refactor: build scripts before release#5765
Conversation
|
Note that Lines 6 to 11 in f2b6f1d The first one you'll need to include with the |
|
To clarify, the |
|
Pushed the changes - kindly point out if I missed anything! |
|
Please note that edit: one possible solution would be to include an |
sounds good 👍 |
|
Changes pushed |
|
LGTM − let's give those CI tests a spin |
- drop testing on unusable `npm` versions
|
I've fixed a handful of issues, but there are remaining ones. Basically run the following: $ npm pack
> uglify-js@3.17.4 prepack
> node bin/uglifyjs --self --no-wrap --beautify --source-map --output index.js
uglify-js-3.17.4.tgz
$ npm test
<should all passes, but I see 5 mocha test failures>As |
|
I think the tests are (mostly) failing as they expect a CJS module, not a global-poluting iife. Adding Also, do you want the CI tests to be updated to test the built code? That would allow PRs to fail in a case like this PR |
That is due to the wrong (inferred)
Good idea − I think this can be done with UglifyJS/test/release/install.sh Lines 48 to 60 in f2b6f1d |
|
I'm not seeing the tests failing locally after rebasing. I've added the build step to the test setup script - can you kindly approve workflows so that the tests can run? |
|
nm - I see them now. Working on it |
|
Will run the CI tests anyway, since we want to make sure the tests do actually fail here too 😉 |
|
The tests failed alright, but I'm stumped on how to fix them...
|
|
I think these issues are all caused by the bits we are dropping away:
|
|
Ok, so what do you recommend? |
|
So I think after generating the packaged
|
|
Why isn't |
Because the file
|
|
It seems the rest of this PR is better dealt with by someone with greater knowledge of Uglify Internals. Glad to have gotten it this far, and I am looking forward to seeing it merged! |
Fixes #5764: build lib before packing. This utilizes the npm
prepackhook to build the scripts prior to packing:That produces the following tarball: