X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=types%2Fgenerate-package.ts;h=a4f049a31ae7a01c22dac1846770ede20b5596da;hb=d17c7b4e8c52317bdc874917387b7a49f6cf8b01;hp=e20e9b624f66d57ec8251894a25cc3f01bdebc33;hpb=41e5b788d9890a5bcb562e36f5a89a843d1e50fd;p=github%2FChocobozzz%2FPeerTube.git diff --git a/types/generate-package.ts b/types/generate-package.ts index e20e9b624..a4f049a31 100644 --- a/types/generate-package.ts +++ b/types/generate-package.ts @@ -1,8 +1,8 @@ -import { copyFile, readJson, writeFile, writeJSON } from 'fs-extra' -import { resolve } from 'path' -import { cwd } from 'process' import { execSync } from 'child_process' import depcheck, { PackageDependencies } from 'depcheck' +import { copyFile, readJson, remove, writeFile, writeJSON } from 'fs-extra' +import { resolve } from 'path' +import { cwd } from 'process' run() .then(() => process.exit(0)) @@ -12,8 +12,6 @@ run() }) async function run () { - execSync('npm run tsc -- -b --verbose types', { stdio: 'inherit' }) - const typesPath = resolve(cwd(), './types/') const typesDistPath = resolve(cwd(), typesPath, './dist/') const typesDistPackageJsonPath = resolve(typesDistPath, './package.json') @@ -23,6 +21,9 @@ async function run () { const distTsConfig = await readJson(distTsConfigPath) const clientPackageJson = await readJson(resolve(cwd(), './client/package.json')) + await remove(typesDistPath) + execSync('npm run tsc -- -b --verbose types', { stdio: 'inherit' }) + const allDependencies = Object.assign( mainPackageJson.dependencies, mainPackageJson.devDepencies,