From 21d68e68039a1eefbe6213fbde46e737e520ee7d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 28 Dec 2021 10:25:30 +0100 Subject: [PATCH] Add version to generate types packages --- packages/types/generate-package.ts | 10 +++++++++- scripts/ci.sh | 2 +- server/tests/api/notifications/user-notifications.ts | 2 +- support/doc/development/lib.md | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/types/generate-package.ts b/packages/types/generate-package.ts index 0c14514e7..853989d68 100644 --- a/packages/types/generate-package.ts +++ b/packages/types/generate-package.ts @@ -4,6 +4,14 @@ import { copyFile, readJson, remove, writeFile, writeJSON } from 'fs-extra' import { resolve } from 'path' import { cwd } from 'process' +if (!process.argv[2]) { + console.error('Need version as argument') + process.exit(-1) +} + +const version = process.argv[2] +console.log('Will generate package version %s.', version) + run() .then(() => process.exit(0)) .catch(err => { @@ -52,7 +60,7 @@ async function run () { return dependencies }, {}) - const { description, version, licence, engines, author, repository } = mainPackageJson + const { description, licence, engines, author, repository } = mainPackageJson const typesPackageJson = { name: '@peertube/peertube-types', description, diff --git a/scripts/ci.sh b/scripts/ci.sh index 5b757d94b..b0b76ca99 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -41,7 +41,7 @@ findTestFiles () { } if [ "$1" = "types-package" ]; then - npm run generate-types-package + npm run generate-types-package 0.0.0 npm run tsc -- --noEmit --esModuleInterop packages/types/tests/test.ts elif [ "$1" = "client" ]; then npm run build diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts index bb3024617..0bd474c09 100644 --- a/server/tests/api/notifications/user-notifications.ts +++ b/server/tests/api/notifications/user-notifications.ts @@ -125,7 +125,7 @@ describe('Test user notifications', function () { }) it('Should not send a notification before the video is published', async function () { - this.timeout(50000) + this.timeout(150000) const updateAt = new Date(new Date().getTime() + 1000000) diff --git a/support/doc/development/lib.md b/support/doc/development/lib.md index 0c77cff56..c43edbacc 100644 --- a/support/doc/development/lib.md +++ b/support/doc/development/lib.md @@ -17,8 +17,8 @@ Typescript definition files generation is controlled by the various `tsconfig.ty The complete types package is generated via: ``` -$ npm run generate-types-package -$ cd types/dist +$ npm run generate-types-package 4.x.x +$ cd packages/types/dist $ npm publish --access=public ``` -- 2.41.0