@storm-software/unbuild 0.22.0 → 0.23.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 +9840 -3131
- package/bin/unbuild.mjs +9817 -3083
- package/dist/build.d.mts +1 -0
- package/dist/build.d.ts +1 -0
- package/dist/build.js +9 -10
- package/dist/build.mjs +8 -9
- package/dist/chunk-3TNHGERR.mjs +49 -0
- package/dist/{chunk-BIZYEBW3.mjs → chunk-4ENAOJ33.mjs} +4 -2
- package/dist/chunk-5A3XPRPO.js +29 -0
- package/dist/{chunk-AICX43E6.mjs → chunk-67M6JMGM.mjs} +6584 -145
- package/dist/chunk-7G3WYTPJ.js +6 -0
- package/dist/{chunk-OG2CKJQU.mjs → chunk-AQ2MDNLT.mjs} +5 -5
- package/dist/{chunk-IIVTCNH5.mjs → chunk-K7L2WB3G.mjs} +5 -6
- package/dist/{chunk-6KE6SIPQ.js → chunk-LYYHOUCS.js} +6 -6
- package/dist/chunk-NA6OVNJI.js +287 -0
- package/dist/chunk-NOVWJHZD.mjs +6 -0
- package/dist/{chunk-FDF3FMZP.mjs → chunk-OUDNDBMR.mjs} +5 -5
- package/dist/{chunk-RUNO4F6F.js → chunk-P6LWSWAQ.js} +4 -2
- package/dist/chunk-Q6WN55YR.mjs +287 -0
- package/dist/chunk-RBSVNX4W.js +49 -0
- package/dist/{chunk-BMAXMHJB.js → chunk-SLC5BBLC.js} +6 -6
- package/dist/chunk-T5JY3PDF.js +23 -0
- package/dist/{chunk-B2WY6JG2.js → chunk-TAHELANG.js} +7629 -1190
- package/dist/{chunk-T5NKX2EJ.mjs → chunk-XPX5NQ4D.mjs} +8 -6
- package/dist/clean.js +3 -4
- package/dist/clean.mjs +2 -3
- package/dist/config.d.mts +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +7 -8
- package/dist/config.mjs +6 -7
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -11
- package/dist/index.mjs +14 -10
- package/dist/types.d.mts +2 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +2 -2
- package/dist/types.mjs +2 -1
- package/package.json +190 -1
- package/dist/chunk-2Q67L63A.js +0 -2456
- package/dist/chunk-4WKFVYTI.js +0 -18
- package/dist/chunk-B5GGHMTB.mjs +0 -604
- package/dist/chunk-E73BVQF5.js +0 -24
- package/dist/chunk-ERHVDARL.mjs +0 -0
- package/dist/chunk-J5YBLOB7.js +0 -27
- package/dist/chunk-LPEX4YW6.mjs +0 -13
- package/dist/chunk-OULCUN6I.js +0 -1
- package/dist/chunk-SGIQJ2OU.mjs +0 -2455
- package/dist/chunk-UUI4UWA4.js +0 -604
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
__name
|
|
6
|
-
} from "./chunk-LPEX4YW6.mjs";
|
|
2
|
+
__name,
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-3TNHGERR.mjs";
|
|
7
5
|
|
|
8
6
|
// src/plugins/on-error.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
import { writeError } from "@storm-software/config-tools";
|
|
9
9
|
var onErrorPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
|
|
10
10
|
name: "storm:on-error",
|
|
11
11
|
buildEnd(error) {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
__name
|
|
7
|
-
} from "./chunk-LPEX4YW6.mjs";
|
|
2
|
+
__name,
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-3TNHGERR.mjs";
|
|
8
5
|
|
|
9
6
|
// src/clean.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
import { getStopwatch, writeDebug } from "@storm-software/config-tools/logger/console";
|
|
10
9
|
import { rm } from "node:fs/promises";
|
|
11
10
|
async function clean(name = "Unbuild", directory, config) {
|
|
12
11
|
writeDebug(` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _chunkUUI4UWA4js = require('./chunk-UUI4UWA4.js');
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
var _chunk4WKFVYTIjs = require('./chunk-4WKFVYTI.js');
|
|
4
|
+
var _chunkRBSVNX4Wjs = require('./chunk-RBSVNX4W.js');
|
|
7
5
|
|
|
8
6
|
// src/plugins/analyze.ts
|
|
9
|
-
|
|
7
|
+
_chunkRBSVNX4Wjs.init_cjs_shims.call(void 0, );
|
|
8
|
+
var _configtools = require('@storm-software/config-tools');
|
|
9
|
+
var formatBytes = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (bytes) => {
|
|
10
10
|
if (bytes === 0) return "0 Byte";
|
|
11
11
|
const k = 1e3;
|
|
12
12
|
const dm = 3;
|
|
@@ -19,13 +19,13 @@ var formatBytes = /* @__PURE__ */ _chunk4WKFVYTIjs.__name.call(void 0, (bytes) =
|
|
|
19
19
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
20
20
|
return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
|
|
21
21
|
}, "formatBytes");
|
|
22
|
-
var analyzePlugin = /* @__PURE__ */
|
|
22
|
+
var analyzePlugin = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (options, resolvedOptions) => {
|
|
23
23
|
return {
|
|
24
24
|
name: "storm:analyzer",
|
|
25
25
|
renderChunk(source, chunk) {
|
|
26
26
|
const sourceBytes = formatBytes(source.length);
|
|
27
27
|
const fileName = chunk.fileName;
|
|
28
|
-
|
|
28
|
+
_configtools.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`, resolvedOptions.config);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}, "analyzePlugin");
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _chunkT5JY3PDFjs = require('./chunk-T5JY3PDF.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk5A3XPRPOjs = require('./chunk-5A3XPRPO.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkTAHELANGjs = require('./chunk-TAHELANG.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkRBSVNX4Wjs = require('./chunk-RBSVNX4W.js');
|
|
14
|
+
|
|
15
|
+
// src/build.ts
|
|
16
|
+
_chunkRBSVNX4Wjs.init_cjs_shims.call(void 0, );
|
|
17
|
+
var _devkit = require('@nx/devkit');
|
|
18
|
+
var _js = require('@nx/js');
|
|
19
|
+
var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
|
|
20
|
+
var _buildtools = require('@storm-software/build-tools');
|
|
21
|
+
var _createstormconfig = require('@storm-software/config-tools/create-storm-config');
|
|
22
|
+
var _console = require('@storm-software/config-tools/logger/console');
|
|
23
|
+
var _getloglevel = require('@storm-software/config-tools/logger/get-log-level');
|
|
24
|
+
var _types = require('@storm-software/config-tools/types');
|
|
25
|
+
var _correctpaths = require('@storm-software/config-tools/utilities/correct-paths');
|
|
26
|
+
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
27
|
+
var _jiti = require('jiti');
|
|
28
|
+
var _fs = require('fs');
|
|
29
|
+
var _promises = require('fs/promises');
|
|
30
|
+
var _path = require('path');
|
|
31
|
+
var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
|
|
32
|
+
async function resolveOptions(options) {
|
|
33
|
+
const projectRoot = options.projectRoot;
|
|
34
|
+
if (!projectRoot) {
|
|
35
|
+
throw new Error("Cannot find project root");
|
|
36
|
+
}
|
|
37
|
+
const outputPath = options.outputPath || _correctpaths.joinPaths.call(void 0, "dist", projectRoot);
|
|
38
|
+
const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
|
|
39
|
+
if (!workspaceRoot) {
|
|
40
|
+
throw new Error("Cannot find workspace root");
|
|
41
|
+
}
|
|
42
|
+
const config = await _createstormconfig.loadStormConfig.call(void 0, workspaceRoot.dir);
|
|
43
|
+
_console.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
44
|
+
const stopwatch = _console.getStopwatch.call(void 0, "Build options resolution");
|
|
45
|
+
if (options.configPath) {
|
|
46
|
+
const configFile = await _chunkTAHELANGjs.loadConfig.call(void 0, options.configPath);
|
|
47
|
+
if (configFile) {
|
|
48
|
+
options = _defu2.default.call(void 0, options, configFile);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
52
|
+
const projectJsonPath = _correctpaths.joinPaths.call(void 0, config.workspaceRoot, projectRoot, "project.json");
|
|
53
|
+
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
54
|
+
throw new Error("Cannot find project.json configuration");
|
|
55
|
+
}
|
|
56
|
+
const projectJsonContent = await _promises.readFile.call(void 0, projectJsonPath, "utf8");
|
|
57
|
+
const projectJson = JSON.parse(projectJsonContent);
|
|
58
|
+
const projectName = projectJson.name;
|
|
59
|
+
const packageJsonPath = _correctpaths.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "package.json");
|
|
60
|
+
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
61
|
+
throw new Error("Cannot find package.json configuration");
|
|
62
|
+
}
|
|
63
|
+
const packageJsonContent = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
|
|
64
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
65
|
+
let tsconfig = options.tsconfig;
|
|
66
|
+
if (!tsconfig) {
|
|
67
|
+
tsconfig = _correctpaths.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "tsconfig.json");
|
|
68
|
+
}
|
|
69
|
+
if (!_fs.existsSync.call(void 0, tsconfig)) {
|
|
70
|
+
throw new Error("Cannot find tsconfig.json configuration");
|
|
71
|
+
}
|
|
72
|
+
let sourceRoot = projectJson.sourceRoot;
|
|
73
|
+
if (!sourceRoot) {
|
|
74
|
+
sourceRoot = _correctpaths.joinPaths.call(void 0, projectRoot, "src");
|
|
75
|
+
}
|
|
76
|
+
if (!_fs.existsSync.call(void 0, sourceRoot)) {
|
|
77
|
+
throw new Error("Cannot find sourceRoot directory");
|
|
78
|
+
}
|
|
79
|
+
const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot.dir, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
80
|
+
let dependencies = result.dependencies;
|
|
81
|
+
const tsLibDependency = _js.getHelperDependency.call(void 0, _js.HelperDependency.tsc, tsconfig, dependencies, projectGraph, true);
|
|
82
|
+
if (tsLibDependency) {
|
|
83
|
+
dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
|
|
84
|
+
dependencies.push(tsLibDependency);
|
|
85
|
+
}
|
|
86
|
+
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
87
|
+
fsCache: config.skipCache ? false : _correctpaths.joinPaths.call(void 0, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
88
|
+
interopDefault: true
|
|
89
|
+
});
|
|
90
|
+
const resolvedOptions = {
|
|
91
|
+
name: projectName,
|
|
92
|
+
config,
|
|
93
|
+
projectRoot,
|
|
94
|
+
sourceRoot,
|
|
95
|
+
projectName,
|
|
96
|
+
tsconfig,
|
|
97
|
+
jiti,
|
|
98
|
+
clean: false,
|
|
99
|
+
entries: [
|
|
100
|
+
{
|
|
101
|
+
builder: "mkdist",
|
|
102
|
+
input: `.${sourceRoot.replace(projectRoot, "")}`,
|
|
103
|
+
outDir: _correctpaths.joinPaths.call(void 0, _path.relative.call(void 0, _correctpaths.joinPaths.call(void 0, config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
|
|
104
|
+
declaration: options.emitTypes !== false,
|
|
105
|
+
format: "esm"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
builder: "mkdist",
|
|
109
|
+
input: `.${sourceRoot.replace(projectRoot, "")}`,
|
|
110
|
+
outDir: _correctpaths.joinPaths.call(void 0, _path.relative.call(void 0, _correctpaths.joinPaths.call(void 0, config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
|
|
111
|
+
declaration: options.emitTypes !== false,
|
|
112
|
+
format: "cjs",
|
|
113
|
+
ext: "cjs"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
declaration: options.emitTypes !== false ? "compatible" : false,
|
|
117
|
+
failOnWarn: false,
|
|
118
|
+
sourcemap: _nullishCoalesce(options.sourcemap, () => ( !!options.debug)),
|
|
119
|
+
outDir: outputPath,
|
|
120
|
+
parallel: true,
|
|
121
|
+
stub: false,
|
|
122
|
+
stubOptions: {
|
|
123
|
+
jiti: {}
|
|
124
|
+
},
|
|
125
|
+
externals: _nullishCoalesce(options.external, () => ( [])),
|
|
126
|
+
dependencies: [],
|
|
127
|
+
peerDependencies: [],
|
|
128
|
+
devDependencies: [],
|
|
129
|
+
hooks: {},
|
|
130
|
+
alias: {},
|
|
131
|
+
replace: {},
|
|
132
|
+
rollup: {
|
|
133
|
+
replace: {},
|
|
134
|
+
alias: {},
|
|
135
|
+
json: {},
|
|
136
|
+
commonjs: {
|
|
137
|
+
sourceMap: _nullishCoalesce(options.sourcemap, () => ( true))
|
|
138
|
+
},
|
|
139
|
+
emitCJS: true,
|
|
140
|
+
cjsBridge: true,
|
|
141
|
+
dts: {
|
|
142
|
+
respectExternal: true,
|
|
143
|
+
tsconfig
|
|
144
|
+
},
|
|
145
|
+
output: {
|
|
146
|
+
banner: options.banner || `
|
|
147
|
+
// \u26A1 Built by Storm Software
|
|
148
|
+
`,
|
|
149
|
+
footer: options.footer
|
|
150
|
+
},
|
|
151
|
+
resolve: {
|
|
152
|
+
preferBuiltins: true,
|
|
153
|
+
extensions: [
|
|
154
|
+
".cjs",
|
|
155
|
+
".mjs",
|
|
156
|
+
".js",
|
|
157
|
+
".jsx",
|
|
158
|
+
".ts",
|
|
159
|
+
".tsx",
|
|
160
|
+
".json"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
esbuild: {
|
|
164
|
+
minify: options.minify !== false,
|
|
165
|
+
splitting: options.splitting !== false,
|
|
166
|
+
treeShaking: options.treeShaking !== false,
|
|
167
|
+
color: true,
|
|
168
|
+
logLevel: config.logLevel === _types.LogLevelLabel.FATAL ? _types.LogLevelLabel.ERROR : _getloglevel.isVerbose.call(void 0, ) ? "verbose" : config.logLevel
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
dependencies = dependencies.filter((dep) => dep.node.type === "npm" || dep.node.type === "lib" || dep.node.type === "app");
|
|
173
|
+
if (dependencies.length > 0) {
|
|
174
|
+
resolvedOptions.dependencies = dependencies.map((dep) => dep.name);
|
|
175
|
+
}
|
|
176
|
+
if (packageJson.devDependencies) {
|
|
177
|
+
resolvedOptions.devDependencies = Object.keys(packageJson.devDependencies);
|
|
178
|
+
}
|
|
179
|
+
if (packageJson.peerDependencies) {
|
|
180
|
+
resolvedOptions.peerDependencies = Object.keys(packageJson.peerDependencies);
|
|
181
|
+
}
|
|
182
|
+
if (options.rollup) {
|
|
183
|
+
let rollup = {};
|
|
184
|
+
if (typeof options.rollup === "string") {
|
|
185
|
+
const rollupFile = await _chunkTAHELANGjs.loadConfig.call(void 0, options.rollup);
|
|
186
|
+
if (rollupFile) {
|
|
187
|
+
rollup = rollupFile;
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
rollup = options.rollup;
|
|
191
|
+
}
|
|
192
|
+
resolvedOptions.rollup = _defu2.default.call(void 0, _nullishCoalesce(resolvedOptions.rollup, () => ( {})), rollup);
|
|
193
|
+
}
|
|
194
|
+
resolvedOptions.hooks = {
|
|
195
|
+
"rollup:options": /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, async (ctx, opts) => {
|
|
196
|
+
opts.plugins = await _asyncNullishCoalesce(options.plugins, async () => ( await _chunk5A3XPRPOjs.getDefaultBuildPlugins.call(void 0, options, resolvedOptions)));
|
|
197
|
+
}, "rollup:options")
|
|
198
|
+
};
|
|
199
|
+
stopwatch();
|
|
200
|
+
return resolvedOptions;
|
|
201
|
+
}
|
|
202
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, resolveOptions, "resolveOptions");
|
|
203
|
+
async function generatePackageJson(options) {
|
|
204
|
+
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _correctpaths.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
205
|
+
_console.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
206
|
+
const stopwatch = _console.getStopwatch.call(void 0, "Write package.json file");
|
|
207
|
+
const packageJsonPath = _correctpaths.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
208
|
+
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
209
|
+
throw new Error("Cannot find package.json configuration");
|
|
210
|
+
}
|
|
211
|
+
let packageJsonContent = await _promises.readFile.call(void 0, _correctpaths.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
212
|
+
if (!packageJsonContent) {
|
|
213
|
+
throw new Error("Cannot find package.json configuration file");
|
|
214
|
+
}
|
|
215
|
+
let packageJson = JSON.parse(packageJsonContent);
|
|
216
|
+
packageJson = await _buildtools.addPackageDependencies.call(void 0, options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
|
|
217
|
+
packageJson = await _buildtools.addWorkspacePackageJsonFields.call(void 0, options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
|
|
218
|
+
await _devkit.writeJsonFile.call(void 0, _correctpaths.joinPaths.call(void 0, options.outDir, "package.json"), await _buildtools.addPackageJsonExports.call(void 0, options.sourceRoot, packageJson));
|
|
219
|
+
stopwatch();
|
|
220
|
+
}
|
|
221
|
+
return options;
|
|
222
|
+
}
|
|
223
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, generatePackageJson, "generatePackageJson");
|
|
224
|
+
async function resolveUnbuild(options) {
|
|
225
|
+
_console.writeTrace.call(void 0, `Resolving Unbuild package with Jiti`, options.config);
|
|
226
|
+
try {
|
|
227
|
+
return options.jiti.import("unbuild");
|
|
228
|
+
} catch (error) {
|
|
229
|
+
_console.writeError.call(void 0, " \u274C An error occurred while resolving the Unbuild package", options.config);
|
|
230
|
+
throw new Error("An error occurred while resolving the Unbuild package", {
|
|
231
|
+
cause: error
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, resolveUnbuild, "resolveUnbuild");
|
|
236
|
+
async function executeUnbuild(options) {
|
|
237
|
+
_console.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} (${options.projectRoot}) build`, options.config);
|
|
238
|
+
const stopwatch = _console.getStopwatch.call(void 0, `${options.name} (${options.projectRoot}) build`);
|
|
239
|
+
try {
|
|
240
|
+
const unbuild = await resolveUnbuild(options);
|
|
241
|
+
await unbuild.build(options.projectRoot, false, {
|
|
242
|
+
...options,
|
|
243
|
+
rootDir: options.projectRoot
|
|
244
|
+
});
|
|
245
|
+
} finally {
|
|
246
|
+
stopwatch();
|
|
247
|
+
}
|
|
248
|
+
return options;
|
|
249
|
+
}
|
|
250
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, executeUnbuild, "executeUnbuild");
|
|
251
|
+
async function copyBuildAssets(options) {
|
|
252
|
+
_console.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`, options.config);
|
|
253
|
+
const stopwatch = _console.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
254
|
+
await _buildtools.copyAssets.call(void 0, options.config, _nullishCoalesce(options.assets, () => ( [])), options.outDir, options.projectRoot, options.projectName, options.sourceRoot, options.generatePackageJson, options.includeSrc);
|
|
255
|
+
stopwatch();
|
|
256
|
+
return options;
|
|
257
|
+
}
|
|
258
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
259
|
+
async function cleanOutputPath(options) {
|
|
260
|
+
if (options.clean !== false && options.outDir) {
|
|
261
|
+
await _chunkT5JY3PDFjs.clean.call(void 0, options.name, options.outDir, options.config);
|
|
262
|
+
}
|
|
263
|
+
return options;
|
|
264
|
+
}
|
|
265
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
266
|
+
async function build(options) {
|
|
267
|
+
_console.writeDebug.call(void 0, ` \u26A1 Executing Storm Unbuild pipeline`);
|
|
268
|
+
const stopwatch = _console.getStopwatch.call(void 0, "Unbuild pipeline");
|
|
269
|
+
try {
|
|
270
|
+
const resolvedOptions = await resolveOptions(options);
|
|
271
|
+
await cleanOutputPath(resolvedOptions);
|
|
272
|
+
await generatePackageJson(resolvedOptions);
|
|
273
|
+
await executeUnbuild(resolvedOptions);
|
|
274
|
+
await copyBuildAssets(resolvedOptions);
|
|
275
|
+
_console.writeSuccess.call(void 0, ` \u{1F3C1} The ${resolvedOptions.name} build completed successfully`, resolvedOptions.config);
|
|
276
|
+
} catch (error) {
|
|
277
|
+
_console.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
278
|
+
throw error;
|
|
279
|
+
} finally {
|
|
280
|
+
stopwatch();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, build, "build");
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
exports.build = build;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
__name
|
|
6
|
-
} from "./chunk-LPEX4YW6.mjs";
|
|
2
|
+
__name,
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-3TNHGERR.mjs";
|
|
7
5
|
|
|
8
6
|
// src/plugins/analyze.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
import { writeInfo } from "@storm-software/config-tools";
|
|
9
9
|
var formatBytes = /* @__PURE__ */ __name((bytes) => {
|
|
10
10
|
if (bytes === 0) return "0 Byte";
|
|
11
11
|
const k = 1e3;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
var _chunkRBSVNX4Wjs = require('./chunk-RBSVNX4W.js');
|
|
4
5
|
|
|
5
6
|
// src/plugins/type-definitions.ts
|
|
7
|
+
_chunkRBSVNX4Wjs.init_cjs_shims.call(void 0, );
|
|
6
8
|
var _path = require('path');
|
|
7
9
|
function typeDefinitions(projectRoot) {
|
|
8
10
|
return {
|
|
@@ -31,7 +33,7 @@ export { default } from ${relativeSourceDtsName};
|
|
|
31
33
|
}
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
|
-
|
|
36
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, typeDefinitions, "typeDefinitions");
|
|
35
37
|
|
|
36
38
|
|
|
37
39
|
|