@unpackjs/core 1.7.10 → 1.7.12

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 (44) hide show
  1. package/compiled/css-loader/index.js +20 -20
  2. package/compiled/less-loader/index.js +8 -8
  3. package/compiled/portfinder/index.d.ts +21 -1
  4. package/compiled/portfinder/index.js +33 -14
  5. package/compiled/portfinder/package.json +1 -1
  6. package/compiled/postcss-loader/index.js +8 -8
  7. package/compiled/sass-loader/index.js +8 -8
  8. package/compiled/style-loader/index.js +10 -10
  9. package/dist/bundler-config/css.cjs +16 -16
  10. package/dist/bundler-config/css.js +19 -19
  11. package/dist/bundler-config/experimentCss.cjs +15 -15
  12. package/dist/bundler-config/experimentCss.js +17 -17
  13. package/dist/bundler-config/index.cjs +35 -23
  14. package/dist/bundler-config/index.d.ts.map +1 -1
  15. package/dist/bundler-config/index.js +35 -23
  16. package/dist/bundler-config/jsMinify.cjs +1 -1
  17. package/dist/bundler-config/jsMinify.js +1 -1
  18. package/dist/colors.cjs +2 -2
  19. package/dist/colors.js +2 -2
  20. package/dist/config.js +2 -2
  21. package/dist/createUnpack.cjs +2 -2
  22. package/dist/createUnpack.js +2 -2
  23. package/dist/index.cjs +4 -4
  24. package/dist/index.js +7 -39
  25. package/dist/lightningcss/loader.cjs +2 -2
  26. package/dist/lightningcss/loader.js +2 -2
  27. package/dist/lightningcss/minimizer.cjs +3 -3
  28. package/dist/lightningcss/minimizer.js +3 -3
  29. package/dist/logger.cjs +2 -2
  30. package/dist/logger.js +2 -2
  31. package/dist/openBrowser.cjs +2 -2
  32. package/dist/openBrowser.js +4 -4
  33. package/dist/prebundleDeps.cjs +3 -9
  34. package/dist/prebundleDeps.js +3 -9
  35. package/dist/run/dev.cjs +5 -5
  36. package/dist/run/dev.js +5 -5
  37. package/dist/typed-css-modules/loader.cjs +4 -10
  38. package/dist/typed-css-modules/loader.js +4 -10
  39. package/dist/typed-css-modules/plugin.cjs +1 -1
  40. package/dist/typed-css-modules/plugin.js +1 -1
  41. package/dist/types/logger.js +2 -2
  42. package/dist/utils.cjs +3 -3
  43. package/dist/utils.js +5 -5
  44. package/package.json +5 -5
package/dist/run/dev.js CHANGED
@@ -14,12 +14,12 @@ async function bundlerDev(originalUnpackConfig) {
14
14
  var _unpackConfig_dev, _unpackConfig_server, _unpackConfig_server1, _unpackConfig_dev1;
15
15
  let unpackConfig = originalUnpackConfig;
16
16
  const bundler = 'rspack' === unpackConfig.bundler ? __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack : __WEBPACK_EXTERNAL_MODULE_webpack__["default"];
17
- if (null === (_unpackConfig_dev = unpackConfig.dev) || void 0 === _unpackConfig_dev ? void 0 : _unpackConfig_dev.prebundle) unpackConfig = await (0, __WEBPACK_EXTERNAL_MODULE__prebundleDeps_js_142f70dc__.prebundleDeps)({
17
+ if (null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.prebundle) unpackConfig = await (0, __WEBPACK_EXTERNAL_MODULE__prebundleDeps_js_142f70dc__.prebundleDeps)({
18
18
  unpackConfig
19
19
  });
20
20
  const config = await (0, __WEBPACK_EXTERNAL_MODULE__bundler_config_index_js_e76188c2__.getBundlerConfig)(unpackConfig);
21
21
  const compiler = bundler(config);
22
- const port = await (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getPort)(null === (_unpackConfig_server = unpackConfig.server) || void 0 === _unpackConfig_server ? void 0 : _unpackConfig_server.port);
22
+ const port = await (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getPort)(null == (_unpackConfig_server = unpackConfig.server) ? void 0 : _unpackConfig_server.port);
23
23
  const middleware = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.experiments.lazyCompilationMiddleware(compiler, config.experiments.lazyCompilation);
24
24
  const devServerOptions = {
25
25
  hot: true,
@@ -28,9 +28,9 @@ async function bundlerDev(originalUnpackConfig) {
28
28
  client: {
29
29
  overlay: false
30
30
  },
31
- proxy: null === (_unpackConfig_server1 = unpackConfig.server) || void 0 === _unpackConfig_server1 ? void 0 : _unpackConfig_server1.proxy,
31
+ proxy: null == (_unpackConfig_server1 = unpackConfig.server) ? void 0 : _unpackConfig_server1.proxy,
32
32
  devMiddleware: {
33
- writeToDisk: null === (_unpackConfig_dev1 = unpackConfig.dev) || void 0 === _unpackConfig_dev1 ? void 0 : _unpackConfig_dev1.writeToDisk
33
+ writeToDisk: null == (_unpackConfig_dev1 = unpackConfig.dev) ? void 0 : _unpackConfig_dev1.writeToDisk
34
34
  },
35
35
  setupMiddlewares (other) {
36
36
  return [
@@ -40,7 +40,7 @@ async function bundlerDev(originalUnpackConfig) {
40
40
  }
41
41
  };
42
42
  const server = new __WEBPACK_EXTERNAL_MODULE_webpack_dev_server_0dd3124e__["default"](devServerOptions, compiler);
43
- __WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.greet(` ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].green(`${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].bold('UNPACK')} v1.7.10`)} ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].dim(`ready in ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].reset(__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].bold(Math.ceil(performance.now() - global.__unpack_start_time)))}ms`)}\n`);
43
+ __WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.greet(` ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].green(`${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].bold('UNPACK')} v1.7.12`)} ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].dim(`ready in ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].reset(__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].bold(Math.ceil(performance.now() - global.__unpack_start_time)))}ms`)}\n`);
44
44
  printAddressUrls(port);
