@aws/create-nx-workspace 1.0.0-rc.7 → 1.0.0-rc.70
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/bin/index.cjs +149 -106
- package/package.json +1 -1
package/bin/index.cjs
CHANGED
|
@@ -2,130 +2,159 @@
|
|
|
2
2
|
let child_process = require("child_process");
|
|
3
3
|
let fs = require("fs");
|
|
4
4
|
let path = require("path");
|
|
5
|
-
//#
|
|
6
|
-
//#region src/create-nx-workspace.ts
|
|
5
|
+
//#region ../nx-plugin/src/utils/versions.ts
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
9
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
* Versons for TypeScript dependencies added by generators
|
|
10
8
|
*/
|
|
11
|
-
const
|
|
12
|
-
"@a2a-js/sdk": "0.3.
|
|
13
|
-
"@aws/aws-distro-opentelemetry-node-autoinstrumentation": "0.
|
|
14
|
-
"@
|
|
15
|
-
|
|
16
|
-
"@aws-sdk/client-
|
|
17
|
-
"@aws-sdk/client-
|
|
18
|
-
"@aws-sdk/
|
|
19
|
-
"@aws-sdk/
|
|
20
|
-
"@aws-sdk/client-
|
|
21
|
-
"@aws-sdk/
|
|
22
|
-
"@aws-
|
|
23
|
-
"@aws-
|
|
24
|
-
"@aws-
|
|
25
|
-
"@aws-
|
|
26
|
-
"@aws-
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@aws-
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"@
|
|
9
|
+
const TS_VERSIONS = {
|
|
10
|
+
"@a2a-js/sdk": "0.3.14",
|
|
11
|
+
"@aws/aws-distro-opentelemetry-node-autoinstrumentation": "0.12.0",
|
|
12
|
+
"@opentelemetry/propagator-jaeger": "2.10.0",
|
|
13
|
+
minimatch: "10.2.6",
|
|
14
|
+
"@aws-sdk/client-dynamodb": "3.1106.0",
|
|
15
|
+
"@aws-sdk/client-api-gateway": "3.1106.0",
|
|
16
|
+
"@aws-sdk/client-iam": "3.1106.0",
|
|
17
|
+
"@aws-sdk/client-bedrock-agentcore": "3.1106.0",
|
|
18
|
+
"@aws-sdk/client-bedrock-runtime": "3.1106.0",
|
|
19
|
+
"@aws-sdk/client-s3": "3.1106.0",
|
|
20
|
+
"@aws-sdk/client-sts": "3.1106.0",
|
|
21
|
+
"@aws-sdk/credential-providers": "3.1106.0",
|
|
22
|
+
"@aws-sdk/credential-provider-cognito-identity": "3.972.66",
|
|
23
|
+
"@aws-sdk/client-secrets-manager": "3.1106.0",
|
|
24
|
+
"@aws-sdk/rds-signer": "3.1106.0",
|
|
25
|
+
"@smithy/server-apigateway": "0.2.0",
|
|
26
|
+
"@smithy/server-node": "0.2.0",
|
|
27
|
+
"@aws-lambda-powertools/logger": "2.34.0",
|
|
28
|
+
"@aws-lambda-powertools/metrics": "2.34.0",
|
|
29
|
+
"@aws-lambda-powertools/parameters": "2.34.0",
|
|
30
|
+
"@aws-lambda-powertools/tracer": "2.34.0",
|
|
31
|
+
"@aws-lambda-powertools/parser": "2.34.0",
|
|
32
|
+
"@aws-sdk/client-appconfigdata": "3.1106.0",
|
|
33
|
+
"@middy/core": "7.7.2",
|
|
34
|
+
"@nxlv/python": "22.2.2",
|
|
35
|
+
"@nx-extend/terraform": "10.4.1",
|
|
36
|
+
nx: "23.1.1",
|
|
37
|
+
"@nx/devkit": "23.1.1",
|
|
38
|
+
"@nx/js": "23.1.1",
|
|
39
|
+
"@nx/react": "23.1.1",
|
|
40
|
+
"@nx/vite": "23.1.1",
|
|
41
|
+
"@nx/vitest": "23.1.1",
|
|
42
|
+
"@nx/workspace": "23.1.1",
|
|
43
|
+
"create-nx-workspace": "23.1.1",
|
|
44
|
+
"@swc-node/register": "1.12.1",
|
|
45
|
+
"@swc/core": "1.15.47",
|
|
46
|
+
"@modelcontextprotocol/sdk": "1.30.0",
|
|
47
|
+
"@modelcontextprotocol/inspector": "0.22.0",
|
|
48
|
+
"@ag-ui/a2ui-toolkit": "0.0.4",
|
|
49
|
+
"@ag-ui/aws-strands": "0.2.3",
|
|
50
|
+
"@ag-ui/client": "0.0.57",
|
|
51
|
+
"@ag-ui/core": "0.0.57",
|
|
52
|
+
"@ag-ui/encoder": "0.0.57",
|
|
53
|
+
"agent-chat-cli": "0.3.0",
|
|
54
|
+
"@copilotkit/react-core": "1.66.4",
|
|
44
55
|
rxjs: "7.8.2",
|
|
45
|
-
"@strands-agents/sdk": "1.
|
|
46
|
-
"@tanstack/react-router": "1.170.
|
|
47
|
-
"@tanstack/router-plugin": "1.168.
|
|
48
|
-
"@tanstack/router-generator": "1.167.
|
|
56
|
+
"@strands-agents/sdk": "1.12.0",
|
|
57
|
+
"@tanstack/react-router": "1.170.23",
|
|
58
|
+
"@tanstack/router-plugin": "1.168.27",
|
|
59
|
+
"@tanstack/router-generator": "1.167.25",
|
|
49
60
|
"@tanstack/virtual-file-routes": "1.162.0",
|
|
50
|
-
"@tanstack/router-utils": "1.162.
|
|
51
|
-
"@cloudscape-design/board-components": "3.0.
|
|
52
|
-
"@cloudscape-design/chat-components": "1.0.
|
|
53
|
-
"@cloudscape-design/components": "3.0.
|
|
54
|
-
"@cloudscape-design/global-styles": "1.0.
|
|
55
|
-
"@tanstack/react-query": "5.
|
|
56
|
-
"@tanstack/react-query-devtools": "5.
|
|
57
|
-
"@trpc/tanstack-react-query": "11.
|
|
58
|
-
"@trpc/client": "11.
|
|
59
|
-
"@trpc/server": "11.
|
|
60
|
-
"@types/node": "
|
|
61
|
-
"@types/aws-lambda": "8.10.
|
|
61
|
+
"@tanstack/router-utils": "1.162.2",
|
|
62
|
+
"@cloudscape-design/board-components": "3.0.213",
|
|
63
|
+
"@cloudscape-design/chat-components": "1.0.157",
|
|
64
|
+
"@cloudscape-design/components": "3.0.1342",
|
|
65
|
+
"@cloudscape-design/global-styles": "1.0.65",
|
|
66
|
+
"@tanstack/react-query": "5.101.4",
|
|
67
|
+
"@tanstack/react-query-devtools": "5.101.4",
|
|
68
|
+
"@trpc/tanstack-react-query": "11.18.0",
|
|
69
|
+
"@trpc/client": "11.18.0",
|
|
70
|
+
"@trpc/server": "11.18.0",
|
|
71
|
+
"@types/node": "26.2.0",
|
|
72
|
+
"@types/aws-lambda": "8.10.162",
|
|
62
73
|
"@types/cors": "2.8.19",
|
|
63
|
-
"@types/pg": "8.
|
|
74
|
+
"@types/pg": "8.21.0",
|
|
64
75
|
"@types/ws": "8.18.1",
|
|
65
76
|
"@types/express": "5.0.6",
|
|
66
|
-
"@smithy/config-resolver": "4.
|
|
67
|
-
"@smithy/node-config-provider": "4.
|
|
68
|
-
"@smithy/node-http-handler": "4.
|
|
69
|
-
"@smithy/types": "4.
|
|
70
|
-
"@vitest/coverage-v8": "4.1.
|
|
71
|
-
"@vitest/ui": "4.1.
|
|
72
|
-
"@astrojs/react": "
|
|
73
|
-
"@astrojs/starlight": "0.
|
|
74
|
-
astro: "
|
|
77
|
+
"@smithy/config-resolver": "4.6.16",
|
|
78
|
+
"@smithy/node-config-provider": "4.5.16",
|
|
79
|
+
"@smithy/node-http-handler": "4.9.13",
|
|
80
|
+
"@smithy/types": "4.16.1",
|
|
81
|
+
"@vitest/coverage-v8": "4.1.10",
|
|
82
|
+
"@vitest/ui": "4.1.10",
|
|
83
|
+
"@astrojs/react": "6.0.2",
|
|
84
|
+
"@astrojs/starlight": "0.41.3",
|
|
85
|
+
astro: "7.1.1",
|
|
75
86
|
aws4fetch: "1.0.20",
|
|
76
|
-
"aws-cdk": "2.
|
|
77
|
-
"aws-cdk-lib": "2.
|
|
87
|
+
"aws-cdk": "2.1135.1",
|
|
88
|
+
"aws-cdk-lib": "2.263.0",
|
|
78
89
|
"aws-xray-sdk-core": "3.12.0",
|
|
79
|
-
constructs: "10.
|
|
90
|
+
constructs: "10.8.1",
|
|
80
91
|
cors: "2.8.6",
|
|
81
92
|
chalk: "5.6.2",
|
|
82
93
|
"class-variance-authority": "0.7.1",
|
|
83
94
|
clsx: "2.1.1",
|
|
84
|
-
commander: "
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
commander: "15.0.0",
|
|
96
|
+
"cpy-cli": "7.0.0",
|
|
97
|
+
electrodb: "3.9.2",
|
|
98
|
+
esbuild: "0.28.2",
|
|
87
99
|
"event-source-polyfill": "1.0.31",
|
|
88
100
|
"@types/event-source-polyfill": "1.0.5",
|
|
89
|
-
"@biomejs/biome": "2.
|
|
90
|
-
"@prisma/adapter-mariadb": "7.
|
|
91
|
-
"@prisma/adapter-pg": "7.
|
|
92
|
-
"@prisma/client": "7.
|
|
101
|
+
"@biomejs/biome": "2.5.7",
|
|
102
|
+
"@prisma/adapter-mariadb": "7.9.1",
|
|
103
|
+
"@prisma/adapter-pg": "7.9.1",
|
|
104
|
+
"@prisma/client": "7.9.1",
|
|
105
|
+
ejs: "6.0.1",
|
|
106
|
+
"@types/ejs": "3.1.5",
|
|
93
107
|
express: "5.2.1",
|
|
94
108
|
"fast-glob": "3.3.3",
|
|
95
109
|
husky: "9.1.7",
|
|
96
|
-
"fs-extra": "11.
|
|
110
|
+
"fs-extra": "11.4.0",
|
|
97
111
|
"@types/fs-extra": "11.0.4",
|
|
98
112
|
"make-dir-cli": "4.0.0",
|
|
99
|
-
mariadb: "3.5.
|
|
113
|
+
mariadb: "3.5.3",
|
|
114
|
+
mise: "2026.8.3",
|
|
100
115
|
ncp: "2.0.0",
|
|
101
|
-
|
|
116
|
+
npm: "12.0.2",
|
|
117
|
+
"npm-check-updates": "22.2.9",
|
|
102
118
|
"oidc-client-ts": "3.5.0",
|
|
103
|
-
pg: "8.
|
|
104
|
-
prisma: "7.
|
|
119
|
+
pg: "8.23.0",
|
|
120
|
+
prisma: "7.9.1",
|
|
105
121
|
"react-oidc-context": "3.3.1",
|
|
106
|
-
react: "19.2.
|
|
107
|
-
"react-dom": "19.2.
|
|
122
|
+
react: "19.2.8",
|
|
123
|
+
"react-dom": "19.2.8",
|
|
108
124
|
rimraf: "6.1.3",
|
|
109
|
-
rolldown: "1.
|
|
125
|
+
rolldown: "1.2.3",
|
|
126
|
+
"rolldown-plugin-dts": "0.28.0",
|
|
110
127
|
"simple-git": "3.36.0",
|
|
111
128
|
"source-map-support": "0.5.21",
|
|
112
|
-
"starlight-blog": "0.
|
|
113
|
-
tailwindcss: "4.3.
|
|
114
|
-
"@tailwindcss/vite": "4.3.
|
|
115
|
-
tsx: "4.
|
|
116
|
-
"lucide-react": "1.
|
|
117
|
-
"radix-ui": "1.
|
|
118
|
-
shadcn: "4.
|
|
129
|
+
"starlight-blog": "0.28.0",
|
|
130
|
+
tailwindcss: "4.3.3",
|
|
131
|
+
"@tailwindcss/vite": "4.3.3",
|
|
132
|
+
tsx: "4.23.11",
|
|
133
|
+
"lucide-react": "1.30.0",
|
|
134
|
+
"radix-ui": "1.6.7",
|
|
135
|
+
shadcn: "4.16.2",
|
|
119
136
|
"tw-animate-css": "1.4.0",
|
|
120
137
|
"tailwind-merge": "3.6.0",
|
|
121
|
-
vite: "8.
|
|
138
|
+
vite: "8.2.1",
|
|
122
139
|
typescript: "6.0.3",
|
|
123
|
-
vitest: "4.1.
|
|
140
|
+
vitest: "4.1.10",
|
|
124
141
|
zod: "4.4.3",
|
|
125
|
-
ws: "8.21.
|
|
126
|
-
}
|
|
142
|
+
ws: "8.21.3"
|
|
143
|
+
};
|
|
144
|
+
TS_VERSIONS.nx;
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/create-nx-workspace.ts
|
|
147
|
+
/**
|
|
148
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
149
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
150
|
+
*/
|
|
151
|
+
const NX_VERSION = TS_VERSIONS["create-nx-workspace"];
|
|
127
152
|
const PRESET = `@aws/nx-plugin@${JSON.parse((0, fs.readFileSync)((0, path.resolve)(__dirname, "..", "package.json"), "utf-8")).version}`;
|
|
128
|
-
const DEFAULT_FLAGS = [
|
|
153
|
+
const DEFAULT_FLAGS = [
|
|
154
|
+
"--ci=skip",
|
|
155
|
+
"--analytics=false",
|
|
156
|
+
"--trustThirdPartyPreset"
|
|
157
|
+
];
|
|
129
158
|
/**
|
|
130
159
|
* Detect the package manager from the npm_config_user_agent environment variable.
|
|
131
160
|
* This is set by package managers when running scripts/bins.
|
|
@@ -139,21 +168,34 @@ const detectPackageManager = () => {
|
|
|
139
168
|
if (userAgent.startsWith("npm/")) return "npm";
|
|
140
169
|
};
|
|
141
170
|
const shouldSkipGit = (flagArgs) => flagArgs.some((a) => a === "--skipGit" || a === "--skipGit=true");
|
|
171
|
+
/**
|
|
172
|
+
* Determine whether the given directory is already inside a git repository.
|
|
173
|
+
*/
|
|
174
|
+
const isGitRepo = (dir) => {
|
|
175
|
+
if (!(0, fs.existsSync)(dir)) return false;
|
|
176
|
+
const result = (0, child_process.spawnSync)("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
177
|
+
cwd: dir,
|
|
178
|
+
stdio: "pipe",
|
|
179
|
+
shell: process.platform === "win32"
|
|
180
|
+
});
|
|
181
|
+
return result.status === 0 && result.stdout?.toString().trim() === "true";
|
|
182
|
+
};
|
|
142
183
|
const buildArgs = (args) => {
|
|
143
|
-
const
|
|
144
|
-
const
|
|
184
|
+
const firstFlagIndex = args.findIndex((a) => a.startsWith("-"));
|
|
185
|
+
const positionalArgs = firstFlagIndex === -1 ? args : args.slice(0, firstFlagIndex);
|
|
186
|
+
const restArgs = firstFlagIndex === -1 ? [] : args.slice(firstFlagIndex);
|
|
145
187
|
const defaultFlags = [...DEFAULT_FLAGS, "--skipGit"];
|
|
146
|
-
if (!
|
|
188
|
+
if (!restArgs.some((a) => a.startsWith("--pm"))) {
|
|
147
189
|
const pm = detectPackageManager();
|
|
148
190
|
if (pm) defaultFlags.push(`--pm=${pm}`);
|
|
149
191
|
}
|
|
150
|
-
const
|
|
151
|
-
const flagsToAdd = defaultFlags.filter((flag) => !
|
|
192
|
+
const userArgsWithoutSkipGit = restArgs.filter((a) => !a.startsWith("--skipGit"));
|
|
193
|
+
const flagsToAdd = defaultFlags.filter((flag) => !userArgsWithoutSkipGit.some((a) => a.startsWith(flag.split("=")[0])));
|
|
152
194
|
return [
|
|
153
195
|
...positionalArgs,
|
|
154
196
|
`--preset=${PRESET}`,
|
|
155
197
|
...flagsToAdd,
|
|
156
|
-
...
|
|
198
|
+
...userArgsWithoutSkipGit
|
|
157
199
|
];
|
|
158
200
|
};
|
|
159
201
|
const initGitRepo = (dir) => {
|
|
@@ -162,7 +204,8 @@ const initGitRepo = (dir) => {
|
|
|
162
204
|
cwd: dir,
|
|
163
205
|
stdio: "pipe"
|
|
164
206
|
});
|
|
165
|
-
|
|
207
|
+
const pm = detectPackageManager() ?? "npm";
|
|
208
|
+
(0, child_process.spawnSync)(pm, ["run", "prepare"], {
|
|
166
209
|
cwd: dir,
|
|
167
210
|
stdio: "pipe",
|
|
168
211
|
shell
|
|
@@ -189,7 +232,8 @@ const createNxWorkspace = (args) => {
|
|
|
189
232
|
console.error("Error: --preset cannot be used with @aws/create-nx-workspace.\nThis package always creates a workspace with the @aws/nx-plugin preset.\nTo use a different preset, run create-nx-workspace directly:\n\n npx create-nx-workspace <name> --preset=<your-preset>\n");
|
|
190
233
|
return 1;
|
|
191
234
|
}
|
|
192
|
-
const
|
|
235
|
+
const flagArgs = args.filter((a) => a.startsWith("-"));
|
|
236
|
+
const skipGit = shouldSkipGit(flagArgs);
|
|
193
237
|
const allArgs = buildArgs(args);
|
|
194
238
|
const result = (0, child_process.spawnSync)("npx", [
|
|
195
239
|
"-y",
|
|
@@ -197,16 +241,15 @@ const createNxWorkspace = (args) => {
|
|
|
197
241
|
...allArgs
|
|
198
242
|
], {
|
|
199
243
|
stdio: "inherit",
|
|
200
|
-
env: {
|
|
201
|
-
...process.env,
|
|
202
|
-
pnpm_config_strict_dep_builds: "false"
|
|
203
|
-
},
|
|
204
244
|
shell: process.platform === "win32"
|
|
205
245
|
});
|
|
206
246
|
if (result.status !== 0) return result.status ?? 1;
|
|
207
247
|
if (!skipGit) {
|
|
208
248
|
const workspaceName = args.filter((a) => !a.startsWith("-"))[0];
|
|
209
|
-
if (workspaceName)
|
|
249
|
+
if (workspaceName) {
|
|
250
|
+
const workspaceDir = (0, path.resolve)(workspaceName);
|
|
251
|
+
if (!isGitRepo(workspaceDir)) initGitRepo(workspaceDir);
|
|
252
|
+
}
|
|
210
253
|
}
|
|
211
254
|
return 0;
|
|
212
255
|
};
|