@aws/create-nx-workspace 1.0.0-rc.9 → 1.0.0-rc.91

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.
Files changed (2) hide show
  1. package/bin/index.cjs +150 -106
  2. package/package.json +1 -1
package/bin/index.cjs CHANGED
@@ -2,130 +2,160 @@
2
2
  let child_process = require("child_process");
3
3
  let fs = require("fs");
4
4
  let path = require("path");
5
- //#endregion
6
- //#region src/create-nx-workspace.ts
5
+ //#region ../nx-plugin/src/utils/versions.ts
7
6
  /**
8
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
9
- * SPDX-License-Identifier: Apache-2.0
7
+ * Versons for TypeScript dependencies added by generators
10
8
  */
11
- const NX_VERSION = {
12
- "@a2a-js/sdk": "0.3.13",
13
- "@aws/aws-distro-opentelemetry-node-autoinstrumentation": "0.11.0",
14
- "@aws-sdk/client-dynamodb": "3.1063.0",
15
- "@aws-sdk/client-bedrock-runtime": "3.1063.0",
16
- "@aws-sdk/client-s3": "3.1063.0",
17
- "@aws-sdk/client-sts": "3.1063.0",
18
- "@aws-sdk/credential-providers": "3.1063.0",
19
- "@aws-sdk/credential-provider-cognito-identity": "3.972.42",
20
- "@aws-sdk/client-secrets-manager": "3.1063.0",
21
- "@aws-sdk/rds-signer": "3.1063.0",
22
- "@aws-smithy/server-apigateway": "1.0.0-alpha.10",
23
- "@aws-smithy/server-node": "1.0.0-alpha.10",
24
- "@aws-lambda-powertools/logger": "2.33.1",
25
- "@aws-lambda-powertools/metrics": "2.33.1",
26
- "@aws-lambda-powertools/parameters": "2.33.1",
27
- "@aws-lambda-powertools/tracer": "2.33.1",
28
- "@aws-lambda-powertools/parser": "2.33.1",
29
- "@aws-sdk/client-appconfigdata": "3.1063.0",
30
- "@middy/core": "7.6.5",
31
- "@nxlv/python": "22.2.0",
32
- "@nx-extend/terraform": "10.2.1",
33
- "@nx/devkit": "22.7.5",
34
- "@nx/react": "22.7.5",
35
- "create-nx-workspace": "22.7.5",
36
- "@modelcontextprotocol/sdk": "1.29.0",
37
- "@modelcontextprotocol/inspector": "0.19.0",
38
- "@ag-ui/aws-strands": "0.1.0",
39
- "@ag-ui/client": "0.0.53",
40
- "@ag-ui/core": "0.0.53",
41
- "@ag-ui/encoder": "0.0.53",
42
- "agent-chat-cli": "0.2.0",
43
- "@copilotkit/react-core": "1.59.5",
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.1121.0",
15
+ "@aws-sdk/client-api-gateway": "3.1121.0",
16
+ "@aws-sdk/client-iam": "3.1121.0",
17
+ "@aws-sdk/client-bedrock-agentcore": "3.1121.0",
18
+ "@aws-sdk/client-bedrock-runtime": "3.1121.0",
19
+ "@aws-sdk/client-s3": "3.1121.0",
20
+ "@aws-sdk/client-sts": "3.1121.0",
21
+ "@aws-sdk/credential-providers": "3.1121.0",
22
+ "@aws-sdk/credential-provider-cognito-identity": "3.972.69",
23
+ "@aws-sdk/client-secrets-manager": "3.1121.0",
24
+ "@aws-sdk/rds-signer": "3.1121.0",
25
+ "@smithy/server-apigateway": "0.3.3",
26
+ "@smithy/server-node": "0.3.3",
27
+ "@aws-lambda-powertools/logger": "2.35.0",
28
+ "@aws-lambda-powertools/metrics": "2.35.0",
29
+ "@aws-lambda-powertools/parameters": "2.35.0",
30
+ "@aws-lambda-powertools/tracer": "2.35.0",
31
+ "@aws-lambda-powertools/parser": "2.35.0",
32
+ "@aws-sdk/client-appconfigdata": "3.1121.0",
33
+ "@middy/core": "7.9.2",
34
+ "@nxlv/python": "23.0.0",
35
+ "@nx-extend/terraform": "10.4.1",
36
+ nx: "23.1.2",
37
+ "@nx/devkit": "23.1.2",
38
+ "@nx/js": "23.1.2",
39
+ "@nx/react": "23.1.2",
40
+ "@nx/vite": "23.1.2",
41
+ "@nx/vitest": "23.1.2",
42
+ "@nx/workspace": "23.1.2",
43
+ "create-nx-workspace": "23.1.2",
44
+ "@swc-node/register": "1.12.1",
45
+ "@swc/core": "1.16.1",
46
+ "@modelcontextprotocol/sdk": "1.30.0",
47
+ "@modelcontextprotocol/inspector": "2.4.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.69.3",
44
55
  rxjs: "7.8.2",
45
- "@strands-agents/sdk": "1.4.0",
46
- "@tanstack/react-router": "1.170.15",
47
- "@tanstack/router-plugin": "1.168.18",
48
- "@tanstack/router-generator": "1.167.17",
56
+ "@strands-agents/sdk": "1.15.0",
57
+ "@tanstack/react-router": "1.170.32",
58
+ "@tanstack/router-plugin": "1.168.35",
59
+ "@tanstack/router-generator": "1.167.33",
49
60
  "@tanstack/virtual-file-routes": "1.162.0",
50
61
  "@tanstack/router-utils": "1.162.2",
51
- "@cloudscape-design/board-components": "3.0.189",
52
- "@cloudscape-design/chat-components": "1.0.138",
53
- "@cloudscape-design/components": "3.0.1308",
54
- "@cloudscape-design/global-styles": "1.0.59",
55
- "@tanstack/react-query": "5.101.0",
56
- "@tanstack/react-query-devtools": "5.101.0",
57
- "@trpc/tanstack-react-query": "11.17.0",
58
- "@trpc/client": "11.17.0",
59
- "@trpc/server": "11.17.0",
60
- "@types/node": "25.9.2",
62
+ "@cloudscape-design/board-components": "3.0.221",
63
+ "@cloudscape-design/chat-components": "1.0.165",
64
+ "@cloudscape-design/components": "3.0.1356",
65
+ "@cloudscape-design/global-styles": "1.0.67",
66
+ "@tanstack/react-query": "5.102.8",
67
+ "@tanstack/react-query-devtools": "5.102.8",
68
+ "@trpc/tanstack-react-query": "11.18.0",
69
+ "@trpc/client": "11.18.0",
70
+ "@trpc/server": "11.18.0",
71
+ "@types/node": "26.4.0",
61
72
  "@types/aws-lambda": "8.10.162",
62
73
  "@types/cors": "2.8.19",
63
- "@types/pg": "8.20.0",
74
+ "@types/pg": "8.23.1",
64
75
  "@types/ws": "8.18.1",
65
76
  "@types/express": "5.0.6",
66
- "@smithy/config-resolver": "4.5.6",
67
- "@smithy/node-config-provider": "4.4.6",
68
- "@smithy/node-http-handler": "4.7.7",
69
- "@smithy/types": "4.14.3",
70
- "@vitest/coverage-v8": "4.1.8",
71
- "@vitest/ui": "4.1.8",
72
- "@astrojs/react": "5.0.7",
73
- "@astrojs/starlight": "0.39.3",
74
- astro: "6.4.4",
77
+ "@smithy/config-resolver": "4.7.2",
78
+ "@smithy/node-config-provider": "4.6.2",
79
+ "@smithy/node-http-handler": "4.11.3",
80
+ "@smithy/types": "4.17.2",
81
+ "@vitest/coverage-v8": "4.1.11",
82
+ "@vitest/ui": "4.1.11",
83
+ "@astrojs/react": "6.0.4",
84
+ "@astrojs/starlight": "0.41.10",
85
+ astro: "7.2.9",
86
+ cookie: "2.0.1",
75
87
  aws4fetch: "1.0.20",
76
- "aws-cdk": "2.1126.0",
77
- "aws-cdk-lib": "2.258.0",
88
+ "aws-cdk": "2.1139.0",
89
+ "aws-cdk-lib": "2.267.0",
78
90
  "aws-xray-sdk-core": "3.12.0",
79
- constructs: "10.6.0",
91
+ constructs: "10.8.1",
80
92
  cors: "2.8.6",
81
- chalk: "5.6.2",
93
+ chalk: "6.0.0",
82
94
  "class-variance-authority": "0.7.1",
83
95
  clsx: "2.1.1",
84
- commander: "14.0.3",
85
- electrodb: "3.9.0",
86
- esbuild: "0.28.0",
96
+ commander: "15.0.0",
97
+ "cpy-cli": "7.0.0",
98
+ electrodb: "3.9.3",
99
+ esbuild: "0.28.2",
87
100
  "event-source-polyfill": "1.0.31",
88
101
  "@types/event-source-polyfill": "1.0.5",
89
- "@biomejs/biome": "2.4.16",
90
- "@prisma/adapter-mariadb": "7.8.0",
91
- "@prisma/adapter-pg": "7.8.0",
92
- "@prisma/client": "7.8.0",
102
+ "@biomejs/biome": "2.5.11",
103
+ "@prisma/adapter-mariadb": "7.10.0",
104
+ "@prisma/adapter-pg": "7.10.0",
105
+ "@prisma/client": "7.10.0",
106
+ ejs: "6.0.1",
107
+ "@types/ejs": "3.1.5",
93
108
  express: "5.2.1",
94
109
  "fast-glob": "3.3.3",
95
110
  husky: "9.1.7",
96
- "fs-extra": "11.3.5",
111
+ "fs-extra": "11.4.0",
97
112
  "@types/fs-extra": "11.0.4",
98
113
  "make-dir-cli": "4.0.0",
99
- mariadb: "3.5.2",
114
+ mariadb: "3.5.3",
115
+ mise: "2026.8.14",
100
116
  ncp: "2.0.0",
101
- "npm-check-updates": "19.6.6",
117
+ npm: "12.0.2",
118
+ "npm-check-updates": "23.1.0",
102
119
  "oidc-client-ts": "3.5.0",
103
- pg: "8.21.0",
104
- prisma: "7.8.0",
120
+ pg: "8.23.0",
121
+ prisma: "7.10.0",
105
122
  "react-oidc-context": "3.3.1",
106
- react: "19.2.7",
107
- "react-dom": "19.2.7",
123
+ react: "19.2.8",
124
+ "react-dom": "19.2.8",
108
125
  rimraf: "6.1.3",
109
- rolldown: "1.0.3",
126
+ rolldown: "1.2.6",
127
+ "rolldown-plugin-dts": "0.28.3",
110
128
  "simple-git": "3.36.0",
111
129
  "source-map-support": "0.5.21",
112
- "starlight-blog": "0.26.1",
113
- tailwindcss: "4.2.2",
114
- "@tailwindcss/vite": "4.2.2",
115
- tsx: "4.22.4",
116
- "lucide-react": "1.17.0",
117
- "radix-ui": "1.5.0",
118
- shadcn: "4.10.0",
130
+ "starlight-blog": "0.29.0",
131
+ tailwindcss: "4.3.3",
132
+ "@tailwindcss/vite": "4.3.3",
133
+ tsx: "4.23.12",
134
+ "lucide-react": "1.37.0",
135
+ "radix-ui": "1.6.7",
136
+ shadcn: "4.19.0",
119
137
  "tw-animate-css": "1.4.0",
120
138
  "tailwind-merge": "3.6.0",
121
- vite: "8.0.16",
139
+ vite: "8.2.2",
122
140
  typescript: "6.0.3",
123
- vitest: "4.1.8",
124
- zod: "4.4.3",
125
- ws: "8.21.0"
126
- }["create-nx-workspace"];
141
+ vitest: "4.1.11",
142
+ zod: "4.5.4",
143
+ ws: "8.21.3"
144
+ };
145
+ TS_VERSIONS.nx;
146
+ //#endregion
147
+ //#region src/create-nx-workspace.ts
148
+ /**
149
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
150
+ * SPDX-License-Identifier: Apache-2.0
151
+ */
152
+ const NX_VERSION = TS_VERSIONS["create-nx-workspace"];
127
153
  const PRESET = `@aws/nx-plugin@${JSON.parse((0, fs.readFileSync)((0, path.resolve)(__dirname, "..", "package.json"), "utf-8")).version}`;
