@storm-software/workspace-tools 1.60.22 → 1.61.0
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 +24 -0
- package/README.md +2 -2
- package/index.js +342 -441
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +27 -18
- package/src/executors/npm-publish/executor.js +6 -0
- package/src/executors/tsup/executor.js +51 -49
- package/src/executors/tsup/schema.d.ts +2 -2
- package/src/executors/tsup/schema.json +7 -23
- package/src/executors/tsup-browser/executor.js +51 -47
- package/src/executors/tsup-neutral/executor.js +51 -47
- package/src/executors/tsup-node/executor.js +51 -47
- package/src/executors/typia/executor.js +14 -11
- package/src/generators/browser-library/generator.js +16 -10
- package/src/generators/config-schema/generator.js +10 -8
- package/src/generators/neutral-library/generator.js +16 -10
- package/src/generators/node-library/generator.js +16 -10
- package/src/generators/preset/generator.js +5 -5
- package/src/generators/release-version/generator.js +32 -19
- package/src/utils/index.js +279 -384
- package/src/executors/tsup/lib.dom.d.ts +0 -28208
- package/src/executors/tsup/lib.dom.iterable.d.ts +0 -732
- package/src/executors/tsup/lib.esnext.d.ts +0 -21
- package/src/executors/tsup-browser/lib.dom.d.ts +0 -28208
- package/src/executors/tsup-browser/lib.dom.iterable.d.ts +0 -732
- package/src/executors/tsup-browser/lib.esnext.d.ts +0 -21
- package/src/executors/tsup-neutral/lib.dom.d.ts +0 -28208
- package/src/executors/tsup-neutral/lib.dom.iterable.d.ts +0 -732
- package/src/executors/tsup-neutral/lib.esnext.d.ts +0 -21
- package/src/executors/tsup-node/lib.dom.d.ts +0 -28208
- package/src/executors/tsup-node/lib.dom.iterable.d.ts +0 -732
- package/src/executors/tsup-node/lib.esnext.d.ts +0 -21
|
@@ -215471,7 +215471,7 @@ var init_get_log_level = __esm({
|
|
|
215471
215471
|
return LogLevel.INFO;
|
|
215472
215472
|
}
|
|
215473
215473
|
};
|
|
215474
|
-
getLogLevelLabel = (logLevel) => {
|
|
215474
|
+
getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
215475
215475
|
if (logLevel >= LogLevel.ALL) {
|
|
215476
215476
|
return LogLevelLabel.ALL;
|
|
215477
215477
|
}
|
|
@@ -215797,14 +215797,14 @@ var init_set_env = __esm({
|
|
|
215797
215797
|
if (extension[key2]) {
|
|
215798
215798
|
const result = key2?.replace(
|
|
215799
215799
|
/([A-Z])+/g,
|
|
215800
|
-
(input) => input ? input[0]
|
|
215800
|
+
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
215801
215801
|
).split(/(?=[A-Z])|[\.\-\s_]/).map((x5) => x5.toLowerCase()) ?? [];
|
|
215802
215802
|
let extensionKey;
|
|
215803
215803
|
if (result.length === 0) {
|
|
215804
215804
|
return;
|
|
215805
215805
|
}
|
|
215806
215806
|
if (result.length === 1) {
|
|
215807
|
-
extensionKey = result[0]
|
|
215807
|
+
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
215808
215808
|
} else {
|
|
215809
215809
|
extensionKey = result.reduce((ret, part) => {
|
|
215810
215810
|
return `${ret}_${part.toLowerCase()}`;
|
|
@@ -456087,9 +456087,13 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
|
456087
456087
|
sourceRoot = context.sourceRoot;
|
|
456088
456088
|
} else {
|
|
456089
456089
|
const projectConfig = tokenizerOptions;
|
|
456090
|
-
projectName = projectConfig.name;
|
|
456091
456090
|
projectRoot = projectConfig.root;
|
|
456092
|
-
|
|
456091
|
+
if (projectConfig.name) {
|
|
456092
|
+
projectName = projectConfig.name;
|
|
456093
|
+
}
|
|
456094
|
+
if (projectConfig.sourceRoot) {
|
|
456095
|
+
sourceRoot = projectConfig.sourceRoot;
|
|
456096
|
+
}
|
|
456093
456097
|
}
|
|
456094
456098
|
if (tokenizerOptions.config) {
|
|
456095
456099
|
const configKeys = Object.keys(tokenizerOptions.config);
|
|
@@ -456113,7 +456117,7 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
|
456113
456117
|
if (result.includes("{workspaceRoot}")) {
|
|
456114
456118
|
result = result.replaceAll(
|
|
456115
456119
|
"{workspaceRoot}",
|
|
456116
|
-
tokenizerOptions.workspaceRoot ??
|
|
456120
|
+
tokenizerOptions.workspaceRoot ?? findWorkspaceRoot()
|
|
456117
456121
|
);
|
|
456118
456122
|
}
|
|
456119
456123
|
return result;
|
|
@@ -456138,7 +456142,6 @@ var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
|
|
|
456138
456142
|
};
|
|
456139
456143
|
|
|
456140
456144
|
// packages/workspace-tools/src/base/base-executor.ts
|
|
456141
|
-
init_src2();
|
|
456142
456145
|
var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
|
|
456143
456146
|
const stopwatch = getStopwatch(name);
|
|
456144
456147
|
let options8 = _options;
|
|
@@ -456151,10 +456154,10 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
|
|
|
456151
456154
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
456152
456155
|
);
|
|
456153
456156
|
}
|
|
456154
|
-
const workspaceRoot =
|
|
456155
|
-
const projectRoot = context.projectsConfigurations.projects[context.projectName]
|
|
456156
|
-
const sourceRoot = context.projectsConfigurations.projects[context.projectName]
|
|
456157
|
-
const projectName = context.projectsConfigurations.projects[context.projectName].
|
|
456157
|
+
const workspaceRoot = findWorkspaceRoot();
|
|
456158
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
|
|
456159
|
+
const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
|
|
456160
|
+
const projectName = context.projectsConfigurations.projects[context.projectName]?.name ?? context.projectName;
|
|
456158
456161
|
if (!executorOptions.skipReadingConfig) {
|
|
456159
456162
|
const { loadStormConfig: loadStormConfig2 } = await Promise.resolve().then(() => (init_src2(), src_exports));
|
|
456160
456163
|
writeDebug(
|
|
@@ -456439,7 +456442,7 @@ var outExtension = ({ format: format3 }) => {
|
|
|
456439
456442
|
|
|
456440
456443
|
// packages/workspace-tools/src/utils/file-path-utils.ts
|
|
456441
456444
|
var removeExtension = (filePath) => {
|
|
456442
|
-
return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
|
|
456445
|
+
return !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
|
|
456443
456446
|
};
|
|
456444
456447
|
|
|
456445
456448
|
// packages/workspace-tools/src/utils/run-tsup-build.ts
|
|
@@ -456477,17 +456480,17 @@ var applyDefaultOptions = (options8) => {
|
|
|
456477
456480
|
return options8;
|
|
456478
456481
|
};
|
|
456479
456482
|
var runTsupBuild = async (context, config, options8) => {
|
|
456480
|
-
const stormEnv = Object.keys(options8.env).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
|
|
456481
|
-
ret[key2] = options8.env[key2];
|
|
456483
|
+
const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
|
|
456484
|
+
ret[key2] = options8.env?.[key2];
|
|
456482
456485
|
return ret;
|
|
456483
456486
|
}, {});
|
|
456484
|
-
options8.plugins
|
|
456487
|
+
options8.plugins?.push(
|
|
456485
456488
|
(0, import_esbuild_decorators.esbuildDecorators)({
|
|
456486
456489
|
tsconfig: options8.tsConfig,
|
|
456487
456490
|
cwd: config.workspaceRoot
|
|
456488
456491
|
})
|
|
456489
456492
|
);
|
|
456490
|
-
options8.plugins
|
|
456493
|
+
options8.plugins?.push(environmentPlugin(stormEnv));
|
|
456491
456494
|
const getConfigOptions = {
|
|
456492
456495
|
...options8,
|
|
456493
456496
|
main: context.main,
|
|
@@ -456505,7 +456508,7 @@ var runTsupBuild = async (context, config, options8) => {
|
|
|
456505
456508
|
},
|
|
456506
456509
|
dtsTsConfig: getNormalizedTsConfig(
|
|
456507
456510
|
context,
|
|
456508
|
-
config.workspaceRoot,
|
|
456511
|
+
config.workspaceRoot ?? ".",
|
|
456509
456512
|
options8.outputPath,
|
|
456510
456513
|
createTypeScriptCompilationOptions(
|
|
456511
456514
|
(0, import_normalize_options.normalizeOptions)(
|
|
@@ -456515,9 +456518,9 @@ var runTsupBuild = async (context, config, options8) => {
|
|
|
456515
456518
|
main: context.main,
|
|
456516
456519
|
transformers: []
|
|
456517
456520
|
},
|
|
456518
|
-
config.workspaceRoot,
|
|
456521
|
+
config.workspaceRoot ?? ".",
|
|
456519
456522
|
context.sourceRoot,
|
|
456520
|
-
config.workspaceRoot
|
|
456523
|
+
config.workspaceRoot ?? "."
|
|
456521
456524
|
),
|
|
456522
456525
|
context.projectName
|
|
456523
456526
|
)
|
|
@@ -456540,7 +456543,7 @@ ${options8.banner}
|
|
|
456540
456543
|
const getConfigFns = [options8.getConfig];
|
|
456541
456544
|
const tsupConfig = (0, import_tsup.defineConfig)(
|
|
456542
456545
|
getConfigFns.map(
|
|
456543
|
-
(getConfigFn) => getConfig(config.workspaceRoot, context.projectRoot, getConfigFn, getConfigOptions)
|
|
456546
|
+
(getConfigFn) => getConfig(config.workspaceRoot ?? ".", context.projectRoot, getConfigFn, getConfigOptions)
|
|
456544
456547
|
)
|
|
456545
456548
|
);
|
|
456546
456549
|
if (_isFunction2(tsupConfig)) {
|
|
@@ -456549,7 +456552,7 @@ ${options8.banner}
|
|
|
456549
456552
|
} else {
|
|
456550
456553
|
await build(tsupConfig, config);
|
|
456551
456554
|
}
|
|
456552
|
-
} else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
|
|
456555
|
+
} else if (getLogLevel(config?.logLevel ?? "debug") >= LogLevel.WARN) {
|
|
456553
456556
|
writeWarning(
|
|
456554
456557
|
config,
|
|
456555
456558
|
"The Build process did not run because no `getConfig` parameter was provided"
|
|
@@ -462821,7 +462824,7 @@ var import_fileutils = require("nx/src/utils/fileutils.js");
|
|
|
462821
462824
|
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
462822
462825
|
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
462823
462826
|
init_src2();
|
|
462824
|
-
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(
|
|
462827
|
+
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRoot());
|
|
462825
462828
|
|
|
462826
462829
|
// packages/workspace-tools/src/utils/get-project-deps.ts
|
|
462827
462830
|
function getExtraDependencies(projectName, graph) {
|
|
@@ -462829,18 +462832,19 @@ function getExtraDependencies(projectName, graph) {
|
|
|
462829
462832
|
recur(projectName);
|
|
462830
462833
|
function recur(currProjectName) {
|
|
462831
462834
|
const allDeps = graph.dependencies[currProjectName];
|
|
462832
|
-
const externalDeps = allDeps
|
|
462833
|
-
const found = graph.externalNodes[node.target];
|
|
462834
|
-
if (found)
|
|
462835
|
+
const externalDeps = allDeps?.reduce((acc, node) => {
|
|
462836
|
+
const found = graph.externalNodes?.[node.target];
|
|
462837
|
+
if (found) {
|
|
462835
462838
|
acc.push(found);
|
|
462839
|
+
}
|
|
462836
462840
|
return acc;
|
|
462837
|
-
}, []);
|
|
462838
|
-
const internalDeps = allDeps
|
|
462841
|
+
}, []) ?? [];
|
|
462842
|
+
const internalDeps = allDeps?.reduce((acc, node) => {
|
|
462839
462843
|
const found = graph.nodes[node.target];
|
|
462840
462844
|
if (found)
|
|
462841
462845
|
acc.push(found);
|
|
462842
462846
|
return acc;
|
|
462843
|
-
}, []);
|
|
462847
|
+
}, []) ?? [];
|
|
462844
462848
|
for (const externalDep of externalDeps) {
|
|
462845
462849
|
deps.set(externalDep.name, {
|
|
462846
462850
|
name: externalDep.name,
|
|
@@ -462856,7 +462860,6 @@ function getExtraDependencies(projectName, graph) {
|
|
|
462856
462860
|
}
|
|
462857
462861
|
|
|
462858
462862
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
462859
|
-
init_src2();
|
|
462860
462863
|
async function tsupExecutorFn(options8, context, config) {
|
|
462861
462864
|
writeInfo(config, "\u{1F4E6} Running Storm build executor on the workspace");
|
|
462862
462865
|
getLogLevel(config?.logLevel) >= LogLevel.TRACE && writeDebug(
|
|
@@ -462872,9 +462875,9 @@ ${Object.keys(options8).map(
|
|
|
462872
462875
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
462873
462876
|
);
|
|
462874
462877
|
}
|
|
462875
|
-
const workspaceRoot =
|
|
462876
|
-
const projectRoot = context.projectsConfigurations.projects[context.projectName]
|
|
462877
|
-
const sourceRoot = context.projectsConfigurations.projects[context.projectName]
|
|
462878
|
+
const workspaceRoot = findWorkspaceRoot();
|
|
462879
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
|
|
462880
|
+
const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
|
|
462878
462881
|
if (options8.clean !== false) {
|
|
462879
462882
|
writeInfo(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
|
|
462880
462883
|
(0, import_fs_extra.removeSync)(options8.outputPath);
|
|
@@ -462929,7 +462932,7 @@ ${Object.keys(options8).map(
|
|
|
462929
462932
|
const externalDependencies = options8.external.reduce(
|
|
462930
462933
|
(ret, name) => {
|
|
462931
462934
|
if (!packageJson?.devDependencies?.[name]) {
|
|
462932
|
-
const externalNode = context.projectGraph
|
|
462935
|
+
const externalNode = context.projectGraph?.externalNodes?.[`npm:${name}`];
|
|
462933
462936
|
if (externalNode) {
|
|
462934
462937
|
ret.push({
|
|
462935
462938
|
name,
|
|
@@ -462942,7 +462945,7 @@ ${Object.keys(options8).map(
|
|
|
462942
462945
|
},
|
|
462943
462946
|
[]
|
|
462944
462947
|
);
|
|
462945
|
-
const implicitDependencies = context.projectsConfigurations.projects[context.projectName]
|
|
462948
|
+
const implicitDependencies = context.projectsConfigurations.projects[context.projectName]?.implicitDependencies;
|
|
462946
462949
|
const internalDependencies = [];
|
|
462947
462950
|
const projectConfigs = await Promise.resolve(getProjectConfigurations());
|
|
462948
462951
|
if (getLogLevel(config?.logLevel) >= LogLevel.TRACE) {
|
|
@@ -462955,7 +462958,7 @@ ${Object.keys(options8).map(
|
|
|
462955
462958
|
const projectConfig = projectConfigs[key2];
|
|
462956
462959
|
if (projectConfig?.targets?.build) {
|
|
462957
462960
|
const projectPackageJson = (0, import_devkit3.readJsonFile)(projectConfig.targets?.build.options.project);
|
|
462958
|
-
if (projectPackageJson?.name && !options8.external
|
|
462961
|
+
if (projectPackageJson?.name && !options8.external?.includes(projectPackageJson.name)) {
|
|
462959
462962
|
ret.push(projectPackageJson.name);
|
|
462960
462963
|
internalDependencies.push(projectPackageJson.name);
|
|
462961
462964
|
}
|
|
@@ -463023,7 +463026,7 @@ ${externalDependencies.map((dep) => {
|
|
|
463023
463026
|
packageJson.dependencies = void 0;
|
|
463024
463027
|
for (const externalDependency of externalDependencies) {
|
|
463025
463028
|
const packageConfig = externalDependency?.node?.data;
|
|
463026
|
-
if (packageConfig?.packageName && !!(projectGraph.externalNodes[externalDependency.node.name]?.type === "npm")) {
|
|
463029
|
+
if (packageConfig?.packageName && !!(projectGraph.externalNodes?.[externalDependency.node.name]?.type === "npm")) {
|
|
463027
463030
|
const { packageName, version } = packageConfig;
|
|
463028
463031
|
if (!workspacePackageJson.dependencies?.[packageName] && !workspacePackageJson.devDependencies?.[packageName] && !packageJson?.devDependencies?.[packageName]) {
|
|
463029
463032
|
packageJson.dependencies ??= {};
|
|
@@ -463071,16 +463074,16 @@ ${externalDependencies.map((dep) => {
|
|
|
463071
463074
|
}
|
|
463072
463075
|
packageJson.exports[`./${formattedEntryPoint}`] = {
|
|
463073
463076
|
import: {
|
|
463074
|
-
types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.ts`,
|
|
463075
|
-
default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.js`
|
|
463077
|
+
types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.ts`,
|
|
463078
|
+
default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.js`
|
|
463076
463079
|
},
|
|
463077
463080
|
require: {
|
|
463078
|
-
types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.cts`,
|
|
463079
|
-
default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.cjs`
|
|
463081
|
+
types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.cts`,
|
|
463082
|
+
default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.cjs`
|
|
463080
463083
|
},
|
|
463081
463084
|
default: {
|
|
463082
|
-
types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.ts`,
|
|
463083
|
-
default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.js`
|
|
463085
|
+
types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.ts`,
|
|
463086
|
+
default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.js`
|
|
463084
463087
|
}
|
|
463085
463088
|
};
|
|
463086
463089
|
}
|
|
@@ -463130,10 +463133,10 @@ ${externalDependencies.map((dep) => {
|
|
|
463130
463133
|
}
|
|
463131
463134
|
if (options8.includeSrc === true) {
|
|
463132
463135
|
const files = globSync([
|
|
463133
|
-
(0, import_devkit3.joinPathFragments)(
|
|
463134
|
-
(0, import_devkit3.joinPathFragments)(
|
|
463135
|
-
(0, import_devkit3.joinPathFragments)(
|
|
463136
|
-
(0, import_devkit3.joinPathFragments)(
|
|
463136
|
+
(0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.ts"),
|
|
463137
|
+
(0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.tsx"),
|
|
463138
|
+
(0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.js"),
|
|
463139
|
+
(0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.jsx")
|
|
463137
463140
|
]);
|
|
463138
463141
|
await Promise.allSettled(
|
|
463139
463142
|
files.map(
|
|
@@ -463153,10 +463156,11 @@ ${(0, import_node_fs3.readFileSync)(file, "utf-8")}`,
|
|
|
463153
463156
|
{
|
|
463154
463157
|
main: entryPoint,
|
|
463155
463158
|
projectRoot,
|
|
463159
|
+
// biome-ignore lint/style/noNonNullAssertion: <explanation>
|
|
463156
463160
|
projectName: context.projectName,
|
|
463157
463161
|
sourceRoot
|
|
463158
463162
|
},
|
|
463159
|
-
config,
|
|
463163
|
+
config ?? {},
|
|
463160
463164
|
options8
|
|
463161
463165
|
)
|
|
463162
463166
|
)
|
|
@@ -215471,7 +215471,7 @@ var init_get_log_level = __esm({
|
|
|
215471
215471
|
return LogLevel.INFO;
|
|
215472
215472
|
}
|
|
215473
215473
|
};
|
|
215474
|
-
getLogLevelLabel = (logLevel) => {
|
|
215474
|
+
getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
215475
215475
|
if (logLevel >= LogLevel.ALL) {
|
|
215476
215476
|
return LogLevelLabel.ALL;
|
|
215477
215477
|
}
|
|
@@ -215797,14 +215797,14 @@ var init_set_env = __esm({
|
|
|
215797
215797
|
if (extension[key]) {
|
|
215798
215798
|
const result = key?.replace(
|
|
215799
215799
|
/([A-Z])+/g,
|
|
215800
|
-
(input) => input ? input[0]
|
|
215800
|
+
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
215801
215801
|
).split(/(?=[A-Z])|[\.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
215802
215802
|
let extensionKey;
|
|
215803
215803
|
if (result.length === 0) {
|
|
215804
215804
|
return;
|
|
215805
215805
|
}
|
|
215806
215806
|
if (result.length === 1) {
|
|
215807
|
-
extensionKey = result[0]
|
|
215807
|
+
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
215808
215808
|
} else {
|
|
215809
215809
|
extensionKey = result.reduce((ret, part) => {
|
|
215810
215810
|
return `${ret}_${part.toLowerCase()}`;
|
|
@@ -238972,9 +238972,13 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
|
238972
238972
|
sourceRoot = context.sourceRoot;
|
|
238973
238973
|
} else {
|
|
238974
238974
|
const projectConfig = tokenizerOptions;
|
|
238975
|
-
projectName = projectConfig.name;
|
|
238976
238975
|
projectRoot = projectConfig.root;
|
|
238977
|
-
|
|
238976
|
+
if (projectConfig.name) {
|
|
238977
|
+
projectName = projectConfig.name;
|
|
238978
|
+
}
|
|
238979
|
+
if (projectConfig.sourceRoot) {
|
|
238980
|
+
sourceRoot = projectConfig.sourceRoot;
|
|
238981
|
+
}
|
|
238978
238982
|
}
|
|
238979
238983
|
if (tokenizerOptions.config) {
|
|
238980
238984
|
const configKeys = Object.keys(tokenizerOptions.config);
|
|
@@ -238998,7 +239002,7 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
|
238998
239002
|
if (result.includes("{workspaceRoot}")) {
|
|
238999
239003
|
result = result.replaceAll(
|
|
239000
239004
|
"{workspaceRoot}",
|
|
239001
|
-
tokenizerOptions.workspaceRoot ??
|
|
239005
|
+
tokenizerOptions.workspaceRoot ?? findWorkspaceRoot()
|
|
239002
239006
|
);
|
|
239003
239007
|
}
|
|
239004
239008
|
return result;
|
|
@@ -239023,7 +239027,6 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
|
|
|
239023
239027
|
};
|
|
239024
239028
|
|
|
239025
239029
|
// packages/workspace-tools/src/base/base-executor.ts
|
|
239026
|
-
init_src2();
|
|
239027
239030
|
var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
|
|
239028
239031
|
const stopwatch = getStopwatch(name);
|
|
239029
239032
|
let options = _options;
|
|
@@ -239036,10 +239039,10 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
|
|
|
239036
239039
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
239037
239040
|
);
|
|
239038
239041
|
}
|
|
239039
|
-
const workspaceRoot =
|
|
239040
|
-
const projectRoot = context.projectsConfigurations.projects[context.projectName]
|
|
239041
|
-
const sourceRoot = context.projectsConfigurations.projects[context.projectName]
|
|
239042
|
-
const projectName = context.projectsConfigurations.projects[context.projectName].
|
|
239042
|
+
const workspaceRoot = findWorkspaceRoot();
|
|
239043
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
|
|
239044
|
+
const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
|
|
239045
|
+
const projectName = context.projectsConfigurations.projects[context.projectName]?.name ?? context.projectName;
|
|
239043
239046
|
if (!executorOptions.skipReadingConfig) {
|
|
239044
239047
|
const { loadStormConfig: loadStormConfig2 } = await Promise.resolve().then(() => (init_src2(), src_exports));
|
|
239045
239048
|
writeDebug(
|
|
@@ -385842,7 +385842,7 @@ var init_get_log_level = __esm({
|
|
|
385842
385842
|
return LogLevel.INFO;
|
|
385843
385843
|
}
|
|
385844
385844
|
};
|
|
385845
|
-
getLogLevelLabel = (logLevel) => {
|
|
385845
|
+
getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
385846
385846
|
if (logLevel >= LogLevel.ALL) {
|
|
385847
385847
|
return LogLevelLabel.ALL;
|
|
385848
385848
|
}
|
|
@@ -386168,14 +386168,14 @@ var init_set_env = __esm({
|
|
|
386168
386168
|
if (extension[key2]) {
|
|
386169
386169
|
const result = key2?.replace(
|
|
386170
386170
|
/([A-Z])+/g,
|
|
386171
|
-
(input) => input ? input[0]
|
|
386171
|
+
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
386172
386172
|
).split(/(?=[A-Z])|[\.\-\s_]/).map((x5) => x5.toLowerCase()) ?? [];
|
|
386173
386173
|
let extensionKey;
|
|
386174
386174
|
if (result.length === 0) {
|
|
386175
386175
|
return;
|
|
386176
386176
|
}
|
|
386177
386177
|
if (result.length === 1) {
|
|
386178
|
-
extensionKey = result[0]
|
|
386178
|
+
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
386179
386179
|
} else {
|
|
386180
386180
|
extensionKey = result.reduce((ret, part) => {
|
|
386181
386181
|
return `${ret}_${part.toLowerCase()}`;
|
|
@@ -400841,7 +400841,7 @@ var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
|
400841
400841
|
if (result.includes("{workspaceRoot}")) {
|
|
400842
400842
|
result = result.replaceAll(
|
|
400843
400843
|
"{workspaceRoot}",
|
|
400844
|
-
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config
|
|
400844
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
|
|
400845
400845
|
);
|
|
400846
400846
|
}
|
|
400847
400847
|
return result;
|
|
@@ -400902,7 +400902,7 @@ ${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.en
|
|
|
400902
400902
|
writeTrace(
|
|
400903
400903
|
config,
|
|
400904
400904
|
`Generator schema options \u2699\uFE0F
|
|
400905
|
-
${Object.keys(options8).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
400905
|
+
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
400906
400906
|
);
|
|
400907
400907
|
const tokenized = applyWorkspaceTokens(
|
|
400908
400908
|
options8,
|
|
@@ -400987,7 +400987,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema2) {
|
|
|
400987
400987
|
const projectConfig = {
|
|
400988
400988
|
root: options8.directory,
|
|
400989
400989
|
projectType: "library",
|
|
400990
|
-
sourceRoot: (0, import_devkit.joinPathFragments)(options8.directory, "src"),
|
|
400990
|
+
sourceRoot: (0, import_devkit.joinPathFragments)(options8.directory ?? "", "src"),
|
|
400991
400991
|
targets: {
|
|
400992
400992
|
build: {
|
|
400993
400993
|
executor: schema2.buildExecutor,
|
|
@@ -401026,7 +401026,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema2) {
|
|
|
401026
401026
|
test: {}
|
|
401027
401027
|
}
|
|
401028
401028
|
};
|
|
401029
|
-
if (schema2.platform) {
|
|
401029
|
+
if (schema2.platform && projectConfig?.targets?.build) {
|
|
401030
401030
|
projectConfig.targets.build.options.platform = schema2.platform;
|
|
401031
401031
|
}
|
|
401032
401032
|
createProjectTsConfigJson(tree, options8);
|
|
@@ -401045,9 +401045,15 @@ async function typeScriptLibraryGeneratorFn(tree, schema2) {
|
|
|
401045
401045
|
description = packageJson.description;
|
|
401046
401046
|
}
|
|
401047
401047
|
}
|
|
401048
|
+
if (!options8.importPath) {
|
|
401049
|
+
options8.importPath = options8.name;
|
|
401050
|
+
}
|
|
401048
401051
|
const packageJsonPath = (0, import_devkit.joinPathFragments)(options8.projectRoot, "package.json");
|
|
401049
401052
|
if (tree.exists(packageJsonPath)) {
|
|
401050
401053
|
(0, import_devkit.updateJson)(tree, packageJsonPath, (json2) => {
|
|
401054
|
+
if (!options8.importPath) {
|
|
401055
|
+
options8.importPath = options8.name;
|
|
401056
|
+
}
|
|
401051
401057
|
json2.name = options8.importPath;
|
|
401052
401058
|
json2.version = "0.0.1";
|
|
401053
401059
|
if (json2.private && (options8.publishable || options8.rootProject)) {
|
|
@@ -401086,14 +401092,14 @@ async function typeScriptLibraryGeneratorFn(tree, schema2) {
|
|
|
401086
401092
|
}
|
|
401087
401093
|
});
|
|
401088
401094
|
}
|
|
401089
|
-
if (tree.exists("package.json")) {
|
|
401095
|
+
if (tree.exists("package.json") && options8.importPath) {
|
|
401090
401096
|
(0, import_devkit.updateJson)(tree, "package.json", (json2) => ({
|
|
401091
401097
|
...json2,
|
|
401092
401098
|
pnpm: {
|
|
401093
401099
|
...json2?.pnpm,
|
|
401094
401100
|
overrides: {
|
|
401095
401101
|
...json2?.pnpm?.overrides,
|
|
401096
|
-
[options8.importPath]: "workspace:*"
|
|
401102
|
+
[options8.importPath ?? ""]: "workspace:*"
|
|
401097
401103
|
}
|
|
401098
401104
|
}
|
|
401099
401105
|
}));
|
|
@@ -401192,7 +401198,7 @@ async function addLint(tree, options8) {
|
|
|
401192
401198
|
ruleSeverity = value[0];
|
|
401193
401199
|
ruleOptions = value[1];
|
|
401194
401200
|
} else {
|
|
401195
|
-
ruleSeverity = value;
|
|
401201
|
+
ruleSeverity = value ?? "error";
|
|
401196
401202
|
ruleOptions = {};
|
|
401197
401203
|
}
|
|
401198
401204
|
if (options8.bundler === "esbuild") {
|
|
@@ -385842,7 +385842,7 @@ var init_get_log_level = __esm({
|
|
|
385842
385842
|
return LogLevel.INFO;
|
|
385843
385843
|
}
|
|
385844
385844
|
};
|
|
385845
|
-
getLogLevelLabel = (logLevel) => {
|
|
385845
|
+
getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
385846
385846
|
if (logLevel >= LogLevel.ALL) {
|
|
385847
385847
|
return LogLevelLabel.ALL;
|
|
385848
385848
|
}
|
|
@@ -386168,14 +386168,14 @@ var init_set_env = __esm({
|
|
|
386168
386168
|
if (extension[key2]) {
|
|
386169
386169
|
const result = key2?.replace(
|
|
386170
386170
|
/([A-Z])+/g,
|
|
386171
|
-
(input) => input ? input[0]
|
|
386171
|
+
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
386172
386172
|
).split(/(?=[A-Z])|[\.\-\s_]/).map((x5) => x5.toLowerCase()) ?? [];
|
|
386173
386173
|
let extensionKey;
|
|
386174
386174
|
if (result.length === 0) {
|
|
386175
386175
|
return;
|
|
386176
386176
|
}
|
|
386177
386177
|
if (result.length === 1) {
|
|
386178
|
-
extensionKey = result[0]
|
|
386178
|
+
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
386179
386179
|
} else {
|
|
386180
386180
|
extensionKey = result.reduce((ret, part) => {
|
|
386181
386181
|
return `${ret}_${part.toLowerCase()}`;
|
|
@@ -387499,7 +387499,7 @@ var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
|
387499
387499
|
if (result.includes("{workspaceRoot}")) {
|
|
387500
387500
|
result = result.replaceAll(
|
|
387501
387501
|
"{workspaceRoot}",
|
|
387502
|
-
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config
|
|
387502
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
|
|
387503
387503
|
);
|
|
387504
387504
|
}
|
|
387505
387505
|
return result;
|
|
@@ -387560,7 +387560,7 @@ ${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.en
|
|
|
387560
387560
|
writeTrace(
|
|
387561
387561
|
config,
|
|
387562
387562
|
`Generator schema options \u2699\uFE0F
|
|
387563
|
-
${Object.keys(options8).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
387563
|
+
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
387564
387564
|
);
|
|
387565
387565
|
const tokenized = applyWorkspaceTokens(
|
|
387566
387566
|
options8,
|
|
@@ -387611,15 +387611,17 @@ ${Object.keys(options8).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2
|
|
|
387611
387611
|
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
387612
387612
|
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
387613
387613
|
init_src2();
|
|
387614
|
-
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(
|
|
387614
|
+
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRoot());
|
|
387615
387615
|
|
|
387616
387616
|
// packages/workspace-tools/src/generators/config-schema/generator.ts
|
|
387617
|
+
init_src2();
|
|
387617
387618
|
async function configSchemaGeneratorFn(tree, options8, config) {
|
|
387618
387619
|
const projectConfigurations = getProjectConfigurations();
|
|
387620
|
+
const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
|
|
387619
387621
|
const modules = await Promise.all(
|
|
387620
387622
|
Object.keys(projectConfigurations).map(async (key2) => {
|
|
387621
387623
|
if (projectConfigurations[key2]?.config) {
|
|
387622
|
-
const configPath = (0, import_node_path4.join)(
|
|
387624
|
+
const configPath = (0, import_node_path4.join)(workspaceRoot, projectConfigurations[key2].config);
|
|
387623
387625
|
if ((0, import_node_fs3.existsSync)(configPath)) {
|
|
387624
387626
|
const mod = await import(configPath);
|
|
387625
387627
|
if (mod.default) {
|
|
@@ -387645,7 +387647,7 @@ async function configSchemaGeneratorFn(tree, options8, config) {
|
|
|
387645
387647
|
);
|
|
387646
387648
|
(0, import_devkit.writeJson)(
|
|
387647
387649
|
tree,
|
|
387648
|
-
options8.outputFile ? (0, import_node_path4.join)(
|
|
387650
|
+
options8.outputFile ? (0, import_node_path4.join)(workspaceRoot, options8.outputFile) : (0, import_node_path4.join)(workspaceRoot, "storm.schema.json"),
|
|
387649
387651
|
zodToJsonSchema(ModulesSchema, "StormConfig")
|
|
387650
387652
|
);
|
|
387651
387653
|
await (0, import_devkit.formatFiles)(tree);
|
|
@@ -385842,7 +385842,7 @@ var init_get_log_level = __esm({
|
|
|
385842
385842
|
return LogLevel.INFO;
|
|
385843
385843
|
}
|
|
385844
385844
|
};
|
|
385845
|
-
getLogLevelLabel = (logLevel) => {
|
|
385845
|
+
getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
385846
385846
|
if (logLevel >= LogLevel.ALL) {
|
|
385847
385847
|
return LogLevelLabel.ALL;
|
|
385848
385848
|
}
|
|
@@ -386168,14 +386168,14 @@ var init_set_env = __esm({
|
|
|
386168
386168
|
if (extension[key2]) {
|
|
386169
386169
|
const result = key2?.replace(
|
|
386170
386170
|
/([A-Z])+/g,
|
|
386171
|
-
(input) => input ? input[0]
|
|
386171
|
+
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
386172
386172
|
).split(/(?=[A-Z])|[\.\-\s_]/).map((x5) => x5.toLowerCase()) ?? [];
|
|
386173
386173
|
let extensionKey;
|
|
386174
386174
|
if (result.length === 0) {
|
|
386175
386175
|
return;
|
|
386176
386176
|
}
|
|
386177
386177
|
if (result.length === 1) {
|
|
386178
|
-
extensionKey = result[0]
|
|
386178
|
+
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
386179
386179
|
} else {
|
|
386180
386180
|
extensionKey = result.reduce((ret, part) => {
|
|
386181
386181
|
return `${ret}_${part.toLowerCase()}`;
|
|
@@ -400841,7 +400841,7 @@ var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
|
|
|
400841
400841
|
if (result.includes("{workspaceRoot}")) {
|
|
400842
400842
|
result = result.replaceAll(
|
|
400843
400843
|
"{workspaceRoot}",
|
|
400844
|
-
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config
|
|
400844
|
+
tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
|
|
400845
400845
|
);
|
|
400846
400846
|
}
|
|
400847
400847
|
return result;
|
|
@@ -400902,7 +400902,7 @@ ${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.en
|
|
|
400902
400902
|
writeTrace(
|
|
400903
400903
|
config,
|
|
400904
400904
|
`Generator schema options \u2699\uFE0F
|
|
400905
|
-
${Object.keys(options8).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
400905
|
+
${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
|
|
400906
400906
|
);
|
|
400907
400907
|
const tokenized = applyWorkspaceTokens(
|
|
400908
400908
|
options8,
|
|
@@ -400987,7 +400987,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema2) {
|
|
|
400987
400987
|
const projectConfig = {
|
|
400988
400988
|
root: options8.directory,
|
|
400989
400989
|
projectType: "library",
|
|
400990
|
-
sourceRoot: (0, import_devkit.joinPathFragments)(options8.directory, "src"),
|
|
400990
|
+
sourceRoot: (0, import_devkit.joinPathFragments)(options8.directory ?? "", "src"),
|
|
400991
400991
|
targets: {
|
|
400992
400992
|
build: {
|
|
400993
400993
|
executor: schema2.buildExecutor,
|
|
@@ -401026,7 +401026,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema2) {
|
|
|
401026
401026
|
test: {}
|
|
401027
401027
|
}
|
|
401028
401028
|
};
|
|
401029
|
-
if (schema2.platform) {
|
|
401029
|
+
if (schema2.platform && projectConfig?.targets?.build) {
|
|
401030
401030
|
projectConfig.targets.build.options.platform = schema2.platform;
|
|
401031
401031
|
}
|
|
401032
401032
|
createProjectTsConfigJson(tree, options8);
|
|
@@ -401045,9 +401045,15 @@ async function typeScriptLibraryGeneratorFn(tree, schema2) {
|
|
|
401045
401045
|
description = packageJson.description;
|
|
401046
401046
|
}
|
|
401047
401047
|
}
|
|
401048
|
+
if (!options8.importPath) {
|
|
401049
|
+
options8.importPath = options8.name;
|
|
401050
|
+
}
|
|
401048
401051
|
const packageJsonPath = (0, import_devkit.joinPathFragments)(options8.projectRoot, "package.json");
|
|
401049
401052
|
if (tree.exists(packageJsonPath)) {
|
|
401050
401053
|
(0, import_devkit.updateJson)(tree, packageJsonPath, (json2) => {
|
|
401054
|
+
if (!options8.importPath) {
|
|
401055
|
+
options8.importPath = options8.name;
|
|
401056
|
+
}
|
|
401051
401057
|
json2.name = options8.importPath;
|
|
401052
401058
|
json2.version = "0.0.1";
|
|
401053
401059
|
if (json2.private && (options8.publishable || options8.rootProject)) {
|
|
@@ -401086,14 +401092,14 @@ async function typeScriptLibraryGeneratorFn(tree, schema2) {
|
|
|
401086
401092
|
}
|
|
401087
401093
|
});
|
|
401088
401094
|
}
|
|
401089
|
-
if (tree.exists("package.json")) {
|
|
401095
|
+
if (tree.exists("package.json") && options8.importPath) {
|
|
401090
401096
|
(0, import_devkit.updateJson)(tree, "package.json", (json2) => ({
|
|
401091
401097
|
...json2,
|
|
401092
401098
|
pnpm: {
|
|
401093
401099
|
...json2?.pnpm,
|
|
401094
401100
|
overrides: {
|
|
401095
401101
|
...json2?.pnpm?.overrides,
|
|
401096
|
-
[options8.importPath]: "workspace:*"
|
|
401102
|
+
[options8.importPath ?? ""]: "workspace:*"
|
|
401097
401103
|
}
|
|
401098
401104
|
}
|
|
401099
401105
|
}));
|
|
@@ -401192,7 +401198,7 @@ async function addLint(tree, options8) {
|
|
|
401192
401198
|
ruleSeverity = value[0];
|
|
401193
401199
|
ruleOptions = value[1];
|
|
401194
401200
|
} else {
|
|
401195
|
-
ruleSeverity = value;
|
|
401201
|
+
ruleSeverity = value ?? "error";
|
|
401196
401202
|
ruleOptions = {};
|
|
401197
401203
|
}
|
|
401198
401204
|
if (options8.bundler === "esbuild") {
|