@storm-software/workspace-tools 1.66.0 → 1.66.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 +12 -0
- package/config/nx.json +6 -27
- package/index.ts +1 -4
- package/package.json +13 -1
- package/project.json +30 -10
- package/src/generators/release-version/generator.ts +2 -1
- package/src/plugins/rust/cargo-toml.ts +124 -119
- package/src/plugins/rust/index.ts +1 -0
- package/src/plugins/typescript/index.ts +2 -0
- package/src/plugins/typescript/project-config.ts +76 -74
- package/tsconfig.lib.json +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 1.66.1 (2024-03-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### 🩹 Fixes
|
|
5
|
+
|
|
6
|
+
- **workspace-tools:** Resolved issue with applying Storm Nx plugins ([db3de8a6](https://github.com/storm-software/storm-ops/commit/db3de8a6))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ❤️ Thank You
|
|
10
|
+
|
|
11
|
+
- Patrick Sullivan
|
|
12
|
+
|
|
1
13
|
## 1.66.0 (2024-03-25)
|
|
2
14
|
|
|
3
15
|
|
package/config/nx.json
CHANGED
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"defaultBase": "main",
|
|
22
21
|
"namedInputs": {
|
|
23
22
|
"globalTesting": [
|
|
24
23
|
"{workspaceRoot}/jest.config.ts",
|
|
@@ -205,29 +204,9 @@
|
|
|
205
204
|
"default",
|
|
206
205
|
"^production"
|
|
207
206
|
],
|
|
208
|
-
"outputs": [
|
|
209
|
-
"{options.outputPath}"
|
|
210
|
-
],
|
|
211
207
|
"dependsOn": [
|
|
212
208
|
"^build"
|
|
213
|
-
]
|
|
214
|
-
"options": {
|
|
215
|
-
"main": "{projectRoot}/src/index.ts",
|
|
216
|
-
"outputPath": "dist/{projectRoot}",
|
|
217
|
-
"tsConfig": "{projectRoot}/tsconfig.json",
|
|
218
|
-
"assets": [
|
|
219
|
-
{
|
|
220
|
-
"glob": "*.md",
|
|
221
|
-
"input": "{projectRoot}",
|
|
222
|
-
"output": "."
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
"glob": "LICENSE",
|
|
226
|
-
"input": ".",
|
|
227
|
-
"output": "."
|
|
228
|
-
}
|
|
229
|
-
]
|
|
230
|
-
}
|
|
209
|
+
]
|
|
231
210
|
},
|
|
232
211
|
"docs": {
|
|
233
212
|
"cache": true,
|
|
@@ -310,10 +289,9 @@
|
|
|
310
289
|
}
|
|
311
290
|
},
|
|
312
291
|
"plugins": [
|
|
313
|
-
"@nx/
|
|
314
|
-
"@
|
|
315
|
-
"@
|
|
316
|
-
"@storm-software/workspace-tools"
|
|
292
|
+
"@nx/eslint/plugin",
|
|
293
|
+
"@storm-software/workspace-tools/plugins/rust",
|
|
294
|
+
"@storm-software/workspace-tools/plugins/typescript"
|
|
317
295
|
],
|
|
318
296
|
"pluginsConfig": {
|
|
319
297
|
"@nx/js": {
|
|
@@ -321,5 +299,6 @@
|
|
|
321
299
|
"analyzeLockfile": true,
|
|
322
300
|
"analyzePackageJson": true
|
|
323
301
|
}
|
|
324
|
-
}
|
|
302
|
+
},
|
|
303
|
+
"defaultBase": "main"
|
|
325
304
|
}
|
package/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./src/base";
|
|
2
|
+
export * from "./src/utils";
|
|
2
3
|
export * from "./src/executors/tsup-neutral/executor";
|
|
3
4
|
export * from "./src/executors/tsup-neutral/schema";
|
|
4
5
|
export * from "./src/executors/tsup-node/executor";
|
|
@@ -23,7 +24,3 @@ export * from "./src/generators/preset/generator";
|
|
|
23
24
|
export * from "./src/generators/preset/schema";
|
|
24
25
|
export * from "./src/generators/release-version/generator";
|
|
25
26
|
export * from "./src/generators/release-version/schema";
|
|
26
|
-
export * from "./src/plugins/rust/cargo-toml";
|
|
27
|
-
export * from "./src/plugins/typescript/package-lock-file";
|
|
28
|
-
export * from "./src/plugins/typescript/project-config";
|
|
29
|
-
export * from "./src/utils";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/workspace-tools",
|
|
3
|
-
"version": "1.66.
|
|
3
|
+
"version": "1.66.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "⚡ A Nx plugin package that contains various executors and generators used in a Storm workspaces.",
|
|
6
6
|
"keywords": [
|
|
@@ -33,6 +33,18 @@
|
|
|
33
33
|
"typings": "./declarations.d.ts",
|
|
34
34
|
"executors": "./executors.json",
|
|
35
35
|
"generators": "./generators.json",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": "./index.js",
|
|
38
|
+
"./package.json": "./package.json",
|
|
39
|
+
"./migrations.json": "./migrations.json",
|
|
40
|
+
"./generators.json": "./generators.json",
|
|
41
|
+
"./generators/*/schema.json": "./src/generators/*/schema.json",
|
|
42
|
+
"./executors.json": "./executors.json",
|
|
43
|
+
"./executors/*/schema.json": "./src/executors/*/schema.json",
|
|
44
|
+
"./plugins/rust": "./src/plugins/rust/index.js",
|
|
45
|
+
"./plugins/typescript": "./src/plugins/typescript/index.js",
|
|
46
|
+
"./preset": "./src/generators/preset/preset.js"
|
|
47
|
+
},
|
|
36
48
|
"dependencies": {
|
|
37
49
|
"@anatine/esbuild-decorators": "0.2.19",
|
|
38
50
|
"@ltd/j-toml": "^1.38.0",
|
package/project.json
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
"targets": {
|
|
7
7
|
"build": {
|
|
8
8
|
"executor": "@nx/esbuild:esbuild",
|
|
9
|
-
"outputs": [
|
|
9
|
+
"outputs": [
|
|
10
|
+
"{options.outputPath}"
|
|
11
|
+
],
|
|
10
12
|
"options": {
|
|
11
13
|
"outputPath": "dist/packages/workspace-tools",
|
|
12
14
|
"tsConfig": "packages/workspace-tools/tsconfig.lib.json",
|
|
@@ -27,9 +29,8 @@
|
|
|
27
29
|
"packages/workspace-tools/src/generators/release-version/generator.ts",
|
|
28
30
|
"packages/workspace-tools/src/generators/preset/generator.ts",
|
|
29
31
|
"packages/workspace-tools/src/generators/config-schema/generator.ts",
|
|
30
|
-
"packages/workspace-tools/src/plugins/rust/
|
|
31
|
-
"packages/workspace-tools/src/plugins/typescript/
|
|
32
|
-
"packages/workspace-tools/src/plugins/typescript/project-config.ts",
|
|
32
|
+
"packages/workspace-tools/src/plugins/rust/index.ts",
|
|
33
|
+
"packages/workspace-tools/src/plugins/typescript/index.ts",
|
|
33
34
|
"packages/workspace-tools/src/utils/index.ts",
|
|
34
35
|
"packages/workspace-tools/src/base/index.ts"
|
|
35
36
|
],
|
|
@@ -40,8 +41,18 @@
|
|
|
40
41
|
"skipTypeCheck": false,
|
|
41
42
|
"metafile": true,
|
|
42
43
|
"minify": false,
|
|
43
|
-
"format": [
|
|
44
|
-
|
|
44
|
+
"format": [
|
|
45
|
+
"cjs"
|
|
46
|
+
],
|
|
47
|
+
"esbuildOptions": {
|
|
48
|
+
"outExtension": {
|
|
49
|
+
".js": ".js"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"external": [
|
|
53
|
+
"nx",
|
|
54
|
+
"@storm-software/*"
|
|
55
|
+
],
|
|
45
56
|
"assets": [
|
|
46
57
|
{
|
|
47
58
|
"input": "packages/workspace-tools",
|
|
@@ -56,13 +67,19 @@
|
|
|
56
67
|
{
|
|
57
68
|
"input": "packages/workspace-tools",
|
|
58
69
|
"glob": "**/*.json",
|
|
59
|
-
"ignore": [
|
|
70
|
+
"ignore": [
|
|
71
|
+
"**/tsconfig*.json",
|
|
72
|
+
"project.json",
|
|
73
|
+
".eslintrc.json"
|
|
74
|
+
],
|
|
60
75
|
"output": "."
|
|
61
76
|
},
|
|
62
77
|
{
|
|
63
78
|
"input": "packages/workspace-tools",
|
|
64
79
|
"glob": "**/*.js",
|
|
65
|
-
"ignore": [
|
|
80
|
+
"ignore": [
|
|
81
|
+
"**/jest.config.js"
|
|
82
|
+
],
|
|
66
83
|
"output": "."
|
|
67
84
|
},
|
|
68
85
|
{
|
|
@@ -94,5 +111,8 @@
|
|
|
94
111
|
}
|
|
95
112
|
}
|
|
96
113
|
},
|
|
97
|
-
"tags": [
|
|
98
|
-
|
|
114
|
+
"tags": [
|
|
115
|
+
"type:util",
|
|
116
|
+
"scope:tools"
|
|
117
|
+
]
|
|
118
|
+
}
|
|
@@ -440,7 +440,8 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
|
|
|
440
440
|
} else if (tree.exists(cargoTomlPath)) {
|
|
441
441
|
const cargoToml = parseCargoToml(tree.read(cargoTomlPath)?.toString("utf-8"));
|
|
442
442
|
|
|
443
|
-
cargoToml.
|
|
443
|
+
cargoToml.package ??= {};
|
|
444
|
+
cargoToml.package.version = newVersion;
|
|
444
445
|
tree.write(cargoTomlPath, stringifyCargoToml(cargoToml));
|
|
445
446
|
}
|
|
446
447
|
|
|
@@ -1,155 +1,160 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type ProjectConfiguration,
|
|
3
3
|
type RawProjectGraphDependency,
|
|
4
|
-
normalizePath,
|
|
5
4
|
workspaceRoot,
|
|
6
|
-
type
|
|
5
|
+
type CreateNodes,
|
|
6
|
+
type CreateDependencies
|
|
7
7
|
} from "@nx/devkit";
|
|
8
8
|
import { DependencyType, type ProjectGraphExternalNode } from "nx/src/config/project-graph";
|
|
9
|
-
import { dirname
|
|
9
|
+
import { dirname } from "node:path";
|
|
10
10
|
import type { Package } from "../../utils/toml";
|
|
11
11
|
import { cargoMetadata, isExternal } from "../../utils/cargo";
|
|
12
12
|
|
|
13
|
-
export const
|
|
14
|
-
name: "storm-software/rust/cargo-toml",
|
|
15
|
-
createNodes: [
|
|
16
|
-
"*/**/Cargo.toml",
|
|
17
|
-
(_projectFile, _opts, ctx) => {
|
|
18
|
-
const metadata = cargoMetadata();
|
|
19
|
-
if (!metadata) {
|
|
20
|
-
return {};
|
|
21
|
-
}
|
|
13
|
+
export const name = "storm-software/rust/cargo-toml";
|
|
22
14
|
|
|
23
|
-
|
|
15
|
+
export const createNodes: CreateNodes = [
|
|
16
|
+
"*/**/Cargo.toml",
|
|
17
|
+
(cargoFile, _opts, ctx) => {
|
|
18
|
+
const metadata = cargoMetadata();
|
|
19
|
+
if (!metadata) {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
const projects: Record<string, ProjectConfiguration> = {};
|
|
23
|
+
const { packages: cargoPackages } = metadata;
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
25
|
+
const externalNodes: Record<string, ProjectGraphExternalNode> = {};
|
|
26
|
+
const projects: Record<string, ProjectConfiguration> = {};
|
|
27
|
+
|
|
28
|
+
const cargoPackageMap = cargoPackages.reduce((acc, p) => {
|
|
29
|
+
if (!acc.has(p.name)) {
|
|
30
|
+
acc.set(p.name, p);
|
|
31
|
+
}
|
|
32
|
+
return acc;
|
|
33
|
+
}, new Map<string, Package>());
|
|
34
|
+
|
|
35
|
+
for (const pkg of cargoPackages) {
|
|
36
|
+
if (!isExternal(pkg, ctx.workspaceRoot)) {
|
|
37
|
+
// const root = normalizePath(dirname(relative(ctx.workspaceRoot, pkg.manifest_path)));
|
|
38
|
+
const root = dirname(cargoFile);
|
|
39
|
+
|
|
40
|
+
const targets: ProjectConfiguration["targets"] = {
|
|
41
|
+
lint: {
|
|
42
|
+
cache: true,
|
|
43
|
+
inputs: ["default", "^production"],
|
|
44
|
+
dependsOn: ["^lint"],
|
|
45
|
+
executor: "@monodon/rust:lint",
|
|
46
|
+
outputs: ["{options.target-dir}"],
|
|
47
|
+
options: {
|
|
48
|
+
"target-dir": `dist/target/${pkg.name}`
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
build: {
|
|
52
|
+
cache: true,
|
|
53
|
+
inputs: ["default", "^production"],
|
|
54
|
+
dependsOn: ["lint", "^build"],
|
|
55
|
+
executor: "@monodon/rust:check",
|
|
56
|
+
outputs: ["{options.target-dir}"],
|
|
57
|
+
options: {
|
|
58
|
+
"target-dir": `dist/target/${pkg.name}`
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
test: {
|
|
62
|
+
cache: true,
|
|
63
|
+
inputs: ["defaultTesting", "^production"],
|
|
64
|
+
dependsOn: ["test", "^build"],
|
|
65
|
+
executor: "@monodon/rust:test",
|
|
66
|
+
outputs: ["{options.target-dir}"],
|
|
67
|
+
options: {
|
|
68
|
+
"target-dir": `dist/target/${pkg.name}`
|
|
59
69
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
dependsOn: ["test", "^build"],
|
|
64
|
-
executor: "@monodon/rust:test",
|
|
65
|
-
outputs: ["{options.target-dir}"],
|
|
66
|
-
options: {
|
|
67
|
-
"target-dir": `dist/target/${pkg.name}`
|
|
68
|
-
},
|
|
69
|
-
configurations: {
|
|
70
|
-
production: {
|
|
71
|
-
release: true
|
|
72
|
-
}
|
|
70
|
+
configurations: {
|
|
71
|
+
production: {
|
|
72
|
+
release: true
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// Apply nx-release-publish target for non-private projects
|
|
78
|
-
const isPrivate = pkg.publish?.length === 0;
|
|
79
|
-
if (!isPrivate) {
|
|
80
|
-
targets["nx-release-publish"] = {
|
|
81
|
-
cache: false,
|
|
82
|
-
inputs: ["default", "^production"],
|
|
83
|
-
dependsOn: ["test", "^nx-release-publish"],
|
|
84
|
-
executor: "@storm-software/workspace-tools:cargo-publish",
|
|
85
|
-
options: {
|
|
86
|
-
packageRoot: root
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
75
|
}
|
|
76
|
+
};
|
|
90
77
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
78
|
+
// Apply nx-release-publish target for non-private projects
|
|
79
|
+
const isPrivate = pkg.publish?.length === 0;
|
|
80
|
+
if (!isPrivate) {
|
|
81
|
+
targets["nx-release-publish"] = {
|
|
82
|
+
cache: false,
|
|
83
|
+
inputs: ["default", "^production"],
|
|
84
|
+
dependsOn: ["test", "^nx-release-publish"],
|
|
85
|
+
executor: "@storm-software/workspace-tools:cargo-publish",
|
|
86
|
+
options: {
|
|
87
|
+
packageRoot: root
|
|
99
88
|
}
|
|
100
89
|
};
|
|
101
90
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
packageName: dep.name,
|
|
111
|
-
version: cargoPackageMap.get(dep.name)?.version ?? "0.0.0"
|
|
112
|
-
}
|
|
113
|
-
};
|
|
91
|
+
|
|
92
|
+
projects[root] = {
|
|
93
|
+
root,
|
|
94
|
+
name: pkg.name,
|
|
95
|
+
targets,
|
|
96
|
+
release: {
|
|
97
|
+
version: {
|
|
98
|
+
generator: "@storm-software/workspace-tools:release-version"
|
|
114
99
|
}
|
|
115
100
|
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
for (const dep of pkg.dependencies) {
|
|
104
|
+
if (isExternal(dep, ctx.workspaceRoot)) {
|
|
105
|
+
const externalDepName = `cargo:${dep.name}`;
|
|
106
|
+
if (!externalNodes?.[externalDepName]) {
|
|
107
|
+
externalNodes[externalDepName] = {
|
|
108
|
+
type: "cargo" as any,
|
|
109
|
+
name: externalDepName as any,
|
|
110
|
+
data: {
|
|
111
|
+
packageName: dep.name,
|
|
112
|
+
version: cargoPackageMap.get(dep.name)?.version ?? "0.0.0"
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
|
|
119
|
-
return {
|
|
120
|
-
projects,
|
|
121
|
-
externalNodes
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
],
|
|
125
|
-
createDependencies: (_, { projects, externalNodes }) => {
|
|
126
|
-
const metadata = cargoMetadata();
|
|
127
|
-
if (!metadata) {
|
|
128
|
-
return [];
|
|
129
118
|
}
|
|
130
119
|
|
|
131
|
-
|
|
120
|
+
return {
|
|
121
|
+
projects,
|
|
122
|
+
externalNodes
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
];
|
|
132
126
|
|
|
133
|
-
|
|
127
|
+
export const createDependencies: CreateDependencies = (_, { projects, externalNodes }) => {
|
|
128
|
+
const metadata = cargoMetadata();
|
|
129
|
+
if (!metadata) {
|
|
130
|
+
return [];
|
|
131
|
+
}
|
|
134
132
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
133
|
+
const { packages: cargoPackages } = metadata;
|
|
134
|
+
|
|
135
|
+
const dependencies: RawProjectGraphDependency[] = [];
|
|
136
|
+
|
|
137
|
+
for (const pkg of cargoPackages) {
|
|
138
|
+
if (projects[pkg.name]) {
|
|
139
|
+
for (const deps of pkg.dependencies) {
|
|
140
|
+
if (!cargoPackages.find((p) => p.name === deps.name)) {
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// if the dependency is listed in nx projects, it's not an external dependency
|
|
145
|
+
if (projects[deps.name]) {
|
|
146
|
+
dependencies.push(createDependency(pkg, deps.name, DependencyType.static));
|
|
147
|
+
} else {
|
|
148
|
+
const externalDepName = `cargo:${deps.name}`;
|
|
149
|
+
if (externalDepName in (externalNodes ?? {})) {
|
|
150
|
+
dependencies.push(createDependency(pkg, externalDepName, DependencyType.static));
|
|
146
151
|
}
|
|
147
152
|
}
|
|
148
153
|
}
|
|
149
154
|
}
|
|
150
|
-
|
|
151
|
-
return dependencies;
|
|
152
155
|
}
|
|
156
|
+
|
|
157
|
+
return dependencies;
|
|
153
158
|
};
|
|
154
159
|
|
|
155
160
|
function createDependency(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./cargo-toml";
|
|
@@ -2,94 +2,96 @@ import { dirname, join } from "node:path";
|
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import type { ProjectConfiguration } from "nx/src/config/workspace-json-project-json";
|
|
4
4
|
import { readJsonFile } from "nx/src/utils/fileutils";
|
|
5
|
-
import type { NxPluginV2 } from "nx/src/utils/nx-plugin";
|
|
6
5
|
import { type PackageJson, readTargetsFromPackageJson } from "nx/src/utils/package-json";
|
|
7
6
|
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
(file,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
7
|
+
export const name = "storm-software/typescript/project-config";
|
|
8
|
+
export const createNodes = [
|
|
9
|
+
"{project.json,**/project.json}",
|
|
10
|
+
(file, _, ctx) => {
|
|
11
|
+
const packageJson = createPackageJson(file, ctx.workspaceRoot);
|
|
12
|
+
if (!packageJson) {
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const project = createProjectFromPackageJsonNextToProjectJson(file, packageJson);
|
|
17
|
+
const targets: ProjectConfiguration["targets"] = readTargetsFromPackageJson(packageJson);
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
if (!targets.lint) {
|
|
20
|
+
targets.lint = {
|
|
21
|
+
cache: true,
|
|
22
|
+
inputs: ["default"],
|
|
23
|
+
dependsOn: ["^lint"],
|
|
24
|
+
executor: "@nx/eslint:lint",
|
|
25
|
+
outputs: ["{options.outputFile}"],
|
|
26
|
+
options: {
|
|
27
|
+
format: "stylish",
|
|
28
|
+
fix: true,
|
|
23
29
|
cache: true,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
format: "stylish",
|
|
30
|
-
fix: true,
|
|
31
|
-
cache: true,
|
|
32
|
-
errorOnUnmatchedPattern: false,
|
|
33
|
-
printConfig: true
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
30
|
+
errorOnUnmatchedPattern: false,
|
|
31
|
+
printConfig: true
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
if (!targets.test) {
|
|
37
|
+
targets.test = {
|
|
38
|
+
cache: true,
|
|
39
|
+
inputs: ["default", "^production"],
|
|
40
|
+
dependsOn: ["build", "^test"],
|
|
41
|
+
executor: "@nx/jest:jest",
|
|
42
|
+
outputs: ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
43
|
+
defaultConfiguration: "local",
|
|
44
|
+
options: {
|
|
45
|
+
jestConfig: "{projectRoot}/jest.config.ts",
|
|
46
|
+
passWithNoTests: true
|
|
47
|
+
},
|
|
48
|
+
configurations: {
|
|
49
|
+
local: {
|
|
50
|
+
ci: false,
|
|
51
|
+
codeCoverage: true
|
|
48
52
|
},
|
|
49
|
-
|
|
50
|
-
ci:
|
|
51
|
-
|
|
52
|
-
codeCoverage: true
|
|
53
|
-
}
|
|
53
|
+
ci: {
|
|
54
|
+
ci: true,
|
|
55
|
+
codeCoverage: true
|
|
54
56
|
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
57
60
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
// Apply nx-release-publish target for non-private projects
|
|
62
|
+
const isPrivate = packageJson.private ?? false;
|
|
63
|
+
if (!isPrivate) {
|
|
64
|
+
targets["nx-release-publish"] = {
|
|
65
|
+
cache: false,
|
|
66
|
+
inputs: ["default", "^production"],
|
|
67
|
+
dependsOn: ["build", "^nx-release-publish"],
|
|
68
|
+
executor: "@storm-software/workspace-tools:npm-publish",
|
|
69
|
+
options: {
|
|
70
|
+
packageRoot: `dist/${project.root}`,
|
|
71
|
+
registry: "https://registry.npmjs.org/"
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
76
|
+
return project?.name
|
|
77
|
+
? {
|
|
78
|
+
projects: {
|
|
79
|
+
[project.name]: {
|
|
80
|
+
...project,
|
|
81
|
+
targets,
|
|
82
|
+
release: {
|
|
83
|
+
...project?.release,
|
|
84
|
+
version: {
|
|
85
|
+
...project?.release?.version,
|
|
86
|
+
generator: "@storm-software/workspace-tools:release-version"
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
}
|
|
92
|
+
: {};
|
|
93
|
+
}
|
|
94
|
+
];
|
|
93
95
|
|
|
94
96
|
function createProjectFromPackageJsonNextToProjectJson(
|
|
95
97
|
projectJsonPath: string,
|
package/tsconfig.lib.json
CHANGED
|
@@ -3,13 +3,19 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"outDir": "../../dist/out-tsc",
|
|
5
5
|
"declaration": true,
|
|
6
|
-
"types": [
|
|
6
|
+
"types": [
|
|
7
|
+
"node"
|
|
8
|
+
]
|
|
7
9
|
},
|
|
8
|
-
"include": [
|
|
10
|
+
"include": [
|
|
11
|
+
"**/*.ts",
|
|
12
|
+
"**/*.json",
|
|
13
|
+
"declarations.d.ts"
|
|
14
|
+
],
|
|
9
15
|
"exclude": [
|
|
10
16
|
"jest.config.ts",
|
|
11
17
|
"src/generators/**/files/**/*",
|
|
12
18
|
"src/**/*.spec.ts",
|
|
13
19
|
"src/**/*.test.ts"
|
|
14
20
|
]
|
|
15
|
-
}
|
|
21
|
+
}
|