@storm-software/workspace-tools 1.41.0 → 1.41.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 +38 -49
- package/meta.json +1 -1
- package/package.json +3 -1
- package/src/base/index.js +18 -37
- package/src/executors/design-tokens/executor.js +18 -37
- package/src/executors/tsup/executor.js +32 -46
- package/src/executors/tsup-browser/executor.js +32 -46
- package/src/executors/tsup-neutral/executor.js +38 -49
- package/src/executors/tsup-node/executor.js +32 -46
|
@@ -131922,14 +131922,13 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
|
|
|
131922
131922
|
var withRunExecutor = (name, executorFn, executorOptions = {
|
|
131923
131923
|
skipReadingConfig: false,
|
|
131924
131924
|
hooks: {}
|
|
131925
|
-
}) => async (
|
|
131925
|
+
}) => async (_options, context) => {
|
|
131926
131926
|
const startTime = Date.now();
|
|
131927
|
+
let options = _options;
|
|
131927
131928
|
try {
|
|
131928
|
-
console.info(
|
|
131929
|
-
chalk.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} executor...
|
|
131929
|
+
console.info(chalk.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} executor...
|
|
131930
131930
|
|
|
131931
|
-
`)
|
|
131932
|
-
);
|
|
131931
|
+
`));
|
|
131933
131932
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
131934
131933
|
throw new Error(
|
|
131935
131934
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
@@ -131954,19 +131953,11 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
131954
131953
|
);
|
|
131955
131954
|
}
|
|
131956
131955
|
if (executorOptions?.hooks?.applyDefaultOptions) {
|
|
131957
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(
|
|
131958
|
-
options = await Promise.resolve(
|
|
131959
|
-
|
|
131960
|
-
);
|
|
131961
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(`Completed the applyDefaultOptions hook...`));
|
|
131956
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the applyDefaultOptions hook..."));
|
|
131957
|
+
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
131958
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the applyDefaultOptions hook..."));
|
|
131962
131959
|
}
|
|
131963
|
-
getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(
|
|
131964
|
-
chalk.hex("#0ea5e9").italic(`
|
|
131965
|
-
|
|
131966
|
-
\u2699\uFE0F Executor schema options:
|
|
131967
|
-
`),
|
|
131968
|
-
options
|
|
131969
|
-
);
|
|
131960
|
+
getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(chalk.hex("#0ea5e9").italic("\n\n \u2699\uFE0F Executor schema options: \n"), options);
|
|
131970
131961
|
const tokenized = applyWorkspaceTokens(
|
|
131971
131962
|
options,
|
|
131972
131963
|
{
|
|
@@ -131981,44 +131972,34 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
131981
131972
|
applyWorkspaceExecutorTokens
|
|
131982
131973
|
);
|
|
131983
131974
|
if (executorOptions?.hooks?.preProcess) {
|
|
131984
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(
|
|
131985
|
-
await Promise.resolve(
|
|
131986
|
-
|
|
131987
|
-
);
|
|
131988
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(`Completed the preProcess hook...`));
|
|
131975
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the preProcess hook..."));
|
|
131976
|
+
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
131977
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the preProcess hook..."));
|
|
131989
131978
|
}
|
|
131990
|
-
const result = await Promise.resolve(
|
|
131991
|
-
executorFn(tokenized, context, config)
|
|
131992
|
-
);
|
|
131979
|
+
const result = await Promise.resolve(executorFn(tokenized, context, config));
|
|
131993
131980
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
131994
131981
|
throw new Error(`The ${name} executor failed to run`, {
|
|
131995
|
-
cause: result
|
|
131982
|
+
cause: result?.error
|
|
131996
131983
|
});
|
|
131997
131984
|
}
|
|
131998
131985
|
if (executorOptions?.hooks?.postProcess) {
|
|
131999
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(
|
|
131986
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the postProcess hook..."));
|
|
132000
131987
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
132001
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(
|
|
131988
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the postProcess hook..."));
|
|
132002
131989
|
}
|
|
132003
131990
|
console.info(
|
|
132004
|
-
chalk.bold.hex("#087f5b")(
|
|
132005
|
-
`
|
|
131991
|
+
chalk.bold.hex("#087f5b")(`
|
|
132006
131992
|
|
|
132007
131993
|
\u{1F389} Successfully completed running the ${name} executor!
|
|
132008
131994
|
|
|
132009
|
-
`
|
|
132010
|
-
)
|
|
131995
|
+
`)
|
|
132011
131996
|
);
|
|
132012
131997
|
return {
|
|
132013
131998
|
success: true
|
|
132014
131999
|
};
|
|
132015
132000
|
} catch (error) {
|
|
132016
132001
|
console.error(
|
|
132017
|
-
chalk.bold.hex("#7d1a1a")(
|
|
132018
|
-
`\u274C An error occurred while running the executor
|
|
132019
|
-
|
|
132020
|
-
`
|
|
132021
|
-
),
|
|
132002
|
+
chalk.bold.hex("#7d1a1a")("\u274C An error occurred while running the executor\n\n"),
|
|
132022
132003
|
error
|
|
132023
132004
|
);
|
|
132024
132005
|
return {
|
|
@@ -132064,8 +132045,6 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
132064
132045
|
};
|
|
132065
132046
|
|
|
132066
132047
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
132067
|
-
var import_fs4 = require("fs");
|
|
132068
|
-
var import_path4 = require("path");
|
|
132069
132048
|
var import_esbuild_decorators = __toESM(require_src());
|
|
132070
132049
|
var import_devkit2 = __toESM(require_devkit());
|
|
132071
132050
|
var import_js = __toESM(require_src2());
|
|
@@ -132114,6 +132093,7 @@ var environmentPlugin = (data) => ({
|
|
|
132114
132093
|
});
|
|
132115
132094
|
|
|
132116
132095
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
132096
|
+
var import_fs4 = require("fs");
|
|
132117
132097
|
var import_fs_extra = __toESM(require_lib6());
|
|
132118
132098
|
var import_promises2 = require("fs/promises");
|
|
132119
132099
|
|
|
@@ -138293,6 +138273,7 @@ glob.glob = glob;
|
|
|
138293
138273
|
|
|
138294
138274
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
138295
138275
|
var import_fileutils = require("nx/src/utils/fileutils");
|
|
138276
|
+
var import_path4 = require("path");
|
|
138296
138277
|
var import_prettier = require("prettier");
|
|
138297
138278
|
var import_tsup = __toESM(require_dist6());
|
|
138298
138279
|
var ts = __toESM(require("typescript"));
|
|
@@ -138771,7 +138752,7 @@ ${(0, import_fs4.readFileSync)(file, "utf-8")}`,
|
|
|
138771
138752
|
...options,
|
|
138772
138753
|
watch: false,
|
|
138773
138754
|
main: options.entry,
|
|
138774
|
-
transformers: ["typia/lib/transform"]
|
|
138755
|
+
transformers: options.skipTypia ? [] : ["typia/lib/transform"]
|
|
138775
138756
|
},
|
|
138776
138757
|
context.root,
|
|
138777
138758
|
sourceRoot,
|
|
@@ -138835,6 +138816,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
138835
138816
|
esModuleInterop: true,
|
|
138836
138817
|
downlevelIteration: true,
|
|
138837
138818
|
forceConsistentCasingInFileNames: true,
|
|
138819
|
+
emitDeclarationOnly: true,
|
|
138838
138820
|
declaration: true,
|
|
138839
138821
|
declarationMap: true,
|
|
138840
138822
|
declarationDir: (0, import_path4.join)(workspaceRoot, "tmp", ".tsup", "declaration")
|
|
@@ -138850,11 +138832,16 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
138850
138832
|
return tsConfig;
|
|
138851
138833
|
}
|
|
138852
138834
|
var build = async (options) => {
|
|
138853
|
-
|
|
138854
|
-
|
|
138855
|
-
|
|
138856
|
-
|
|
138857
|
-
|
|
138835
|
+
try {
|
|
138836
|
+
Array.isArray(options) ? options.length > 0 ? options[0].silent : false : options.silent && console.log("\u2699\uFE0F Tsup build config: \n", options, "\n");
|
|
138837
|
+
if (Array.isArray(options)) {
|
|
138838
|
+
await Promise.all(options.map((buildOptions) => (0, import_tsup.build)(buildOptions)));
|
|
138839
|
+
} else {
|
|
138840
|
+
await (0, import_tsup.build)(options);
|
|
138841
|
+
}
|
|
138842
|
+
} catch (e) {
|
|
138843
|
+
console.error("\u26A0\uFE0F A failure occured during the Tsup Build executor");
|
|
138844
|
+
console.error(e);
|
|
138858
138845
|
}
|
|
138859
138846
|
};
|
|
138860
138847
|
var applyDefaultOptions = (options) => {
|
|
@@ -138884,7 +138871,6 @@ var applyDefaultOptions = (options) => {
|
|
|
138884
138871
|
options.skipTypia ??= false;
|
|
138885
138872
|
options.define ??= {};
|
|
138886
138873
|
options.env ??= {};
|
|
138887
|
-
options.verbose ??= !!process.env.CI;
|
|
138888
138874
|
options.getConfig ??= { dist: defaultConfig };
|
|
138889
138875
|
return options;
|
|
138890
138876
|
};
|
|
@@ -138928,6 +138914,9 @@ function neutralConfig({
|
|
|
138928
138914
|
metafile = false,
|
|
138929
138915
|
define: define2,
|
|
138930
138916
|
env,
|
|
138917
|
+
apiReport = true,
|
|
138918
|
+
docModel = true,
|
|
138919
|
+
tsdocMetadata = true,
|
|
138931
138920
|
plugins,
|
|
138932
138921
|
generatePackageJson,
|
|
138933
138922
|
dtsTsConfig,
|
|
@@ -138968,9 +138957,9 @@ function neutralConfig({
|
|
|
138968
138957
|
}
|
|
138969
138958
|
}
|
|
138970
138959
|
},
|
|
138971
|
-
apiReport
|
|
138972
|
-
docModel
|
|
138973
|
-
tsdocMetadata
|
|
138960
|
+
apiReport,
|
|
138961
|
+
docModel,
|
|
138962
|
+
tsdocMetadata,
|
|
138974
138963
|
sourcemap: debug,
|
|
138975
138964
|
clean: false,
|
|
138976
138965
|
tsconfigDecoratorMetadata: true,
|
|
@@ -131922,14 +131922,13 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
|
|
|
131922
131922
|
var withRunExecutor = (name, executorFn, executorOptions = {
|
|
131923
131923
|
skipReadingConfig: false,
|
|
131924
131924
|
hooks: {}
|
|
131925
|
-
}) => async (
|
|
131925
|
+
}) => async (_options, context) => {
|
|
131926
131926
|
const startTime = Date.now();
|
|
131927
|
+
let options = _options;
|
|
131927
131928
|
try {
|
|
131928
|
-
console.info(
|
|
131929
|
-
chalk.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} executor...
|
|
131929
|
+
console.info(chalk.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} executor...
|
|
131930
131930
|
|
|
131931
|
-
`)
|
|
131932
|
-
);
|
|
131931
|
+
`));
|
|
131933
131932
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
131934
131933
|
throw new Error(
|
|
131935
131934
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
@@ -131954,19 +131953,11 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
131954
131953
|
);
|
|
131955
131954
|
}
|
|
131956
131955
|
if (executorOptions?.hooks?.applyDefaultOptions) {
|
|
131957
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(
|
|
131958
|
-
options = await Promise.resolve(
|
|
131959
|
-
|
|
131960
|
-
);
|
|
131961
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(`Completed the applyDefaultOptions hook...`));
|
|
131956
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the applyDefaultOptions hook..."));
|
|
131957
|
+
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
131958
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the applyDefaultOptions hook..."));
|
|
131962
131959
|
}
|
|
131963
|
-
getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(
|
|
131964
|
-
chalk.hex("#0ea5e9").italic(`
|
|
131965
|
-
|
|
131966
|
-
\u2699\uFE0F Executor schema options:
|
|
131967
|
-
`),
|
|
131968
|
-
options
|
|
131969
|
-
);
|
|
131960
|
+
getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(chalk.hex("#0ea5e9").italic("\n\n \u2699\uFE0F Executor schema options: \n"), options);
|
|
131970
131961
|
const tokenized = applyWorkspaceTokens(
|
|
131971
131962
|
options,
|
|
131972
131963
|
{
|
|
@@ -131981,44 +131972,34 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
131981
131972
|
applyWorkspaceExecutorTokens
|
|
131982
131973
|
);
|
|
131983
131974
|
if (executorOptions?.hooks?.preProcess) {
|
|
131984
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(
|
|
131985
|
-
await Promise.resolve(
|
|
131986
|
-
|
|
131987
|
-
);
|
|
131988
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(`Completed the preProcess hook...`));
|
|
131975
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the preProcess hook..."));
|
|
131976
|
+
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
131977
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the preProcess hook..."));
|
|
131989
131978
|
}
|
|
131990
|
-
const result = await Promise.resolve(
|
|
131991
|
-
executorFn(tokenized, context, config)
|
|
131992
|
-
);
|
|
131979
|
+
const result = await Promise.resolve(executorFn(tokenized, context, config));
|
|
131993
131980
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
131994
131981
|
throw new Error(`The ${name} executor failed to run`, {
|
|
131995
|
-
cause: result
|
|
131982
|
+
cause: result?.error
|
|
131996
131983
|
});
|
|
131997
131984
|
}
|
|
131998
131985
|
if (executorOptions?.hooks?.postProcess) {
|
|
131999
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(
|
|
131986
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the postProcess hook..."));
|
|
132000
131987
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
132001
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim(
|
|
131988
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the postProcess hook..."));
|
|
132002
131989
|
}
|
|
132003
131990
|
console.info(
|
|
132004
|
-
chalk.bold.hex("#087f5b")(
|
|
132005
|
-
`
|
|
131991
|
+
chalk.bold.hex("#087f5b")(`
|
|
132006
131992
|
|
|
132007
131993
|
\u{1F389} Successfully completed running the ${name} executor!
|
|
132008
131994
|
|
|
132009
|
-
`
|
|
132010
|
-
)
|
|
131995
|
+
`)
|
|
132011
131996
|
);
|
|
132012
131997
|
return {
|
|
132013
131998
|
success: true
|
|
132014
131999
|
};
|
|
132015
132000
|
} catch (error) {
|
|
132016
132001
|
console.error(
|
|
132017
|
-
chalk.bold.hex("#7d1a1a")(
|
|
132018
|
-
`\u274C An error occurred while running the executor
|
|
132019
|
-
|
|
132020
|
-
`
|
|
132021
|
-
),
|
|
132002
|
+
chalk.bold.hex("#7d1a1a")("\u274C An error occurred while running the executor\n\n"),
|
|
132022
132003
|
error
|
|
132023
132004
|
);
|
|
132024
132005
|
return {
|
|
@@ -132064,8 +132045,6 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
132064
132045
|
};
|
|
132065
132046
|
|
|
132066
132047
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
132067
|
-
var import_fs4 = require("fs");
|
|
132068
|
-
var import_path4 = require("path");
|
|
132069
132048
|
var import_esbuild_decorators = __toESM(require_src());
|
|
132070
132049
|
var import_devkit2 = __toESM(require_devkit());
|
|
132071
132050
|
var import_js = __toESM(require_src2());
|
|
@@ -132114,6 +132093,7 @@ var environmentPlugin = (data) => ({
|
|
|
132114
132093
|
});
|
|
132115
132094
|
|
|
132116
132095
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
132096
|
+
var import_fs4 = require("fs");
|
|
132117
132097
|
var import_fs_extra = __toESM(require_lib6());
|
|
132118
132098
|
var import_promises2 = require("fs/promises");
|
|
132119
132099
|
|
|
@@ -138293,6 +138273,7 @@ glob.glob = glob;
|
|
|
138293
138273
|
|
|
138294
138274
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
138295
138275
|
var import_fileutils = require("nx/src/utils/fileutils");
|
|
138276
|
+
var import_path4 = require("path");
|
|
138296
138277
|
var import_prettier = require("prettier");
|
|
138297
138278
|
var import_tsup = __toESM(require_dist6());
|
|
138298
138279
|
var ts = __toESM(require("typescript"));
|
|
@@ -138771,7 +138752,7 @@ ${(0, import_fs4.readFileSync)(file, "utf-8")}`,
|
|
|
138771
138752
|
...options,
|
|
138772
138753
|
watch: false,
|
|
138773
138754
|
main: options.entry,
|
|
138774
|
-
transformers: ["typia/lib/transform"]
|
|
138755
|
+
transformers: options.skipTypia ? [] : ["typia/lib/transform"]
|
|
138775
138756
|
},
|
|
138776
138757
|
context.root,
|
|
138777
138758
|
sourceRoot,
|
|
@@ -138835,6 +138816,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
138835
138816
|
esModuleInterop: true,
|
|
138836
138817
|
downlevelIteration: true,
|
|
138837
138818
|
forceConsistentCasingInFileNames: true,
|
|
138819
|
+
emitDeclarationOnly: true,
|
|
138838
138820
|
declaration: true,
|
|
138839
138821
|
declarationMap: true,
|
|
138840
138822
|
declarationDir: (0, import_path4.join)(workspaceRoot, "tmp", ".tsup", "declaration")
|
|
@@ -138850,11 +138832,16 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
138850
138832
|
return tsConfig;
|
|
138851
138833
|
}
|
|
138852
138834
|
var build = async (options) => {
|
|
138853
|
-
|
|
138854
|
-
|
|
138855
|
-
|
|
138856
|
-
|
|
138857
|
-
|
|
138835
|
+
try {
|
|
138836
|
+
Array.isArray(options) ? options.length > 0 ? options[0].silent : false : options.silent && console.log("\u2699\uFE0F Tsup build config: \n", options, "\n");
|
|
138837
|
+
if (Array.isArray(options)) {
|
|
138838
|
+
await Promise.all(options.map((buildOptions) => (0, import_tsup.build)(buildOptions)));
|
|
138839
|
+
} else {
|
|
138840
|
+
await (0, import_tsup.build)(options);
|
|
138841
|
+
}
|
|
138842
|
+
} catch (e) {
|
|
138843
|
+
console.error("\u26A0\uFE0F A failure occured during the Tsup Build executor");
|
|
138844
|
+
console.error(e);
|
|
138858
138845
|
}
|
|
138859
138846
|
};
|
|
138860
138847
|
var applyDefaultOptions = (options) => {
|
|
@@ -138884,7 +138871,6 @@ var applyDefaultOptions = (options) => {
|
|
|
138884
138871
|
options.skipTypia ??= false;
|
|
138885
138872
|
options.define ??= {};
|
|
138886
138873
|
options.env ??= {};
|
|
138887
|
-
options.verbose ??= !!process.env.CI;
|
|
138888
138874
|
options.getConfig ??= { dist: defaultConfig };
|
|
138889
138875
|
return options;
|
|
138890
138876
|
};
|