@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/package.json
CHANGED
package/src/base/index.js
CHANGED
|
@@ -6755,7 +6755,8 @@ var getWorkspaceRoot2 = () => {
|
|
|
6755
6755
|
};
|
|
6756
6756
|
|
|
6757
6757
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
6758
|
-
var applyWorkspaceExecutorTokens = (option,
|
|
6758
|
+
var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
6759
|
+
console.log("applyWorkspaceExecutorTokens", option);
|
|
6759
6760
|
let result = option;
|
|
6760
6761
|
if (!result) {
|
|
6761
6762
|
return result;
|
|
@@ -6763,17 +6764,30 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
6763
6764
|
let projectName;
|
|
6764
6765
|
let projectRoot;
|
|
6765
6766
|
let sourceRoot;
|
|
6766
|
-
if (
|
|
6767
|
-
const context =
|
|
6767
|
+
if (tokenizerOptions?.projectName) {
|
|
6768
|
+
const context = tokenizerOptions;
|
|
6768
6769
|
projectName = context.projectName;
|
|
6769
6770
|
projectRoot = context.root;
|
|
6770
6771
|
sourceRoot = context.sourceRoot;
|
|
6771
6772
|
} else {
|
|
6772
|
-
const projectConfig =
|
|
6773
|
+
const projectConfig = tokenizerOptions;
|
|
6773
6774
|
projectName = projectConfig.name;
|
|
6774
6775
|
projectRoot = projectConfig.root;
|
|
6775
6776
|
sourceRoot = projectConfig.sourceRoot;
|
|
6776
6777
|
}
|
|
6778
|
+
if (tokenizerOptions.config) {
|
|
6779
|
+
const configKeys = Object.keys(tokenizerOptions.config);
|
|
6780
|
+
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
6781
|
+
configKeys.forEach((configKey) => {
|
|
6782
|
+
if (result.includes(`{${configKey}}`)) {
|
|
6783
|
+
result = result.replaceAll(
|
|
6784
|
+
`{${configKey}}`,
|
|
6785
|
+
tokenizerOptions.config[configKey]
|
|
6786
|
+
);
|
|
6787
|
+
}
|
|
6788
|
+
});
|
|
6789
|
+
}
|
|
6790
|
+
}
|
|
6777
6791
|
if (result.includes("{projectName}")) {
|
|
6778
6792
|
result = result.replaceAll("{projectName}", projectName);
|
|
6779
6793
|
}
|
|
@@ -6786,12 +6800,12 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
6786
6800
|
if (result.includes("{workspaceRoot}")) {
|
|
6787
6801
|
result = result.replaceAll(
|
|
6788
6802
|
"{workspaceRoot}",
|
|
6789
|
-
|
|
6803
|
+
tokenizerOptions.workspaceRoot ?? getWorkspaceRoot2()
|
|
6790
6804
|
);
|
|
6791
6805
|
}
|
|
6792
6806
|
return result;
|
|
6793
6807
|
};
|
|
6794
|
-
var applyWorkspaceGeneratorTokens = (option,
|
|
6808
|
+
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
6795
6809
|
let result = option;
|
|
6796
6810
|
if (!result) {
|
|
6797
6811
|
return result;
|
|
@@ -6799,7 +6813,7 @@ var applyWorkspaceGeneratorTokens = (option, config) => {
|
|
|
6799
6813
|
if (result.includes("{workspaceRoot}")) {
|
|
6800
6814
|
result = result.replaceAll(
|
|
6801
6815
|
"{workspaceRoot}",
|
|
6802
|
-
config.workspaceRoot ?? getWorkspaceRoot2()
|
|
6816
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config.workspaceRoot ?? getWorkspaceRoot2()
|
|
6803
6817
|
);
|
|
6804
6818
|
}
|
|
6805
6819
|
return result;
|
|
@@ -6847,9 +6861,22 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
6847
6861
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
6848
6862
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
6849
6863
|
const projectName = context.projectsConfigurations.projects[context.projectName].name;
|
|
6864
|
+
let config;
|
|
6865
|
+
if (!executorOptions.skipReadingConfig) {
|
|
6866
|
+
const configFile = await getConfigFile();
|
|
6867
|
+
const configEnv = getConfigEnv();
|
|
6868
|
+
config = await getDefaultConfig({
|
|
6869
|
+
...configFile,
|
|
6870
|
+
...configEnv
|
|
6871
|
+
});
|
|
6872
|
+
setConfigEnv(config);
|
|
6873
|
+
console.debug(`Loaded Storm config into env:
|
|
6874
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
6875
|
+
}
|
|
6850
6876
|
const tokenized = applyWorkspaceTokens(
|
|
6851
6877
|
options,
|
|
6852
6878
|
{
|
|
6879
|
+
config,
|
|
6853
6880
|
workspaceRoot,
|
|
6854
6881
|
projectRoot,
|
|
6855
6882
|
sourceRoot,
|
|
@@ -6859,18 +6886,6 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
6859
6886
|
},
|
|
6860
6887
|
applyWorkspaceExecutorTokens
|
|
6861
6888
|
);
|
|
6862
|
-
let config;
|
|
6863
|
-
if (!executorOptions.skipReadingConfig) {
|
|
6864
|
-
const configFile = await getConfigFile();
|
|
6865
|
-
const configEnv = getConfigEnv();
|
|
6866
|
-
config = await getDefaultConfig({
|
|
6867
|
-
...configFile,
|
|
6868
|
-
...configEnv
|
|
6869
|
-
});
|
|
6870
|
-
setConfigEnv(config);
|
|
6871
|
-
console.debug(`Loaded Storm config into env:
|
|
6872
|
-
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
6873
|
-
}
|
|
6874
6889
|
const result = await Promise.resolve(
|
|
6875
6890
|
executorFn(tokenized, context, config)
|
|
6876
6891
|
);
|
|
@@ -6905,11 +6920,6 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
6905
6920
|
options = generatorOptions.applyDefaultFn(options);
|
|
6906
6921
|
}
|
|
6907
6922
|
console.debug("\u2699\uFE0F Generator schema options: \n", options);
|
|
6908
|
-
const tokenized = applyWorkspaceTokens(
|
|
6909
|
-
options,
|
|
6910
|
-
{ workspaceRoot: tree.root },
|
|
6911
|
-
applyWorkspaceGeneratorTokens
|
|
6912
|
-
);
|
|
6913
6923
|
let config;
|
|
6914
6924
|
if (!generatorOptions.skipReadingConfig) {
|
|
6915
6925
|
const configFile = await getConfigFile();
|
|
@@ -6922,6 +6932,11 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
6922
6932
|
console.debug(`Loaded Storm config into env:
|
|
6923
6933
|
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
6924
6934
|
}
|
|
6935
|
+
const tokenized = applyWorkspaceTokens(
|
|
6936
|
+
options,
|
|
6937
|
+
{ workspaceRoot: tree.root, config },
|
|
6938
|
+
applyWorkspaceGeneratorTokens
|
|
6939
|
+
);
|
|
6925
6940
|
const result = await Promise.resolve(
|
|
6926
6941
|
generatorFn(tree, tokenized, config)
|
|
6927
6942
|
);
|
|
@@ -111442,7 +111442,8 @@ var getWorkspaceRoot2 = () => {
|
|
|
111442
111442
|
};
|
|
111443
111443
|
|
|
111444
111444
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
111445
|
-
var applyWorkspaceExecutorTokens = (option,
|
|
111445
|
+
var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
111446
|
+
console.log("applyWorkspaceExecutorTokens", option);
|
|
111446
111447
|
let result = option;
|
|
111447
111448
|
if (!result) {
|
|
111448
111449
|
return result;
|
|
@@ -111450,17 +111451,30 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
111450
111451
|
let projectName;
|
|
111451
111452
|
let projectRoot;
|
|
111452
111453
|
let sourceRoot;
|
|
111453
|
-
if (
|
|
111454
|
-
const context =
|
|
111454
|
+
if (tokenizerOptions?.projectName) {
|
|
111455
|
+
const context = tokenizerOptions;
|
|
111455
111456
|
projectName = context.projectName;
|
|
111456
111457
|
projectRoot = context.root;
|
|
111457
111458
|
sourceRoot = context.sourceRoot;
|
|
111458
111459
|
} else {
|
|
111459
|
-
const projectConfig =
|
|
111460
|
+
const projectConfig = tokenizerOptions;
|
|
111460
111461
|
projectName = projectConfig.name;
|
|
111461
111462
|
projectRoot = projectConfig.root;
|
|
111462
111463
|
sourceRoot = projectConfig.sourceRoot;
|
|
111463
111464
|
}
|
|
111465
|
+
if (tokenizerOptions.config) {
|
|
111466
|
+
const configKeys = Object.keys(tokenizerOptions.config);
|
|
111467
|
+
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
111468
|
+
configKeys.forEach((configKey) => {
|
|
111469
|
+
if (result.includes(`{${configKey}}`)) {
|
|
111470
|
+
result = result.replaceAll(
|
|
111471
|
+
`{${configKey}}`,
|
|
111472
|
+
tokenizerOptions.config[configKey]
|
|
111473
|
+
);
|
|
111474
|
+
}
|
|
111475
|
+
});
|
|
111476
|
+
}
|
|
111477
|
+
}
|
|
111464
111478
|
if (result.includes("{projectName}")) {
|
|
111465
111479
|
result = result.replaceAll("{projectName}", projectName);
|
|
111466
111480
|
}
|
|
@@ -111473,7 +111487,7 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
111473
111487
|
if (result.includes("{workspaceRoot}")) {
|
|
111474
111488
|
result = result.replaceAll(
|
|
111475
111489
|
"{workspaceRoot}",
|
|
111476
|
-
|
|
111490
|
+
tokenizerOptions.workspaceRoot ?? getWorkspaceRoot2()
|
|
111477
111491
|
);
|
|
111478
111492
|
}
|
|
111479
111493
|
return result;
|
|
@@ -111521,9 +111535,22 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
111521
111535
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
111522
111536
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
111523
111537
|
const projectName = context.projectsConfigurations.projects[context.projectName].name;
|
|
111538
|
+
let config;
|
|
111539
|
+
if (!executorOptions.skipReadingConfig) {
|
|
111540
|
+
const configFile = await getConfigFile();
|
|
111541
|
+
const configEnv = getConfigEnv();
|
|
111542
|
+
config = await getDefaultConfig({
|
|
111543
|
+
...configFile,
|
|
111544
|
+
...configEnv
|
|
111545
|
+
});
|
|
111546
|
+
setConfigEnv(config);
|
|
111547
|
+
console.debug(`Loaded Storm config into env:
|
|
111548
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
111549
|
+
}
|
|
111524
111550
|
const tokenized = applyWorkspaceTokens(
|
|
111525
111551
|
options,
|
|
111526
111552
|
{
|
|
111553
|
+
config,
|
|
111527
111554
|
workspaceRoot,
|
|
111528
111555
|
projectRoot,
|
|
111529
111556
|
sourceRoot,
|
|
@@ -111533,18 +111560,6 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
111533
111560
|
},
|
|
111534
111561
|
applyWorkspaceExecutorTokens
|
|
111535
111562
|
);
|
|
111536
|
-
let config;
|
|
111537
|
-
if (!executorOptions.skipReadingConfig) {
|
|
111538
|
-
const configFile = await getConfigFile();
|
|
111539
|
-
const configEnv = getConfigEnv();
|
|
111540
|
-
config = await getDefaultConfig({
|
|
111541
|
-
...configFile,
|
|
111542
|
-
...configEnv
|
|
111543
|
-
});
|
|
111544
|
-
setConfigEnv(config);
|
|
111545
|
-
console.debug(`Loaded Storm config into env:
|
|
111546
|
-
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
111547
|
-
}
|
|
111548
111563
|
const result = await Promise.resolve(
|
|
111549
111564
|
executorFn(tokenized, context, config)
|
|
111550
111565
|
);
|
|
@@ -105206,7 +105206,8 @@ var getWorkspaceRoot2 = () => {
|
|
|
105206
105206
|
};
|
|
105207
105207
|
|
|
105208
105208
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
105209
|
-
var applyWorkspaceExecutorTokens = (option,
|
|
105209
|
+
var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
105210
|
+
console.log("applyWorkspaceExecutorTokens", option);
|
|
105210
105211
|
let result = option;
|
|
105211
105212
|
if (!result) {
|
|
105212
105213
|
return result;
|
|
@@ -105214,17 +105215,30 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
105214
105215
|
let projectName;
|
|
105215
105216
|
let projectRoot;
|
|
105216
105217
|
let sourceRoot;
|
|
105217
|
-
if (
|
|
105218
|
-
const context =
|
|
105218
|
+
if (tokenizerOptions?.projectName) {
|
|
105219
|
+
const context = tokenizerOptions;
|
|
105219
105220
|
projectName = context.projectName;
|
|
105220
105221
|
projectRoot = context.root;
|
|
105221
105222
|
sourceRoot = context.sourceRoot;
|
|
105222
105223
|
} else {
|
|
105223
|
-
const projectConfig =
|
|
105224
|
+
const projectConfig = tokenizerOptions;
|
|
105224
105225
|
projectName = projectConfig.name;
|
|
105225
105226
|
projectRoot = projectConfig.root;
|
|
105226
105227
|
sourceRoot = projectConfig.sourceRoot;
|
|
105227
105228
|
}
|
|
105229
|
+
if (tokenizerOptions.config) {
|
|
105230
|
+
const configKeys = Object.keys(tokenizerOptions.config);
|
|
105231
|
+
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
105232
|
+
configKeys.forEach((configKey) => {
|
|
105233
|
+
if (result.includes(`{${configKey}}`)) {
|
|
105234
|
+
result = result.replaceAll(
|
|
105235
|
+
`{${configKey}}`,
|
|
105236
|
+
tokenizerOptions.config[configKey]
|
|
105237
|
+
);
|
|
105238
|
+
}
|
|
105239
|
+
});
|
|
105240
|
+
}
|
|
105241
|
+
}
|
|
105228
105242
|
if (result.includes("{projectName}")) {
|
|
105229
105243
|
result = result.replaceAll("{projectName}", projectName);
|
|
105230
105244
|
}
|
|
@@ -105237,7 +105251,7 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
105237
105251
|
if (result.includes("{workspaceRoot}")) {
|
|
105238
105252
|
result = result.replaceAll(
|
|
105239
105253
|
"{workspaceRoot}",
|
|
105240
|
-
|
|
105254
|
+
tokenizerOptions.workspaceRoot ?? getWorkspaceRoot2()
|
|
105241
105255
|
);
|
|
105242
105256
|
}
|
|
105243
105257
|
return result;
|
|
@@ -105285,9 +105299,22 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
105285
105299
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
105286
105300
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
105287
105301
|
const projectName = context.projectsConfigurations.projects[context.projectName].name;
|
|
105302
|
+
let config;
|
|
105303
|
+
if (!executorOptions.skipReadingConfig) {
|
|
105304
|
+
const configFile = await getConfigFile();
|
|
105305
|
+
const configEnv = getConfigEnv();
|
|
105306
|
+
config = await getDefaultConfig({
|
|
105307
|
+
...configFile,
|
|
105308
|
+
...configEnv
|
|
105309
|
+
});
|
|
105310
|
+
setConfigEnv(config);
|
|
105311
|
+
console.debug(`Loaded Storm config into env:
|
|
105312
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
105313
|
+
}
|
|
105288
105314
|
const tokenized = applyWorkspaceTokens(
|
|
105289
105315
|
options,
|
|
105290
105316
|
{
|
|
105317
|
+
config,
|
|
105291
105318
|
workspaceRoot,
|
|
105292
105319
|
projectRoot,
|
|
105293
105320
|
sourceRoot,
|
|
@@ -105297,18 +105324,6 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
105297
105324
|
},
|
|
105298
105325
|
applyWorkspaceExecutorTokens
|
|
105299
105326
|
);
|
|
105300
|
-
let config;
|
|
105301
|
-
if (!executorOptions.skipReadingConfig) {
|
|
105302
|
-
const configFile = await getConfigFile();
|
|
105303
|
-
const configEnv = getConfigEnv();
|
|
105304
|
-
config = await getDefaultConfig({
|
|
105305
|
-
...configFile,
|
|
105306
|
-
...configEnv
|
|
105307
|
-
});
|
|
105308
|
-
setConfigEnv(config);
|
|
105309
|
-
console.debug(`Loaded Storm config into env:
|
|
105310
|
-
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
105311
|
-
}
|
|
105312
105327
|
const result = await Promise.resolve(
|
|
105313
105328
|
executorFn(tokenized, context, config)
|
|
105314
105329
|
);
|
|
@@ -105336,7 +105336,8 @@ var getWorkspaceRoot2 = () => {
|
|
|
105336
105336
|
};
|
|
105337
105337
|
|
|
105338
105338
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
105339
|
-
var applyWorkspaceExecutorTokens = (option,
|
|
105339
|
+
var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
105340
|
+
console.log("applyWorkspaceExecutorTokens", option);
|
|
105340
105341
|
let result = option;
|
|
105341
105342
|
if (!result) {
|
|
105342
105343
|
return result;
|
|
@@ -105344,17 +105345,30 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
105344
105345
|
let projectName;
|
|
105345
105346
|
let projectRoot;
|
|
105346
105347
|
let sourceRoot;
|
|
105347
|
-
if (
|
|
105348
|
-
const context =
|
|
105348
|
+
if (tokenizerOptions?.projectName) {
|
|
105349
|
+
const context = tokenizerOptions;
|
|
105349
105350
|
projectName = context.projectName;
|
|
105350
105351
|
projectRoot = context.root;
|
|
105351
105352
|
sourceRoot = context.sourceRoot;
|
|
105352
105353
|
} else {
|
|
105353
|
-
const projectConfig =
|
|
105354
|
+
const projectConfig = tokenizerOptions;
|
|
105354
105355
|
projectName = projectConfig.name;
|
|
105355
105356
|
projectRoot = projectConfig.root;
|
|
105356
105357
|
sourceRoot = projectConfig.sourceRoot;
|
|
105357
105358
|
}
|
|
105359
|
+
if (tokenizerOptions.config) {
|
|
105360
|
+
const configKeys = Object.keys(tokenizerOptions.config);
|
|
105361
|
+
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
105362
|
+
configKeys.forEach((configKey) => {
|
|
105363
|
+
if (result.includes(`{${configKey}}`)) {
|
|
105364
|
+
result = result.replaceAll(
|
|
105365
|
+
`{${configKey}}`,
|
|
105366
|
+
tokenizerOptions.config[configKey]
|
|
105367
|
+
);
|
|
105368
|
+
}
|
|
105369
|
+
});
|
|
105370
|
+
}
|
|
105371
|
+
}
|
|
105358
105372
|
if (result.includes("{projectName}")) {
|
|
105359
105373
|
result = result.replaceAll("{projectName}", projectName);
|
|
105360
105374
|
}
|
|
@@ -105367,7 +105381,7 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
105367
105381
|
if (result.includes("{workspaceRoot}")) {
|
|
105368
105382
|
result = result.replaceAll(
|
|
105369
105383
|
"{workspaceRoot}",
|
|
105370
|
-
|
|
105384
|
+
tokenizerOptions.workspaceRoot ?? getWorkspaceRoot2()
|
|
105371
105385
|
);
|
|
105372
105386
|
}
|
|
105373
105387
|
return result;
|
|
@@ -105415,9 +105429,22 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
105415
105429
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
105416
105430
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
105417
105431
|
const projectName = context.projectsConfigurations.projects[context.projectName].name;
|
|
105432
|
+
let config;
|
|
105433
|
+
if (!executorOptions.skipReadingConfig) {
|
|
105434
|
+
const configFile = await getConfigFile();
|
|
105435
|
+
const configEnv = getConfigEnv();
|
|
105436
|
+
config = await getDefaultConfig({
|
|
105437
|
+
...configFile,
|
|
105438
|
+
...configEnv
|
|
105439
|
+
});
|
|
105440
|
+
setConfigEnv(config);
|
|
105441
|
+
console.debug(`Loaded Storm config into env:
|
|
105442
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
105443
|
+
}
|
|
105418
105444
|
const tokenized = applyWorkspaceTokens(
|
|
105419
105445
|
options,
|
|
105420
105446
|
{
|
|
105447
|
+
config,
|
|
105421
105448
|
workspaceRoot,
|
|
105422
105449
|
projectRoot,
|
|
105423
105450
|
sourceRoot,
|
|
@@ -105427,18 +105454,6 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
105427
105454
|
},
|
|
105428
105455
|
applyWorkspaceExecutorTokens
|
|
105429
105456
|
);
|
|
105430
|
-
let config;
|
|
105431
|
-
if (!executorOptions.skipReadingConfig) {
|
|
105432
|
-
const configFile = await getConfigFile();
|
|
105433
|
-
const configEnv = getConfigEnv();
|
|
105434
|
-
config = await getDefaultConfig({
|
|
105435
|
-
...configFile,
|
|
105436
|
-
...configEnv
|
|
105437
|
-
});
|
|
105438
|
-
setConfigEnv(config);
|
|
105439
|
-
console.debug(`Loaded Storm config into env:
|
|
105440
|
-
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
105441
|
-
}
|
|
105442
105457
|
const result = await Promise.resolve(
|
|
105443
105458
|
executorFn(tokenized, context, config)
|
|
105444
105459
|
);
|
|
@@ -29603,7 +29603,7 @@ var getWorkspaceRoot2 = () => {
|
|
|
29603
29603
|
};
|
|
29604
29604
|
|
|
29605
29605
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
29606
|
-
var applyWorkspaceGeneratorTokens = (option,
|
|
29606
|
+
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
29607
29607
|
let result = option;
|
|
29608
29608
|
if (!result) {
|
|
29609
29609
|
return result;
|
|
@@ -29611,7 +29611,7 @@ var applyWorkspaceGeneratorTokens = (option, config) => {
|
|
|
29611
29611
|
if (result.includes("{workspaceRoot}")) {
|
|
29612
29612
|
result = result.replaceAll(
|
|
29613
29613
|
"{workspaceRoot}",
|
|
29614
|
-
config.workspaceRoot ?? getWorkspaceRoot2()
|
|
29614
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config.workspaceRoot ?? getWorkspaceRoot2()
|
|
29615
29615
|
);
|
|
29616
29616
|
}
|
|
29617
29617
|
return result;
|
|
@@ -29649,11 +29649,6 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
29649
29649
|
options = generatorOptions.applyDefaultFn(options);
|
|
29650
29650
|
}
|
|
29651
29651
|
console.debug("\u2699\uFE0F Generator schema options: \n", options);
|
|
29652
|
-
const tokenized = applyWorkspaceTokens(
|
|
29653
|
-
options,
|
|
29654
|
-
{ workspaceRoot: tree.root },
|
|
29655
|
-
applyWorkspaceGeneratorTokens
|
|
29656
|
-
);
|
|
29657
29652
|
let config;
|
|
29658
29653
|
if (!generatorOptions.skipReadingConfig) {
|
|
29659
29654
|
const configFile = await getConfigFile();
|
|
@@ -29666,6 +29661,11 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
29666
29661
|
console.debug(`Loaded Storm config into env:
|
|
29667
29662
|
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
29668
29663
|
}
|
|
29664
|
+
const tokenized = applyWorkspaceTokens(
|
|
29665
|
+
options,
|
|
29666
|
+
{ workspaceRoot: tree.root, config },
|
|
29667
|
+
applyWorkspaceGeneratorTokens
|
|
29668
|
+
);
|
|
29669
29669
|
const result = await Promise.resolve(
|
|
29670
29670
|
generatorFn(tree, tokenized, config)
|
|
29671
29671
|
);
|
|
@@ -43935,7 +43935,7 @@ var getWorkspaceRoot2 = () => {
|
|
|
43935
43935
|
};
|
|
43936
43936
|
|
|
43937
43937
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
43938
|
-
var applyWorkspaceGeneratorTokens = (option,
|
|
43938
|
+
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
43939
43939
|
let result = option;
|
|
43940
43940
|
if (!result) {
|
|
43941
43941
|
return result;
|
|
@@ -43943,7 +43943,7 @@ var applyWorkspaceGeneratorTokens = (option, config) => {
|
|
|
43943
43943
|
if (result.includes("{workspaceRoot}")) {
|
|
43944
43944
|
result = result.replaceAll(
|
|
43945
43945
|
"{workspaceRoot}",
|
|
43946
|
-
config.workspaceRoot ?? getWorkspaceRoot2()
|
|
43946
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config.workspaceRoot ?? getWorkspaceRoot2()
|
|
43947
43947
|
);
|
|
43948
43948
|
}
|
|
43949
43949
|
return result;
|
|
@@ -43981,11 +43981,6 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
43981
43981
|
options = generatorOptions.applyDefaultFn(options);
|
|
43982
43982
|
}
|
|
43983
43983
|
console.debug("\u2699\uFE0F Generator schema options: \n", options);
|
|
43984
|
-
const tokenized = applyWorkspaceTokens(
|
|
43985
|
-
options,
|
|
43986
|
-
{ workspaceRoot: tree.root },
|
|
43987
|
-
applyWorkspaceGeneratorTokens
|
|
43988
|
-
);
|
|
43989
43984
|
let config;
|
|
43990
43985
|
if (!generatorOptions.skipReadingConfig) {
|
|
43991
43986
|
const configFile = await getConfigFile();
|
|
@@ -43998,6 +43993,11 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
43998
43993
|
console.debug(`Loaded Storm config into env:
|
|
43999
43994
|
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
44000
43995
|
}
|
|
43996
|
+
const tokenized = applyWorkspaceTokens(
|
|
43997
|
+
options,
|
|
43998
|
+
{ workspaceRoot: tree.root, config },
|
|
43999
|
+
applyWorkspaceGeneratorTokens
|
|
44000
|
+
);
|
|
44001
44001
|
const result = await Promise.resolve(
|
|
44002
44002
|
generatorFn(tree, tokenized, config)
|
|
44003
44003
|
);
|
|
@@ -24960,7 +24960,7 @@ var getWorkspaceRoot2 = () => {
|
|
|
24960
24960
|
};
|
|
24961
24961
|
|
|
24962
24962
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
24963
|
-
var applyWorkspaceGeneratorTokens = (option,
|
|
24963
|
+
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
24964
24964
|
let result = option;
|
|
24965
24965
|
if (!result) {
|
|
24966
24966
|
return result;
|
|
@@ -24968,7 +24968,7 @@ var applyWorkspaceGeneratorTokens = (option, config) => {
|
|
|
24968
24968
|
if (result.includes("{workspaceRoot}")) {
|
|
24969
24969
|
result = result.replaceAll(
|
|
24970
24970
|
"{workspaceRoot}",
|
|
24971
|
-
config.workspaceRoot ?? getWorkspaceRoot2()
|
|
24971
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config.workspaceRoot ?? getWorkspaceRoot2()
|
|
24972
24972
|
);
|
|
24973
24973
|
}
|
|
24974
24974
|
return result;
|
|
@@ -25006,11 +25006,6 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
25006
25006
|
options = generatorOptions.applyDefaultFn(options);
|
|
25007
25007
|
}
|
|
25008
25008
|
console.debug("\u2699\uFE0F Generator schema options: \n", options);
|
|
25009
|
-
const tokenized = applyWorkspaceTokens(
|
|
25010
|
-
options,
|
|
25011
|
-
{ workspaceRoot: tree.root },
|
|
25012
|
-
applyWorkspaceGeneratorTokens
|
|
25013
|
-
);
|
|
25014
25009
|
let config;
|
|
25015
25010
|
if (!generatorOptions.skipReadingConfig) {
|
|
25016
25011
|
const configFile = await getConfigFile();
|
|
@@ -25023,6 +25018,11 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
25023
25018
|
console.debug(`Loaded Storm config into env:
|
|
25024
25019
|
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`);
|
|
25025
25020
|
}
|
|
25021
|
+
const tokenized = applyWorkspaceTokens(
|
|
25022
|
+
options,
|
|
25023
|
+
{ workspaceRoot: tree.root, config },
|
|
25024
|
+
applyWorkspaceGeneratorTokens
|
|
25025
|
+
);
|
|
25026
25026
|
const result = await Promise.resolve(
|
|
25027
25027
|
generatorFn(tree, tokenized, config)
|
|
25028
25028
|
);
|
package/src/utils/index.js
CHANGED
|
@@ -60,7 +60,8 @@ var getWorkspaceRoot = () => {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
63
|
-
var applyWorkspaceExecutorTokens = (option,
|
|
63
|
+
var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
64
|
+
console.log("applyWorkspaceExecutorTokens", option);
|
|
64
65
|
let result = option;
|
|
65
66
|
if (!result) {
|
|
66
67
|
return result;
|
|
@@ -68,17 +69,30 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
68
69
|
let projectName;
|
|
69
70
|
let projectRoot;
|
|
70
71
|
let sourceRoot;
|
|
71
|
-
if (
|
|
72
|
-
const context =
|
|
72
|
+
if (tokenizerOptions?.projectName) {
|
|
73
|
+
const context = tokenizerOptions;
|
|
73
74
|
projectName = context.projectName;
|
|
74
75
|
projectRoot = context.root;
|
|
75
76
|
sourceRoot = context.sourceRoot;
|
|
76
77
|
} else {
|
|
77
|
-
const projectConfig =
|
|
78
|
+
const projectConfig = tokenizerOptions;
|
|
78
79
|
projectName = projectConfig.name;
|
|
79
80
|
projectRoot = projectConfig.root;
|
|
80
81
|
sourceRoot = projectConfig.sourceRoot;
|
|
81
82
|
}
|
|
83
|
+
if (tokenizerOptions.config) {
|
|
84
|
+
const configKeys = Object.keys(tokenizerOptions.config);
|
|
85
|
+
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
86
|
+
configKeys.forEach((configKey) => {
|
|
87
|
+
if (result.includes(`{${configKey}}`)) {
|
|
88
|
+
result = result.replaceAll(
|
|
89
|
+
`{${configKey}}`,
|
|
90
|
+
tokenizerOptions.config[configKey]
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
82
96
|
if (result.includes("{projectName}")) {
|
|
83
97
|
result = result.replaceAll("{projectName}", projectName);
|
|
84
98
|
}
|
|
@@ -91,12 +105,12 @@ var applyWorkspaceExecutorTokens = (option, config) => {
|
|
|
91
105
|
if (result.includes("{workspaceRoot}")) {
|
|
92
106
|
result = result.replaceAll(
|
|
93
107
|
"{workspaceRoot}",
|
|
94
|
-
|
|
108
|
+
tokenizerOptions.workspaceRoot ?? getWorkspaceRoot()
|
|
95
109
|
);
|
|
96
110
|
}
|
|
97
111
|
return result;
|
|
98
112
|
};
|
|
99
|
-
var applyWorkspaceGeneratorTokens = (option,
|
|
113
|
+
var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
100
114
|
let result = option;
|
|
101
115
|
if (!result) {
|
|
102
116
|
return result;
|
|
@@ -104,7 +118,7 @@ var applyWorkspaceGeneratorTokens = (option, config) => {
|
|
|
104
118
|
if (result.includes("{workspaceRoot}")) {
|
|
105
119
|
result = result.replaceAll(
|
|
106
120
|
"{workspaceRoot}",
|
|
107
|
-
config.workspaceRoot ?? getWorkspaceRoot()
|
|
121
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config.workspaceRoot ?? getWorkspaceRoot()
|
|
108
122
|
);
|
|
109
123
|
}
|
|
110
124
|
return result;
|