balm-core 3.23.4 → 3.25.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/index.d.ts CHANGED
@@ -29,6 +29,7 @@ interface BalmStyles {
29
29
  extname: string;
30
30
  minify: boolean;
31
31
  atImportPaths: string[];
32
+ entry: string | string[];
32
33
  options: object;
33
34
  sassOptions: object;
34
35
  lessOptions: object;
@@ -7,6 +7,7 @@ exports["default"] = void 0;
7
7
  var extname = 'css';
8
8
  var minify = false;
9
9
  var atImportPaths = [];
10
+ var entry = '';
10
11
  /**
11
12
  * Cssnano optimisations
12
13
  *
@@ -67,6 +68,7 @@ var _default = {
67
68
  extname: extname,
68
69
  minify: minify,
69
70
  atImportPaths: atImportPaths,
71
+ entry: entry,
70
72
  options: options,
71
73
  sassOptions: sassOptions,
72
74
  lessOptions: lessOptions,
package/lib/hello.js CHANGED
@@ -2,12 +2,18 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
+ var _process = require("process");
6
+
5
7
  var _events = require("events");
6
8
 
7
9
  var _cacheCore = _interopRequireDefault(require("./utilities/cache-core"));
8
10
 
9
11
  global.BalmJS = {
10
- emitter: new _events.EventEmitter()
12
+ emitter: new _events.EventEmitter(),
13
+ useCacache: +_process.versions.node.split('.')[0] >= 18
11
14
  };
12
- BalmJS.loading = true;
13
- (0, _cacheCore["default"])();
15
+
16
+ if (!BalmJS.useCacache) {
17
+ BalmJS.loading = true;
18
+ (0, _cacheCore["default"])();
19
+ }
@@ -50,7 +50,18 @@ var BalmStyleTask = /*#__PURE__*/function (_BalmTask) {
50
50
  extname = 'css';
51
51
  }
52
52
 
53
- _this.defaultInput = path.join(BalmJS.config.src.css, '**', "!(_*).".concat(extname));
53
+ if (Array.isArray(BalmJS.config.styles.entry)) {
54
+ _this.defaultInput = BalmJS.config.styles.entry.map(function (styleEntry) {
55
+ return path.join(BalmJS.config.src.css, styleEntry);
56
+ });
57
+ } else {
58
+ if (BalmJS.config.styles.entry) {
59
+ _this.defaultInput = path.join(BalmJS.config.src.css, BalmJS.config.styles.entry);
60
+ } else {
61
+ _this.defaultInput = path.join(BalmJS.config.src.css, '**', "!(_*).".concat(extname));
62
+ }
63
+ }
64
+
54
65
  _this.defaultOutput = BalmJS.config.env.isMP ? path.join(BalmJS.config.dest.base, _constants.MP_ASSETS, BalmJS.config.paths.target.css) : BalmJS.config.dest.css;
55
66
  return _this;
56
67
  }
