balm-core 3.20.1 → 3.23.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/README.md +9 -16
- package/lib/bundler/esbuild/transform.js +5 -3
- package/lib/bundler/rollup/index.js +5 -3
- package/lib/config/globals.js +1 -1
- package/lib/config/scripts.js +3 -3
- package/lib/plugins/replace.js +2 -2
- package/lib/plugins/sass.js +88 -78
- package/lib/tasks/private/build.js +3 -1
- package/lib/tasks/private/cache.js +3 -1
- package/lib/tasks/private/extra.js +3 -1
- package/lib/tasks/private/font.js +3 -1
- package/lib/tasks/private/image.js +3 -1
- package/lib/tasks/private/lint.js +3 -1
- package/lib/tasks/private/media.js +3 -1
- package/lib/tasks/private/modernizr.js +3 -1
- package/lib/tasks/private/start.js +3 -1
- package/lib/tasks/private/workbox-sw.js +3 -1
- 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 +22 -22
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balm-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.23.0",
|
|
4
4
|
"description": "BalmJS compiler core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"balm",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"ansi-colors": "^4.1.1",
|
|
44
|
-
"async": "^3.2.
|
|
45
|
-
"autoprefixer": "
|
|
46
|
-
"babel-loader": "^8.2.
|
|
47
|
-
"browser-sync": "^2.27.
|
|
44
|
+
"async": "^3.2.3",
|
|
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": "
|
|
50
|
+
"cssnano": "4",
|
|
51
51
|
"del": "^6.0.0",
|
|
52
|
-
"esbuild": "^0.
|
|
53
|
-
"fancy-log": "^
|
|
52
|
+
"esbuild": "^0.14",
|
|
53
|
+
"fancy-log": "^2.0.0",
|
|
54
54
|
"file-loader": "^6.2.0",
|
|
55
55
|
"gulp-eslint": "^6.0.0",
|
|
56
56
|
"gulp-if": "^3.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.
|
|
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": "
|
|
77
|
-
"postcss-import": "
|
|
78
|
-
"postcss-load-config": "^3.1.
|
|
76
|
+
"postcss": "7",
|
|
77
|
+
"postcss-import": "12",
|
|
78
|
+
"postcss-load-config": "^3.1.2",
|
|
79
79
|
"postcss-loader": "4",
|
|
80
|
-
"postcss-preset-env": "
|
|
80
|
+
"postcss-preset-env": "6",
|
|
81
81
|
"postcss-safe-parser": "5",
|
|
82
|
-
"pretty-bytes": "
|
|
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.
|
|
86
|
+
"rollup": "^2.68.0",
|
|
87
87
|
"rollup-plugin-terser": "^7.0.2",
|
|
88
88
|
"sass": "1.39.2",
|
|
89
|
-
"ssh2": "
|
|
89
|
+
"ssh2": "0.8.9",
|
|
90
90
|
"strip-ansi": "6",
|
|
91
91
|
"style-loader": "2",
|
|
92
|
-
"terser": "^5.
|
|
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.
|
|
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.3
|
|
104
|
+
"workbox-build": "^6.5.3"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
107
|
"@types/express": "^4.17.13",
|
|
108
|
-
"@types/node": "^
|
|
108
|
+
"@types/node": "^17",
|
|
109
109
|
"@types/webpack": "4"
|
|
110
110
|
},
|
|
111
111
|
"optionalDependencies": {
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"imagemin-svgo": "^9.0.0"
|
|
116
116
|
},
|
|
117
117
|
"engines": {
|
|
118
|
-
"node": ">=10.
|
|
118
|
+
"node": ">=10.13.0"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "949efc7b88ccabe2d7beadeb60992ad9efd27209"
|
|
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 =
|
|
8
|
+
const tasks_1 = tslib_1.__importDefault(require("./tasks"));
|
|
9
9
|
const bootstrap_1 = require("./bootstrap");
|
|
10
|
-
const loading_1 =
|
|
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
|
-
|
|
16
|
+
tslib_1.__classPrivateFieldSet(this, _Balm_config, BalmJS.config, "f");
|
|
17
17
|
}
|
|
18
18
|
get config() {
|
|
19
|
-
return
|
|
19
|
+
return tslib_1.__classPrivateFieldGet(this, _Balm_config, "f");
|
|
20
20
|
}
|
|
21
21
|
set config(value) {
|
|
22
|
-
|
|
23
|
-
BalmJS.config =
|
|
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);
|
package/tslib/bootstrap/index.js
CHANGED
|
@@ -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 =
|
|
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 =
|
|
5
|
-
const transform_1 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
5
|
-
const output_1 =
|
|
6
|
-
const build_1 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
5
|
-
const common_1 =
|
|
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 =
|
|
5
|
-
const prod_1 =
|
|
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 =
|
|
5
|
-
const common_1 =
|
|
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 =
|
|
6
|
-
const entry_1 =
|
|
7
|
-
const output_1 =
|
|
8
|
-
const config_1 =
|
|
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 =
|
|
5
|
-
const require_dir_1 =
|
|
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({
|
package/tslib/config/globals.js
CHANGED
|
@@ -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 =
|
|
5
|
-
const path_1 =
|
|
6
|
-
const ansi_colors_1 =
|
|
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.
|
|
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);
|
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();
|