balm-core 3.21.0 → 3.23.1

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 (60) hide show
  1. package/README.md +9 -16
  2. package/lib/config/globals.js +1 -1
  3. package/lib/config/scripts.js +3 -3
  4. package/lib/plugins/sass.js +88 -78
  5. package/lib/tasks/public/sass.js +2 -1
  6. package/lib/tasks/public/webpack.js +14 -11
  7. package/lib/utilities/loading.js +3 -1
  8. package/package.json +16 -16
  9. package/tslib/balm.js +6 -6
  10. package/tslib/bootstrap/index.js +1 -1
  11. package/tslib/bundler/esbuild/index.js +2 -2
  12. package/tslib/bundler/esbuild/transform.js +2 -2
  13. package/tslib/bundler/rollup/index.js +4 -4
  14. package/tslib/bundler/webpack/config/common.js +1 -1
  15. package/tslib/bundler/webpack/config/dev.js +2 -2
  16. package/tslib/bundler/webpack/config/index.js +2 -2
  17. package/tslib/bundler/webpack/config/prod.js +2 -2
  18. package/tslib/bundler/webpack/index.js +4 -4
  19. package/tslib/bundler/webpack/loaders.js +2 -2
  20. package/tslib/config/globals.js +4 -4
  21. package/tslib/config/index.js +13 -13
  22. package/tslib/config/scripts.js +3 -3
  23. package/tslib/config/version.js +1 -1
  24. package/tslib/hello.js +1 -1
  25. package/tslib/hooks/index.js +1 -1
  26. package/tslib/index.js +2 -2
  27. package/tslib/middlewares/index.js +3 -3
  28. package/tslib/plugins/imagemin.js +1 -1
  29. package/tslib/plugins/index.js +11 -11
  30. package/tslib/plugins/less.js +3 -3
  31. package/tslib/plugins/postcss.js +1 -1
  32. package/tslib/plugins/replace.js +1 -1
  33. package/tslib/plugins/sass.js +52 -55
  34. package/tslib/plugins/sftp.js +1 -1
  35. package/tslib/tasks/foundation/balm_style.js +1 -1
  36. package/tslib/tasks/foundation/index.js +2 -2
  37. package/tslib/tasks/index.js +3 -3
  38. package/tslib/tasks/private/clean.js +2 -2
  39. package/tslib/tasks/private/modernizr.js +4 -4
  40. package/tslib/tasks/private/sprite.js +4 -4
  41. package/tslib/tasks/public/esbuild.js +1 -1
  42. package/tslib/tasks/public/html.js +5 -5
  43. package/tslib/tasks/public/publish.js +3 -3
  44. package/tslib/tasks/public/remove.js +1 -1
  45. package/tslib/tasks/public/rollup.js +1 -1
  46. package/tslib/tasks/public/sass.js +2 -1
  47. package/tslib/tasks/public/server.js +9 -9
  48. package/tslib/tasks/public/url.js +2 -2
  49. package/tslib/tasks/public/webpack.js +17 -8
  50. package/tslib/utilities/address.js +1 -1
  51. package/tslib/utilities/cache-core.js +3 -3
  52. package/tslib/utilities/color.js +1 -1
  53. package/tslib/utilities/compiling.js +4 -4
  54. package/tslib/utilities/detect-port.js +2 -2
  55. package/tslib/utilities/file.js +2 -2
  56. package/tslib/utilities/index.js +4 -4
  57. package/tslib/utilities/loading.js +8 -8
  58. package/tslib/utilities/logger.js +8 -8
  59. package/tslib/utilities/replacestream.js +1 -1
  60. package/tslib/utilities/utils.js +1 -1
@@ -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 os_1 = (0, tslib_1.__importDefault)(require("os"));
4
+ const os_1 = tslib_1.__importDefault(require("os"));
5
5
  const platform = os_1.default.platform();
