balm-core 3.19.1 → 3.22.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 +5 -1
- package/lib/bundler/esbuild/transform.js +39 -45
- package/lib/bundler/rollup/index.js +37 -43
- package/lib/bundler/webpack/config/regex.js +1 -1
- package/lib/bundler/webpack/index.js +1 -1
- package/lib/config/constants.js +1 -1
- package/lib/config/scripts.js +3 -3
- package/lib/index.js +5 -5
- package/lib/middlewares/proxy.js +3 -1
- package/lib/plugins/less.js +55 -4
- package/lib/plugins/plumber.js +1 -1
- package/lib/plugins/postcss.js +1 -0
- package/lib/plugins/replace.js +2 -2
- package/lib/plugins/sass.js +8 -16
- package/lib/tasks/foundation/balm_style.js +1 -1
- package/lib/tasks/index.js +3 -1
- package/lib/tasks/private/build.js +3 -1
- package/lib/tasks/private/cache.js +3 -1
- package/lib/tasks/private/clean.js +5 -1
- package/lib/tasks/private/extra.js +3 -1
- package/lib/tasks/private/font.js +3 -1
- package/lib/tasks/private/image.js +3 -1
- package/lib/tasks/private/lint.js +3 -1
- package/lib/tasks/private/media.js +3 -1
- package/lib/tasks/private/modernizr.js +10 -4
- package/lib/tasks/private/sprite.js +6 -2
- package/lib/tasks/private/start.js +3 -1
- package/lib/tasks/private/workbox-sw.js +3 -1
- package/lib/tasks/public/ftp.js +3 -1
- package/lib/tasks/public/html.js +6 -2
- package/lib/tasks/public/publish.js +5 -1
- package/lib/tasks/public/remove.js +5 -1
- package/lib/tasks/public/sass.js +2 -1
- package/lib/tasks/public/server.js +9 -3
- package/lib/tasks/public/url.js +5 -1
- package/lib/tasks/public/webpack.js +14 -11
- package/lib/utilities/cache-core.js +4 -3
- package/lib/utilities/compiling.js +5 -1
- package/lib/utilities/loading.js +7 -3
- package/lib/utilities/logger.js +5 -1
- package/package.json +30 -30
- package/tslib/balm.js +9 -9
- package/tslib/bootstrap/index.js +2 -2
- package/tslib/bundler/esbuild/index.js +4 -4
- package/tslib/bundler/esbuild/transform.js +2 -2
- package/tslib/bundler/rollup/entry.js +1 -1
- package/tslib/bundler/rollup/index.js +8 -8
- package/tslib/bundler/rollup/output.js +1 -1
- package/tslib/bundler/webpack/config/common.js +2 -2
- package/tslib/bundler/webpack/config/dev.js +3 -3
- package/tslib/bundler/webpack/config/index.js +4 -4
- package/tslib/bundler/webpack/config/prod.js +3 -3
- package/tslib/bundler/webpack/index.js +8 -8
- package/tslib/bundler/webpack/loaders.js +4 -4
- package/tslib/config/globals.js +3 -3
- package/tslib/config/index.js +13 -13
- package/tslib/config/scripts.js +3 -3
- package/tslib/config/version.js +1 -1
- package/tslib/hello.js +2 -2
- package/tslib/hooks/index.js +1 -1
- package/tslib/index.js +2 -2
- package/tslib/middlewares/index.js +6 -6
- package/tslib/middlewares/proxy.js +2 -1
- package/tslib/plugins/imagemin.js +6 -4
- package/tslib/plugins/index.js +11 -11
- package/tslib/plugins/less.js +54 -9
- package/tslib/plugins/postcss.js +2 -2
- package/tslib/plugins/replace.js +2 -2
- package/tslib/plugins/sass.js +13 -12
- package/tslib/plugins/sftp.js +1 -1
- package/tslib/tasks/foundation/balm_style.js +2 -2
- package/tslib/tasks/foundation/index.js +2 -2
- package/tslib/tasks/index.js +7 -6
- package/tslib/tasks/private/clean.js +2 -2
- package/tslib/tasks/private/image.js +1 -1
- package/tslib/tasks/private/modernizr.js +4 -4
- package/tslib/tasks/private/sprite.js +5 -5
- package/tslib/tasks/public/esbuild.js +2 -2
- package/tslib/tasks/public/ftp.js +2 -1
- package/tslib/tasks/public/html.js +5 -5
- package/tslib/tasks/public/publish.js +4 -4
- package/tslib/tasks/public/remove.js +1 -1
- package/tslib/tasks/public/rollup.js +2 -2
- package/tslib/tasks/public/sass.js +2 -1
- package/tslib/tasks/public/server.js +13 -12
- package/tslib/tasks/public/url.js +2 -2
- package/tslib/tasks/public/webpack.js +18 -9
- package/tslib/utilities/address.js +1 -1
- package/tslib/utilities/cache-core.js +10 -9
- package/tslib/utilities/color.js +1 -1
- package/tslib/utilities/compiling.js +4 -4
- package/tslib/utilities/detect-port.js +2 -2
- package/tslib/utilities/file.js +3 -3
- package/tslib/utilities/index.js +4 -4
- package/tslib/utilities/loading.js +9 -8
- package/tslib/utilities/logger.js +9 -9
- package/tslib/utilities/replacestream.js +3 -3
- package/tslib/utilities/utils.js +4 -4
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
var _BalmLoading_stream, _BalmLoading_frameIndex, _BalmLoading_frameCount;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const readline_1 = tslib_1.__importDefault(require("readline"));
|
|
6
|
-
const spinner_1 = tslib_1.__importDefault(require("../config/spinner"));
|
|
7
|
-
const version_1 = tslib_1.__importDefault(require("../config/version"));
|
|
5
|
+
const readline_1 = (0, tslib_1.__importDefault)(require("readline"));
|
|
6
|
+
const spinner_1 = (0, tslib_1.__importDefault)(require("../config/spinner"));
|
|
7
|
+
const version_1 = (0, tslib_1.__importDefault)(require("../config/version"));
|
|
8
8
|
class BalmLoading {
|
|
9
9
|
constructor() {
|
|
10
10
|
_BalmLoading_stream.set(this, process.stderr);
|
|
@@ -12,17 +12,18 @@ class BalmLoading {
|
|
|
12
12
|
_BalmLoading_frameCount.set(this, spinner_1.default.frames.length);
|
|
13
13
|
}
|
|
14
14
|
get frame() {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
var _a;
|
|
16
|
+
const currentFrame = spinner_1.default.frames[(0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_frameIndex, "f")];
|
|
17
|
+
(0, tslib_1.__classPrivateFieldSet)(this, _BalmLoading_frameIndex, (0, tslib_1.__classPrivateFieldSet)(this, _BalmLoading_frameIndex, (_a = (0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_frameIndex, "f"), ++_a), "f") % (0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_frameCount, "f"), "f");
|
|
17
18
|
return currentFrame;
|
|
18
19
|
}
|
|
19
20
|
clear() {
|
|
20
|
-
readline_1.default.clearLine(tslib_1.__classPrivateFieldGet(this, _BalmLoading_stream, "f"), 0);
|
|
21
|
-
readline_1.default.cursorTo(tslib_1.__classPrivateFieldGet(this, _BalmLoading_stream, "f"), 0);
|
|
21
|
+
readline_1.default.clearLine((0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_stream, "f"), 0);
|
|
22
|
+
readline_1.default.cursorTo((0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_stream, "f"), 0);
|
|
22
23
|
}
|
|
23
24
|
render(text = `${this.frame} BalmJS is initializing...`) {
|
|
24
25
|
this.clear();
|
|
25
|
-
tslib_1.__classPrivateFieldGet(this, _BalmLoading_stream, "f").write(text);
|
|
26
|
+
(0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_stream, "f").write(text);
|
|
26
27
|
}
|
|
27
28
|
succeed() {
|
|
28
29
|
this.clear();
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
var _Logger_log;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const util_1 = tslib_1.__importDefault(require("util"));
|
|
6
|
-
const fancy_log_1 = tslib_1.__importDefault(require("fancy-log"));
|
|
7
|
-
const color_1 = tslib_1.__importDefault(require("./color"));
|
|
5
|
+
const util_1 = (0, tslib_1.__importDefault)(require("util"));
|
|
6
|
+
const fancy_log_1 = (0, tslib_1.__importDefault)(require("fancy-log"));
|
|
7
|
+
const color_1 = (0, tslib_1.__importDefault)(require("./color"));
|
|
8
8
|
const LOG = {
|
|
9
9
|
FORMAT: '%s %s %s',
|
|
10
|
-
PREFIX: color_1.default('BalmJS', {
|
|
10
|
+
PREFIX: (0, color_1.default)('BalmJS', {
|
|
11
11
|
color: 'blue',
|
|
12
12
|
background: true,
|
|
13
13
|
bright: true
|
|
@@ -57,7 +57,7 @@ class Logger {
|
|
|
57
57
|
}, options);
|
|
58
58
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
59
59
|
console.log(LOG.beginning);
|
|
60
|
-
fancy_log_1.default(LOG.FORMAT, LOG.PREFIX, color_1.default(`<${label}>`, LOG.OK), tslib_1.__classPrivateFieldGet(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
60
|
+
(0, fancy_log_1.default)(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.OK), (0, tslib_1.__classPrivateFieldGet)(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
61
61
|
console.log(LOG.end);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -66,7 +66,7 @@ class Logger {
|
|
|
66
66
|
logLevel: BalmJS.LogLevel.Debug
|
|
67
67
|
}, options);
|
|
68
68
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
69
|
-
fancy_log_1.default.info(LOG.FORMAT, LOG.PREFIX, color_1.default(`<${label}>`, LOG.DEBUG), tslib_1.__classPrivateFieldGet(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
69
|
+
fancy_log_1.default.info(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.DEBUG), (0, tslib_1.__classPrivateFieldGet)(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
info(label, message, options = {}) {
|
|
@@ -74,7 +74,7 @@ class Logger {
|
|
|
74
74
|
logLevel: BalmJS.LogLevel.Info
|
|
75
75
|
}, options);
|
|
76
76
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
77
|
-
fancy_log_1.default.info(LOG.FORMAT, LOG.PREFIX, color_1.default(`<${label}>`, LOG.INFO), tslib_1.__classPrivateFieldGet(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
77
|
+
fancy_log_1.default.info(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.INFO), (0, tslib_1.__classPrivateFieldGet)(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
warn(label, message, options = {}) {
|
|
@@ -82,7 +82,7 @@ class Logger {
|
|
|
82
82
|
logLevel: BalmJS.LogLevel.Warn
|
|
83
83
|
}, options);
|
|
84
84
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
85
|
-
fancy_log_1.default.warn(LOG.FORMAT, LOG.PREFIX, color_1.default(`<${label}>`, LOG.WARN), tslib_1.__classPrivateFieldGet(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
85
|
+
fancy_log_1.default.warn(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.WARN), (0, tslib_1.__classPrivateFieldGet)(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
error(label, message, options = {}) {
|
|
@@ -91,7 +91,7 @@ class Logger {
|
|
|
91
91
|
pre: false
|
|
92
92
|
}, options);
|
|
93
93
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
94
|
-
fancy_log_1.default.error(LOG.FORMAT, LOG.PREFIX, color_1.default(`<${label}>`, LOG.ERROR), tslib_1.__classPrivateFieldGet(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
94
|
+
fancy_log_1.default.error(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.ERROR), (0, tslib_1.__classPrivateFieldGet)(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const escape_string_regexp_1 = tslib_1.__importDefault(require("./escape-string-regexp"));
|
|
4
|
+
const escape_string_regexp_1 = (0, tslib_1.__importDefault)(require("./escape-string-regexp"));
|
|
5
5
|
function createReplaceFn(replace, isRegEx) {
|
|
6
6
|
function regexReplaceFunction(...args) {
|
|
7
7
|
let newReplace = replace;
|
|
@@ -31,9 +31,9 @@ function matchFromRegex(regex, options) {
|
|
|
31
31
|
}
|
|
32
32
|
function matchFromString(str, options) {
|
|
33
33
|
if (options.regExpFlags) {
|
|
34
|
-
return new RegExp(escape_string_regexp_1.default(str), options.regExpFlags);
|
|
34
|
+
return new RegExp((0, escape_string_regexp_1.default)(str), options.regExpFlags);
|
|
35
35
|
}
|
|
36
|
-
return new RegExp(escape_string_regexp_1.default(str), options.ignoreCase ? 'gmi' : 'gm');
|
|
36
|
+
return new RegExp((0, escape_string_regexp_1.default)(str), options.ignoreCase ? 'gmi' : 'gm');
|
|
37
37
|
}
|
|
38
38
|
function replaceStream(search, replace, opts) {
|
|
39
39
|
const readableStream = require('readable-stream');
|
package/tslib/utilities/utils.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const typeof_1 = tslib_1.__importDefault(require("./typeof"));
|
|
4
|
+
const typeof_1 = (0, tslib_1.__importDefault)(require("./typeof"));
|
|
5
5
|
function isString(str) {
|
|
6
|
-
return typeof_1.default(str) === 'string';
|
|
6
|
+
return (0, typeof_1.default)(str) === 'string';
|
|
7
7
|
}
|
|
8
8
|
function isObject(obj) {
|
|
9
|
-
return typeof_1.default(obj) === 'object';
|
|
9
|
+
return (0, typeof_1.default)(obj) === 'object';
|
|
10
10
|
}
|
|
11
11
|
function isArray(arr) {
|
|
12
12
|
return Array.isArray(arr);
|
|
13
13
|
}
|
|
14
14
|
function isFunction(fn) {
|
|
15
|
-
const type = typeof_1.default(fn);
|
|
15
|
+
const type = (0, typeof_1.default)(fn);
|
|
16
16
|
return type === 'function' || type === 'generatorfunction';
|
|
17
17
|
}
|
|
18
18
|
function deepMerge(target, source) {
|