@aws/nx-plugin 0.96.0 → 0.97.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/LICENSE-THIRD-PARTY +97 -56
- package/README.md +132 -62
- package/package.json +1 -1
- package/src/mcp-server/generator-info.d.ts +1 -1
- package/src/mcp-server/generator-info.js +1 -1
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +5 -5
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/general-guidance.d.ts +1 -1
- package/src/mcp-server/tools/general-guidance.js +2 -2
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.d.ts +1 -1
- package/src/mcp-server/tools/list-generators.d.ts +1 -1
- package/src/ts/nx-plugin/__snapshots__/generator.spec.ts.snap +17 -3
- package/src/ts/nx-plugin/files/mcp-server/tools/create-workspace-command.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/utils.ts.template +11 -1
- package/src/ts/nx-plugin/generator.js +0 -2
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +7 -13
- package/src/ts/react-website/app/generator.js +3 -7
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/utils/commands.d.ts +17 -3
- package/src/utils/commands.js +26 -12
- package/src/utils/commands.js.map +1 -1
- package/src/utils/generators.d.ts +4 -0
- package/src/utils/generators.js.map +1 -1
- package/src/utils/iac-providers.d.ts +7 -0
- package/src/utils/iac-providers.js +9 -0
- package/src/utils/iac-providers.js.map +1 -0
- package/src/utils/iac.d.ts +4 -5
- package/src/utils/iac.js +5 -3
- package/src/utils/iac.js.map +1 -1
- package/src/utils/nx.d.ts +9 -5
- package/src/utils/nx.js +4 -4
- package/src/utils/nx.js.map +1 -1
- package/src/utils/versions.d.ts +1 -2
- package/src/utils/versions.js +0 -1
- package/src/utils/versions.js.map +1 -1
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addGeneralGuidanceTool = exports.TOOL_SELECTION_GUIDE = void 0;
|
|
4
4
|
const schema_1 = require("../schema");
|
|
5
5
|
const generator_info_1 = require("../generator-info");
|
|
6
|
-
const
|
|
6
|
+
const iac_providers_1 = require("../../utils/iac-providers");
|
|
7
7
|
exports.TOOL_SELECTION_GUIDE = `## Tool Selection Guide
|
|
8
8
|
|
|
9
9
|
- Use the \`general-guidance\` tool for guidance and best practices for working with Nx and the Nx Plugin for AWS.
|
|
@@ -28,7 +28,7 @@ ${exports.TOOL_SELECTION_GUIDE}
|
|
|
28
28
|
## Getting Started
|
|
29
29
|
|
|
30
30
|
- Choose a package manager first. You can choose between ${schema_1.PACKAGE_MANAGERS.join(', ')}. It's recommended to use "pnpm" if the user has no preference
|
|
31
|
-
- Choose an infrastructure as code (IaC) provider next. You can choose between ${
|
|
31
|
+
- Choose an infrastructure as code (IaC) provider next. You can choose between ${iac_providers_1.IAC_PROVIDERS.join(', ')}. It's recommended to use CDK if the user has no preference
|
|
32
32
|
- Next, you must create an Nx workspace. Use the \`create-workspace-command\` tool for more details, and provide it with your chosen package manager
|
|
33
33
|
- After this, you can start scaffolding the main components of your application using generators. Use the \`list-generators\` tool to discover available generators, and the \`generator-guide\` tool for more detailed information about a specific generator
|
|
34
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general-guidance.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/mcp-server/tools/general-guidance.ts"],"names":[],"mappings":";;;AAMA,sCAA6C;AAC7C,sDAAoE;AACpE,
|
|
1
|
+
{"version":3,"file":"general-guidance.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/mcp-server/tools/general-guidance.ts"],"names":[],"mappings":";;;AAMA,sCAA6C;AAC7C,sDAAoE;AACpE,6DAA0D;AAE7C,QAAA,oBAAoB,GAAG;;;;;gGAK4D,CAAC;AAEjG;;GAEG;AACI,MAAM,sBAAsB,GAAG,CACpC,MAAiB,EACjB,UAA6B,EAC7B,EAAE;IACF,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,oFAAoF;KACvF,EACD,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE;;EAEd,4BAAoB;;;;2DAIqC,yBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;iFACL,6BAAa,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;EAOvG,yBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAA,+BAAc,EAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkC3E,MAAM,IAAA,gCAAe,EAAC,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,EAAE,UAAU,CAAC;;KAExE;aACI;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAtEW,QAAA,sBAAsB,0BAsEjC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
|
-
import { NxGeneratorInfo } from '../../utils/
|
|
6
|
+
import { NxGeneratorInfo } from '../../utils/generators';
|
|
7
7
|
/**
|
|
8
8
|
* Add a tool which provides a detailed guide for an individual generator
|
|
9
9
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
|
-
import { NxGeneratorInfo } from '../../utils/
|
|
6
|
+
import { NxGeneratorInfo } from '../../utils/generators';
|
|
7
7
|
/**
|
|
8
8
|
* Adds a tool which lists details about the available generators
|
|
9
9
|
*/
|
|
@@ -225,7 +225,11 @@ exports[`ts#nx-plugin generator > should generate MCP server files > test-plugin
|
|
|
225
225
|
"import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
226
226
|
import { z } from 'zod';
|
|
227
227
|
import { PackageManagerSchema } from '../schema';
|
|
228
|
-
import {
|
|
228
|
+
import {
|
|
229
|
+
buildCreateCommand,
|
|
230
|
+
buildInstallCommand,
|
|
231
|
+
getPackageName,
|
|
232
|
+
} from '../utils';
|
|
229
233
|
|
|
230
234
|
/**
|
|
231
235
|
* Registers a tool which tells a model how to create an Nx workspace
|
|
@@ -248,7 +252,7 @@ export const registerCreateWorkspaceCommandTool = (server: McpServer) => {
|
|
|
248
252
|
text: \`Run the following command to create a workspace:
|
|
249
253
|
|
|
250
254
|
\\\`\\\`\\\`bash
|
|
251
|
-
|
|
255
|
+
\${buildCreateCommand(packageManager, workspaceName)}
|
|
252
256
|
\\\`\\\`\\\`
|
|
253
257
|
|
|
254
258
|
This will create a new workspace within the \${workspaceName} directory.
|
|
@@ -450,6 +454,16 @@ export const buildNxCommand = (command: string, pm?: string) =>
|
|
|
450
454
|
: ''
|
|
451
455
|
}nx \${command}\`;
|
|
452
456
|
|
|
457
|
+
const CREATE_COMMANDS: Record<string, string> = {
|
|
458
|
+
npm: 'npm create',
|
|
459
|
+
pnpm: 'pnpm create',
|
|
460
|
+
yarn: 'yarn create',
|
|
461
|
+
bun: 'bun create',
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
export const buildCreateCommand = (pm: string, workspaceName: string) =>
|
|
465
|
+
\`\${CREATE_COMMANDS[pm] ?? \`\${pm} create\`} @aws/nx-workspace \${pm === 'npm' ? '-- ' : ''}\${workspaceName}\`;
|
|
466
|
+
|
|
453
467
|
export const buildInstallCommand = (pm: string, pkg: string) =>
|
|
454
468
|
({
|
|
455
469
|
pnpm: \`pnpm add -Dw \${pkg}\`,
|
|
@@ -462,7 +476,7 @@ const renderSchema = (schema: any) =>
|
|
|
462
476
|
Object.entries(schema.properties)
|
|
463
477
|
.map(
|
|
464
478
|
([parameter, parameterSchema]: [string, any]) =>
|
|
465
|
-
\`- \${parameter} [type: \${parameterSchema.type}]\${(schema.required ?? []).includes(parameter) ? \` (required)\` : ''} \${parameterSchema.description}\`,
|
|
479
|
+
\`- \${parameter} [type: \${parameterSchema.type}]\${parameterSchema.enum ? \` [options: \${parameterSchema.enum.join(', ')}]\` : ''}\${(schema.required ?? []).includes(parameter) ? \` (required)\` : ''} \${parameterSchema.description}\`,
|
|
466
480
|
)
|
|
467
481
|
.join('\\n');
|
|
468
482
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { PackageManagerSchema } from '../schema';
|
|
4
|
-
import { buildInstallCommand, getPackageName } from '../utils';
|
|
4
|
+
import { buildCreateCommand, buildInstallCommand, getPackageName } from '../utils';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Registers a tool which tells a model how to create an Nx workspace
|
|
@@ -20,7 +20,7 @@ export const registerCreateWorkspaceCommandTool = (server: McpServer) => {
|
|
|
20
20
|
text: `Run the following command to create a workspace:
|
|
21
21
|
|
|
22
22
|
\`\`\`bash
|
|
23
|
-
|
|
23
|
+
${buildCreateCommand(packageManager, workspaceName)}
|
|
24
24
|
\`\`\`
|
|
25
25
|
|
|
26
26
|
This will create a new workspace within the ${workspaceName} directory.
|
|
@@ -41,6 +41,16 @@ export const buildNxCommand = (command: string, pm?: string) =>
|
|
|
41
41
|
: ''
|
|
42
42
|
}nx ${command}`;
|
|
43
43
|
|
|
44
|
+
const CREATE_COMMANDS: Record<string, string> = {
|
|
45
|
+
npm: 'npm create',
|
|
46
|
+
pnpm: 'pnpm create',
|
|
47
|
+
yarn: 'yarn create',
|
|
48
|
+
bun: 'bun create',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const buildCreateCommand = (pm: string, workspaceName: string) =>
|
|
52
|
+
`${CREATE_COMMANDS[pm] ?? `${pm} create`} @aws/nx-workspace ${pm === 'npm' ? '-- ' : ''}${workspaceName}`;
|
|
53
|
+
|
|
44
54
|
export const buildInstallCommand = (pm: string, pkg: string) =>
|
|
45
55
|
({
|
|
46
56
|
pnpm: `pnpm add -Dw ${pkg}`,
|
|
@@ -53,7 +63,7 @@ const renderSchema = (schema: any) =>
|
|
|
53
63
|
Object.entries(schema.properties)
|
|
54
64
|
.map(
|
|
55
65
|
([parameter, parameterSchema]: [string, any]) =>
|
|
56
|
-
`- ${parameter} [type: ${parameterSchema.type}]${(schema.required ?? []).includes(parameter) ? ` (required)` : ''} ${parameterSchema.description}`,
|
|
66
|
+
`- ${parameter} [type: ${parameterSchema.type}]${parameterSchema.enum ? ` [options: ${parameterSchema.enum.join(', ')}]` : ''}${(schema.required ?? []).includes(parameter) ? ` (required)` : ''} ${parameterSchema.description}`,
|
|
57
67
|
)
|
|
58
68
|
.join('\n');
|
|
59
69
|
|
|
@@ -13,7 +13,6 @@ const format_1 = require("../../utils/format");
|
|
|
13
13
|
const generator_1 = tslib_1.__importStar(require("../lib/generator"));
|
|
14
14
|
const utils_1 = require("./utils");
|
|
15
15
|
const generator_2 = tslib_1.__importDefault(require("../mcp-server/generator"));
|
|
16
|
-
const versions_1 = require("../../utils/versions");
|
|
17
16
|
exports.TS_NX_PLUGIN_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
18
17
|
const tsNxPluginGenerator = async (tree, options) => {
|
|
19
18
|
// Generate a TypeScript project as the base
|
|
@@ -84,7 +83,6 @@ const tsNxPluginGenerator = async (tree, options) => {
|
|
|
84
83
|
// Add generator MCP server
|
|
85
84
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'mcp-server'), mcpPath, {
|
|
86
85
|
name: fullyQualifiedName,
|
|
87
|
-
createNxWorkspaceVersion: versions_1.TS_VERSIONS['create-nx-workspace'],
|
|
88
86
|
}, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
89
87
|
(0, nx_1.addGeneratorMetadata)(tree, project.name, exports.TS_NX_PLUGIN_GENERATOR_INFO);
|
|
90
88
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [exports.TS_NX_PLUGIN_GENERATOR_INFO]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/nx-plugin/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCASoB;AAEpB,uCAKwB;AACxB,iDAAsE;AACtE,+CAA0D;AAC1D,sEAAuE;AACvE,mCAAuD;AACvD,gFAA2D;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/nx-plugin/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCASoB;AAEpB,uCAKwB;AACxB,iDAAsE;AACtE,+CAA0D;AAC1D,sEAAuE;AACvE,mCAAuD;AACvD,gFAA2D;AAE9C,QAAA,2BAA2B,GACtC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,mBAAmB,GAAG,KAAK,EACtC,IAAU,EACV,OAAkC,EACN,EAAE;IAC9B,4CAA4C;IAC5C,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,GAAG,IAAA,2BAAe,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnE,MAAM,IAAA,mBAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAExC,mDAAmD;IACnD,IAAA,oCAA4B,EAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAEvD,+EAA+E;IAC/E,MAAM,OAAO,GAAG,IAAA,wCAAmC,EAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IA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AAW,EAAE,MAAM;QACnB,WAAW,EAAE,KAAK,EAAE,WAAW;KAChC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IACpE,MAAM,aAAa,GAAG,IAAA,0BAAiB,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAE9D,qCAAqC;IACrC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC3B,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC3D,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,OAAO,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAE3E,2BAA2B;IAC3B,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,EACnD,OAAO,EACP;QACE,IAAI,EAAE,kBAAkB;KACzB,EACD,EAAE,iBAAiB,EAAE,0BAAiB,CAAC,YAAY,EAAE,CACtD,CAAC;IAEF,IAAA,yBAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,mCAA2B,CAAC,CAAC;IAEtE,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,mCAA2B,CAAC,CAAC,CAAC;IAE3E,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAjGW,QAAA,mBAAmB,uBAiG9B;AAEF,kBAAe,2BAAmB,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`react-website generator > TailwindCSS integration > should configure vite with TailwindCSS plugin by default > vite.config.mts-with-tailwind 1`] = `
|
|
4
4
|
"import tailwindcss from '@tailwindcss/vite';
|
|
5
|
-
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
6
5
|
import { resolve } from 'path';
|
|
7
6
|
import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
|
8
7
|
/// <reference types='vitest' />
|
|
@@ -27,7 +26,6 @@ export default defineConfig(() => ({
|
|
|
27
26
|
}),
|
|
28
27
|
react(),
|
|
29
28
|
tailwindcss(),
|
|
30
|
-
tsconfigPaths(),
|
|
31
29
|
],
|
|
32
30
|
// Uncomment this if you are using workers.
|
|
33
31
|
// worker: {
|
|
@@ -54,14 +52,14 @@ export default defineConfig(() => ({
|
|
|
54
52
|
},
|
|
55
53
|
passWithNoTests: true,
|
|
56
54
|
},
|
|
55
|
+
resolve: { tsconfigPaths: true },
|
|
57
56
|
define: { global: {} },
|
|
58
57
|
}));
|
|
59
58
|
"
|
|
60
59
|
`;
|
|
61
60
|
|
|
62
61
|
exports[`react-website generator > TailwindCSS integration > should configure vite without TailwindCSS plugin when disabled > vite.config.mts-without-tailwind 1`] = `
|
|
63
|
-
"import
|
|
64
|
-
import { resolve } from 'path';
|
|
62
|
+
"import { resolve } from 'path';
|
|
65
63
|
import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
|
66
64
|
/// <reference types='vitest' />
|
|
67
65
|
import { defineConfig } from 'vite';
|
|
@@ -84,7 +82,6 @@ export default defineConfig(() => ({
|
|
|
84
82
|
generatedRouteTree: resolve(__dirname, 'src/routeTree.gen.ts'),
|
|
85
83
|
}),
|
|
86
84
|
react(),
|
|
87
|
-
tsconfigPaths(),
|
|
88
85
|
],
|
|
89
86
|
// Uncomment this if you are using workers.
|
|
90
87
|
// worker: {
|
|
@@ -111,6 +108,7 @@ export default defineConfig(() => ({
|
|
|
111
108
|
},
|
|
112
109
|
passWithNoTests: true,
|
|
113
110
|
},
|
|
111
|
+
resolve: { tsconfigPaths: true },
|
|
114
112
|
define: { global: {} },
|
|
115
113
|
}));
|
|
116
114
|
"
|
|
@@ -1102,7 +1100,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1102
1100
|
"typescript": "~5.9.2",
|
|
1103
1101
|
"typescript-eslint": "^8.40.0",
|
|
1104
1102
|
"vite": "8.0.8",
|
|
1105
|
-
"vite-tsconfig-paths": "6.1.1",
|
|
1106
1103
|
"vitest": "4.1.4"
|
|
1107
1104
|
},
|
|
1108
1105
|
"type": "module"
|
|
@@ -2402,7 +2399,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2402
2399
|
|
|
2403
2400
|
exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > test-app/vite.config.mts 1`] = `
|
|
2404
2401
|
"import tailwindcss from '@tailwindcss/vite';
|
|
2405
|
-
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
2406
2402
|
/// <reference types='vitest' />
|
|
2407
2403
|
import { defineConfig } from 'vite';
|
|
2408
2404
|
import react from '@vitejs/plugin-react';
|
|
@@ -2418,7 +2414,7 @@ export default defineConfig(() => ({
|
|
|
2418
2414
|
port: 4300,
|
|
2419
2415
|
host: 'localhost',
|
|
2420
2416
|
},
|
|
2421
|
-
plugins: [react(), tailwindcss()
|
|
2417
|
+
plugins: [react(), tailwindcss()],
|
|
2422
2418
|
// Uncomment this if you are using workers.
|
|
2423
2419
|
// worker: {
|
|
2424
2420
|
// plugins: [],
|
|
@@ -2444,6 +2440,7 @@ export default defineConfig(() => ({
|
|
|
2444
2440
|
},
|
|
2445
2441
|
passWithNoTests: true,
|
|
2446
2442
|
},
|
|
2443
|
+
resolve: { tsconfigPaths: true },
|
|
2447
2444
|
define: { global: {} },
|
|
2448
2445
|
}));
|
|
2449
2446
|
"
|
|
@@ -2699,7 +2696,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2699
2696
|
"typescript": "~5.9.2",
|
|
2700
2697
|
"typescript-eslint": "^8.40.0",
|
|
2701
2698
|
"vite": "8.0.8",
|
|
2702
|
-
"vite-tsconfig-paths": "6.1.1",
|
|
2703
2699
|
"vitest": "4.1.4"
|
|
2704
2700
|
},
|
|
2705
2701
|
"type": "module"
|
|
@@ -4183,7 +4179,6 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
4183
4179
|
|
|
4184
4180
|
exports[`react-website generator > Tanstack router integration > should generate website with router correctly > test-app/vite.config.mts 1`] = `
|
|
4185
4181
|
"import tailwindcss from '@tailwindcss/vite';
|
|
4186
|
-
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
4187
4182
|
import { resolve } from 'path';
|
|
4188
4183
|
import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
|
4189
4184
|
/// <reference types='vitest' />
|
|
@@ -4208,7 +4203,6 @@ export default defineConfig(() => ({
|
|
|
4208
4203
|
}),
|
|
4209
4204
|
react(),
|
|
4210
4205
|
tailwindcss(),
|
|
4211
|
-
tsconfigPaths(),
|
|
4212
4206
|
],
|
|
4213
4207
|
// Uncomment this if you are using workers.
|
|
4214
4208
|
// worker: {
|
|
@@ -4235,6 +4229,7 @@ export default defineConfig(() => ({
|
|
|
4235
4229
|
},
|
|
4236
4230
|
passWithNoTests: true,
|
|
4237
4231
|
},
|
|
4232
|
+
resolve: { tsconfigPaths: true },
|
|
4238
4233
|
define: { global: {} },
|
|
4239
4234
|
}));
|
|
4240
4235
|
"
|
|
@@ -4297,7 +4292,6 @@ exports[`react-website generator > should configure TypeScript correctly > tscon
|
|
|
4297
4292
|
|
|
4298
4293
|
exports[`react-website generator > should configure vite correctly > vite.config.mts 1`] = `
|
|
4299
4294
|
"import tailwindcss from '@tailwindcss/vite';
|
|
4300
|
-
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
4301
4295
|
import { resolve } from 'path';
|
|
4302
4296
|
import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
|
4303
4297
|
/// <reference types='vitest' />
|
|
@@ -4322,7 +4316,6 @@ export default defineConfig(() => ({
|
|
|
4322
4316
|
}),
|
|
4323
4317
|
react(),
|
|
4324
4318
|
tailwindcss(),
|
|
4325
|
-
tsconfigPaths(),
|
|
4326
4319
|
],
|
|
4327
4320
|
// Uncomment this if you are using workers.
|
|
4328
4321
|
// worker: {
|
|
@@ -4349,6 +4342,7 @@ export default defineConfig(() => ({
|
|
|
4349
4342
|
},
|
|
4350
4343
|
passWithNoTests: true,
|
|
4351
4344
|
},
|
|
4345
|
+
resolve: { tsconfigPaths: true },
|
|
4352
4346
|
define: { global: {} },
|
|
4353
4347
|
}));
|
|
4354
4348
|
"
|
|
@@ -227,7 +227,6 @@ async function tsReactWebsiteGenerator(tree, schema) {
|
|
|
227
227
|
await (0, ast_1.addDestructuredImport)(tree, viteConfigPath, ['tanstackRouter'], '@tanstack/router-plugin/vite');
|
|
228
228
|
await (0, ast_1.addDestructuredImport)(tree, viteConfigPath, ['resolve'], 'path');
|
|
229
229
|
}
|
|
230
|
-
await (0, ast_1.addSingleImport)(tree, viteConfigPath, 'tsconfigPaths', 'vite-tsconfig-paths');
|
|
231
230
|
// Add TailwindCSS import if enabled
|
|
232
231
|
if (enableTailwind) {
|
|
233
232
|
await (0, ast_1.addSingleImport)(tree, viteConfigPath, 'tailwindcss', '@tailwindcss/vite');
|
|
@@ -243,7 +242,8 @@ async function tsReactWebsiteGenerator(tree, schema) {
|
|
|
243
242
|
if (enableTailwind) {
|
|
244
243
|
await (0, ast_1.applyGritQL)(tree, viteConfigPath, '`plugins: [$items]` => `plugins: [$items, tailwindcss()]` where { $items <: within `defineConfig($_)`, $items <: not some `tailwindcss()` }');
|
|
245
244
|
}
|
|
246
|
-
|
|
245
|
+
// Use Vite's native tsconfig paths resolution (replaces vite-tsconfig-paths)
|
|
246
|
+
await (0, ast_1.applyGritQL)(tree, viteConfigPath, 'or { `defineConfig(() => ({ $props }))` where { $props <: not some `resolve: $_`, $props += `resolve: { tsconfigPaths: true }` }, `defineConfig({ $props })` where { $props <: not some `resolve: $_`, $props += `resolve: { tsconfigPaths: true }` } }');
|
|
247
247
|
// Add define: { global: {} } to the config (handles both callback and direct forms)
|
|
248
248
|
await (0, ast_1.applyGritQL)(tree, viteConfigPath, 'or { `defineConfig(() => ({ $props }))` where { $props <: not contains `define`, $props += `define: { global: {} }` }, `defineConfig({ $props })` where { $props <: not contains `define`, $props += `define: { global: {} }` } }');
|
|
249
249
|
}
|
|
@@ -274,11 +274,7 @@ async function tsReactWebsiteGenerator(tree, schema) {
|
|
|
274
274
|
]
|
|
275
275
|
: tsconfig.references,
|
|
276
276
|
}));
|
|
277
|
-
const devDependencies = [
|
|
278
|
-
'vite-tsconfig-paths',
|
|
279
|
-
'@nx/react',
|
|
280
|
-
'@vitest/ui',
|
|
281
|
-
];
|
|
277
|
+
const devDependencies = ['@nx/react', '@vitest/ui'];
|
|
282
278
|
const dependencies = ['react', 'react-dom'];
|
|
283
279
|
if (uxProvider === 'Cloudscape') {
|
|
284
280
|
dependencies.push('@cloudscape-design/components', '@cloudscape-design/board-components', '@cloudscape-design/global-styles');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/react-website/app/generator.ts"],"names":[],"mappings":";;;AAyDA,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/react-website/app/generator.ts"],"names":[],"mappings":";;;AAyDA,0DAsbC;AA/eD;;;GAGG;AACH,uCAWoB;AAGpB,qCAAiD;AACjD,wEAA6E;AAC7E,wDAA2E;AAC3E,iEAAgE;AAChE,sDAAsE;AACtE,gDAA6D;AAC7D,4FAGoD;AACpD,gDAA2E;AAC3E,4CAI4B;AAC5B,kDAA6D;AAC7D,4DAA8E;AAC9E,+BAAqC;AACrC,kDAAuD;AACvD,0CAI2B;AAC3B,gEAAqE;AACrE,oDAAyE;AACzE,6FAAuF;AACvF,4CAAwD;AAE3C,QAAA,sBAAsB,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAU,CAAC;AAMnE,QAAA,gCAAgC,GAC3C,IAAA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CAAC;IAED,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC,YAAY,CAAC,EAC1B,IAAA,uBAAY,EAAC,eAAe,CAAC,CAC9B,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE;QAC1C,wCAAgC;KACjC,CAAC,CAAC;IAEH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YACxB,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AACD,kBAAe,uBAAuB,CAAC"}
|
package/src/utils/commands.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* Display-friendly command prefixes for each package manager.
|
|
3
7
|
*
|
|
@@ -12,6 +16,8 @@ export interface PackageManagerDisplayCommands {
|
|
|
12
16
|
exec: string;
|
|
13
17
|
/** Prefix for running package.json scripts: `npm run`, pnpm, yarn, bun */
|
|
14
18
|
run: string;
|
|
19
|
+
/** Prefix for `create` commands: `npm create`, `pnpm create`, etc. */
|
|
20
|
+
create: string;
|
|
15
21
|
}
|
|
16
22
|
export declare const PACKAGE_MANAGER_COMMANDS: Record<string, PackageManagerDisplayCommands>;
|
|
17
23
|
/**
|
|
@@ -27,7 +33,15 @@ export declare const buildPackageManagerShortCommand: (pm: string, command: stri
|
|
|
27
33
|
*/
|
|
28
34
|
export declare const buildInstallCommand: (pm: string, pkg: string, dev: boolean) => string;
|
|
29
35
|
/**
|
|
30
|
-
* Build a create-nx-workspace
|
|
31
|
-
*
|
|
36
|
+
* Build a command to create a new workspace using @aws/create-nx-workspace.
|
|
37
|
+
*
|
|
38
|
+
* Uses the `create` shorthand for each package manager:
|
|
39
|
+
* npm create @aws/nx-workspace my-project
|
|
40
|
+
* pnpm create @aws/nx-workspace my-project
|
|
41
|
+
* yarn create @aws/nx-workspace my-project
|
|
42
|
+
* bun create @aws/nx-workspace my-project
|
|
43
|
+
*
|
|
44
|
+
* The package manager is auto-detected by @aws/create-nx-workspace from the
|
|
45
|
+
* invoking command, so --pm is not needed.
|
|
32
46
|
*/
|
|
33
|
-
export declare const buildCreateNxWorkspaceCommand: (pm: string, workspace: string, iacProvider?: "CDK" | "Terraform"
|
|
47
|
+
export declare const buildCreateNxWorkspaceCommand: (pm: string, workspace: string, iacProvider?: "CDK" | "Terraform") => string;
|
package/src/utils/commands.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildCreateNxWorkspaceCommand = exports.buildInstallCommand = exports.buildPackageManagerShortCommand = exports.buildPackageManagerExecCommand = exports.PACKAGE_MANAGER_COMMANDS = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
const versions_1 = require("./versions");
|
|
9
4
|
exports.PACKAGE_MANAGER_COMMANDS = {
|
|
10
|
-
npm: { exec: 'npx', run: 'npm run' },
|
|
11
|
-
pnpm: { exec: 'pnpm', run: 'pnpm' },
|
|
12
|
-
yarn: { exec: 'yarn', run: 'yarn' },
|
|
13
|
-
bun: { exec: 'bunx', run: 'bun' },
|
|
5
|
+
npm: { exec: 'npx', run: 'npm run', create: 'npm create' },
|
|
6
|
+
pnpm: { exec: 'pnpm', run: 'pnpm', create: 'pnpm create' },
|
|
7
|
+
yarn: { exec: 'yarn', run: 'yarn', create: 'yarn create' },
|
|
8
|
+
bun: { exec: 'bunx', run: 'bun', create: 'bun create' },
|
|
14
9
|
};
|
|
15
10
|
/**
|
|
16
11
|
* Build a package manager exec command (e.g. pnpm cmd, npx cmd, bunx cmd)
|
|
@@ -47,9 +42,28 @@ const buildInstallCommand = (pm, pkg, dev) => {
|
|
|
47
42
|
};
|
|
48
43
|
exports.buildInstallCommand = buildInstallCommand;
|
|
49
44
|
/**
|
|
50
|
-
* Build a create-nx-workspace
|
|
51
|
-
*
|
|
45
|
+
* Build a command to create a new workspace using @aws/create-nx-workspace.
|
|
46
|
+
*
|
|
47
|
+
* Uses the `create` shorthand for each package manager:
|
|
48
|
+
* npm create @aws/nx-workspace my-project
|
|
49
|
+
* pnpm create @aws/nx-workspace my-project
|
|
50
|
+
* yarn create @aws/nx-workspace my-project
|
|
51
|
+
* bun create @aws/nx-workspace my-project
|
|
52
|
+
*
|
|
53
|
+
* The package manager is auto-detected by @aws/create-nx-workspace from the
|
|
54
|
+
* invoking command, so --pm is not needed.
|
|
52
55
|
*/
|
|
53
|
-
const buildCreateNxWorkspaceCommand = (pm, workspace, iacProvider
|
|
56
|
+
const buildCreateNxWorkspaceCommand = (pm, workspace, iacProvider) => {
|
|
57
|
+
const createPrefix = exports.PACKAGE_MANAGER_COMMANDS[pm]?.create ?? `${pm} create`;
|
|
58
|
+
const parts = [
|
|
59
|
+
createPrefix,
|
|
60
|
+
'@aws/nx-workspace',
|
|
61
|
+
// npm requires '--' to stop interpreting subsequent flags as npm config
|
|
62
|
+
...(pm === 'npm' ? ['--'] : []),
|
|
63
|
+
workspace,
|
|
64
|
+
...(iacProvider ? [`--iacProvider=${iacProvider}`] : []),
|
|
65
|
+
];
|
|
66
|
+
return parts.join(' ');
|
|
67
|
+
};
|
|
54
68
|
exports.buildCreateNxWorkspaceCommand = buildCreateNxWorkspaceCommand;
|
|
55
69
|
//# sourceMappingURL=commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/commands.ts"],"names":[],"mappings":";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|
|
10
|
+
/**
|
|
11
|
+
* Alias for GeneratorInfo used by MCP server and generators
|
|
12
|
+
*/
|
|
13
|
+
export type NxGeneratorInfo = GeneratorInfo;
|
|
10
14
|
/**
|
|
11
15
|
* Build the list of generator info, resolving schema/factory paths relative to the given base directory.
|
|
12
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/generators.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,oFAAmD;AACnD,mDAA6B;
|
|
1
|
+
{"version":3,"file":"generators.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/generators.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,oFAAmD;AACnD,mDAA6B;AAiB7B;;GAEG;AACI,MAAM,sBAAsB,GAAG,CAAC,OAAe,EAAmB,EAAE,CACzE,MAAM,CAAC,OAAO,CAAE,yBAAsC,CAAC,UAAU,CAAC,CAAC,GAAG,CACpE,CAAC,CAAC,EAAE,EAAE,IAAI,CAAgB,EAAE,EAAE,CAAC,CAAC;IAC9B,EAAE;IACF,MAAM,EAAE,IAAI,CAAC,MAAM;IACnB,mBAAmB,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;IACxD,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;IACtD,WAAW,EAAE,IAAI,CAAC,WAAW;IAC7B,GAAG,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,GAAG,CAAC,YAAY,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU;QACzC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;QACjC,CAAC,CAAC,EAAE,CAAC;CACR,CAAC,CACH,CAAC;AAbS,QAAA,sBAAsB,0BAa/B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
export declare const IAC_PROVIDERS: readonly ["CDK", "Terraform"];
|
|
6
|
+
export type IacProvider = (typeof IAC_PROVIDERS)[number];
|
|
7
|
+
export type IacProviderOption = IacProvider | 'Inherit';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.IAC_PROVIDERS = void 0;
|
|
8
|
+
exports.IAC_PROVIDERS = ['CDK', 'Terraform'];
|
|
9
|
+
//# sourceMappingURL=iac-providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iac-providers.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/iac-providers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,aAAa,GAAG,CAAC,KAAK,EAAE,WAAW,CAAU,CAAC"}
|
package/src/utils/iac.d.ts
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { Tree } from '@nx/devkit';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export type IacProviderOption = IacProvider | 'Inherit';
|
|
6
|
+
export { IAC_PROVIDERS, type IacProvider, type IacProviderOption, } from './iac-providers';
|
|
7
|
+
import { IAC_PROVIDERS } from './iac-providers';
|
|
9
8
|
/**
|
|
10
9
|
* Configuration for infrastructure as code
|
|
11
10
|
*/
|
|
@@ -13,9 +12,9 @@ export interface IacConfig {
|
|
|
13
12
|
/**
|
|
14
13
|
* Default provider for infrastructure as code
|
|
15
14
|
*/
|
|
16
|
-
provider:
|
|
15
|
+
provider: (typeof IAC_PROVIDERS)[number];
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* Given an iac provider option, resolve the actual iac provider to use
|
|
20
19
|
*/
|
|
21
|
-
export declare const resolveIacProvider: (tree: Tree, iacProviderOption:
|
|
20
|
+
export declare const resolveIacProvider: (tree: Tree, iacProviderOption: "CDK" | "Terraform" | "Inherit") => Promise<(typeof IAC_PROVIDERS)[number]>;
|
package/src/utils/iac.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveIacProvider = exports.IAC_PROVIDERS = void 0;
|
|
4
4
|
const utils_1 = require("./config/utils");
|
|
5
|
-
|
|
5
|
+
var iac_providers_1 = require("./iac-providers");
|
|
6
|
+
Object.defineProperty(exports, "IAC_PROVIDERS", { enumerable: true, get: function () { return iac_providers_1.IAC_PROVIDERS; } });
|
|
7
|
+
const iac_providers_2 = require("./iac-providers");
|
|
6
8
|
/**
|
|
7
9
|
* Given an iac provider option, resolve the actual iac provider to use
|
|
8
10
|
*/
|
|
@@ -12,8 +14,8 @@ const resolveIacProvider = async (tree, iacProviderOption) => {
|
|
|
12
14
|
if (!pluginConfig?.iac?.provider) {
|
|
13
15
|
throw new Error(`IaC provider "Inherit" requires iac.provider to be set in ${utils_1.AWS_NX_PLUGIN_CONFIG_FILE_NAME}`);
|
|
14
16
|
}
|
|
15
|
-
if (!
|
|
16
|
-
throw new Error(`iac.provider in ${utils_1.AWS_NX_PLUGIN_CONFIG_FILE_NAME} must be one of ${
|
|
17
|
+
if (!iac_providers_2.IAC_PROVIDERS.includes(pluginConfig.iac.provider)) {
|
|
18
|
+
throw new Error(`iac.provider in ${utils_1.AWS_NX_PLUGIN_CONFIG_FILE_NAME} must be one of ${iac_providers_2.IAC_PROVIDERS.join(', ')}`);
|
|
17
19
|
}
|
|
18
20
|
return pluginConfig.iac.provider;
|
|
19
21
|
}
|
package/src/utils/iac.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iac.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/iac.ts"],"names":[],"mappings":";;;AAKA,0CAGwB;
|
|
1
|
+
{"version":3,"file":"iac.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/iac.ts"],"names":[],"mappings":";;;AAKA,0CAGwB;AAExB,iDAIyB;AAHvB,8GAAA,aAAa,OAAA;AAIf,mDAAgD;AAYhD;;GAEG;AACI,MAAM,kBAAkB,GAAG,KAAK,EACrC,IAAU,EACV,iBAAkD,EACT,EAAE;IAC3C,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACpC,MAAM,YAAY,GAAG,MAAM,IAAA,6BAAqB,EAAC,IAAI,CAAC,CAAC;QAEvD,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,6DAA6D,sCAA8B,EAAE,CAC9F,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,6BAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,KAAK,CACb,mBAAmB,sCAA8B,mBAAmB,6BAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC/F,CAAC;QACJ,CAAC;QAED,OAAO,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC;IACnC,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AArBW,QAAA,kBAAkB,sBAqB7B"}
|
package/src/utils/nx.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
6
|
-
|
|
7
|
-
export type NxGeneratorInfo = GeneratorInfo;
|
|
6
|
+
export type { NxGeneratorInfo, GeneratorInfo } from './generators';
|
|
8
7
|
export { buildGeneratorInfoList } from './generators';
|
|
8
|
+
import { type GeneratorInfo } from './generators';
|
|
9
9
|
/**
|
|
10
10
|
* List Nx Plugin for AWS generators
|
|
11
11
|
* @param includeHidden include hidden generators (default false)
|
|
@@ -14,7 +14,7 @@ export declare const listGenerators: (includeHidden?: boolean) => GeneratorInfo[
|
|
|
14
14
|
/**
|
|
15
15
|
* Return generator information. Call this from a generator method with __filename
|
|
16
16
|
*/
|
|
17
|
-
export declare const getGeneratorInfo: (generatorFileName: string) =>
|
|
17
|
+
export declare const getGeneratorInfo: (generatorFileName: string) => GeneratorInfo;
|
|
18
18
|
export declare const getPackageVersion: () => string;
|
|
19
19
|
/**
|
|
20
20
|
* Read a project configuration where the project name may not be fully qualified (ie may omit the scope prefix)
|
|
@@ -23,7 +23,9 @@ export declare const readProjectConfigurationUnqualified: (tree: Tree, projectNa
|
|
|
23
23
|
/**
|
|
24
24
|
* Add metadata about the generator that generated the project to the project.json
|
|
25
25
|
*/
|
|
26
|
-
export declare const addGeneratorMetadata: (tree: Tree, projectName: string, info:
|
|
26
|
+
export declare const addGeneratorMetadata: (tree: Tree, projectName: string, info: {
|
|
27
|
+
id: string;
|
|
28
|
+
}, additionalMetadata?: {
|
|
27
29
|
[key: string]: any;
|
|
28
30
|
}) => void;
|
|
29
31
|
/**
|
|
@@ -38,7 +40,9 @@ export interface ComponentMetadata {
|
|
|
38
40
|
/**
|
|
39
41
|
* Add metadata about the generator that generated the component to the project.json
|
|
40
42
|
*/
|
|
41
|
-
export declare const addComponentGeneratorMetadata: (tree: Tree, projectName: string, info:
|
|
43
|
+
export declare const addComponentGeneratorMetadata: (tree: Tree, projectName: string, info: {
|
|
44
|
+
id: string;
|
|
45
|
+
}, componentPath: string, componentName?: string, additionalMetadata?: {
|
|
42
46
|
[key: string]: any;
|
|
43
47
|
}) => void;
|
|
44
48
|
/**
|