@storm-software/workspace-tools 1.202.1 → 1.204.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 +15 -0
- package/declarations.d.ts +18 -2
- package/index.js +115 -101
- package/meta.json +221 -176
- package/package.json +1 -1
- package/src/base/base-executor.js +10 -12
- package/src/base/base-generator.js +10 -12
- package/src/base/index.js +79 -19
- package/src/base/typescript-library-generator.d.ts +2 -1
- package/src/base/typescript-library-generator.js +69 -7
- package/src/executors/cargo-build/executor.js +10 -12
- package/src/executors/cargo-check/executor.js +10 -12
- package/src/executors/cargo-clippy/executor.js +10 -12
- package/src/executors/cargo-doc/executor.js +10 -12
- package/src/executors/cargo-format/executor.js +10 -12
- package/src/executors/clean-package/executor.js +10 -12
- package/src/executors/rolldown/executor.js +10 -12
- package/src/executors/rollup/executor.js +10 -12
- package/src/executors/size-limit/executor.js +10 -12
- package/src/executors/tsup/executor.js +10 -12
- package/src/executors/tsup-browser/executor.js +10 -12
- package/src/executors/tsup-neutral/executor.js +10 -12
- package/src/executors/tsup-node/executor.js +10 -12
- package/src/executors/typia/executor.js +10 -12
- package/src/executors/unbuild/executor.js +10 -12
- package/src/executors/unbuild/schema.json +7 -1
- package/src/generators/browser-library/generator.d.ts +2 -1
- package/src/generators/browser-library/generator.js +81 -21
- package/src/generators/config-schema/generator.js +10 -12
- package/src/generators/neutral-library/generator.d.ts +2 -1
- package/src/generators/neutral-library/generator.js +81 -21
- package/src/generators/node-library/generator.d.ts +2 -1
- package/src/generators/node-library/generator.js +81 -21
- package/src/generators/preset/generator.js +10 -12
- package/src/generators/release-version/generator.js +10 -12
- package/src/plugins/rust/index.js +13 -0
- package/src/plugins/typescript/index.js +13 -0
- package/src/utils/index.js +23 -12
- package/src/utils/project-tags.d.ts +8 -1
- package/src/utils/project-tags.js +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/workspace-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.204.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "Tools for managing a Storm workspace, including various Nx generators and executors for common development tasks.",
|
|
6
6
|
"repository": {
|
|
@@ -66405,7 +66405,7 @@ var init_schema = __esm({
|
|
|
66405
66405
|
worker: z3.string().trim().default("Stormie-Bot").describe(
|
|
66406
66406
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
66407
66407
|
),
|
|
66408
|
-
|
|
66408
|
+
envName: z3.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment name for the package"),
|
|
66409
66409
|
workspaceRoot: z3.string().trim().default("").describe("The root directory of the workspace"),
|
|
66410
66410
|
packageDirectory: z3.string().trim().optional().describe("The root directory of the package"),
|
|
66411
66411
|
externalPackagePatterns: z3.array(z3.string()).default([]).describe(
|
|
@@ -66527,19 +66527,17 @@ var init_get_default_config = __esm({
|
|
|
66527
66527
|
}
|
|
66528
66528
|
};
|
|
66529
66529
|
DEFAULT_STORM_CONFIG = {
|
|
66530
|
-
name: "storm",
|
|
66531
66530
|
namespace: "storm-software",
|
|
66532
|
-
license: "Apache
|
|
66531
|
+
license: "Apache-2.0",
|
|
66533
66532
|
homepage: "https://stormsoftware.com",
|
|
66534
|
-
owner: "@storm-software/
|
|
66533
|
+
owner: "@storm-software/admin",
|
|
66535
66534
|
worker: "stormie-bot",
|
|
66536
66535
|
runtimeDirectory: "node_modules/.storm",
|
|
66537
|
-
cacheDirectory: "node_modules/.cache/storm",
|
|
66538
66536
|
skipCache: false,
|
|
66539
|
-
packageManager: "
|
|
66537
|
+
packageManager: "pnpm",
|
|
66540
66538
|
timezone: "America/New_York",
|
|
66541
66539
|
locale: "en-US",
|
|
66542
|
-
|
|
66540
|
+
envName: "production",
|
|
66543
66541
|
branch: "main",
|
|
66544
66542
|
organization: "storm-software",
|
|
66545
66543
|
configFile: null,
|
|
@@ -67039,7 +67037,7 @@ var init_get_env = __esm({
|
|
|
67039
67037
|
cacheDirectory: correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]),
|
|
67040
67038
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
67041
67039
|
outputDirectory: correctPaths(process.env[`${prefix}OUTPUT_DIRECTORY`]),
|
|
67042
|
-
|
|
67040
|
+
envName: process.env[`${prefix}ENV_NAME`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
67043
67041
|
// ci:
|
|
67044
67042
|
// process.env[`${prefix}CI`] !== undefined
|
|
67045
67043
|
// ? Boolean(
|
|
@@ -67268,10 +67266,10 @@ var init_set_env = __esm({
|
|
|
67268
67266
|
config.outputDirectory
|
|
67269
67267
|
);
|
|
67270
67268
|
}
|
|
67271
|
-
if (config.
|
|
67272
|
-
process.env[`${prefix}
|
|
67273
|
-
process.env.NODE_ENV = config.
|
|
67274
|
-
process.env.ENVIRONMENT = config.
|
|
67269
|
+
if (config.envName) {
|
|
67270
|
+
process.env[`${prefix}ENV_NAME`] = config.envName;
|
|
67271
|
+
process.env.NODE_ENV = config.envName;
|
|
67272
|
+
process.env.ENVIRONMENT = config.envName;
|
|
67275
67273
|
}
|
|
67276
67274
|
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
67277
67275
|
for (const key of Object.keys(config.colors)) {
|
|
@@ -66405,7 +66405,7 @@ var init_schema = __esm({
|
|
|
66405
66405
|
worker: z3.string().trim().default("Stormie-Bot").describe(
|
|
66406
66406
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
66407
66407
|
),
|
|
66408
|
-
|
|
66408
|
+
envName: z3.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment name for the package"),
|
|
66409
66409
|
workspaceRoot: z3.string().trim().default("").describe("The root directory of the workspace"),
|
|
66410
66410
|
packageDirectory: z3.string().trim().optional().describe("The root directory of the package"),
|
|
66411
66411
|
externalPackagePatterns: z3.array(z3.string()).default([]).describe(
|
|
@@ -66527,19 +66527,17 @@ var init_get_default_config = __esm({
|
|
|
66527
66527
|
}
|
|
66528
66528
|
};
|
|
66529
66529
|
DEFAULT_STORM_CONFIG = {
|
|
66530
|
-
name: "storm",
|
|
66531
66530
|
namespace: "storm-software",
|
|
66532
|
-
license: "Apache
|
|
66531
|
+
license: "Apache-2.0",
|
|
66533
66532
|
homepage: "https://stormsoftware.com",
|
|
66534
|
-
owner: "@storm-software/
|
|
66533
|
+
owner: "@storm-software/admin",
|
|
66535
66534
|
worker: "stormie-bot",
|
|
66536
66535
|
runtimeDirectory: "node_modules/.storm",
|
|
66537
|
-
cacheDirectory: "node_modules/.cache/storm",
|
|
66538
66536
|
skipCache: false,
|
|
66539
|
-
packageManager: "
|
|
66537
|
+
packageManager: "pnpm",
|
|
66540
66538
|
timezone: "America/New_York",
|
|
66541
66539
|
locale: "en-US",
|
|
66542
|
-
|
|
66540
|
+
envName: "production",
|
|
66543
66541
|
branch: "main",
|
|
66544
66542
|
organization: "storm-software",
|
|
66545
66543
|
configFile: null,
|
|
@@ -67039,7 +67037,7 @@ var init_get_env = __esm({
|
|
|
67039
67037
|
cacheDirectory: correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]),
|
|
67040
67038
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
67041
67039
|
outputDirectory: correctPaths(process.env[`${prefix}OUTPUT_DIRECTORY`]),
|
|
67042
|
-
|
|
67040
|
+
envName: process.env[`${prefix}ENV_NAME`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
67043
67041
|
// ci:
|
|
67044
67042
|
// process.env[`${prefix}CI`] !== undefined
|
|
67045
67043
|
// ? Boolean(
|
|
@@ -67268,10 +67266,10 @@ var init_set_env = __esm({
|
|
|
67268
67266
|
config.outputDirectory
|
|
67269
67267
|
);
|
|
67270
67268
|
}
|
|
67271
|
-
if (config.
|
|
67272
|
-
process.env[`${prefix}
|
|
67273
|
-
process.env.NODE_ENV = config.
|
|
67274
|
-
process.env.ENVIRONMENT = config.
|
|
67269
|
+
if (config.envName) {
|
|
67270
|
+
process.env[`${prefix}ENV_NAME`] = config.envName;
|
|
67271
|
+
process.env.NODE_ENV = config.envName;
|
|
67272
|
+
process.env.ENVIRONMENT = config.envName;
|
|
67275
67273
|
}
|
|
67276
67274
|
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
67277
67275
|
for (const key of Object.keys(config.colors)) {
|
package/src/base/index.js
CHANGED
|
@@ -66405,7 +66405,7 @@ var init_schema = __esm({
|
|
|
66405
66405
|
worker: z3.string().trim().default("Stormie-Bot").describe(
|
|
66406
66406
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
66407
66407
|
),
|
|
66408
|
-
|
|
66408
|
+
envName: z3.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment name for the package"),
|
|
66409
66409
|
workspaceRoot: z3.string().trim().default("").describe("The root directory of the workspace"),
|
|
66410
66410
|
packageDirectory: z3.string().trim().optional().describe("The root directory of the package"),
|
|
66411
66411
|
externalPackagePatterns: z3.array(z3.string()).default([]).describe(
|
|
@@ -66527,19 +66527,17 @@ var init_get_default_config = __esm({
|
|
|
66527
66527
|
}
|
|
66528
66528
|
};
|
|
66529
66529
|
DEFAULT_STORM_CONFIG = {
|
|
66530
|
-
name: "storm",
|
|
66531
66530
|
namespace: "storm-software",
|
|
66532
|
-
license: "Apache
|
|
66531
|
+
license: "Apache-2.0",
|
|
66533
66532
|
homepage: "https://stormsoftware.com",
|
|
66534
|
-
owner: "@storm-software/
|
|
66533
|
+
owner: "@storm-software/admin",
|
|
66535
66534
|
worker: "stormie-bot",
|
|
66536
66535
|
runtimeDirectory: "node_modules/.storm",
|
|
66537
|
-
cacheDirectory: "node_modules/.cache/storm",
|
|
66538
66536
|
skipCache: false,
|
|
66539
|
-
packageManager: "
|
|
66537
|
+
packageManager: "pnpm",
|
|
66540
66538
|
timezone: "America/New_York",
|
|
66541
66539
|
locale: "en-US",
|
|
66542
|
-
|
|
66540
|
+
envName: "production",
|
|
66543
66541
|
branch: "main",
|
|
66544
66542
|
organization: "storm-software",
|
|
66545
66543
|
configFile: null,
|
|
@@ -67039,7 +67037,7 @@ var init_get_env = __esm({
|
|
|
67039
67037
|
cacheDirectory: correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]),
|
|
67040
67038
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
67041
67039
|
outputDirectory: correctPaths(process.env[`${prefix}OUTPUT_DIRECTORY`]),
|
|
67042
|
-
|
|
67040
|
+
envName: process.env[`${prefix}ENV_NAME`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
67043
67041
|
// ci:
|
|
67044
67042
|
// process.env[`${prefix}CI`] !== undefined
|
|
67045
67043
|
// ? Boolean(
|
|
@@ -67268,10 +67266,10 @@ var init_set_env = __esm({
|
|
|
67268
67266
|
config.outputDirectory
|
|
67269
67267
|
);
|
|
67270
67268
|
}
|
|
67271
|
-
if (config.
|
|
67272
|
-
process.env[`${prefix}
|
|
67273
|
-
process.env.NODE_ENV = config.
|
|
67274
|
-
process.env.ENVIRONMENT = config.
|
|
67269
|
+
if (config.envName) {
|
|
67270
|
+
process.env[`${prefix}ENV_NAME`] = config.envName;
|
|
67271
|
+
process.env.NODE_ENV = config.envName;
|
|
67272
|
+
process.env.ENVIRONMENT = config.envName;
|
|
67275
67273
|
}
|
|
67276
67274
|
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
67277
67275
|
for (const key of Object.keys(config.colors)) {
|
|
@@ -67914,11 +67912,68 @@ var import_js = require("@nx/js");
|
|
|
67914
67912
|
var import_init = __toESM(require("@nx/js/src/generators/init/init"));
|
|
67915
67913
|
var import_generator = __toESM(require("@nx/js/src/generators/setup-verdaccio/generator"));
|
|
67916
67914
|
|
|
67915
|
+
// packages/workspace-tools/src/utils/project-tags.ts
|
|
67916
|
+
var ProjectTagConstants = {
|
|
67917
|
+
Language: {
|
|
67918
|
+
TAG_ID: "language",
|
|
67919
|
+
TYPESCRIPT: "typescript",
|
|
67920
|
+
RUST: "rust"
|
|
67921
|
+
},
|
|
67922
|
+
ProjectType: {
|
|
67923
|
+
TAG_ID: "type",
|
|
67924
|
+
LIBRARY: "library",
|
|
67925
|
+
APPLICATION: "application"
|
|
67926
|
+
},
|
|
67927
|
+
DistStyle: {
|
|
67928
|
+
TAG_ID: "dist-style",
|
|
67929
|
+
NORMAL: "normal",
|
|
67930
|
+
CLEAN: "clean"
|
|
67931
|
+
},
|
|
67932
|
+
Provider: {
|
|
67933
|
+
TAG_ID: "provider"
|
|
67934
|
+
},
|
|
67935
|
+
Platform: {
|
|
67936
|
+
TAG_ID: "platform",
|
|
67937
|
+
NODE: "node",
|
|
67938
|
+
BROWSER: "browser",
|
|
67939
|
+
NEUTRAL: "neutral",
|
|
67940
|
+
WORKER: "worker"
|
|
67941
|
+
},
|
|
67942
|
+
Registry: {
|
|
67943
|
+
TAG_ID: "registry",
|
|
67944
|
+
CARGO: "cargo",
|
|
67945
|
+
NPM: "npm",
|
|
67946
|
+
CONTAINER: "container",
|
|
67947
|
+
CYCLONE: "cyclone"
|
|
67948
|
+
}
|
|
67949
|
+
};
|
|
67950
|
+
var formatProjectTag = (variant, value2) => {
|
|
67951
|
+
return `${variant}:${value2}`;
|
|
67952
|
+
};
|
|
67953
|
+
var hasProjectTag = (project, variant) => {
|
|
67954
|
+
project.tags = project.tags ?? [];
|
|
67955
|
+
const prefix = formatProjectTag(variant, "");
|
|
67956
|
+
return project.tags.some(
|
|
67957
|
+
(tag) => tag.startsWith(prefix) && tag.length > prefix.length
|
|
67958
|
+
);
|
|
67959
|
+
};
|
|
67960
|
+
var addProjectTag = (project, variant, value2, options = {
|
|
67961
|
+
overwrite: false
|
|
67962
|
+
}) => {
|
|
67963
|
+
project.tags = project.tags ?? [];
|
|
67964
|
+
if (options.overwrite || !hasProjectTag(project, variant)) {
|
|
67965
|
+
project.tags = project.tags.filter(
|
|
67966
|
+
(tag) => !tag.startsWith(formatProjectTag(variant, ""))
|
|
67967
|
+
);
|
|
67968
|
+
project.tags.push(formatProjectTag(variant, value2));
|
|
67969
|
+
}
|
|
67970
|
+
};
|
|
67971
|
+
|
|
67917
67972
|
// packages/workspace-tools/src/utils/versions.ts
|
|
67918
67973
|
var nxVersion = "^18.0.4";
|
|
67919
67974
|
|
|
67920
67975
|
// packages/workspace-tools/src/base/typescript-library-generator.ts
|
|
67921
|
-
async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
67976
|
+
async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
67922
67977
|
const options = await normalizeOptions(tree, { ...schema });
|
|
67923
67978
|
const tasks = [];
|
|
67924
67979
|
tasks.push(
|
|
@@ -67955,6 +68010,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
67955
68010
|
tsConfig: (0, import_devkit.joinPathFragments)(options.projectRoot, "tsconfig.json"),
|
|
67956
68011
|
project: (0, import_devkit.joinPathFragments)(options.projectRoot, "package.json"),
|
|
67957
68012
|
defaultConfiguration: "production",
|
|
68013
|
+
platform: "neutral",
|
|
67958
68014
|
assets: [
|
|
67959
68015
|
{
|
|
67960
68016
|
input: options.projectRoot,
|
|
@@ -67978,21 +68034,25 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
67978
68034
|
verbose: true
|
|
67979
68035
|
}
|
|
67980
68036
|
}
|
|
67981
|
-
}
|
|
67982
|
-
lint: {},
|
|
67983
|
-
test: {}
|
|
68037
|
+
}
|
|
67984
68038
|
}
|
|
67985
68039
|
};
|
|
67986
|
-
if (schema.platform
|
|
68040
|
+
if (schema.platform) {
|
|
67987
68041
|
projectConfig.targets.build.options.platform = schema.platform;
|
|
67988
68042
|
}
|
|
68043
|
+
addProjectTag(
|
|
68044
|
+
projectConfig,
|
|
68045
|
+
ProjectTagConstants.Platform.TAG_ID,
|
|
68046
|
+
projectConfig.targets.build.options.platform === "node" ? ProjectTagConstants.Platform.NODE : projectConfig.targets.build.options.platform === "worker" ? ProjectTagConstants.Platform.WORKER : projectConfig.targets.build.options.platform === "browser" ? ProjectTagConstants.Platform.BROWSER : ProjectTagConstants.Platform.NEUTRAL,
|
|
68047
|
+
{ overwrite: false }
|
|
68048
|
+
);
|
|
67989
68049
|
createProjectTsConfigJson(tree, options);
|
|
67990
68050
|
(0, import_devkit.addProjectConfiguration)(tree, options.name, projectConfig);
|
|
67991
68051
|
let repository = {
|
|
67992
68052
|
type: "github",
|
|
67993
|
-
url:
|
|
68053
|
+
url: config?.repository || `https://github.com/${config?.organization || "storm-software"}/${config?.namespace || config?.name || "repository"}.git`
|
|
67994
68054
|
};
|
|
67995
|
-
let description = schema.description
|
|
68055
|
+
let description = schema.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
67996
68056
|
if (tree.exists("package.json")) {
|
|
67997
68057
|
const packageJson = (0, import_devkit.readJson)(tree, "package.json");
|
|
67998
68058
|
if (packageJson?.repository) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Tree } from "@nx/devkit";
|
|
2
|
+
import { StormConfig } from "@storm-software/config";
|
|
2
3
|
import type { TypeScriptLibraryGeneratorNormalizedSchema, TypeScriptLibraryGeneratorSchema } from "../../declarations.d";
|
|
3
|
-
export declare function typeScriptLibraryGeneratorFn(tree: Tree, schema: TypeScriptLibraryGeneratorSchema): Promise<null>;
|
|
4
|
+
export declare function typeScriptLibraryGeneratorFn(tree: Tree, schema: TypeScriptLibraryGeneratorSchema, config?: StormConfig): Promise<null>;
|
|
4
5
|
export declare function getOutputPath(options: TypeScriptLibraryGeneratorNormalizedSchema): string;
|
|
5
6
|
export declare function createProjectTsConfigJson(tree: Tree, options: TypeScriptLibraryGeneratorNormalizedSchema): void;
|
|
6
7
|
export declare function normalizeOptions(tree: Tree, options: TypeScriptLibraryGeneratorSchema): Promise<TypeScriptLibraryGeneratorNormalizedSchema>;
|
|
@@ -41,11 +41,68 @@ var import_js = require("@nx/js");
|
|
|
41
41
|
var import_init = __toESM(require("@nx/js/src/generators/init/init"));
|
|
42
42
|
var import_generator = __toESM(require("@nx/js/src/generators/setup-verdaccio/generator"));
|
|
43
43
|
|
|
44
|
+
// packages/workspace-tools/src/utils/project-tags.ts
|
|
45
|
+
var ProjectTagConstants = {
|
|
46
|
+
Language: {
|
|
47
|
+
TAG_ID: "language",
|
|
48
|
+
TYPESCRIPT: "typescript",
|
|
49
|
+
RUST: "rust"
|
|
50
|
+
},
|
|
51
|
+
ProjectType: {
|
|
52
|
+
TAG_ID: "type",
|
|
53
|
+
LIBRARY: "library",
|
|
54
|
+
APPLICATION: "application"
|
|
55
|
+
},
|
|
56
|
+
DistStyle: {
|
|
57
|
+
TAG_ID: "dist-style",
|
|
58
|
+
NORMAL: "normal",
|
|
59
|
+
CLEAN: "clean"
|
|
60
|
+
},
|
|
61
|
+
Provider: {
|
|
62
|
+
TAG_ID: "provider"
|
|
63
|
+
},
|
|
64
|
+
Platform: {
|
|
65
|
+
TAG_ID: "platform",
|
|
66
|
+
NODE: "node",
|
|
67
|
+
BROWSER: "browser",
|
|
68
|
+
NEUTRAL: "neutral",
|
|
69
|
+
WORKER: "worker"
|
|
70
|
+
},
|
|
71
|
+
Registry: {
|
|
72
|
+
TAG_ID: "registry",
|
|
73
|
+
CARGO: "cargo",
|
|
74
|
+
NPM: "npm",
|
|
75
|
+
CONTAINER: "container",
|
|
76
|
+
CYCLONE: "cyclone"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
var formatProjectTag = (variant, value) => {
|
|
80
|
+
return `${variant}:${value}`;
|
|
81
|
+
};
|
|
82
|
+
var hasProjectTag = (project, variant) => {
|
|
83
|
+
project.tags = project.tags ?? [];
|
|
84
|
+
const prefix = formatProjectTag(variant, "");
|
|
85
|
+
return project.tags.some(
|
|
86
|
+
(tag) => tag.startsWith(prefix) && tag.length > prefix.length
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
var addProjectTag = (project, variant, value, options = {
|
|
90
|
+
overwrite: false
|
|
91
|
+
}) => {
|
|
92
|
+
project.tags = project.tags ?? [];
|
|
93
|
+
if (options.overwrite || !hasProjectTag(project, variant)) {
|
|
94
|
+
project.tags = project.tags.filter(
|
|
95
|
+
(tag) => !tag.startsWith(formatProjectTag(variant, ""))
|
|
96
|
+
);
|
|
97
|
+
project.tags.push(formatProjectTag(variant, value));
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
44
101
|
// packages/workspace-tools/src/utils/versions.ts
|
|
45
102
|
var nxVersion = "^18.0.4";
|
|
46
103
|
|
|
47
104
|
// packages/workspace-tools/src/base/typescript-library-generator.ts
|
|
48
|
-
async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
105
|
+
async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
49
106
|
const options = await normalizeOptions(tree, { ...schema });
|
|
50
107
|
const tasks = [];
|
|
51
108
|
tasks.push(
|
|
@@ -82,6 +139,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
82
139
|
tsConfig: (0, import_devkit.joinPathFragments)(options.projectRoot, "tsconfig.json"),
|
|
83
140
|
project: (0, import_devkit.joinPathFragments)(options.projectRoot, "package.json"),
|
|
84
141
|
defaultConfiguration: "production",
|
|
142
|
+
platform: "neutral",
|
|
85
143
|
assets: [
|
|
86
144
|
{
|
|
87
145
|
input: options.projectRoot,
|
|
@@ -105,21 +163,25 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
|
|
|
105
163
|
verbose: true
|
|
106
164
|
}
|
|
107
165
|
}
|
|
108
|
-
}
|
|
109
|
-
lint: {},
|
|
110
|
-
test: {}
|
|
166
|
+
}
|
|
111
167
|
}
|
|
112
168
|
};
|
|
113
|
-
if (schema.platform
|
|
169
|
+
if (schema.platform) {
|
|
114
170
|
projectConfig.targets.build.options.platform = schema.platform;
|
|
115
171
|
}
|
|
172
|
+
addProjectTag(
|
|
173
|
+
projectConfig,
|
|
174
|
+
ProjectTagConstants.Platform.TAG_ID,
|
|
175
|
+
projectConfig.targets.build.options.platform === "node" ? ProjectTagConstants.Platform.NODE : projectConfig.targets.build.options.platform === "worker" ? ProjectTagConstants.Platform.WORKER : projectConfig.targets.build.options.platform === "browser" ? ProjectTagConstants.Platform.BROWSER : ProjectTagConstants.Platform.NEUTRAL,
|
|
176
|
+
{ overwrite: false }
|
|
177
|
+
);
|
|
116
178
|
createProjectTsConfigJson(tree, options);
|
|
117
179
|
(0, import_devkit.addProjectConfiguration)(tree, options.name, projectConfig);
|
|
118
180
|
let repository = {
|
|
119
181
|
type: "github",
|
|
120
|
-
url:
|
|
182
|
+
url: config?.repository || `https://github.com/${config?.organization || "storm-software"}/${config?.namespace || config?.name || "repository"}.git`
|
|
121
183
|
};
|
|
122
|
-
let description = schema.description
|
|
184
|
+
let description = schema.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
123
185
|
if (tree.exists("package.json")) {
|
|
124
186
|
const packageJson = (0, import_devkit.readJson)(tree, "package.json");
|
|
125
187
|
if (packageJson?.repository) {
|
|
@@ -66405,7 +66405,7 @@ var init_schema = __esm({
|
|
|
66405
66405
|
worker: z3.string().trim().default("Stormie-Bot").describe(
|
|
66406
66406
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
66407
66407
|
),
|
|
66408
|
-
|
|
66408
|
+
envName: z3.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment name for the package"),
|
|
66409
66409
|
workspaceRoot: z3.string().trim().default("").describe("The root directory of the workspace"),
|
|
66410
66410
|
packageDirectory: z3.string().trim().optional().describe("The root directory of the package"),
|
|
66411
66411
|
externalPackagePatterns: z3.array(z3.string()).default([]).describe(
|
|
@@ -66527,19 +66527,17 @@ var init_get_default_config = __esm({
|
|
|
66527
66527
|
}
|
|
66528
66528
|
};
|
|
66529
66529
|
DEFAULT_STORM_CONFIG = {
|
|
66530
|
-
name: "storm",
|
|
66531
66530
|
namespace: "storm-software",
|
|
66532
|
-
license: "Apache
|
|
66531
|
+
license: "Apache-2.0",
|
|
66533
66532
|
homepage: "https://stormsoftware.com",
|
|
66534
|
-
owner: "@storm-software/
|
|
66533
|
+
owner: "@storm-software/admin",
|
|
66535
66534
|
worker: "stormie-bot",
|
|
66536
66535
|
runtimeDirectory: "node_modules/.storm",
|
|
66537
|
-
cacheDirectory: "node_modules/.cache/storm",
|
|
66538
66536
|
skipCache: false,
|
|
66539
|
-
packageManager: "
|
|
66537
|
+
packageManager: "pnpm",
|
|
66540
66538
|
timezone: "America/New_York",
|
|
66541
66539
|
locale: "en-US",
|
|
66542
|
-
|
|
66540
|
+
envName: "production",
|
|
66543
66541
|
branch: "main",
|
|
66544
66542
|
organization: "storm-software",
|
|
66545
66543
|
configFile: null,
|
|
@@ -67039,7 +67037,7 @@ var init_get_env = __esm({
|
|
|
67039
67037
|
cacheDirectory: correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]),
|
|
67040
67038
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
67041
67039
|
outputDirectory: correctPaths(process.env[`${prefix}OUTPUT_DIRECTORY`]),
|
|
67042
|
-
|
|
67040
|
+
envName: process.env[`${prefix}ENV_NAME`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
67043
67041
|
// ci:
|
|
67044
67042
|
// process.env[`${prefix}CI`] !== undefined
|
|
67045
67043
|
// ? Boolean(
|
|
@@ -67268,10 +67266,10 @@ var init_set_env = __esm({
|
|
|
67268
67266
|
config.outputDirectory
|
|
67269
67267
|
);
|
|
67270
67268
|
}
|
|
67271
|
-
if (config.
|
|
67272
|
-
process.env[`${prefix}
|
|
67273
|
-
process.env.NODE_ENV = config.
|
|
67274
|
-
process.env.ENVIRONMENT = config.
|
|
67269
|
+
if (config.envName) {
|
|
67270
|
+
process.env[`${prefix}ENV_NAME`] = config.envName;
|
|
67271
|
+
process.env.NODE_ENV = config.envName;
|
|
67272
|
+
process.env.ENVIRONMENT = config.envName;
|
|
67275
67273
|
}
|
|
67276
67274
|
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
67277
67275
|
for (const key of Object.keys(config.colors)) {
|
|
@@ -66405,7 +66405,7 @@ var init_schema = __esm({
|
|
|
66405
66405
|
worker: z3.string().trim().default("Stormie-Bot").describe(
|
|
66406
66406
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
66407
66407
|
),
|
|
66408
|
-
|
|
66408
|
+
envName: z3.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment name for the package"),
|
|
66409
66409
|
workspaceRoot: z3.string().trim().default("").describe("The root directory of the workspace"),
|
|
66410
66410
|
packageDirectory: z3.string().trim().optional().describe("The root directory of the package"),
|
|
66411
66411
|
externalPackagePatterns: z3.array(z3.string()).default([]).describe(
|
|
@@ -66527,19 +66527,17 @@ var init_get_default_config = __esm({
|
|
|
66527
66527
|
}
|
|
66528
66528
|
};
|
|
66529
66529
|
DEFAULT_STORM_CONFIG = {
|
|
66530
|
-
name: "storm",
|
|
66531
66530
|
namespace: "storm-software",
|
|
66532
|
-
license: "Apache
|
|
66531
|
+
license: "Apache-2.0",
|
|
66533
66532
|
homepage: "https://stormsoftware.com",
|
|
66534
|
-
owner: "@storm-software/
|
|
66533
|
+
owner: "@storm-software/admin",
|
|
66535
66534
|
worker: "stormie-bot",
|
|
66536
66535
|
runtimeDirectory: "node_modules/.storm",
|
|
66537
|
-
cacheDirectory: "node_modules/.cache/storm",
|
|
66538
66536
|
skipCache: false,
|
|
66539
|
-
packageManager: "
|
|
66537
|
+
packageManager: "pnpm",
|
|
66540
66538
|
timezone: "America/New_York",
|
|
66541
66539
|
locale: "en-US",
|
|
66542
|
-
|
|
66540
|
+
envName: "production",
|
|
66543
66541
|
branch: "main",
|
|
66544
66542
|
organization: "storm-software",
|
|
66545
66543
|
configFile: null,
|
|
@@ -67039,7 +67037,7 @@ var init_get_env = __esm({
|
|
|
67039
67037
|
cacheDirectory: correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]),
|
|
67040
67038
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
67041
67039
|
outputDirectory: correctPaths(process.env[`${prefix}OUTPUT_DIRECTORY`]),
|
|
67042
|
-
|
|
67040
|
+
envName: process.env[`${prefix}ENV_NAME`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
67043
67041
|
// ci:
|
|
67044
67042
|
// process.env[`${prefix}CI`] !== undefined
|
|
67045
67043
|
// ? Boolean(
|
|
@@ -67268,10 +67266,10 @@ var init_set_env = __esm({
|
|
|
67268
67266
|
config.outputDirectory
|
|
67269
67267
|
);
|
|
67270
67268
|
}
|
|
67271
|
-
if (config.
|
|
67272
|
-
process.env[`${prefix}
|
|
67273
|
-
process.env.NODE_ENV = config.
|
|
67274
|
-
process.env.ENVIRONMENT = config.
|
|
67269
|
+
if (config.envName) {
|
|
67270
|
+
process.env[`${prefix}ENV_NAME`] = config.envName;
|
|
67271
|
+
process.env.NODE_ENV = config.envName;
|
|
67272
|
+
process.env.ENVIRONMENT = config.envName;
|
|
67275
67273
|
}
|
|
67276
67274
|
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
67277
67275
|
for (const key of Object.keys(config.colors)) {
|
|
@@ -66405,7 +66405,7 @@ var init_schema = __esm({
|
|
|
66405
66405
|
worker: z3.string().trim().default("Stormie-Bot").describe(
|
|
66406
66406
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
66407
66407
|
),
|
|
66408
|
-
|
|
66408
|
+
envName: z3.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment name for the package"),
|
|
66409
66409
|
workspaceRoot: z3.string().trim().default("").describe("The root directory of the workspace"),
|
|
66410
66410
|
packageDirectory: z3.string().trim().optional().describe("The root directory of the package"),
|
|
66411
66411
|
externalPackagePatterns: z3.array(z3.string()).default([]).describe(
|
|
@@ -66527,19 +66527,17 @@ var init_get_default_config = __esm({
|
|
|
66527
66527
|
}
|
|
66528
66528
|
};
|
|
66529
66529
|
DEFAULT_STORM_CONFIG = {
|
|
66530
|
-
name: "storm",
|
|
66531
66530
|
namespace: "storm-software",
|
|
66532
|
-
license: "Apache
|
|
66531
|
+
license: "Apache-2.0",
|
|
66533
66532
|
homepage: "https://stormsoftware.com",
|
|
66534
|
-
owner: "@storm-software/
|
|
66533
|
+
owner: "@storm-software/admin",
|
|
66535
66534
|
worker: "stormie-bot",
|
|
66536
66535
|
runtimeDirectory: "node_modules/.storm",
|
|
66537
|
-
cacheDirectory: "node_modules/.cache/storm",
|
|
66538
66536
|
skipCache: false,
|
|
66539
|
-
packageManager: "
|
|
66537
|
+
packageManager: "pnpm",
|
|
66540
66538
|
timezone: "America/New_York",
|
|
66541
66539
|
locale: "en-US",
|
|
66542
|
-
|
|
66540
|
+
envName: "production",
|
|
66543
66541
|
branch: "main",
|
|
66544
66542
|
organization: "storm-software",
|
|
66545
66543
|
configFile: null,
|
|
@@ -67039,7 +67037,7 @@ var init_get_env = __esm({
|
|
|
67039
67037
|
cacheDirectory: correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]),
|
|
67040
67038
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
67041
67039
|
outputDirectory: correctPaths(process.env[`${prefix}OUTPUT_DIRECTORY`]),
|
|
67042
|
-
|
|
67040
|
+
envName: process.env[`${prefix}ENV_NAME`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
67043
67041
|
// ci:
|
|
67044
67042
|
// process.env[`${prefix}CI`] !== undefined
|
|
67045
67043
|
// ? Boolean(
|
|
@@ -67268,10 +67266,10 @@ var init_set_env = __esm({
|
|
|
67268
67266
|
config.outputDirectory
|
|
67269
67267
|
);
|
|
67270
67268
|
}
|
|
67271
|
-
if (config.
|
|
67272
|
-
process.env[`${prefix}
|
|
67273
|
-
process.env.NODE_ENV = config.
|
|
67274
|
-
process.env.ENVIRONMENT = config.
|
|
67269
|
+
if (config.envName) {
|
|
67270
|
+
process.env[`${prefix}ENV_NAME`] = config.envName;
|
|
67271
|
+
process.env.NODE_ENV = config.envName;
|
|
67272
|
+
process.env.ENVIRONMENT = config.envName;
|
|
67275
67273
|
}
|
|
67276
67274
|
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
67277
67275
|
for (const key of Object.keys(config.colors)) {
|
|
@@ -66405,7 +66405,7 @@ var init_schema = __esm({
|
|
|
66405
66405
|
worker: z3.string().trim().default("Stormie-Bot").describe(
|
|
66406
66406
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
66407
66407
|
),
|
|
66408
|
-
|
|
66408
|
+
envName: z3.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment name for the package"),
|
|
66409
66409
|
workspaceRoot: z3.string().trim().default("").describe("The root directory of the workspace"),
|
|
66410
66410
|
packageDirectory: z3.string().trim().optional().describe("The root directory of the package"),
|
|
66411
66411
|
externalPackagePatterns: z3.array(z3.string()).default([]).describe(
|
|
@@ -66527,19 +66527,17 @@ var init_get_default_config = __esm({
|
|
|
66527
66527
|
}
|
|
66528
66528
|
};
|
|
66529
66529
|
DEFAULT_STORM_CONFIG = {
|
|
66530
|
-
name: "storm",
|
|
66531
66530
|
namespace: "storm-software",
|
|
66532
|
-
license: "Apache
|
|
66531
|
+
license: "Apache-2.0",
|
|
66533
66532
|
homepage: "https://stormsoftware.com",
|
|
66534
|
-
owner: "@storm-software/
|
|
66533
|
+
owner: "@storm-software/admin",
|
|
66535
66534
|
worker: "stormie-bot",
|
|
66536
66535
|
runtimeDirectory: "node_modules/.storm",
|
|
66537
|
-
cacheDirectory: "node_modules/.cache/storm",
|
|
66538
66536
|
skipCache: false,
|
|
66539
|
-
packageManager: "
|
|
66537
|
+
packageManager: "pnpm",
|
|
66540
66538
|
timezone: "America/New_York",
|
|
66541
66539
|
locale: "en-US",
|
|
66542
|
-
|
|
66540
|
+
envName: "production",
|
|
66543
66541
|
branch: "main",
|
|
66544
66542
|
organization: "storm-software",
|
|
66545
66543
|
configFile: null,
|
|
@@ -67039,7 +67037,7 @@ var init_get_env = __esm({
|
|
|
67039
67037
|
cacheDirectory: correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]),
|
|
67040
67038
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
67041
67039
|
outputDirectory: correctPaths(process.env[`${prefix}OUTPUT_DIRECTORY`]),
|
|
67042
|
-
|
|
67040
|
+
envName: process.env[`${prefix}ENV_NAME`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
67043
67041
|
// ci:
|
|
67044
67042
|
// process.env[`${prefix}CI`] !== undefined
|
|
67045
67043
|
// ? Boolean(
|
|
@@ -67268,10 +67266,10 @@ var init_set_env = __esm({
|
|
|
67268
67266
|
config.outputDirectory
|
|
67269
67267
|
);
|
|
67270
67268
|
}
|
|
67271
|
-
if (config.
|
|
67272
|
-
process.env[`${prefix}
|
|
67273
|
-
process.env.NODE_ENV = config.
|
|
67274
|
-
process.env.ENVIRONMENT = config.
|
|
67269
|
+
if (config.envName) {
|
|
67270
|
+
process.env[`${prefix}ENV_NAME`] = config.envName;
|
|
67271
|
+
process.env.NODE_ENV = config.envName;
|
|
67272
|
+
process.env.ENVIRONMENT = config.envName;
|
|
67275
67273
|
}
|
|
67276
67274
|
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
67277
67275
|
for (const key of Object.keys(config.colors)) {
|