@storm-software/workspace-tools 1.20.0 → 1.20.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/CHANGELOG.md +7 -0
- package/index.js +39 -24
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +39 -24
- package/src/executors/tsup/executor.js +32 -17
- package/src/executors/tsup-neutral/executor.js +32 -17
- package/src/executors/tsup-node/executor.js +32 -17
- package/src/generators/config-schema/generator.js +7 -7
- package/src/generators/node-library/generator.js +7 -7
- package/src/generators/preset/generator.js +7 -7
- package/src/utils/index.js +21 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.20.0](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.19.3...workspace-tools-v1.20.0) (2023-12-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **workspace-tools:** Added default options function parameter to workspace tools ([9a5c880](https://github.com/storm-software/storm-ops/commit/9a5c880c24898f5c593c32d1d13e978c5e0b3356))
|
|
7
|
+
|
|
1
8
|
## [1.19.3](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.19.2...workspace-tools-v1.19.3) (2023-12-02)
|
|
2
9
|
|
|
3
10
|
|
package/index.js
CHANGED
|
@@ -105242,7 +105242,8 @@ var getWorkspaceRoot2 = () => {
|
|
|
105242
105242
|
};
|
|
105243
105243
|
|
|
105244
105244
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
105245
|
-
var applyWorkspaceExecutorTokens = (option,
|
|
105245
|
+
var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
105246
|
+
console.log("applyWorkspaceExecutorTokens", option);
|
|
105246
105247
|
let result = option;
|
|
105247
105248
|
if (!result) {
|
|
105248
105249
|
return result;
|
|
@@ -105250,17 +105251,30 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
105250
105251
|
let projectName;
|
|
105251
105252
|
let projectRoot;
|
|
105252
105253
|
let sourceRoot;
|
|
105253
|
-
if (
|
|
105254
|
-
const context =
|
|
105254
|
+
if (tokenizerOptions?.projectName) {
|
|
105255
|
+
const context = tokenizerOptions;
|
|
105255
105256
|
projectName = context.projectName;
|
|
105256
105257
|
projectRoot = context.root;
|
|
105257
105258
|
sourceRoot = context.sourceRoot;
|
|
105258
105259
|
} else {
|
|
105259
|
-
const projectConfig =
|
|
105260
|
+
const projectConfig = tokenizerOptions;
|
|
105260
105261
|
projectName = projectConfig.name;
|
|
105261
105262
|
projectRoot = projectConfig.root;
|
|
105262
105263
|
sourceRoot = projectConfig.sourceRoot;
|
|
105263
105264
|
}
|
|
105265
|
+
if (tokenizerOptions.config) {
|
|
105266
|
+
const configKeys = Object.keys(tokenizerOptions.config);
|
|
105267
|
+
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
105268
|
+
configKeys.forEach((configKey) => {
|
|
105269
|
+
if (result.includes(`{${configKey}}`)) {
|
|
105270
|
+
result = result.replaceAll(
|
|
105271
|
+
`{${configKey}}`,
|
|
105272
|
+
tokenizerOptions.config[configKey]
|
|
105273
|
+
);
|
|
105274
|
+
}
|
|
105275
|
+
});
|
|
105276
|
+
}
|
|
105277
|
+
}
|
|
105264
105278
|
if (result.includes("{projectName}")) {
|
|
105265
105279
|
result = result.replaceAll("{projectName}", projectName);
|
|
105266
105280
|
}
|
|
@@ -105273,12 +105287,12 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
105273
105287
|
if (result.includes("{workspaceRoot}")) {
|
|
105274
105288
|
result = result.replaceAll(
|
|
105275
105289
|
"{workspaceRoot}",
|
|
105276
|
-
|
|
105290
|
+
tokenizerOptions.workspaceRoot ?? getWorkspaceRoot2()
|
|
105277
105291
|
);
|
|
105278
105292
|
}
|
|
105279
105293
|
return result;
|
|
105280
105294
|
};
|
|
105281
|
-
var applyWorkspaceGeneratorTokens = (option,
|
|
105295
|
+
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
105282
105296
|
let result = option;
|
|
105283
105297
|
if (!result) {
|
|
105284
105298
|
return result;
|
|
@@ -105286,7 +105300,7 @@ var applyWorkspaceGeneratorTokens = (option, config) => {
|
|
|
105286
105300
|
if (result.includes("{workspaceRoot}")) {
|
|
105287
105301
|
result = result.replaceAll(
|
|
105288
105302
|
"{workspaceRoot}",
|
|
105289
|
-
config.workspaceRoot ?? getWorkspaceRoot2()
|
|
105303
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config.workspaceRoot ?? getWorkspaceRoot2()
|
|
105290
105304
|
);
|
|
105291
105305
|
}
|
|
105292
105306
|
return result;
|
|
@@ -105334,9 +105348,22 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
105334
105348
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
105335
105349
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
105336
105350
|
const projectName = context.projectsConfigurations.projects[context.projectName].name;
|
|
105351
|
+
let config;
|
|
105352
|
+
if (!executorOptions.skipReadingConfig) {
|
|
105353
|
+
const configFile = await getConfigFile();
|
|
105354
|
+
const configEnv = getConfigEnv();
|
|
105355
|
+
config = await getDefaultConfig({
|
|
105356
|
+
...configFile,
|
|
105357
|
+
...configEnv
|
|
105358
|
+
});
|
|
105359
|
+
setConfigEnv(config);
|
|
105360
|
+
console.debug(`Loaded Storm config into env:
|
|
105361
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
105362
|
+
}
|
|
105337
105363
|
const tokenized = applyWorkspaceTokens(
|
|
105338
105364
|
options,
|
|
105339
105365
|
{
|
|
105366
|
+
config,
|
|
105340
105367
|
workspaceRoot,
|
|
105341
105368
|
projectRoot,
|
|
105342
105369
|
sourceRoot,
|
|
@@ -105346,18 +105373,6 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
105346
105373
|
},
|
|
105347
105374
|
applyWorkspaceExecutorTokens
|
|
105348
105375
|
);
|
|
105349
|
-
let config;
|
|
105350
|
-
if (!executorOptions.skipReadingConfig) {
|
|
105351
|
-
const configFile = await getConfigFile();
|
|
105352
|
-
const configEnv = getConfigEnv();
|
|
105353
|
-
config = await getDefaultConfig({
|
|
105354
|
-
...configFile,
|
|
105355
|
-
...configEnv
|
|
105356
|
-
});
|
|
105357
|
-
setConfigEnv(config);
|
|
105358
|
-
console.debug(`Loaded Storm config into env:
|
|
105359
|
-
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
105360
|
-
}
|
|
105361
105376
|
const result = await Promise.resolve(
|
|
105362
105377
|
executorFn(tokenized, context, config)
|
|
105363
105378
|
);
|
|
@@ -105392,11 +105407,6 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
105392
105407
|
options = generatorOptions.applyDefaultFn(options);
|
|
105393
105408
|
}
|
|
105394
105409
|
console.debug("\u2699\uFE0F Generator schema options: \n", options);
|
|
105395
|
-
const tokenized = applyWorkspaceTokens(
|
|
105396
|
-
options,
|
|
105397
|
-
{ workspaceRoot: tree.root },
|
|
105398
|
-
applyWorkspaceGeneratorTokens
|
|
105399
|
-
);
|
|
105400
105410
|
let config;
|
|
105401
105411
|
if (!generatorOptions.skipReadingConfig) {
|
|
105402
105412
|
const configFile = await getConfigFile();
|
|
@@ -105409,6 +105419,11 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
105409
105419
|
console.debug(`Loaded Storm config into env:
|
|
105410
105420
|
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
105411
105421
|
}
|
|
105422
|
+
const tokenized = applyWorkspaceTokens(
|
|
105423
|
+
options,
|
|
105424
|
+
{ workspaceRoot: tree.root, config },
|
|
105425
|
+
applyWorkspaceGeneratorTokens
|
|
105426
|
+
);
|
|
105412
105427
|
const result = await Promise.resolve(
|
|
105413
105428
|
generatorFn(tree, tokenized, config)
|
|
105414
105429
|
);
|