Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: build scripts before release #5765

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
test:
strategy:
matrix:
node: [ '0.10', '0.12', '4', '6', '8', '10', '12', '14', '16', latest ]
node: [ '0.10', '0.12', '4', '6', '8', '10', '12', '14', '16', '18' ]
os: [ ubuntu-latest, windows-latest ]
script: [ compress, mocha, release/benchmark, release/jetstream ]
name: ${{ matrix.node }} ${{ matrix.os }} ${{ matrix.script }}
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules/
/npm-debug.log
index.js.map
node_modules/
npm-debug.log
tmp/
7 changes: 5 additions & 2 deletions bin/uglifyjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require("../tools/tty");
var fs = require("fs");
var info = require("../package.json");
var path = require("path");
var UglifyJS = require("../tools/node");
var UglifyJS = require("..");

var skip_keys = [ "cname", "fixed", "in_arg", "inlined", "length_read", "parent_scope", "redef", "scope", "unused" ];
var truthy_keys = [ "optional", "pure", "terminal", "uses_arguments", "uses_eval", "uses_with" ];
mbrevda marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -175,6 +175,9 @@ function process_option(name, no_value) {
case "wrap":
options[name] = read_value(true);
break;
case "no-wrap":
options.wrap = false;
break;
case "verbose":
options.warnings = "verbose";
break;
Expand Down Expand Up @@ -271,7 +274,7 @@ if (typeof options.sourceMap == "object" && "base" in options.sourceMap) {
}
if (specified["self"]) {
if (paths.length) UglifyJS.AST_Node.warn("Ignoring input files since --self was passed");
if (!options.wrap) options.wrap = "UglifyJS";
if (!("wrap" in options)) options.wrap = "UglifyJS";
paths = UglifyJS.FILES;
} else if (paths.length) {
paths = simple_glob(paths);
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("./tools/node");
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@
"Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)"
],
"repository": "mishoo/UglifyJS",
"main": "tools/node.js",
"main": "index.js",
"bin": {
"uglifyjs": "bin/uglifyjs"
},
"files": [
"bin",
"lib",
"tools",
"index.js",
mbrevda marked this conversation as resolved.
Show resolved Hide resolved
"index.js.map",
"tools/tty.js",
"LICENSE"
],
"devDependencies": {
"acorn": "~8.7.1",
"semver": "~6.3.0"
},
"scripts": {
"test": "node test/compress.js && node test/mocha.js"
"test": "node test/compress.js && node test/mocha.js",
"prepack": "node bin/uglifyjs --self --no-wrap --beautify --source-map --output index.js"
},
"keywords": [
"cli",
Expand Down
1 change: 1 addition & 0 deletions test/release/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ npm --version
while !(npm install); do
while !(npm cache clean --force); do echo "'npm cache clean' failed - retrying..."; done
done
npm run prepack