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
package/README.md CHANGED
@@ -5,17 +5,16 @@
5
5
  <br>
6
6
  <br>
7
7
 
8
- [![NPM version][balm-image]][balm-url]
8
+ [![NPM version][balm-core-image]][balm-core-url]
9
9
  [![License][license-image]][license-url]
10
- [![Dependency Status][deps-image]][deps-url]
11
- [![Build Status][travis-image]][travis-url]
12
- [![Build Status][appveyor-image]][appveyor-url]
13
10
  [![Coverage Percentage][cover-image]][cover-url]
14
11
 
15
12
  <h1>BalmJS</h1>
16
13
  <p>An universal Front-End workflow for webapps</p>
17
14
  </div>
18
15
 
16
+ > :tada: [`balm-core@next`](https://github.com/balmjs/balm/tree/main)(v4) supports for `node@12+`, `sass@latest`, `postcss@8`, `webpack@5`
17
+
19
18
  ## Introduction
20
19
 
21
20
  BalmJS prescribes best practices and tools to help you stay productive.
@@ -173,25 +172,19 @@ We'd love for you to contribute and make BalmJS even better than it is today! Pl
173
172
 
174
173
  © 2016-present, [Elf-mousE](http://elf-mouse.me/)
175
174
 
176
- [balm-core-image]: https://badge.fury.io/js/balm-core.svg
175
+ [balm-core-image]: https://img.shields.io/npm/v/balm-core.svg
177
176
  [balm-core-url]: https://npmjs.org/package/balm-core
178
- [balm-image]: https://badge.fury.io/js/balm.svg
177
+ [balm-image]: https://img.shields.io/npm/v/balm.svg
179
178
  [balm-url]: https://npmjs.org/package/balm
180
179
  [license-image]: https://img.shields.io/npm/l/balm-core.svg?sanitize=true
181
180
  [license-url]: https://www.npmjs.com/package/balm-core
182
- [deps-image]: https://david-dm.org/balmjs/balm.svg?path=packages/balm-core&theme=shields.io
183
- [deps-url]: https://david-dm.org/balmjs/balm?path=packages/balm-core
184
- [travis-image]: https://travis-ci.com/balmjs/balm.svg?branch=master
185
- [travis-url]: https://travis-ci.com/balmjs/balm
186
- [appveyor-image]: https://ci.appveyor.com/api/projects/status/github/balmjs/balm?svg=true
187
- [appveyor-url]: https://ci.appveyor.com/project/balmjs/balm
188
181
  [cover-image]: https://coveralls.io/repos/balmjs/balm/badge.svg
189
182
  [cover-url]: https://coveralls.io/r/balmjs/balm
190
- [balm-cli-image]: https://badge.fury.io/js/balm-cli.svg
183
+ [balm-cli-image]: https://img.shields.io/npm/v/balm-cli.svg
191
184
  [balm-cli-url]: https://npmjs.org/package/balm-cli
192
- [balm-ui-lite-image]: https://badge.fury.io/js/balm-ui-lite.svg
185
+ [balm-ui-lite-image]: https://img.shields.io/npm/v/balm-ui-lite.svg
193
186
  [balm-ui-lite-url]: https://npmjs.org/package/balm-ui-lite
194
- [balm-ui-image]: https://badge.fury.io/js/balm-ui.svg
187
+ [balm-ui-image]: https://img.shields.io/npm/v/balm-ui.svg
195
188
  [balm-ui-url]: https://npmjs.org/package/balm-ui
196
- [balm-scroll-image]: https://badge.fury.io/js/balm-scroll.svg
189
+ [balm-scroll-image]: https://img.shields.io/npm/v/balm-scroll.svg
197
190
  [balm-scroll-url]: https://npmjs.org/package/balm-scroll
@@ -10,7 +10,7 @@ var _ansiColors = _interopRequireDefault(require("ansi-colors"));
10
10
 
11
11
  // Set env var for ORIGINAL cwd before anything touches it
12
12
  process.env.BALM_CWD = process.env.INIT_CWD || process.cwd();
13
- var gulpModule = "".concat(process.env.BALM || process.env.BALM_CWD, "/node_modules/gulp/index.js");
13
+ var gulpModule = "".concat(process.env.BALM_ROOT || process.env.BALM_CWD, "/node_modules/gulp/index.js");
14
14
 
15
15
  if (!_fs["default"].existsSync(gulpModule)) {
16
16
  console.error(_ansiColors["default"].bgBlueBright('BalmJS'), _ansiColors["default"].yellow('`balm` module not found :('));
@@ -105,10 +105,10 @@ var externals = ''; // Stats
105
105
 
106
106
  var stats = {
107
107
  colors: true,
108
+ assets: true,
109
+ children: false,
108
110
  chunks: false,
109
- chunkModules: false,
110
- modules: false,
111
- children: false
111
+ modules: false
112
112
  };
113
113
  /**
114
114
  * Full custom webpack configuration
@@ -7,36 +7,111 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = void 0;
9
9
 
10
+ var _stream = require("stream");
11
+
12
+ var _sass = _interopRequireDefault(require("sass"));
13
+
10
14
  var _replaceExt = _interopRequireDefault(require("replace-ext"));
11
15
 
12
16
  var _vinylSourcemapsApply = _interopRequireDefault(require("vinyl-sourcemaps-apply"));
13
17
 
18
+ // Reference `gulp-sass@5.1.0`
14
19
  var PLUGIN_NAME = 'sass';
15
20
 
16
- //////////////////////////////
21
+ var transformObj = function transformObj(transform) {
22
+ return new _stream.Transform({
23
+ transform: transform,
24
+ objectMode: true
25
+ });
26
+ };
27
+ /**
28
+ * Handles returning the file to the stream
29
+ */
30
+
31
+
32
+ var filePush = function filePush(file, sassObject, callback) {
33
+ // Build Source Maps!
34
+ if (sassObject.map) {
35
+ // Transform map into JSON
36
+ var sassMap = JSON.parse(sassObject.map.toString()); // Grab the stdout and transform it into stdin
37
+
38
+ var sassMapFile = sassMap.file.replace(/^stdout$/, 'stdin'); // Grab the base filename that's being worked on
39
+
40
+ var sassFileSrc = file.relative; // Grab the path portion of the file that's being worked on
41
+
42
+ var sassFileSrcPath = path.dirname(sassFileSrc);
43
+
44
+ if (sassFileSrcPath) {
45
+ var sourceFileIndex = sassMap.sources.indexOf(sassMapFile); // Prepend the path to all files in the sources array except the file that's being worked on
46
+
47
+ sassMap.sources = sassMap.sources.map(function (source, index) {
48
+ return index === sourceFileIndex ? source : path.join(sassFileSrcPath, source);
49
+ });
50
+ } // Remove 'stdin' from sources and replace with filenames!
51
+
52
+
53
+ sassMap.sources = sassMap.sources.filter(function (src) {
54
+ return src !== 'stdin' && src;
55
+ }); // Replace the map file with the original filename (but new extension)
56
+
57
+ sassMap.file = (0, _replaceExt["default"])(sassFileSrc, '.css'); // Apply the map
58
+
59
+ (0, _vinylSourcemapsApply["default"])(file, sassMap);
60
+ }
61
+
62
+ file.contents = sassObject.css;
63
+ file.path = (0, _replaceExt["default"])(file.path, '.css');
64
+
65
+ if (file.stat) {
66
+ file.stat.atime = file.stat.mtime = file.stat.ctime = new Date();
67
+ }
68
+
69
+ callback(null, file);
70
+ };
71
+ /**
72
+ * Handles error message
73
+ */
74
+
75
+
76
+ var handleError = function handleError(error, file, callback) {
77
+ var filePath = (error.file === 'stdin' ? file.path : error.file) || file.path;
78
+ var relativePath = path.relative(process.cwd(), filePath);
79
+ var message = "".concat(require('ansi-colors').underline(relativePath), "\n").concat(error.formatted);
80
+ error.messageFormatted = message;
81
+ error.messageOriginal = error.message;
82
+ error.message = require('strip-ansi')(message);
83
+ error.relativePath = relativePath;
84
+ return callback(new PluginError(PLUGIN_NAME, error));
85
+ }; //////////////////////////////
17
86
  // Main Gulp Sass function
18
87
  //////////////////////////////
88
+
89
+
19
90
  var gulpSass = function gulpSass(options) {
20
- return through2.obj(function (file, encoding, cb) {
91
+ return transformObj(function (file, encoding, callback) {
21
92
  if (file.isNull()) {
22
- return cb(null, file);
93
+ callback(null, file);
94
+ return;
23
95
  }
24
96
 
25
97
  if (file.isStream()) {
26
- return cb(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
98
+ callback(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
99
+ return;
27
100
  }
28
101
 
29
- if (path.basename(file.path).indexOf('_') === 0) {
30
- return cb();
102
+ if (path.basename(file.path).startsWith('_')) {
103
+ callback();
104
+ return;
31
105
  }
32
106
 
33
107
  if (!file.contents.length) {
34
108
  file.path = (0, _replaceExt["default"])(file.path, '.css');
35
- return cb(null, file);
109
+ callback(null, file);
110
+ return;
36
111
  }
37
112
 
38
113
  var opts = options || {};
39
- opts.data = file.contents.toString(); // we set the file path here so that libsass can correctly resolve import paths
114
+ opts.data = file.contents.toString(); // We set the file path here so that libsass can correctly resolve import paths
40
115
 
41
116
  opts.file = file.path; // Ensure `indentedSyntax` is true if a `.sass` file
42
117
 
@@ -53,90 +128,25 @@ var gulpSass = function gulpSass(options) {
53
128
  opts.includePaths = [];
54
129
  }
55
130
 
56
- opts.includePaths.unshift(path.dirname(file.path)); // Generate Source Maps if plugin source-map present
131
+ opts.includePaths.unshift(path.dirname(file.path)); // Generate Source Maps if the source-map plugin is present
57
132
 
58
133
  if (file.sourceMap) {
59
134
  opts.sourceMap = file.path;
60
135
  opts.omitSourceMapUrl = true;
61
136
  opts.sourceMapContents = true;
62
137
  } //////////////////////////////
63
- // Handles returning the file to the stream
64
- //////////////////////////////
65
-
66
-
67
- var filePush = function filePush(sassObj) {
68
- var sassMap;
69
- var sassMapFile;
70
- var sassFileSrc;
71
- var sassFileSrcPath;
72
- var sourceFileIndex; // Build Source Maps!
73
-
74
- if (sassObj.map) {
75
- // Transform map into JSON
76
- sassMap = JSON.parse(sassObj.map.toString()); // Grab the stdout and transform it into stdin
77
-
78
- sassMapFile = sassMap.file.replace(/^stdout$/, 'stdin'); // Grab the base file name that's being worked on
79
-
80
- sassFileSrc = file.relative; // Grab the path portion of the file that's being worked on
81
-
82
- sassFileSrcPath = path.dirname(sassFileSrc);
83
-
84
- if (sassFileSrcPath) {
85
- // Prepend the path to all files in the sources array except the file that's being worked on
86
- sourceFileIndex = sassMap.sources.indexOf(sassMapFile);
87
- sassMap.sources = sassMap.sources.map(function (source, index) {
88
- return index === sourceFileIndex ? source : path.join(sassFileSrcPath, source);
89
- });
90
- } // Remove 'stdin' from sources and replace with filenames!
91
-
92
-
93
- sassMap.sources = sassMap.sources.filter(function (src) {
94
- return src !== 'stdin' && src;
95
- }); // Replace the map file with the original file name (but new extension)
96
-
97
- sassMap.file = (0, _replaceExt["default"])(sassFileSrc, '.css'); // Apply the map
98
-
99
- (0, _vinylSourcemapsApply["default"])(file, sassMap);
100
- }
101
-
102
- file.contents = sassObj.css;
103
- file.path = (0, _replaceExt["default"])(file.path, '.css');
104
-
105
- if (file.stat) {
106
- file.stat.atime = file.stat.mtime = file.stat.ctime = new Date();
107
- }
108
-
109
- cb(null, file);
110
- }; //////////////////////////////
111
- // Handles error message
112
- //////////////////////////////
113
-
114
-
115
- var errorM = function errorM(error) {
116
- var filePath = (error.file === 'stdin' ? file.path : error.file) || file.path;
117
- var relativePath = path.relative(process.cwd(), filePath);
118
- var message = [relativePath, error.formatted].join('\n');
119
- error.messageFormatted = message;
120
- error.messageOriginal = error.message;
121
- error.message = require('strip-ansi')(message);
122
- error.relativePath = relativePath;
123
- return cb(new PluginError(PLUGIN_NAME, error));
124
- }; //////////////////////////////
125
138
  // Sync Sass render
126
139
  //////////////////////////////
127
140
 
128
141
 
129
142
  try {
130
- gulpSass.compiler && filePush(gulpSass.compiler.renderSync(opts));
143
+ gulpSass.compiler && filePush(file, gulpSass.compiler.renderSync(opts), callback);
131
144
  } catch (error) {
132
- return errorM(error);
145
+ handleError(error, file, callback);
133
146
  }
134
147
  });
135
148
  };
136
149
 
137
- var _default = function _default(options) {
138
- gulpSass.compiler = require('sass');
139
- return gulpSass(options);
140
- };
141
-
150
+ gulpSass.compiler = _sass["default"];
151
+ var _default = gulpSass;
142
152
  exports["default"] = _default;
@@ -36,7 +36,8 @@ var SassTask = /*#__PURE__*/function (_BalmJS$BalmStyleTask) {
36
36
  get: function get() {
37
37
  return Object.assign({
38
38
  includePaths: BalmJS.file.stylePaths,
39
- outputStyle: 'expanded'
39
+ outputStyle: 'expanded',
40
+ quietDeps: BalmJS.config.logs.level < BalmJS.LogLevel.Warn
40
41
  }, BalmJS.config.styles.sassOptions, this.customOptions);
41
42
  }
42
43
  }, {
@@ -51,20 +51,23 @@ var WebpackTask = /*#__PURE__*/function (_BalmJS$BalmTask) {
51
51
  _compiling["default"].start();
52
52
 
53
53
  BalmJS.webpackCompiler = (0, _webpack.webpack)((0, _webpack.webpackConfig)(_this.input, _this.output, customOptions, isHook), function (error, stats) {
54
- _compiling["default"].stop(); // Handle errors here
55
- // if (error) {
56
- // BalmJS.logger.error(`${this.name} task`, error.stack || error);
57
- // if (error.details) {
58
- // BalmJS.logger.error(`${this.name} task`, error.details);
59
- // }
60
- // return;
61
- // }
54
+ _compiling["default"].stop();
62
55
 
56
+ try {
57
+ var scriptLogLevel = stats.hasErrors() ? BalmJS.LogLevel.Error : stats.hasWarnings() ? BalmJS.LogLevel.Warn : BalmJS.LogLevel.Info;
63
58
 
64
- var scriptLogLevel = stats.hasErrors() ? BalmJS.LogLevel.Error : stats.hasWarnings() ? BalmJS.LogLevel.Warn : BalmJS.LogLevel.Info;
59
+ if (BalmJS.config.logs.level <= scriptLogLevel) {
60
+ console.log(stats.toString(BalmJS.config.scripts.stats));
61
+ }
62
+ } catch (e) {
63
+ // Handle errors here
64
+ BalmJS.logger.error("".concat(_this.name, " task"), error.stack || error);
65
65
 
66
- if (BalmJS.config.logs.level <= scriptLogLevel) {
67
- console.log(stats.toString(BalmJS.config.scripts.stats));
66
+ if (error.details) {
67
+ BalmJS.logger.error("".concat(_this.name, " task"), error.details);
68
+ }
69
+
70
+ return;
68
71
  }
69
72
 
70
73
  fn && fn(); // Done processing
@@ -54,9 +54,11 @@ var BalmLoading = /*#__PURE__*/function () {
54
54
  (0, _createClass2["default"])(BalmLoading, [{
55
55
  key: "frame",
56
56
  get: function get() {
57
+ var _this$frameIndex;
58
+
57
59
  var currentFrame = _spinner["default"].frames[(0, _classPrivateFieldGet2["default"])(this, _frameIndex)];
58
60
 
59
- (0, _classPrivateFieldSet2["default"])(this, _frameIndex, (0, _classPrivateFieldSet2["default"])(this, _frameIndex, +(0, _classPrivateFieldGet2["default"])(this, _frameIndex) + 1) % (0, _classPrivateFieldGet2["default"])(this, _frameCount));
61
+ (0, _classPrivateFieldSet2["default"])(this, _frameIndex, (0, _classPrivateFieldSet2["default"])(this, _frameIndex, (_this$frameIndex = (0, _classPrivateFieldGet2["default"])(this, _frameIndex), ++_this$frameIndex)) % (0, _classPrivateFieldGet2["default"])(this, _frameCount));
60
62
  return currentFrame;
61
63
  }
62
64
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "balm-core",
3
- "version": "3.21.0",
3
+ "version": "3.23.1",
4
4
  "description": "BalmJS compiler core",
5
5
  "keywords": [
6
6
  "balm",
@@ -42,12 +42,12 @@
42
42
  "dependencies": {
43
43
  "ansi-colors": "^4.1.1",
44
44
  "async": "^3.2.3",
45
- "autoprefixer": "^10.4.2",
46
- "babel-loader": "^8.2.3",
47
- "browser-sync": "^2.27.7",
45
+ "autoprefixer": "9",
46
+ "babel-loader": "^8.2.5",
47
+ "browser-sync": "^2.27.9",
48
48
  "connect-history-api-fallback": "^1.6.0",
49
49
  "css-loader": "5",
50
- "cssnano": "^5.0.15",
50
+ "cssnano": "4",
51
51
  "del": "^6.0.0",
52
52
  "esbuild": "^0.14",
53
53
  "fancy-log": "^2.0.0",
@@ -69,31 +69,31 @@
69
69
  "istextorbinary": "^6.0.0",
70
70
  "less": "^4.1.2",
71
71
  "mini-css-extract-plugin": "1",
72
- "modernizr": "^3.11.8",
72
+ "modernizr": "^3.12.0",
73
73
  "optimize-css-assets-webpack-plugin": "^6.0.1",
74
74
  "parents": "^1.0.1",
75
75
  "plugin-error": "^1.0.1",
76
- "postcss": "^8.4.5",
77
- "postcss-import": "^14.0.2",
78
- "postcss-load-config": "^3.1.1",
76
+ "postcss": "7",
77
+ "postcss-import": "12",
78
+ "postcss-load-config": "2",
79
79
  "postcss-loader": "4",
80
80
  "postcss-preset-env": "6",
81
81
  "postcss-safe-parser": "5",
82
- "pretty-bytes": "^5.6.0",
82
+ "pretty-bytes": "5",
83
83
  "readable-stream": "^3.6.0",
84
84
  "replace-ext": "^2.0.0",
85
85
  "require-dir": "^1.2.0",
86
- "rollup": "^2.64.0",
86
+ "rollup": "^2.68.0",
87
87
  "rollup-plugin-terser": "^7.0.2",
88
88
  "sass": "1.39.2",
89
89
  "ssh2": "0.8.9",
90
90
  "strip-ansi": "6",
91
91
  "style-loader": "2",
92
- "terser": "^5.10.0",
92
+ "terser": "^5.13.0",
93
93
  "terser-webpack-plugin": "4",
94
94
  "through2": "^4.0.2",
95
95
  "through2-concurrent": "^2.0.0",
96
- "tslib": "^2.3.1",
96
+ "tslib": "^2.4.0",
97
97
  "url-loader": "^4.1.1",
98
98
  "vinyl-sourcemaps-apply": "^0.2.1",
99
99
  "webpack": "4",
@@ -101,11 +101,11 @@
101
101
  "webpack-dev-middleware": "3",
102
102
  "webpack-hot-middleware": "^2.25.1",
103
103
  "webpack-merge": "^5.8.0",
104
- "workbox-build": "^6.4.2"
104
+ "workbox-build": "^6.5.3"
105
105
  },
106
106
  "devDependencies": {
107
107
  "@types/express": "^4.17.13",
108
- "@types/node": "^17.0.8",
108
+ "@types/node": "^17",
109
109
  "@types/webpack": "4"
110
110
  },
111
111
  "optionalDependencies": {
@@ -117,5 +117,5 @@
117
117
  "engines": {
118
118
  "node": ">=10.13.0"
119
119
  },
120
- "gitHead": "6b13ad753b6a6d20435a5a80d3f703c3f1a4820c"
120
+ "gitHead": "dc9280e2ecb912ff389d795634ad460a4ac2e962"
121
121
  }
package/tslib/balm.js CHANGED
@@ -5,22 +5,22 @@ const tslib_1 = require("tslib");
5
5
  require("./config");
6
6
  require("./utilities");
7
7
  require("./plugins");
8
- const tasks_1 = (0, tslib_1.__importDefault)(require("./tasks"));
8
+ const tasks_1 = tslib_1.__importDefault(require("./tasks"));
9
9
  const bootstrap_1 = require("./bootstrap");
10
- const loading_1 = (0, tslib_1.__importDefault)(require("./utilities/loading"));
10
+ const loading_1 = tslib_1.__importDefault(require("./utilities/loading"));
11
11
  class Balm {
12
12
  constructor() {
13
13
  _Balm_config.set(this, void 0);
14
14
  BalmJS.loading = false;
15
15
  loading_1.default.succeed();
16
- (0, tslib_1.__classPrivateFieldSet)(this, _Balm_config, BalmJS.config, "f");
16
+ tslib_1.__classPrivateFieldSet(this, _Balm_config, BalmJS.config, "f");
17
17
  }
18
18
  get config() {
19
- return (0, tslib_1.__classPrivateFieldGet)(this, _Balm_config, "f");
19
+ return tslib_1.__classPrivateFieldGet(this, _Balm_config, "f");
20
20
  }
21
21
  set config(value) {
22
- (0, tslib_1.__classPrivateFieldSet)(this, _Balm_config, (0, bootstrap_1.setConfig)(value), "f");
23
- BalmJS.config = (0, tslib_1.__classPrivateFieldGet)(this, _Balm_config, "f");
22
+ tslib_1.__classPrivateFieldSet(this, _Balm_config, (0, bootstrap_1.setConfig)(value), "f");
23
+ BalmJS.config = tslib_1.__classPrivateFieldGet(this, _Balm_config, "f");
24
24
  }
25
25
  set beforeTask(name) {
26
26
  BalmJS.beforeTask = (0, bootstrap_1.setTask)(name);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setTask = exports.setConfig = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const check_config_1 = (0, tslib_1.__importDefault)(require("./check_config"));
5
+ const check_config_1 = tslib_1.__importDefault(require("./check_config"));
6
6
  const constants_1 = require("../config/constants");
7
7
  function createQuickPath(config, rootKey) {
8
8
  const result = {};
@@ -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 build_1 = (0, tslib_1.__importDefault)(require("./build"));
5
- const transform_1 = (0, tslib_1.__importDefault)(require("./transform"));
4
+ const build_1 = tslib_1.__importDefault(require("./build"));
5
+ const transform_1 = tslib_1.__importDefault(require("./transform"));
6
6
  const esbuild = (input, output, customOptions, callback) => {
7
7
  const entryPoints = BalmJS.utils.isString(input)
8
8
  ? [input]
@@ -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 fs_1 = (0, tslib_1.__importDefault)(require("fs"));
4
+ const fs_1 = tslib_1.__importDefault(require("fs"));
5
5
  const options_1 = require("./options");
6
6
  const esTransform = (entryPoints, output, customTransformOptions, callback) => {
7
7
  const build = {
@@ -15,7 +15,7 @@ const esTransform = (entryPoints, output, customTransformOptions, callback) => {
15
15
  var e_1, _a;
16
16
  try {
17
17
  try {
18
- for (var entryPoints_1 = (0, tslib_1.__asyncValues)(entryPoints), entryPoints_1_1; entryPoints_1_1 = await entryPoints_1.next(), !entryPoints_1_1.done;) {
18
+ for (var entryPoints_1 = tslib_1.__asyncValues(entryPoints), entryPoints_1_1; entryPoints_1_1 = await entryPoints_1.next(), !entryPoints_1_1.done;) {
19
19
  const entryPoint = entryPoints_1_1.value;
20
20
  build.input = BalmJS.file.absPath(entryPoint);
21
21
  BalmJS.logger.debug('esbuild bundler - transform', {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const entry_1 = (0, tslib_1.__importDefault)(require("./entry"));
5
- const output_1 = (0, tslib_1.__importDefault)(require("./output"));
6
- const build_1 = (0, tslib_1.__importDefault)(require("./build"));
4
+ const entry_1 = tslib_1.__importDefault(require("./entry"));
5
+ const output_1 = tslib_1.__importDefault(require("./output"));
6
+ const build_1 = tslib_1.__importDefault(require("./build"));
7
7
  const buildLibrary = async (inputOptions, outputOptions) => {
8
8
  var e_1, _a;
9
9
  const rollup = require('rollup');
@@ -15,7 +15,7 @@ const buildLibrary = async (inputOptions, outputOptions) => {
15
15
  const bundle = await rollup.rollup(rollupOptions);
16
16
  if (Array.isArray(outputOptions)) {
17
17
  try {
18
- for (var outputOptions_1 = (0, tslib_1.__asyncValues)(outputOptions), outputOptions_1_1; outputOptions_1_1 = await outputOptions_1.next(), !outputOptions_1_1.done;) {
18
+ for (var outputOptions_1 = tslib_1.__asyncValues(outputOptions), outputOptions_1_1; outputOptions_1_1 = await outputOptions_1.next(), !outputOptions_1_1.done;) {
19
19
  const outputOption = outputOptions_1_1.value;
20
20
  await (0, build_1.default)(bundle, outputOption);
21
21
  }
@@ -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 loaders_1 = (0, tslib_1.__importDefault)(require("../loaders"));
4
+ const loaders_1 = tslib_1.__importDefault(require("../loaders"));
5
5
  const constants_1 = require("../../../config/constants");
6
6
  function getDefaultPlugins(webpack, scripts) {
7
7
  const plugins = [
@@ -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 webpack_merge_1 = (0, tslib_1.__importDefault)(require("webpack-merge"));
5
- const common_1 = (0, tslib_1.__importDefault)(require("./common"));
4
+ const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
5
+ const common_1 = tslib_1.__importDefault(require("./common"));
6
6
  function getDevConfig(webpack, scripts) {
7
7
  return (0, webpack_merge_1.default)((0, common_1.default)(webpack, scripts), {
8
8
  mode: 'development',
@@ -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 dev_1 = (0, tslib_1.__importDefault)(require("./dev"));
5
- const prod_1 = (0, tslib_1.__importDefault)(require("./prod"));
4
+ const dev_1 = tslib_1.__importDefault(require("./dev"));
5
+ const prod_1 = tslib_1.__importDefault(require("./prod"));
6
6
  function getDefaultConfig(webpack, scripts) {
7
7
  return BalmJS.config.env.isProd || scripts.minify || scripts.ie8
8
8
  ? (0, prod_1.default)(webpack, scripts)
@@ -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 webpack_merge_1 = (0, tslib_1.__importDefault)(require("webpack-merge"));
5
- const common_1 = (0, tslib_1.__importDefault)(require("./common"));
4
+ const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
5
+ const common_1 = tslib_1.__importDefault(require("./common"));
6
6
  const constants_1 = require("../../../config/constants");
7
7
  const bundleAnalyzerReport = process.env.npm_config_report || false;
8
8
  const getCssFilename = () => `${BalmJS.config.paths.target.css}/${constants_1.ASYNC_SCRIPTS}/[name].${constants_1.HASH_NAME_PROD}.css`;
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.webpackConfig = exports.webpack = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const webpack_merge_1 = (0, tslib_1.__importDefault)(require("webpack-merge"));
6
- const entry_1 = (0, tslib_1.__importDefault)(require("./entry"));
7
- const output_1 = (0, tslib_1.__importDefault)(require("./output"));
8
- const config_1 = (0, tslib_1.__importDefault)(require("./config"));
5
+ const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
6
+ const entry_1 = tslib_1.__importDefault(require("./entry"));
7
+ const output_1 = tslib_1.__importDefault(require("./output"));
8
+ const config_1 = tslib_1.__importDefault(require("./config"));
9
9
  const webpackModule = process.env.WEBPACK || require.resolve('webpack');
10
10
  const webpack = require(webpackModule);
11
11
  exports.webpack = webpack;
@@ -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 webpack_merge_1 = (0, tslib_1.__importDefault)(require("webpack-merge"));
5
- const require_dir_1 = (0, tslib_1.__importDefault)(require("require-dir"));
4
+ const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
5
+ const require_dir_1 = tslib_1.__importDefault(require("require-dir"));
6
6
  const LOADERS = (0, require_dir_1.default)('./rules');
7
7
  function getLoaders(customLoaders) {
8
8
  const enableDefaultLoaders = Object.assign({
@@ -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 fs_1 = (0, tslib_1.__importDefault)(require("fs"));
5
- const path_1 = (0, tslib_1.__importDefault)(require("path"));
6
- const ansi_colors_1 = (0, tslib_1.__importDefault)(require("ansi-colors"));
4
+ const fs_1 = tslib_1.__importDefault(require("fs"));
5
+ const path_1 = tslib_1.__importDefault(require("path"));
6
+ const ansi_colors_1 = tslib_1.__importDefault(require("ansi-colors"));
7
7
  process.env.BALM_CWD = process.env.INIT_CWD || process.cwd();
8
- const gulpModule = `${process.env.BALM || process.env.BALM_CWD}/node_modules/gulp/index.js`;
8
+ const gulpModule = `${process.env.BALM_ROOT || process.env.BALM_CWD}/node_modules/gulp/index.js`;
9
9
  if (!fs_1.default.existsSync(gulpModule)) {
10
10
  console.error(ansi_colors_1.default.bgBlueBright('BalmJS'), ansi_colors_1.default.yellow('`balm` module not found :('));
11
11
  process.exit(1);