@unpackjs/core 1.7.5 → 1.7.7
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/compiled/css-loader/index.js +180 -178
- package/compiled/less-loader/index.js +11 -11
- package/compiled/line-diff/index.js +4 -4
- package/compiled/line-diff/license +1 -1
- package/compiled/line-diff/package.json +1 -1
- package/compiled/portfinder/index.js +37 -37
- package/compiled/postcss-loader/index.js +261 -256
- package/compiled/sass-loader/index.js +24 -20
- package/compiled/sass-loader/package.json +1 -1
- package/compiled/semver/index.js +188 -170
- package/compiled/semver/package.json +1 -1
- package/compiled/style-loader/index.js +13 -13
- package/compiled/webpack-bundle-analyzer/index.js +198 -198
- package/compiled/webpack-merge/index.js +29 -29
- package/dist/bundler-config/chunkSplit.cjs +169 -156
- package/dist/bundler-config/chunkSplit.js +125 -134
- package/dist/bundler-config/css.cjs +181 -158
- package/dist/bundler-config/css.js +139 -151
- package/dist/bundler-config/experimentCss.cjs +203 -159
- package/dist/bundler-config/experimentCss.js +162 -152
- package/dist/bundler-config/helper.cjs +82 -78
- package/dist/bundler-config/helper.js +36 -55
- package/dist/bundler-config/index.cjs +260 -209
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +209 -182
- package/dist/bundler-config/jsMinify.cjs +114 -95
- package/dist/bundler-config/jsMinify.js +70 -73
- package/dist/colors.cjs +83 -56
- package/dist/colors.js +38 -37
- package/dist/config.cjs +107 -93
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +64 -70
- package/dist/constants.cjs +65 -62
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +22 -38
- package/dist/createUnpack.cjs +111 -104
- package/dist/createUnpack.js +67 -82
- package/dist/global.cjs +36 -0
- package/dist/global.d.ts +2 -0
- package/dist/global.d.ts.map +1 -0
- package/dist/global.js +4 -0
- package/dist/index.cjs +174 -51
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -15
- package/dist/lightningcss/loader.cjs +56 -53
- package/dist/lightningcss/loader.d.ts.map +1 -1
- package/dist/lightningcss/loader.js +25 -34
- package/dist/lightningcss/minimizer.cjs +90 -109
- package/dist/lightningcss/minimizer.d.ts.map +1 -1
- package/dist/lightningcss/minimizer.js +59 -87
- package/dist/logger.cjs +104 -98
- package/dist/logger.js +59 -76
- package/dist/openBrowser.cjs +104 -81
- package/dist/openBrowser.js +56 -52
- package/dist/plugin-progress/rspack.cjs +104 -79
- package/dist/plugin-progress/rspack.js +59 -57
- package/dist/plugin-progress/webpack.cjs +111 -89
- package/dist/plugin-progress/webpack.js +65 -67
- package/dist/plugin.cjs +38 -29
- package/dist/plugin.js +8 -17
- package/dist/prebundleDeps.cjs +327 -337
- package/dist/prebundleDeps.d.ts.map +1 -1
- package/dist/prebundleDeps.js +278 -324
- package/dist/progressBar.cjs +82 -65
- package/dist/progressBar.js +38 -43
- package/dist/reporter.cjs +149 -124
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +102 -102
- package/dist/run/build.cjs +68 -67
- package/dist/run/build.js +24 -45
- package/dist/run/dev.cjs +96 -83
- package/dist/run/dev.d.ts.map +1 -1
- package/dist/run/dev.js +50 -61
- package/dist/run/index.cjs +74 -21
- package/dist/run/index.js +2 -9
- package/dist/typed-css-modules/loader.cjs +179 -188
- package/dist/typed-css-modules/loader.js +118 -151
- package/dist/typed-css-modules/plugin.cjs +113 -88
- package/dist/typed-css-modules/plugin.js +68 -66
- package/dist/typed-css-modules/utils.cjs +43 -42
- package/dist/typed-css-modules/utils.js +13 -30
- package/dist/types/chunkSplit.cjs +19 -15
- package/dist/types/chunkSplit.d.ts +2 -10
- package/dist/types/chunkSplit.d.ts.map +1 -1
- package/dist/types/chunkSplit.js +2 -9
- package/dist/types/config.cjs +19 -15
- package/dist/types/config.js +2 -9
- package/dist/types/index.cjs +101 -27
- package/dist/types/index.js +2 -9
- package/dist/types/lightningcss.cjs +19 -15
- package/dist/types/lightningcss.js +2 -9
- package/dist/types/logger.cjs +43 -34
- package/dist/types/logger.js +13 -22
- package/dist/types/plugin.cjs +19 -15
- package/dist/types/plugin.js +2 -9
- package/dist/utils.cjs +280 -304
- package/dist/utils.js +195 -241
- package/dist/watchFiles.cjs +73 -0
- package/dist/watchFiles.d.ts +3 -0
- package/dist/watchFiles.d.ts.map +1 -0
- package/dist/watchFiles.js +27 -0
- package/package.json +18 -21
- package/compiled/commander/index.d.ts +0 -1047
- package/compiled/commander/index.js +0 -2428
- package/compiled/commander/license +0 -22
- package/compiled/commander/package.json +0 -1
- package/dist/bundleRequire.cjs +0 -200
- package/dist/bundleRequire.d.ts +0 -5
- package/dist/bundleRequire.d.ts.map +0 -1
- package/dist/bundleRequire.js +0 -173
- package/dist/lightningcss/cache.cjs +0 -36
- package/dist/lightningcss/cache.d.ts +0 -2
- package/dist/lightningcss/cache.d.ts.map +0 -1
- package/dist/lightningcss/cache.js +0 -22
package/dist/logger.js
CHANGED
|
@@ -1,81 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
var getFilename = () => fileURLToPath(import.meta.url);
|
|
7
|
-
var getDirname = () => path.dirname(getFilename());
|
|
8
|
-
var __dirname = /* @__PURE__ */ getDirname();
|
|
9
|
-
var __filename = /* @__PURE__ */ getFilename();
|
|
10
|
-
import readline from "node:readline";
|
|
11
|
-
import colors from "./colors.js";
|
|
12
|
-
import { LogColor } from "./types/index.js";
|
|
1
|
+
import __rslib_shim_module__ from 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_readline_91c31510__ from "node:readline";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__ from "./colors.js";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__types_index_js_63ede62f__ from "./types/index.js";
|
|
13
6
|
const prefixes = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
wait: '○',
|
|
8
|
+
error: '⨯',
|
|
9
|
+
warn: '⚠',
|
|
10
|
+
info: 'ℹ',
|
|
11
|
+
ready: '✓',
|
|
12
|
+
event: '»',
|
|
13
|
+
debug: '⚙'
|
|
21
14
|
};
|
|
22
|
-
const createLogger = ()
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
15
|
+
const createLogger = ()=>{
|
|
16
|
+
const log = (type, message, ...args)=>{
|
|
17
|
+
const label = __WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"][__WEBPACK_EXTERNAL_MODULE__types_index_js_63ede62f__.LogColor[type]](__WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].bold(prefixes[type]));
|
|
18
|
+
let text = '';
|
|
19
|
+
switch(type){
|
|
20
|
+
case 'error':
|
|
21
|
+
if (message instanceof Error) {
|
|
22
|
+
if (message.stack) {
|
|
23
|
+
let [name, ...rest] = message.stack.split('\n');
|
|
24
|
+
if (name.startsWith('Error: ')) {
|
|
25
|
+
name = name.slice(7);
|
|
26
|
+
rest = rest.map((line)=>line.slice(2));
|
|
27
|
+
}
|
|
28
|
+
text = `${__WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].red(name)}\n${__WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].dim(rest.join('\n'))}`;
|
|
29
|
+
} else text = __WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].red(message.message);
|
|
30
|
+
} else text = __WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].red(message);
|
|
31
|
+
break;
|
|
32
|
+
case 'warn':
|
|
33
|
+
text = __WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].yellow(message);
|
|
34
|
+
break;
|
|
35
|
+
default:
|
|
36
|
+
text = message;
|
|
37
|
+
break;
|
|
42
38
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
text = colors.yellow(message);
|
|
46
|
-
break;
|
|
47
|
-
default:
|
|
48
|
-
text = message;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
if (type === "debug" && process.env.DEBUG !== "unpack")
|
|
52
|
-
return;
|
|
53
|
-
console.log(`${label} ${text}`, ...args);
|
|
54
|
-
};
|
|
55
|
-
const logger2 = {
|
|
56
|
-
clear: () => {
|
|
57
|
-
const repeatCount = process.stdout.rows - 2;
|
|
58
|
-
const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : "";
|
|
59
|
-
console.log(blank);
|
|
60
|
-
readline.cursorTo(process.stdout, 0, 0);
|
|
61
|
-
readline.clearScreenDown(process.stdout);
|
|
62
|
-
},
|
|
63
|
-
greet: (msg) => {
|
|
64
|
-
const { npm_execpath, npm_lifecycle_event } = process.env;
|
|
65
|
-
if (!npm_execpath || npm_lifecycle_event === "npx" || npm_execpath.includes("npx-cli") || npm_execpath.includes(".bun") || npm_execpath.includes("yarn")) {
|
|
66
|
-
console.log();
|
|
67
|
-
}
|
|
68
|
-
console.log(msg);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
Object.keys(prefixes).forEach((type) => {
|
|
72
|
-
logger2[type] = (message, ...args) => {
|
|
73
|
-
log(type, message, ...args);
|
|
39
|
+
if ('debug' === type && 'unpack' !== process.env.DEBUG) return;
|
|
40
|
+
console.log(`${label} ${text}`, ...args);
|
|
74
41
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
42
|
+
const logger = {
|
|
43
|
+
clear: ()=>{
|
|
44
|
+
const repeatCount = process.stdout.rows - 2;
|
|
45
|
+
const blank = repeatCount > 0 ? '\n'.repeat(repeatCount) : '';
|
|
46
|
+
console.log(blank);
|
|
47
|
+
__WEBPACK_EXTERNAL_MODULE_node_readline_91c31510__["default"].cursorTo(process.stdout, 0, 0);
|
|
48
|
+
__WEBPACK_EXTERNAL_MODULE_node_readline_91c31510__["default"].clearScreenDown(process.stdout);
|
|
49
|
+
},
|
|
50
|
+
greet: (msg)=>{
|
|
51
|
+
const { npm_execpath, npm_lifecycle_event } = process.env;
|
|
52
|
+
if (!npm_execpath || 'npx' === npm_lifecycle_event || npm_execpath.includes('npx-cli') || npm_execpath.includes('.bun') || npm_execpath.includes('yarn')) console.log();
|
|
53
|
+
console.log(msg);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
Object.keys(prefixes).forEach((type)=>{
|
|
57
|
+
logger[type] = (message, ...args)=>{
|
|
58
|
+
log(type, message, ...args);
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
return logger;
|
|
81
62
|
};
|
|
63
|
+
const logger_rslib_entry_logger = createLogger();
|
|
64
|
+
export { logger_rslib_entry_logger as logger };
|
package/dist/openBrowser.cjs
CHANGED
|
@@ -1,85 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var openBrowser_exports = {};
|
|
29
|
-
__export(openBrowser_exports, {
|
|
30
|
-
openBrowser: () => openBrowser
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(openBrowser_exports);
|
|
33
|
-
var import_node_child_process = require("node:child_process");
|
|
34
|
-
var import_node_path = __toESM(require("node:path"));
|
|
35
|
-
var import_logger = require("./logger.cjs");
|
|
36
|
-
const open = require("open");
|
|
37
|
-
async function openBrowser(url) {
|
|
38
|
-
const supportedChromiumBrowsers = [
|
|
39
|
-
"Google Chrome Canary",
|
|
40
|
-
"Google Chrome Dev",
|
|
41
|
-
"Google Chrome Beta",
|
|
42
|
-
"Google Chrome",
|
|
43
|
-
"Microsoft Edge",
|
|
44
|
-
"Brave Browser",
|
|
45
|
-
"Vivaldi",
|
|
46
|
-
"Chromium"
|
|
47
|
-
];
|
|
48
|
-
if (process.platform === "darwin") {
|
|
49
|
-
try {
|
|
50
|
-
const ps = await execAsync("ps cax");
|
|
51
|
-
const openedBrowser = supportedChromiumBrowsers.find((b) => ps.includes(b));
|
|
52
|
-
if (openedBrowser) {
|
|
53
|
-
await execAsync(`osascript openChrome.applescript "${encodeURI(url)}" "${openedBrowser}"`, {
|
|
54
|
-
cwd: import_node_path.default.join(__dirname, "../bin")
|
|
55
|
-
});
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
} catch (err) {
|
|
59
|
-
import_logger.logger.error(err);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
open: function(module) {
|
|
4
|
+
module.exports = require("open");
|
|
60
5
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
6
|
+
};
|
|
7
|
+
var __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
13
|
+
};
|
|
14
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
+
return module.exports;
|
|
70
16
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.n = function(module) {
|
|
19
|
+
var getter = module && module.__esModule ? function() {
|
|
20
|
+
return module['default'];
|
|
21
|
+
} : function() {
|
|
22
|
+
return module;
|
|
23
|
+
};
|
|
24
|
+
__webpack_require__.d(getter, {
|
|
25
|
+
a: getter
|
|
26
|
+
});
|
|
27
|
+
return getter;
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
(()=>{
|
|
31
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
32
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: definition[key]
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
(()=>{
|
|
39
|
+
__webpack_require__.o = function(obj, prop) {
|
|
40
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
(()=>{
|
|
44
|
+
__webpack_require__.r = function(exports1) {
|
|
45
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
46
|
+
value: 'Module'
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
49
|
+
value: true
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
})();
|
|
53
|
+
var __webpack_exports__ = {};
|
|
54
|
+
(()=>{
|
|
55
|
+
__webpack_require__.r(__webpack_exports__);
|
|
56
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
57
|
+
openBrowser: ()=>openBrowser
|
|
79
58
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
59
|
+
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
60
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
61
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
62
|
+
const external_logger_cjs_namespaceObject = require("./logger.cjs");
|
|
63
|
+
const openBrowser_rslib_entry_open = __webpack_require__("open");
|
|
64
|
+
async function openBrowser(url) {
|
|
65
|
+
const supportedChromiumBrowsers = [
|
|
66
|
+
'Google Chrome Canary',
|
|
67
|
+
'Google Chrome Dev',
|
|
68
|
+
'Google Chrome Beta',
|
|
69
|
+
'Google Chrome',
|
|
70
|
+
'Microsoft Edge',
|
|
71
|
+
'Brave Browser',
|
|
72
|
+
'Vivaldi',
|
|
73
|
+
'Chromium'
|
|
74
|
+
];
|
|
75
|
+
if ('darwin' === process.platform) try {
|
|
76
|
+
const ps = await execAsync('ps cax');
|
|
77
|
+
const openedBrowser = supportedChromiumBrowsers.find((b)=>ps.includes(b));
|
|
78
|
+
if (openedBrowser) {
|
|
79
|
+
await execAsync(`osascript openChrome.applescript "${encodeURI(url)}" "${openedBrowser}"`, {
|
|
80
|
+
cwd: external_node_path_default().join(__dirname, '../bin')
|
|
81
|
+
});
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
} catch (err) {
|
|
85
|
+
external_logger_cjs_namespaceObject.logger.error(err);
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
openBrowser_rslib_entry_open(url).catch(()=>{});
|
|
89
|
+
return true;
|
|
90
|
+
} catch (err) {
|
|
91
|
+
external_logger_cjs_namespaceObject.logger.error(err);
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function execAsync(command, options) {
|
|
96
|
+
return new Promise((resolve, reject)=>{
|
|
97
|
+
(0, external_node_child_process_namespaceObject.exec)(command, options, (error, stdout)=>{
|
|
98
|
+
if (error) reject(error);
|
|
99
|
+
else resolve(stdout.toString());
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
})();
|
|
104
|
+
var __webpack_export_target__ = exports;
|
|
105
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
106
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
107
|
+
value: true
|
|
85
108
|
});
|
package/dist/openBrowser.js
CHANGED
|
@@ -1,61 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import __rslib_shim_module__ from 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
|
|
4
|
+
import { dirname as __webpack_dirname__ } from "node:path";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE_open__ from "open";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_child_process_27f17141__ from "node:child_process";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__logger_js_c2be5186__ from "./logger.js";
|
|
9
|
+
var __webpack_modules__ = {
|
|
10
|
+
open: function(module) {
|
|
11
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_open__;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var __webpack_module_cache__ = {};
|
|
15
|
+
function __webpack_require__(moduleId) {
|
|
16
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
17
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
18
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
19
|
+
exports: {}
|
|
20
|
+
};
|
|
21
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
22
|
+
return module.exports;
|
|
23
|
+
}
|
|
24
|
+
var openBrowser_rslib_entry_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
25
|
+
const openBrowser_rslib_entry_open = __webpack_require__("open");
|
|
14
26
|
async function openBrowser(url) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
const supportedChromiumBrowsers = [
|
|
28
|
+
'Google Chrome Canary',
|
|
29
|
+
'Google Chrome Dev',
|
|
30
|
+
'Google Chrome Beta',
|
|
31
|
+
'Google Chrome',
|
|
32
|
+
'Microsoft Edge',
|
|
33
|
+
'Brave Browser',
|
|
34
|
+
'Vivaldi',
|
|
35
|
+
'Chromium'
|
|
36
|
+
];
|
|
37
|
+
if ('darwin' === process.platform) try {
|
|
38
|
+
const ps = await execAsync('ps cax');
|
|
39
|
+
const openedBrowser = supportedChromiumBrowsers.find((b)=>ps.includes(b));
|
|
40
|
+
if (openedBrowser) {
|
|
41
|
+
await execAsync(`osascript openChrome.applescript "${encodeURI(url)}" "${openedBrowser}"`, {
|
|
42
|
+
cwd: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(openBrowser_rslib_entry_dirname, '../bin')
|
|
43
|
+
});
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
} catch (err) {
|
|
47
|
+
__WEBPACK_EXTERNAL_MODULE__logger_js_c2be5186__.logger.error(err);
|
|
48
|
+
}
|
|
26
49
|
try {
|
|
27
|
-
|
|
28
|
-
const openedBrowser = supportedChromiumBrowsers.find((b) => ps.includes(b));
|
|
29
|
-
if (openedBrowser) {
|
|
30
|
-
await execAsync(`osascript openChrome.applescript "${encodeURI(url)}" "${openedBrowser}"`, {
|
|
31
|
-
cwd: path2.join(__dirname, "../bin")
|
|
32
|
-
});
|
|
50
|
+
openBrowser_rslib_entry_open(url).catch(()=>{});
|
|
33
51
|
return true;
|
|
34
|
-
}
|
|
35
52
|
} catch (err) {
|
|
36
|
-
|
|
53
|
+
__WEBPACK_EXTERNAL_MODULE__logger_js_c2be5186__.logger.error(err);
|
|
54
|
+
return false;
|
|
37
55
|
}
|
|
38
|
-
}
|
|
39
|
-
try {
|
|
40
|
-
open(url).catch(() => {
|
|
41
|
-
});
|
|
42
|
-
return true;
|
|
43
|
-
} catch (err) {
|
|
44
|
-
logger.error(err);
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
56
|
}
|
|
48
57
|
function execAsync(command, options) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
resolve(stdout.toString());
|
|
55
|
-
}
|
|
58
|
+
return new Promise((resolve, reject)=>{
|
|
59
|
+
(0, __WEBPACK_EXTERNAL_MODULE_node_child_process_27f17141__.exec)(command, options, (error, stdout)=>{
|
|
60
|
+
if (error) reject(error);
|
|
61
|
+
else resolve(stdout.toString());
|
|
62
|
+
});
|
|
56
63
|
});
|
|
57
|
-
});
|
|
58
64
|
}
|
|
59
|
-
export {
|
|
60
|
-
openBrowser
|
|
61
|
-
};
|
|
65
|
+
export { openBrowser };
|
|
@@ -1,84 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = function(module) {
|
|
5
|
+
var getter = module && module.__esModule ? function() {
|
|
6
|
+
return module['default'];
|
|
7
|
+
} : function() {
|
|
8
|
+
return module;
|
|
9
|
+
};
|
|
10
|
+
__webpack_require__.d(getter, {
|
|
11
|
+
a: getter
|
|
12
|
+
});
|
|
13
|
+
return getter;
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
18
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: definition[key]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = function(obj, prop) {
|
|
26
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
27
|
+
};
|
|
28
|
+
})();
|
|
29
|
+
(()=>{
|
|
30
|
+
__webpack_require__.r = function(exports1) {
|
|
31
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
32
|
+
value: 'Module'
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
var __webpack_exports__ = {};
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
+
RspackPluginProgress: ()=>RspackPluginProgress
|
|
31
43
|
});
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
45
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
46
|
+
const core_namespaceObject = require("@rspack/core");
|
|
47
|
+
const external_colors_cjs_namespaceObject = require("../colors.cjs");
|
|
48
|
+
var external_colors_cjs_default = /*#__PURE__*/ __webpack_require__.n(external_colors_cjs_namespaceObject);
|
|
49
|
+
const external_logger_cjs_namespaceObject = require("../logger.cjs");
|
|
50
|
+
const external_progressBar_cjs_namespaceObject = require("../progressBar.cjs");
|
|
51
|
+
const external_reporter_cjs_namespaceObject = require("../reporter.cjs");
|
|
52
|
+
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
53
|
+
function _define_property(obj, key, value) {
|
|
54
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
55
|
+
value: value,
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true,
|
|
58
|
+
writable: true
|
|
45
59
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
compiler
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
60
|
+
else obj[key] = value;
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
const PLUGIN_NAME = 'PluginProgress';
|
|
64
|
+
class RspackPluginProgress extends core_namespaceObject.rspack.ProgressPlugin {
|
|
65
|
+
apply(compiler) {
|
|
66
|
+
super.apply(compiler);
|
|
67
|
+
compiler.hooks.compile.tap(PLUGIN_NAME, ()=>{
|
|
68
|
+
this.startTime = process.hrtime();
|
|
69
|
+
(0, external_utils_cjs_namespaceObject.isProd)() || external_logger_cjs_namespaceObject.logger.wait('building...');
|
|
70
|
+
});
|
|
71
|
+
compiler.hooks.done.tap(PLUGIN_NAME, async (stats)=>{
|
|
72
|
+
if (!this.startTime) return;
|
|
73
|
+
(0, external_utils_cjs_namespaceObject.isProd)() && this.progressBar.done();
|
|
74
|
+
const hrtime = process.hrtime(this.startTime);
|
|
75
|
+
const compileTime = hrtime[0] + hrtime[1] / 1e9;
|
|
76
|
+
this.startTime = void 0;
|
|
77
|
+
const root = compiler.options.context;
|
|
78
|
+
if (!stats.hasErrors()) {
|
|
79
|
+
if ((0, external_utils_cjs_namespaceObject.isProd)()) {
|
|
80
|
+
await (0, external_reporter_cjs_namespaceObject.printFileSize)({
|
|
81
|
+
root,
|
|
82
|
+
stats
|
|
83
|
+
});
|
|
84
|
+
console.log(external_colors_cjs_default().green(`✓ built in ${external_colors_cjs_default().bold((0, external_utils_cjs_namespaceObject.prettyTime)(compileTime))}`));
|
|
85
|
+
} else {
|
|
86
|
+
const modules = stats.compilation.modules;
|
|
87
|
+
modules.forEach((module)=>{
|
|
88
|
+
const { resource } = module;
|
|
89
|
+
if (null == resource ? void 0 : resource.includes(external_node_path_default().resolve(root, 'node_modules'))) external_logger_cjs_namespaceObject.logger.debug(external_node_path_default().relative(root, resource));
|
|
90
|
+
});
|
|
91
|
+
external_logger_cjs_namespaceObject.logger.ready(`built in ${(0, external_utils_cjs_namespaceObject.prettyTime)(compileTime)} (${modules.size} modules)`);
|
|
92
|
+
}
|
|
73
93
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
constructor(){
|
|
97
|
+
super((percentage, msg, ...args)=>{
|
|
98
|
+
(0, external_utils_cjs_namespaceObject.isProd)() && this.progressBar.update({
|
|
99
|
+
current: percentage,
|
|
100
|
+
message: `${msg} ${args.join(' ')}`
|
|
101
|
+
});
|
|
102
|
+
}), _define_property(this, "startTime", void 0), _define_property(this, "progressBar", new external_progressBar_cjs_namespaceObject.ProgressBar());
|
|
103
|
+
}
|
|
80
104
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
105
|
+
var __webpack_export_target__ = exports;
|
|
106
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
107
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
108
|
+
value: true
|
|
84
109
|
});
|