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.
Files changed (98) hide show
  1. package/lib/balm.js +5 -1
  2. package/lib/bundler/esbuild/transform.js +39 -45
  3. package/lib/bundler/rollup/index.js +37 -43
  4. package/lib/bundler/webpack/config/regex.js +1 -1
  5. package/lib/bundler/webpack/index.js +1 -1
  6. package/lib/config/constants.js +1 -1
  7. package/lib/config/scripts.js +3 -3
  8. package/lib/index.js +5 -5
  9. package/lib/middlewares/proxy.js +3 -1
  10. package/lib/plugins/less.js +55 -4
  11. package/lib/plugins/plumber.js +1 -1
  12. package/lib/plugins/postcss.js +1 -0
  13. package/lib/plugins/replace.js +2 -2
  14. package/lib/plugins/sass.js +8 -16
  15. package/lib/tasks/foundation/balm_style.js +1 -1
  16. package/lib/tasks/index.js +3 -1
  17. package/lib/tasks/private/build.js +3 -1
  18. package/lib/tasks/private/cache.js +3 -1
  19. package/lib/tasks/private/clean.js +5 -1
  20. package/lib/tasks/private/extra.js +3 -1
  21. package/lib/tasks/private/font.js +3 -1
  22. package/lib/tasks/private/image.js +3 -1
  23. package/lib/tasks/private/lint.js +3 -1
  24. package/lib/tasks/private/media.js +3 -1
  25. package/lib/tasks/private/modernizr.js +10 -4
  26. package/lib/tasks/private/sprite.js +6 -2
  27. package/lib/tasks/private/start.js +3 -1
  28. package/lib/tasks/private/workbox-sw.js +3 -1
  29. package/lib/tasks/public/ftp.js +3 -1
  30. package/lib/tasks/public/html.js +6 -2
  31. package/lib/tasks/public/publish.js +5 -1
  32. package/lib/tasks/public/remove.js +5 -1
  33. package/lib/tasks/public/sass.js +2 -1
  34. package/lib/tasks/public/server.js +9 -3
  35. package/lib/tasks/public/url.js +5 -1
  36. package/lib/tasks/public/webpack.js +14 -11
  37. package/lib/utilities/cache-core.js +4 -3
  38. package/lib/utilities/compiling.js +5 -1
  39. package/lib/utilities/loading.js +7 -3
  40. package/lib/utilities/logger.js +5 -1
  41. package/package.json +30 -30
  42. package/tslib/balm.js +9 -9
  43. package/tslib/bootstrap/index.js +2 -2
  44. package/tslib/bundler/esbuild/index.js +4 -4
  45. package/tslib/bundler/esbuild/transform.js +2 -2
  46. package/tslib/bundler/rollup/entry.js +1 -1
  47. package/tslib/bundler/rollup/index.js +8 -8
  48. package/tslib/bundler/rollup/output.js +1 -1
  49. package/tslib/bundler/webpack/config/common.js +2 -2
  50. package/tslib/bundler/webpack/config/dev.js +3 -3
  51. package/tslib/bundler/webpack/config/index.js +4 -4
  52. package/tslib/bundler/webpack/config/prod.js +3 -3
  53. package/tslib/bundler/webpack/index.js +8 -8
  54. package/tslib/bundler/webpack/loaders.js +4 -4
  55. package/tslib/config/globals.js +3 -3
  56. package/tslib/config/index.js +13 -13
  57. package/tslib/config/scripts.js +3 -3
  58. package/tslib/config/version.js +1 -1
  59. package/tslib/hello.js +2 -2
  60. package/tslib/hooks/index.js +1 -1
  61. package/tslib/index.js +2 -2
  62. package/tslib/middlewares/index.js +6 -6
  63. package/tslib/middlewares/proxy.js +2 -1
  64. package/tslib/plugins/imagemin.js +6 -4
  65. package/tslib/plugins/index.js +11 -11
  66. package/tslib/plugins/less.js +54 -9
  67. package/tslib/plugins/postcss.js +2 -2
  68. package/tslib/plugins/replace.js +2 -2
  69. package/tslib/plugins/sass.js +13 -12
  70. package/tslib/plugins/sftp.js +1 -1
  71. package/tslib/tasks/foundation/balm_style.js +2 -2
  72. package/tslib/tasks/foundation/index.js +2 -2
  73. package/tslib/tasks/index.js +7 -6
  74. package/tslib/tasks/private/clean.js +2 -2
  75. package/tslib/tasks/private/image.js +1 -1
  76. package/tslib/tasks/private/modernizr.js +4 -4
  77. package/tslib/tasks/private/sprite.js +5 -5
  78. package/tslib/tasks/public/esbuild.js +2 -2
  79. package/tslib/tasks/public/ftp.js +2 -1
  80. package/tslib/tasks/public/html.js +5 -5
  81. package/tslib/tasks/public/publish.js +4 -4
  82. package/tslib/tasks/public/remove.js +1 -1
  83. package/tslib/tasks/public/rollup.js +2 -2
  84. package/tslib/tasks/public/sass.js +2 -1
  85. package/tslib/tasks/public/server.js +13 -12
  86. package/tslib/tasks/public/url.js +2 -2
  87. package/tslib/tasks/public/webpack.js +18 -9
  88. package/tslib/utilities/address.js +1 -1
  89. package/tslib/utilities/cache-core.js +10 -9
  90. package/tslib/utilities/color.js +1 -1
  91. package/tslib/utilities/compiling.js +4 -4
  92. package/tslib/utilities/detect-port.js +2 -2
  93. package/tslib/utilities/file.js +3 -3
  94. package/tslib/utilities/index.js +4 -4
  95. package/tslib/utilities/loading.js +9 -8
  96. package/tslib/utilities/logger.js +9 -9
  97. package/tslib/utilities/replacestream.js +3 -3
  98. 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
- const currentFrame = spinner_1.default.frames[tslib_1.__classPrivateFieldGet(this, _BalmLoading_frameIndex, "f")];
16
- tslib_1.__classPrivateFieldSet(this, _BalmLoading_frameIndex, tslib_1.__classPrivateFieldSet(this, _BalmLoading_frameIndex, +tslib_1.__classPrivateFieldGet(this, _BalmLoading_frameIndex, "f") + 1, "f") % tslib_1.__classPrivateFieldGet(this, _BalmLoading_frameCount, "f"), "f");
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');
@@ -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) {