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.
- package/README.md +9 -16
- package/lib/config/globals.js +1 -1
- package/lib/config/scripts.js +3 -3
- package/lib/plugins/sass.js +88 -78
- package/lib/tasks/public/sass.js +2 -1
- package/lib/tasks/public/webpack.js +14 -11
- package/lib/utilities/loading.js +3 -1
- package/package.json +16 -16
- package/tslib/balm.js +6 -6
- package/tslib/bootstrap/index.js +1 -1
- package/tslib/bundler/esbuild/index.js +2 -2
- package/tslib/bundler/esbuild/transform.js +2 -2
- package/tslib/bundler/rollup/index.js +4 -4
- package/tslib/bundler/webpack/config/common.js +1 -1
- package/tslib/bundler/webpack/config/dev.js +2 -2
- package/tslib/bundler/webpack/config/index.js +2 -2
- package/tslib/bundler/webpack/config/prod.js +2 -2
- package/tslib/bundler/webpack/index.js +4 -4
- package/tslib/bundler/webpack/loaders.js +2 -2
- package/tslib/config/globals.js +4 -4
- package/tslib/config/index.js +13 -13
- package/tslib/config/scripts.js +3 -3
- package/tslib/config/version.js +1 -1
- package/tslib/hello.js +1 -1
- package/tslib/hooks/index.js +1 -1
- package/tslib/index.js +2 -2
- package/tslib/middlewares/index.js +3 -3
- package/tslib/plugins/imagemin.js +1 -1
- package/tslib/plugins/index.js +11 -11
- package/tslib/plugins/less.js +3 -3
- package/tslib/plugins/postcss.js +1 -1
- package/tslib/plugins/replace.js +1 -1
- package/tslib/plugins/sass.js +52 -55
- package/tslib/plugins/sftp.js +1 -1
- package/tslib/tasks/foundation/balm_style.js +1 -1
- package/tslib/tasks/foundation/index.js +2 -2
- package/tslib/tasks/index.js +3 -3
- package/tslib/tasks/private/clean.js +2 -2
- package/tslib/tasks/private/modernizr.js +4 -4
- package/tslib/tasks/private/sprite.js +4 -4
- package/tslib/tasks/public/esbuild.js +1 -1
- package/tslib/tasks/public/html.js +5 -5
- package/tslib/tasks/public/publish.js +3 -3
- package/tslib/tasks/public/remove.js +1 -1
- package/tslib/tasks/public/rollup.js +1 -1
- package/tslib/tasks/public/sass.js +2 -1
- package/tslib/tasks/public/server.js +9 -9
- package/tslib/tasks/public/url.js +2 -2
- package/tslib/tasks/public/webpack.js +17 -8
- package/tslib/utilities/address.js +1 -1
- package/tslib/utilities/cache-core.js +3 -3
- package/tslib/utilities/color.js +1 -1
- package/tslib/utilities/compiling.js +4 -4
- package/tslib/utilities/detect-port.js +2 -2
- package/tslib/utilities/file.js +2 -2
- package/tslib/utilities/index.js +4 -4
- package/tslib/utilities/loading.js +8 -8
- package/tslib/utilities/logger.js +8 -8
- package/tslib/utilities/replacestream.js +1 -1
- package/tslib/utilities/utils.js +1 -1
package/tslib/config/index.js
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
require("./globals");
|
|
5
|
-
const env_1 =
|
|
6
|
-
const roots_1 =
|
|
7
|
-
const paths_1 =
|
|
8
|
-
const html_1 =
|
|
9
|
-
const styles_1 =
|
|
10
|
-
const scripts_1 =
|
|
11
|
-
const images_1 =
|
|
12
|
-
const extras_1 =
|
|
13
|
-
const assets_1 =
|
|
14
|
-
const server_1 =
|
|
15
|
-
const ftp_1 =
|
|
16
|
-
const pwa_1 =
|
|
17
|
-
const logs_1 =
|
|
5
|
+
const env_1 = tslib_1.__importDefault(require("./env"));
|
|
6
|
+
const roots_1 = tslib_1.__importDefault(require("./roots"));
|
|
7
|
+
const paths_1 = tslib_1.__importDefault(require("./paths"));
|
|
8
|
+
const html_1 = tslib_1.__importDefault(require("./html"));
|
|
9
|
+
const styles_1 = tslib_1.__importDefault(require("./styles"));
|
|
10
|
+
const scripts_1 = tslib_1.__importDefault(require("./scripts"));
|
|
11
|
+
const images_1 = tslib_1.__importDefault(require("./images"));
|
|
12
|
+
const extras_1 = tslib_1.__importDefault(require("./extras"));
|
|
13
|
+
const assets_1 = tslib_1.__importDefault(require("./assets"));
|
|
14
|
+
const server_1 = tslib_1.__importDefault(require("./server"));
|
|
15
|
+
const ftp_1 = tslib_1.__importDefault(require("./ftp"));
|
|
16
|
+
const pwa_1 = tslib_1.__importDefault(require("./pwa"));
|
|
17
|
+
const logs_1 = tslib_1.__importDefault(require("./logs"));
|
|
18
18
|
var LogLevel;
|
|
19
19
|
(function (LogLevel) {
|
|
20
20
|
LogLevel[LogLevel["Trace"] = 0] = "Trace";
|
package/tslib/config/scripts.js
CHANGED
|
@@ -42,10 +42,10 @@ const target = 'web';
|
|
|
42
42
|
const externals = '';
|
|
43
43
|
const stats = {
|
|
44
44
|
colors: true,
|
|
45
|
+
assets: true,
|
|
46
|
+
children: false,
|
|
45
47
|
chunks: false,
|
|
46
|
-
|
|
47
|
-
modules: false,
|
|
48
|
-
children: false
|
|
48
|
+
modules: false
|
|
49
49
|
};
|
|
50
50
|
const webpackOptions = {};
|
|
51
51
|
const optimization = {};
|
package/tslib/config/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const package_json_1 =
|
|
4
|
+
const package_json_1 = tslib_1.__importDefault(require("../../package.json"));
|
|
5
5
|
exports.default = package_json_1.default.version;
|
package/tslib/hello.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const events_1 = require("events");
|
|
5
|
-
const cache_core_1 =
|
|
5
|
+
const cache_core_1 = tslib_1.__importDefault(require("./utilities/cache-core"));
|
|
6
6
|
global.BalmJS = {
|
|
7
7
|
emitter: new events_1.EventEmitter()
|
|
8
8
|
};
|
package/tslib/hooks/index.js
CHANGED
|
@@ -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 maker_1 =
|
|
4
|
+
const maker_1 = tslib_1.__importDefault(require("./maker"));
|
|
5
5
|
class BaseHooks {
|
|
6
6
|
get env() {
|
|
7
7
|
return BalmJS.config.env;
|
package/tslib/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.version = exports.Balm = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const version_1 =
|
|
5
|
+
const version_1 = tslib_1.__importDefault(require("./config/version"));
|
|
6
6
|
exports.version = version_1.default;
|
|
7
7
|
require("./hello");
|
|
8
|
-
const balm_1 =
|
|
8
|
+
const balm_1 = tslib_1.__importDefault(require("./balm"));
|
|
9
9
|
exports.Balm = balm_1.default;
|
|
10
10
|
const balm = new balm_1.default();
|
|
11
11
|
exports.default = balm;
|
|
@@ -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 webpack_1 =
|
|
5
|
-
const proxy_1 =
|
|
6
|
-
const history_1 =
|
|
4
|
+
const webpack_1 = tslib_1.__importDefault(require("./webpack"));
|
|
5
|
+
const proxy_1 = tslib_1.__importDefault(require("./proxy"));
|
|
6
|
+
const history_1 = tslib_1.__importDefault(require("./history"));
|
|
7
7
|
function getMiddlewares() {
|
|
8
8
|
const canOverride = BalmJS.config.server.middlewares.every((middleware) => BalmJS.utils.isFunction(middleware) || BalmJS.utils.isObject(middleware));
|
|
9
9
|
if (!canOverride) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDefaultImagePlugins = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const pretty_bytes_1 =
|
|
5
|
+
const pretty_bytes_1 = tslib_1.__importDefault(require("pretty-bytes"));
|
|
6
6
|
const PLUGIN_NAME = 'imagemin';
|
|
7
7
|
const defaultPlugins = ['gifsicle', 'mozjpeg', 'optipng', 'svgo'];
|
|
8
8
|
const loadPlugin = (plugin, ...args) => {
|
package/tslib/plugins/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const htmlmin_1 =
|
|
5
|
-
const imagemin_1 =
|
|
6
|
-
const jsmin_1 =
|
|
7
|
-
const less_1 =
|
|
8
|
-
const plumber_1 =
|
|
9
|
-
const postcss_1 =
|
|
10
|
-
const postcss_plugins_1 =
|
|
11
|
-
const rename_1 =
|
|
12
|
-
const replace_1 =
|
|
13
|
-
const sass_1 =
|
|
14
|
-
const sftp_1 =
|
|
4
|
+
const htmlmin_1 = tslib_1.__importDefault(require("./htmlmin"));
|
|
5
|
+
const imagemin_1 = tslib_1.__importDefault(require("./imagemin"));
|
|
6
|
+
const jsmin_1 = tslib_1.__importDefault(require("./jsmin"));
|
|
7
|
+
const less_1 = tslib_1.__importDefault(require("./less"));
|
|
8
|
+
const plumber_1 = tslib_1.__importDefault(require("./plumber"));
|
|
9
|
+
const postcss_1 = tslib_1.__importDefault(require("./postcss"));
|
|
10
|
+
const postcss_plugins_1 = tslib_1.__importDefault(require("./postcss-plugins"));
|
|
11
|
+
const rename_1 = tslib_1.__importDefault(require("./rename"));
|
|
12
|
+
const replace_1 = tslib_1.__importDefault(require("./replace"));
|
|
13
|
+
const sass_1 = tslib_1.__importDefault(require("./sass"));
|
|
14
|
+
const sftp_1 = tslib_1.__importDefault(require("./sftp"));
|
|
15
15
|
const plugins = {
|
|
16
16
|
htmlmin: htmlmin_1.default,
|
|
17
17
|
imagemin: imagemin_1.default,
|
package/tslib/plugins/less.js
CHANGED
|
@@ -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 fs_1 =
|
|
5
|
-
const replace_ext_1 =
|
|
6
|
-
const vinyl_sourcemaps_apply_1 =
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
|
+
const replace_ext_1 = tslib_1.__importDefault(require("replace-ext"));
|
|
6
|
+
const vinyl_sourcemaps_apply_1 = tslib_1.__importDefault(require("vinyl-sourcemaps-apply"));
|
|
7
7
|
const PLUGIN_NAME = 'less';
|
|
8
8
|
function inlineSources(sourcemap) {
|
|
9
9
|
if (sourcemap.sourcesContent) {
|
package/tslib/plugins/postcss.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const stream_1 = require("stream");
|
|
5
|
-
const vinyl_sourcemaps_apply_1 =
|
|
5
|
+
const vinyl_sourcemaps_apply_1 = tslib_1.__importDefault(require("vinyl-sourcemaps-apply"));
|
|
6
6
|
const PLUGIN_NAME = 'postcss';
|
|
7
7
|
function gulpPostcss(cb) {
|
|
8
8
|
return function (plugins, options) {
|
package/tslib/plugins/replace.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const stream_1 = require("stream");
|
|
5
|
-
const replacestream_1 =
|
|
5
|
+
const replacestream_1 = tslib_1.__importDefault(require("../utilities/replacestream"));
|
|
6
6
|
const defaultOptions = {
|
|
7
7
|
skipBinary: true
|
|
8
8
|
};
|
package/tslib/plugins/sass.js
CHANGED
|
@@ -1,22 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const stream_1 = require("stream");
|
|
5
|
+
const sass_1 = tslib_1.__importDefault(require("sass"));
|
|
6
|
+
const replace_ext_1 = tslib_1.__importDefault(require("replace-ext"));
|
|
7
|
+
const vinyl_sourcemaps_apply_1 = tslib_1.__importDefault(require("vinyl-sourcemaps-apply"));
|
|
6
8
|
const PLUGIN_NAME = 'sass';
|
|
7
|
-
const
|
|
9
|
+
const transformObj = (transform) => new stream_1.Transform({ transform, objectMode: true });
|
|
10
|
+
const filePush = (file, sassObject, callback) => {
|
|
11
|
+
if (sassObject.map) {
|
|
12
|
+
const sassMap = JSON.parse(sassObject.map.toString());
|
|
13
|
+
const sassMapFile = sassMap.file.replace(/^stdout$/, 'stdin');
|
|
14
|
+
const sassFileSrc = file.relative;
|
|
15
|
+
const sassFileSrcPath = path.dirname(sassFileSrc);
|
|
16
|
+
if (sassFileSrcPath) {
|
|
17
|
+
const sourceFileIndex = sassMap.sources.indexOf(sassMapFile);
|
|
18
|
+
sassMap.sources = sassMap.sources.map((source, index) => index === sourceFileIndex ? source : path.join(sassFileSrcPath, source));
|
|
19
|
+
}
|
|
20
|
+
sassMap.sources = sassMap.sources.filter((src) => src !== 'stdin' && src);
|
|
21
|
+
sassMap.file = (0, replace_ext_1.default)(sassFileSrc, '.css');
|
|
22
|
+
(0, vinyl_sourcemaps_apply_1.default)(file, sassMap);
|
|
23
|
+
}
|
|
24
|
+
file.contents = sassObject.css;
|
|
25
|
+
file.path = (0, replace_ext_1.default)(file.path, '.css');
|
|
26
|
+
if (file.stat) {
|
|
27
|
+
file.stat.atime = file.stat.mtime = file.stat.ctime = new Date();
|
|
28
|
+
}
|
|
29
|
+
callback(null, file);
|
|
30
|
+
};
|
|
31
|
+
const handleError = (error, file, callback) => {
|
|
32
|
+
const filePath = ((error.file === 'stdin' ? file.path : error.file) ||
|
|
33
|
+
file.path);
|
|
34
|
+
const relativePath = path.relative(process.cwd(), filePath);
|
|
35
|
+
const message = `${require('ansi-colors').underline(relativePath)}\n${error.formatted}`;
|
|
36
|
+
error.messageFormatted = message;
|
|
37
|
+
error.messageOriginal = error.message;
|
|
38
|
+
error.message = require('strip-ansi')(message);
|
|
39
|
+
error.relativePath = relativePath;
|
|
40
|
+
return callback(new PluginError(PLUGIN_NAME, error));
|
|
41
|
+
};
|
|
42
|
+
const gulpSass = (options) => transformObj((file, encoding, callback) => {
|
|
8
43
|
if (file.isNull()) {
|
|
9
|
-
|
|
44
|
+
callback(null, file);
|
|
45
|
+
return;
|
|
10
46
|
}
|
|
11
47
|
if (file.isStream()) {
|
|
12
|
-
|
|
48
|
+
callback(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
|
|
49
|
+
return;
|
|
13
50
|
}
|
|
14
|
-
if (path.basename(file.path).
|
|
15
|
-
|
|
51
|
+
if (path.basename(file.path).startsWith('_')) {
|
|
52
|
+
callback();
|
|
53
|
+
return;
|
|
16
54
|
}
|
|
17
55
|
if (!file.contents.length) {
|
|
18
56
|
file.path = (0, replace_ext_1.default)(file.path, '.css');
|
|
19
|
-
|
|
57
|
+
callback(null, file);
|
|
58
|
+
return;
|
|
20
59
|
}
|
|
21
60
|
const opts = (options || {});
|
|
22
61
|
opts.data = file.contents.toString();
|
|
@@ -38,55 +77,13 @@ const gulpSass = (options) => through2.obj((file, encoding, cb) => {
|
|
|
38
77
|
opts.omitSourceMapUrl = true;
|
|
39
78
|
opts.sourceMapContents = true;
|
|
40
79
|
}
|
|
41
|
-
const filePush = (sassObj) => {
|
|
42
|
-
let sassMap;
|
|
43
|
-
let sassMapFile;
|
|
44
|
-
let sassFileSrc;
|
|
45
|
-
let sassFileSrcPath;
|
|
46
|
-
let sourceFileIndex;
|
|
47
|
-
if (sassObj.map) {
|
|
48
|
-
sassMap = JSON.parse(sassObj.map.toString());
|
|
49
|
-
sassMapFile = sassMap.file.replace(/^stdout$/, 'stdin');
|
|
50
|
-
sassFileSrc = file.relative;
|
|
51
|
-
sassFileSrcPath = path.dirname(sassFileSrc);
|
|
52
|
-
if (sassFileSrcPath) {
|
|
53
|
-
sourceFileIndex = sassMap.sources.indexOf(sassMapFile);
|
|
54
|
-
sassMap.sources = sassMap.sources.map((source, index) => {
|
|
55
|
-
return index === sourceFileIndex
|
|
56
|
-
? source
|
|
57
|
-
: path.join(sassFileSrcPath, source);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
sassMap.sources = sassMap.sources.filter((src) => src !== 'stdin' && src);
|
|
61
|
-
sassMap.file = (0, replace_ext_1.default)(sassFileSrc, '.css');
|
|
62
|
-
(0, vinyl_sourcemaps_apply_1.default)(file, sassMap);
|
|
63
|
-
}
|
|
64
|
-
file.contents = sassObj.css;
|
|
65
|
-
file.path = (0, replace_ext_1.default)(file.path, '.css');
|
|
66
|
-
if (file.stat) {
|
|
67
|
-
file.stat.atime = file.stat.mtime = file.stat.ctime = new Date();
|
|
68
|
-
}
|
|
69
|
-
cb(null, file);
|
|
70
|
-
};
|
|
71
|
-
const errorM = (error) => {
|
|
72
|
-
const filePath = ((error.file === 'stdin' ? file.path : error.file) ||
|
|
73
|
-
file.path);
|
|
74
|
-
const relativePath = path.relative(process.cwd(), filePath);
|
|
75
|
-
const message = [relativePath, error.formatted].join('\n');
|
|
76
|
-
error.messageFormatted = message;
|
|
77
|
-
error.messageOriginal = error.message;
|
|
78
|
-
error.message = require('strip-ansi')(message);
|
|
79
|
-
error.relativePath = relativePath;
|
|
80
|
-
return cb(new PluginError(PLUGIN_NAME, error));
|
|
81
|
-
};
|
|
82
80
|
try {
|
|
83
|
-
gulpSass.compiler &&
|
|
81
|
+
gulpSass.compiler &&
|
|
82
|
+
filePush(file, gulpSass.compiler.renderSync(opts), callback);
|
|
84
83
|
}
|
|
85
84
|
catch (error) {
|
|
86
|
-
|
|
85
|
+
handleError(error, file, callback);
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return gulpSass(options);
|
|
92
|
-
};
|
|
88
|
+
gulpSass.compiler = sass_1.default;
|
|
89
|
+
exports.default = gulpSass;
|
package/tslib/plugins/sftp.js
CHANGED
|
@@ -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 =
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
5
|
const PLUGIN_NAME = 'sftp';
|
|
6
6
|
const normalizePath = (_path) => _path.replace(/\\/g, '/');
|
|
7
7
|
function resolveHomePath(key) {
|
|
@@ -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 balm_1 =
|
|
4
|
+
const balm_1 = tslib_1.__importDefault(require("./balm"));
|
|
5
5
|
const constants_1 = require("../../config/constants");
|
|
6
6
|
class BalmStyleTask extends balm_1.default {
|
|
7
7
|
constructor(name) {
|
|
@@ -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 balm_1 =
|
|
5
|
-
const balm_style_1 =
|
|
4
|
+
const balm_1 = tslib_1.__importDefault(require("./balm"));
|
|
5
|
+
const balm_style_1 = tslib_1.__importDefault(require("./balm_style"));
|
|
6
6
|
BalmJS.BalmTask = balm_1.default;
|
|
7
7
|
BalmJS.BalmStyleTask = balm_style_1.default;
|
|
8
8
|
BalmJS.tasks = new Map();
|
package/tslib/tasks/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
require("./foundation");
|
|
5
|
-
const require_dir_1 =
|
|
6
|
-
const default_1 =
|
|
7
|
-
const hooks_1 =
|
|
5
|
+
const require_dir_1 = tslib_1.__importDefault(require("require-dir"));
|
|
6
|
+
const default_1 = tslib_1.__importDefault(require("./default"));
|
|
7
|
+
const hooks_1 = tslib_1.__importDefault(require("../hooks"));
|
|
8
8
|
const PRIVATE_TASKS = (0, require_dir_1.default)('./private');
|
|
9
9
|
const PUBLIC_TASKS = (0, require_dir_1.default)('./public');
|
|
10
10
|
function registerTasks(recipe) {
|
|
@@ -52,7 +52,7 @@ class CleanTask extends BalmJS.BalmTask {
|
|
|
52
52
|
get remoteAppDir() {
|
|
53
53
|
return BalmJS.config.assets.subDir
|
|
54
54
|
? [BalmJS.config.assets.static]
|
|
55
|
-
:
|
|
55
|
+
: tslib_1.__classPrivateFieldGet(this, _CleanTask_getAssetsDir, "f").call(this);
|
|
56
56
|
}
|
|
57
57
|
get dirInFrontend() {
|
|
58
58
|
const isLocal = !path.isAbsolute(BalmJS.config.assets.root);
|
|
@@ -76,7 +76,7 @@ class CleanTask extends BalmJS.BalmTask {
|
|
|
76
76
|
return [
|
|
77
77
|
...(BalmJS.config.env.isProd && hasBuildDir
|
|
78
78
|
? buildDirInProd
|
|
79
|
-
: [...buildDirInDev, ...
|
|
79
|
+
: [...buildDirInDev, ...tslib_1.__classPrivateFieldGet(this, _CleanTask_getAssetsDir, "f").call(this, 'dest')])
|
|
80
80
|
];
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var _ModernizrTask_readConfig, _ModernizrTask_createDir, _ModernizrTask_generateScript;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
6
|
class ModernizrTask extends BalmJS.BalmTask {
|
|
7
7
|
constructor() {
|
|
8
8
|
super('modernizr');
|
|
@@ -39,10 +39,10 @@ class ModernizrTask extends BalmJS.BalmTask {
|
|
|
39
39
|
this.init();
|
|
40
40
|
if (fs_1.default.existsSync(this.input)) {
|
|
41
41
|
const [config] = await Promise.all([
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
tslib_1.__classPrivateFieldGet(this, _ModernizrTask_readConfig, "f").call(this),
|
|
43
|
+
tslib_1.__classPrivateFieldGet(this, _ModernizrTask_createDir, "f").call(this)
|
|
44
44
|
]);
|
|
45
|
-
await
|
|
45
|
+
await tslib_1.__classPrivateFieldGet(this, _ModernizrTask_generateScript, "f").call(this, config);
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
48
|
BalmJS.logger.warn(`${this.name} task`, `The '${this.input}' does not exist`, {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var _SpriteTask_tasks, _SpriteTask_getParams;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const merge_stream_1 =
|
|
5
|
+
const merge_stream_1 = tslib_1.__importDefault(require("../../utilities/merge-stream"));
|
|
6
6
|
class SpriteTask extends BalmJS.BalmTask {
|
|
7
7
|
constructor() {
|
|
8
8
|
super('sprite');
|
|
@@ -66,7 +66,7 @@ class SpriteTask extends BalmJS.BalmTask {
|
|
|
66
66
|
BalmJS.logger.debug(`${this.name} task`, spriteConfig, {
|
|
67
67
|
pre: true
|
|
68
68
|
});
|
|
69
|
-
spriteConfig.params =
|
|
69
|
+
spriteConfig.params = tslib_1.__classPrivateFieldGet(this, _SpriteTask_getParams, "f").call(this, spriteItem, spriteOptions);
|
|
70
70
|
gulp.task(BalmJS.toNamespace(spriteTaskName), () => {
|
|
71
71
|
const spriteData = gulp
|
|
72
72
|
.src(spriteConfig.input)
|
|
@@ -78,7 +78,7 @@ class SpriteTask extends BalmJS.BalmTask {
|
|
|
78
78
|
const cssStream = spriteData.css.pipe(gulp.dest(spriteConfig.cssOutput));
|
|
79
79
|
return (0, merge_stream_1.default)(imgStream, cssStream);
|
|
80
80
|
});
|
|
81
|
-
|
|
81
|
+
tslib_1.__classPrivateFieldGet(this, _SpriteTask_tasks, "f").push(spriteTaskName);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
recipe(input, output, spriteOptions = {}) {
|
|
@@ -91,7 +91,7 @@ class SpriteTask extends BalmJS.BalmTask {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
get deps() {
|
|
94
|
-
return
|
|
94
|
+
return tslib_1.__classPrivateFieldGet(this, _SpriteTask_tasks, "f");
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
_SpriteTask_tasks = new WeakMap(), _SpriteTask_getParams = new WeakMap();
|
|
@@ -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 esbuild_1 =
|
|
4
|
+
const esbuild_1 = tslib_1.__importDefault(require("../../bundler/esbuild"));
|
|
5
5
|
class EsbuildTask extends BalmJS.BalmTask {
|
|
6
6
|
constructor() {
|
|
7
7
|
super('esbuild');
|
|
@@ -48,9 +48,9 @@ class HtmlTask extends BalmJS.BalmTask {
|
|
|
48
48
|
['css', 'js', 'img', 'media', 'manifest'].forEach((type) => {
|
|
49
49
|
const canUpdate = type === 'manifest'
|
|
50
50
|
? BalmJS.config.pwa.enabled
|
|
51
|
-
:
|
|
51
|
+
: tslib_1.__classPrivateFieldGet(this, _HtmlTask_hasSourcePath, "f").call(this, type);
|
|
52
52
|
if (canUpdate) {
|
|
53
|
-
stream = stream.pipe(
|
|
53
|
+
stream = stream.pipe(tslib_1.__classPrivateFieldGet(this, _HtmlTask_updateAssetsPath, "f").call(this, type));
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
stream = BalmJS.config.assets.cache
|
|
@@ -60,10 +60,10 @@ class HtmlTask extends BalmJS.BalmTask {
|
|
|
60
60
|
else {
|
|
61
61
|
['css', 'js', 'img', 'media'].forEach((type, index) => {
|
|
62
62
|
const canUpdate = index > 1
|
|
63
|
-
?
|
|
64
|
-
:
|
|
63
|
+
? tslib_1.__classPrivateFieldGet(this, _HtmlTask_hasSourcePath, "f").call(this, type) && !BalmJS.config.inFrontend
|
|
64
|
+
: tslib_1.__classPrivateFieldGet(this, _HtmlTask_hasSourcePath, "f").call(this, type);
|
|
65
65
|
if (canUpdate) {
|
|
66
|
-
stream = stream.pipe(
|
|
66
|
+
stream = stream.pipe(tslib_1.__classPrivateFieldGet(this, _HtmlTask_updateAssetsPath, "f").call(this, type));
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
stream = stream.pipe(BalmJS.file.setPublicPath());
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var _PublishTask_release;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const merge_stream_1 =
|
|
5
|
+
const merge_stream_1 = tslib_1.__importDefault(require("../../utilities/merge-stream"));
|
|
6
6
|
class PublishTask extends BalmJS.BalmTask {
|
|
7
7
|
constructor() {
|
|
8
8
|
super('publish');
|
|
@@ -27,11 +27,11 @@ class PublishTask extends BalmJS.BalmTask {
|
|
|
27
27
|
const balmPublish = (callback) => {
|
|
28
28
|
if (BalmJS.config.env.isProd) {
|
|
29
29
|
if (BalmJS.utils.isArray(input)) {
|
|
30
|
-
const tasks = input.map((template) =>
|
|
30
|
+
const tasks = input.map((template) => tslib_1.__classPrivateFieldGet(this, _PublishTask_release, "f").call(this, template.input, template.output, template.renameOptions));
|
|
31
31
|
return (0, merge_stream_1.default)(...tasks);
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
|
-
return
|
|
34
|
+
return tslib_1.__classPrivateFieldGet(this, _PublishTask_release, "f").call(this, input, output, renameOptions);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
@@ -18,7 +18,7 @@ class RemoveTask extends BalmJS.BalmTask {
|
|
|
18
18
|
const canDel = !!((BalmJS.utils.isString(input) && input.trim()) ||
|
|
19
19
|
(BalmJS.utils.isArray(input) && input.length));
|
|
20
20
|
if (canDel) {
|
|
21
|
-
const files =
|
|
21
|
+
const files = tslib_1.__classPrivateFieldGet(this, _RemoveTask_getFiles, "f").call(this, input);
|
|
22
22
|
BalmJS.logger.debug(`${this.name} task`, {
|
|
23
23
|
files
|
|
24
24
|
}, {
|
|
@@ -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 rollup_1 =
|
|
4
|
+
const rollup_1 = tslib_1.__importDefault(require("../../bundler/rollup"));
|
|
5
5
|
class RollupTask extends BalmJS.BalmTask {
|
|
6
6
|
constructor() {
|
|
7
7
|
super('rollup');
|
|
@@ -7,7 +7,8 @@ class SassTask extends BalmJS.BalmStyleTask {
|
|
|
7
7
|
get options() {
|
|
8
8
|
return Object.assign({
|
|
9
9
|
includePaths: BalmJS.file.stylePaths,
|
|
10
|
-
outputStyle: 'expanded'
|
|
10
|
+
outputStyle: 'expanded',
|
|
11
|
+
quietDeps: BalmJS.config.logs.level < BalmJS.LogLevel.Warn
|
|
11
12
|
}, BalmJS.config.styles.sassOptions, this.customOptions);
|
|
12
13
|
}
|
|
13
14
|
recipe(input, output, options = {}) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
var _ServerTask_watchTask, _ServerTask_onWatch;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const detect_port_1 =
|
|
6
|
-
const middlewares_1 =
|
|
5
|
+
const detect_port_1 = tslib_1.__importDefault(require("../../utilities/detect-port"));
|
|
6
|
+
const middlewares_1 = tslib_1.__importDefault(require("../../middlewares"));
|
|
7
7
|
class ServerTask extends BalmJS.BalmTask {
|
|
8
8
|
constructor() {
|
|
9
9
|
super('serve');
|
|
@@ -25,18 +25,18 @@ class ServerTask extends BalmJS.BalmTask {
|
|
|
25
25
|
`${BalmJS.config.dest.font}/**/*`,
|
|
26
26
|
...BalmJS.config.server.extraWatchFiles
|
|
27
27
|
], watchOptions).on('change', server.reload);
|
|
28
|
-
watch(`${BalmJS.file.templateBasePath}/*.html`, watchOptions,
|
|
29
|
-
watch(`${BalmJS.config.src.css}/**/*.${BalmJS.config.styles.extname}`, watchOptions,
|
|
28
|
+
watch(`${BalmJS.file.templateBasePath}/*.html`, watchOptions, tslib_1.__classPrivateFieldGet(this, _ServerTask_watchTask, "f").call(this, 'html', true));
|
|
29
|
+
watch(`${BalmJS.config.src.css}/**/*.${BalmJS.config.styles.extname}`, watchOptions, tslib_1.__classPrivateFieldGet(this, _ServerTask_watchTask, "f").call(this, BalmJS.config.inFrontend ? this.styleName : 'style'));
|
|
30
30
|
if (!BalmJS.config.server.useHMR) {
|
|
31
|
-
watch(`${BalmJS.config.src.js}/**/*`, watchOptions,
|
|
31
|
+
watch(`${BalmJS.config.src.js}/**/*`, watchOptions, tslib_1.__classPrivateFieldGet(this, _ServerTask_watchTask, "f").call(this, BalmJS.config.scripts.bundler, true));
|
|
32
32
|
}
|
|
33
|
-
watch(`${BalmJS.config.src.base}/modernizr.json`, watchOptions,
|
|
34
|
-
watch(`${BalmJS.config.src.font}/**/*`, watchOptions,
|
|
33
|
+
watch(`${BalmJS.config.src.base}/modernizr.json`, watchOptions, tslib_1.__classPrivateFieldGet(this, _ServerTask_watchTask, "f").call(this, 'modernizr'));
|
|
34
|
+
watch(`${BalmJS.config.src.font}/**/*`, watchOptions, tslib_1.__classPrivateFieldGet(this, _ServerTask_watchTask, "f").call(this, 'font'));
|
|
35
35
|
if (BalmJS.config.ftp.watchFiles.length) {
|
|
36
36
|
watch(BalmJS.config.ftp.watchFiles, watchOptions).on('change', (path) => {
|
|
37
37
|
BalmJS.logger.debug(`${this.name} task`, `File ${path} was changed`);
|
|
38
38
|
BalmJS.watchFtpFile = path;
|
|
39
|
-
|
|
39
|
+
tslib_1.__classPrivateFieldGet(this, _ServerTask_watchTask, "f").call(this, 'ftp', true)();
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -104,7 +104,7 @@ class ServerTask extends BalmJS.BalmTask {
|
|
|
104
104
|
if (BalmJS.config.env.isDev) {
|
|
105
105
|
BalmJS.server = server.init(bsOptions);
|
|
106
106
|
if (BalmJS.config.useDefaults) {
|
|
107
|
-
|
|
107
|
+
tslib_1.__classPrivateFieldGet(this, _ServerTask_onWatch, "f").call(this);
|
|
108
108
|
}
|
|
109
109
|
else {
|
|
110
110
|
BalmJS.watching = true;
|
|
@@ -26,8 +26,8 @@ class UrlTask extends BalmJS.BalmTask {
|
|
|
26
26
|
const balmUrl = () => {
|
|
27
27
|
this.init(input, output);
|
|
28
28
|
return this.src
|
|
29
|
-
.pipe(
|
|
30
|
-
.pipe(
|
|
29
|
+
.pipe(tslib_1.__classPrivateFieldGet(this, _UrlTask_urlProcessing, "f").call(this, 'img'))
|
|
30
|
+
.pipe(tslib_1.__classPrivateFieldGet(this, _UrlTask_urlProcessing, "f").call(this, 'font'))
|
|
31
31
|
.pipe(gulp.dest(this.output));
|
|
32
32
|
};
|
|
33
33
|
return balmUrl;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const webpack_1 = require("../../bundler/webpack");
|
|
5
|
-
const compiling_1 =
|
|
5
|
+
const compiling_1 = tslib_1.__importDefault(require("../../utilities/compiling"));
|
|
6
6
|
class WebpackTask extends BalmJS.BalmTask {
|
|
7
7
|
constructor() {
|
|
8
8
|
super('webpack');
|
|
@@ -14,13 +14,22 @@ class WebpackTask extends BalmJS.BalmTask {
|
|
|
14
14
|
compiling_1.default.start();
|
|
15
15
|
BalmJS.webpackCompiler = (0, webpack_1.webpack)((0, webpack_1.webpackConfig)(this.input, this.output, customOptions, isHook), (error, stats) => {
|
|
16
16
|
compiling_1.default.stop();
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
try {
|
|
18
|
+
const scriptLogLevel = stats.hasErrors()
|
|
19
|
+
? BalmJS.LogLevel.Error
|
|
20
|
+
: stats.hasWarnings()
|
|
21
|
+
? BalmJS.LogLevel.Warn
|
|
22
|
+
: BalmJS.LogLevel.Info;
|
|
23
|
+
if (BalmJS.config.logs.level <= scriptLogLevel) {
|
|
24
|
+
console.log(stats.toString(BalmJS.config.scripts.stats));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
BalmJS.logger.error(`${this.name} task`, error.stack || error);
|
|
29
|
+
if (error.details) {
|
|
30
|
+
BalmJS.logger.error(`${this.name} task`, error.details);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
24
33
|
}
|
|
25
34
|
fn && fn();
|
|
26
35
|
callback();
|