balm-core 3.26.2 → 3.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/lib/balm.js +0 -22
  2. package/lib/bootstrap/check_config.js +4 -10
  3. package/lib/bootstrap/index.js +17 -28
  4. package/lib/bundler/esbuild/build.js +0 -4
  5. package/lib/bundler/esbuild/index.js +0 -5
  6. package/lib/bundler/esbuild/transform.js +0 -33
  7. package/lib/bundler/rollup/build.js +2 -17
  8. package/lib/bundler/rollup/entry.js +2 -6
  9. package/lib/bundler/rollup/index.js +0 -32
  10. package/lib/bundler/rollup/output.js +0 -6
  11. package/lib/bundler/rollup/plugins.js +0 -11
  12. package/lib/bundler/webpack/config/common.js +3 -26
  13. package/lib/bundler/webpack/config/dev.js +2 -6
  14. package/lib/bundler/webpack/config/index.js +0 -5
  15. package/lib/bundler/webpack/config/prod.js +2 -17
  16. package/lib/bundler/webpack/entry.js +12 -23
  17. package/lib/bundler/webpack/index.js +5 -14
  18. package/lib/bundler/webpack/loaders.js +0 -10
  19. package/lib/bundler/webpack/output.js +0 -7
  20. package/lib/bundler/webpack/rules/babel.js +3 -7
  21. package/lib/bundler/webpack/rules/css.js +2 -7
  22. package/lib/bundler/webpack/rules/html.js +0 -3
  23. package/lib/bundler/webpack/rules/url.js +2 -6
  24. package/lib/config/assets.js +0 -5
  25. package/lib/config/env.js +0 -2
  26. package/lib/config/globals.js +3 -10
  27. package/lib/config/html.js +0 -1
  28. package/lib/config/index.js +0 -21
  29. package/lib/config/logs.js +0 -1
  30. package/lib/config/paths.js +2 -3
  31. package/lib/config/pwa.js +0 -3
  32. package/lib/config/roots.js +0 -3
  33. package/lib/config/scripts.js +24 -32
  34. package/lib/config/server.js +4 -11
  35. package/lib/config/styles.js +2 -10
  36. package/lib/config/version.js +0 -3
  37. package/lib/hello.js +0 -5
  38. package/lib/hooks/index.js +20 -27
  39. package/lib/hooks/maker.js +2 -22
  40. package/lib/index.js +0 -5
  41. package/lib/middlewares/history.js +0 -3
  42. package/lib/middlewares/index.js +0 -9
  43. package/lib/middlewares/proxy.js +1 -9
  44. package/lib/middlewares/webpack.js +0 -6
  45. package/lib/plugins/htmlmin.js +1 -7
  46. package/lib/plugins/imagemin.js +1 -29
  47. package/lib/plugins/index.js +0 -12
  48. package/lib/plugins/jsmin.js +0 -20
  49. package/lib/plugins/less.js +7 -19
  50. package/lib/plugins/plumber.js +5 -24
  51. package/lib/plugins/postcss-plugins.js +0 -9
  52. package/lib/plugins/postcss.js +9 -27
  53. package/lib/plugins/rename.js +3 -16
  54. package/lib/plugins/replace.js +4 -26
  55. package/lib/plugins/sass.js +31 -45
  56. package/lib/plugins/sftp.js +36 -69
  57. package/lib/tasks/default.js +2 -23
  58. package/lib/tasks/foundation/balm.js +0 -19
  59. package/lib/tasks/foundation/balm_style.js +2 -27
  60. package/lib/tasks/foundation/index.js +0 -5
  61. package/lib/tasks/index.js +7 -16
  62. package/lib/tasks/private/build.js +0 -17
  63. package/lib/tasks/private/cache.js +0 -19
  64. package/lib/tasks/private/clean.js +0 -33
  65. package/lib/tasks/private/end.js +0 -23
  66. package/lib/tasks/private/extra.js +4 -29
  67. package/lib/tasks/private/font.js +0 -17
  68. package/lib/tasks/private/image.js +1 -28
  69. package/lib/tasks/private/lint.js +0 -17
  70. package/lib/tasks/private/media.js +0 -17
  71. package/lib/tasks/private/modernizr.js +0 -39
  72. package/lib/tasks/private/pwa-cache.js +0 -21
  73. package/lib/tasks/private/script.js +0 -13
  74. package/lib/tasks/private/sprite.js +3 -37
  75. package/lib/tasks/private/start.js +0 -23
  76. package/lib/tasks/private/style.js +0 -14
  77. package/lib/tasks/private/workbox-sw.js +0 -17
  78. package/lib/tasks/public/copy.js +0 -17
  79. package/lib/tasks/public/esbuild.js +0 -19
  80. package/lib/tasks/public/ftp.js +1 -22
  81. package/lib/tasks/public/html.js +0 -31
  82. package/lib/tasks/public/jsmin.js +0 -17
  83. package/lib/tasks/public/less.js +0 -17
  84. package/lib/tasks/public/postcss.js +0 -16
  85. package/lib/tasks/public/publish.js +3 -29
  86. package/lib/tasks/public/pwa.js +1 -30
  87. package/lib/tasks/public/remove.js +2 -34
  88. package/lib/tasks/public/replace.js +0 -18
  89. package/lib/tasks/public/rollup.js +0 -20
  90. package/lib/tasks/public/sass.js +0 -17
  91. package/lib/tasks/public/server.js +5 -44
  92. package/lib/tasks/public/url.js +0 -24
  93. package/lib/tasks/public/version.js +0 -17
  94. package/lib/tasks/public/webpack.js +2 -27
  95. package/lib/tasks/public/zip.js +0 -18
  96. package/lib/utilities/address.js +5 -21
  97. package/lib/utilities/cache-core.js +5 -21
  98. package/lib/utilities/color.js +0 -8
  99. package/lib/utilities/compiling.js +0 -15
  100. package/lib/utilities/detect-port.js +6 -26
  101. package/lib/utilities/escape-string-regexp.js +3 -5
  102. package/lib/utilities/file.js +3 -23
  103. package/lib/utilities/index.js +0 -5
  104. package/lib/utilities/loading.js +0 -23
  105. package/lib/utilities/logger.js +0 -21
  106. package/lib/utilities/merge-stream.js +0 -11
  107. package/lib/utilities/namespace.js +0 -4
  108. package/lib/utilities/public-url.js +9 -12
  109. package/lib/utilities/replacestream.js +5 -31
  110. package/lib/utilities/typeof.js +0 -2
  111. package/lib/utilities/utils.js +2 -12
  112. package/package.json +9 -9
  113. package/tslib/bundler/esbuild/transform.js +26 -19
  114. package/tslib/bundler/rollup/index.js +12 -5
