@aws/create-nx-workspace 1.0.0-rc.6 → 1.0.0-rc.60
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 +146 -104
- package/package.json +1 -1
package/bin/index.cjs
CHANGED
|
@@ -2,130 +2,158 @@
|
|
|
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/
|
|
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.1101.0",
|
|
15
|
+
"@aws-sdk/client-api-gateway": "3.1101.0",
|
|
16
|
+
"@aws-sdk/client-iam": "3.1101.0",
|
|
17
|
+
"@aws-sdk/client-bedrock-agentcore": "3.1101.0",
|
|
18
|
+
"@aws-sdk/client-bedrock-runtime": "3.1101.0",
|
|
19
|
+
"@aws-sdk/client-s3": "3.1101.0",
|
|
20
|
+
"@aws-sdk/client-sts": "3.1101.0",
|
|
21
|
+
"@aws-sdk/credential-providers": "3.1101.0",
|
|
22
|
+
"@aws-sdk/credential-provider-cognito-identity": "3.972.64",
|
|
23
|
+
"@aws-sdk/client-secrets-manager": "3.1101.0",
|
|
24
|
+
"@aws-sdk/rds-signer": "3.1101.0",
|
|
22
25
|
"@aws-smithy/server-apigateway": "1.0.0-alpha.10",
|
|
23
26
|
"@aws-smithy/server-node": "1.0.0-alpha.10",
|
|
24
|
-
"@aws-lambda-powertools/logger": "2.
|
|
25
|
-
"@aws-lambda-powertools/metrics": "2.
|
|
26
|
-
"@aws-lambda-powertools/parameters": "2.
|
|
27
|
-
"@aws-lambda-powertools/tracer": "2.
|
|
28
|
-
"@aws-lambda-powertools/parser": "2.
|
|
29
|
-
"@aws-sdk/client-appconfigdata": "3.
|
|
30
|
-
"@middy/core": "7.
|
|
31
|
-
"@nxlv/python": "22.
|
|
32
|
-
"@nx-extend/terraform": "10.
|
|
33
|
-
|
|
34
|
-
"@nx/
|
|
35
|
-
"
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"@
|
|
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.1101.0",
|
|
33
|
+
"@middy/core": "7.7.2",
|
|
34
|
+
"@nxlv/python": "22.2.2",
|
|
35
|
+
"@nx-extend/terraform": "10.3.0",
|
|
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.65.0",
|
|
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.11.2",
|
|
57
|
+
"@tanstack/react-router": "1.170.18",
|
|
58
|
+
"@tanstack/router-plugin": "1.168.23",
|
|
59
|
+
"@tanstack/router-generator": "1.167.21",
|
|
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.212",
|
|
63
|
+
"@cloudscape-design/chat-components": "1.0.156",
|
|
64
|
+
"@cloudscape-design/components": "3.0.1340",
|
|
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.1.2",
|
|
72
|
+
"@types/aws-lambda": "8.10.162",
|
|
62
73
|
"@types/cors": "2.8.19",
|
|
63
|
-
"@types/pg": "8.20.
|
|
74
|
+
"@types/pg": "8.20.3",
|
|
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.0",
|
|
88
|
+
"aws-cdk-lib": "2.263.0",
|
|
78
89
|
"aws-xray-sdk-core": "3.12.0",
|
|
79
|
-
constructs: "10.
|
|
90
|
+
constructs: "10.8.0",
|
|
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
|
-
electrodb: "3.9.
|
|
86
|
-
esbuild: "0.28.
|
|
95
|
+
commander: "15.0.0",
|
|
96
|
+
electrodb: "3.9.1",
|
|
97
|
+
esbuild: "0.28.1",
|
|
87
98
|
"event-source-polyfill": "1.0.31",
|
|
88
99
|
"@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.
|
|
100
|
+
"@biomejs/biome": "2.5.6",
|
|
101
|
+
"@prisma/adapter-mariadb": "7.9.1",
|
|
102
|
+
"@prisma/adapter-pg": "7.9.1",
|
|
103
|
+
"@prisma/client": "7.9.1",
|
|
104
|
+
ejs: "6.0.1",
|
|
105
|
+
"@types/ejs": "3.1.5",
|
|
93
106
|
express: "5.2.1",
|
|
94
107
|
"fast-glob": "3.3.3",
|
|
95
108
|
husky: "9.1.7",
|
|
96
|
-
"fs-extra": "11.
|
|
109
|
+
"fs-extra": "11.4.0",
|
|
97
110
|
"@types/fs-extra": "11.0.4",
|
|
98
111
|
"make-dir-cli": "4.0.0",
|
|
99
|
-
mariadb: "3.5.
|
|
112
|
+
mariadb: "3.5.3",
|
|
100
113
|
ncp: "2.0.0",
|
|
101
|
-
|
|
114
|
+
npm: "12.0.2",
|
|
115
|
+
"npm-check-updates": "22.2.9",
|
|
102
116
|
"oidc-client-ts": "3.5.0",
|
|
103
|
-
pg: "8.
|
|
104
|
-
prisma: "7.
|
|
117
|
+
pg: "8.22.0",
|
|
118
|
+
prisma: "7.9.1",
|
|
105
119
|
"react-oidc-context": "3.3.1",
|
|
106
|
-
react: "19.2.
|
|
107
|
-
"react-dom": "19.2.
|
|
120
|
+
react: "19.2.8",
|
|
121
|
+
"react-dom": "19.2.8",
|
|
108
122
|
rimraf: "6.1.3",
|
|
109
|
-
rolldown: "1.
|
|
123
|
+
rolldown: "1.2.2",
|
|
124
|
+
"rolldown-plugin-dts": "0.28.0",
|
|
125
|
+
"@rollup/plugin-esm-shim": "0.1.8",
|
|
110
126
|
"simple-git": "3.36.0",
|
|
111
127
|
"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.
|
|
128
|
+
"starlight-blog": "0.28.0",
|
|
129
|
+
tailwindcss: "4.3.3",
|
|
130
|
+
"@tailwindcss/vite": "4.3.3",
|
|
131
|
+
tsx: "4.23.5",
|
|
132
|
+
"lucide-react": "1.28.0",
|
|
133
|
+
"radix-ui": "1.6.7",
|
|
134
|
+
shadcn: "4.16.1",
|
|
119
135
|
"tw-animate-css": "1.4.0",
|
|
120
136
|
"tailwind-merge": "3.6.0",
|
|
121
|
-
vite: "8.0
|
|
137
|
+
vite: "8.2.0",
|
|
122
138
|
typescript: "6.0.3",
|
|
123
|
-
vitest: "4.1.
|
|
139
|
+
vitest: "4.1.10",
|
|
124
140
|
zod: "4.4.3",
|
|
125
|
-
ws: "8.21.
|
|
126
|
-
}
|
|
141
|
+
ws: "8.21.1"
|
|
142
|
+
};
|
|
143
|
+
TS_VERSIONS.nx;
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/create-nx-workspace.ts
|
|
146
|
+
/**
|
|
147
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
148
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
149
|
+
*/
|
|
150
|
+
const NX_VERSION = TS_VERSIONS["create-nx-workspace"];
|
|
127
151
|
const PRESET = `@aws/nx-plugin@${JSON.parse((0, fs.readFileSync)((0, path.resolve)(__dirname, "..", "package.json"), "utf-8")).version}`;
|
|
128
|
-
const DEFAULT_FLAGS = [
|
|
152
|
+
const DEFAULT_FLAGS = [
|
|
153
|
+
"--ci=skip",
|
|
154
|
+
"--analytics=false",
|
|
155
|
+
"--trustThirdPartyPreset"
|
|
156
|
+
];
|
|
129
157
|
/**
|
|
130
158
|
* Detect the package manager from the npm_config_user_agent environment variable.
|
|
131
159
|
* This is set by package managers when running scripts/bins.
|
|
@@ -139,21 +167,34 @@ const detectPackageManager = () => {
|
|
|
139
167
|
if (userAgent.startsWith("npm/")) return "npm";
|
|
140
168
|
};
|
|
141
169
|
const shouldSkipGit = (flagArgs) => flagArgs.some((a) => a === "--skipGit" || a === "--skipGit=true");
|
|
170
|
+
/**
|
|
171
|
+
* Determine whether the given directory is already inside a git repository.
|
|
172
|
+
*/
|
|
173
|
+
const isGitRepo = (dir) => {
|
|
174
|
+
if (!(0, fs.existsSync)(dir)) return false;
|
|
175
|
+
const result = (0, child_process.spawnSync)("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
176
|
+
cwd: dir,
|
|
177
|
+
stdio: "pipe",
|
|
178
|
+
shell: process.platform === "win32"
|
|
179
|
+
});
|
|
180
|
+
return result.status === 0 && result.stdout?.toString().trim() === "true";
|
|
181
|
+
};
|
|
142
182
|
const buildArgs = (args) => {
|
|
143
|
-
const
|
|
144
|
-
const
|
|
183
|
+
const firstFlagIndex = args.findIndex((a) => a.startsWith("-"));
|
|
184
|
+
const positionalArgs = firstFlagIndex === -1 ? args : args.slice(0, firstFlagIndex);
|
|
185
|
+
const restArgs = firstFlagIndex === -1 ? [] : args.slice(firstFlagIndex);
|
|
145
186
|
const defaultFlags = [...DEFAULT_FLAGS, "--skipGit"];
|
|
146
|
-
if (!
|
|
187
|
+
if (!restArgs.some((a) => a.startsWith("--pm"))) {
|
|
147
188
|
const pm = detectPackageManager();
|
|
148
189
|
if (pm) defaultFlags.push(`--pm=${pm}`);
|
|
149
190
|
}
|
|
150
|
-
const
|
|
151
|
-
const flagsToAdd = defaultFlags.filter((flag) => !
|
|
191
|
+
const userArgsWithoutSkipGit = restArgs.filter((a) => !a.startsWith("--skipGit"));
|
|
192
|
+
const flagsToAdd = defaultFlags.filter((flag) => !userArgsWithoutSkipGit.some((a) => a.startsWith(flag.split("=")[0])));
|
|
152
193
|
return [
|
|
153
194
|
...positionalArgs,
|
|
154
195
|
`--preset=${PRESET}`,
|
|
155
196
|
...flagsToAdd,
|
|
156
|
-
...
|
|
197
|
+
...userArgsWithoutSkipGit
|
|
157
198
|
];
|
|
158
199
|
};
|
|
159
200
|
const initGitRepo = (dir) => {
|
|
@@ -162,7 +203,8 @@ const initGitRepo = (dir) => {
|
|
|
162
203
|
cwd: dir,
|
|
163
204
|
stdio: "pipe"
|
|
164
205
|
});
|
|
165
|
-
|
|
206
|
+
const pm = detectPackageManager() ?? "npm";
|
|
207
|
+
(0, child_process.spawnSync)(pm, ["run", "prepare"], {
|
|
166
208
|
cwd: dir,
|
|
167
209
|
stdio: "pipe",
|
|
168
210
|
shell
|
|
@@ -189,7 +231,8 @@ const createNxWorkspace = (args) => {
|
|
|
189
231
|
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
232
|
return 1;
|
|
191
233
|
}
|
|
192
|
-
const
|
|
234
|
+
const flagArgs = args.filter((a) => a.startsWith("-"));
|
|
235
|
+
const skipGit = shouldSkipGit(flagArgs);
|
|
193
236
|
const allArgs = buildArgs(args);
|
|
194
237
|
const result = (0, child_process.spawnSync)("npx", [
|
|
195
238
|
"-y",
|
|
@@ -197,16 +240,15 @@ const createNxWorkspace = (args) => {
|
|
|
197
240
|
...allArgs
|
|
198
241
|
], {
|
|
199
242
|
stdio: "inherit",
|
|
200
|
-
env: {
|
|
201
|
-
...process.env,
|
|
202
|
-
pnpm_config_strict_dep_builds: "false"
|
|
203
|
-
},
|
|
204
243
|
shell: process.platform === "win32"
|
|
205
244
|
});
|
|
206
245
|
if (result.status !== 0) return result.status ?? 1;
|
|
207
246
|
if (!skipGit) {
|
|
208
247
|
const workspaceName = args.filter((a) => !a.startsWith("-"))[0];
|
|
209
|
-
if (workspaceName)
|
|
248
|
+
if (workspaceName) {
|
|
249
|
+
const workspaceDir = (0, path.resolve)(workspaceName);
|
|
250
|
+
if (!isGitRepo(workspaceDir)) initGitRepo(workspaceDir);
|
|
251
|
+
}
|
|
210
252
|
}
|
|
211
253
|
return 0;
|
|
212
254
|
};
|