@storm-software/tsdown 0.27.16 → 0.27.17
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/bin/tsdown.cjs +3 -1
- package/dist/build.cjs +3 -3
- package/dist/build.js +2 -2
- package/dist/{chunk-YDB6OO6Q.cjs → chunk-2CESRFDQ.cjs} +111 -107
- package/dist/{chunk-HBRFPU3J.cjs → chunk-5I23ITU4.cjs} +2 -2
- package/dist/{chunk-WAL2QM22.js → chunk-HE6DPQ63.js} +2 -2
- package/dist/{chunk-SRDH3VQ5.js → chunk-ULKTID2C.js} +17 -13
- package/dist/clean.cjs +2 -2
- package/dist/clean.d.cts +5 -5
- package/dist/clean.d.ts +5 -5
- package/dist/clean.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/bin/tsdown.cjs
CHANGED
|
@@ -364,7 +364,9 @@ async function createProgram(config) {
|
|
|
364
364
|
const root = (0, import_find_workspace_root2.findWorkspaceRootSafe)();
|
|
365
365
|
process.env.STORM_WORKSPACE_ROOT ??= root;
|
|
366
366
|
process.env.NX_WORKSPACE_ROOT_PATH ??= root;
|
|
367
|
-
|
|
367
|
+
if (root) {
|
|
368
|
+
process.chdir(root);
|
|
369
|
+
}
|
|
368
370
|
const program = new import_commander.Command("storm-tsdown");
|
|
369
371
|
program.version("1.0.0", "-v --version", "display CLI version");
|
|
370
372
|
program.description("\u26A1 Run the Storm TSDown pipeline").showHelpAfterError().showSuggestionAfterError();
|
package/dist/build.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunk2CESRFDQcjs = require('./chunk-2CESRFDQ.cjs');
|
|
5
|
+
require('./chunk-5I23ITU4.cjs');
|
|
6
6
|
require('./chunk-DEWYQH4B.cjs');
|
|
7
7
|
require('./chunk-USNT2KNT.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.build =
|
|
11
|
+
exports.build = _chunk2CESRFDQcjs.build; exports.cleanOutputPath = _chunk2CESRFDQcjs.cleanOutputPath;
|
package/dist/build.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunk5I23ITU4cjs = require('./chunk-5I23ITU4.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
var _chunkDEWYQH4Bcjs = require('./chunk-DEWYQH4B.cjs');
|
|
@@ -79,8 +79,8 @@ var copyAssets = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (co
|
|
|
79
79
|
output: "src/"
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${
|
|
82
|
+
_chunk5I23ITU4cjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
|
|
83
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunk5I23ITU4cjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
|
|
84
84
|
const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
|
|
85
85
|
projectDir: projectRoot,
|
|
86
86
|
rootDir: config.workspaceRoot,
|
|
@@ -89,12 +89,12 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
89
89
|
});
|
|
90
90
|
await assetHandler.processAllAssetsOnce();
|
|
91
91
|
if (includeSrc === true) {
|
|
92
|
-
|
|
92
|
+
_chunk5I23ITU4cjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunk5I23ITU4cjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
93
93
|
const files = await _glob.glob.call(void 0, [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
_chunk5I23ITU4cjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
95
|
+
_chunk5I23ITU4cjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
96
|
+
_chunk5I23ITU4cjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
97
|
+
_chunk5I23ITU4cjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
98
98
|
]);
|
|
99
99
|
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
100
100
|
|
|
@@ -117,7 +117,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
117
117
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && _optionalChain([dep, 'access', _ => _.node, 'access', _2 => _2.data, 'optionalAccess', _3 => _3.root]) !== projectRoot && _optionalChain([dep, 'access', _4 => _4.node, 'access', _5 => _5.data, 'optionalAccess', _6 => _6.root]) !== workspaceRoot)) {
|
|
118
118
|
const projectNode = project.node;
|
|
119
119
|
if (projectNode.data.root) {
|
|
120
|
-
const projectPackageJsonPath =
|
|
120
|
+
const projectPackageJsonPath = _chunk5I23ITU4cjs.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
|
|
121
121
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
122
122
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
123
123
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -128,8 +128,8 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
if (localPackages.length > 0) {
|
|
131
|
-
|
|
132
|
-
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
131
|
+
_chunk5I23ITU4cjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
132
|
+
const projectJsonFile = await _promises.readFile.call(void 0, _chunk5I23ITU4cjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
|
|
133
133
|
const projectJson = JSON.parse(projectJsonFile);
|
|
134
134
|
const projectName2 = projectJson.name;
|
|
135
135
|
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
@@ -138,7 +138,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
138
138
|
}
|
|
139
139
|
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _9 => _9.projects, 'optionalAccess', _10 => _10[projectName2], 'access', _11 => _11.implicitDependencies, 'optionalAccess', _12 => _12.reduce, 'call', _13 => _13((ret, dep) => {
|
|
140
140
|
if (_optionalChain([projectConfigurations, 'access', _14 => _14.projects, 'optionalAccess', _15 => _15[dep]])) {
|
|
141
|
-
const depPackageJsonPath =
|
|
141
|
+
const depPackageJsonPath = _chunk5I23ITU4cjs.joinPaths.call(void 0, workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
|
|
142
142
|
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
143
143
|
const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
|
|
144
144
|
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
@@ -150,25 +150,25 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
150
150
|
return ret;
|
|
151
151
|
}, [])]);
|
|
152
152
|
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
153
|
-
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _16 => _16.includes, 'call', _17 => _17(localPackage.name)])) {
|
|
154
|
-
ret[localPackage.name] =
|
|
153
|
+
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _16 => _16.includes, 'call', _17 => _17(localPackage.name)]) && _optionalChain([packageJson, 'access', _18 => _18.devDependencies, 'optionalAccess', _19 => _19[localPackage.name]]) === void 0) {
|
|
154
|
+
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
155
155
|
}
|
|
156
156
|
return ret;
|
|
157
157
|
}, _nullishCoalesce(packageJson.dependencies, () => ( {})));
|
|
158
158
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
159
|
-
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess',
|
|
159
|
+
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _20 => _20.includes, 'call', _21 => _21(localPackage.name)]) && _optionalChain([packageJson, 'access', _22 => _22.dependencies, 'optionalAccess', _23 => _23[localPackage.name]]) === void 0) {
|
|
160
160
|
ret[localPackage.name] = localPackage.version || "0.0.1";
|
|
161
161
|
}
|
|
162
162
|
return ret;
|
|
163
163
|
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
164
164
|
} else {
|
|
165
|
-
|
|
165
|
+
_chunk5I23ITU4cjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
166
166
|
}
|
|
167
167
|
return packageJson;
|
|
168
168
|
}, "addPackageDependencies");
|
|
169
169
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
170
|
-
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot :
|
|
171
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
170
|
+
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunk5I23ITU4cjs.findWorkspaceRoot.call(void 0, );
|
|
171
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunk5I23ITU4cjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
|
|
172
172
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
173
173
|
packageJson.type ??= "module";
|
|
174
174
|
packageJson.sideEffects ??= false;
|
|
@@ -177,7 +177,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.cal
|
|
|
177
177
|
if (distSrc.startsWith("/")) {
|
|
178
178
|
distSrc = distSrc.substring(1);
|
|
179
179
|
}
|
|
180
|
-
packageJson.source ??= `${
|
|
180
|
+
packageJson.source ??= `${_chunk5I23ITU4cjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
181
181
|
}
|
|
182
182
|
packageJson.files ??= [
|
|
183
183
|
"dist/**/*"
|
|
@@ -208,7 +208,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.cal
|
|
|
208
208
|
];
|
|
209
209
|
}
|
|
210
210
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
211
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
211
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunk5I23ITU4cjs.joinPaths.call(void 0, "packages", projectName);
|
|
212
212
|
return packageJson;
|
|
213
213
|
}, "addWorkspacePackageJsonFields");
|
|
214
214
|
var addPackageJsonExport = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
|
|
@@ -236,16 +236,16 @@ var addPackageJsonExport = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
236
236
|
var _c12 = require('c12');
|
|
237
237
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
238
238
|
var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (fileName, filePath, options = {}) => {
|
|
239
|
-
const workspacePath = filePath ||
|
|
239
|
+
const workspacePath = filePath || _chunk5I23ITU4cjs.findWorkspaceRoot.call(void 0, filePath);
|
|
240
240
|
const configs = await Promise.all([
|
|
241
241
|
_c12.loadConfig.call(void 0, {
|
|
242
242
|
cwd: workspacePath,
|
|
243
243
|
packageJson: true,
|
|
244
244
|
name: fileName,
|
|
245
|
-
envName: _optionalChain([fileName, 'optionalAccess',
|
|
245
|
+
envName: _optionalChain([fileName, 'optionalAccess', _24 => _24.toUpperCase, 'call', _25 => _25()]),
|
|
246
246
|
jitiOptions: {
|
|
247
247
|
debug: false,
|
|
248
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
248
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunk5I23ITU4cjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
249
249
|
},
|
|
250
250
|
...options
|
|
251
251
|
}),
|
|
@@ -253,10 +253,10 @@ var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
253
253
|
cwd: workspacePath,
|
|
254
254
|
packageJson: true,
|
|
255
255
|
name: fileName,
|
|
256
|
-
envName: _optionalChain([fileName, 'optionalAccess',
|
|
256
|
+
envName: _optionalChain([fileName, 'optionalAccess', _26 => _26.toUpperCase, 'call', _27 => _27()]),
|
|
257
257
|
jitiOptions: {
|
|
258
258
|
debug: false,
|
|
259
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
259
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunk5I23ITU4cjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
260
260
|
},
|
|
261
261
|
configFile: fileName,
|
|
262
262
|
...options
|
|
@@ -265,21 +265,21 @@ var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
265
265
|
return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
|
|
266
266
|
}, "getConfigFileByName");
|
|
267
267
|
var getConfigFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
|
|
268
|
-
const workspacePath = filePath ? filePath :
|
|
268
|
+
const workspacePath = filePath ? filePath : _chunk5I23ITU4cjs.findWorkspaceRoot.call(void 0, filePath);
|
|
269
269
|
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
270
270
|
let config = result.config;
|
|
271
271
|
const configFile = result.configFile;
|
|
272
272
|
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
273
|
-
|
|
273
|
+
_chunk5I23ITU4cjs.writeTrace.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
274
274
|
logLevel: "all"
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
277
|
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
278
278
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
279
279
|
for (const result2 of results) {
|
|
280
|
-
if (_optionalChain([result2, 'optionalAccess',
|
|
280
|
+
if (_optionalChain([result2, 'optionalAccess', _28 => _28.config]) && _optionalChain([result2, 'optionalAccess', _29 => _29.configFile]) && Object.keys(result2.config).length > 0) {
|
|
281
281
|
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
282
|
-
|
|
282
|
+
_chunk5I23ITU4cjs.writeTrace.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
283
283
|
logLevel: "all"
|
|
284
284
|
});
|
|
285
285
|
}
|
|
@@ -341,15 +341,15 @@ var getConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
|
|
|
341
341
|
contact: process.env[`${prefix}CONTACT`] || void 0,
|
|
342
342
|
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
343
343
|
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
344
|
-
configFile: process.env[`${prefix}CONFIG_FILE`] ?
|
|
345
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ?
|
|
344
|
+
configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunk5I23ITU4cjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
345
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunk5I23ITU4cjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
346
346
|
directories: {
|
|
347
|
-
cache: process.env[`${prefix}CACHE_DIR`] ?
|
|
348
|
-
data: process.env[`${prefix}DATA_DIR`] ?
|
|
349
|
-
config: process.env[`${prefix}CONFIG_DIR`] ?
|
|
350
|
-
temp: process.env[`${prefix}TEMP_DIR`] ?
|
|
351
|
-
log: process.env[`${prefix}LOG_DIR`] ?
|
|
352
|
-
build: process.env[`${prefix}BUILD_DIR`] ?
|
|
347
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? _chunk5I23ITU4cjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
|
|
348
|
+
data: process.env[`${prefix}DATA_DIR`] ? _chunk5I23ITU4cjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
|
|
349
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? _chunk5I23ITU4cjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
|
|
350
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? _chunk5I23ITU4cjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
|
|
351
|
+
log: process.env[`${prefix}LOG_DIR`] ? _chunk5I23ITU4cjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
|
|
352
|
+
build: process.env[`${prefix}BUILD_DIR`] ? _chunk5I23ITU4cjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
|
|
353
353
|
},
|
|
354
354
|
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
355
355
|
mode: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}MODE`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
|
|
@@ -372,24 +372,24 @@ var getConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
|
|
|
372
372
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
373
373
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
374
374
|
},
|
|
375
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ?
|
|
375
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? _chunk5I23ITU4cjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
376
376
|
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
377
377
|
};
|
|
378
|
-
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) &&
|
|
378
|
+
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunk5I23ITU4cjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
|
|
379
379
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
380
380
|
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
381
381
|
return ret;
|
|
382
382
|
}, {}) : getThemeColorConfigEnv(prefix);
|
|
383
|
-
if (config.docs ===
|
|
384
|
-
if (config.homepage ===
|
|
385
|
-
config.docs = `${
|
|
383
|
+
if (config.docs === _chunk5I23ITU4cjs.STORM_DEFAULT_DOCS) {
|
|
384
|
+
if (config.homepage === _chunk5I23ITU4cjs.STORM_DEFAULT_HOMEPAGE) {
|
|
385
|
+
config.docs = `${_chunk5I23ITU4cjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
386
386
|
} else {
|
|
387
387
|
config.docs = `${config.homepage}/docs`;
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
if (config.licensing ===
|
|
391
|
-
if (config.homepage ===
|
|
392
|
-
config.licensing = `${
|
|
390
|
+
if (config.licensing === _chunk5I23ITU4cjs.STORM_DEFAULT_LICENSING) {
|
|
391
|
+
if (config.homepage === _chunk5I23ITU4cjs.STORM_DEFAULT_HOMEPAGE) {
|
|
392
|
+
config.licensing = `${_chunk5I23ITU4cjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
393
393
|
} else {
|
|
394
394
|
config.licensing = `${config.homepage}/docs`;
|
|
395
395
|
}
|
|
@@ -463,13 +463,13 @@ var getBaseThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(v
|
|
|
463
463
|
var setExtensionEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (extensionName, extension) => {
|
|
464
464
|
for (const key of Object.keys(_nullishCoalesce(extension, () => ( {})))) {
|
|
465
465
|
if (extension[key]) {
|
|
466
|
-
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess',
|
|
466
|
+
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _30 => _30.replace, 'call', _31 => _31(/([A-Z])+/g, (input) => input ? _optionalChain([input, 'access', _32 => _32[0], 'optionalAccess', _33 => _33.toUpperCase, 'call', _34 => _34()]) + input.slice(1) : ""), 'access', _35 => _35.split, 'call', _36 => _36(/(?=[A-Z])|[.\-\s_]/), 'access', _37 => _37.map, 'call', _38 => _38((x) => x.toLowerCase())]), () => ( []));
|
|
467
467
|
let extensionKey;
|
|
468
468
|
if (result.length === 0) {
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
471
|
if (result.length === 1) {
|
|
472
|
-
extensionKey = _nullishCoalesce(_optionalChain([result, 'access',
|
|
472
|
+
extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _39 => _39[0], 'optionalAccess', _40 => _40.toUpperCase, 'call', _41 => _41()]), () => ( ""));
|
|
473
473
|
} else {
|
|
474
474
|
extensionKey = result.reduce((ret, part) => {
|
|
475
475
|
return `${ret}_${part.toLowerCase()}`;
|
|
@@ -555,31 +555,31 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
555
555
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
556
556
|
}
|
|
557
557
|
if (config.configFile) {
|
|
558
|
-
process.env[`${prefix}CONFIG_FILE`] =
|
|
558
|
+
process.env[`${prefix}CONFIG_FILE`] = _chunk5I23ITU4cjs.correctPaths.call(void 0, config.configFile);
|
|
559
559
|
}
|
|
560
560
|
if (config.workspaceRoot) {
|
|
561
|
-
process.env[`${prefix}WORKSPACE_ROOT`] =
|
|
562
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
563
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
561
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = _chunk5I23ITU4cjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
562
|
+
process.env.NX_WORKSPACE_ROOT = _chunk5I23ITU4cjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
563
|
+
process.env.NX_WORKSPACE_ROOT_PATH = _chunk5I23ITU4cjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
564
564
|
}
|
|
565
565
|
if (config.directories) {
|
|
566
566
|
if (!config.skipCache && config.directories.cache) {
|
|
567
|
-
process.env[`${prefix}CACHE_DIR`] =
|
|
567
|
+
process.env[`${prefix}CACHE_DIR`] = _chunk5I23ITU4cjs.correctPaths.call(void 0, config.directories.cache);
|
|
568
568
|
}
|
|
569
569
|
if (config.directories.data) {
|
|
570
|
-
process.env[`${prefix}DATA_DIR`] =
|
|
570
|
+
process.env[`${prefix}DATA_DIR`] = _chunk5I23ITU4cjs.correctPaths.call(void 0, config.directories.data);
|
|
571
571
|
}
|
|
572
572
|
if (config.directories.config) {
|
|
573
|
-
process.env[`${prefix}CONFIG_DIR`] =
|
|
573
|
+
process.env[`${prefix}CONFIG_DIR`] = _chunk5I23ITU4cjs.correctPaths.call(void 0, config.directories.config);
|
|
574
574
|
}
|
|
575
575
|
if (config.directories.temp) {
|
|
576
|
-
process.env[`${prefix}TEMP_DIR`] =
|
|
576
|
+
process.env[`${prefix}TEMP_DIR`] = _chunk5I23ITU4cjs.correctPaths.call(void 0, config.directories.temp);
|
|
577
577
|
}
|
|
578
578
|
if (config.directories.log) {
|
|
579
|
-
process.env[`${prefix}LOG_DIR`] =
|
|
579
|
+
process.env[`${prefix}LOG_DIR`] = _chunk5I23ITU4cjs.correctPaths.call(void 0, config.directories.log);
|
|
580
580
|
}
|
|
581
581
|
if (config.directories.build) {
|
|
582
|
-
process.env[`${prefix}BUILD_DIR`] =
|
|
582
|
+
process.env[`${prefix}BUILD_DIR`] = _chunk5I23ITU4cjs.correctPaths.call(void 0, config.directories.build);
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
if (config.skipCache !== void 0) {
|
|
@@ -594,7 +594,7 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
594
594
|
process.env.NODE_ENV = config.mode;
|
|
595
595
|
process.env.ENVIRONMENT = config.mode;
|
|
596
596
|
}
|
|
597
|
-
if (_optionalChain([config, 'access',
|
|
597
|
+
if (_optionalChain([config, 'access', _42 => _42.colors, 'optionalAccess', _43 => _43.base, 'optionalAccess', _44 => _44.light]) || _optionalChain([config, 'access', _45 => _45.colors, 'optionalAccess', _46 => _46.base, 'optionalAccess', _47 => _47.dark])) {
|
|
598
598
|
for (const key of Object.keys(config.colors)) {
|
|
599
599
|
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
600
600
|
}
|
|
@@ -633,8 +633,8 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
633
633
|
if (config.logLevel) {
|
|
634
634
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
635
635
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
636
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
637
|
-
process.env.RUST_BACKTRACE =
|
|
636
|
+
process.env.NX_VERBOSE_LOGGING = String(_chunk5I23ITU4cjs.getLogLevel.call(void 0, config.logLevel) >= _chunk5I23ITU4cjs.LogLevel.DEBUG ? true : false);
|
|
637
|
+
process.env.RUST_BACKTRACE = _chunk5I23ITU4cjs.getLogLevel.call(void 0, config.logLevel) >= _chunk5I23ITU4cjs.LogLevel.DEBUG ? "full" : "none";
|
|
638
638
|
}
|
|
639
639
|
if (config.skipConfigLogging !== void 0) {
|
|
640
640
|
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
@@ -647,7 +647,7 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
647
647
|
}
|
|
648
648
|
}, "setConfigEnv");
|
|
649
649
|
var setThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, config) => {
|
|
650
|
-
return _optionalChain([config, 'optionalAccess',
|
|
650
|
+
return _optionalChain([config, 'optionalAccess', _48 => _48.light, 'optionalAccess', _49 => _49.brand]) || _optionalChain([config, 'optionalAccess', _50 => _50.dark, 'optionalAccess', _51 => _51.brand]) ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
651
651
|
}, "setThemeColorConfigEnv");
|
|
652
652
|
var setSingleThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, config) => {
|
|
653
653
|
if (config.dark) {
|
|
@@ -747,22 +747,22 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(v
|
|
|
747
747
|
// ../config-tools/src/create-storm-config.ts
|
|
748
748
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
749
749
|
var _static_cache = void 0;
|
|
750
|
-
var
|
|
750
|
+
var createStormWorkspaceConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (extensionName, schema, workspaceRoot, skipLogs = false) => {
|
|
751
751
|
let result;
|
|
752
|
-
if (!_optionalChain([_static_cache, 'optionalAccess',
|
|
752
|
+
if (!_optionalChain([_static_cache, 'optionalAccess', _52 => _52.data]) || !_optionalChain([_static_cache, 'optionalAccess', _53 => _53.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
753
753
|
let _workspaceRoot = workspaceRoot;
|
|
754
754
|
if (!_workspaceRoot) {
|
|
755
|
-
_workspaceRoot =
|
|
755
|
+
_workspaceRoot = _chunk5I23ITU4cjs.findWorkspaceRoot.call(void 0, );
|
|
756
756
|
}
|
|
757
757
|
const configEnv = getConfigEnv();
|
|
758
|
-
const defaultConfig = await
|
|
758
|
+
const defaultConfig = await _chunk5I23ITU4cjs.getDefaultConfig.call(void 0, _workspaceRoot);
|
|
759
759
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
760
760
|
if (!configFile && !skipLogs) {
|
|
761
|
-
|
|
761
|
+
_chunk5I23ITU4cjs.writeWarning.call(void 0, "No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
|
|
762
762
|
logLevel: "all"
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
|
-
result = await
|
|
765
|
+
result = await _chunk5I23ITU4cjs.stormWorkspaceConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
|
|
766
766
|
result.workspaceRoot ??= _workspaceRoot;
|
|
767
767
|
} else {
|
|
768
768
|
result = _static_cache.data;
|
|
@@ -778,7 +778,7 @@ var createStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, as
|
|
|
778
778
|
data: result
|
|
779
779
|
};
|
|
780
780
|
return result;
|
|
781
|
-
}, "
|
|
781
|
+
}, "createStormWorkspaceConfig");
|
|
782
782
|
var createConfigExtension = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (extensionName, schema) => {
|
|
783
783
|
const extension_cache_key = {
|
|
784
784
|
extensionName
|
|
@@ -793,25 +793,25 @@ var createConfigExtension = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0
|
|
|
793
793
|
_extension_cache.set(extension_cache_key, extension);
|
|
794
794
|
return extension;
|
|
795
795
|
}, "createConfigExtension");
|
|
796
|
-
var
|
|
797
|
-
const config = await
|
|
796
|
+
var loadStormWorkspaceConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot, skipLogs = false) => {
|
|
797
|
+
const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
798
798
|
setConfigEnv(config);
|
|
799
799
|
if (!skipLogs && !config.skipConfigLogging) {
|
|
800
|
-
|
|
801
|
-
${
|
|
800
|
+
_chunk5I23ITU4cjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm Workspace configuration:
|
|
801
|
+
${_chunk5I23ITU4cjs.formatLogMessage.call(void 0, config)}`, config);
|
|
802
802
|
}
|
|
803
803
|
return config;
|
|
804
|
-
}, "
|
|
804
|
+
}, "loadStormWorkspaceConfig");
|
|
805
805
|
|
|
806
806
|
// ../config-tools/src/get-config.ts
|
|
807
807
|
var getConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (workspaceRoot, skipLogs = false) => {
|
|
808
|
-
return
|
|
808
|
+
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
809
809
|
}, "getConfig");
|
|
810
810
|
|
|
811
811
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
812
812
|
|
|
813
813
|
var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
814
|
-
const workspaceRoot = config.workspaceRoot ||
|
|
814
|
+
const workspaceRoot = config.workspaceRoot || _chunk5I23ITU4cjs.findWorkspaceRoot.call(void 0, );
|
|
815
815
|
const entryPoints = [];
|
|
816
816
|
if (entry) {
|
|
817
817
|
if (typeof entry === "string") {
|
|
@@ -823,7 +823,7 @@ var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
823
823
|
}
|
|
824
824
|
}
|
|
825
825
|
if (emitOnAll) {
|
|
826
|
-
entryPoints.push(
|
|
826
|
+
entryPoints.push(_chunk5I23ITU4cjs.joinPaths.call(void 0, workspaceRoot, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
827
827
|
}
|
|
828
828
|
const results = await Promise.all(entryPoints.map(async (entryPoint) => {
|
|
829
829
|
const paths = [];
|
|
@@ -835,9 +835,9 @@ var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
835
835
|
]
|
|
836
836
|
});
|
|
837
837
|
paths.push(...files.reduce((ret, filePath) => {
|
|
838
|
-
const result =
|
|
838
|
+
const result = _chunk5I23ITU4cjs.correctPaths.call(void 0, _chunk5I23ITU4cjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunk5I23ITU4cjs.correctPaths.call(void 0, workspaceRoot), "").replaceAll(_chunk5I23ITU4cjs.correctPaths.call(void 0, projectRoot), ""));
|
|
839
839
|
if (result) {
|
|
840
|
-
|
|
840
|
+
_chunk5I23ITU4cjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunk5I23ITU4cjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
841
841
|
if (!paths.includes(result)) {
|
|
842
842
|
paths.push(result);
|
|
843
843
|
}
|
|
@@ -845,7 +845,11 @@ var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
845
845
|
return ret;
|
|
846
846
|
}, []));
|
|
847
847
|
} else {
|
|
848
|
-
|
|
848
|
+
const result = _chunk5I23ITU4cjs.correctPaths.call(void 0, entryPoint.replaceAll(_chunk5I23ITU4cjs.correctPaths.call(void 0, workspaceRoot), "").replaceAll(_chunk5I23ITU4cjs.correctPaths.call(void 0, projectRoot), ""));
|
|
849
|
+
_chunk5I23ITU4cjs.writeDebug.call(void 0, `Trying to add entry point ${result}"`, config);
|
|
850
|
+
if (!paths.includes(result)) {
|
|
851
|
+
paths.push(result);
|
|
852
|
+
}
|
|
849
853
|
}
|
|
850
854
|
return paths;
|
|
851
855
|
}));
|
|
@@ -893,12 +897,12 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
893
897
|
throw new Error("Cannot find Nx workspace root");
|
|
894
898
|
}
|
|
895
899
|
const config = await getConfig(workspaceRoot.dir);
|
|
896
|
-
|
|
897
|
-
const stopwatch =
|
|
900
|
+
_chunk5I23ITU4cjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
901
|
+
const stopwatch = _chunk5I23ITU4cjs.getStopwatch.call(void 0, "Build options resolution");
|
|
898
902
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
899
903
|
exitOnError: true
|
|
900
904
|
});
|
|
901
|
-
const projectJsonPath =
|
|
905
|
+
const projectJsonPath = _chunk5I23ITU4cjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "project.json");
|
|
902
906
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
903
907
|
throw new Error("Cannot find project.json configuration");
|
|
904
908
|
}
|
|
@@ -906,13 +910,13 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
906
910
|
const projectJson = JSON.parse(projectJsonFile);
|
|
907
911
|
const projectName = projectJson.name;
|
|
908
912
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
909
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
913
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _54 => _54.projects, 'optionalAccess', _55 => _55[projectName]])) {
|
|
910
914
|
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
911
915
|
}
|
|
912
916
|
const options = _defu2.default.call(void 0, userOptions, _chunkDEWYQH4Bcjs.DEFAULT_BUILD_OPTIONS);
|
|
913
917
|
options.name ??= `${projectName}-${options.format}`;
|
|
914
918
|
options.target ??= DEFAULT_TARGET;
|
|
915
|
-
const packageJsonPath =
|
|
919
|
+
const packageJsonPath = _chunk5I23ITU4cjs.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
|
|
916
920
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
917
921
|
throw new Error("Cannot find package.json configuration");
|
|
918
922
|
}
|
|
@@ -921,20 +925,20 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
921
925
|
...options,
|
|
922
926
|
config,
|
|
923
927
|
...userOptions,
|
|
924
|
-
tsconfig:
|
|
928
|
+
tsconfig: _chunk5I23ITU4cjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
925
929
|
format: options.format || "cjs",
|
|
926
930
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
927
931
|
"./src/index.ts"
|
|
928
932
|
], userOptions.emitOnAll),
|
|
929
|
-
outdir: userOptions.outputPath ||
|
|
933
|
+
outdir: userOptions.outputPath || _chunk5I23ITU4cjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
930
934
|
plugins: [],
|
|
931
935
|
name: userOptions.name || projectName,
|
|
932
936
|
projectConfigurations,
|
|
933
937
|
projectName,
|
|
934
938
|
projectGraph,
|
|
935
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
939
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunk5I23ITU4cjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
936
940
|
minify: userOptions.minify || !userOptions.debug,
|
|
937
|
-
verbose: userOptions.verbose ||
|
|
941
|
+
verbose: userOptions.verbose || _chunk5I23ITU4cjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
938
942
|
includeSrc: userOptions.includeSrc === true,
|
|
939
943
|
metafile: userOptions.metafile !== false,
|
|
940
944
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -968,14 +972,14 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
968
972
|
return result;
|
|
969
973
|
}, "resolveOptions");
|
|
970
974
|
async function generatePackageJson(options) {
|
|
971
|
-
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
972
|
-
|
|
973
|
-
const stopwatch =
|
|
974
|
-
const packageJsonPath =
|
|
975
|
+
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunk5I23ITU4cjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
976
|
+
_chunk5I23ITU4cjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
977
|
+
const stopwatch = _chunk5I23ITU4cjs.getStopwatch.call(void 0, "Write package.json file");
|
|
978
|
+
const packageJsonPath = _chunk5I23ITU4cjs.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
975
979
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
976
980
|
throw new Error("Cannot find package.json configuration");
|
|
977
981
|
}
|
|
978
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
982
|
+
const packageJsonFile = await _promises2.default.readFile(_chunk5I23ITU4cjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
979
983
|
if (!packageJsonFile) {
|
|
980
984
|
throw new Error("Cannot find package.json configuration file");
|
|
981
985
|
}
|
|
@@ -1014,15 +1018,15 @@ async function generatePackageJson(options) {
|
|
|
1014
1018
|
}
|
|
1015
1019
|
return ret;
|
|
1016
1020
|
}, packageJson.exports);
|
|
1017
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1021
|
+
await _devkit.writeJsonFile.call(void 0, _chunk5I23ITU4cjs.joinPaths.call(void 0, options.outdir, "package.json"), packageJson);
|
|
1018
1022
|
stopwatch();
|
|
1019
1023
|
}
|
|
1020
1024
|
return options;
|
|
1021
1025
|
}
|
|
1022
1026
|
_chunkUSNT2KNTcjs.__name.call(void 0, generatePackageJson, "generatePackageJson");
|
|
1023
1027
|
async function executeTSDown(options) {
|
|
1024
|
-
|
|
1025
|
-
const stopwatch =
|
|
1028
|
+
_chunk5I23ITU4cjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.config);
|
|
1029
|
+
const stopwatch = _chunk5I23ITU4cjs.getStopwatch.call(void 0, `${options.name} build`);
|
|
1026
1030
|
await _tsdown.build.call(void 0, {
|
|
1027
1031
|
...options,
|
|
1028
1032
|
entry: options.entryPoints,
|
|
@@ -1034,30 +1038,30 @@ async function executeTSDown(options) {
|
|
|
1034
1038
|
}
|
|
1035
1039
|
_chunkUSNT2KNTcjs.__name.call(void 0, executeTSDown, "executeTSDown");
|
|
1036
1040
|
async function copyBuildAssets(options) {
|
|
1037
|
-
|
|
1038
|
-
const stopwatch =
|
|
1041
|
+
_chunk5I23ITU4cjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outdir}`, options.config);
|
|
1042
|
+
const stopwatch = _chunk5I23ITU4cjs.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
1039
1043
|
await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outdir, options.projectRoot, options.sourceRoot, true, false);
|
|
1040
1044
|
stopwatch();
|
|
1041
1045
|
return options;
|
|
1042
1046
|
}
|
|
1043
1047
|
_chunkUSNT2KNTcjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1044
1048
|
async function reportResults(options) {
|
|
1045
|
-
|
|
1049
|
+
_chunk5I23ITU4cjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${options.name} build completed successfully`, options.config);
|
|
1046
1050
|
}
|
|
1047
1051
|
_chunkUSNT2KNTcjs.__name.call(void 0, reportResults, "reportResults");
|
|
1048
1052
|
async function cleanOutputPath(options) {
|
|
1049
1053
|
if (options.clean !== false && options.outdir) {
|
|
1050
|
-
|
|
1051
|
-
const stopwatch =
|
|
1052
|
-
await
|
|
1054
|
+
_chunk5I23ITU4cjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${options.name} output path: ${options.outdir}`, options.config);
|
|
1055
|
+
const stopwatch = _chunk5I23ITU4cjs.getStopwatch.call(void 0, `${options.name} output clean`);
|
|
1056
|
+
await _chunk5I23ITU4cjs.cleanDirectories.call(void 0, options.name, options.outdir, options.config);
|
|
1053
1057
|
stopwatch();
|
|
1054
1058
|
}
|
|
1055
1059
|
return options;
|
|
1056
1060
|
}
|
|
1057
1061
|
_chunkUSNT2KNTcjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1058
1062
|
async function build(options) {
|
|
1059
|
-
|
|
1060
|
-
const stopwatch =
|
|
1063
|
+
_chunk5I23ITU4cjs.writeDebug.call(void 0, ` \u26A1 Executing Storm TSDown pipeline`);
|
|
1064
|
+
const stopwatch = _chunk5I23ITU4cjs.getStopwatch.call(void 0, "TSDown pipeline");
|
|
1061
1065
|
try {
|
|
1062
1066
|
const opts = Array.isArray(options) ? options : [
|
|
1063
1067
|
options
|
|
@@ -1075,11 +1079,11 @@ async function build(options) {
|
|
|
1075
1079
|
await reportResults(opt);
|
|
1076
1080
|
}));
|
|
1077
1081
|
} else {
|
|
1078
|
-
|
|
1082
|
+
_chunk5I23ITU4cjs.writeWarning.call(void 0, " \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function.");
|
|
1079
1083
|
}
|
|
1080
|
-
|
|
1084
|
+
_chunk5I23ITU4cjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
|
|
1081
1085
|
} catch (error) {
|
|
1082
|
-
|
|
1086
|
+
_chunk5I23ITU4cjs.writeFatal.call(void 0, "Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
|
|
1083
1087
|
throw error;
|
|
1084
1088
|
} finally {
|
|
1085
1089
|
stopwatch();
|
|
@@ -157,7 +157,7 @@ var WorkspaceDirectoryConfigSchema = _zod2.default.object({
|
|
|
157
157
|
log: _zod2.default.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
158
158
|
build: _zod2.default.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
|
|
159
159
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
160
|
-
var
|
|
160
|
+
var stormWorkspaceConfigSchema = _zod2.default.object({
|
|
161
161
|
$schema: _zod2.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
162
162
|
extends: ExtendsSchema.optional(),
|
|
163
163
|
name: _zod2.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
@@ -772,4 +772,4 @@ _chunkUSNT2KNTcjs.__name.call(void 0, cleanDirectories, "cleanDirectories");
|
|
|
772
772
|
|
|
773
773
|
|
|
774
774
|
|
|
775
|
-
exports.LogLevel = LogLevel; exports.STORM_DEFAULT_DOCS = STORM_DEFAULT_DOCS; exports.STORM_DEFAULT_HOMEPAGE = STORM_DEFAULT_HOMEPAGE; exports.STORM_DEFAULT_LICENSING = STORM_DEFAULT_LICENSING; exports.
|
|
775
|
+
exports.LogLevel = LogLevel; exports.STORM_DEFAULT_DOCS = STORM_DEFAULT_DOCS; exports.STORM_DEFAULT_HOMEPAGE = STORM_DEFAULT_HOMEPAGE; exports.STORM_DEFAULT_LICENSING = STORM_DEFAULT_LICENSING; exports.stormWorkspaceConfigSchema = stormWorkspaceConfigSchema; exports.COLOR_KEYS = COLOR_KEYS; exports.correctPaths = correctPaths; exports.joinPaths = joinPaths; exports.findWorkspaceRoot = findWorkspaceRoot; exports.getDefaultConfig = getDefaultConfig; exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; exports.isVerbose = isVerbose; exports.writeFatal = writeFatal; exports.writeWarning = writeWarning; exports.writeSuccess = writeSuccess; exports.writeDebug = writeDebug; exports.writeTrace = writeTrace; exports.getStopwatch = getStopwatch; exports.formatLogMessage = formatLogMessage; exports.clean = clean; exports.cleanDirectories = cleanDirectories;
|
|
@@ -157,7 +157,7 @@ var WorkspaceDirectoryConfigSchema = z.object({
|
|
|
157
157
|
log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
158
158
|
build: z.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
|
|
159
159
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
160
|
-
var
|
|
160
|
+
var stormWorkspaceConfigSchema = z.object({
|
|
161
161
|
$schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
162
162
|
extends: ExtendsSchema.optional(),
|
|
163
163
|
name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
@@ -754,7 +754,7 @@ export {
|
|
|
754
754
|
STORM_DEFAULT_DOCS,
|
|
755
755
|
STORM_DEFAULT_HOMEPAGE,
|
|
756
756
|
STORM_DEFAULT_LICENSING,
|
|
757
|
-
|
|
757
|
+
stormWorkspaceConfigSchema,
|
|
758
758
|
COLOR_KEYS,
|
|
759
759
|
correctPaths,
|
|
760
760
|
joinPaths,
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
STORM_DEFAULT_DOCS,
|
|
5
5
|
STORM_DEFAULT_HOMEPAGE,
|
|
6
6
|
STORM_DEFAULT_LICENSING,
|
|
7
|
-
StormConfigSchema,
|
|
8
7
|
cleanDirectories,
|
|
9
8
|
correctPaths,
|
|
10
9
|
findWorkspaceRoot,
|
|
@@ -15,12 +14,13 @@ import {
|
|
|
15
14
|
getStopwatch,
|
|
16
15
|
isVerbose,
|
|
17
16
|
joinPaths,
|
|
17
|
+
stormWorkspaceConfigSchema,
|
|
18
18
|
writeDebug,
|
|
19
19
|
writeFatal,
|
|
20
20
|
writeSuccess,
|
|
21
21
|
writeTrace,
|
|
22
22
|
writeWarning
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-HE6DPQ63.js";
|
|
24
24
|
import {
|
|
25
25
|
DEFAULT_BUILD_OPTIONS
|
|
26
26
|
} from "./chunk-PR5HLZXS.js";
|
|
@@ -150,13 +150,13 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
150
150
|
return ret;
|
|
151
151
|
}, []);
|
|
152
152
|
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
153
|
-
if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name)) {
|
|
154
|
-
ret[localPackage.name] =
|
|
153
|
+
if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name) && packageJson.devDependencies?.[localPackage.name] === void 0) {
|
|
154
|
+
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
155
155
|
}
|
|
156
156
|
return ret;
|
|
157
157
|
}, packageJson.dependencies ?? {});
|
|
158
158
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
159
|
-
if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name)) {
|
|
159
|
+
if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name) && packageJson.dependencies?.[localPackage.name] === void 0) {
|
|
160
160
|
ret[localPackage.name] = localPackage.version || "0.0.1";
|
|
161
161
|
}
|
|
162
162
|
return ret;
|
|
@@ -747,7 +747,7 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
|
747
747
|
// ../config-tools/src/create-storm-config.ts
|
|
748
748
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
749
749
|
var _static_cache = void 0;
|
|
750
|
-
var
|
|
750
|
+
var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, schema, workspaceRoot, skipLogs = false) => {
|
|
751
751
|
let result;
|
|
752
752
|
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
753
753
|
let _workspaceRoot = workspaceRoot;
|
|
@@ -762,7 +762,7 @@ var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, wor
|
|
|
762
762
|
logLevel: "all"
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
|
-
result = await
|
|
765
|
+
result = await stormWorkspaceConfigSchema.parseAsync(defu2(configEnv, configFile, defaultConfig));
|
|
766
766
|
result.workspaceRoot ??= _workspaceRoot;
|
|
767
767
|
} else {
|
|
768
768
|
result = _static_cache.data;
|
|
@@ -778,7 +778,7 @@ var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, wor
|
|
|
778
778
|
data: result
|
|
779
779
|
};
|
|
780
780
|
return result;
|
|
781
|
-
}, "
|
|
781
|
+
}, "createStormWorkspaceConfig");
|
|
782
782
|
var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
783
783
|
const extension_cache_key = {
|
|
784
784
|
extensionName
|
|
@@ -793,19 +793,19 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
|
793
793
|
_extension_cache.set(extension_cache_key, extension);
|
|
794
794
|
return extension;
|
|
795
795
|
}, "createConfigExtension");
|
|
796
|
-
var
|
|
797
|
-
const config = await
|
|
796
|
+
var loadStormWorkspaceConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
|
|
797
|
+
const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
798
798
|
setConfigEnv(config);
|
|
799
799
|
if (!skipLogs && !config.skipConfigLogging) {
|
|
800
800
|
writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
801
801
|
${formatLogMessage(config)}`, config);
|
|
802
802
|
}
|
|
803
803
|
return config;
|
|
804
|
-
}, "
|
|
804
|
+
}, "loadStormWorkspaceConfig");
|
|
805
805
|
|
|
806
806
|
// ../config-tools/src/get-config.ts
|
|
807
807
|
var getConfig = /* @__PURE__ */ __name((workspaceRoot, skipLogs = false) => {
|
|
808
|
-
return
|
|
808
|
+
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
809
809
|
}, "getConfig");
|
|
810
810
|
|
|
811
811
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
@@ -845,7 +845,11 @@ var getEntryPoints = /* @__PURE__ */ __name(async (config, projectRoot, sourceRo
|
|
|
845
845
|
return ret;
|
|
846
846
|
}, []));
|
|
847
847
|
} else {
|
|
848
|
-
|
|
848
|
+
const result = correctPaths(entryPoint.replaceAll(correctPaths(workspaceRoot), "").replaceAll(correctPaths(projectRoot), ""));
|
|
849
|
+
writeDebug(`Trying to add entry point ${result}"`, config);
|
|
850
|
+
if (!paths.includes(result)) {
|
|
851
|
+
paths.push(result);
|
|
852
|
+
}
|
|
849
853
|
}
|
|
850
854
|
return paths;
|
|
851
855
|
}));
|
package/dist/clean.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk5I23ITU4cjs = require('./chunk-5I23ITU4.cjs');
|
|
5
5
|
require('./chunk-USNT2KNT.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.clean =
|
|
9
|
+
exports.clean = _chunk5I23ITU4cjs.clean; exports.cleanDirectories = _chunk5I23ITU4cjs.cleanDirectories;
|
package/dist/clean.d.cts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StormWorkspaceConfig } from '@storm-software/config';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Clean the TSDown output path
|
|
5
5
|
*
|
|
6
6
|
* @param name - The name of the executor
|
|
7
7
|
* @param directory - The directory to clean
|
|
8
|
-
* @param config - The
|
|
8
|
+
* @param config - The StormWorkspaceConfig object
|
|
9
9
|
*/
|
|
10
|
-
declare function clean(name: string | undefined, directory: string, config?:
|
|
10
|
+
declare function clean(name: string | undefined, directory: string, config?: StormWorkspaceConfig): Promise<void>;
|
|
11
11
|
/**
|
|
12
12
|
* Clean the TSDown output path
|
|
13
13
|
*
|
|
14
14
|
* @param name - The name of the executor
|
|
15
15
|
* @param directory - The directory to clean
|
|
16
|
-
* @param config - The
|
|
16
|
+
* @param config - The StormWorkspaceConfig object
|
|
17
17
|
*/
|
|
18
|
-
declare function cleanDirectories(name: string | undefined, directory: string, config?:
|
|
18
|
+
declare function cleanDirectories(name: string | undefined, directory: string, config?: StormWorkspaceConfig): Promise<void>;
|
|
19
19
|
|
|
20
20
|
export { clean, cleanDirectories };
|
package/dist/clean.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StormWorkspaceConfig } from '@storm-software/config';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Clean the TSDown output path
|
|
5
5
|
*
|
|
6
6
|
* @param name - The name of the executor
|
|
7
7
|
* @param directory - The directory to clean
|
|
8
|
-
* @param config - The
|
|
8
|
+
* @param config - The StormWorkspaceConfig object
|
|
9
9
|
*/
|
|
10
|
-
declare function clean(name: string | undefined, directory: string, config?:
|
|
10
|
+
declare function clean(name: string | undefined, directory: string, config?: StormWorkspaceConfig): Promise<void>;
|
|
11
11
|
/**
|
|
12
12
|
* Clean the TSDown output path
|
|
13
13
|
*
|
|
14
14
|
* @param name - The name of the executor
|
|
15
15
|
* @param directory - The directory to clean
|
|
16
|
-
* @param config - The
|
|
16
|
+
* @param config - The StormWorkspaceConfig object
|
|
17
17
|
*/
|
|
18
|
-
declare function cleanDirectories(name: string | undefined, directory: string, config?:
|
|
18
|
+
declare function cleanDirectories(name: string | undefined, directory: string, config?: StormWorkspaceConfig): Promise<void>;
|
|
19
19
|
|
|
20
20
|
export { clean, cleanDirectories };
|
package/dist/clean.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk2CESRFDQcjs = require('./chunk-2CESRFDQ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk5I23ITU4cjs = require('./chunk-5I23ITU4.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunkDEWYQH4Bcjs = require('./chunk-DEWYQH4B.cjs');
|
|
@@ -17,4 +17,4 @@ require('./chunk-SFZRYJZ2.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
exports.DEFAULT_BUILD_OPTIONS = _chunkDEWYQH4Bcjs.DEFAULT_BUILD_OPTIONS; exports.build =
|
|
20
|
+
exports.DEFAULT_BUILD_OPTIONS = _chunkDEWYQH4Bcjs.DEFAULT_BUILD_OPTIONS; exports.build = _chunk2CESRFDQcjs.build; exports.clean = _chunk5I23ITU4cjs.clean; exports.cleanDirectories = _chunk5I23ITU4cjs.cleanDirectories; exports.cleanOutputPath = _chunk2CESRFDQcjs.cleanOutputPath;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
build,
|
|
3
3
|
cleanOutputPath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ULKTID2C.js";
|
|
5
5
|
import {
|
|
6
6
|
clean,
|
|
7
7
|
cleanDirectories
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HE6DPQ63.js";
|
|
9
9
|
import {
|
|
10
10
|
DEFAULT_BUILD_OPTIONS
|
|
11
11
|
} from "./chunk-PR5HLZXS.js";
|