@@ -5,13 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var root = 'assets'; // Remote project root simulation
8
-
9
8
  var mainDir = 'public'; // The `public` directory contains the front controller and your assets (images, JavaScript, CSS, etc.)
10
-
11
9
  var subDir = ''; // Public subdirectory
12
-
13
10
  var buildDir = 'build'; // The suffix of the `subDir`: for dynamic language project
14
-
15
11
  var virtualDir = ''; // The prefix of the `subDir`: for non-standard dynamic language project
16
12
 
17
13
  var cache = false;
@@ -20,7 +16,6 @@ var cache = false;
20
16
  *
21
17
  * @reference https://github.com/smysnk/gulp-rev-all#options
22
18
  */
23
-
24
19
  var options = {
25
20
  fileNameManifest: 'rev-manifest.json',
26
21
  dontRenameFile: ['.html'],
package/lib/config/env.js CHANGED
@@ -17,7 +17,6 @@ var ENV = {
17
17
  var isProd = process.env.NODE_ENV === ENV.PROD || process.argv.includes("--".concat(ENV.PROD)) || process.argv.includes('-p');
18
18
  var isTest = process.env.NODE_ENV === ENV.TEST || process.argv.includes("--".concat(ENV.TEST)) || process.argv.includes('-t');
19
19
  var isDev = !isProd && !isTest;
20
-
21
20
  if (!process.env.NODE_ENV) {
22
21
  if (isProd) {
23
22
  process.env.NODE_ENV = ENV.PROD;
@@ -27,7 +26,6 @@ if (!process.env.NODE_ENV) {
27
26
  process.env.NODE_ENV = ENV.DEV;
28
27
  }
29
28
  }
30
-
31
29
  var inSSR = process.env.NODE_ENV === ENV.SSR || process.argv.includes("--".concat(ENV.SSR)) || process.argv.includes('-ssr');
32
30
  var isMP = process.env.NODE_ENV === ENV.MP || process.argv.includes("--".concat(ENV.MP)) || process.argv.includes('-mp');
33
31
  var inDesktopApp = process.env.NODE_ENV === ENV.DESKTOP_APP || process.argv.includes("--".concat(ENV.DESKTOP_APP)) || process.argv.includes('-electron');
@@ -1,33 +1,26 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _fs = _interopRequireDefault(require("fs"));
6
-
7
5
  var _path = _interopRequireDefault(require("path"));
8
-
9
6
  var _ansiColors = _interopRequireDefault(require("ansi-colors"));
10
-
11
7
  // Set env var for ORIGINAL cwd before anything touches it
12
8
  process.env.BALM_CWD = process.env.INIT_CWD || process.cwd();
13
9
  var gulpModule = "".concat(process.env.BALM_ROOT || process.env.BALM_CWD, "/node_modules/gulp/index.js");
14
-
15
10
  if (!_fs["default"].existsSync(gulpModule)) {
16
11
  console.error(_ansiColors["default"].bgBlueBright('BalmJS'), _ansiColors["default"].yellow('`balm` module not found :('));
17
12
  process.exit(1);
18
- } // Chdir before requiring balm config to make sure
19
- // we let them chdir as needed
20
-
13
+ }
21
14
 
15
+ // Chdir before requiring balm config to make sure
16
+ // we let them chdir as needed
22
17
  if (process.cwd() !== process.env.BALM_CWD) {
23
18
  process.chdir(process.env.BALM_CWD);
24
19
  }
25
-
26
20
  global.path = _path["default"];
27
21
  global.gulp = require(gulpModule);
28
22
  global.$ = require('gulp-load-plugins')();
29
23
  global.server = require('browser-sync').create();
30
24
  global.through2 = require('through2');
31
25
  global.PluginError = require('plugin-error');
32
-
33
26
  global.NOOP = function () {};
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
-
8
7
  /**
9
8
  * HTMLMinifier options
10
9
  *
@@ -1,42 +1,25 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = void 0;
9
-
10
8
  require("./globals");
11
-
12
9
  var _env = _interopRequireDefault(require("./env"));
13
-
14
10
  var _roots = _interopRequireDefault(require("./roots"));
15
-
16
11
  var _paths = _interopRequireDefault(require("./paths"));
17
-
18
12
  var _html = _interopRequireDefault(require("./html"));
19
-
20
13
  var _styles = _interopRequireDefault(require("./styles"));
21
-
22
14
  var _scripts = _interopRequireDefault(require("./scripts"));
23
-
24
15
  var _images = _interopRequireDefault(require("./images"));
25
-
26
16
  var _extras = _interopRequireDefault(require("./extras"));
27
-
28
17
  var _assets = _interopRequireDefault(require("./assets"));
29
-
30
18
  var _server = _interopRequireDefault(require("./server"));
31
-
32
19
  var _ftp = _interopRequireDefault(require("./ftp"));
33
-
34
20
  var _pwa = _interopRequireDefault(require("./pwa"));
35
-
36
21
  var _logs = _interopRequireDefault(require("./logs"));
37
-
38
22
  var LogLevel;
39
-
40
23
  (function (LogLevel) {
41
24
  LogLevel[LogLevel["Trace"] = 0] = "Trace";
42
25
  LogLevel[LogLevel["Debug"] = 1] = "Debug";
@@ -44,15 +27,12 @@ var LogLevel;
44
27
  LogLevel[LogLevel["Warn"] = 3] = "Warn";
45
28
  LogLevel[LogLevel["Error"] = 4] = "Error";
46
29
  })(LogLevel || (LogLevel = {}));
47
-
48
30
  var Bundler;
49
-
50
31
  (function (Bundler) {
51
32
  Bundler["webpack"] = "webpack";
52
33
  Bundler["rollup"] = "rollup";
53
34
  Bundler["esbuild"] = "esbuild";
54
35
  })(Bundler || (Bundler = {}));
55
-
56
36
  var vendors = [];
57
37
  var workspace = process.env.BALM_CWD;
58
38
  /**
@@ -61,7 +41,6 @@ var workspace = process.env.BALM_CWD;
61
41
  * set `true` for a static HTML project
62
42
  * set `false` for a dynamic language project (e.g. PHP framework)
63
43
  */
64
-
65
44
  var inFrontend = true;
66
45
  var useDefaults = true; // Use balm default task
67
46
 
@@ -10,7 +10,6 @@ var level = 3;
10
10
  *
11
11
  * @reference https://github.com/nodejs/node/blob/master/doc/api/util.md#utilinspectobject-options
12
12
  */
13
-
14
13
  var formatOptions = {};
15
14
  var _default = {
16
15
  level: level,
@@ -18,8 +18,8 @@ var source = {
18
18
  font: 'fonts',
19
19
  // Font directory: `src/fonts`
20
20
  media: 'media' // Media directory: `src/media`
21
-
22
21
  };
22
+
23
23
  var tmp = {
24
24
  base: '',
25
25
  // `.tmp`
@@ -32,8 +32,8 @@ var tmp = {
32
32
  font: 'fonts',
33
33
  // `.tmp/fonts`
34
34
  media: 'media' // `.tmp/media`
35
-
36
35
  };
36
+
37
37
  var target = {
38
38
  base: '',
39
39
  // `dist`
@@ -46,7 +46,6 @@ var target = {
46
46
  font: 'font',
47
47
  // `dist/font`
48
48
  media: 'media' // `dist/media`
49
-
50
49
  };
51
50
  var _default = {
52
51
  source: source,
package/lib/config/pwa.js CHANGED
@@ -6,17 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var enabled = false;
8
8
  var manifest = 'manifest.json'; // 'manifest.json' or 'manifest.webmanifest'
9
-
10
9
  var workboxSw = 'node_modules/workbox-sw/build/workbox-sw.js';
11
10
  var mode = 'generateSW'; // 'generateSW' or 'injectManifest'
12
-
13
11
  /**
14
12
  * Workbox Build options
15
13
  *
16
14
  * @reference https://developers.google.com/web/tools/workbox/modules/workbox-build#full_generatesw_config
17
15
  * @reference https://developers.google.com/web/tools/workbox/modules/workbox-build#full_injectmanifest_config
18
16
  */
19
-
20
17
  var options = {};
21
18
  var swSrcFilename = 'service-worker.js';
22
19
  var swDestFilename = 'sw.js';
@@ -5,11 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var source = 'src'; // Source code
8
-
9
8
  var tmp = '.tmp'; // Temporary precompiled assets
10
-
11
9
  var target = 'dist'; // The final distribution folder
12
-
13
10
  var _default = {
14
11
  source: source,
15
12
  tmp: tmp,
@@ -12,7 +12,6 @@ var minify = false;
12
12
  *
13
13
  * @reference https://github.com/terser/terser#minify-options
14
14
  */
15
-
16
15
  var minifyOptions = {
17
16
  ecma: 5,
18
17
  parse: {
@@ -44,18 +43,19 @@ var minifyOptions = {
44
43
  // https://github.com/facebook/create-react-app/issues/2488
45
44
  ascii_only: true
46
45
  }
47
- }; // Entry and Context (webpack/esbuild common options)
48
-
46
+ };
47
+ // Entry and Context (webpack/esbuild common options)
49
48
  var entry = '';
50
49
  var lint = false;
50
+
51
51
  /**
52
52
  * Webpack bundler
53
53
  */
54
- // Output
55
54
 
55
+ // Output
56
56
  var library = '';
57
- var libraryTarget = 'var'; // Module
58
-
57
+ var libraryTarget = 'var';
58
+ // Module
59
59
  var loaders = [];
60
60
  var defaultLoaders = {};
61
61
  var includeJsResource = [];
@@ -66,43 +66,39 @@ var useEsModule = true;
66
66
  *
67
67
  * @reference https://github.com/webpack-contrib/url-loader#options
68
68
  */
69
-
70
69
  var urlLoaderOptions = {};
71
70
  /**
72
71
  * Scripts: babel-loader options
73
72
  *
74
73
  * @reference https://github.com/babel/babel-loader#options
75
74
  */
76
-
77
75
  var babelLoaderOptions = {};
78
76
  /**
79
77
  * Styling: postcss-loader options
80
78
  *
81
79
  * @reference https://github.com/postcss/postcss-loader#options
82
80
  */
83
-
84
81
  var postcssLoaderOptions = {};
85
82
  /**
86
83
  * Templating: html-loader options
87
84
  *
88
85
  * @reference https://github.com/webpack-contrib/html-loader#options
89
86
  */
90
-
91
- var htmlLoaderOptions = {}; // Resolve
92
-
87
+ var htmlLoaderOptions = {};
88
+ // Resolve
93
89
  var extensions = [];
94
- var alias = {}; // Plugins
95
-
90
+ var alias = {};
91
+ // Plugins
96
92
  var plugins = [];
97
93
  var injectHtml = false;
98
- var htmlPluginOptions = {}; // Devtool
99
-
100
- var sourceMap = false; // Target
101
-
102
- var target = 'web'; // Externals
103
-
104
- var externals = ''; // Stats
105
-
94
+ var htmlPluginOptions = {};
95
+ // Devtool
96
+ var sourceMap = false;
97
+ // Target
98
+ var target = 'web';
99
+ // Externals
100
+ var externals = '';
101
+ // Stats
106
102
  var stats = {
107
103
  colors: true,
108
104
  assets: true,
@@ -115,34 +111,30 @@ var stats = {
115
111
  *
116
112
  * @reference https://webpack.js.org/configuration/
117
113
  */
118
-
119
- var webpackOptions = {}; // Optimization
120
-
114
+ var webpackOptions = {};
115
+ // Optimization
121
116
  /**
122
117
  * Webpack optimizations for manual configuration and overrides
123
118
  *
124
119
  * @reference https://webpack.js.org/configuration/optimization/
125
120
  */
126
-
127
121
  var optimization = {};
128
122
  var extractAllVendors = false; // Extract all vendors (all in one)
129
-
130
123
  var vendorName = 'vendor'; // AllInOne vendor filename or Vendors folder name
131
-
132
- var extractCss = false; // IE8 compatibility
133
-
124
+ var extractCss = false;
125
+ // IE8 compatibility
134
126
  var ie8 = false;
127
+
135
128
  /**
136
129
  * Rollup bundler
137
130
  */
138
-
139
131
  var inputOptions = {};
140
132
  var outputOptions = {};
141
133
  var watchOptions = {};
134
+
142
135
  /**
143
136
  * Esbuild bundler
144
137
  */
145
-
146
138
  var buildOptions = {};
147
139
  var useTransform = false;
148
140
  var transformOptions = {};
@@ -9,8 +9,8 @@ var host = null;
9
9
  var https = undefined;
10
10
  var open = false;
11
11
  var proxy = false; // Host: your.project.dev
12
-
13
- var serveStatic = [// {
12
+ var serveStatic = [
13
+ // {
14
14
  // route: '/public',
15
15
  // dir: '/path/to/public'
16
16
  // }
@@ -20,23 +20,20 @@ var serveStatic = [// {
20
20
  *
21
21
  * @reference https://browsersync.io/docs/options
22
22
  */
23
-
24
23
  var options = {};
25
- var next = NOOP; // Middleware
26
-
24
+ var next = NOOP;
25
+ // Middleware
27
26
  /**
28
27
  * A development middleware for webpack
29
28
  *
30
29
  * @reference https://github.com/webpack/webpack-dev-middleware#options
31
30
  */
32
-
33
31
  var devOptions = {};
34
32
  /**
35
33
  * Webpack hot reloading
36
34
  *
37
35
  * @reference https://github.com/webpack-contrib/webpack-hot-middleware#config
38
36
  */
39
-
40
37
  var hotOptions = {
41
38
  reload: true,
42
39
  noInfo: true
@@ -72,19 +69,15 @@ var hotOptions = {
72
69
  * }
73
70
  * }]
74
71
  */
75
-
76
72
  var proxyConfig = false;
77
73
  /**
78
74
  * HTML 5 history API
79
75
  *
80
76
  * @reference https://github.com/bripkens/connect-history-api-fallback#options
81
77
  */
82
-
83
78
  var historyOptions = false;
84
79
  var middlewares = []; // Extra middlewares for server
85
-
86
80
  var extraWatchFiles = []; // Just for `mix.serve`
87
-
88
81
  var _default = {
89
82
  port: port,
90
83
  host: host,
@@ -13,7 +13,6 @@ var entry = '';
13
13
  *
14
14
  * @reference https://cssnano.co/docs/optimisations/
15
15
  */
16
-
17
16
  var options = {
18
17
  discardComments: {
19
18
  removeAll: true
@@ -24,21 +23,18 @@ var options = {
24
23
  *
25
24
  * @reference https://github.com/sass/node-sass#options
26
25
  */
27
-
28
26
  var sassOptions = {};
29
27
  /**
30
28
  * Less plugin for Gulp
31
29
  *
32
30
  * @reference https://github.com/gulp-community/gulp-less#options
33
31
  */
34
-
35
32
  var lessOptions = {};
36
33
  /**
37
34
  * PostCSS Preset Env
38
35
  *
39
36
  * @reference https://github.com/csstools/postcss-preset-env#options
40
37
  */
41
-
42
38
  var postcssEnvOptions = {
43
39
  stage: 0,
44
40
  autoprefixer: {
@@ -50,19 +46,15 @@ var postcssEnvOptions = {
50
46
  *
51
47
  * @reference https://www.postcss.parts/
52
48
  */
53
-
54
- var postcssPlugins = []; // CSS Sprites
55
-
49
+ var postcssPlugins = [];
50
+ // CSS Sprites
56
51
  var imageBasePath = '../'; // Relative to css file
57
-
58
52
  var sprites = []; // Image folders
59
-
60
53
  var spriteRetina = false;
61
54
  /**
62
55
  * Spritesmith parameters
63
56
  * @reference https://github.com/twolfson/gulp.spritesmith#spritesmithparams
64
57
  */
65
-
66
58
  var spriteParams = {};
67
59
  var _default = {
68
60
  extname: extname,
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = void 0;
9
-
10
8
  var _package = _interopRequireDefault(require("../../package.json"));
11
-
12
9
  var _default = _package["default"].version;
13
10
  exports["default"] = _default;
package/lib/hello.js CHANGED
@@ -1,18 +1,13 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _process = require("process");
6
-
7
5
  var _events = require("events");
8
-
9
6
  var _cacheCore = _interopRequireDefault(require("./utilities/cache-core"));
10
-
11
7
  global.BalmJS = {
12
8
  emitter: new _events.EventEmitter(),
13
9
  useCacache: +_process.versions.node.split('.')[0] >= 18
14
10
  };
15
-
16
11
  if (!BalmJS.useCacache) {
17
12
  BalmJS.loading = true;
18
13
  (0, _cacheCore["default"])();
@@ -1,45 +1,36 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = void 0;
9
-
10
8
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
-
12
9
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
-
14
10
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
-
16
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
17
-
18
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
19
-
20
13
  var _maker = _interopRequireDefault(require("./maker"));
21
-
22
14
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
23
-
24
15
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
25
-
26
16
  var BaseHooks = /*#__PURE__*/function () {
27
17
  function BaseHooks() {
28
18
  (0, _classCallCheck2["default"])(this, BaseHooks);
29
19
  }
30
-
31
20
  (0, _createClass2["default"])(BaseHooks, [{
32
21
  key: "env",
33
22
  get: function get() {
34
23
  return BalmJS.config.env;
35
- } // HTML
24
+ }
36
25
 
26
+ // HTML
37
27
  }, {
38
28
  key: "html",
39
29
  value: function html(input, output) {
40
30
  _maker["default"].generate('html', [input, output]);
41
- } // Stylesheets
31
+ }
42
32
 
33
+ // Stylesheets
43
34
  }, {
44
35
  key: "css",
45
36
  value: function css(input, output) {
@@ -59,8 +50,9 @@ var BaseHooks = /*#__PURE__*/function () {
59
50
  key: "url",
60
51
  value: function url(input, output) {
61
52
  _maker["default"].generate('url', [input, output]);
62
- } // JavaScript
53
+ }
63
54
 
55
+ // JavaScript
64
56
  }, {
65
57
  key: "js",
66
58
  value: function js() {
@@ -85,8 +77,9 @@ var BaseHooks = /*#__PURE__*/function () {
85
77
  key: "jsmin",
86
78
  value: function jsmin(input, output, options) {
87
79
  _maker["default"].generate('jsmin', [input, output, options]);
88
- } // Files & Directories
80
+ }
89
81
 
82
+ // Files & Directories
90
83
  }, {
91
84
  key: "copy",
92
85
  value: function copy(input, output, options) {
@@ -96,14 +89,16 @@ var BaseHooks = /*#__PURE__*/function () {
96
89
  key: "remove",
97
90
  value: function remove(paths) {
98
91
  _maker["default"].generate('remove', [paths]);
99
- } // Cache
92
+ }
100
93
 
94
+ // Cache
101
95
  }, {
102
96
  key: "version",
103
97
  value: function version(input, output, assetsOptions) {
104
98
  _maker["default"].generate('version', [input, output, assetsOptions]);
105
- } // Server
99
+ }
106
100
 
101
+ // Server
107
102
  }, {
108
103
  key: "serve",
109
104
  value: function serve(handler) {
@@ -112,24 +107,22 @@ var BaseHooks = /*#__PURE__*/function () {
112
107
  }]);
113
108
  return BaseHooks;
114
109
  }();
115
-
116
110
  var BalmHooks = /*#__PURE__*/function (_BaseHooks) {
117
111
  (0, _inherits2["default"])(BalmHooks, _BaseHooks);
118
-
119
112
  var _super = _createSuper(BalmHooks);
120
-
121
113
  function BalmHooks() {
122
114
  (0, _classCallCheck2["default"])(this, BalmHooks);
123
115
  return _super.apply(this, arguments);
124
116
  }
125
-
126
117
  (0, _createClass2["default"])(BalmHooks, [{
127
118
  key: "sprite",
128
- value: // Stylesheets
119
+ value:
120
+ // Stylesheets
129
121
  function sprite(input, output, spriteOptions) {
130
122
  _maker["default"].generate('sprite', [input, output, spriteOptions]);
131
- } // Assets
123
+ }
132
124
 
125
+ // Assets
133
126
  }, {
134
127
  key: "replace",
135
128
  value: function replace(input, output, options) {
@@ -146,15 +139,15 @@ var BalmHooks = /*#__PURE__*/function (_BaseHooks) {
146
139
  var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
147
140
  var output = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
148
141
  var filename = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'archive.zip';
149
-
150
142
  _maker["default"].generate('zip', [input, output, filename]);
151
143
  }
152
144
  }, {
153
145
  key: "ftp",
154
146
  value: function ftp(localFiles, options) {
155
147
  _maker["default"].generate('ftp', [localFiles, options]);
156
- } // PWA
148
+ }
157
149
 
150
+ // PWA
158
151
  }, {
159
152
  key: "generateSW",
160
153
  value: function generateSW(pwaOptions) {
@@ -164,8 +157,9 @@ var BalmHooks = /*#__PURE__*/function (_BaseHooks) {
164
157
  key: "injectManifest",
165
158
  value: function injectManifest(pwaOptions) {
166
159
  _maker["default"].generate('pwa', ['injectManifest', pwaOptions]);
167
- } // Others
160
+ }
168
161
 
162
+ // Others
169
163
  }, {
170
164
  key: "modernizr",
171
165
  value: function modernizr() {
@@ -174,6 +168,5 @@ var BalmHooks = /*#__PURE__*/function (_BaseHooks) {
174
168
  }]);
175
169
  return BalmHooks;
176
170
  }(BaseHooks);
177
-
178
171
  var _default = BalmHooks;
179
172
  exports["default"] = _default;