balm-core 3.35.0 → 3.36.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 (53) hide show
  1. package/lib/balm.js +11 -14
  2. package/lib/bootstrap/index.js +3 -3
  3. package/lib/bundler/esbuild/transform.js +1 -1
  4. package/lib/bundler/rollup/build.js +4 -4
  5. package/lib/bundler/rollup/index.js +1 -1
  6. package/lib/bundler/webpack/config/common.js +3 -3
  7. package/lib/hooks/index.js +7 -10
  8. package/lib/hooks/maker.js +1 -2
  9. package/lib/plugins/imagemin.js +1 -1
  10. package/lib/plugins/jsmin.js +1 -1
  11. package/lib/plugins/sass.js +4 -4
  12. package/lib/tasks/default.js +6 -8
  13. package/lib/tasks/foundation/balm.js +1 -2
  14. package/lib/tasks/foundation/balm_style.js +6 -8
  15. package/lib/tasks/private/build.js +6 -8
  16. package/lib/tasks/private/cache.js +6 -8
  17. package/lib/tasks/private/clean.js +19 -24
  18. package/lib/tasks/private/end.js +8 -11
  19. package/lib/tasks/private/extra.js +9 -11
  20. package/lib/tasks/private/font.js +6 -8
  21. package/lib/tasks/private/image.js +12 -14
  22. package/lib/tasks/private/lint.js +6 -8
  23. package/lib/tasks/private/media.js +6 -8
  24. package/lib/tasks/private/modernizr.js +34 -44
  25. package/lib/tasks/private/pwa-cache.js +7 -10
  26. package/lib/tasks/private/script.js +6 -8
  27. package/lib/tasks/private/sprite.js +49 -57
  28. package/lib/tasks/private/start.js +7 -9
  29. package/lib/tasks/private/style.js +6 -8
  30. package/lib/tasks/private/workbox-sw.js +6 -8
  31. package/lib/tasks/public/copy.js +6 -8
  32. package/lib/tasks/public/esbuild.js +6 -8
  33. package/lib/tasks/public/ftp.js +6 -8
  34. package/lib/tasks/public/html.js +30 -38
  35. package/lib/tasks/public/jsmin.js +6 -8
  36. package/lib/tasks/public/less.js +6 -8
  37. package/lib/tasks/public/postcss.js +6 -8
  38. package/lib/tasks/public/publish.js +20 -25
  39. package/lib/tasks/public/pwa.js +7 -9
  40. package/lib/tasks/public/remove.js +19 -24
  41. package/lib/tasks/public/replace.js +6 -8
  42. package/lib/tasks/public/rollup.js +7 -9
  43. package/lib/tasks/public/sass.js +6 -8
  44. package/lib/tasks/public/server.js +41 -49
  45. package/lib/tasks/public/url.js +22 -27
  46. package/lib/tasks/public/version.js +6 -8
  47. package/lib/tasks/public/webpack.js +6 -8
  48. package/lib/tasks/public/zip.js +6 -8
  49. package/lib/utilities/compiling.js +10 -13
  50. package/lib/utilities/file.js +4 -5
  51. package/lib/utilities/loading.js +14 -23
  52. package/lib/utilities/logger.js +18 -21
  53. package/package.json +14 -14
@@ -11,9 +11,9 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
11
11
  var _fs = _interopRequireDefault(require("fs"));
12
12
  var _publicUrl = _interopRequireDefault(require("./public-url"));
13
13
  var _constants = require("../config/constants");
14
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
15
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
15
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
16
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
17
17
  // Make sure any symlinks in the project folder are resolved
18
18
  var appDirectory = _fs["default"].realpathSync(process.cwd());
