@storm-software/unbuild 0.41.21 → 0.41.22
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.cjs +798 -412
- package/bin/unbuild.js +826 -420
- package/dist/build.cjs +8 -8
- package/dist/build.js +7 -7
- package/dist/{chunk-3GQAWCBQ.js → chunk-3RG5ZIWI.js} +0 -3
- package/dist/{chunk-HZNOKNKE.js → chunk-4KHUAP4R.js} +13 -10
- package/dist/{chunk-BFBEOACU.cjs → chunk-ALGMIE4E.cjs} +471 -257
- package/dist/{chunk-5FQ2QYFQ.js → chunk-ATN45QRM.js} +418 -204
- package/dist/{chunk-F4MPFQDI.cjs → chunk-FAW45G3E.cjs} +13 -10
- package/dist/{chunk-3BXXHK3F.cjs → chunk-MO3MUSJO.cjs} +7 -15
- package/dist/chunk-OBGZSXTJ.cjs +10 -0
- package/dist/{chunk-DUDE4LYM.js → chunk-PCGRQKDH.js} +2 -10
- package/dist/{chunk-PWE7CANF.cjs → chunk-Q2G4VMOW.cjs} +198 -130
- package/dist/{chunk-ITHOVA3D.cjs → chunk-Q3NBYYR4.cjs} +4 -12
- package/dist/{chunk-ZB2JWLJS.cjs → chunk-Q4VUCJPK.cjs} +51 -16
- package/dist/chunk-WQLDD6CA.js +106 -0
- package/dist/{chunk-3BDIPKMO.js → chunk-XQLLOGJZ.js} +197 -129
- package/dist/{chunk-SMAV5VSP.js → chunk-XWLZOFQ4.js} +6 -14
- package/dist/clean.cjs +4 -4
- package/dist/clean.js +3 -3
- package/dist/index.cjs +9 -9
- package/dist/index.js +8 -8
- package/dist/plugins/analyze.cjs +4 -4
- package/dist/plugins/analyze.js +3 -3
- package/dist/plugins/on-error.cjs +4 -4
- package/dist/plugins/on-error.js +3 -3
- package/dist/plugins/swc.cjs +5 -8
- package/dist/plugins/swc.js +4 -7
- package/dist/plugins/tsc.cjs +4 -4
- package/dist/plugins/tsc.js +3 -3
- package/dist/plugins/type-definitions.cjs +9 -6
- package/dist/plugins/type-definitions.js +9 -6
- package/dist/types.cjs +1 -1
- package/dist/types.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-BGYQAVKQ.cjs +0 -13
- package/dist/chunk-XXRSY6EE.js +0 -71
- /package/dist/{chunk-OULCUN6I.js → chunk-GGNOJ77I.js} +0 -0
- /package/dist/{chunk-ORA4UQMU.cjs → chunk-SFZRYJZ2.cjs} +0 -0
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
3
|
+
var _chunkQ2G4VMOWcjs = require('./chunk-Q2G4VMOW.cjs');
|
|
7
4
|
|
|
8
5
|
// src/plugins/on-error.ts
|
|
9
|
-
var onErrorPlugin =
|
|
6
|
+
var onErrorPlugin = (options) => ({
|
|
10
7
|
name: "storm:on-error",
|
|
11
8
|
buildEnd(error) {
|
|
12
9
|
if (error) {
|
|
13
|
-
|
|
10
|
+
_chunkQ2G4VMOWcjs.writeError.call(void 0,
|
|
11
|
+
`The following errors occurred during the build:
|
|
14
12
|
${error ? error.message : "Unknown build error"}
|
|
15
13
|
|
|
16
|
-
`,
|
|
14
|
+
`,
|
|
15
|
+
options.config
|
|
16
|
+
);
|
|
17
17
|
throw new Error("Storm unbuild process failed with errors.");
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
renderError(error) {
|
|
21
|
-
|
|
21
|
+
_chunkQ2G4VMOWcjs.writeError.call(void 0,
|
|
22
|
+
`The following errors occurred during the build:
|
|
22
23
|
${error ? error.message : "Unknown build error"}
|
|
23
24
|
|
|
24
|
-
`,
|
|
25
|
+
`,
|
|
26
|
+
options.config
|
|
27
|
+
);
|
|
25
28
|
throw new Error("Storm unbuild process failed with errors.");
|
|
26
29
|
}
|
|
27
|
-
})
|
|
30
|
+
});
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
|
|
@@ -1,34 +1,26 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
3
|
+
var _chunkQ2G4VMOWcjs = require('./chunk-Q2G4VMOW.cjs');
|
|
7
4
|
|
|
8
5
|
// src/plugins/analyze.ts
|
|
9
|
-
var formatBytes =
|
|
6
|
+
var formatBytes = (bytes) => {
|
|
10
7
|
if (bytes === 0) return "0 Byte";
|
|
11
8
|
const k = 1e3;
|
|
12
9
|
const dm = 3;
|
|
13
|
-
const sizes = [
|
|
14
|
-
"Bytes",
|
|
15
|
-
"KB",
|
|
16
|
-
"MB",
|
|
17
|
-
"GB"
|
|
18
|
-
];
|
|
10
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
19
11
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
20
12
|
return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
|
|
21
|
-
}
|
|
22
|
-
var analyzePlugin =
|
|
13
|
+
};
|
|
14
|
+
var analyzePlugin = (options) => {
|
|
23
15
|
return {
|
|
24
16
|
name: "storm:analyzer",
|
|
25
17
|
renderChunk(source, chunk) {
|
|
26
18
|
const sourceBytes = formatBytes(source.length);
|
|
27
19
|
const fileName = chunk.fileName;
|
|
28
|
-
|
|
20
|
+
_chunkQ2G4VMOWcjs.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`, options.config);
|
|
29
21
|
}
|
|
30
22
|
};
|
|
31
|
-
}
|
|
23
|
+
};
|
|
32
24
|
|
|
33
25
|
|
|
34
26
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.__require = __require;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getStopwatch,
|
|
3
3
|
writeDebug
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
__name
|
|
7
|
-
} from "./chunk-3GQAWCBQ.js";
|
|
4
|
+
} from "./chunk-XQLLOGJZ.js";
|
|
8
5
|
|
|
9
6
|
// src/clean.ts
|
|
10
7
|
import { rm } from "node:fs/promises";
|
|
@@ -14,14 +11,9 @@ async function clean(name = "Unbuild", directory, config) {
|
|
|
14
11
|
await cleanDirectories(name, directory, config);
|
|
15
12
|
stopwatch();
|
|
16
13
|
}
|
|
17
|
-
__name(clean, "clean");
|
|
18
14
|
async function cleanDirectories(name = "Unbuild", directory, config) {
|
|
19
|
-
await rm(directory, {
|
|
20
|
-
recursive: true,
|
|
21
|
-
force: true
|
|
22
|
-
});
|
|
15
|
+
await rm(directory, { recursive: true, force: true });
|
|
23
16
|
}
|
|
24
|
-
__name(cleanDirectories, "cleanDirectories");
|
|
25
17
|
|
|
26
18
|
export {
|
|
27
19
|
clean,
|