@unpackjs/core 1.5.3 → 1.6.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/bin/openChrome.applescript +94 -0
- package/compiled/chokidar/index.d.ts +327 -0
- package/compiled/chokidar/index.js +1773 -0
- package/compiled/chokidar/license +21 -0
- package/compiled/chokidar/package.json +1 -0
- package/compiled/commander/index.d.ts +971 -0
- package/compiled/commander/index.js +2190 -0
- package/compiled/commander/license +22 -0
- package/compiled/commander/package.json +1 -0
- package/compiled/css-loader/api.js +85 -0
- package/compiled/css-loader/getUrl.js +26 -0
- package/compiled/css-loader/index.d.ts +1 -0
- package/compiled/css-loader/index.js +8004 -0
- package/compiled/css-loader/license +20 -0
- package/compiled/css-loader/noSourceMaps.js +5 -0
- package/compiled/css-loader/package.json +1 -0
- package/compiled/css-loader/sourceMaps.js +16 -0
- package/compiled/fast-glob/index.d.ts +237 -0
- package/compiled/fast-glob/index.js +5726 -0
- package/compiled/fast-glob/license +21 -0
- package/compiled/fast-glob/package.json +1 -0
- package/compiled/less-loader/index.d.ts +1 -0
- package/compiled/less-loader/index.js +340 -0
- package/compiled/less-loader/license +20 -0
- package/compiled/less-loader/package.json +1 -0
- package/compiled/line-diff/index.d.ts +1 -0
- package/compiled/line-diff/index.js +160 -0
- package/compiled/line-diff/license +21 -0
- package/compiled/line-diff/package.json +1 -0
- package/compiled/log-update/index.d.ts +1 -0
- package/compiled/log-update/index.js +1970 -0
- package/compiled/log-update/package.json +1 -0
- package/compiled/portfinder/index.d.ts +64 -0
- package/compiled/portfinder/index.js +3401 -0
- package/compiled/portfinder/license +22 -0
- package/compiled/portfinder/package.json +1 -0
- package/compiled/postcss-loader/index.d.ts +1 -0
- package/compiled/postcss-loader/index.js +94945 -0
- package/compiled/postcss-loader/license +20 -0
- package/compiled/postcss-loader/package.json +1 -0
- package/compiled/sass-loader/index.d.ts +961 -0
- package/compiled/sass-loader/index.js +5610 -0
- package/compiled/sass-loader/index1.js +65 -0
- package/compiled/sass-loader/license +20 -0
- package/compiled/sass-loader/package.json +1 -0
- package/compiled/sass-loader/sass.node.js +12 -0
- package/compiled/semver/index.d.ts +1 -0
- package/compiled/semver/index.js +1940 -0
- package/compiled/semver/license +15 -0
- package/compiled/semver/package.json +1 -0
- package/compiled/style-loader/index.d.ts +1 -0
- package/compiled/style-loader/index.js +370 -0
- package/compiled/style-loader/license +20 -0
- package/compiled/style-loader/package.json +1 -0
- package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
- package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
- package/compiled/style-loader/runtime/insertBySelector.js +34 -0
- package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
- package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
- package/compiled/style-loader/runtime/isOldIE.js +17 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
- package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
- package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
- package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
- package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
- package/compiled/webpack-bundle-analyzer/index.d.ts +1 -0
- package/compiled/webpack-bundle-analyzer/index.js +13276 -0
- package/compiled/webpack-bundle-analyzer/license +20 -0
- package/compiled/webpack-bundle-analyzer/package.json +1 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
- package/compiled/webpack-merge/index.d.ts +31 -0
- package/compiled/webpack-merge/index.js +1200 -0
- package/compiled/webpack-merge/license +20 -0
- package/compiled/webpack-merge/package.json +1 -0
- package/dist/bundleRequire.cjs +200 -0
- package/dist/bundleRequire.d.ts +5 -0
- package/dist/bundleRequire.d.ts.map +1 -0
- package/dist/bundleRequire.js +173 -0
- package/dist/bundler-config/chunkSplit.cjs +151 -0
- package/dist/bundler-config/chunkSplit.d.ts +6 -0
- package/dist/bundler-config/chunkSplit.d.ts.map +1 -0
- package/dist/bundler-config/chunkSplit.js +127 -0
- package/dist/bundler-config/css.cjs +168 -0
- package/dist/bundler-config/css.d.ts +6 -0
- package/dist/bundler-config/css.d.ts.map +1 -0
- package/dist/bundler-config/css.js +158 -0
- package/dist/bundler-config/experimentCss.cjs +167 -0
- package/dist/bundler-config/experimentCss.d.ts +6 -0
- package/dist/bundler-config/experimentCss.d.ts.map +1 -0
- package/dist/bundler-config/experimentCss.js +157 -0
- package/dist/bundler-config/helper.cjs +81 -0
- package/dist/bundler-config/helper.d.ts +8 -0
- package/dist/bundler-config/helper.d.ts.map +1 -0
- package/dist/bundler-config/helper.js +56 -0
- package/dist/bundler-config/index.cjs +206 -0
- package/dist/bundler-config/index.d.ts +3 -0
- package/dist/bundler-config/index.d.ts.map +1 -0
- package/dist/bundler-config/index.js +190 -0
- package/dist/colors.cjs +60 -0
- package/dist/colors.d.ts +6 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +40 -0
- package/dist/{config/index.cjs → config.cjs} +28 -21
- package/dist/{config/index.d.ts → config.d.ts} +4 -3
- package/dist/config.d.ts.map +1 -0
- package/dist/{config/index.js → config.js} +22 -23
- package/dist/constants.cjs +86 -0
- package/dist/constants.d.ts +25 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +61 -0
- package/dist/createService.cjs +65 -0
- package/dist/createService.d.ts +8 -0
- package/dist/createService.d.ts.map +1 -0
- package/dist/createService.js +41 -0
- package/dist/index.cjs +27 -48
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -51
- package/dist/lightningcss/cache.cjs +36 -0
- package/dist/lightningcss/cache.d.ts +2 -0
- package/dist/lightningcss/cache.d.ts.map +1 -0
- package/dist/lightningcss/cache.js +22 -0
- package/dist/lightningcss/index.cjs +21 -0
- package/dist/lightningcss/index.d.ts +2 -0
- package/dist/lightningcss/index.d.ts.map +1 -0
- package/dist/lightningcss/index.js +10 -0
- package/dist/lightningcss/loader.cjs +56 -0
- package/dist/lightningcss/loader.d.ts +5 -0
- package/dist/lightningcss/loader.d.ts.map +1 -0
- package/dist/lightningcss/loader.js +36 -0
- package/dist/lightningcss/minimizer.cjs +114 -0
- package/dist/lightningcss/minimizer.d.ts +11 -0
- package/dist/lightningcss/minimizer.d.ts.map +1 -0
- package/dist/lightningcss/minimizer.js +90 -0
- package/dist/logger.cjs +103 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +79 -0
- package/dist/openBrowser.cjs +85 -0
- package/dist/openBrowser.d.ts +2 -0
- package/dist/openBrowser.d.ts.map +1 -0
- package/dist/openBrowser.js +61 -0
- package/dist/plugin-progress/rspack.cjs +74 -0
- package/dist/plugin-progress/rspack.d.ts +9 -0
- package/dist/plugin-progress/rspack.d.ts.map +1 -0
- package/dist/plugin-progress/rspack.js +50 -0
- package/dist/plugin-progress/webpack.cjs +84 -0
- package/dist/plugin-progress/webpack.d.ts +9 -0
- package/dist/plugin-progress/webpack.d.ts.map +1 -0
- package/dist/plugin-progress/webpack.js +60 -0
- package/dist/plugin.cjs +33 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +19 -0
- package/dist/progressBar.cjs +70 -0
- package/dist/progressBar.d.ts +14 -0
- package/dist/progressBar.d.ts.map +1 -0
- package/dist/progressBar.js +46 -0
- package/dist/reporter.cjs +133 -0
- package/dist/reporter.d.ts +8 -0
- package/dist/reporter.d.ts.map +1 -0
- package/dist/reporter.js +109 -0
- package/dist/run/build.cjs +77 -0
- package/dist/run/build.d.ts +3 -0
- package/dist/run/build.d.ts.map +1 -0
- package/dist/run/build.js +53 -0
- package/dist/run/dev.cjs +107 -0
- package/dist/run/dev.d.ts +3 -0
- package/dist/run/dev.d.ts.map +1 -0
- package/dist/run/dev.js +83 -0
- package/dist/run/index.cjs +23 -0
- package/dist/run/index.d.ts +3 -0
- package/dist/run/index.d.ts.map +1 -0
- package/dist/run/index.js +11 -0
- package/dist/thread-loader/WorkerError.cjs +41 -0
- package/dist/thread-loader/WorkerError.js +31 -0
- package/dist/thread-loader/WorkerPool.cjs +407 -0
- package/dist/thread-loader/WorkerPool.js +387 -0
- package/dist/thread-loader/index.cjs +100 -0
- package/dist/thread-loader/index.js +85 -0
- package/dist/thread-loader/readBuffer.cjs +55 -0
- package/dist/thread-loader/readBuffer.js +45 -0
- package/dist/thread-loader/serializer.cjs +46 -0
- package/dist/thread-loader/serializer.js +31 -0
- package/dist/thread-loader/utils.cjs +84 -0
- package/dist/thread-loader/utils.js +60 -0
- package/dist/thread-loader/worker.cjs +377 -0
- package/dist/thread-loader/worker.js +382 -0
- package/dist/thread-loader/workerPools.cjs +57 -0
- package/dist/thread-loader/workerPools.js +33 -0
- package/dist/typed-css-modules/index.cjs +21 -0
- package/dist/typed-css-modules/index.d.ts +2 -0
- package/dist/typed-css-modules/index.d.ts.map +1 -0
- package/dist/typed-css-modules/index.js +10 -0
- package/dist/typed-css-modules/loader.cjs +195 -0
- package/dist/typed-css-modules/loader.d.ts +10 -0
- package/dist/typed-css-modules/loader.d.ts.map +1 -0
- package/dist/typed-css-modules/loader.js +170 -0
- package/dist/typed-css-modules/plugin.cjs +96 -0
- package/dist/typed-css-modules/plugin.d.ts +16 -0
- package/dist/typed-css-modules/plugin.d.ts.map +1 -0
- package/dist/typed-css-modules/plugin.js +72 -0
- package/dist/typed-css-modules/utils.cjs +45 -0
- package/dist/typed-css-modules/utils.d.ts +6 -0
- package/dist/typed-css-modules/utils.d.ts.map +1 -0
- package/dist/typed-css-modules/utils.js +31 -0
- package/dist/types/chunkSplit.cjs +15 -0
- package/dist/types/chunkSplit.d.ts +35 -0
- package/dist/types/chunkSplit.d.ts.map +1 -0
- package/dist/types/chunkSplit.js +9 -0
- package/dist/types/config.cjs +15 -0
- package/dist/types/config.d.ts +176 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +9 -0
- package/dist/types/index.cjs +29 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +14 -0
- package/dist/types/lightningcss.cjs +15 -0
- package/dist/types/lightningcss.d.ts +11 -0
- package/dist/types/lightningcss.d.ts.map +1 -0
- package/dist/types/lightningcss.js +9 -0
- package/dist/types/logger.cjs +35 -0
- package/dist/types/logger.d.ts +16 -0
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/logger.js +21 -0
- package/dist/types/plugin.cjs +15 -0
- package/dist/types/plugin.d.ts +18 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +9 -0
- package/dist/utils.cjs +293 -0
- package/dist/utils.d.ts +39 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +242 -0
- package/package.json +95 -6
- package/dist/config/index.d.ts.map +0 -1
package/dist/logger.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
var require = createRequire(import.meta['url']);
|
|
3
|
+
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
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";
|
|
13
|
+
const prefixes = {
|
|
14
|
+
wait: "○",
|
|
15
|
+
error: "⨯",
|
|
16
|
+
warn: "⚠",
|
|
17
|
+
info: "ℹ",
|
|
18
|
+
ready: "✓",
|
|
19
|
+
event: "»"
|
|
20
|
+
};
|
|
21
|
+
const createLogger = () => {
|
|
22
|
+
const log = (type, message, ...args) => {
|
|
23
|
+
const label = colors[LogColor[type]](colors.bold(prefixes[type]));
|
|
24
|
+
let text = "";
|
|
25
|
+
switch (type) {
|
|
26
|
+
case "error":
|
|
27
|
+
if (message instanceof Error) {
|
|
28
|
+
if (message.stack) {
|
|
29
|
+
let [name, ...rest] = message.stack.split("\n");
|
|
30
|
+
if (name.startsWith("Error: ")) {
|
|
31
|
+
name = name.slice(7);
|
|
32
|
+
rest = rest.map((line) => line.slice(2));
|
|
33
|
+
}
|
|
34
|
+
text = `${colors.red(name)}
|
|
35
|
+
${colors.dim(rest.join("\n"))}`;
|
|
36
|
+
} else {
|
|
37
|
+
text = colors.red(message.message);
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
text = colors.red(message);
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
case "warn":
|
|
44
|
+
text = colors.yellow(message);
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
text = message;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
console.log(`${label} ${text}`, ...args);
|
|
51
|
+
};
|
|
52
|
+
const logTypes = ["error", "warn", "info", "ready", "event", "wait"];
|
|
53
|
+
const logger2 = {
|
|
54
|
+
clear: () => {
|
|
55
|
+
const repeatCount = process.stdout.rows - 2;
|
|
56
|
+
const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : "";
|
|
57
|
+
console.log(blank);
|
|
58
|
+
readline.cursorTo(process.stdout, 0, 0);
|
|
59
|
+
readline.clearScreenDown(process.stdout);
|
|
60
|
+
},
|
|
61
|
+
greet: (msg) => {
|
|
62
|
+
const { npm_execpath, npm_lifecycle_event } = process.env;
|
|
63
|
+
if (!npm_execpath || npm_lifecycle_event === "npx" || npm_execpath.includes("npx-cli") || npm_execpath.includes(".bun") || npm_execpath.includes("yarn")) {
|
|
64
|
+
console.log();
|
|
65
|
+
}
|
|
66
|
+
console.log(msg);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
logTypes.forEach((type) => {
|
|
70
|
+
logger2[type] = (message, ...args) => {
|
|
71
|
+
log(type, message, ...args);
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
return logger2;
|
|
75
|
+
};
|
|
76
|
+
const logger = createLogger();
|
|
77
|
+
export {
|
|
78
|
+
logger
|
|
79
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
open(url).catch(() => {
|
|
64
|
+
});
|
|
65
|
+
return true;
|
|
66
|
+
} catch (err) {
|
|
67
|
+
import_logger.logger.error(err);
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function execAsync(command, options) {
|
|
72
|
+
return new Promise((resolve, reject) => {
|
|
73
|
+
(0, import_node_child_process.exec)(command, options, (error, stdout) => {
|
|
74
|
+
if (error) {
|
|
75
|
+
reject(error);
|
|
76
|
+
} else {
|
|
77
|
+
resolve(stdout.toString());
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
openBrowser
|
|
85
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openBrowser.d.ts","sourceRoot":"","sources":["../src/openBrowser.ts"],"names":[],"mappings":"AAKA,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,oBAkC5C"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
var require = createRequire(import.meta['url']);
|
|
3
|
+
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
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 { exec } from "node:child_process";
|
|
11
|
+
import path2 from "node:path";
|
|
12
|
+
import { logger } from "./logger.js";
|
|
13
|
+
const open = require("open");
|
|
14
|
+
async function openBrowser(url) {
|
|
15
|
+
const supportedChromiumBrowsers = [
|
|
16
|
+
"Google Chrome Canary",
|
|
17
|
+
"Google Chrome Dev",
|
|
18
|
+
"Google Chrome Beta",
|
|
19
|
+
"Google Chrome",
|
|
20
|
+
"Microsoft Edge",
|
|
21
|
+
"Brave Browser",
|
|
22
|
+
"Vivaldi",
|
|
23
|
+
"Chromium"
|
|
24
|
+
];
|
|
25
|
+
if (process.platform === "darwin") {
|
|
26
|
+
try {
|
|
27
|
+
const ps = await execAsync("ps cax");
|
|
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
|
+
});
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
} catch (err) {
|
|
36
|
+
logger.error(err);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
open(url).catch(() => {
|
|
41
|
+
});
|
|
42
|
+
return true;
|
|
43
|
+
} catch (err) {
|
|
44
|
+
logger.error(err);
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function execAsync(command, options) {
|
|
49
|
+
return new Promise((resolve, reject) => {
|
|
50
|
+
exec(command, options, (error, stdout) => {
|
|
51
|
+
if (error) {
|
|
52
|
+
reject(error);
|
|
53
|
+
} else {
|
|
54
|
+
resolve(stdout.toString());
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
openBrowser
|
|
61
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 rspack_exports = {};
|
|
29
|
+
__export(rspack_exports, {
|
|
30
|
+
RspackPluginProgress: () => RspackPluginProgress
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(rspack_exports);
|
|
33
|
+
var import_core = require("@rspack/core");
|
|
34
|
+
var import_colors = __toESM(require("../colors.cjs"));
|
|
35
|
+
var import_logger = require("../logger.cjs");
|
|
36
|
+
var import_progressBar = require("../progressBar.cjs");
|
|
37
|
+
var import_reporter = require("../reporter.cjs");
|
|
38
|
+
var import_utils = require("../utils.cjs");
|
|
39
|
+
const PLUGIN_NAME = "PluginProgress";
|
|
40
|
+
class RspackPluginProgress extends import_core.rspack.ProgressPlugin {
|
|
41
|
+
constructor() {
|
|
42
|
+
super((percentage, msg, ...args) => {
|
|
43
|
+
(0, import_utils.isProd)() && this.progressBar.update({ current: percentage, message: `${msg} ${args.join(" ")}` });
|
|
44
|
+
});
|
|
45
|
+
this.startTime = void 0;
|
|
46
|
+
this.progressBar = new import_progressBar.ProgressBar();
|
|
47
|
+
}
|
|
48
|
+
apply(compiler) {
|
|
49
|
+
super.apply(compiler);
|
|
50
|
+
compiler.hooks.compile.tap(PLUGIN_NAME, () => {
|
|
51
|
+
this.startTime = process.hrtime();
|
|
52
|
+
!(0, import_utils.isProd)() && import_logger.logger.wait("building...");
|
|
53
|
+
});
|
|
54
|
+
compiler.hooks.done.tap(PLUGIN_NAME, async (stats) => {
|
|
55
|
+
if (this.startTime) {
|
|
56
|
+
const hrtime = process.hrtime(this.startTime);
|
|
57
|
+
const compileTime = hrtime[0] + hrtime[1] / 1e9;
|
|
58
|
+
this.startTime = void 0;
|
|
59
|
+
if (!stats.hasErrors()) {
|
|
60
|
+
if ((0, import_utils.isProd)()) {
|
|
61
|
+
await (0, import_reporter.printFileSize)({ stats });
|
|
62
|
+
console.log(import_colors.default.green(`✓ built in ${import_colors.default.bold((0, import_utils.prettyTime)(compileTime))}`));
|
|
63
|
+
} else {
|
|
64
|
+
import_logger.logger.ready(`built in ${import_colors.default.bold((0, import_utils.prettyTime)(compileTime))}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
RspackPluginProgress
|
|
74
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Compiler, rspack } from '@rspack/core';
|
|
2
|
+
import { ProgressBar } from '../progressBar';
|
|
3
|
+
export declare class RspackPluginProgress extends rspack.ProgressPlugin {
|
|
4
|
+
startTime?: [number, number];
|
|
5
|
+
progressBar: ProgressBar;
|
|
6
|
+
constructor();
|
|
7
|
+
apply(compiler: Compiler): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=rspack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../../src/plugin-progress/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAK7C,qBAAa,oBAAqB,SAAQ,MAAM,CAAC,cAAc;IAC7D,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAY;IACxC,WAAW,cAAoB;;IAO/B,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAsBhC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
var require = createRequire(import.meta['url']);
|
|
3
|
+
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
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 { rspack } from "@rspack/core";
|
|
11
|
+
import colors from "../colors.js";
|
|
12
|
+
import { logger } from "../logger.js";
|
|
13
|
+
import { ProgressBar } from "../progressBar.js";
|
|
14
|
+
import { printFileSize } from "../reporter.js";
|
|
15
|
+
import { isProd, prettyTime } from "../utils.js";
|
|
16
|
+
const PLUGIN_NAME = "PluginProgress";
|
|
17
|
+
class RspackPluginProgress extends rspack.ProgressPlugin {
|
|
18
|
+
constructor() {
|
|
19
|
+
super((percentage, msg, ...args) => {
|
|
20
|
+
isProd() && this.progressBar.update({ current: percentage, message: `${msg} ${args.join(" ")}` });
|
|
21
|
+
});
|
|
22
|
+
this.startTime = void 0;
|
|
23
|
+
this.progressBar = new ProgressBar();
|
|
24
|
+
}
|
|
25
|
+
apply(compiler) {
|
|
26
|
+
super.apply(compiler);
|
|
27
|
+
compiler.hooks.compile.tap(PLUGIN_NAME, () => {
|
|
28
|
+
this.startTime = process.hrtime();
|
|
29
|
+
!isProd() && logger.wait("building...");
|
|
30
|
+
});
|
|
31
|
+
compiler.hooks.done.tap(PLUGIN_NAME, async (stats) => {
|
|
32
|
+
if (this.startTime) {
|
|
33
|
+
const hrtime = process.hrtime(this.startTime);
|
|
34
|
+
const compileTime = hrtime[0] + hrtime[1] / 1e9;
|
|
35
|
+
this.startTime = void 0;
|
|
36
|
+
if (!stats.hasErrors()) {
|
|
37
|
+
if (isProd()) {
|
|
38
|
+
await printFileSize({ stats });
|
|
39
|
+
console.log(colors.green(`✓ built in ${colors.bold(prettyTime(compileTime))}`));
|
|
40
|
+
} else {
|
|
41
|
+
logger.ready(`built in ${colors.bold(prettyTime(compileTime))}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
RspackPluginProgress
|
|
50
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 webpack_exports = {};
|
|
29
|
+
__export(webpack_exports, {
|
|
30
|
+
WebpackPluginProgress: () => WebpackPluginProgress
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(webpack_exports);
|
|
33
|
+
var import_colors = __toESM(require("../colors.cjs"));
|
|
34
|
+
var import_logger = require("../logger.cjs");
|
|
35
|
+
var import_progressBar = require("../progressBar.cjs");
|
|
36
|
+
var import_reporter = require("../reporter.cjs");
|
|
37
|
+
var import_utils = require("../utils.cjs");
|
|
38
|
+
var import_webpack = __toESM(require("webpack"));
|
|
39
|
+
const PLUGIN_NAME = "PluginProgress";
|
|
40
|
+
class WebpackPluginProgress extends import_webpack.default.ProgressPlugin {
|
|
41
|
+
constructor() {
|
|
42
|
+
super({
|
|
43
|
+
entries: false,
|
|
44
|
+
dependencies: false,
|
|
45
|
+
activeModules: true,
|
|
46
|
+
handler: (0, import_utils.isProd)() ? (percentage, msg, ...args) => {
|
|
47
|
+
if (!this.startTime)
|
|
48
|
+
return;
|
|
49
|
+
this.progressBar.update({
|
|
50
|
+
current: percentage,
|
|
51
|
+
message: `${msg} ${args.join(" ").replace(/(\d+) active /, "")}`
|
|
52
|
+
});
|
|
53
|
+
} : void 0
|
|
54
|
+
});
|
|
55
|
+
this.startTime = void 0;
|
|
56
|
+
this.progressBar = new import_progressBar.ProgressBar();
|
|
57
|
+
}
|
|
58
|
+
apply(compiler) {
|
|
59
|
+
super.apply(compiler);
|
|
60
|
+
compiler.hooks.compile.tap(PLUGIN_NAME, () => {
|
|
61
|
+
this.startTime = process.hrtime();
|
|
62
|
+
!(0, import_utils.isProd)() && import_logger.logger.wait("building...");
|
|
63
|
+
});
|
|
64
|
+
compiler.hooks.done.tap(PLUGIN_NAME, async (stats) => {
|
|
65
|
+
if (this.startTime) {
|
|
66
|
+
const hrtime = process.hrtime(this.startTime);
|
|
67
|
+
const compileTime = hrtime[0] + hrtime[1] / 1e9;
|
|
68
|
+
this.startTime = void 0;
|
|
69
|
+
if (!stats.hasErrors()) {
|
|
70
|
+
if ((0, import_utils.isProd)()) {
|
|
71
|
+
await (0, import_reporter.printFileSize)({ stats });
|
|
72
|
+
console.log(import_colors.default.green(`✓ built in ${import_colors.default.bold((0, import_utils.prettyTime)(compileTime))}`));
|
|
73
|
+
} else {
|
|
74
|
+
import_logger.logger.ready(`built in ${import_colors.default.bold((0, import_utils.prettyTime)(compileTime))}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {
|
|
83
|
+
WebpackPluginProgress
|
|
84
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProgressBar } from '../progressBar';
|
|
2
|
+
import webpack from 'webpack';
|
|
3
|
+
export declare class WebpackPluginProgress extends webpack.ProgressPlugin {
|
|
4
|
+
startTime?: [number, number];
|
|
5
|
+
progressBar: ProgressBar;
|
|
6
|
+
constructor();
|
|
7
|
+
apply(compiler: webpack.Compiler): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=webpack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../src/plugin-progress/webpack.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG7C,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,cAAc;IAC/D,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAY;IACxC,WAAW,cAAoB;;IAiB/B,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI;CAsBxC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
var require = createRequire(import.meta['url']);
|
|
3
|
+
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
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 colors from "../colors.js";
|
|
11
|
+
import { logger } from "../logger.js";
|
|
12
|
+
import { ProgressBar } from "../progressBar.js";
|
|
13
|
+
import { printFileSize } from "../reporter.js";
|
|
14
|
+
import { isProd, prettyTime } from "../utils.js";
|
|
15
|
+
import webpack from "webpack";
|
|
16
|
+
const PLUGIN_NAME = "PluginProgress";
|
|
17
|
+
class WebpackPluginProgress extends webpack.ProgressPlugin {
|
|
18
|
+
constructor() {
|
|
19
|
+
super({
|
|
20
|
+
entries: false,
|
|
21
|
+
dependencies: false,
|
|
22
|
+
activeModules: true,
|
|
23
|
+
handler: isProd() ? (percentage, msg, ...args) => {
|
|
24
|
+
if (!this.startTime)
|
|
25
|
+
return;
|
|
26
|
+
this.progressBar.update({
|
|
27
|
+
current: percentage,
|
|
28
|
+
message: `${msg} ${args.join(" ").replace(/(\d+) active /, "")}`
|
|
29
|
+
});
|
|
30
|
+
} : void 0
|
|
31
|
+
});
|
|
32
|
+
this.startTime = void 0;
|
|
33
|
+
this.progressBar = new ProgressBar();
|
|
34
|
+
}
|
|
35
|
+
apply(compiler) {
|
|
36
|
+
super.apply(compiler);
|
|
37
|
+
compiler.hooks.compile.tap(PLUGIN_NAME, () => {
|
|
38
|
+
this.startTime = process.hrtime();
|
|
39
|
+
!isProd() && logger.wait("building...");
|
|
40
|
+
});
|
|
41
|
+
compiler.hooks.done.tap(PLUGIN_NAME, async (stats) => {
|
|
42
|
+
if (this.startTime) {
|
|
43
|
+
const hrtime = process.hrtime(this.startTime);
|
|
44
|
+
const compileTime = hrtime[0] + hrtime[1] / 1e9;
|
|
45
|
+
this.startTime = void 0;
|
|
46
|
+
if (!stats.hasErrors()) {
|
|
47
|
+
if (isProd()) {
|
|
48
|
+
await printFileSize({ stats });
|
|
49
|
+
console.log(colors.green(`✓ built in ${colors.bold(prettyTime(compileTime))}`));
|
|
50
|
+
} else {
|
|
51
|
+
logger.ready(`built in ${colors.bold(prettyTime(compileTime))}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
WebpackPluginProgress
|
|
60
|
+
};
|
package/dist/plugin.cjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var plugin_exports = {};
|
|
19
|
+
__export(plugin_exports, {
|
|
20
|
+
getNormalizedPluginsByHook: () => getNormalizedPluginsByHook
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(plugin_exports);
|
|
23
|
+
function getNormalizedPluginsByHook(hook, plugins) {
|
|
24
|
+
const pluginMap = /* @__PURE__ */ new Map();
|
|
25
|
+
plugins?.forEach((plugin) => {
|
|
26
|
+
plugin[hook] && pluginMap.set(plugin.name, plugin);
|
|
27
|
+
});
|
|
28
|
+
return Array.from(pluginMap.values());
|
|
29
|
+
}
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
getNormalizedPluginsByHook
|
|
33
|
+
});
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAEnE,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,EAAE,kBAOzF"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
var require = createRequire(import.meta['url']);
|
|
3
|
+
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
var getFilename = () => fileURLToPath(import.meta.url);
|
|
7
|
+
var getDirname = () => path.dirname(getFilename());
|
|
8
|
+
var __dirname = /* @__PURE__ */ getDirname();
|
|
9
|
+
var __filename = /* @__PURE__ */ getFilename();
|
|
10
|
+
function getNormalizedPluginsByHook(hook, plugins) {
|
|
11
|
+
const pluginMap = /* @__PURE__ */ new Map();
|
|
12
|
+
plugins?.forEach((plugin) => {
|
|
13
|
+
plugin[hook] && pluginMap.set(plugin.name, plugin);
|
|
14
|
+
});
|
|
15
|
+
return Array.from(pluginMap.values());
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
getNormalizedPluginsByHook
|
|
19
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 progressBar_exports = {};
|
|
29
|
+
__export(progressBar_exports, {
|
|
30
|
+
ProgressBar: () => ProgressBar
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(progressBar_exports);
|
|
33
|
+
var import_colors = __toESM(require("./colors.cjs"));
|
|
34
|
+
const logUpdate = require("../compiled/log-update/index.js");
|
|
35
|
+
class ProgressBar {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.options = {
|
|
38
|
+
width: 25,
|
|
39
|
+
prefix: "",
|
|
40
|
+
char: "▨",
|
|
41
|
+
color: "green"
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
update({ current: originalCurrent, message = "" }) {
|
|
45
|
+
const { columns: terminalWidth } = process.stdout;
|
|
46
|
+
const messageWidth = terminalWidth - this.options.width - this.options.prefix.length - 7;
|
|
47
|
+
let current = originalCurrent;
|
|
48
|
+
if (originalCurrent >= 0.98) {
|
|
49
|
+
current = 1;
|
|
50
|
+
}
|
|
51
|
+
const doneWidth = Math.floor(current * this.options.width);
|
|
52
|
+
const undoneWidth = this.options.width - doneWidth;
|
|
53
|
+
const done = import_colors.default[this.options.color](this.options.char).repeat(doneWidth);
|
|
54
|
+
const undone = import_colors.default.dim(this.options.char).repeat(undoneWidth);
|
|
55
|
+
const bar = `${done}${undone}`;
|
|
56
|
+
const prefix = this.options.prefix ? `${import_colors.default.bold(this.options.prefix)} ` : "";
|
|
57
|
+
logUpdate(
|
|
58
|
+
`${prefix}${bar} (${Math.floor(
|
|
59
|
+
current * 100
|
|
60
|
+
)}%) ${import_colors.default.dim(message.slice(0, messageWidth))}`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
done() {
|
|
64
|
+
logUpdate.done();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
ProgressBar
|
|
70
|
+
});
|