@storm-software/workspace-tools 1.119.0 → 1.121.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 +16 -0
- package/README.md +1 -1
- package/declarations.d.ts +66 -0
- package/index.js +88 -1
- package/meta.json +1 -1
- package/package.json +4 -2
- package/packages/workspace-tools/src/base/typescript-library-generator.d.ts +2 -14
- package/packages/workspace-tools/src/generators/browser-library/generator.d.ts +1 -1
- package/packages/workspace-tools/src/generators/neutral-library/generator.d.ts +1 -1
- package/packages/workspace-tools/src/generators/node-library/generator.d.ts +1 -1
- package/packages/workspace-tools/src/plugins/typescript/project-config.d.ts +1 -1
- package/packages/workspace-tools/src/utils/index.d.ts +1 -0
- package/packages/workspace-tools/src/utils/project-tags.d.ts +30 -0
- package/src/generators/browser-library/generator.js +8 -2
- package/src/generators/neutral-library/schema.d.ts +1 -1
- package/src/generators/node-library/generator.js +3 -1
- package/src/plugins/rust/index.js +67 -15
- package/src/plugins/typescript/index.js +92 -17
- package/src/utils/create-cli-options.js +46 -0
- package/src/utils/index.js +85 -0
- package/src/utils/lock-file.js +149 -0
- package/src/utils/project-tags.js +109 -0
- package/src/utils/toml.js +2969 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/workspace-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.121.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "⚡ A Nx plugin package that contains various executors and generators used in a Storm workspaces.",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
"./executors/*/schema.json": "./src/executors/*/schema.json",
|
|
35
35
|
"./plugins/rust": "./src/plugins/rust/index.js",
|
|
36
36
|
"./plugins/typescript": "./src/plugins/typescript/index.js",
|
|
37
|
-
"./preset": "./src/generators/preset/preset.js"
|
|
37
|
+
"./preset": "./src/generators/preset/preset.js",
|
|
38
|
+
"./utils": "./src/utils/index.js",
|
|
39
|
+
"./utils/*": "./src/utils/*.js"
|
|
38
40
|
},
|
|
39
41
|
"typings": "./declarations.d.ts",
|
|
40
42
|
"keywords": [
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { type GeneratorCallback, type Tree } from "@nx/devkit";
|
|
2
|
-
import type { AddLintOptions
|
|
3
|
-
import type {
|
|
4
|
-
import type { Platform } from "../executors/tsup/schema";
|
|
5
|
-
export type TypeScriptLibraryGeneratorSchema = Omit<LibraryGeneratorSchema, "js" | "pascalCaseFiles" | "skipFormat" | "skipTsConfig" | "skipPackageJson" | "includeBabelRc" | "unitTestRunner" | "linter" | "testEnvironment" | "config" | "compiler" | "bundler" | "skipTypeCheck" | "minimal"> & {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
buildExecutor: string;
|
|
9
|
-
platform?: Platform;
|
|
10
|
-
devDependencies?: Record<string, string>;
|
|
11
|
-
peerDependencies?: Record<string, string>;
|
|
12
|
-
peerDependenciesMeta?: Record<string, any>;
|
|
13
|
-
tsConfigOptions?: Record<string, any>;
|
|
14
|
-
};
|
|
15
|
-
export type TypeScriptLibraryGeneratorNormalizedSchema = TypeScriptLibraryGeneratorSchema & NormalizedSchema;
|
|
2
|
+
import type { AddLintOptions } from "@nx/js/src/generators/library/library";
|
|
3
|
+
import type { TypeScriptLibraryGeneratorNormalizedSchema, TypeScriptLibraryGeneratorSchema } from "../../declarations.d";
|
|
16
4
|
export declare function typeScriptLibraryGeneratorFn(tree: Tree, schema: TypeScriptLibraryGeneratorSchema): Promise<null>;
|
|
17
5
|
export declare function addLint(tree: Tree, options: AddLintOptions): Promise<GeneratorCallback>;
|
|
18
6
|
export declare function getOutputPath(options: TypeScriptLibraryGeneratorNormalizedSchema): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Tree } from "@nx/devkit";
|
|
2
2
|
import type { BrowserLibraryGeneratorSchema } from "./schema";
|
|
3
3
|
export declare function browserLibraryGeneratorFn(tree: Tree, schema: BrowserLibraryGeneratorSchema): Promise<null>;
|
|
4
|
-
declare const _default: (tree: Tree, _options: BrowserLibraryGeneratorSchema) => Promise<import("../../../declarations").BaseGeneratorResult | import("@nx/devkit").GeneratorCallback>;
|
|
4
|
+
declare const _default: (tree: Tree, _options: BrowserLibraryGeneratorSchema) => Promise<import("../../../declarations.d").BaseGeneratorResult | import("@nx/devkit").GeneratorCallback>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tree } from "@nx/devkit";
|
|
2
2
|
import { NeutralLibraryGeneratorSchema } from "./schema";
|
|
3
3
|
export declare function neutralLibraryGeneratorFn(tree: Tree, schema: NeutralLibraryGeneratorSchema): Promise<null>;
|
|
4
|
-
declare const _default: (tree: Tree, _options: NeutralLibraryGeneratorSchema) => Promise<import("../../../declarations").BaseGeneratorResult | import("@nx/devkit").GeneratorCallback>;
|
|
4
|
+
declare const _default: (tree: Tree, _options: NeutralLibraryGeneratorSchema) => Promise<import("../../../declarations.d").BaseGeneratorResult | import("@nx/devkit").GeneratorCallback>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Tree } from "@nx/devkit";
|
|
2
2
|
import type { NodeLibraryGeneratorSchema } from "./schema";
|
|
3
3
|
export declare function nodeLibraryGeneratorFn(tree: Tree, schema: NodeLibraryGeneratorSchema): Promise<null>;
|
|
4
|
-
declare const _default: (tree: Tree, _options: NodeLibraryGeneratorSchema) => Promise<import("../../../declarations").BaseGeneratorResult | import("@nx/devkit").GeneratorCallback>;
|
|
4
|
+
declare const _default: (tree: Tree, _options: NodeLibraryGeneratorSchema) => Promise<import("../../../declarations.d").BaseGeneratorResult | import("@nx/devkit").GeneratorCallback>;
|
|
5
5
|
export default _default;
|
|
@@ -4,7 +4,6 @@ export declare const createNodes: (string | ((file: any, _: any, ctx: any) => {
|
|
|
4
4
|
} | {
|
|
5
5
|
projects: {
|
|
6
6
|
[x: string]: {
|
|
7
|
-
tags: string[];
|
|
8
7
|
targets: {
|
|
9
8
|
[targetName: string]: import("nx/src/config/workspace-json-project-json").TargetConfiguration<any>;
|
|
10
9
|
};
|
|
@@ -27,6 +26,7 @@ export declare const createNodes: (string | ((file: any, _: any, ctx: any) => {
|
|
|
27
26
|
namedInputs?: {
|
|
28
27
|
[inputName: string]: (string | import("nx/src/config/workspace-json-project-json").InputDefinition)[];
|
|
29
28
|
} | undefined;
|
|
29
|
+
tags?: string[] | undefined;
|
|
30
30
|
metadata?: import("nx/src/config/workspace-json-project-json").ProjectMetadata | undefined;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ProjectConfiguration } from "@nx/devkit";
|
|
2
|
+
import { ProjectTagDistStyleValue, ProjectTagLanguageValue, ProjectTagTypeValue, ProjectTagVariant } from "../../declarations.d";
|
|
3
|
+
export declare const ProjectTagConstants: {
|
|
4
|
+
readonly Language: {
|
|
5
|
+
readonly TAG_ID: ProjectTagVariant;
|
|
6
|
+
readonly TYPESCRIPT: ProjectTagLanguageValue;
|
|
7
|
+
readonly RUST: ProjectTagLanguageValue;
|
|
8
|
+
};
|
|
9
|
+
readonly ProjectType: {
|
|
10
|
+
readonly TAG_ID: ProjectTagVariant;
|
|
11
|
+
readonly LIBRARY: ProjectTagTypeValue;
|
|
12
|
+
readonly APPLICATION: ProjectTagTypeValue;
|
|
13
|
+
};
|
|
14
|
+
readonly DistStyle: {
|
|
15
|
+
readonly TAG_ID: ProjectTagVariant;
|
|
16
|
+
readonly NORMAL: ProjectTagDistStyleValue;
|
|
17
|
+
readonly CLEAN: ProjectTagDistStyleValue;
|
|
18
|
+
};
|
|
19
|
+
readonly Provider: {
|
|
20
|
+
readonly TAG_ID: ProjectTagVariant;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const formatProjectTag: (variant: ProjectTagVariant, value: string) => string;
|
|
24
|
+
export declare const hasProjectTag: (project: ProjectConfiguration, variant: ProjectTagVariant) => boolean;
|
|
25
|
+
export declare const getProjectTag: (project: ProjectConfiguration, variant: ProjectTagVariant) => string | undefined;
|
|
26
|
+
export declare const isEqualProjectTag: (project: ProjectConfiguration, variant: ProjectTagVariant, value: string) => boolean;
|
|
27
|
+
export declare const addProjectTag: (project: ProjectConfiguration, variant: ProjectTagVariant, value: string, options?: {
|
|
28
|
+
overwrite?: boolean;
|
|
29
|
+
}) => void;
|
|
30
|
+
export declare const setDefaultProjectTags: (project: ProjectConfiguration) => void;
|
|
@@ -374547,7 +374547,9 @@ async function browserLibraryGeneratorFn(tree, schema) {
|
|
|
374547
374547
|
buildExecutor: "@storm-software/workspace-tools:tsup-browser"
|
|
374548
374548
|
};
|
|
374549
374549
|
const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
|
|
374550
|
-
const { className, name, propertyName } = (0, import_devkit2.names)(
|
|
374550
|
+
const { className, name, propertyName } = (0, import_devkit2.names)(
|
|
374551
|
+
options.projectNames.projectFileName
|
|
374552
|
+
);
|
|
374551
374553
|
(0, import_devkit2.generateFiles)(tree, filesDir, options.projectRoot, {
|
|
374552
374554
|
...schema,
|
|
374553
374555
|
dot: ".",
|
|
@@ -374566,7 +374568,11 @@ async function browserLibraryGeneratorFn(tree, schema) {
|
|
|
374566
374568
|
tsConfigOptions: {
|
|
374567
374569
|
compilerOptions: {
|
|
374568
374570
|
jsx: "react",
|
|
374569
|
-
types: [
|
|
374571
|
+
types: [
|
|
374572
|
+
"node",
|
|
374573
|
+
"@nx/react/typings/cssmodule.d.ts",
|
|
374574
|
+
"@nx/react/typings/image.d.ts"
|
|
374575
|
+
]
|
|
374570
374576
|
}
|
|
374571
374577
|
}
|
|
374572
374578
|
});
|
|
@@ -374534,7 +374534,9 @@ async function nodeLibraryGeneratorFn(tree, schema) {
|
|
|
374534
374534
|
buildExecutor: "@storm-software/workspace-tools:tsup-node"
|
|
374535
374535
|
};
|
|
374536
374536
|
const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
|
|
374537
|
-
const { className, name, propertyName } = (0, import_devkit2.names)(
|
|
374537
|
+
const { className, name, propertyName } = (0, import_devkit2.names)(
|
|
374538
|
+
options.projectNames.projectFileName
|
|
374539
|
+
);
|
|
374538
374540
|
(0, import_devkit2.generateFiles)(tree, filesDir, options.projectRoot, {
|
|
374539
374541
|
...schema,
|
|
374540
374542
|
dot: ".",
|
|
@@ -78,6 +78,66 @@ function isExternal(packageOrDep, workspaceRoot3) {
|
|
|
78
78
|
|
|
79
79
|
// packages/workspace-tools/src/plugins/rust/cargo-toml.ts
|
|
80
80
|
var import_node_fs = require("node:fs");
|
|
81
|
+
|
|
82
|
+
// packages/workspace-tools/src/utils/project-tags.ts
|
|
83
|
+
var ProjectTagConstants = {
|
|
84
|
+
Language: {
|
|
85
|
+
TAG_ID: "language",
|
|
86
|
+
TYPESCRIPT: "typescript",
|
|
87
|
+
RUST: "rust"
|
|
88
|
+
},
|
|
89
|
+
ProjectType: {
|
|
90
|
+
TAG_ID: "type",
|
|
91
|
+
LIBRARY: "library",
|
|
92
|
+
APPLICATION: "application"
|
|
93
|
+
},
|
|
94
|
+
DistStyle: {
|
|
95
|
+
TAG_ID: "dist-style",
|
|
96
|
+
NORMAL: "normal",
|
|
97
|
+
CLEAN: "clean"
|
|
98
|
+
},
|
|
99
|
+
Provider: {
|
|
100
|
+
TAG_ID: "provider"
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
var formatProjectTag = (variant, value) => {
|
|
104
|
+
return `${variant}:${value}`;
|
|
105
|
+
};
|
|
106
|
+
var hasProjectTag = (project, variant) => {
|
|
107
|
+
project.tags = project.tags ?? [];
|
|
108
|
+
const prefix = formatProjectTag(variant, "");
|
|
109
|
+
return project.tags.some(
|
|
110
|
+
(tag) => tag.startsWith(prefix) && tag.length > prefix.length
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
var addProjectTag = (project, variant, value, options = {
|
|
114
|
+
overwrite: false
|
|
115
|
+
}) => {
|
|
116
|
+
project.tags = project.tags ?? [];
|
|
117
|
+
if (options.overwrite || !hasProjectTag(project, variant)) {
|
|
118
|
+
project.tags = project.tags.filter(
|
|
119
|
+
(tag) => !tag.startsWith(formatProjectTag(variant, ""))
|
|
120
|
+
);
|
|
121
|
+
project.tags.push(formatProjectTag(variant, value));
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
var setDefaultProjectTags = (project) => {
|
|
125
|
+
project.tags = project.tags ?? [];
|
|
126
|
+
addProjectTag(
|
|
127
|
+
project,
|
|
128
|
+
ProjectTagConstants.ProjectType.TAG_ID,
|
|
129
|
+
project.projectType === "application" ? ProjectTagConstants.ProjectType.APPLICATION : ProjectTagConstants.ProjectType.LIBRARY,
|
|
130
|
+
{ overwrite: true }
|
|
131
|
+
);
|
|
132
|
+
addProjectTag(
|
|
133
|
+
project,
|
|
134
|
+
ProjectTagConstants.DistStyle.TAG_ID,
|
|
135
|
+
project.targets && Object.keys(project.targets).includes("clean-package") ? ProjectTagConstants.DistStyle.CLEAN : ProjectTagConstants.DistStyle.NORMAL,
|
|
136
|
+
{ overwrite: true }
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// packages/workspace-tools/src/plugins/rust/cargo-toml.ts
|
|
81
141
|
var name = "storm-software/rust/cargo-toml";
|
|
82
142
|
var createNodes = [
|
|
83
143
|
"*/**/Cargo.toml",
|
|
@@ -205,23 +265,15 @@ var createNodes = [
|
|
|
205
265
|
}
|
|
206
266
|
};
|
|
207
267
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
if (!tags.some((tag) => tag.startsWith("dist-style:"))) {
|
|
218
|
-
tags.push(
|
|
219
|
-
`dist-style:${Object.keys(project.targets).includes("clean-package") ? "dist-style:clean" : "dist-style:normal"}`
|
|
220
|
-
);
|
|
221
|
-
}
|
|
268
|
+
addProjectTag(
|
|
269
|
+
project,
|
|
270
|
+
ProjectTagConstants.Language.TAG_ID,
|
|
271
|
+
ProjectTagConstants.Language.RUST,
|
|
272
|
+
{ overwrite: true }
|
|
273
|
+
);
|
|
274
|
+
setDefaultProjectTags(project);
|
|
222
275
|
projects[root] = {
|
|
223
276
|
...project,
|
|
224
|
-
tags,
|
|
225
277
|
release: {
|
|
226
278
|
...project.release,
|
|
227
279
|
version: {
|
|
@@ -29,6 +29,79 @@ var import_node_fs = require("node:fs");
|
|
|
29
29
|
var import_node_path = require("node:path");
|
|
30
30
|
var import_fileutils = require("nx/src/utils/fileutils");
|
|
31
31
|
var import_package_json = require("nx/src/utils/package-json");
|
|
32
|
+
|
|
33
|
+
// packages/workspace-tools/src/utils/project-tags.ts
|
|
34
|
+
var ProjectTagConstants = {
|
|
35
|
+
Language: {
|
|
36
|
+
TAG_ID: "language",
|
|
37
|
+
TYPESCRIPT: "typescript",
|
|
38
|
+
RUST: "rust"
|
|
39
|
+
},
|
|
40
|
+
ProjectType: {
|
|
41
|
+
TAG_ID: "type",
|
|
42
|
+
LIBRARY: "library",
|
|
43
|
+
APPLICATION: "application"
|
|
44
|
+
},
|
|
45
|
+
DistStyle: {
|
|
46
|
+
TAG_ID: "dist-style",
|
|
47
|
+
NORMAL: "normal",
|
|
48
|
+
CLEAN: "clean"
|
|
49
|
+
},
|
|
50
|
+
Provider: {
|
|
51
|
+
TAG_ID: "provider"
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var formatProjectTag = (variant, value) => {
|
|
55
|
+
return `${variant}:${value}`;
|
|
56
|
+
};
|
|
57
|
+
var hasProjectTag = (project, variant) => {
|
|
58
|
+
project.tags = project.tags ?? [];
|
|
59
|
+
const prefix = formatProjectTag(variant, "");
|
|
60
|
+
return project.tags.some(
|
|
61
|
+
(tag) => tag.startsWith(prefix) && tag.length > prefix.length
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
var getProjectTag = (project, variant) => {
|
|
65
|
+
if (!hasProjectTag(project, variant)) {
|
|
66
|
+
return void 0;
|
|
67
|
+
}
|
|
68
|
+
project.tags = project.tags ?? [];
|
|
69
|
+
const prefix = formatProjectTag(variant, "");
|
|
70
|
+
const tag = project.tags.find((tag2) => tag2.startsWith(prefix));
|
|
71
|
+
return tag?.replace(prefix, "");
|
|
72
|
+
};
|
|
73
|
+
var isEqualProjectTag = (project, variant, value) => {
|
|
74
|
+
const tag = getProjectTag(project, variant);
|
|
75
|
+
return !!(tag && tag?.toUpperCase() === value.toUpperCase());
|
|
76
|
+
};
|
|
77
|
+
var addProjectTag = (project, variant, value, options = {
|
|
78
|
+
overwrite: false
|
|
79
|
+
}) => {
|
|
80
|
+
project.tags = project.tags ?? [];
|
|
81
|
+
if (options.overwrite || !hasProjectTag(project, variant)) {
|
|
82
|
+
project.tags = project.tags.filter(
|
|
83
|
+
(tag) => !tag.startsWith(formatProjectTag(variant, ""))
|
|
84
|
+
);
|
|
85
|
+
project.tags.push(formatProjectTag(variant, value));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var setDefaultProjectTags = (project) => {
|
|
89
|
+
project.tags = project.tags ?? [];
|
|
90
|
+
addProjectTag(
|
|
91
|
+
project,
|
|
92
|
+
ProjectTagConstants.ProjectType.TAG_ID,
|
|
93
|
+
project.projectType === "application" ? ProjectTagConstants.ProjectType.APPLICATION : ProjectTagConstants.ProjectType.LIBRARY,
|
|
94
|
+
{ overwrite: true }
|
|
95
|
+
);
|
|
96
|
+
addProjectTag(
|
|
97
|
+
project,
|
|
98
|
+
ProjectTagConstants.DistStyle.TAG_ID,
|
|
99
|
+
project.targets && Object.keys(project.targets).includes("clean-package") ? ProjectTagConstants.DistStyle.CLEAN : ProjectTagConstants.DistStyle.NORMAL,
|
|
100
|
+
{ overwrite: true }
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// packages/workspace-tools/src/plugins/typescript/project-config.ts
|
|
32
105
|
var name = "storm-software/typescript/project-config";
|
|
33
106
|
var createNodes = [
|
|
34
107
|
"{project.json,**/project.json}",
|
|
@@ -168,10 +241,20 @@ var createNodes = [
|
|
|
168
241
|
executor: "@storm-software/workspace-tools:npm-publish",
|
|
169
242
|
options: {}
|
|
170
243
|
};
|
|
171
|
-
if (project.projectType === "application" ||
|
|
244
|
+
if (project.projectType === "application" || isEqualProjectTag(
|
|
245
|
+
project,
|
|
246
|
+
ProjectTagConstants.ProjectType.TAG_ID,
|
|
247
|
+
ProjectTagConstants.ProjectType.APPLICATION
|
|
248
|
+
) || isEqualProjectTag(
|
|
249
|
+
project,
|
|
250
|
+
ProjectTagConstants.DistStyle.TAG_ID,
|
|
251
|
+
ProjectTagConstants.DistStyle.CLEAN
|
|
252
|
+
)) {
|
|
172
253
|
targets["clean-package"] = {
|
|
173
|
-
cache:
|
|
254
|
+
cache: true,
|
|
174
255
|
dependsOn: ["build"],
|
|
256
|
+
inputs: ["typescript", "^production"],
|
|
257
|
+
outputs: ["{workspaceRoot}/dist/{projectRoot}"],
|
|
175
258
|
executor: "@storm-software/workspace-tools:clean-package",
|
|
176
259
|
options: {
|
|
177
260
|
cleanReadMe: true,
|
|
@@ -181,25 +264,17 @@ var createNodes = [
|
|
|
181
264
|
targets["nx-release-publish"].dependsOn = ["clean-package"];
|
|
182
265
|
}
|
|
183
266
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
if (!tags.some((tag) => tag.startsWith("dist-style:"))) {
|
|
194
|
-
tags.push(
|
|
195
|
-
`dist-style:${Object.keys(targets).includes("clean-package") ? "dist-style:clean" : "dist-style:normal"}`
|
|
196
|
-
);
|
|
197
|
-
}
|
|
267
|
+
addProjectTag(
|
|
268
|
+
project,
|
|
269
|
+
ProjectTagConstants.Language.TAG_ID,
|
|
270
|
+
ProjectTagConstants.Language.TYPESCRIPT,
|
|
271
|
+
{ overwrite: true }
|
|
272
|
+
);
|
|
273
|
+
setDefaultProjectTags(project);
|
|
198
274
|
return project?.name ? {
|
|
199
275
|
projects: {
|
|
200
276
|
[project.name]: {
|
|
201
277
|
...project,
|
|
202
|
-
tags,
|
|
203
278
|
targets,
|
|
204
279
|
release: {
|
|
205
280
|
...project?.release,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/workspace-tools/src/utils/create-cli-options.ts
|
|
20
|
+
var create_cli_options_exports = {};
|
|
21
|
+
__export(create_cli_options_exports, {
|
|
22
|
+
createCliOptions: () => createCliOptions
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(create_cli_options_exports);
|
|
25
|
+
var import_devkit = require("@nx/devkit");
|
|
26
|
+
function createCliOptions(obj) {
|
|
27
|
+
const args = [];
|
|
28
|
+
for (const key in obj) {
|
|
29
|
+
const value = obj[key];
|
|
30
|
+
if (value) {
|
|
31
|
+
const arg = (0, import_devkit.names)(key).fileName;
|
|
32
|
+
if (Array.isArray(value)) {
|
|
33
|
+
args.push(
|
|
34
|
+
`--${arg.toLowerCase()}=${value.map((v) => v.trim()).join(",")}`
|
|
35
|
+
);
|
|
36
|
+
} else {
|
|
37
|
+
args.push(`--${arg.toLowerCase()}=${value}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return args;
|
|
42
|
+
}
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
createCliOptions
|
|
46
|
+
});
|
package/src/utils/index.js
CHANGED
|
@@ -296572,8 +296572,10 @@ __export(utils_exports, {
|
|
|
296572
296572
|
NPM_LOCK_PATH: () => NPM_LOCK_PATH,
|
|
296573
296573
|
PNPM_LOCK_FILE: () => PNPM_LOCK_FILE,
|
|
296574
296574
|
PNPM_LOCK_PATH: () => PNPM_LOCK_PATH,
|
|
296575
|
+
ProjectTagConstants: () => ProjectTagConstants,
|
|
296575
296576
|
YARN_LOCK_FILE: () => YARN_LOCK_FILE,
|
|
296576
296577
|
YARN_LOCK_PATH: () => YARN_LOCK_PATH,
|
|
296578
|
+
addProjectTag: () => addProjectTag,
|
|
296577
296579
|
applyWorkspaceExecutorTokens: () => applyWorkspaceExecutorTokens,
|
|
296578
296580
|
cargoCommand: () => cargoCommand,
|
|
296579
296581
|
cargoCommandSync: () => cargoCommandSync,
|
|
@@ -296582,12 +296584,16 @@ __export(utils_exports, {
|
|
|
296582
296584
|
childProcess: () => childProcess2,
|
|
296583
296585
|
createCliOptions: () => createCliOptions,
|
|
296584
296586
|
eslintVersion: () => eslintVersion,
|
|
296587
|
+
formatProjectTag: () => formatProjectTag,
|
|
296585
296588
|
getLockFileDependencies: () => getLockFileDependencies,
|
|
296586
296589
|
getLockFileName: () => getLockFileName,
|
|
296587
296590
|
getLockFileNodes: () => getLockFileNodes,
|
|
296588
296591
|
getProjectConfiguration: () => getProjectConfiguration,
|
|
296589
296592
|
getProjectConfigurations: () => getProjectConfigurations,
|
|
296593
|
+
getProjectTag: () => getProjectTag,
|
|
296590
296594
|
getTypiaTransform: () => getTypiaTransform,
|
|
296595
|
+
hasProjectTag: () => hasProjectTag,
|
|
296596
|
+
isEqualProjectTag: () => isEqualProjectTag,
|
|
296591
296597
|
isExternal: () => isExternal,
|
|
296592
296598
|
lintStagedVersion: () => lintStagedVersion,
|
|
296593
296599
|
lockFileExists: () => lockFileExists,
|
|
@@ -296603,6 +296609,7 @@ __export(utils_exports, {
|
|
|
296603
296609
|
prettierVersion: () => prettierVersion,
|
|
296604
296610
|
runProcess: () => runProcess,
|
|
296605
296611
|
semanticReleaseVersion: () => semanticReleaseVersion,
|
|
296612
|
+
setDefaultProjectTags: () => setDefaultProjectTags,
|
|
296606
296613
|
stringifyCargoToml: () => stringifyCargoToml,
|
|
296607
296614
|
swcCliVersion: () => swcCliVersion,
|
|
296608
296615
|
swcCoreVersion: () => swcCoreVersion,
|
|
@@ -299831,6 +299838,77 @@ function createCliOptions(obj) {
|
|
|
299831
299838
|
}
|
|
299832
299839
|
return args;
|
|
299833
299840
|
}
|
|
299841
|
+
|
|
299842
|
+
// packages/workspace-tools/src/utils/project-tags.ts
|
|
299843
|
+
var ProjectTagConstants = {
|
|
299844
|
+
Language: {
|
|
299845
|
+
TAG_ID: "language",
|
|
299846
|
+
TYPESCRIPT: "typescript",
|
|
299847
|
+
RUST: "rust"
|
|
299848
|
+
},
|
|
299849
|
+
ProjectType: {
|
|
299850
|
+
TAG_ID: "type",
|
|
299851
|
+
LIBRARY: "library",
|
|
299852
|
+
APPLICATION: "application"
|
|
299853
|
+
},
|
|
299854
|
+
DistStyle: {
|
|
299855
|
+
TAG_ID: "dist-style",
|
|
299856
|
+
NORMAL: "normal",
|
|
299857
|
+
CLEAN: "clean"
|
|
299858
|
+
},
|
|
299859
|
+
Provider: {
|
|
299860
|
+
TAG_ID: "provider"
|
|
299861
|
+
}
|
|
299862
|
+
};
|
|
299863
|
+
var formatProjectTag = (variant, value2) => {
|
|
299864
|
+
return `${variant}:${value2}`;
|
|
299865
|
+
};
|
|
299866
|
+
var hasProjectTag = (project, variant) => {
|
|
299867
|
+
project.tags = project.tags ?? [];
|
|
299868
|
+
const prefix = formatProjectTag(variant, "");
|
|
299869
|
+
return project.tags.some(
|
|
299870
|
+
(tag) => tag.startsWith(prefix) && tag.length > prefix.length
|
|
299871
|
+
);
|
|
299872
|
+
};
|
|
299873
|
+
var getProjectTag = (project, variant) => {
|
|
299874
|
+
if (!hasProjectTag(project, variant)) {
|
|
299875
|
+
return void 0;
|
|
299876
|
+
}
|
|
299877
|
+
project.tags = project.tags ?? [];
|
|
299878
|
+
const prefix = formatProjectTag(variant, "");
|
|
299879
|
+
const tag = project.tags.find((tag2) => tag2.startsWith(prefix));
|
|
299880
|
+
return tag?.replace(prefix, "");
|
|
299881
|
+
};
|
|
299882
|
+
var isEqualProjectTag = (project, variant, value2) => {
|
|
299883
|
+
const tag = getProjectTag(project, variant);
|
|
299884
|
+
return !!(tag && tag?.toUpperCase() === value2.toUpperCase());
|
|
299885
|
+
};
|
|
299886
|
+
var addProjectTag = (project, variant, value2, options = {
|
|
299887
|
+
overwrite: false
|
|
299888
|
+
}) => {
|
|
299889
|
+
project.tags = project.tags ?? [];
|
|
299890
|
+
if (options.overwrite || !hasProjectTag(project, variant)) {
|
|
299891
|
+
project.tags = project.tags.filter(
|
|
299892
|
+
(tag) => !tag.startsWith(formatProjectTag(variant, ""))
|
|
299893
|
+
);
|
|
299894
|
+
project.tags.push(formatProjectTag(variant, value2));
|
|
299895
|
+
}
|
|
299896
|
+
};
|
|
299897
|
+
var setDefaultProjectTags = (project) => {
|
|
299898
|
+
project.tags = project.tags ?? [];
|
|
299899
|
+
addProjectTag(
|
|
299900
|
+
project,
|
|
299901
|
+
ProjectTagConstants.ProjectType.TAG_ID,
|
|
299902
|
+
project.projectType === "application" ? ProjectTagConstants.ProjectType.APPLICATION : ProjectTagConstants.ProjectType.LIBRARY,
|
|
299903
|
+
{ overwrite: true }
|
|
299904
|
+
);
|
|
299905
|
+
addProjectTag(
|
|
299906
|
+
project,
|
|
299907
|
+
ProjectTagConstants.DistStyle.TAG_ID,
|
|
299908
|
+
project.targets && Object.keys(project.targets).includes("clean-package") ? ProjectTagConstants.DistStyle.CLEAN : ProjectTagConstants.DistStyle.NORMAL,
|
|
299909
|
+
{ overwrite: true }
|
|
299910
|
+
);
|
|
299911
|
+
};
|
|
299834
299912
|
// Annotate the CommonJS export names for ESM import in node:
|
|
299835
299913
|
0 && (module.exports = {
|
|
299836
299914
|
LOCK_FILES,
|
|
@@ -299838,8 +299916,10 @@ function createCliOptions(obj) {
|
|
|
299838
299916
|
NPM_LOCK_PATH,
|
|
299839
299917
|
PNPM_LOCK_FILE,
|
|
299840
299918
|
PNPM_LOCK_PATH,
|
|
299919
|
+
ProjectTagConstants,
|
|
299841
299920
|
YARN_LOCK_FILE,
|
|
299842
299921
|
YARN_LOCK_PATH,
|
|
299922
|
+
addProjectTag,
|
|
299843
299923
|
applyWorkspaceExecutorTokens,
|
|
299844
299924
|
cargoCommand,
|
|
299845
299925
|
cargoCommandSync,
|
|
@@ -299848,12 +299928,16 @@ function createCliOptions(obj) {
|
|
|
299848
299928
|
childProcess,
|
|
299849
299929
|
createCliOptions,
|
|
299850
299930
|
eslintVersion,
|
|
299931
|
+
formatProjectTag,
|
|
299851
299932
|
getLockFileDependencies,
|
|
299852
299933
|
getLockFileName,
|
|
299853
299934
|
getLockFileNodes,
|
|
299854
299935
|
getProjectConfiguration,
|
|
299855
299936
|
getProjectConfigurations,
|
|
299937
|
+
getProjectTag,
|
|
299856
299938
|
getTypiaTransform,
|
|
299939
|
+
hasProjectTag,
|
|
299940
|
+
isEqualProjectTag,
|
|
299857
299941
|
isExternal,
|
|
299858
299942
|
lintStagedVersion,
|
|
299859
299943
|
lockFileExists,
|
|
@@ -299869,6 +299953,7 @@ function createCliOptions(obj) {
|
|
|
299869
299953
|
prettierVersion,
|
|
299870
299954
|
runProcess,
|
|
299871
299955
|
semanticReleaseVersion,
|
|
299956
|
+
setDefaultProjectTags,
|
|
299872
299957
|
stringifyCargoToml,
|
|
299873
299958
|
swcCliVersion,
|
|
299874
299959
|
swcCoreVersion,
|