Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(devs-infra): improve type generation script (#2492)
- Loading branch information
Showing
9 changed files
with
390 additions
and
609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,3 @@ website/src/**/*.js | |
presets/index.d.ts | ||
*.config.js | ||
.eslintrc.js | ||
src/generated-raw-compiler-options.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
const fs = require('fs') | ||
|
||
const { generateRawTsCompilerOptions } = require('./generate-raw-compiler-options') | ||
const { computePackageDigest } = require('./lib/bundle') | ||
const { generatedPath } = require('./lib/paths') | ||
const execa = require('execa') | ||
const { generatedPath, rawCompilerOptionsFileName } = require('./lib/paths') | ||
|
||
void (async () => { | ||
const rawCompilerOptions = await generateRawTsCompilerOptions() | ||
if (rawCompilerOptions !== fs.readFileSync(generatedPath, 'utf-8')) { | ||
throw new Error('Tsconfig options have changed. The generated file should be regenerated') | ||
} | ||
})() | ||
if (execa.sync('git', ['diff-index', '--name-only', 'HEAD']).stdout.includes(rawCompilerOptionsFileName)) { | ||
throw new Error( | ||
`Tsconfig options have changed. Please check the modified generated ${generatedPath} and commit the change` | ||
) | ||
} | ||
|
||
computePackageDigest() |
Oops, something went wrong.