@storm-software/unbuild 0.30.5 → 0.30.6
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 -80
- package/bin/unbuild.js +117 -64
- package/dist/build.cjs +8 -8
- package/dist/build.js +7 -7
- package/dist/{chunk-V627S7QU.cjs → chunk-26OHEX55.cjs} +2 -2
- package/dist/{chunk-F77T2VZV.cjs → chunk-2FZRLS3Z.cjs} +175 -126
- package/dist/{chunk-KPFCICEG.js → chunk-3Q2ZB7CN.js} +1 -1
- package/dist/{chunk-VD6EE7HD.js → chunk-6K2BOPQA.js} +93 -44
- package/dist/{chunk-5E3NJ26L.cjs → chunk-CUQLNBV5.cjs} +3 -3
- package/dist/{chunk-5S4A4OEA.js → chunk-G2BQ6VSR.js} +1 -1
- package/dist/{chunk-CF2C3GEV.cjs → chunk-GVX7LSWK.cjs} +3 -3
- package/dist/{chunk-PSYW5YJB.cjs → chunk-KDTFDJN3.cjs} +2 -2
- package/dist/{chunk-FG6XQ26M.cjs → chunk-LXCK6Y4C.cjs} +20 -16
- package/dist/{chunk-C5IHRWT3.js → chunk-NYVG7QMW.js} +1 -1
- package/dist/{chunk-Y2DOCJBE.cjs → chunk-O45RUFL3.cjs} +6 -6
- package/dist/{chunk-K2D7TQ7G.js → chunk-OAOLAATA.js} +3 -3
- package/dist/{chunk-TPFSDZCR.js → chunk-VWXW3RW5.js} +18 -14
- package/dist/{chunk-VC7N2YVM.js → chunk-XGZOR6PZ.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/package.json +4 -4
package/bin/unbuild.js
CHANGED
|
@@ -93,6 +93,8 @@ var ColorConfigMapSchema = z.union([
|
|
|
93
93
|
}),
|
|
94
94
|
z.record(z.string(), ColorConfigSchema)
|
|
95
95
|
]);
|
|
96
|
+
var ExtendsItemSchema = z.string().trim().describe("The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration.");
|
|
97
|
+
var ExtendsSchema = ExtendsItemSchema.or(z.array(ExtendsItemSchema)).describe("The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration.");
|
|
96
98
|
var WorkspaceBotConfigSchema = z.object({
|
|
97
99
|
name: z.string().trim().default("Stormie-Bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
|
|
98
100
|
email: z.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
@@ -107,11 +109,11 @@ var WorkspaceDirectoryConfigSchema = z.object({
|
|
|
107
109
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
108
110
|
var StormConfigSchema = z.object({
|
|
109
111
|
$schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
110
|
-
extends:
|
|
112
|
+
extends: ExtendsSchema.optional(),
|
|
111
113
|
name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
112
114
|
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
113
115
|
organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
|
|
114
|
-
repository: z.string().trim().
|
|
116
|
+
repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
115
117
|
license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
116
118
|
homepage: z.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
|
|
117
119
|
docs: z.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
|
|
@@ -205,7 +207,8 @@ var COLOR_KEYS = [
|
|
|
205
207
|
];
|
|
206
208
|
|
|
207
209
|
// ../config-tools/src/utilities/get-default-config.ts
|
|
208
|
-
import { existsSync as existsSync2
|
|
210
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
211
|
+
import { readFile } from "node:fs/promises";
|
|
209
212
|
import { join as join2 } from "node:path";
|
|
210
213
|
|
|
211
214
|
// ../config-tools/src/utilities/correct-paths.ts
|
|
@@ -327,17 +330,15 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
327
330
|
"negative": "#dc2626"
|
|
328
331
|
}
|
|
329
332
|
};
|
|
330
|
-
var getDefaultConfig = /* @__PURE__ */ __name((root) => {
|
|
333
|
+
var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
331
334
|
let license = STORM_DEFAULT_LICENSE;
|
|
332
335
|
let homepage = STORM_DEFAULT_HOMEPAGE;
|
|
333
|
-
let name;
|
|
334
|
-
let namespace;
|
|
335
|
-
let repository;
|
|
336
|
+
let name = void 0;
|
|
337
|
+
let namespace = void 0;
|
|
338
|
+
let repository = void 0;
|
|
336
339
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
337
340
|
if (existsSync2(join2(workspaceRoot, "package.json"))) {
|
|
338
|
-
const file =
|
|
339
|
-
encoding: "utf8"
|
|
340
|
-
});
|
|
341
|
+
const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
341
342
|
if (file) {
|
|
342
343
|
const packageJson = JSON.parse(file);
|
|
343
344
|
if (packageJson.name) {
|
|
@@ -346,8 +347,12 @@ var getDefaultConfig = /* @__PURE__ */ __name((root) => {
|
|
|
346
347
|
if (packageJson.namespace) {
|
|
347
348
|
namespace = packageJson.namespace;
|
|
348
349
|
}
|
|
349
|
-
if (packageJson.repository
|
|
350
|
-
|
|
350
|
+
if (packageJson.repository) {
|
|
351
|
+
if (typeof packageJson.repository === "string") {
|
|
352
|
+
repository = packageJson.repository;
|
|
353
|
+
} else if (packageJson.repository.url) {
|
|
354
|
+
repository = packageJson.repository.url;
|
|
355
|
+
}
|
|
351
356
|
}
|
|
352
357
|
if (packageJson.license) {
|
|
353
358
|
license = packageJson.license;
|
|
@@ -556,7 +561,6 @@ var writeInfo = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.IN
|
|
|
556
561
|
var writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
|
|
557
562
|
var writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
|
|
558
563
|
var writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
|
|
559
|
-
var writeSystem = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
|
|
560
564
|
var getStopwatch = /* @__PURE__ */ __name((name) => {
|
|
561
565
|
const start = process.hrtime();
|
|
562
566
|
return () => {
|
|
@@ -629,19 +633,19 @@ Stacktrace: ${error.stack}`, config);
|
|
|
629
633
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
630
634
|
var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, options = {}) => {
|
|
631
635
|
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
636
|
+
const configs = await Promise.all([
|
|
637
|
+
loadConfig({
|
|
638
|
+
cwd: workspacePath,
|
|
639
|
+
packageJson: true,
|
|
640
|
+
name: fileName,
|
|
641
|
+
envName: fileName?.toUpperCase(),
|
|
642
|
+
jitiOptions: {
|
|
643
|
+
debug: false,
|
|
644
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
645
|
+
},
|
|
646
|
+
...options
|
|
647
|
+
}),
|
|
648
|
+
loadConfig({
|
|
645
649
|
cwd: workspacePath,
|
|
646
650
|
packageJson: true,
|
|
647
651
|
name: fileName,
|
|
@@ -652,9 +656,9 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
652
656
|
},
|
|
653
657
|
configFile: fileName,
|
|
654
658
|
...options
|
|
655
|
-
})
|
|
656
|
-
|
|
657
|
-
return
|
|
659
|
+
})
|
|
660
|
+
]);
|
|
661
|
+
return defu(configs[0] ?? {}, configs[1] ?? {});
|
|
658
662
|
}, "getConfigFileByName");
|
|
659
663
|
var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
|
|
660
664
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
@@ -662,7 +666,7 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
662
666
|
let config = result.config;
|
|
663
667
|
const configFile = result.configFile;
|
|
664
668
|
if (config && configFile && Object.keys(config).length > 0) {
|
|
665
|
-
|
|
669
|
+
writeTrace(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
666
670
|
logLevel: "all"
|
|
667
671
|
});
|
|
668
672
|
}
|
|
@@ -670,7 +674,7 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
670
674
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
671
675
|
for (const result2 of results) {
|
|
672
676
|
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
673
|
-
|
|
677
|
+
writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
674
678
|
logLevel: "all"
|
|
675
679
|
});
|
|
676
680
|
config = defu(result2.config ?? {}, config ?? {});
|
|
@@ -685,6 +689,16 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
685
689
|
}, "getConfigFile");
|
|
686
690
|
|
|
687
691
|
// ../config-tools/src/env/get-env.ts
|
|
692
|
+
var getExtensionEnv = /* @__PURE__ */ __name((extensionName) => {
|
|
693
|
+
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
694
|
+
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
695
|
+
const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
|
|
696
|
+
if (name) {
|
|
697
|
+
ret[name] = process.env[key];
|
|
698
|
+
}
|
|
699
|
+
return ret;
|
|
700
|
+
}, {});
|
|
701
|
+
}, "getExtensionEnv");
|
|
688
702
|
var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
689
703
|
const prefix = "STORM_";
|
|
690
704
|
let config = {
|
|
@@ -844,7 +858,7 @@ var setExtensionEnv = /* @__PURE__ */ __name((extensionName, extension) => {
|
|
|
844
858
|
var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
845
859
|
const prefix = "STORM_";
|
|
846
860
|
if (config.extends) {
|
|
847
|
-
process.env[`${prefix}EXTENDS`] = config.extends;
|
|
861
|
+
process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
|
|
848
862
|
}
|
|
849
863
|
if (config.name) {
|
|
850
864
|
process.env[`${prefix}NAME`] = config.name;
|
|
@@ -1074,30 +1088,69 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
|
1074
1088
|
}, "setBaseThemeColorConfigEnv");
|
|
1075
1089
|
|
|
1076
1090
|
// ../config-tools/src/create-storm-config.ts
|
|
1091
|
+
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
1077
1092
|
var _static_cache = void 0;
|
|
1078
|
-
var
|
|
1079
|
-
let
|
|
1080
|
-
if (_static_cache?.data
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
}
|
|
1093
|
+
var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, workspaceRoot, skipLogs = false) => {
|
|
1094
|
+
let result;
|
|
1095
|
+
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
1096
|
+
let _workspaceRoot = workspaceRoot;
|
|
1097
|
+
if (!_workspaceRoot) {
|
|
1098
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
1099
|
+
}
|
|
1100
|
+
const configEnv = getConfigEnv();
|
|
1101
|
+
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
1102
|
+
const configFile = await getConfigFile(_workspaceRoot);
|
|
1103
|
+
if (!configFile && !skipLogs) {
|
|
1104
|
+
writeWarning("No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
|
|
1105
|
+
logLevel: "all"
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
result = await StormConfigSchema.parseAsync(defu2(configEnv, configFile, defaultConfig));
|
|
1109
|
+
result.workspaceRoot ??= _workspaceRoot;
|
|
1110
|
+
} else {
|
|
1111
|
+
result = _static_cache.data;
|
|
1112
|
+
}
|
|
1113
|
+
if (schema && extensionName) {
|
|
1114
|
+
result.extensions = {
|
|
1115
|
+
...result.extensions,
|
|
1116
|
+
[extensionName]: createConfigExtension(extensionName, schema)
|
|
1117
|
+
};
|
|
1093
1118
|
}
|
|
1094
|
-
|
|
1119
|
+
_static_cache = {
|
|
1120
|
+
timestamp: Date.now(),
|
|
1121
|
+
data: result
|
|
1122
|
+
};
|
|
1123
|
+
return result;
|
|
1124
|
+
}, "createStormConfig");
|
|
1125
|
+
var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
1126
|
+
const extension_cache_key = {
|
|
1127
|
+
extensionName
|
|
1128
|
+
};
|
|
1129
|
+
if (_extension_cache.has(extension_cache_key)) {
|
|
1130
|
+
return _extension_cache.get(extension_cache_key);
|
|
1131
|
+
}
|
|
1132
|
+
let extension = getExtensionEnv(extensionName);
|
|
1133
|
+
if (schema) {
|
|
1134
|
+
extension = schema.parse(extension);
|
|
1135
|
+
}
|
|
1136
|
+
_extension_cache.set(extension_cache_key, extension);
|
|
1137
|
+
return extension;
|
|
1138
|
+
}, "createConfigExtension");
|
|
1139
|
+
var loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
|
|
1140
|
+
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
1095
1141
|
setConfigEnv(config);
|
|
1096
|
-
|
|
1142
|
+
if (!skipLogs) {
|
|
1143
|
+
writeTrace(`\u2699\uFE0F Using Storm configuration:
|
|
1097
1144
|
${formatLogMessage(config)}`, config);
|
|
1145
|
+
}
|
|
1098
1146
|
return config;
|
|
1099
1147
|
}, "loadStormConfig");
|
|
1100
1148
|
|
|
1149
|
+
// ../config-tools/src/get-config.ts
|
|
1150
|
+
var getConfig = /* @__PURE__ */ __name((workspaceRoot, skipLogs = false) => {
|
|
1151
|
+
return loadStormConfig(workspaceRoot, skipLogs);
|
|
1152
|
+
}, "getConfig");
|
|
1153
|
+
|
|
1101
1154
|
// bin/unbuild.ts
|
|
1102
1155
|
import { Command, Option } from "commander";
|
|
1103
1156
|
|
|
@@ -1123,22 +1176,22 @@ import { relative } from "path";
|
|
|
1123
1176
|
import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "@nx/devkit";
|
|
1124
1177
|
import { copyAssets as copyAssetsBase } from "@nx/js";
|
|
1125
1178
|
import { glob } from "glob";
|
|
1126
|
-
import { readFile as
|
|
1179
|
+
import { readFile as readFile3, writeFile } from "node:fs/promises";
|
|
1127
1180
|
|
|
1128
1181
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
1129
1182
|
import { existsSync as existsSync3 } from "node:fs";
|
|
1130
|
-
import { readFile } from "node:fs/promises";
|
|
1183
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
1131
1184
|
var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
|
|
1132
1185
|
let rootDir = workspaceRoot;
|
|
1133
1186
|
if (!rootDir) {
|
|
1134
|
-
const config = await
|
|
1187
|
+
const config = await getConfig();
|
|
1135
1188
|
rootDir = config.workspaceRoot;
|
|
1136
1189
|
}
|
|
1137
1190
|
const nxJsonPath = joinPaths(rootDir, "nx.json");
|
|
1138
1191
|
if (!existsSync3(nxJsonPath)) {
|
|
1139
1192
|
throw new Error("Cannot find project.json configuration");
|
|
1140
1193
|
}
|
|
1141
|
-
const configContent = await
|
|
1194
|
+
const configContent = await readFile2(nxJsonPath, "utf8");
|
|
1142
1195
|
return JSON.parse(configContent);
|
|
1143
1196
|
}, "readNxConfig");
|
|
1144
1197
|
|
|
@@ -1146,7 +1199,7 @@ var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
|
|
|
1146
1199
|
var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, projectRoot, projectName, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
|
|
1147
1200
|
const pendingAssets = Array.from(assets ?? []);
|
|
1148
1201
|
pendingAssets.push({
|
|
1149
|
-
input: projectRoot,
|
|
1202
|
+
input: joinPaths(config.workspaceRoot, projectRoot),
|
|
1150
1203
|
glob: "*.md",
|
|
1151
1204
|
output: "."
|
|
1152
1205
|
});
|
|
@@ -1209,7 +1262,7 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
1209
1262
|
]);
|
|
1210
1263
|
await Promise.allSettled(files.map(async (file) => writeFile(file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
1211
1264
|
|
|
1212
|
-
${await
|
|
1265
|
+
${await readFile3(file, "utf8")}
|
|
1213
1266
|
|
|
1214
1267
|
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
|
|
1215
1268
|
}
|
|
@@ -1219,7 +1272,7 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
|
|
|
1219
1272
|
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
1220
1273
|
import { Glob } from "glob";
|
|
1221
1274
|
import { existsSync as existsSync4 } from "node:fs";
|
|
1222
|
-
import { readFile as
|
|
1275
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
1223
1276
|
import { readCachedProjectGraph as readCachedProjectGraph2 } from "nx/src/project-graph/project-graph";
|
|
1224
1277
|
var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
1225
1278
|
const projectDependencies = calculateProjectBuildableDependencies(void 0, readCachedProjectGraph2(), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
@@ -1229,7 +1282,7 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
1229
1282
|
if (projectNode.data.root) {
|
|
1230
1283
|
const projectPackageJsonPath = joinPaths(workspaceRoot, projectNode.data.root, "package.json");
|
|
1231
1284
|
if (existsSync4(projectPackageJsonPath)) {
|
|
1232
|
-
const projectPackageJsonContent = await
|
|
1285
|
+
const projectPackageJsonContent = await readFile4(projectPackageJsonPath, "utf8");
|
|
1233
1286
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
1234
1287
|
if (projectPackageJson.private !== false) {
|
|
1235
1288
|
localPackages.push(projectPackageJson);
|
|
@@ -1266,7 +1319,7 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
1266
1319
|
}, "addPackageDependencies");
|
|
1267
1320
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
1268
1321
|
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : findWorkspaceRoot();
|
|
1269
|
-
const workspacePackageJsonContent = await
|
|
1322
|
+
const workspacePackageJsonContent = await readFile4(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
1270
1323
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
1271
1324
|
packageJson.type ??= "module";
|
|
1272
1325
|
packageJson.sideEffects ??= false;
|
|
@@ -1320,7 +1373,7 @@ import { createTaskGraph, mapTargetDefaultsToDependencies } from "nx/src/tasks-r
|
|
|
1320
1373
|
import defu4 from "defu";
|
|
1321
1374
|
import { Glob as Glob2 } from "glob";
|
|
1322
1375
|
import { existsSync as existsSync6 } from "node:fs";
|
|
1323
|
-
import { readFile as
|
|
1376
|
+
import { readFile as readFile5 } from "node:fs/promises";
|
|
1324
1377
|
import { relative as relative4 } from "node:path";
|
|
1325
1378
|
import { findWorkspaceRoot as findWorkspaceRoot2 } from "nx/src/utils/find-workspace-root";
|
|
1326
1379
|
|
|
@@ -2924,14 +2977,14 @@ async function resolveOptions(options, config) {
|
|
|
2924
2977
|
if (!existsSync6(projectJsonPath)) {
|
|
2925
2978
|
throw new Error("Cannot find project.json configuration");
|
|
2926
2979
|
}
|
|
2927
|
-
const projectJsonContent = await
|
|
2980
|
+
const projectJsonContent = await readFile5(projectJsonPath, "utf8");
|
|
2928
2981
|
const projectJson = JSON.parse(projectJsonContent);
|
|
2929
2982
|
const projectName = projectJson.name;
|
|
2930
2983
|
const packageJsonPath = joinPaths(config.workspaceRoot, options.projectRoot, "package.json");
|
|
2931
2984
|
if (!existsSync6(packageJsonPath)) {
|
|
2932
2985
|
throw new Error("Cannot find package.json configuration");
|
|
2933
2986
|
}
|
|
2934
|
-
const packageJsonContent = await
|
|
2987
|
+
const packageJsonContent = await readFile5(packageJsonPath, "utf8");
|
|
2935
2988
|
const packageJson = JSON.parse(packageJsonContent);
|
|
2936
2989
|
let tsconfig = options.tsconfig;
|
|
2937
2990
|
if (!tsconfig) {
|
|
@@ -3120,7 +3173,7 @@ async function generatePackageJson(options) {
|
|
|
3120
3173
|
if (!existsSync6(packageJsonPath)) {
|
|
3121
3174
|
throw new Error("Cannot find package.json configuration");
|
|
3122
3175
|
}
|
|
3123
|
-
let packageJsonContent = await
|
|
3176
|
+
let packageJsonContent = await readFile5(joinPaths(options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
3124
3177
|
if (!packageJsonContent) {
|
|
3125
3178
|
throw new Error("Cannot find package.json configuration file");
|
|
3126
3179
|
}
|
|
@@ -3220,7 +3273,7 @@ async function build2(options) {
|
|
|
3220
3273
|
if (!workspaceRoot) {
|
|
3221
3274
|
throw new Error("Cannot find workspace root");
|
|
3222
3275
|
}
|
|
3223
|
-
const config = await
|
|
3276
|
+
const config = await getConfig(workspaceRoot.dir);
|
|
3224
3277
|
writeDebug(` \u26A1 Executing Storm Unbuild pipeline`, config);
|
|
3225
3278
|
const stopwatch = getStopwatch("Unbuild pipeline");
|
|
3226
3279
|
try {
|
|
@@ -3371,7 +3424,7 @@ var cleanAction = /* @__PURE__ */ __name((config) => async (options) => {
|
|
|
3371
3424
|
}
|
|
3372
3425
|
}, "cleanAction");
|
|
3373
3426
|
void (async () => {
|
|
3374
|
-
const config = await
|
|
3427
|
+
const config = await getConfig();
|
|
3375
3428
|
const stopwatch = getStopwatch("Storm ESBuild executable");
|
|
3376
3429
|
try {
|
|
3377
3430
|
handleProcess(config);
|
package/dist/build.cjs
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-
|
|
8
|
+
var _chunk2FZRLS3Zcjs = require('./chunk-2FZRLS3Z.cjs');
|
|
9
|
+
require('./chunk-CUQLNBV5.cjs');
|
|
10
|
+
require('./chunk-O45RUFL3.cjs');
|
|
11
|
+
require('./chunk-26OHEX55.cjs');
|
|
12
12
|
require('./chunk-SHHAZOHN.cjs');
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
15
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-KDTFDJN3.cjs');
|
|
14
|
+
require('./chunk-GVX7LSWK.cjs');
|
|
15
|
+
require('./chunk-LXCK6Y4C.cjs');
|
|
16
16
|
require('./chunk-YDYGZTJK.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
@@ -21,4 +21,4 @@ require('./chunk-YDYGZTJK.cjs');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
exports.build =
|
|
24
|
+
exports.build = _chunk2FZRLS3Zcjs.build; exports.cleanOutputPath = _chunk2FZRLS3Zcjs.cleanOutputPath; exports.copyBuildAssets = _chunk2FZRLS3Zcjs.copyBuildAssets; exports.executeUnbuild = _chunk2FZRLS3Zcjs.executeUnbuild; exports.generatePackageJson = _chunk2FZRLS3Zcjs.generatePackageJson; exports.resolveOptions = _chunk2FZRLS3Zcjs.resolveOptions;
|
package/dist/build.js
CHANGED
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
executeUnbuild,
|
|
6
6
|
generatePackageJson,
|
|
7
7
|
resolveOptions
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-6K2BOPQA.js";
|
|
9
|
+
import "./chunk-XGZOR6PZ.js";
|
|
10
|
+
import "./chunk-OAOLAATA.js";
|
|
11
|
+
import "./chunk-NYVG7QMW.js";
|
|
12
12
|
import "./chunk-ESRR2FD2.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-3Q2ZB7CN.js";
|
|
14
|
+
import "./chunk-G2BQ6VSR.js";
|
|
15
|
+
import "./chunk-VWXW3RW5.js";
|
|
16
16
|
import "./chunk-3GQAWCBQ.js";
|
|
17
17
|
export {
|
|
18
18
|
build,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLXCK6Y4Ccjs = require('./chunk-LXCK6Y4C.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkYDYGZTJKcjs = require('./chunk-YDYGZTJK.cjs');
|
|
@@ -32,7 +32,7 @@ async function createTsCompilerOptions(config, tsConfigPath, projectRoot, depend
|
|
|
32
32
|
declaration: true,
|
|
33
33
|
paths: _buildablelibsutils.computeCompilerOptionsPaths.call(void 0, tsConfig, _nullishCoalesce(dependencies, () => ( [])))
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
_chunkLXCK6Y4Ccjs.writeTrace.call(void 0, compilerOptions, config);
|
|
36
36
|
return compilerOptions;
|
|
37
37
|
}
|
|
38
38
|
_chunkYDYGZTJKcjs.__name.call(void 0, createTsCompilerOptions, "createTsCompilerOptions");
|