45
45
  await server.start();
46
46
  __WEBPACK_EXTERNAL_MODULE__global_js_83d0ec5c__.restartCleaners.push(async ()=>await server.stop(), ()=>new Promise((resolve)=>compiler.close(()=>resolve())));
@@ -49,7 +49,7 @@ var __webpack_exports__ = {};
49
49
  __webpack_require__.r(__webpack_exports__);
50
50
  __webpack_require__.d(__webpack_exports__, {
51
51
  wrapQuotes: ()=>wrapQuotes,
52
- default: ()=>loader_rslib_entry_,
52
+ default: ()=>loader,
53
53
  isInNodeModules: ()=>isInNodeModules
54
54
  });
55
55
  const external_node_fs_namespaceObject = require("node:fs");
@@ -133,21 +133,15 @@ var __webpack_exports__ = {};
133
133
  const cssModuleExport = 'declare const cssExports: CssExports;\nexport default cssExports;\n';
134
134
  return `${bannerMessage}\n${cssModuleToInterface(keys)}\n${cssModuleExport}`;
135
135
  }
136
- function loader_rslib_entry_(content, ...rest) {
136
+ function loader(content, ...rest) {
137
137
  const { failed, success } = makeDoneHandlers(this.async(), content, rest);
138
138
  const { resourcePath } = this;
139
139
  const { mode = 'emit', modules } = this.getOptions() || {};
140
- if (!validModes.includes(mode)) {
141
- failed(new Error(`Invalid mode option: ${mode}`));
142
- return;
143
- }
140
+ if (!validModes.includes(mode)) return void failed(new Error(`Invalid mode option: ${mode}`));
144
141
  if (!(0, external_utils_cjs_namespaceObject.isCSSModules)({
145
142
  resourcePath,
146
143
  modules
147
- }) || isInNodeModules(resourcePath)) {
148
- success();
149
- return;
150
- }
144
+ }) || isInNodeModules(resourcePath)) return void success();
151
145
  const cssModuleInterfaceFilename = filenameToTypingsFilename(resourcePath);
152
146
  const { read, write } = makeFileHandlers(cssModuleInterfaceFilename);
153
147
  const namedExport = external_constants_cjs_namespaceObject.CSS_NAMED_EXPORT;
@@ -95,21 +95,15 @@ function codegen(keys, namedExport) {
95
95
  const cssModuleExport = 'declare const cssExports: CssExports;\nexport default cssExports;\n';
96
96
  return `${bannerMessage}\n${cssModuleToInterface(keys)}\n${cssModuleExport}`;
97
97
  }
