@storm-software/workspace-tools 1.62.6 → 1.62.8
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 +1 -1
- package/index.js +111 -84
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +54 -37
- package/src/executors/tsup/executor.js +75 -57
- package/src/executors/tsup-browser/executor.js +75 -57
- package/src/executors/tsup-neutral/executor.js +75 -57
- package/src/executors/tsup-node/executor.js +75 -57
- package/src/executors/typia/executor.js +29 -21
- package/src/generators/browser-library/generator.js +27 -20
- package/src/generators/config-schema/generator.js +31 -24
- package/src/generators/neutral-library/generator.js +27 -20
- package/src/generators/node-library/generator.js +27 -20
- package/src/generators/preset/generator.js +27 -20
- package/src/generators/release-version/generator.js +32 -25
- package/src/utils/index.js +24 -23
|
@@ -4479,20 +4479,20 @@ var require_typescript = __commonJS({
|
|
|
4479
4479
|
})();
|
|
4480
4480
|
}
|
|
4481
4481
|
});
|
|
4482
|
-
var
|
|
4482
|
+
var LogLevel, Debug;
|
|
4483
4483
|
var init_debug = __esm2({
|
|
4484
4484
|
"src/compiler/debug.ts"() {
|
|
4485
4485
|
"use strict";
|
|
4486
4486
|
init_ts2();
|
|
4487
4487
|
init_ts2();
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
return
|
|
4495
|
-
})(
|
|
4488
|
+
LogLevel = /* @__PURE__ */ ((LogLevel3) => {
|
|
4489
|
+
LogLevel3[LogLevel3["Off"] = 0] = "Off";
|
|
4490
|
+
LogLevel3[LogLevel3["Error"] = 1] = "Error";
|
|
4491
|
+
LogLevel3[LogLevel3["Warning"] = 2] = "Warning";
|
|
4492
|
+
LogLevel3[LogLevel3["Info"] = 3] = "Info";
|
|
4493
|
+
LogLevel3[LogLevel3["Verbose"] = 4] = "Verbose";
|
|
4494
|
+
return LogLevel3;
|
|
4495
|
+
})(LogLevel || {});
|
|
4496
4496
|
((Debug2) => {
|
|
4497
4497
|
let currentAssertionLevel = 0;
|
|
4498
4498
|
Debug2.currentLogLevel = 2;
|
|
@@ -187061,12 +187061,12 @@ ${options8.prefix}` : "\n" : options8.prefix
|
|
|
187061
187061
|
"src/server/utilitiesPublic.ts"() {
|
|
187062
187062
|
"use strict";
|
|
187063
187063
|
init_ts7();
|
|
187064
|
-
LogLevel22 = /* @__PURE__ */ ((
|
|
187065
|
-
|
|
187066
|
-
|
|
187067
|
-
|
|
187068
|
-
|
|
187069
|
-
return
|
|
187064
|
+
LogLevel22 = /* @__PURE__ */ ((LogLevel3) => {
|
|
187065
|
+
LogLevel3[LogLevel3["terse"] = 0] = "terse";
|
|
187066
|
+
LogLevel3[LogLevel3["normal"] = 1] = "normal";
|
|
187067
|
+
LogLevel3[LogLevel3["requestTime"] = 2] = "requestTime";
|
|
187068
|
+
LogLevel3[LogLevel3["verbose"] = 3] = "verbose";
|
|
187069
|
+
return LogLevel3;
|
|
187070
187070
|
})(LogLevel22 || {});
|
|
187071
187071
|
emptyArray22 = createSortedArray22();
|
|
187072
187072
|
Msg2 = /* @__PURE__ */ ((Msg22) => {
|
|
@@ -198597,7 +198597,7 @@ ${e3.message}`;
|
|
|
198597
198597
|
LanguageVariant: () => LanguageVariant,
|
|
198598
198598
|
LexicalEnvironmentFlags: () => LexicalEnvironmentFlags,
|
|
198599
198599
|
ListFormat: () => ListFormat,
|
|
198600
|
-
LogLevel: () =>
|
|
198600
|
+
LogLevel: () => LogLevel,
|
|
198601
198601
|
MemberOverrideStatus: () => MemberOverrideStatus,
|
|
198602
198602
|
ModifierFlags: () => ModifierFlags,
|
|
198603
198603
|
ModuleDetectionKind: () => ModuleDetectionKind,
|
|
@@ -201001,7 +201001,7 @@ ${e3.message}`;
|
|
|
201001
201001
|
LanguageVariant: () => LanguageVariant,
|
|
201002
201002
|
LexicalEnvironmentFlags: () => LexicalEnvironmentFlags,
|
|
201003
201003
|
ListFormat: () => ListFormat,
|
|
201004
|
-
LogLevel: () =>
|
|
201004
|
+
LogLevel: () => LogLevel,
|
|
201005
201005
|
MemberOverrideStatus: () => MemberOverrideStatus,
|
|
201006
201006
|
ModifierFlags: () => ModifierFlags,
|
|
201007
201007
|
ModuleDetectionKind: () => ModuleDetectionKind,
|
|
@@ -448946,9 +448946,6 @@ __export(executor_exports, {
|
|
|
448946
448946
|
});
|
|
448947
448947
|
module.exports = __toCommonJS(executor_exports);
|
|
448948
448948
|
|
|
448949
|
-
// packages/workspace-tools/src/base/base-executor.ts
|
|
448950
|
-
var import_config_tools2 = require("@storm-software/config-tools");
|
|
448951
|
-
|
|
448952
448949
|
// packages/workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
448953
448950
|
var import_config_tools = require("@storm-software/config-tools");
|
|
448954
448951
|
var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
|
|
@@ -449022,23 +449019,34 @@ var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
|
|
|
449022
449019
|
|
|
449023
449020
|
// packages/workspace-tools/src/base/base-executor.ts
|
|
449024
449021
|
var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
|
|
449025
|
-
const
|
|
449022
|
+
const {
|
|
449023
|
+
getStopwatch,
|
|
449024
|
+
writeDebug,
|
|
449025
|
+
writeError,
|
|
449026
|
+
writeFatal,
|
|
449027
|
+
writeInfo,
|
|
449028
|
+
writeSuccess,
|
|
449029
|
+
writeTrace,
|
|
449030
|
+
findWorkspaceRoot: findWorkspaceRoot3,
|
|
449031
|
+
loadStormConfig
|
|
449032
|
+
} = await import("@storm-software/config-tools");
|
|
449033
|
+
const stopwatch = getStopwatch(name);
|
|
449026
449034
|
let options8 = _options;
|
|
449027
449035
|
let config;
|
|
449028
449036
|
try {
|
|
449029
|
-
|
|
449037
|
+
writeInfo(config, `\u26A1 Running the ${name} executor...
|
|
449030
449038
|
`);
|
|
449031
449039
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
449032
449040
|
throw new Error(
|
|
449033
449041
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
449034
449042
|
);
|
|
449035
449043
|
}
|
|
449036
|
-
const workspaceRoot = (
|
|
449044
|
+
const workspaceRoot = findWorkspaceRoot3();
|
|
449037
449045
|
const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
|
|
449038
449046
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
|
|
449039
449047
|
const projectName = context.projectsConfigurations.projects[context.projectName]?.name ?? context.projectName;
|
|
449040
449048
|
if (!executorOptions.skipReadingConfig) {
|
|
449041
|
-
|
|
449049
|
+
writeDebug(
|
|
449042
449050
|
config,
|
|
449043
449051
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
449044
449052
|
- workspaceRoot: ${workspaceRoot}
|
|
@@ -449047,8 +449055,8 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
|
|
|
449047
449055
|
- projectName: ${projectName}
|
|
449048
449056
|
`
|
|
449049
449057
|
);
|
|
449050
|
-
config = await
|
|
449051
|
-
|
|
449058
|
+
config = await loadStormConfig(workspaceRoot);
|
|
449059
|
+
writeTrace(
|
|
449052
449060
|
config,
|
|
449053
449061
|
`Loaded Storm config into env:
|
|
449054
449062
|
${Object.keys(process.env).filter((key2) => key2.startsWith("STORM_")).map(
|
|
@@ -449057,11 +449065,11 @@ ${Object.keys(process.env).filter((key2) => key2.startsWith("STORM_")).map(
|
|
|
449057
449065
|
);
|
|
449058
449066
|
}
|
|
449059
449067
|
if (executorOptions?.hooks?.applyDefaultOptions) {
|
|
449060
|
-
|
|
449068
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
449061
449069
|
options8 = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options8, config));
|
|
449062
|
-
|
|
449070
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
449063
449071
|
}
|
|
449064
|
-
|
|
449072
|
+
writeTrace(
|
|
449065
449073
|
config,
|
|
449066
449074
|
`Executor schema options \u2699\uFE0F
|
|
449067
449075
|
${Object.keys(options8).map(
|
|
@@ -449082,9 +449090,9 @@ ${Object.keys(options8).map(
|
|
|
449082
449090
|
applyWorkspaceExecutorTokens
|
|
449083
449091
|
);
|
|
449084
449092
|
if (executorOptions?.hooks?.preProcess) {
|
|
449085
|
-
|
|
449093
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
449086
449094
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
449087
|
-
|
|
449095
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
449088
449096
|
}
|
|
449089
449097
|
const result = await Promise.resolve(executorFn(tokenized, context, config));
|
|
449090
449098
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -449093,21 +449101,21 @@ ${Object.keys(options8).map(
|
|
|
449093
449101
|
});
|
|
449094
449102
|
}
|
|
449095
449103
|
if (executorOptions?.hooks?.postProcess) {
|
|
449096
|
-
|
|
449104
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
449097
449105
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
449098
|
-
|
|
449106
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
449099
449107
|
}
|
|
449100
|
-
|
|
449108
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
449101
449109
|
`);
|
|
449102
449110
|
return {
|
|
449103
449111
|
success: true
|
|
449104
449112
|
};
|
|
449105
449113
|
} catch (error) {
|
|
449106
|
-
|
|
449114
|
+
writeFatal(
|
|
449107
449115
|
config,
|
|
449108
449116
|
"A fatal error occurred while running the executor - the process was forced to terminate"
|
|
449109
449117
|
);
|
|
449110
|
-
|
|
449118
|
+
writeError(
|
|
449111
449119
|
config,
|
|
449112
449120
|
`An exception was thrown in the executor's process
|
|
449113
449121
|
- Details: ${error.message}
|
|
@@ -449164,7 +449172,6 @@ var import_esbuild_decorators = __toESM(require_src());
|
|
|
449164
449172
|
var import_devkit2 = __toESM(require_devkit());
|
|
449165
449173
|
var import_get_custom_transformers_factory = __toESM(require_get_custom_transformers_factory());
|
|
449166
449174
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
449167
|
-
var import_config_tools3 = require("@storm-software/config-tools");
|
|
449168
449175
|
|
|
449169
449176
|
// node_modules/.pnpm/esbuild-plugin-define@0.4.0_esbuild@0.19.12/node_modules/esbuild-plugin-define/dist/mjs/utils.js
|
|
449170
449177
|
var makeKey = (...inputs) => inputs.filter((input) => !!input).join(".");
|
|
@@ -449365,7 +449372,8 @@ var applyDefaultOptions = (options8) => {
|
|
|
449365
449372
|
return options8;
|
|
449366
449373
|
};
|
|
449367
449374
|
var runTsupBuild = async (context, config, options8) => {
|
|
449368
|
-
const
|
|
449375
|
+
const { LogLevel, getLogLevel, writeInfo, writeWarning, findWorkspaceRoot: findWorkspaceRoot3 } = await import("@storm-software/config-tools");
|
|
449376
|
+
const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot3();
|
|
449369
449377
|
const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
|
|
449370
449378
|
ret[key2] = options8.env?.[key2];
|
|
449371
449379
|
return ret;
|
|
@@ -449424,7 +449432,7 @@ ${options8.banner}
|
|
|
449424
449432
|
outputPath: options8.outputPath
|
|
449425
449433
|
};
|
|
449426
449434
|
if (options8.getConfig) {
|
|
449427
|
-
|
|
449435
|
+
writeInfo(config, "\u26A1 Running the Build process");
|
|
449428
449436
|
const getConfigFns = [options8.getConfig];
|
|
449429
449437
|
const tsupConfig = (0, import_tsup.defineConfig)(
|
|
449430
449438
|
getConfigFns.map(
|
|
@@ -449437,8 +449445,8 @@ ${options8.banner}
|
|
|
449437
449445
|
} else {
|
|
449438
449446
|
await build(tsupConfig, config);
|
|
449439
449447
|
}
|
|
449440
|
-
} else if (
|
|
449441
|
-
|
|
449448
|
+
} else if (getLogLevel(config?.logLevel ?? "debug") >= LogLevel.WARN) {
|
|
449449
|
+
writeWarning(
|
|
449442
449450
|
config,
|
|
449443
449451
|
"The Build process did not run because no `getConfig` parameter was provided"
|
|
449444
449452
|
);
|
|
@@ -449473,6 +449481,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options8) {
|
|
|
449473
449481
|
return tsConfig;
|
|
449474
449482
|
}
|
|
449475
449483
|
var build = async (options8, config) => {
|
|
449484
|
+
const { writeDebug } = await import("@storm-software/config-tools");
|
|
449476
449485
|
if (Array.isArray(options8)) {
|
|
449477
449486
|
await Promise.all(options8.map((buildOptions) => build(buildOptions, config)));
|
|
449478
449487
|
} else {
|
|
@@ -449480,7 +449489,7 @@ var build = async (options8, config) => {
|
|
|
449480
449489
|
if (_isFunction2(tsupOptions)) {
|
|
449481
449490
|
tsupOptions = await Promise.resolve(tsupOptions({}));
|
|
449482
449491
|
}
|
|
449483
|
-
|
|
449492
|
+
writeDebug(
|
|
449484
449493
|
config,
|
|
449485
449494
|
`\u2699\uFE0F Tsup Build options:
|
|
449486
449495
|
${!_isFunction2(tsupOptions) ? Object.keys(tsupOptions).map(
|
|
@@ -449522,7 +449531,6 @@ var createTypeScriptCompilationOptions = (normalizedOptions, projectName) => {
|
|
|
449522
449531
|
var import_node_fs = require("node:fs");
|
|
449523
449532
|
var import_devkit3 = __toESM(require_devkit());
|
|
449524
449533
|
var import_js = __toESM(require_src6());
|
|
449525
|
-
var import_config_tools5 = require("@storm-software/config-tools");
|
|
449526
449534
|
var import_fs_extra = __toESM(require_lib5());
|
|
449527
449535
|
|
|
449528
449536
|
// node_modules/.pnpm/minimatch@9.0.3/node_modules/minimatch/dist/mjs/index.js
|
|
@@ -455704,8 +455712,8 @@ var import_fileutils = require("nx/src/utils/fileutils.js");
|
|
|
455704
455712
|
|
|
455705
455713
|
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
455706
455714
|
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
455707
|
-
var
|
|
455708
|
-
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)((0,
|
|
455715
|
+
var import_config_tools2 = require("@storm-software/config-tools");
|
|
455716
|
+
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)((0, import_config_tools2.findWorkspaceRoot)());
|
|
455709
455717
|
|
|
455710
455718
|
// packages/workspace-tools/src/utils/get-project-deps.ts
|
|
455711
455719
|
function getExtraDependencies(projectName, graph) {
|
|
@@ -455742,8 +455750,18 @@ function getExtraDependencies(projectName, graph) {
|
|
|
455742
455750
|
|
|
455743
455751
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
455744
455752
|
async function tsupExecutorFn(options8, context, config) {
|
|
455745
|
-
|
|
455746
|
-
|
|
455753
|
+
const {
|
|
455754
|
+
LogLevel,
|
|
455755
|
+
getLogLevel,
|
|
455756
|
+
writeDebug,
|
|
455757
|
+
writeInfo,
|
|
455758
|
+
writeSuccess,
|
|
455759
|
+
writeTrace,
|
|
455760
|
+
writeWarning,
|
|
455761
|
+
findWorkspaceRoot: findWorkspaceRoot3
|
|
455762
|
+
} = await import("@storm-software/config-tools");
|
|
455763
|
+
writeInfo(config, "\u{1F4E6} Running Storm build executor on the workspace");
|
|
455764
|
+
writeDebug(
|
|
455747
455765
|
config,
|
|
455748
455766
|
`\u2699\uFE0F Executor options:
|
|
455749
455767
|
${Object.keys(options8).map(
|
|
@@ -455756,11 +455774,11 @@ ${Object.keys(options8).map(
|
|
|
455756
455774
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
455757
455775
|
);
|
|
455758
455776
|
}
|
|
455759
|
-
const workspaceRoot = (
|
|
455777
|
+
const workspaceRoot = findWorkspaceRoot3();
|
|
455760
455778
|
const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
|
|
455761
455779
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
|
|
455762
455780
|
if (options8.clean !== false) {
|
|
455763
|
-
|
|
455781
|
+
writeInfo(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
|
|
455764
455782
|
(0, import_fs_extra.removeSync)(options8.outputPath);
|
|
455765
455783
|
}
|
|
455766
455784
|
const assets = Array.from(options8.assets);
|
|
@@ -455829,13 +455847,13 @@ ${Object.keys(options8).map(
|
|
|
455829
455847
|
const implicitDependencies = context.projectsConfigurations.projects[context.projectName]?.implicitDependencies;
|
|
455830
455848
|
const internalDependencies = [];
|
|
455831
455849
|
const projectConfigs = await Promise.resolve(getProjectConfigurations());
|
|
455832
|
-
if (
|
|
455833
|
-
|
|
455850
|
+
if (getLogLevel(config?.logLevel) >= LogLevel.TRACE) {
|
|
455851
|
+
writeDebug(config, "Project Configs:");
|
|
455834
455852
|
console.log(projectConfigs);
|
|
455835
455853
|
}
|
|
455836
455854
|
if (implicitDependencies && implicitDependencies.length > 0) {
|
|
455837
455855
|
options8.external = implicitDependencies.reduce((ret, key2) => {
|
|
455838
|
-
|
|
455856
|
+
writeDebug(config, `\u26A1 Adding implicit dependency: ${key2}`);
|
|
455839
455857
|
const projectConfig = projectConfigs[key2];
|
|
455840
455858
|
if (projectConfig?.targets?.build) {
|
|
455841
455859
|
const projectPackageJson = (0, import_devkit3.readJsonFile)(projectConfig.targets?.build.options.project);
|
|
@@ -455860,7 +455878,7 @@ ${Object.keys(options8).map(
|
|
|
455860
455878
|
externalDependencies.push(thirdPartyDependency);
|
|
455861
455879
|
}
|
|
455862
455880
|
}
|
|
455863
|
-
|
|
455881
|
+
writeTrace(
|
|
455864
455882
|
config,
|
|
455865
455883
|
`Building with the following dependencies marked as external:
|
|
455866
455884
|
${externalDependencies.map((dep) => {
|
|
@@ -455887,7 +455905,7 @@ ${externalDependencies.map((dep) => {
|
|
|
455887
455905
|
while (propertyKey.startsWith("/")) {
|
|
455888
455906
|
propertyKey = propertyKey.substring(1);
|
|
455889
455907
|
}
|
|
455890
|
-
|
|
455908
|
+
writeDebug(
|
|
455891
455909
|
config,
|
|
455892
455910
|
`Trying to add entry point ${propertyKey} at "${(0, import_devkit3.joinPathFragments)(
|
|
455893
455911
|
filePath.path,
|
|
@@ -456007,10 +456025,10 @@ ${externalDependencies.map((dep) => {
|
|
|
456007
456025
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
456008
456026
|
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit3.joinPathFragments)("packages", context.projectName);
|
|
456009
456027
|
const packageJsonPath = (0, import_devkit3.joinPathFragments)(context.root, options8.outputPath, "package.json");
|
|
456010
|
-
|
|
456028
|
+
writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
456011
456029
|
(0, import_node_fs.writeFileSync)(packageJsonPath, JSON.stringify(packageJson));
|
|
456012
456030
|
} else {
|
|
456013
|
-
|
|
456031
|
+
writeWarning(config, "Skipping writing to package.json file");
|
|
456014
456032
|
}
|
|
456015
456033
|
if (options8.includeSrc === true) {
|
|
456016
456034
|
const files = globSync([
|
|
@@ -456046,7 +456064,7 @@ ${(0, import_node_fs.readFileSync)(file, "utf-8")}`,
|
|
|
456046
456064
|
)
|
|
456047
456065
|
)
|
|
456048
456066
|
);
|
|
456049
|
-
|
|
456067
|
+
writeSuccess(config, "\u26A1 The Build process has completed successfully");
|
|
456050
456068
|
return {
|
|
456051
456069
|
success: true
|
|
456052
456070
|
};
|