aboutsummaryrefslogtreecommitdiffhomepage
path: root/types/generate-package.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-16 18:03:52 +0100
committerChocobozzz <me@florianbigard.com>2021-12-16 18:03:52 +0100
commit077f344891b3f4b00a8a4f8d700306d4392b3a2f (patch)
tree686ae3031bd3ae0314a61b36da6be22a414d1035 /types/generate-package.ts
parent9d1b826b8afab8e04f081b6f0875462bf57da4c9 (diff)
downloadPeerTube-077f344891b3f4b00a8a4f8d700306d4392b3a2f.tar.gz
PeerTube-077f344891b3f4b00a8a4f8d700306d4392b3a2f.tar.zst
PeerTube-077f344891b3f4b00a8a4f8d700306d4392b3a2f.zip
Cleanup types dist before compilation
Diffstat (limited to 'types/generate-package.ts')
-rw-r--r--types/generate-package.ts11
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 @@
1import { copyFile, readJson, writeFile, writeJSON } from 'fs-extra'
2import { resolve } from 'path'
3import { cwd } from 'process'
4import { execSync } from 'child_process' 1import { execSync } from 'child_process'
5import depcheck, { PackageDependencies } from 'depcheck' 2import depcheck, { PackageDependencies } from 'depcheck'
3import { copyFile, readJson, remove, writeFile, writeJSON } from 'fs-extra'
4import { resolve } from 'path'
5import { cwd } from 'process'
6 6
7run() 7run()
8 .then(() => process.exit(0)) 8 .then(() => process.exit(0))
@@ -12,8 +12,6 @@ run()
12 }) 12 })
13 13
14async function run () { 14async 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,