98
- function loader_rslib_entry_(content, ...rest) {
98
+ function loader(content, ...rest) {
99
99
  const { failed, success } = makeDoneHandlers(this.async(), content, rest);
100
100
  const { resourcePath } = this;
101
101
  const { mode = 'emit', modules } = this.getOptions() || {};
102
- if (!validModes.includes(mode)) {
103
- failed(new Error(`Invalid mode option: ${mode}`));
104
- return;
105
- }
102
+ if (!validModes.includes(mode)) return void failed(new Error(`Invalid mode option: ${mode}`));
106
103
  if (!(0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.isCSSModules)({
107
104
  resourcePath,
108
105
  modules
109
- }) || isInNodeModules(resourcePath)) {
110
- success();
111
- return;
112
- }
106
+ }) || isInNodeModules(resourcePath)) return void success();
113
107
  const cssModuleInterfaceFilename = filenameToTypingsFilename(resourcePath);
114
108
  const { read, write } = makeFileHandlers(cssModuleInterfaceFilename);
115
109
  const namedExport = __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.CSS_NAMED_EXPORT;
@@ -134,4 +128,4 @@ function loader_rslib_entry_(content, ...rest) {
134
128
  });
135
129
  });
136
130
  }
137
- export { loader_rslib_entry_ as default, isInNodeModules, wrapQuotes };
131
+ export { loader as default, isInNodeModules, wrapQuotes };
@@ -90,7 +90,7 @@ class PluginTypedCssModules {
90
90
  var _this_userOptions;
91
91
  return (0, external_utils_cjs_namespaceObject.isCSSModules)({
92
92
  resourcePath: file,
93
- modules: null === (_this_userOptions = this.userOptions) || void 0 === _this_userOptions ? void 0 : _this_userOptions.modules
93
+ modules: null == (_this_userOptions = this.userOptions) ? void 0 : _this_userOptions.modules
94
94
  });
95
95
  });
96
96
  const doTask = incremental ? generateTypingIfNecessary : writeFile;
@@ -53,7 +53,7 @@ class PluginTypedCssModules {
53
53
  var _this_userOptions;
54
54
  return (0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.isCSSModules)({
55
55
  resourcePath: file,
56
- modules: null === (_this_userOptions = this.userOptions) || void 0 === _this_userOptions ? void 0 : _this_userOptions.modules
56
+ modules: null == (_this_userOptions = this.userOptions) ? void 0 : _this_userOptions.modules
57
57
  });
58
58
  });
59
59
  const doTask = incremental ? generateTypingIfNecessary : writeFile;
@@ -1,6 +1,6 @@
1
1
  import __rslib_shim_module__ from 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
- var logger_rslib_entry_LogColor = /*#__PURE__*/ function(LogColor) {
3
+ var logger_LogColor = /*#__PURE__*/ function(LogColor) {
4
4
  LogColor["error"] = "red";
5
5
  LogColor["warn"] = "yellow";
6
6
  LogColor["info"] = "cyan";
@@ -10,4 +10,4 @@ var logger_rslib_entry_LogColor = /*#__PURE__*/ function(LogColor) {
10
10
  LogColor["debug"] = "dim";
11
11
  return LogColor;
12
12
  }({});
13
- export { logger_rslib_entry_LogColor as LogColor };
13
+ export { logger_LogColor as LogColor };
package/dist/utils.cjs CHANGED
@@ -60,7 +60,7 @@ var __webpack_exports__ = {};
60
60
  isDev: ()=>isDev,
61
61
  getAddressUrls: ()=>getAddressUrls,
62
62
  getCompiledPkgPath: ()=>getCompiledPkgPath,
63
- isDevServer: ()=>utils_rslib_entry_isDevServer,
63
+ isDevServer: ()=>utils_isDevServer,
64
64
  isFunction: ()=>isFunction,
65
65
  getUserDepVersion: ()=>getUserDepVersion,
66
66
  isObject: ()=>isObject,
@@ -106,8 +106,8 @@ var __webpack_exports__ = {};
106
106
  process.env.DEV_SERVER = isDevServer ? 'true' : 'false';
107
107
  };
108
108
  const isDev = ()=>'development' === getNodeEnv();
109
- const utils_rslib_entry_isDevServer = ()=>'true' === process.env.DEV_SERVER;
110
- const isWatch = ()=>isDev() && !utils_rslib_entry_isDevServer();
109
+ const utils_isDevServer = ()=>'true' === process.env.DEV_SERVER;
110
+ const isWatch = ()=>isDev() && !utils_isDevServer();
111
111
  const isProd = ()=>'production' === getNodeEnv();
112
112
  const isWin = ()=>'win32' === process.platform;
113
113
  const isString = (str)=>'string' == typeof str;
package/dist/utils.js CHANGED
@@ -29,7 +29,7 @@ function __webpack_require__(moduleId) {
29
29
  __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
30
30
  return module.exports;
31
31
  }
32
- var utils_rslib_entry_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
32
+ var utils_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
33
33
  const portfinder = __webpack_require__("../compiled/portfinder/index.js");
34
34
  const { merge } = __webpack_require__("../compiled/webpack-merge/index.js");
35
35
  const getNodeEnv = ()=>process.env.NODE_ENV;
@@ -40,8 +40,8 @@ const setDevServer = (isDevServer)=>{
40
40
  process.env.DEV_SERVER = isDevServer ? 'true' : 'false';
41
41
  };
42
42
  const isDev = ()=>'development' === getNodeEnv();
43
- const utils_rslib_entry_isDevServer = ()=>'true' === process.env.DEV_SERVER;
44
- const isWatch = ()=>isDev() && !utils_rslib_entry_isDevServer();
43
+ const utils_isDevServer = ()=>'true' === process.env.DEV_SERVER;
44
+ const isWatch = ()=>isDev() && !utils_isDevServer();
45
45
  const isProd = ()=>'production' === getNodeEnv();
46
46
  const isWin = ()=>'win32' === process.platform;
47
47
  const isString = (str)=>'string' == typeof str;
@@ -87,7 +87,7 @@ const getPort = (startPort)=>new Promise((resolve)=>{
87
87
  resolve(port);
88
88
  });
89
89
  });
