diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-16 18:03:52 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-16 18:03:52 +0100 |
commit | 077f344891b3f4b00a8a4f8d700306d4392b3a2f (patch) | |
tree | 686ae3031bd3ae0314a61b36da6be22a414d1035 | |
parent | 9d1b826b8afab8e04f081b6f0875462bf57da4c9 (diff) | |
download | PeerTube-077f344891b3f4b00a8a4f8d700306d4392b3a2f.tar.gz PeerTube-077f344891b3f4b00a8a4f8d700306d4392b3a2f.tar.zst PeerTube-077f344891b3f4b00a8a4f8d700306d4392b3a2f.zip |
Cleanup types dist before compilation
-rw-r--r-- | types/generate-package.ts | 11 |
1 files changed, 6 insertions, 5 deletions
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 @@ | |||
1 | import { copyFile, readJson, writeFile, writeJSON } from 'fs-extra' | ||
2 | import { resolve } from 'path' | ||
3 | import { cwd } from 'process' | ||
4 | import { execSync } from 'child_process' | 1 | import { execSync } from 'child_process' |
5 | import depcheck, { PackageDependencies } from 'depcheck' | 2 | import depcheck, { PackageDependencies } from 'depcheck' |
3 | import { copyFile, readJson, remove, writeFile, writeJSON } from 'fs-extra' | ||
4 | import { resolve } from 'path' | ||
5 | import { cwd } from 'process' | ||
6 | 6 | ||
7 | run() | 7 | run() |
8 | .then(() => process.exit(0)) | 8 | .then(() => process.exit(0)) |
@@ -12,8 +12,6 @@ run() | |||
12 | }) | 12 | }) |
13 | 13 | ||
14 | async function run () { | 14 | async function run () { |
15 | execSync('npm run tsc -- -b --verbose types', { stdio: 'inherit' }) | ||
16 | |||
17 | const typesPath = resolve(cwd(), './types/') | 15 | const typesPath = resolve(cwd(), './types/') |
18 | const typesDistPath = resolve(cwd(), typesPath, './dist/') | 16 | const typesDistPath = resolve(cwd(), typesPath, './dist/') |
19 | const typesDistPackageJsonPath = resolve(typesDistPath, './package.json') | 17 | const typesDistPackageJsonPath = resolve(typesDistPath, './package.json') |
@@ -23,6 +21,9 @@ async function run () { | |||
23 | const distTsConfig = await readJson(distTsConfigPath) | 21 | const distTsConfig = await readJson(distTsConfigPath) |
24 | const clientPackageJson = await readJson(resolve(cwd(), './client/package.json')) | 22 | const clientPackageJson = await readJson(resolve(cwd(), './client/package.json')) |
25 | 23 | ||
24 | await remove(typesDistPath) | ||
25 | execSync('npm run tsc -- -b --verbose types', { stdio: 'inherit' }) | ||
26 | |||
26 | const allDependencies = Object.assign( | 27 | const allDependencies = Object.assign( |
27 | mainPackageJson.dependencies, | 28 | mainPackageJson.dependencies, |
28 | mainPackageJson.devDepencies, | 29 | mainPackageJson.devDepencies, |