aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yml13
-rwxr-xr-xtest/release/acorn.sh2
-rwxr-xr-xtest/release/bootstrap.sh182
-rwxr-xr-xtest/release/buble.sh2
-rwxr-xr-xtest/release/butternut.sh2
-rwxr-xr-xtest/release/mathjs.sh4
-rwxr-xr-xtest/release/rollup-es.sh2
-rwxr-xr-xtest/release/rollup-ts.sh8
-rwxr-xr-xtest/release/sucrase.sh6
-rwxr-xr-xtest/release/web-tooling-benchmark.sh2
10 files changed, 209 insertions, 14 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 5522cd30..ed6c2891 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -9,11 +9,22 @@ jobs:
fail-fast: false
matrix:
options: [ '-mb braces', '--ie8 -c', '-mc', '--toplevel -mc passes=3,pure_getters,unsafe' ]
- script: [ acorn.sh, buble.sh, butternut.sh, mathjs.sh, rollup-es.sh, rollup-ts.sh, sucrase.sh, web-tooling-benchmark.sh ]
+ script:
+ - acorn.sh
+ - bootstrap.sh
+ - buble.sh
+ - butternut.sh
+ - mathjs.sh
+ - rollup-es.sh
+ - rollup-ts.sh
+ - sucrase.sh
+ - web-tooling-benchmark.sh
include:
- node: '14'
script: acorn.sh
- node: '14'
+ script: bootstrap.sh
+ - node: '14'
script: buble.sh
- node: '14'
script: butternut.sh
diff --git a/test/release/acorn.sh b/test/release/acorn.sh
index 1adaa9c1..f6fdb6a7 100755
--- a/test/release/acorn.sh
+++ b/test/release/acorn.sh
@@ -7,7 +7,7 @@ minify_in_situ() {
ARGS="$UGLIFY_OPTIONS --validate --in-situ"
DIRS="$1"
echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
- for i in `find $DIRS -name '*.js'`
+ for i in `find $DIRS -type f -name '*.js'`
do
ARGS="$ARGS $i"
done
diff --git a/test/release/bootstrap.sh b/test/release/bootstrap.sh
new file mode 100755
index 00000000..32c77f46
--- /dev/null
+++ b/test/release/bootstrap.sh
@@ -0,0 +1,182 @@
+#!/bin/sh
+
+alias uglify-js=$PWD/bin/uglifyjs
+UGLIFY_OPTIONS=$@
+
+minify_in_situ() {
+ ARGS="$UGLIFY_OPTIONS --validate --in-situ"
+ DIRS="$1"
+ echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
+ for i in `find $DIRS -type f -name '*.js'`
+ do
+ ARGS="$ARGS $i"
+ done
+ uglify-js $ARGS
+}
+
+rm -rf tmp/bootstrap \
+&& git clone --depth 1 --branch v5.0.0-beta2 https://github.com/twbs/bootstrap.git tmp/bootstrap \
+&& cd tmp/bootstrap \
+&& rm -rf .git/hooks \
+&& patch -p1 <<EOF
+--- a/.babelrc.js
++++ /dev/null
+@@ -1,12 +0,0 @@
+-module.exports = {
+- presets: [
+- [
+- '@babel/preset-env',
+- {
+- loose: true,
+- bugfixes: true,
+- modules: false
+- }
+- ]
+- ]
+-};
+--- a/.gitattributes
++++ b/.gitattributes
+@@ -5,0 +6 @@
++*.png binary
+--- a/build/build-plugins.js
++++ b/build/build-plugins.js
+@@ -14 +13,0 @@ const rollup = require('rollup')
+-const { babel } = require('@rollup/plugin-babel')
+@@ -19,6 +17,0 @@ const plugins = [
+- babel({
+- // Only transpile our source code
+- exclude: 'node_modules/**',
+- // Include the helpers in each file, at most one copy of each
+- babelHelpers: 'bundled'
+- })
+--- a/build/rollup.config.js
++++ b/build/rollup.config.js
+@@ -4 +3,0 @@ const path = require('path')
+-const { babel } = require('@rollup/plugin-babel')
+@@ -15,6 +13,0 @@ const plugins = [
+- babel({
+- // Only transpile our source code
+- exclude: 'node_modules/**',
+- // Include the helpers in the bundle, at most one copy of each
+- babelHelpers: 'bundled'
+- })
+--- a/js/tests/integration/rollup.bundle.js
++++ b/js/tests/integration/rollup.bundle.js
+@@ -3 +2,0 @@
+-const { babel } = require('@rollup/plugin-babel')
+@@ -18,4 +16,0 @@ module.exports = {
+- babel({
+- exclude: 'node_modules/**',
+- babelHelpers: 'bundled'
+- })
+--- a/js/tests/karma.conf.js
++++ b/js/tests/karma.conf.js
+@@ -7,2 +6,0 @@ const ip = require('ip')
+-const { babel } = require('@rollup/plugin-babel')
+-const istanbul = require('rollup-plugin-istanbul')
+@@ -84,13 +81,0 @@ const conf = {
+- istanbul({
+- exclude: [
+- 'node_modules/**',
+- 'js/tests/unit/**/*.spec.js',
+- 'js/tests/helpers/**/*.js'
+- ]
+- }),
+- babel({
+- // Only transpile our source code
+- exclude: 'node_modules/**',
+- // Inline the required helpers in each file
+- babelHelpers: 'inline'
+- }),
+@@ -142 +126,0 @@ if (BROWSERSTACK) {
+- 'karma-coverage-istanbul-reporter'
+@@ -144 +127,0 @@ if (BROWSERSTACK) {
+- reporters.push('coverage-istanbul')
+--- a/package.json
++++ b/package.json
+@@ -23 +23 @@
+- "start": "npm-run-all --parallel watch docs-serve",
++ "start": "npm-run-all --parallel watch",
+@@ -28,3 +27,0 @@
+- "css-lint": "npm-run-all --continue-on-error --parallel css-lint-*",
+- "css-lint-stylelint": "stylelint \"**/*.{css,scss}\" --cache --cache-location .cache/.stylelintcache --rd",
+- "css-lint-vars": "fusv scss/ site/assets/scss/",
+@@ -44 +40,0 @@
+- "js-lint": "eslint --cache --cache-location .cache/.eslintcache --report-unused-disable-directives .",
+@@ -46,3 +42,3 @@
+- "js-minify-standalone": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.js.map,includeSources,url=bootstrap.min.js.map\" --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
+- "js-minify-standalone-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.esm.js.map,includeSources,url=bootstrap.esm.min.js.map\" --output dist/js/bootstrap.esm.min.js dist/js/bootstrap.esm.js",
+- "js-minify-bundle": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.bundle.js.map,includeSources,url=bootstrap.bundle.min.js.map\" --output dist/js/bootstrap.bundle.min.js dist/js/bootstrap.bundle.js",
++ "js-minify-standalone": "../../bin/uglifyjs --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.js.map,includeSources,url=bootstrap.min.js.map\" --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
++ "js-minify-standalone-esm": "../../bin/uglifyjs --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.esm.js.map,includeSources,url=bootstrap.esm.min.js.map\" --output dist/js/bootstrap.esm.min.js dist/js/bootstrap.esm.js",
++ "js-minify-bundle": "../../bin/uglifyjs --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.bundle.js.map,includeSources,url=bootstrap.bundle.min.js.map\" --output dist/js/bootstrap.bundle.min.js dist/js/bootstrap.bundle.js",
+@@ -56,25 +52 @@
+- "lint": "npm-run-all --parallel js-lint css-lint lockfile-lint",
+- "docs": "npm-run-all docs-build docs-lint",
+- "docs-build": "hugo --cleanDestinationDir",
+- "docs-compile": "npm run docs-build",
+- "docs-linkinator": "linkinator _gh_pages --recurse --silent --skip \"^(?!http://localhost)\"",
+- "docs-vnu": "node build/vnu-jar.js",
+- "docs-lint": "npm-run-all --parallel docs-vnu docs-linkinator",
+- "docs-serve": "hugo server --port 9001 --disableFastRender",
+- "docs-serve-only": "npx sirv-cli _gh_pages --port 9001",
+- "lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json",
+- "update-deps": "ncu -u -x karma-browserstack-launcher,terser && npm update && echo Manually update site/assets/js/vendor",
+- "release": "npm-run-all dist release-sri docs-build release-zip*",
+- "release-sri": "node build/generate-sri.js",
+- "release-version": "node build/change-version.js",
+- "release-zip": "cross-env-shell \"rm -rf bootstrap-\$npm_package_version-dist && cp -r dist/ bootstrap-\$npm_package_version-dist && zip -r9 bootstrap-\$npm_package_version-dist.zip bootstrap-\$npm_package_version-dist && rm -rf bootstrap-\$npm_package_version-dist\"",
+- "release-zip-examples": "node build/zip-examples.js",
+- "dist": "npm-run-all --parallel css js",
+- "test": "npm-run-all lint dist js-test docs-build docs-lint",
+- "netlify": "cross-env-shell HUGO_BASEURL=\$DEPLOY_PRIME_URL npm-run-all dist release-sri docs-build",
+- "watch": "npm-run-all --parallel watch-*",
+- "watch-css-main": "nodemon --watch scss/ --ext scss --exec \"npm-run-all css-lint css-compile css-prefix\"",
+- "watch-css-dist": "nodemon --watch dist/css/ --ext css --ignore \"dist/css/*.rtl.*\" --exec \"npm run css-rtl\"",
+- "watch-css-docs": "nodemon --watch site/assets/scss/ --ext scss --exec \"npm run css-lint\"",
+- "watch-js-main": "nodemon --watch js/src/ --ext js --exec \"npm-run-all js-lint js-compile\"",
+- "watch-js-docs": "nodemon --watch site/assets/js/ --ext js --exec \"npm run js-lint\""
++ "dist": "npm run css && npm run js"
+@@ -103,3 +74,0 @@
+- "@babel/cli": "^7.12.13",
+- "@babel/core": "^7.12.13",
+- "@babel/preset-env": "^7.12.13",
+@@ -107 +75,0 @@
+- "@rollup/plugin-babel": "^5.2.3",
+@@ -115,4 +82,0 @@
+- "eslint": "^7.19.0",
+- "eslint-config-xo": "^0.34.0",
+- "eslint-plugin-import": "^2.22.1",
+- "eslint-plugin-unicorn": "^27.0.0",
+@@ -122 +85,0 @@
+- "hugo-bin": "^0.68.0",
+@@ -128 +90,0 @@
+- "karma-coverage-istanbul-reporter": "^3.0.3",
+@@ -134,2 +95,0 @@
+- "linkinator": "^2.13.4",
+- "lockfile-lint": "^4.3.7",
+@@ -141 +100,0 @@
+- "rollup-plugin-istanbul": "^3.0.0",
+@@ -144,5 +103 @@
+- "shelljs": "^0.8.4",
+- "stylelint": "^13.9.0",
+- "stylelint-config-twbs-bootstrap": "^2.1.0",
+- "terser": "5.1.0",
+- "vnu-jar": "21.2.5"
++ "shelljs": "^0.8.4"
+@@ -155,3 +109,0 @@
+- "hugo-bin": {
+- "buildTags": "extended"
+- },
+EOF
+ERR=$?; if [ "$ERR" != "0" ]; then echo "Error: $ERR"; exit $ERR; fi
+rm -rf node_modules \
+&& npm ci \
+&& minify_in_situ "node_modules/@popperjs/core" \
+&& rm -rf dist/js/* \
+&& minify_in_situ "build" \
+&& minify_in_situ "js" \
+&& minify_in_situ "site" \
+&& npm run dist \
+&& minify_in_situ "dist" \
+&& npm run js-test
diff --git a/test/release/buble.sh b/test/release/buble.sh
index 4bcec662..d997b0f1 100755
--- a/test/release/buble.sh
+++ b/test/release/buble.sh
@@ -7,7 +7,7 @@ minify_in_situ() {
ARGS="$UGLIFY_OPTIONS --validate --in-situ"
DIRS="$1"
echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
- for i in `find $DIRS -name '*.js'`
+ for i in `find $DIRS -type f -name '*.js'`
do
ARGS="$ARGS $i"
done
diff --git a/test/release/butternut.sh b/test/release/butternut.sh
index 8e1ef71b..bb79a299 100755
--- a/test/release/butternut.sh
+++ b/test/release/butternut.sh
@@ -7,7 +7,7 @@ minify_in_situ() {
ARGS="$UGLIFY_OPTIONS --validate --in-situ"
DIRS="$1"
echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
- for i in `find $DIRS -name '*.js'`
+ for i in `find $DIRS -type f -name '*.js'`
do
ARGS="$ARGS $i"
done
diff --git a/test/release/mathjs.sh b/test/release/mathjs.sh
index e245db53..5779ad26 100755
--- a/test/release/mathjs.sh
+++ b/test/release/mathjs.sh
@@ -7,11 +7,11 @@ minify_in_situ() {
ARGS="$UGLIFY_OPTIONS --validate --in-situ"
DIRS="$1"
echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
- for i in `find $DIRS -name '*.js'`
+ for i in `find $DIRS -type f -name '*.js'`
do
ARGS="$ARGS $i"
done
- for i in `find $DIRS -name '*.mjs'`
+ for i in `find $DIRS -type f -name '*.mjs'`
do
ARGS="$ARGS $i"
done
diff --git a/test/release/rollup-es.sh b/test/release/rollup-es.sh
index 3ff8b702..b38661bf 100755
--- a/test/release/rollup-es.sh
+++ b/test/release/rollup-es.sh
@@ -7,7 +7,7 @@ minify_in_situ() {
ARGS="$UGLIFY_OPTIONS --validate --in-situ"
DIRS="$1"
echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
- for i in `find $DIRS -name '*.js'`
+ for i in `find $DIRS -type f -name '*.js'`
do
ARGS="$ARGS $i"
done
diff --git a/test/release/rollup-ts.sh b/test/release/rollup-ts.sh
index d3c078fb..c80e4d18 100755
--- a/test/release/rollup-ts.sh
+++ b/test/release/rollup-ts.sh
@@ -7,12 +7,12 @@ minify_in_situ() {
ARGS="$UGLIFY_OPTIONS --validate --in-situ"
DIRS="$1"
echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
- for i in `find $DIRS -name '*.js'`
+ for i in `find $DIRS -type f -name '*.js'`
do
ARGS="$ARGS $i"
done
uglify-js $ARGS
- for i in `find $DIRS -name '*.ts' | grep -v '\.d\.ts'`
+ for i in `find $DIRS -type f -name '*.ts' | grep -v '\.d\.ts'`
do
echo "$i"
node_modules/.bin/esbuild --loader=ts --target=node14 < "$i" \
@@ -34,8 +34,10 @@ rm -rf tmp/rollup \
- "prepublishOnly": "pinst --disable && npm ci && npm run lint:nofix && npm run security && npm run build:bootstrap && npm run test:all",
--- a/test/cli/index.js
+++ b/test/cli/index.js
-@@ -13,0 +14 @@ sander.rimrafSync(__dirname, 'node_modules');
+@@ -13,0 +14,3 @@ sander.rimrafSync(__dirname, 'node_modules');
++sander.rimrafSync(__dirname, 'samples', 'watch', 'bundle-error');
+sander.rimrafSync(__dirname, 'samples', 'watch', 'watch-config-error');
++sander.rimrafSync(__dirname, 'samples', 'watch', 'watch-config-initial-error');
EOF
ERR=$?; if [ "$ERR" != "0" ]; then echo "Error: $ERR"; exit $ERR; fi
npm install esbuild-wasm@0.8.56 \
diff --git a/test/release/sucrase.sh b/test/release/sucrase.sh
index 0576c167..c293f3c8 100755
--- a/test/release/sucrase.sh
+++ b/test/release/sucrase.sh
@@ -7,16 +7,16 @@ minify_in_situ() {
ARGS="$UGLIFY_OPTIONS --validate --in-situ"
DIRS="$1"
echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
- for i in `find $DIRS -name '*.js'`
+ for i in `find $DIRS -type f -name '*.js'`
do
ARGS="$ARGS $i"
done
- for i in `find $DIRS -name '*.mjs'`
+ for i in `find $DIRS -type f -name '*.mjs'`
do
ARGS="$ARGS $i"
done
uglify-js $ARGS
- for i in `find $DIRS -name '*.ts' | grep -v '\.d\.ts'`
+ for i in `find $DIRS -type f -name '*.ts' | grep -v '\.d\.ts'`
do
echo "$i"
node_modules/.bin/esbuild --loader=ts --target=node14 < "$i" \
diff --git a/test/release/web-tooling-benchmark.sh b/test/release/web-tooling-benchmark.sh
index cf089dbc..d7218d38 100755
--- a/test/release/web-tooling-benchmark.sh
+++ b/test/release/web-tooling-benchmark.sh
@@ -7,7 +7,7 @@ minify_in_situ() {
ARGS="$UGLIFY_OPTIONS --validate --in-situ"
DIRS="$1"
echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
- for i in `find $DIRS -name '*.js'`
+ for i in `find $DIRS -type f -name '*.js'`
do
ARGS="$ARGS $i"
done