@storm-software/unbuild 0.34.0 → 0.34.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.cjs +133 -30
- package/bin/unbuild.js +125 -22
- package/dist/build.cjs +8 -8
- package/dist/build.js +7 -7
- package/dist/{chunk-ERYQ4O3N.js → chunk-2E6P5U5P.js} +1 -1
- package/dist/{chunk-I7SGCUR4.cjs → chunk-3HGUCQU6.cjs} +3 -3
- package/dist/{chunk-LFUHP3V6.cjs → chunk-5FQVMM7I.cjs} +121 -18
- package/dist/{chunk-Y3FGYCTG.cjs → chunk-AGJ2KZ3K.cjs} +2 -2
- package/dist/{chunk-HBOCJ3VS.cjs → chunk-DL7OBOWN.cjs} +6 -6
- package/dist/{chunk-6N2XN6DP.js → chunk-HHWS7REN.js} +1 -1
- package/dist/{chunk-ZGZI67KX.js → chunk-J7JXWCQS.js} +4 -4
- package/dist/{chunk-FYU6QKHN.cjs → chunk-LJ5GM5M6.cjs} +92 -92
- package/dist/{chunk-ZYPPSI2Q.cjs → chunk-NGL4NRBA.cjs} +2 -2
- package/dist/{chunk-J4VTEQNQ.js → chunk-PLJQK2VX.js} +125 -22
- package/dist/{chunk-ELBNF3ZV.cjs → chunk-SEWO2Q7T.cjs} +3 -3
- package/dist/{chunk-JN2D2LK7.js → chunk-UELS4AUC.js} +1 -1
- package/dist/{chunk-SRY6IWKG.js → chunk-UYR662XD.js} +3 -3
- package/dist/{chunk-I3ATI525.js → chunk-WI52QJ54.js} +1 -1
- package/dist/clean.cjs +3 -3
- package/dist/clean.js +2 -2
- package/dist/config.cjs +6 -6
- package/dist/config.js +5 -5
- package/dist/index.cjs +8 -8
- package/dist/index.js +7 -7
- package/dist/plugins/analyze.cjs +3 -3
- package/dist/plugins/analyze.js +2 -2
- package/dist/plugins/on-error.cjs +3 -3
- package/dist/plugins/on-error.js +2 -2
- package/dist/plugins/tsc.cjs +3 -3
- package/dist/plugins/tsc.js +2 -2
- package/package.json +1 -1
|
@@ -27,28 +27,131 @@ var LogLevelLabel = {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
// ../config-tools/src/utilities/correct-paths.ts
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
31
|
+
function normalizeWindowsPath(input = "") {
|
|
32
|
+
if (!input) {
|
|
33
|
+
return input;
|
|
34
|
+
}
|
|
35
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
36
|
+
}
|
|
37
|
+
_chunkBGYQAVKQcjs.__name.call(void 0, normalizeWindowsPath, "normalizeWindowsPath");
|
|
38
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
39
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
40
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
41
|
+
var correctPaths = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, function(path) {
|
|
42
|
+
if (!path || path.length === 0) {
|
|
43
|
+
return ".";
|
|
44
|
+
}
|
|
45
|
+
path = normalizeWindowsPath(path);
|
|
46
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
47
|
+
const isPathAbsolute = isAbsolute(path);
|
|
48
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
49
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
50
|
+
if (path.length === 0) {
|
|
51
|
+
if (isPathAbsolute) {
|
|
52
|
+
return "/";
|
|
41
53
|
}
|
|
42
|
-
return
|
|
54
|
+
return trailingSeparator ? "./" : ".";
|
|
55
|
+
}
|
|
56
|
+
if (trailingSeparator) {
|
|
57
|
+
path += "/";
|
|
58
|
+
}
|
|
59
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
60
|
+
path += "/";
|
|
43
61
|
}
|
|
44
|
-
|
|
62
|
+
if (isUNCPath) {
|
|
63
|
+
if (!isPathAbsolute) {
|
|
64
|
+
return `//./${path}`;
|
|
65
|
+
}
|
|
66
|
+
return `//${path}`;
|
|
67
|
+
}
|
|
68
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
45
69
|
}, "correctPaths");
|
|
46
|
-
var joinPaths = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (...
|
|
47
|
-
|
|
48
|
-
|
|
70
|
+
var joinPaths = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, function(...segments) {
|
|
71
|
+
let path = "";
|
|
72
|
+
for (const seg of segments) {
|
|
73
|
+
if (!seg) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (path.length > 0) {
|
|
77
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
78
|
+
const segLeading = seg[0] === "/";
|
|
79
|
+
const both = pathTrailing && segLeading;
|
|
80
|
+
if (both) {
|
|
81
|
+
path += seg.slice(1);
|
|
82
|
+
} else {
|
|
83
|
+
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
path += seg;
|
|
87
|
+
}
|
|
49
88
|
}
|
|
50
|
-
return correctPaths(
|
|
89
|
+
return correctPaths(path);
|
|
51
90
|
}, "joinPaths");
|
|
91
|
+
function normalizeString(path, allowAboveRoot) {
|
|
92
|
+
let res = "";
|
|
93
|
+
let lastSegmentLength = 0;
|
|
94
|
+
let lastSlash = -1;
|
|
95
|
+
let dots = 0;
|
|
96
|
+
let char = null;
|
|
97
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
98
|
+
if (index < path.length) {
|
|
99
|
+
char = path[index];
|
|
100
|
+
} else if (char === "/") {
|
|
101
|
+
break;
|
|
102
|
+
} else {
|
|
103
|
+
char = "/";
|
|
104
|
+
}
|
|
105
|
+
if (char === "/") {
|
|
106
|
+
if (lastSlash === index - 1 || dots === 1) {
|
|
107
|
+
} else if (dots === 2) {
|
|
108
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
109
|
+
if (res.length > 2) {
|
|
110
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
111
|
+
if (lastSlashIndex === -1) {
|
|
112
|
+
res = "";
|
|
113
|
+
lastSegmentLength = 0;
|
|
114
|
+
} else {
|
|
115
|
+
res = res.slice(0, lastSlashIndex);
|
|
116
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
117
|
+
}
|
|
118
|
+
lastSlash = index;
|
|
119
|
+
dots = 0;
|
|
120
|
+
continue;
|
|
121
|
+
} else if (res.length > 0) {
|
|
122
|
+
res = "";
|
|
123
|
+
lastSegmentLength = 0;
|
|
124
|
+
lastSlash = index;
|
|
125
|
+
dots = 0;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (allowAboveRoot) {
|
|
130
|
+
res += res.length > 0 ? "/.." : "..";
|
|
131
|
+
lastSegmentLength = 2;
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
if (res.length > 0) {
|
|
135
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
136
|
+
} else {
|
|
137
|
+
res = path.slice(lastSlash + 1, index);
|
|
138
|
+
}
|
|
139
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
140
|
+
}
|
|
141
|
+
lastSlash = index;
|
|
142
|
+
dots = 0;
|
|
143
|
+
} else if (char === "." && dots !== -1) {
|
|
144
|
+
++dots;
|
|
145
|
+
} else {
|
|
146
|
+
dots = -1;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return res;
|
|
150
|
+
}
|
|
151
|
+
_chunkBGYQAVKQcjs.__name.call(void 0, normalizeString, "normalizeString");
|
|
152
|
+
var isAbsolute = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, function(p) {
|
|
153
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
154
|
+
}, "isAbsolute");
|
|
52
155
|
|
|
53
156
|
// ../config-tools/src/logger/get-log-level.ts
|
|
54
157
|
var getLogLevel = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (label) => {
|
|
@@ -279,7 +382,7 @@ var COLOR_KEYS = [
|
|
|
279
382
|
// ../config-tools/src/utilities/get-default-config.ts
|
|
280
383
|
var _fs = require('fs');
|
|
281
384
|
var _promises = require('fs/promises');
|
|
282
|
-
|
|
385
|
+
var _path = require('path');
|
|
283
386
|
|
|
284
387
|
// ../config-tools/src/utilities/find-up.ts
|
|
285
388
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk5FQVMM7Icjs = require('./chunk-5FQVMM7I.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
@@ -25,7 +25,7 @@ var analyzePlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (optio
|
|
|
25
25
|
renderChunk(source, chunk) {
|
|
26
26
|
const sourceBytes = formatBytes(source.length);
|
|
27
27
|
const fileName = chunk.fileName;
|
|
28
|
-
|
|
28
|
+
_chunk5FQVMM7Icjs.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`, resolvedOptions.config);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}, "analyzePlugin");
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNGL4NRBAcjs = require('./chunk-NGL4NRBA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkBDHZY5E7cjs = require('./chunk-BDHZY5E7.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkAGJ2KZ3Kcjs = require('./chunk-AGJ2KZ3K.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkSEWO2Q7Tcjs = require('./chunk-SEWO2Q7T.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
16
16
|
|
|
17
17
|
// src/config.ts
|
|
18
18
|
var getDefaultBuildPlugins = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (options, resolvedOptions) => Promise.all([
|
|
19
|
-
|
|
19
|
+
_chunkAGJ2KZ3Kcjs.analyzePlugin.call(void 0, options, resolvedOptions),
|
|
20
20
|
_chunkBDHZY5E7cjs.typeDefinitions.call(void 0, resolvedOptions.projectRoot),
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
_chunkNGL4NRBAcjs.tscPlugin.call(void 0, options, resolvedOptions),
|
|
22
|
+
_chunkSEWO2Q7Tcjs.onErrorPlugin.call(void 0, options, resolvedOptions)
|
|
23
23
|
].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
|
|
24
24
|
|
|
25
25
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cleanDirectories
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2E6P5U5P.js";
|
|
4
4
|
import {
|
|
5
5
|
getDefaultBuildPlugins
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UYR662XD.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WI52QJ54.js";
|
|
10
10
|
import {
|
|
11
11
|
COLOR_KEYS,
|
|
12
12
|
LogLevel,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
writeSuccess,
|
|
30
30
|
writeTrace,
|
|
31
31
|
writeWarning
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-PLJQK2VX.js";
|
|
33
33
|
import {
|
|
34
34
|
__name
|
|
35
35
|
} from "./chunk-3GQAWCBQ.js";
|