19
19
  var resolveApp = function resolveApp(relativePath) {
@@ -23,7 +23,7 @@ var File = /*#__PURE__*/function () {
23
23
  function File() {
24
24
  (0, _classCallCheck2["default"])(this, File);
25
25
  }
26
- (0, _createClass2["default"])(File, [{
26
+ return (0, _createClass2["default"])(File, [{
27
27
  key: "publicUrlOrPath",
28
28
  get: function get() {
29
29
  // We use `PUBLIC_URL` environment variable or "homepage" field to infer
@@ -114,6 +114,5 @@ var File = /*#__PURE__*/function () {
114
114
  return BalmJS.plugins.replace(publicPathSrc, publicPathDest);
115
115
  }
116
116
  }]);
117
- return File;
118
117
  }();
119
118
  var _default = exports["default"] = new File();
@@ -7,53 +7,45 @@ 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 _classPrivateFieldSet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldSet"));
11
- var _classPrivateFieldGet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldGet"));
12
10
  var _readline = _interopRequireDefault(require("readline"));
13
11
  var _spinner = _interopRequireDefault(require("../config/spinner"));
14
12
  var _version = _interopRequireDefault(require("../config/version"));
15
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
16
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
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 _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
16
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
17
+ 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"); }
17
18
  var _stream = /*#__PURE__*/new WeakMap();
18
19
  var _frameIndex = /*#__PURE__*/new WeakMap();
19
20
  var _frameCount = /*#__PURE__*/new WeakMap();
20
21
  var BalmLoading = /*#__PURE__*/function () {
21
22
  function BalmLoading() {
22
23
  (0, _classCallCheck2["default"])(this, BalmLoading);
23
- _classPrivateFieldInitSpec(this, _stream, {
24
- writable: true,
25
- value: process.stderr
26
- });
27
- _classPrivateFieldInitSpec(this, _frameIndex, {
28
- writable: true,
29
- value: 0
30
- });
31
- _classPrivateFieldInitSpec(this, _frameCount, {
32
- writable: true,
33
- value: _spinner["default"].frames.length
34
- });
24
+ _classPrivateFieldInitSpec(this, _stream, process.stderr);
25
+ _classPrivateFieldInitSpec(this, _frameIndex, 0);
26
+ _classPrivateFieldInitSpec(this, _frameCount, _spinner["default"].frames.length);
35
27
  }
36
- (0, _createClass2["default"])(BalmLoading, [{
28
+ return (0, _createClass2["default"])(BalmLoading, [{
37
29
  key: "frame",
38
30
  get: function get() {
39
31
  var _this$frameIndex;
40
- var currentFrame = _spinner["default"].frames[(0, _classPrivateFieldGet2["default"])(this, _frameIndex)];
41
- (0, _classPrivateFieldSet2["default"])(this, _frameIndex, (0, _classPrivateFieldSet2["default"])(this, _frameIndex, (_this$frameIndex = (0, _classPrivateFieldGet2["default"])(this, _frameIndex), ++_this$frameIndex)) % (0, _classPrivateFieldGet2["default"])(this, _frameCount));
32
+ var currentFrame = _spinner["default"].frames[_classPrivateFieldGet(_frameIndex, this)];
33
+ _classPrivateFieldSet(_frameIndex, this, _classPrivateFieldSet(_frameIndex, this, (_this$frameIndex = _classPrivateFieldGet(_frameIndex, this), ++_this$frameIndex)) % _classPrivateFieldGet(_frameCount, this));
42
34
  return currentFrame;
43
35
  }
44
36
  }, {
45
37
  key: "clear",
46
38
  value: function clear() {
47
39
  // Compatibility on Windows
48
- _readline["default"].clearLine((0, _classPrivateFieldGet2["default"])(this, _stream), 0);
49
- _readline["default"].cursorTo((0, _classPrivateFieldGet2["default"])(this, _stream), 0);
40
+ _readline["default"].clearLine(_classPrivateFieldGet(_stream, this), 0);
41
+ _readline["default"].cursorTo(_classPrivateFieldGet(_stream, this), 0);
50
42
  }
51
43
  }, {
52
44
  key: "render",
53
45
  value: function render() {
54
46
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "".concat(this.frame, " BalmJS is initializing...");
55
47
  this.clear();
56
- (0, _classPrivateFieldGet2["default"])(this, _stream).write(text);
48
+ _classPrivateFieldGet(_stream, this).write(text);
57
49
  }
58
50
  }, {
59
51
  key: "succeed",
@@ -62,6 +54,5 @@ var BalmLoading = /*#__PURE__*/function () {
62
54
  console.log("BalmJS core version: ".concat(_version["default"]));
63
55
  }
64
56
  }]);
65
- return BalmLoading;
66
57
  }();
67
58
  var _default = exports["default"] = new BalmLoading();
@@ -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(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
15
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
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
- writable: true,
57
- value: function value(obj) {
58
- var pre = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
59
- var options = Object.assign({
60
- showHidden: false,
61
- depth: 2,
62
- colors: true
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), (0, _classPrivateFieldGet2["default"])(this, _log).call(this, message, logOptions.pre));
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), (0, _classPrivateFieldGet2["default"])(this, _log).call(this, message, logOptions.pre));
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), (0, _classPrivateFieldGet2["default"])(this, _log).call(this, message, logOptions.pre));
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), (0, _classPrivateFieldGet2["default"])(this, _log).call(this, message, logOptions.pre));
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), (0, _classPrivateFieldGet2["default"])(this, _log).call(this, message, logOptions.pre));
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.35.0",
3
+ "version": "3.36.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.5",
44
+ "async": "^3.2.6",
45
45
  "autoprefixer": "9",
46
46
  "babel-loader": "8",
47
- "browser-sync": "^3.0.2",
47
+ "browser-sync": "^3.0.3",
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.19.0",
52
+ "esbuild": "^0.24.0",
53
53
  "fancy-log": "^2.0.0",
54
54
  "file-loader": "6",
55
55
  "gulp-eslint": "^6.0.0",
@@ -60,7 +60,7 @@
60
60
  "gulp-size": "3",
61
61
  "gulp-useref": "^5.0.0",
62
62
  "gulp-zip": "5",
63
- "gulp.spritesmith": "^6.13.0",
63
+ "gulp.spritesmith": "^6.13.1",
64
64
  "html-loader": "1",
65
65
  "html-minifier": "^4.0.0",
66
66
  "html-webpack-plugin": "4",
@@ -69,7 +69,7 @@
69
69
  "istextorbinary": "6",
70
70
  "less": "^4.2.0",
71
71
  "mini-css-extract-plugin": "1",
72
- "modernizr": "^3.13.0",
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",
@@ -90,20 +90,20 @@
90
90
  "ssh2": "0.8.9",
91
91
  "strip-ansi": "6",
92
92
  "style-loader": "2",
93
- "tailwindcss": "npm:@tailwindcss/postcss7-compat",
94
- "terser": "^5.27.0",
93
+ "tailwindcss": "npm:@tailwindcss/postcss7-compat@2.1.4",
94
+ "terser": "^5.36.0",
95
95
  "terser-webpack-plugin": "4",
96
96
  "through2": "^4.0.2",
97
97
  "through2-concurrent": "^2.0.0",
98
- "tslib": "^2.6.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": "^4.10.1",
102
+ "webpack-bundle-analyzer": "^4.10.2",
103
103
  "webpack-dev-middleware": "3",
104
- "webpack-hot-middleware": "^2.26.0",
105
- "webpack-merge": "^5.10.0",
106
- "workbox-build": "^7.0.0"
104
+ "webpack-hot-middleware": "^2.26.1",
105
+ "webpack-merge": "5",
106
+ "workbox-build": "^7.3.0"
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": "8c698f0b5b89ee814bc958f0a96925fcc5fbd7d3"
122
+ "gitHead": "31c867e316d69d6de47bcb9cb2f0e28ea148740a"
123
123
  }