@@ -36,14 +36,14 @@ var BalmCompiling = /*#__PURE__*/function () {
36
36
  (0, _createClass2["default"])(BalmCompiling, [{
37
37
  key: "start",
38
38
  value: function start() {
39
- if ((0, _classPrivateFieldGet2["default"])(this, _firstCompile)) {
39
+ if (!BalmJS.useCacache && (0, _classPrivateFieldGet2["default"])(this, _firstCompile)) {
40
40
  _loading["default"].render('Compiling to JS...');
41
41
  }
42
42
  }
43
43
  }, {
44
44
  key: "stop",
45
45
  value: function stop() {
46
- if ((0, _classPrivateFieldGet2["default"])(this, _firstCompile)) {
46
+ if (!BalmJS.useCacache && (0, _classPrivateFieldGet2["default"])(this, _firstCompile)) {
47
47
  (0, _classPrivateFieldSet2["default"])(this, _firstCompile, false);
48
48
 
49
49
  _loading["default"].clear();
@@ -80,7 +80,7 @@ var BalmLoading = /*#__PURE__*/function () {
80
80
  key: "succeed",
81
81
  value: function succeed() {
82
82
  this.clear();
83
- console.log("BalmJS version: ".concat(_version["default"]));
83
+ console.log("BalmJS core version: ".concat(_version["default"]));
84
84
  }
85
85
  }]);
86
86
  return BalmLoading;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "balm-core",
3
- "version": "3.23.4",
3
+ "version": "3.25.0",
4
4
  "description": "BalmJS compiler core",
5
5
  "keywords": [
6
6
  "balm",
@@ -40,15 +40,15 @@
40
40
  "directory": "packages/balm-core"
41
41
  },
42
42
  "dependencies": {
43
- "ansi-colors": "^4.1.1",
43
+ "ansi-colors": "^4.1.3",
44
44
  "async": "^3.2.3",
45
45
  "autoprefixer": "9",
46
46
  "babel-loader": "^8.2.5",
47
- "browser-sync": "^2.27.9",
47
+ "browser-sync": "^2.27.10",
48
48
  "connect-history-api-fallback": "^1.6.0",
49
49
  "css-loader": "5",
50
50
  "cssnano": "4",
51
- "del": "^6.0.0",
51
+ "del": "^6.1.0",
52
52
  "esbuild": "^0.14",
53
53
  "fancy-log": "^2.0.0",
54
54
  "file-loader": "^6.2.0",
@@ -104,7 +104,7 @@
104
104
  "workbox-build": "^6.5.3"
105
105
  },
106
106
  "devDependencies": {
107
- "@types/express": "^4.17.13",
107
+ "@types/express": "^4",
108
108
  "@types/node": "^17",
109
109
  "@types/webpack": "4"
110
110
  },
@@ -117,5 +117,5 @@
117
117
  "engines": {
118
118
  "node": ">=10.13.0"
119
119
  },
120
- "gitHead": "7f3e7726a166c664bb41c3d3713e33ba1a85be0d"
120
+ "gitHead": "107637e397df1050aab921958c64b26e3424395a"
121
121
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const extname = 'css';
4
4
  const minify = false;
5
5
  const atImportPaths = [];
6
+ const entry = '';
6
7
  const options = {
7
8
  discardComments: {
8
9
  removeAll: true
@@ -25,6 +26,7 @@ exports.default = {
25
26
  extname,
26
27
  minify,
27
28
  atImportPaths,
29
+ entry,
28
30
  options,
29
31
  sassOptions,
30
32
  lessOptions,
package/tslib/hello.js CHANGED
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const process_1 = require("process");
4
5
  const events_1 = require("events");
5
6
  const cache_core_1 = tslib_1.__importDefault(require("./utilities/cache-core"));
6
7
  global.BalmJS = {
7
- emitter: new events_1.EventEmitter()
8
+ emitter: new events_1.EventEmitter(),
9
+ useCacache: +process_1.versions.node.split('.')[0] >= 18
8
10
  };
9
- BalmJS.loading = true;
10
- (0, cache_core_1.default)();
11
+ if (!BalmJS.useCacache) {
12
+ BalmJS.loading = true;
13
+ (0, cache_core_1.default)();
14
+ }
@@ -17,7 +17,17 @@ class BalmStyleTask extends balm_1.default {
17
17
  default:
18
18
  extname = 'css';
19
19
  }
20
- this.defaultInput = path.join(BalmJS.config.src.css, '**', `!(_*).${extname}`);
20
+ if (Array.isArray(BalmJS.config.styles.entry)) {
21
+ this.defaultInput = BalmJS.config.styles.entry.map((styleEntry) => path.join(BalmJS.config.src.css, styleEntry));
22
+ }
23
+ else {
24
+ if (BalmJS.config.styles.entry) {
25
+ this.defaultInput = path.join(BalmJS.config.src.css, BalmJS.config.styles.entry);
26
+ }
27
+ else {
28
+ this.defaultInput = path.join(BalmJS.config.src.css, '**', `!(_*).${extname}`);
29
+ }
30
+ }
21
31
  this.defaultOutput = BalmJS.config.env.isMP
22
32
  ? path.join(BalmJS.config.dest.base, constants_1.MP_ASSETS, BalmJS.config.paths.target.css)
23
33
  : BalmJS.config.dest.css;
@@ -8,12 +8,12 @@ class BalmCompiling {
8
8
  _BalmCompiling_firstCompile.set(this, true);
9
9
  }
10
10
  start() {
11
- if (tslib_1.__classPrivateFieldGet(this, _BalmCompiling_firstCompile, "f")) {
11
+ if (!BalmJS.useCacache && 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 (tslib_1.__classPrivateFieldGet(this, _BalmCompiling_firstCompile, "f")) {
16
+ if (!BalmJS.useCacache && tslib_1.__classPrivateFieldGet(this, _BalmCompiling_firstCompile, "f")) {
17
17
  tslib_1.__classPrivateFieldSet(this, _BalmCompiling_firstCompile, false, "f");
18
18
  loading_1.default.clear();
19
19
  }
@@ -27,7 +27,7 @@ class BalmLoading {
27
27
  }
28
28
  succeed() {
29
29
  this.clear();
30
- console.log(`BalmJS version: ${version_1.default}`);
30
+ console.log(`BalmJS core version: ${version_1.default}`);
31
31
  }
32
32
  }
33
33
  _BalmLoading_stream = new WeakMap(), _BalmLoading_frameIndex = new WeakMap(), _BalmLoading_frameCount = new WeakMap();