Add version to generate types packages

pull/4696/head
Chocobozzz 2021-12-28 10:25:30 +01:00
parent 6627dbc957
commit 21d68e6803
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 13 additions and 5 deletions

View File

@ -4,6 +4,14 @@ import { copyFile, readJson, remove, writeFile, writeJSON } from 'fs-extra'
import { resolve } from 'path' import { resolve } from 'path'
import { cwd } from 'process' 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() run()
.then(() => process.exit(0)) .then(() => process.exit(0))
.catch(err => { .catch(err => {
@ -52,7 +60,7 @@ async function run () {
return dependencies return dependencies
}, {}) }, {})
const { description, version, licence, engines, author, repository } = mainPackageJson const { description, licence, engines, author, repository } = mainPackageJson
const typesPackageJson = { const typesPackageJson = {
name: '@peertube/peertube-types', name: '@peertube/peertube-types',
description, description,

View File

@ -41,7 +41,7 @@ findTestFiles () {
} }
if [ "$1" = "types-package" ]; then 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 npm run tsc -- --noEmit --esModuleInterop packages/types/tests/test.ts
elif [ "$1" = "client" ]; then elif [ "$1" = "client" ]; then
npm run build npm run build

View File

@ -125,7 +125,7 @@ describe('Test user notifications', function () {
}) })
it('Should not send a notification before the video is published', async 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) const updateAt = new Date(new Date().getTime() + 1000000)

View File

@ -17,8 +17,8 @@ Typescript definition files generation is controlled by the various `tsconfig.ty
The complete types package is generated via: The complete types package is generated via:
``` ```
$ npm run generate-types-package $ npm run generate-types-package 4.x.x
$ cd types/dist $ cd packages/types/dist
$ npm publish --access=public $ npm publish --access=public
``` ```