128
- const DEFAULT_FLAGS = ["--ci=skip", "--analytics=false"];
154
+ const DEFAULT_FLAGS = [
155
+ "--ci=skip",
156
+ "--analytics=false",
157
+ "--trustThirdPartyPreset"
158
+ ];
129
159
  /**
130
160
  * Detect the package manager from the npm_config_user_agent environment variable.
131
161
  * This is set by package managers when running scripts/bins.
@@ -139,21 +169,34 @@ const detectPackageManager = () => {
139
169
  if (userAgent.startsWith("npm/")) return "npm";
140
170
  };
141
171
  const shouldSkipGit = (flagArgs) => flagArgs.some((a) => a === "--skipGit" || a === "--skipGit=true");
172
+ /**
173
+ * Determine whether the given directory is already inside a git repository.
174
+ */
175
+ const isGitRepo = (dir) => {
176
+ if (!(0, fs.existsSync)(dir)) return false;
177
+ const result = (0, child_process.spawnSync)("git", ["rev-parse", "--is-inside-work-tree"], {
178
+ cwd: dir,
179
+ stdio: "pipe",
180
+ shell: process.platform === "win32"
181
+ });
182
+ return result.status === 0 && result.stdout?.toString().trim() === "true";
183
+ };
142
184
  const buildArgs = (args) => {
143
- const positionalArgs = args.filter((a) => !a.startsWith("-"));
144
- const flagArgs = args.filter((a) => a.startsWith("-"));
185
+ const firstFlagIndex = args.findIndex((a) => a.startsWith("-"));
186
+ const positionalArgs = firstFlagIndex === -1 ? args : args.slice(0, firstFlagIndex);
187
+ const restArgs = firstFlagIndex === -1 ? [] : args.slice(firstFlagIndex);
145
188
  const defaultFlags = [...DEFAULT_FLAGS, "--skipGit"];
146
- if (!flagArgs.some((a) => a.startsWith("--pm"))) {
189
+ if (!restArgs.some((a) => a.startsWith("--pm"))) {
147
190
  const pm = detectPackageManager();
148
191
  if (pm) defaultFlags.push(`--pm=${pm}`);
149
192
  }
150
- const userFlagsWithoutSkipGit = flagArgs.filter((a) => !a.startsWith("--skipGit"));
151
- const flagsToAdd = defaultFlags.filter((flag) => !userFlagsWithoutSkipGit.some((a) => a.startsWith(flag.split("=")[0])));
193
+ const userArgsWithoutSkipGit = restArgs.filter((a) => !a.startsWith("--skipGit"));
194
+ const flagsToAdd = defaultFlags.filter((flag) => !userArgsWithoutSkipGit.some((a) => a.startsWith(flag.split("=")[0])));
152
195
  return [
153
196
  ...positionalArgs,
154
197
  `--preset=${PRESET}`,
155
198
  ...flagsToAdd,
156
- ...userFlagsWithoutSkipGit
199
+ ...userArgsWithoutSkipGit
157
200
  ];
158
201
  };
159
202
  const initGitRepo = (dir) => {
@@ -162,7 +205,8 @@ const initGitRepo = (dir) => {
162
205
  cwd: dir,
163
206
  stdio: "pipe"
164
207
  });
165
- (0, child_process.spawnSync)(detectPackageManager() ?? "npm", ["run", "prepare"], {
208
+ const pm = detectPackageManager() ?? "npm";
209
+ (0, child_process.spawnSync)(pm, ["run", "prepare"], {
166
210
  cwd: dir,
167
211
  stdio: "pipe",
168
212
  shell
@@ -189,7 +233,8 @@ const createNxWorkspace = (args) => {
189
233
  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
234
  return 1;
191
235
  }
192
- const skipGit = shouldSkipGit(args.filter((a) => a.startsWith("-")));
236
+ const flagArgs = args.filter((a) => a.startsWith("-"));
237
+ const skipGit = shouldSkipGit(flagArgs);
193
238
  const allArgs = buildArgs(args);
194
239
  const result = (0, child_process.spawnSync)("npx", [
195
240
  "-y",
@@ -197,16 +242,15 @@ const createNxWorkspace = (args) => {
197
242
  ...allArgs
198
243
  ], {
199
244
  stdio: "inherit",
200
- env: {
201
- ...process.env,
202
- pnpm_config_strict_dep_builds: "false"
203
- },
204
245
  shell: process.platform === "win32"
205
246
  });
206
247
  if (result.status !== 0) return result.status ?? 1;
207
248
  if (!skipGit) {
208
249
  const workspaceName = args.filter((a) => !a.startsWith("-"))[0];
209
- if (workspaceName) initGitRepo((0, path.resolve)(workspaceName));
250
+ if (workspaceName) {
251
+ const workspaceDir = (0, path.resolve)(workspaceName);
252
+ if (!isGitRepo(workspaceDir)) initGitRepo(workspaceDir);
253
+ }
210
254
  }
211
255
  return 0;
212
256
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/create-nx-workspace",
3
- "version": "1.0.0-rc.9",
3
+ "version": "1.0.0-rc.91",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",