90
- const getCompiledPkgPath = (packageName)=>__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(utils_rslib_entry_dirname, '../compiled', packageName);
90
+ const getCompiledPkgPath = (packageName)=>__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(utils_dirname, '../compiled', packageName);
91
91
  const getUserDepPath = (root, deps)=>{
92
92
  const dependencies = Array.isArray(deps) ? deps : [
93
93
  deps
@@ -205,4 +205,4 @@ const removeDir = (dir)=>{
205
205
  force: true
206
206
  });
207
207
  };
208
- export { clearLine, debounce, getAddressUrls, getCompiledPkgPath, getIpv4Interfaces, getNodeEnv, getPathInJs, getPort, getTime, getUserDepPath, getUserDepVersion, getValueByPath, isBoolean, isDev, utils_rslib_entry_isDevServer as isDevServer, isFunction, isObject, isPlainObject, isProd, isRegExp, isString, isUndefined, isWatch, isWin, logUpdate, mergeConfig, prettyTime, removeDir, setDevServer, setNodeEnv, setValueByPath, trackPerformance };
208
+ export { clearLine, debounce, getAddressUrls, getCompiledPkgPath, getIpv4Interfaces, getNodeEnv, getPathInJs, getPort, getTime, getUserDepPath, getUserDepVersion, getValueByPath, isBoolean, isDev, utils_isDevServer as isDevServer, isFunction, isObject, isPlainObject, isProd, isRegExp, isString, isUndefined, isWatch, isWin, logUpdate, mergeConfig, prettyTime, removeDir, setDevServer, setNodeEnv, setValueByPath, trackPerformance };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unpackjs/core",
3
- "version": "1.7.10",
3
+ "version": "1.7.12",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
@@ -68,7 +68,7 @@
68
68
  "css-loader": "7.1.2",
69
69
  "less-loader": "12.2.0",
70
70
  "line-diff": "2.1.2",
71
- "portfinder": "1.0.35",
71
+ "portfinder": "1.0.36",
72
72
  "postcss-loader": "8.1.1",
73
73
  "sass-loader": "16.0.5",
74
74
  "semver": "7.7.1",
@@ -77,7 +77,7 @@
77
77
  "webpack-merge": "6.0.1"
78
78
  },
79
79
  "dependencies": {
80
- "@rspack/core": "1.3.1",
80
+ "@rspack/core": "1.3.5",
81
81
  "@types/less": "3.0.8",
82
82
  "chokidar": "4.0.3",
83
83
  "copy-webpack-plugin": "13.0.0",
@@ -93,10 +93,10 @@
93
93
  "picocolors": "1.1.1",
94
94
  "postcss": "8.5.3",
95
95
  "thread-loader": "4.0.4",
96
- "tinyglobby": "0.2.12",
96
+ "tinyglobby": "0.2.13",
97
97
  "ts-checker-rspack-plugin": "1.1.1",
98
98
  "typed-css-modules": "0.9.1",
99
- "webpack": "5.98.0",
99
+ "webpack": "5.99.6",
100
100
  "webpack-dev-server": "5.2.1"
101
101
  },
102
102
  "scripts": {