-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): build time improvements (#352)
- Loading branch information
Showing
29 changed files
with
338 additions
and
833 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"env": { | ||
"coreJs": 3 | ||
}, | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": true | ||
} | ||
} | ||
} |
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
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,18 +1,43 @@ | ||
const util = require('util'); | ||
const exec = util.promisify(require('child_process').exec); | ||
|
||
const ignore = [ | ||
'"**/test-utils/**"', | ||
'"**/__acceptance_tests__/**"', | ||
'"**/__screenshot_tests__/**"', | ||
'"**/__tests__/**"', | ||
'"**/__stories__/**"', | ||
'"**/__type_tests__/**"', | ||
] | ||
.flatMap((patter) => ['--ignore', patter]) | ||
.join(' '); | ||
const childProcess = require('child_process'); | ||
const rimraf = require('rimraf'); | ||
const execSync = childProcess.execSync; | ||
const dtsToFlow = require('./dts-to-flow'); | ||
const genSizeStats = require('./size-stats'); | ||
|
||
const run = (command) => { | ||
execSync(command, {stdio: 'inherit'}); | ||
}; | ||
|
||
const compile = () => { | ||
run(`yarn swc src --out-dir dist-es --extensions .tsx`); | ||
|
||
[ | ||
'__tests__', | ||
'__acceptance_tests__', | ||
'__screenshot_tests__', | ||
'__type_tests__', | ||
'__stories__', | ||
'test-utils', | ||
].forEach((dirName) => { | ||
rimraf.sync(`dist-es/${dirName}`); | ||
}); | ||
|
||
run(`yarn swc dist-es --out-dir dist -C module.type=commonjs`); | ||
}; | ||
|
||
(async () => { | ||
await exec(`yarn babel src --extensions .tsx --out-dir dist-es ${ignore}`); | ||
await exec(`yarn babel --plugins @babel/plugin-transform-modules-commonjs dist-es --out-dir dist`); | ||
console.log('\nCompile:'); | ||
compile(); | ||
|
||
console.log('\nGenerate TS defs:'); | ||
run('yarn gen-ts-defs'); | ||
|
||
console.log('\nGenerate Flow defs:'); | ||
await dtsToFlow(); | ||
|
||
console.log('\nFlow check:'); | ||
run('yarn flow check'); | ||
|
||
console.log('\nGenerate size stats:'); | ||
await genSizeStats(); | ||
})(); |
Oops, something went wrong.
a30cd72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for mistica-web ready!
✅ Preview
https://mistica-web-kg89ojl29-tuentisre.vercel.app
Built with commit a30cd72.
This pull request is being automatically deployed with vercel-action