diff options
-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, |