@storm-software/unbuild 0.19.4 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/unbuild.js +13554 -141
- package/bin/unbuild.mjs +13561 -148
- package/dist/build.js +9 -10
- package/dist/build.mjs +8 -9
- package/dist/{chunk-XI6ZXBUG.js → chunk-2345XTVS.js} +105 -108
- package/dist/{chunk-ZUXO7HQP.js → chunk-3OJD7CO4.js} +8 -5
- package/dist/chunk-AICX43E6.mjs +13496 -0
- package/dist/chunk-AYRYNROK.js +27 -0
- package/dist/{chunk-5SOSUWM3.mjs → chunk-B5GGHMTB.mjs} +9 -8
- package/dist/chunk-BIZYEBW3.mjs +38 -0
- package/dist/chunk-DFIGNXGY.js +13496 -0
- package/dist/{chunk-34DH32EF.mjs → chunk-FDF3FMZP.mjs} +1 -1
- package/dist/{chunk-AH7CDDC4.mjs → chunk-IIVTCNH5.mjs} +6 -3
- package/dist/{chunk-FP34RJ2B.mjs → chunk-OG2CKJQU.mjs} +1 -1
- package/dist/{chunk-2CDKPC2J.js → chunk-OQPSH7GE.js} +9 -8
- package/dist/chunk-RCEWRXM5.js +38 -0
- package/dist/{chunk-LMAVRNZF.mjs → chunk-T5NKX2EJ.mjs} +5 -9
- package/dist/{chunk-I24R5RY2.mjs → chunk-WGFWMGCJ.mjs} +26 -29
- package/dist/{chunk-QUQ5VOD7.js → chunk-WPOEGALQ.js} +3 -3
- package/dist/{chunk-JOAJEBTW.js → chunk-XEAFTDQ7.js} +2 -2
- package/dist/clean.js +3 -3
- package/dist/clean.mjs +2 -2
- package/dist/config.js +7 -8
- package/dist/config.mjs +6 -7
- package/dist/index.js +9 -10
- package/dist/index.mjs +8 -9
- package/package.json +1 -1
- package/dist/chunk-4REDJQMU.js +0 -35
- package/dist/chunk-ITLNJJHL.mjs +0 -65
- package/dist/chunk-KTRDC23G.mjs +0 -28
- package/dist/chunk-L73LP5QX.js +0 -31
- package/dist/chunk-TYJGNL6P.mjs +0 -35
- package/dist/chunk-V2LF4EEM.js +0 -28
- package/dist/chunk-YNOD6WE4.js +0 -65
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkDFIGNXGYjs = require('./chunk-DFIGNXGY.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkRCEWRXM5js = require('./chunk-RCEWRXM5.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkXEAFTDQ7js = require('./chunk-XEAFTDQ7.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkWPOEGALQjs = require('./chunk-WPOEGALQ.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
16
|
+
|
|
17
|
+
// src/config.ts
|
|
18
|
+
var getDefaultBuildPlugins = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, resolvedOptions) => Promise.all([
|
|
19
|
+
_chunkXEAFTDQ7js.analyzePlugin.call(void 0, options, resolvedOptions),
|
|
20
|
+
_chunkRCEWRXM5js.typeDefinitions.call(void 0, resolvedOptions.projectRoot),
|
|
21
|
+
_chunkDFIGNXGYjs.tscPlugin.call(void 0, options, resolvedOptions),
|
|
22
|
+
_chunkWPOEGALQjs.onErrorPlugin.call(void 0, options, resolvedOptions)
|
|
23
|
+
].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
exports.getDefaultBuildPlugins = getDefaultBuildPlugins;
|
|
@@ -468,7 +468,8 @@ var CONSOLE_ICONS = {
|
|
|
468
468
|
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
469
469
|
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
470
470
|
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
471
|
-
[LogLevelLabel.TRACE]: useIcon("\
|
|
471
|
+
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
472
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
472
473
|
};
|
|
473
474
|
|
|
474
475
|
// ../config-tools/src/logger/format-timestamp.ts
|
|
@@ -488,48 +489,48 @@ var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}) =>
|
|
|
488
489
|
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
489
490
|
return (message) => {
|
|
490
491
|
console.error(`
|
|
491
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
492
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
492
493
|
`);
|
|
493
494
|
};
|
|
494
495
|
}
|
|
495
496
|
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
496
497
|
return (message) => {
|
|
497
498
|
console.error(`
|
|
498
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
499
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
499
500
|
`);
|
|
500
501
|
};
|
|
501
502
|
}
|
|
502
503
|
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
503
504
|
return (message) => {
|
|
504
505
|
console.warn(`
|
|
505
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
506
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
506
507
|
`);
|
|
507
508
|
};
|
|
508
509
|
}
|
|
509
510
|
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
|
|
510
511
|
return (message) => {
|
|
511
512
|
console.info(`
|
|
512
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
513
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
513
514
|
`);
|
|
514
515
|
};
|
|
515
516
|
}
|
|
516
517
|
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
517
518
|
return (message) => {
|
|
518
519
|
console.info(`
|
|
519
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
520
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
520
521
|
`);
|
|
521
522
|
};
|
|
522
523
|
}
|
|
523
524
|
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
|
|
524
525
|
return (message) => {
|
|
525
526
|
console.debug(`
|
|
526
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
527
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
527
528
|
`);
|
|
528
529
|
};
|
|
529
530
|
}
|
|
530
531
|
return (message) => {
|
|
531
532
|
console.log(`
|
|
532
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
533
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
533
534
|
`);
|
|
534
535
|
};
|
|
535
536
|
}, "getLogFn");
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-LPEX4YW6.mjs";
|
|
4
|
+
|
|
5
|
+
// src/plugins/type-definitions.ts
|
|
6
|
+
import { relative } from "node:path";
|
|
7
|
+
function typeDefinitions(projectRoot) {
|
|
8
|
+
return {
|
|
9
|
+
name: "storm:dts-bundle",
|
|
10
|
+
async generateBundle(_opts, bundle) {
|
|
11
|
+
for (const file of Object.values(bundle)) {
|
|
12
|
+
if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const hasDefaultExport = file.exports.includes("default");
|
|
16
|
+
const entrySourceFileName = relative(projectRoot, file.facadeModuleId);
|
|
17
|
+
const entrySourceDtsName = entrySourceFileName.replace(/\.[cm]?[jt]sx?$/, "");
|
|
18
|
+
const dtsFileName = file.fileName.replace(/\.[cm]?js$/, ".d.ts");
|
|
19
|
+
const relativeSourceDtsName = JSON.stringify("./" + entrySourceDtsName);
|
|
20
|
+
const dtsFileSource = hasDefaultExport ? `
|
|
21
|
+
export * from ${relativeSourceDtsName};
|
|
22
|
+
export { default } from ${relativeSourceDtsName};
|
|
23
|
+
` : `export * from ${relativeSourceDtsName};
|
|
24
|
+
`;
|
|
25
|
+
this.emitFile({
|
|
26
|
+
type: "asset",
|
|
27
|
+
fileName: dtsFileName,
|
|
28
|
+
source: dtsFileSource
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
__name(typeDefinitions, "typeDefinitions");
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
typeDefinitions
|
|
38
|
+
};
|