6
6
  function getInterfaceName() {
7
7
  let val = 'eth';
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const module_1 = (0, tslib_1.__importDefault)(require("module"));
5
- const path_1 = (0, tslib_1.__importDefault)(require("path"));
4
+ const module_1 = tslib_1.__importDefault(require("module"));
5
+ const path_1 = tslib_1.__importDefault(require("path"));
6
6
  const os_1 = require("os");
7
7
  const fs_1 = require("fs");
8
- const loading_1 = (0, tslib_1.__importDefault)(require("./loading"));
8
+ const loading_1 = tslib_1.__importDefault(require("./loading"));
9
9
  const _require = module_1.default.prototype.require;
10
10
  const SAVE_FILE = path_1.default.join((0, os_1.homedir)(), process.env.BALM_CORE_CACHE || '.balm-core-cache.json');
11
11
  function cacheBalmCore() {
@@ -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 ansi_colors_1 = (0, tslib_1.__importDefault)(require("ansi-colors"));
4
+ const ansi_colors_1 = tslib_1.__importDefault(require("ansi-colors"));
5
5
  const COLOR = {
6
6
  PREFIX: 'bg',
7
7
  SUFFIX: 'Bright'
@@ -2,19 +2,19 @@
2
2
  var _BalmCompiling_firstCompile;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const tslib_1 = require("tslib");
5
- const loading_1 = (0, tslib_1.__importDefault)(require("./loading"));
5
+ const loading_1 = tslib_1.__importDefault(require("./loading"));
6
6
  class BalmCompiling {
7
7
  constructor() {
8
8
  _BalmCompiling_firstCompile.set(this, true);
9
9
  }
10
10
  start() {
11
- if ((0, tslib_1.__classPrivateFieldGet)(this, _BalmCompiling_firstCompile, "f")) {
11
+ if (tslib_1.__classPrivateFieldGet(this, _BalmCompiling_firstCompile, "f")) {
12
12
  loading_1.default.render('Compiling to JS...');
13
13
  }
14
14
  }
15
15
  stop() {
16
- if ((0, tslib_1.__classPrivateFieldGet)(this, _BalmCompiling_firstCompile, "f")) {
17
- (0, tslib_1.__classPrivateFieldSet)(this, _BalmCompiling_firstCompile, false, "f");
16
+ if (tslib_1.__classPrivateFieldGet(this, _BalmCompiling_firstCompile, "f")) {
17
+ tslib_1.__classPrivateFieldSet(this, _BalmCompiling_firstCompile, false, "f");
18
18
  loading_1.default.clear();
19
19
  }
20
20
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const net_1 = (0, tslib_1.__importDefault)(require("net"));
5
- const address_1 = (0, tslib_1.__importDefault)(require("./address"));
4
+ const net_1 = tslib_1.__importDefault(require("net"));
5
+ const address_1 = tslib_1.__importDefault(require("./address"));
6
6
  const UTIL_NAME = 'detect port';
7
7
  const MAX_PORT = 65535;
8
8
  function listen(port, host, callback) {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
5
- const public_url_1 = (0, tslib_1.__importDefault)(require("./public-url"));
4
+ const fs_1 = tslib_1.__importDefault(require("fs"));
5
+ const public_url_1 = tslib_1.__importDefault(require("./public-url"));
6
6
  const constants_1 = require("../config/constants");
7
7
  const appDirectory = fs_1.default.realpathSync(process.cwd());
8
8
  const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const utils_1 = (0, tslib_1.__importDefault)(require("./utils"));
5
- const logger_1 = (0, tslib_1.__importDefault)(require("./logger"));
6
- const file_1 = (0, tslib_1.__importDefault)(require("./file"));
7
- const namespace_1 = (0, tslib_1.__importDefault)(require("./namespace"));
4
+ const utils_1 = tslib_1.__importDefault(require("./utils"));
5
+ const logger_1 = tslib_1.__importDefault(require("./logger"));
6
+ const file_1 = tslib_1.__importDefault(require("./file"));
7
+ const namespace_1 = tslib_1.__importDefault(require("./namespace"));
8
8
  BalmJS.utils = utils_1.default;
9
9
  BalmJS.logger = logger_1.default;
10
10
  BalmJS.file = file_1.default;
@@ -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 = (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"));
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"));
8
8
  class BalmLoading {
9
9
  constructor() {
10
10
  _BalmLoading_stream.set(this, process.stderr);
@@ -13,17 +13,17 @@ class BalmLoading {
13
13
  }
14
14
  get frame() {
15
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");
16
+ const currentFrame = spinner_1.default.frames[tslib_1.__classPrivateFieldGet(this, _BalmLoading_frameIndex, "f")];
17
+ tslib_1.__classPrivateFieldSet(this, _BalmLoading_frameIndex, tslib_1.__classPrivateFieldSet(this, _BalmLoading_frameIndex, (_a = tslib_1.__classPrivateFieldGet(this, _BalmLoading_frameIndex, "f"), ++_a), "f") % tslib_1.__classPrivateFieldGet(this, _BalmLoading_frameCount, "f"), "f");
18
18
  return currentFrame;
19
19
  }
20
20
  clear() {
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);
21
+ readline_1.default.clearLine(tslib_1.__classPrivateFieldGet(this, _BalmLoading_stream, "f"), 0);
22
+ readline_1.default.cursorTo(tslib_1.__classPrivateFieldGet(this, _BalmLoading_stream, "f"), 0);
23
23
  }
24
24
  render(text = `${this.frame} BalmJS is initializing...`) {
25
25
  this.clear();
26
- (0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_stream, "f").write(text);
26
+ tslib_1.__classPrivateFieldGet(this, _BalmLoading_stream, "f").write(text);
27
27
  }
28
28
  succeed() {
29
29
  this.clear();
@@ -2,9 +2,9 @@
2
2
  var _Logger_log;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const tslib_1 = require("tslib");
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"));
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"));
8
8
  const LOG = {
9
9
  FORMAT: '%s %s %s',
10
10
  PREFIX: (0, color_1.default)('BalmJS', {
@@ -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
- (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));
60
+ (0, fancy_log_1.default)(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.OK), 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, (0, color_1.default)(`<${label}>`, LOG.DEBUG), (0, 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), 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, (0, color_1.default)(`<${label}>`, LOG.INFO), (0, 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), 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, (0, color_1.default)(`<${label}>`, LOG.WARN), (0, 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), 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, (0, color_1.default)(`<${label}>`, LOG.ERROR), (0, 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), 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 = (0, tslib_1.__importDefault)(require("./escape-string-regexp"));
4
+ const escape_string_regexp_1 = tslib_1.__importDefault(require("./escape-string-regexp"));
5
5
  function createReplaceFn(replace, isRegEx) {
6
6
  function regexReplaceFunction(...args) {
7
7
  let newReplace = replace;
@@ -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 typeof_1 = (0, tslib_1.__importDefault)(require("./typeof"));
4
+ const typeof_1 = tslib_1.__importDefault(require("./typeof"));
5
5
  function isString(str) {
6
6
  return (0, typeof_1.default)(str) === 'string';
7
7
  }