Build: Ensure make build will build Babel parser typings#17808
Build: Ensure make build will build Babel parser typings#17808JLHwung merged 10 commits intobabel:mainfrom
make build will build Babel parser typings#17808Conversation
|
commit: |
7aa3549 to
bfbf076
Compare
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60983 |
Split bundle-dts into bundle-babel-parser-dts and bundle-babel-packages-dts. Added bundle-babel-parser-dts task to the make watch
bfbf076 to
c1acae0
Compare
| target["build-no-bundle"] = function () { | ||
| target["clean"](); | ||
| target["clean-lib"](); | ||
| target["bundle-babel-parser-dts"](); |
There was a problem hiding this comment.
Will a type error interrupt the build?
I'm a little worried that this will slow down build-no-bundle.
There was a problem hiding this comment.
Yes, if there is a typing error within Babel parser, the build will stop, because the typings.d.ts can not be built.
The tsc probably has its own cache, if cache is hit, this step will take around 1 second on my machine.
If we use GNU make, we can easily parallelize bundle-babel-parser-dts and gulp build dev, but that ship has long sailed...
There was a problem hiding this comment.
Perhaps in the future we can also generate the parser's dts into lib, just like other dts.
make builddoes not build Babel parser typingspackages/babel-parser/typings/babel-parser.d.ts.Currently, the file
packages/babel-parser/typings/babel-parser.d.tscan only be built bymake prepublish-prepare-dts. This is very confusing as contributors are not supposed to run a prepublish task in order to properly update a source file.The current banner of the Babel parser typing file mentions that
This tip is not quite helpful as it should have been, as the
dtsfiles may be also outdated, which can only be updated bytsc.In this PR we create a new makefile task for the babel-parser typings. This task will also be invoked from
make buildormake build-bundle. Hopefully we will be much less annoyed by the babel-parser typing update error thrown from the CI.Aside: Now that
Gulpfile.mtshas been renamed toGulpfile.tsrecently, thets-node/registerwas invoked by theinterpretthatGulpuses to support various config file format, I have removed the ts hooks so that we can unleash the native TS support.