1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
#!/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
}
npm_install() {
PKG="$1"
while !(npm install $PKG); do
while !(npm cache clean --force); do echo "'npm cache clean' failed - retrying..."; done
done
}
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_install \
&& 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
|