balm-core 3.35.1 → 3.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/balm.js +11 -14
- package/lib/bootstrap/index.js +3 -3
- package/lib/bundler/esbuild/transform.js +38 -38
- package/lib/bundler/rollup/build.js +10 -10
- package/lib/bundler/rollup/index.js +38 -38
- package/lib/bundler/webpack/config/common.js +3 -3
- package/lib/hooks/index.js +7 -10
- package/lib/hooks/maker.js +1 -2
- package/lib/plugins/imagemin.js +12 -12
- package/lib/plugins/jsmin.js +18 -18
- package/lib/plugins/sass.js +4 -4
- package/lib/tasks/default.js +6 -8
- package/lib/tasks/foundation/balm.js +1 -2
- package/lib/tasks/foundation/balm_style.js +6 -8
- package/lib/tasks/private/build.js +6 -8
- package/lib/tasks/private/cache.js +6 -8
- package/lib/tasks/private/clean.js +23 -28
- package/lib/tasks/private/end.js +13 -16
- package/lib/tasks/private/extra.js +9 -11
- package/lib/tasks/private/font.js +6 -8
- package/lib/tasks/private/image.js +12 -14
- package/lib/tasks/private/lint.js +6 -8
- package/lib/tasks/private/media.js +6 -8
- package/lib/tasks/private/modernizr.js +44 -54
- package/lib/tasks/private/pwa-cache.js +7 -10
- package/lib/tasks/private/script.js +6 -8
- package/lib/tasks/private/sprite.js +49 -57
- package/lib/tasks/private/start.js +12 -14
- package/lib/tasks/private/style.js +6 -8
- package/lib/tasks/private/workbox-sw.js +6 -8
- package/lib/tasks/public/copy.js +6 -8
- package/lib/tasks/public/esbuild.js +6 -8
- package/lib/tasks/public/ftp.js +6 -8
- package/lib/tasks/public/html.js +30 -38
- package/lib/tasks/public/jsmin.js +6 -8
- package/lib/tasks/public/less.js +6 -8
- package/lib/tasks/public/postcss.js +6 -8
- package/lib/tasks/public/publish.js +20 -25
- package/lib/tasks/public/pwa.js +23 -25
- package/lib/tasks/public/remove.js +27 -32
- package/lib/tasks/public/replace.js +6 -8
- package/lib/tasks/public/rollup.js +11 -13
- package/lib/tasks/public/sass.js +6 -8
- package/lib/tasks/public/server.js +41 -49
- package/lib/tasks/public/url.js +22 -27
- package/lib/tasks/public/version.js +6 -8
- package/lib/tasks/public/webpack.js +6 -8
- package/lib/tasks/public/zip.js +6 -8
- package/lib/utilities/compiling.js +10 -13
- package/lib/utilities/file.js +4 -5
- package/lib/utilities/loading.js +14 -23
- package/lib/utilities/logger.js +18 -21
- package/package.json +15 -15
- package/tslib/bootstrap/index.js +2 -3
- package/tslib/bundler/esbuild/transform.js +17 -22
- package/tslib/bundler/rollup/index.js +3 -8
- package/tslib/bundler/rollup/plugins.js +2 -3
- package/tslib/bundler/webpack/index.js +2 -2
- package/tslib/plugins/plumber.js +1 -2
package/lib/utilities/logger.js
CHANGED
|
@@ -7,12 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _classPrivateFieldGet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldGet"));
|
|
11
10
|
var _util = _interopRequireDefault(require("util"));
|
|
12
11
|
var _fancyLog = _interopRequireDefault(require("fancy-log"));
|
|
13
12
|
var _color = _interopRequireDefault(require("./color"));
|
|
14
|
-
function _classPrivateFieldInitSpec(
|
|
15
|
-
function _checkPrivateRedeclaration(
|
|
13
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
14
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
15
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
16
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
16
17
|
var LOG = {
|
|
17
18
|
FORMAT: '%s %s %s',
|
|
18
19
|
PREFIX: (0, _color["default"])('BalmJS', {
|
|
@@ -52,20 +53,17 @@ var _log = /*#__PURE__*/new WeakMap();
|
|
|
52
53
|
var Logger = /*#__PURE__*/function () {
|
|
53
54
|
function Logger() {
|
|
54
55
|
(0, _classCallCheck2["default"])(this, Logger);
|
|
55
|
-
_classPrivateFieldInitSpec(this, _log, {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, BalmJS.config.logs.formatOptions);
|
|
64
|
-
return pre ? _util["default"].inspect(obj, options) : obj;
|
|
65
|
-
}
|
|
56
|
+
_classPrivateFieldInitSpec(this, _log, function (obj) {
|
|
57
|
+
var pre = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
58
|
+
var options = Object.assign({
|
|
59
|
+
showHidden: false,
|
|
60
|
+
depth: 2,
|
|
61
|
+
colors: true
|
|
62
|
+
}, BalmJS.config.logs.formatOptions);
|
|
63
|
+
return pre ? _util["default"].inspect(obj, options) : obj;
|
|
66
64
|
});
|
|
67
65
|
}
|
|
68
|
-
(0, _createClass2["default"])(Logger, [{
|
|
66
|
+
return (0, _createClass2["default"])(Logger, [{
|
|
69
67
|
key: "success",
|
|
70
68
|
value: function success(label, message) {
|
|
71
69
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -74,7 +72,7 @@ var Logger = /*#__PURE__*/function () {
|
|
|
74
72
|
}, options);
|
|
75
73
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
76
74
|
console.log(LOG.beginning);
|
|
77
|
-
(0, _fancyLog["default"])(LOG.FORMAT, LOG.PREFIX, (0, _color["default"])("<".concat(label, ">"), LOG.OK), (
|
|
75
|
+
(0, _fancyLog["default"])(LOG.FORMAT, LOG.PREFIX, (0, _color["default"])("<".concat(label, ">"), LOG.OK), _classPrivateFieldGet(_log, this).call(this, message, logOptions.pre));
|
|
78
76
|
console.log(LOG.end);
|
|
79
77
|
}
|
|
80
78
|
}
|
|
@@ -86,7 +84,7 @@ var Logger = /*#__PURE__*/function () {
|
|
|
86
84
|
logLevel: BalmJS.LogLevel.Debug
|
|
87
85
|
}, options);
|
|
88
86
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
89
|
-
_fancyLog["default"].info(LOG.FORMAT, LOG.PREFIX, (0, _color["default"])("<".concat(label, ">"), LOG.DEBUG), (
|
|
87
|
+
_fancyLog["default"].info(LOG.FORMAT, LOG.PREFIX, (0, _color["default"])("<".concat(label, ">"), LOG.DEBUG), _classPrivateFieldGet(_log, this).call(this, message, logOptions.pre));
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
90
|
}, {
|
|
@@ -97,7 +95,7 @@ var Logger = /*#__PURE__*/function () {
|
|
|
97
95
|
logLevel: BalmJS.LogLevel.Info
|
|
98
96
|
}, options);
|
|
99
97
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
100
|
-
_fancyLog["default"].info(LOG.FORMAT, LOG.PREFIX, (0, _color["default"])("<".concat(label, ">"), LOG.INFO), (
|
|
98
|
+
_fancyLog["default"].info(LOG.FORMAT, LOG.PREFIX, (0, _color["default"])("<".concat(label, ">"), LOG.INFO), _classPrivateFieldGet(_log, this).call(this, message, logOptions.pre));
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
101
|
}, {
|
|
@@ -108,7 +106,7 @@ var Logger = /*#__PURE__*/function () {
|
|
|
108
106
|
logLevel: BalmJS.LogLevel.Warn
|
|
109
107
|
}, options);
|
|
110
108
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
111
|
-
_fancyLog["default"].warn(LOG.FORMAT, LOG.PREFIX, (0, _color["default"])("<".concat(label, ">"), LOG.WARN), (
|
|
109
|
+
_fancyLog["default"].warn(LOG.FORMAT, LOG.PREFIX, (0, _color["default"])("<".concat(label, ">"), LOG.WARN), _classPrivateFieldGet(_log, this).call(this, message, logOptions.pre));
|
|
112
110
|
}
|
|
113
111
|
}
|
|
114
112
|
}, {
|
|
@@ -120,10 +118,9 @@ var Logger = /*#__PURE__*/function () {
|
|
|
120
118
|
pre: false
|
|
121
119
|
}, options);
|
|
122
120
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
123
|
-
_fancyLog["default"].error(LOG.FORMAT, LOG.PREFIX, (0, _color["default"])("<".concat(label, ">"), LOG.ERROR), (
|
|
121
|
+
_fancyLog["default"].error(LOG.FORMAT, LOG.PREFIX, (0, _color["default"])("<".concat(label, ">"), LOG.ERROR), _classPrivateFieldGet(_log, this).call(this, message, logOptions.pre));
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
124
|
}]);
|
|
127
|
-
return Logger;
|
|
128
125
|
}();
|
|
129
126
|
var _default = exports["default"] = new Logger();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balm-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.37.0",
|
|
4
4
|
"description": "BalmJS compiler core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"balm",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"ansi-colors": "^4.1.3",
|
|
44
|
-
"async": "^3.2.
|
|
44
|
+
"async": "^3.2.6",
|
|
45
45
|
"autoprefixer": "9",
|
|
46
46
|
"babel-loader": "8",
|
|
47
|
-
"browser-sync": "^3.0.
|
|
47
|
+
"browser-sync": "^3.0.4",
|
|
48
48
|
"connect-history-api-fallback": "^2.0.0",
|
|
49
49
|
"css-loader": "5",
|
|
50
50
|
"cssnano": "4",
|
|
51
51
|
"del": "6",
|
|
52
|
-
"esbuild": "^0.
|
|
52
|
+
"esbuild": "^0.28.0",
|
|
53
53
|
"fancy-log": "^2.0.0",
|
|
54
54
|
"file-loader": "6",
|
|
55
55
|
"gulp-eslint": "^6.0.0",
|
|
@@ -60,16 +60,16 @@
|
|
|
60
60
|
"gulp-size": "3",
|
|
61
61
|
"gulp-useref": "^5.0.0",
|
|
62
62
|
"gulp-zip": "5",
|
|
63
|
-
"gulp.spritesmith": "^6.13.
|
|
63
|
+
"gulp.spritesmith": "^6.13.1",
|
|
64
64
|
"html-loader": "1",
|
|
65
65
|
"html-minifier": "^4.0.0",
|
|
66
66
|
"html-webpack-plugin": "4",
|
|
67
67
|
"http-proxy-middleware": "1",
|
|
68
68
|
"imagemin": "7",
|
|
69
69
|
"istextorbinary": "6",
|
|
70
|
-
"less": "^4.
|
|
70
|
+
"less": "^4.6.4",
|
|
71
71
|
"mini-css-extract-plugin": "1",
|
|
72
|
-
"modernizr": "^3.13.
|
|
72
|
+
"modernizr": "^3.13.1",
|
|
73
73
|
"optimize-css-assets-webpack-plugin": "5",
|
|
74
74
|
"parents": "^1.0.1",
|
|
75
75
|
"plugin-error": "^2.0.1",
|
|
@@ -91,19 +91,19 @@
|
|
|
91
91
|
"strip-ansi": "6",
|
|
92
92
|
"style-loader": "2",
|
|
93
93
|
"tailwindcss": "npm:@tailwindcss/postcss7-compat@2.1.4",
|
|
94
|
-
"terser": "^5.
|
|
94
|
+
"terser": "^5.47.0",
|
|
95
95
|
"terser-webpack-plugin": "4",
|
|
96
|
-
"through2": "
|
|
96
|
+
"through2": "4",
|
|
97
97
|
"through2-concurrent": "^2.0.0",
|
|
98
|
-
"tslib": "^2.
|
|
98
|
+
"tslib": "^2.8.1",
|
|
99
99
|
"url-loader": "4",
|
|
100
100
|
"vinyl-sourcemaps-apply": "^0.2.1",
|
|
101
101
|
"webpack": "4",
|
|
102
|
-
"webpack-bundle-analyzer": "
|
|
102
|
+
"webpack-bundle-analyzer": "4",
|
|
103
103
|
"webpack-dev-middleware": "3",
|
|
104
|
-
"webpack-hot-middleware": "^2.26.
|
|
105
|
-
"webpack-merge": "
|
|
106
|
-
"workbox-build": "^7.
|
|
104
|
+
"webpack-hot-middleware": "^2.26.1",
|
|
105
|
+
"webpack-merge": "5",
|
|
106
|
+
"workbox-build": "^7.4.1"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@types/express": "4",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"engines": {
|
|
120
120
|
"node": ">=10.13.0"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "ae455031deb87887f9438974d7214038a71e3dca"
|
|
123
123
|
}
|
package/tslib/bootstrap/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.setConfig = setConfig;
|
|
4
|
+
exports.setTask = setTask;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const check_config_1 = tslib_1.__importDefault(require("./check_config"));
|
|
6
7
|
const constants_1 = require("../config/constants");
|
|
@@ -63,7 +64,6 @@ function setConfig(customConfig) {
|
|
|
63
64
|
});
|
|
64
65
|
return config;
|
|
65
66
|
}
|
|
66
|
-
exports.setConfig = setConfig;
|
|
67
67
|
function setTask(name) {
|
|
68
68
|
let result = undefined;
|
|
69
69
|
if (BalmJS.utils.isFunction(name)) {
|
|
@@ -82,4 +82,3 @@ function setTask(name) {
|
|
|
82
82
|
}
|
|
83
83
|
return result;
|
|
84
84
|
}
|
|
85
|
-
exports.setTask = setTask;
|
|
@@ -15,31 +15,26 @@ const esTransform = (entryPoints, output, customTransformOptions, callback) => {
|
|
|
15
15
|
var _a, e_1, _b, _c;
|
|
16
16
|
try {
|
|
17
17
|
try {
|
|
18
|
-
for (var _d = true, entryPoints_1 = tslib_1.__asyncValues(entryPoints), entryPoints_1_1; entryPoints_1_1 = await entryPoints_1.next(), _a = entryPoints_1_1.done, !_a;) {
|
|
18
|
+
for (var _d = true, entryPoints_1 = tslib_1.__asyncValues(entryPoints), entryPoints_1_1; entryPoints_1_1 = await entryPoints_1.next(), _a = entryPoints_1_1.done, !_a; _d = true) {
|
|
19
19
|
_c = entryPoints_1_1.value;
|
|
20
20
|
_d = false;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
fs_1.default.writeFileSync(path.join(build.output, filename), result.code);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
BalmJS.logger.warn('esbuild', `Invalid entry point: ${entryPoint}`);
|
|
39
|
-
}
|
|
21
|
+
const entryPoint = _c;
|
|
22
|
+
build.input = BalmJS.file.absPath(entryPoint);
|
|
23
|
+
BalmJS.logger.debug('esbuild bundler - transform', {
|
|
24
|
+
input: build.input,
|
|
25
|
+
output: build.output
|
|
26
|
+
}, {
|
|
27
|
+
pre: true
|
|
28
|
+
});
|
|
29
|
+
const filename = entryPoint.split('/').pop();
|
|
30
|
+
if (filename && fs_1.default.existsSync(build.input)) {
|
|
31
|
+
const inputCode = fs_1.default.readFileSync(build.input, 'utf8');
|
|
32
|
+
const result = await require('esbuild').transform(inputCode, options);
|
|
33
|
+
fs_1.default.mkdirSync(build.output, { recursive: true });
|
|
34
|
+
fs_1.default.writeFileSync(path.join(build.output, filename), result.code);
|
|
40
35
|
}
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
else {
|
|
37
|
+
BalmJS.logger.warn('esbuild', `Invalid entry point: ${entryPoint}`);
|
|
43
38
|
}
|
|
44
39
|
}
|
|
45
40
|
}
|
|
@@ -15,16 +15,11 @@ const buildLibrary = async (inputOptions, outputOptions) => {
|
|
|
15
15
|
const bundle = await rollup.rollup(rollupOptions);
|
|
16
16
|
if (Array.isArray(outputOptions)) {
|
|
17
17
|
try {
|
|
18
|
-
for (var _d = true, outputOptions_1 = tslib_1.__asyncValues(outputOptions), outputOptions_1_1; outputOptions_1_1 = await outputOptions_1.next(), _a = outputOptions_1_1.done, !_a;) {
|
|
18
|
+
for (var _d = true, outputOptions_1 = tslib_1.__asyncValues(outputOptions), outputOptions_1_1; outputOptions_1_1 = await outputOptions_1.next(), _a = outputOptions_1_1.done, !_a; _d = true) {
|
|
19
19
|
_c = outputOptions_1_1.value;
|
|
20
20
|
_d = false;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
await (0, build_1.default)(bundle, outputOption);
|
|
24
|
-
}
|
|
25
|
-
finally {
|
|
26
|
-
_d = true;
|
|
27
|
-
}
|
|
21
|
+
const outputOption = _c;
|
|
22
|
+
await (0, build_1.default)(bundle, outputOption);
|
|
28
23
|
}
|
|
29
24
|
}
|
|
30
25
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getInputPlugins = getInputPlugins;
|
|
4
|
+
exports.getOutputPlugins = getOutputPlugins;
|
|
4
5
|
function getInputPlugins(customInputOptions) {
|
|
5
6
|
const { inputOptions } = BalmJS.config.scripts;
|
|
6
7
|
const inputPlugins = [];
|
|
@@ -12,7 +13,6 @@ function getInputPlugins(customInputOptions) {
|
|
|
12
13
|
}
|
|
13
14
|
return inputPlugins;
|
|
14
15
|
}
|
|
15
|
-
exports.getInputPlugins = getInputPlugins;
|
|
16
16
|
function getOutputPlugins(customOutputOptions) {
|
|
17
17
|
const { outputOptions } = BalmJS.config.scripts;
|
|
18
18
|
const outputPlugins = [];
|
|
@@ -27,4 +27,3 @@ function getOutputPlugins(customOutputOptions) {
|
|
|
27
27
|
}
|
|
28
28
|
return outputPlugins;
|
|
29
29
|
}
|
|
30
|
-
exports.getOutputPlugins = getOutputPlugins;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.webpack = void 0;
|
|
4
|
+
exports.webpackConfig = webpackConfig;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
|
|
6
7
|
const entry_1 = tslib_1.__importDefault(require("./entry"));
|
|
@@ -44,4 +45,3 @@ function webpackConfig(input, output, customWebpackOptions = {}, isHook = false)
|
|
|
44
45
|
});
|
|
45
46
|
return configuration;
|
|
46
47
|
}
|
|
47
|
-
exports.webpackConfig = webpackConfig;
|
package/tslib/plugins/plumber.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stop =
|
|
3
|
+
exports.stop = stop;
|
|
4
4
|
const events_1 = require("events");
|
|
5
5
|
const PLUGIN_NAME = 'plumber';
|
|
6
6
|
const emitter = new events_1.EventEmitter();
|
|
@@ -80,5 +80,4 @@ function stop() {
|
|
|
80
80
|
through._unplumbed = true;
|
|
81
81
|
return through;
|
|
82
82
|
}
|
|
83
|
-
exports.stop = stop;
|
|
84
83
|
exports.default = gulpPlumber;
|