@aws/nx-plugin 0.121.0 → 1.0.0-rc.0
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/generators.json +47 -6
- package/package.json +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +5 -7
- package/src/py/api/generator.d.ts +10 -0
- package/src/py/api/generator.js +25 -0
- package/src/py/api/generator.js.map +1 -0
- package/src/py/api/schema.d.ts +19 -0
- package/src/py/api/schema.json +100 -0
- package/src/ts/api/generator.d.ts +10 -0
- package/src/ts/api/generator.js +36 -0
- package/src/ts/api/generator.js.map +1 -0
- package/src/ts/api/schema.d.ts +18 -0
- package/src/ts/api/schema.json +105 -0
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +1 -0
- package/src/ts/astro-docs/generator.js +1 -0
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/docs/generator.d.ts +10 -0
- package/src/ts/docs/generator.js +13 -0
- package/src/ts/docs/generator.js.map +1 -0
- package/src/ts/docs/schema.d.ts +34 -0
- package/src/ts/docs/schema.json +70 -0
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +4 -2
- package/src/ts/react-website/app/generator.js +1 -0
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/website/app/generator.d.ts +10 -0
- package/src/ts/website/app/generator.js +13 -0
- package/src/ts/website/app/generator.js.map +1 -0
- package/src/ts/website/app/schema.d.ts +20 -0
- package/src/ts/website/app/schema.json +97 -0
- package/src/ts/website/auth/generator.d.ts +10 -0
- package/src/ts/website/auth/generator.js +17 -0
- package/src/ts/website/auth/generator.js.map +1 -0
- package/src/ts/website/auth/schema.d.ts +12 -0
- package/src/ts/website/auth/schema.json +46 -0
package/generators.json
CHANGED
|
@@ -67,12 +67,20 @@
|
|
|
67
67
|
"metric": "g20",
|
|
68
68
|
"hidden": true
|
|
69
69
|
},
|
|
70
|
+
"py#api": {
|
|
71
|
+
"factory": "./src/py/api/generator",
|
|
72
|
+
"schema": "./src/py/api/schema.json",
|
|
73
|
+
"description": "Create a Python API",
|
|
74
|
+
"metric": "g45",
|
|
75
|
+
"guidePages": ["py-api", "fastapi"]
|
|
76
|
+
},
|
|
70
77
|
"py#fast-api": {
|
|
71
78
|
"factory": "./src/py/fast-api/generator",
|
|
72
79
|
"schema": "./src/py/fast-api/schema.json",
|
|
73
80
|
"description": "Generates a FastAPI Python project",
|
|
74
81
|
"metric": "g3",
|
|
75
|
-
"guidePages": ["fastapi"]
|
|
82
|
+
"guidePages": ["fastapi"],
|
|
83
|
+
"hidden": true
|
|
76
84
|
},
|
|
77
85
|
"py#fast-api#react-connection": {
|
|
78
86
|
"factory": "./src/py/fast-api/react/generator",
|
|
@@ -142,12 +150,20 @@
|
|
|
142
150
|
"metric": "g23",
|
|
143
151
|
"guidePages": ["terraform-project"]
|
|
144
152
|
},
|
|
153
|
+
"ts#docs": {
|
|
154
|
+
"factory": "./src/ts/docs/generator",
|
|
155
|
+
"schema": "./src/ts/docs/schema.json",
|
|
156
|
+
"description": "Generates a documentation site",
|
|
157
|
+
"metric": "g43",
|
|
158
|
+
"guidePages": ["docs", "astro-docs"]
|
|
159
|
+
},
|
|
145
160
|
"ts#astro-docs": {
|
|
146
161
|
"factory": "./src/ts/astro-docs/generator",
|
|
147
162
|
"schema": "./src/ts/astro-docs/schema.json",
|
|
148
163
|
"description": "Generates an Astro + Starlight documentation site with localisation, snippets, blog, and optional automated documentation translation",
|
|
149
164
|
"metric": "g37",
|
|
150
|
-
"guidePages": ["astro-docs"]
|
|
165
|
+
"guidePages": ["astro-docs"],
|
|
166
|
+
"hidden": true
|
|
151
167
|
},
|
|
152
168
|
"ts#infra": {
|
|
153
169
|
"factory": "./src/infra/app/generator",
|
|
@@ -188,19 +204,35 @@
|
|
|
188
204
|
"metric": "g1",
|
|
189
205
|
"guidePages": ["typescript-project"]
|
|
190
206
|
},
|
|
207
|
+
"ts#website": {
|
|
208
|
+
"factory": "./src/ts/website/app/generator",
|
|
209
|
+
"schema": "./src/ts/website/app/schema.json",
|
|
210
|
+
"description": "Generates a website application",
|
|
211
|
+
"metric": "g43",
|
|
212
|
+
"guidePages": ["website", "react-website"]
|
|
213
|
+
},
|
|
214
|
+
"ts#website#auth": {
|
|
215
|
+
"factory": "./src/ts/website/auth/generator",
|
|
216
|
+
"schema": "./src/ts/website/auth/schema.json",
|
|
217
|
+
"description": "Adds auth to an existing website",
|
|
218
|
+
"metric": "g44",
|
|
219
|
+
"guidePages": ["react-website-auth"]
|
|
220
|
+
},
|
|
191
221
|
"ts#react-website": {
|
|
192
222
|
"factory": "./src/ts/react-website/app/generator",
|
|
193
223
|
"schema": "./src/ts/react-website/app/schema.json",
|
|
194
224
|
"description": "Generates a React static website",
|
|
195
225
|
"metric": "g5",
|
|
196
|
-
"guidePages": ["react-website"]
|
|
226
|
+
"guidePages": ["react-website"],
|
|
227
|
+
"hidden": true
|
|
197
228
|
},
|
|
198
229
|
"ts#react-website#auth": {
|
|
199
230
|
"factory": "./src/ts/react-website/cognito-auth/generator",
|
|
200
231
|
"schema": "./src/ts/react-website/cognito-auth/schema.json",
|
|
201
232
|
"description": "Adds auth to an existing React website",
|
|
202
233
|
"metric": "g6",
|
|
203
|
-
"guidePages": ["react-website-auth"]
|
|
234
|
+
"guidePages": ["react-website-auth"],
|
|
235
|
+
"hidden": true
|
|
204
236
|
},
|
|
205
237
|
"ts#react-website#runtime-config": {
|
|
206
238
|
"factory": "./src/ts/react-website/runtime-config/generator",
|
|
@@ -213,7 +245,8 @@
|
|
|
213
245
|
"factory": "./src/smithy/ts/api/generator",
|
|
214
246
|
"schema": "./src/smithy/ts/api/schema.json",
|
|
215
247
|
"description": "Create an API using Smithy and the Smithy TypeScript Server SDK",
|
|
216
|
-
"metric": "g26"
|
|
248
|
+
"metric": "g26",
|
|
249
|
+
"hidden": true
|
|
217
250
|
},
|
|
218
251
|
"ts#agent": {
|
|
219
252
|
"factory": "./src/ts/agent/generator",
|
|
@@ -256,12 +289,20 @@
|
|
|
256
289
|
"metric": "g29",
|
|
257
290
|
"hidden": true
|
|
258
291
|
},
|
|
292
|
+
"ts#api": {
|
|
293
|
+
"factory": "./src/ts/api/generator",
|
|
294
|
+
"schema": "./src/ts/api/schema.json",
|
|
295
|
+
"description": "Create a TypeScript API",
|
|
296
|
+
"metric": "g46",
|
|
297
|
+
"guidePages": ["ts-api", "trpc", "ts-smithy-api"]
|
|
298
|
+
},
|
|
259
299
|
"ts#trpc-api": {
|
|
260
300
|
"factory": "./src/trpc/backend/generator",
|
|
261
301
|
"schema": "./src/trpc/backend/schema.json",
|
|
262
302
|
"description": "creates a trpc backend",
|
|
263
303
|
"metric": "g9",
|
|
264
|
-
"guidePages": ["trpc"]
|
|
304
|
+
"guidePages": ["trpc"],
|
|
305
|
+
"hidden": true
|
|
265
306
|
},
|
|
266
307
|
"ts#trpc-api#react-connection": {
|
|
267
308
|
"factory": "./src/trpc/react/generator",
|
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@ The following list of generators are what is currently available in the \`@aws/n
|
|
|
36
36
|
|
|
37
37
|
- **license**: Add LICENSE files and configure source code licence headers
|
|
38
38
|
|
|
39
|
-
- **py#
|
|
39
|
+
- **py#api**: Create a Python API
|
|
40
40
|
|
|
41
41
|
- **py#lambda-function**: Adds a lambda function to a python project
|
|
42
42
|
|
|
@@ -48,7 +48,7 @@ The following list of generators are what is currently available in the \`@aws/n
|
|
|
48
48
|
|
|
49
49
|
- **terraform#project**: Generates a Terraform project
|
|
50
50
|
|
|
51
|
-
- **ts#
|
|
51
|
+
- **ts#docs**: Generates a documentation site
|
|
52
52
|
|
|
53
53
|
- **ts#infra**: Generates a cdk application
|
|
54
54
|
|
|
@@ -62,15 +62,13 @@ The following list of generators are what is currently available in the \`@aws/n
|
|
|
62
62
|
|
|
63
63
|
- **ts#project**: Generates a TypeScript project
|
|
64
64
|
|
|
65
|
-
- **ts#
|
|
65
|
+
- **ts#website**: Generates a website application
|
|
66
66
|
|
|
67
|
-
- **ts#
|
|
68
|
-
|
|
69
|
-
- **ts#smithy-api**: Create an API using Smithy and the Smithy TypeScript Server SDK
|
|
67
|
+
- **ts#website#auth**: Adds auth to an existing website
|
|
70
68
|
|
|
71
69
|
- **ts#agent**: Add an AI Agent to a TypeScript project
|
|
72
70
|
|
|
73
|
-
- **ts#
|
|
71
|
+
- **ts#api**: Create a TypeScript API
|
|
74
72
|
|
|
75
73
|
- **ts#rdb**: Create a relational database project
|
|
76
74
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { Tree } from '@nx/devkit';
|
|
6
|
+
import { PyApiGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../utils/nx';
|
|
8
|
+
export declare const PY_API_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare function pyApiGenerator(tree: Tree, options: PyApiGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
10
|
+
export default pyApiGenerator;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PY_API_GENERATOR_INFO = void 0;
|
|
4
|
+
exports.pyApiGenerator = pyApiGenerator;
|
|
5
|
+
const nx_1 = require("../../utils/nx");
|
|
6
|
+
const generator_1 = require("../fast-api/generator");
|
|
7
|
+
exports.PY_API_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
8
|
+
async function pyApiGenerator(tree, options) {
|
|
9
|
+
const framework = options.framework ?? 'fastapi';
|
|
10
|
+
switch (framework) {
|
|
11
|
+
case 'fastapi':
|
|
12
|
+
return (0, generator_1.pyFastApiProjectGenerator)(tree, {
|
|
13
|
+
name: options.name,
|
|
14
|
+
computeType: options.computeType,
|
|
15
|
+
integrationPattern: options.integrationPattern,
|
|
16
|
+
auth: options.auth,
|
|
17
|
+
directory: options.directory,
|
|
18
|
+
subDirectory: options.subDirectory,
|
|
19
|
+
moduleName: options.moduleName,
|
|
20
|
+
iacProvider: options.iacProvider,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = pyApiGenerator;
|
|
25
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/api/generator.ts"],"names":[],"mappings":";;;AAYA,wCAmBC;AAzBD,uCAAmE;AACnE,qDAAkE;AAErD,QAAA,qBAAqB,GAChC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,cAAc,CAClC,IAAU,EACV,OAA6B;IAE7B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,SAAS,CAAC;IAEjD,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,SAAS;YACZ,OAAO,IAAA,qCAAyB,EAAC,IAAI,EAAE;gBACrC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;gBAC9C,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;aACjC,CAAC,CAAC;IACP,CAAC;AACH,CAAC;AAED,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { IacProviderOption } from '../../utils/iac';
|
|
6
|
+
|
|
7
|
+
export interface PyApiGeneratorSchema {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly framework?: 'fastapi';
|
|
10
|
+
readonly computeType:
|
|
11
|
+
| 'ServerlessApiGatewayRestApi'
|
|
12
|
+
| 'ServerlessApiGatewayHttpApi';
|
|
13
|
+
readonly integrationPattern?: 'isolated' | 'shared';
|
|
14
|
+
readonly auth: 'IAM' | 'Cognito' | 'Custom';
|
|
15
|
+
readonly directory?: string;
|
|
16
|
+
readonly subDirectory?: string;
|
|
17
|
+
readonly moduleName?: string;
|
|
18
|
+
readonly iacProvider: IacProviderOption;
|
|
19
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "py#api",
|
|
4
|
+
"title": "py#api",
|
|
5
|
+
"description": "Create a Python API",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Name of the API project to generate",
|
|
11
|
+
"x-priority": "important",
|
|
12
|
+
"$default": {
|
|
13
|
+
"$source": "argv",
|
|
14
|
+
"index": 0
|
|
15
|
+
},
|
|
16
|
+
"x-prompt": "What name would you like your API to have? i.e: MyApi"
|
|
17
|
+
},
|
|
18
|
+
"framework": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "The API framework to use.",
|
|
21
|
+
"default": "fastapi",
|
|
22
|
+
"enum": ["fastapi"],
|
|
23
|
+
"x-prompt": {
|
|
24
|
+
"message": "Which API framework would you like to use?",
|
|
25
|
+
"type": "list",
|
|
26
|
+
"items": [
|
|
27
|
+
{
|
|
28
|
+
"value": "fastapi",
|
|
29
|
+
"label": "FastAPI (modern Python web framework)"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"default": "fastapi"
|
|
33
|
+
},
|
|
34
|
+
"x-priority": "important"
|
|
35
|
+
},
|
|
36
|
+
"computeType": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "The type of compute to use to deploy this API. Choose between ServerlessApiGatewayRestApi (default) or ServerlessApiGatewayHttpApi.",
|
|
39
|
+
"default": "ServerlessApiGatewayRestApi",
|
|
40
|
+
"enum": ["ServerlessApiGatewayRestApi", "ServerlessApiGatewayHttpApi"],
|
|
41
|
+
"x-prompt": "What compute type would you like to deploy your API with?",
|
|
42
|
+
"x-priority": "important"
|
|
43
|
+
},
|
|
44
|
+
"integrationPattern": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "How API Gateway integrations are generated for the API. Choose between isolated (default) and shared.",
|
|
47
|
+
"default": "isolated",
|
|
48
|
+
"enum": ["isolated", "shared"],
|
|
49
|
+
"x-priority": "important",
|
|
50
|
+
"x-prompt": {
|
|
51
|
+
"message": "How would you like to map integrations to your API operations?",
|
|
52
|
+
"type": "list",
|
|
53
|
+
"items": [
|
|
54
|
+
{
|
|
55
|
+
"value": "isolated",
|
|
56
|
+
"label": "isolated (one integration per operation)"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"value": "shared",
|
|
60
|
+
"label": "shared (single default integration with optional overrides)"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"default": "isolated"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"auth": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"description": "The method used to authenticate with your API. Choose between IAM (default), Cognito or Custom.",
|
|
69
|
+
"default": "IAM",
|
|
70
|
+
"enum": ["IAM", "Cognito", "Custom"],
|
|
71
|
+
"x-prompt": "How would you like users to authenticate with your API?",
|
|
72
|
+
"x-priority": "important"
|
|
73
|
+
},
|
|
74
|
+
"directory": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "The directory to store the application in.",
|
|
77
|
+
"default": "packages",
|
|
78
|
+
"x-prompt": "Which directory do you want to create the project in?",
|
|
79
|
+
"x-priority": "important"
|
|
80
|
+
},
|
|
81
|
+
"subDirectory": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"description": "The sub directory the project is placed in. By default this is the project name.",
|
|
84
|
+
"x-prompt": "Which sub directory do you want to create the project in? (By default this is the project name)"
|
|
85
|
+
},
|
|
86
|
+
"iacProvider": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
89
|
+
"enum": ["Inherit", "CDK", "Terraform"],
|
|
90
|
+
"x-priority": "important",
|
|
91
|
+
"default": "Inherit",
|
|
92
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: Inherit)"
|
|
93
|
+
},
|
|
94
|
+
"moduleName": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Python module name"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"required": ["name"]
|
|
100
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { Tree } from '@nx/devkit';
|
|
6
|
+
import { TsApiGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../utils/nx';
|
|
8
|
+
export declare const TS_API_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare function tsApiGenerator(tree: Tree, options: TsApiGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
10
|
+
export default tsApiGenerator;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TS_API_GENERATOR_INFO = void 0;
|
|
4
|
+
exports.tsApiGenerator = tsApiGenerator;
|
|
5
|
+
const nx_1 = require("../../utils/nx");
|
|
6
|
+
const generator_1 = require("../../trpc/backend/generator");
|
|
7
|
+
const generator_2 = require("../../smithy/ts/api/generator");
|
|
8
|
+
exports.TS_API_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
9
|
+
async function tsApiGenerator(tree, options) {
|
|
10
|
+
const framework = options.framework ?? 'trpc';
|
|
11
|
+
switch (framework) {
|
|
12
|
+
case 'trpc':
|
|
13
|
+
return (0, generator_1.tsTrpcApiGenerator)(tree, {
|
|
14
|
+
name: options.name,
|
|
15
|
+
computeType: options.computeType,
|
|
16
|
+
integrationPattern: options.integrationPattern,
|
|
17
|
+
auth: options.auth,
|
|
18
|
+
directory: options.directory,
|
|
19
|
+
subDirectory: options.subDirectory,
|
|
20
|
+
iacProvider: options.iacProvider,
|
|
21
|
+
});
|
|
22
|
+
case 'smithy':
|
|
23
|
+
return (0, generator_2.tsSmithyApiGenerator)(tree, {
|
|
24
|
+
name: options.name,
|
|
25
|
+
namespace: options.namespace,
|
|
26
|
+
computeType: 'ServerlessApiGatewayRestApi',
|
|
27
|
+
integrationPattern: options.integrationPattern,
|
|
28
|
+
auth: options.auth,
|
|
29
|
+
directory: options.directory,
|
|
30
|
+
subDirectory: options.subDirectory,
|
|
31
|
+
iacProvider: options.iacProvider,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = tsApiGenerator;
|
|
36
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/api/generator.ts"],"names":[],"mappings":";;;AAaA,wCA6BC;AApCD,uCAAmE;AACnE,4DAAkE;AAClE,6DAAqE;AAExD,QAAA,qBAAqB,GAChC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,cAAc,CAClC,IAAU,EACV,OAA6B;IAE7B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC;IAE9C,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,IAAA,8BAAkB,EAAC,IAAI,EAAE;gBAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;gBAC9C,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,WAAW,EAAE,OAAO,CAAC,WAAW;aACjC,CAAC,CAAC;QACL,KAAK,QAAQ;YACX,OAAO,IAAA,gCAAoB,EAAC,IAAI,EAAE;gBAChC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,WAAW,EAAE,6BAA6B;gBAC1C,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;gBAC9C,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,WAAW,EAAE,OAAO,CAAC,WAAW;aACjC,CAAC,CAAC;IACP,CAAC;AACH,CAAC;AAED,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { TsProjectGeneratorSchema } from '../lib/schema';
|
|
6
|
+
import { IacProviderOption } from '../../utils/iac';
|
|
7
|
+
|
|
8
|
+
export interface TsApiGeneratorSchema {
|
|
9
|
+
name: string;
|
|
10
|
+
framework?: 'trpc' | 'smithy';
|
|
11
|
+
namespace?: string;
|
|
12
|
+
computeType: 'ServerlessApiGatewayRestApi' | 'ServerlessApiGatewayHttpApi';
|
|
13
|
+
integrationPattern?: 'isolated' | 'shared';
|
|
14
|
+
auth: 'IAM' | 'Cognito' | 'Custom';
|
|
15
|
+
directory?: TsProjectGeneratorSchema['directory'];
|
|
16
|
+
subDirectory?: TsProjectGeneratorSchema['subDirectory'];
|
|
17
|
+
iacProvider: IacProviderOption;
|
|
18
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "ts#api",
|
|
4
|
+
"title": "ts#api",
|
|
5
|
+
"description": "Create a TypeScript API",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The name of the API (required). Used to generate class names and file paths.",
|
|
11
|
+
"$default": {
|
|
12
|
+
"$source": "argv",
|
|
13
|
+
"index": 0
|
|
14
|
+
},
|
|
15
|
+
"x-prompt": "What name would you like your API to have? i.e: MyApi"
|
|
16
|
+
},
|
|
17
|
+
"framework": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The API framework to use.",
|
|
20
|
+
"default": "trpc",
|
|
21
|
+
"enum": ["trpc", "smithy"],
|
|
22
|
+
"x-prompt": {
|
|
23
|
+
"message": "Which API framework would you like to use?",
|
|
24
|
+
"type": "list",
|
|
25
|
+
"items": [
|
|
26
|
+
{
|
|
27
|
+
"value": "trpc",
|
|
28
|
+
"label": "tRPC (end-to-end type-safe APIs with TypeScript)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"value": "smithy",
|
|
32
|
+
"label": "Smithy (model-driven API development)"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"default": "trpc"
|
|
36
|
+
},
|
|
37
|
+
"x-priority": "important"
|
|
38
|
+
},
|
|
39
|
+
"namespace": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "The namespace for the Smithy API (only applicable for the smithy framework). Defaults to your monorepo scope",
|
|
42
|
+
"x-prompt": "What namespace would you like your API to have? i.e: com.example"
|
|
43
|
+
},
|
|
44
|
+
"computeType": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "The type of compute to use to deploy this API.",
|
|
47
|
+
"default": "ServerlessApiGatewayRestApi",
|
|
48
|
+
"enum": ["ServerlessApiGatewayRestApi", "ServerlessApiGatewayHttpApi"],
|
|
49
|
+
"x-prompt": "What compute type would you like to deploy your API with?",
|
|
50
|
+
"x-priority": "important"
|
|
51
|
+
},
|
|
52
|
+
"integrationPattern": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "How API Gateway integrations are generated for the API. Choose between isolated (default) and shared.",
|
|
55
|
+
"default": "isolated",
|
|
56
|
+
"enum": ["isolated", "shared"],
|
|
57
|
+
"x-priority": "important",
|
|
58
|
+
"x-prompt": {
|
|
59
|
+
"message": "How would you like to map integrations to your API operations?",
|
|
60
|
+
"type": "list",
|
|
61
|
+
"items": [
|
|
62
|
+
{
|
|
63
|
+
"value": "isolated",
|
|
64
|
+
"label": "isolated (one integration per operation)"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"value": "shared",
|
|
68
|
+
"label": "shared (single default integration with optional overrides)"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"default": "isolated"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"auth": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "The method used to authenticate with your API. Choose between IAM (default), Cognito or Custom.",
|
|
77
|
+
"default": "IAM",
|
|
78
|
+
"enum": ["IAM", "Cognito", "Custom"],
|
|
79
|
+
"x-prompt": "How would you like users to authenticate with your API?",
|
|
80
|
+
"x-priority": "important"
|
|
81
|
+
},
|
|
82
|
+
"directory": {
|
|
83
|
+
"description": "The directory to store the application in.",
|
|
84
|
+
"type": "string",
|
|
85
|
+
"alias": "dir",
|
|
86
|
+
"x-priority": "important",
|
|
87
|
+
"default": "packages",
|
|
88
|
+
"x-prompt": "What directory would you like to store your application in?"
|
|
89
|
+
},
|
|
90
|
+
"subDirectory": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "The sub directory the project is placed in. By default this is the project name.",
|
|
93
|
+
"x-prompt": "Which sub directory do you want to create the project in? (By default this is the project name)"
|
|
94
|
+
},
|
|
95
|
+
"iacProvider": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
98
|
+
"enum": ["Inherit", "CDK", "Terraform"],
|
|
99
|
+
"x-priority": "important",
|
|
100
|
+
"default": "Inherit",
|
|
101
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: Inherit)"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"required": ["name"]
|
|
105
|
+
}
|
|
@@ -87,6 +87,7 @@ const tsAstroDocsGenerator = async (tree, schema) => {
|
|
|
87
87
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'translation'), dir, templateOptions, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
88
88
|
}
|
|
89
89
|
(0, nx_1.addGeneratorMetadata)(tree, fullyQualifiedName, exports.TS_ASTRO_DOCS_GENERATOR_INFO, {
|
|
90
|
+
framework: 'astro',
|
|
90
91
|
includeTranslation,
|
|
91
92
|
includeBlog,
|
|
92
93
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/astro-docs/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAUoB;AAEpB,uCAIwB;AACxB,iDAAsE;AACtE,+CAA0D;AAC1D,qDAA0D;AAC1D,6CAAgD;AAChD,mDAAmE;AACnE,yDAA2E;AAE9D,QAAA,4BAA4B,GACvC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,oBAAoB,GAAG,KAAK,EACvC,IAAU,EACV,MAAkC,EACN,EAAE;IAC9B,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,IAAI,KAAK,CAAC,CAAC;IAC5D,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AY,GAAoB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;IACtE,MAAM,eAAe,GAAoB,EAAE,CAAC;IAE5C,IAAI,WAAW,EAAE,CAAC;QAChB,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,kBAAkB,EAAE,CAAC;QACvB,YAAY,CAAC,IAAI,CACf,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,CACb,CAAC;QACF,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACjD,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,CAAC,oCAA4B,CAAC,CAAC,CAAC;IAE5E,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,CAAC;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/astro-docs/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAUoB;AAEpB,uCAIwB;AACxB,iDAAsE;AACtE,+CAA0D;AAC1D,qDAA0D;AAC1D,6CAAgD;AAChD,mDAAmE;AACnE,yDAA2E;AAE9D,QAAA,4BAA4B,GACvC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,oBAAoB,GAAG,KAAK,EACvC,IAAU,EACV,MAAkC,EACN,EAAE;IAC9B,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,IAAI,KAAK,C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ClB,WAAW;KACZ,CAAC,CAAC;IAEH,MAAM,YAAY,GAAoB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;IACtE,MAAM,eAAe,GAAoB,EAAE,CAAC;IAE5C,IAAI,WAAW,EAAE,CAAC;QAChB,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,kBAAkB,EAAE,CAAC;QACvB,YAAY,CAAC,IAAI,CACf,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,CACb,CAAC;QACF,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACjD,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,CAAC,oCAA4B,CAAC,CAAC,CAAC;IAE5E,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,CAAC;AAlJW,QAAA,oBAAoB,wBAkJ/B;AAEF,kBAAe,4BAAoB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
6
|
+
import { TsDocsGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../utils/nx';
|
|
8
|
+
export declare const TS_DOCS_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare const tsDocsGenerator: (tree: Tree, schema: TsDocsGeneratorSchema) => Promise<GeneratorCallback>;
|
|
10
|
+
export default tsDocsGenerator;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tsDocsGenerator = exports.TS_DOCS_GENERATOR_INFO = void 0;
|
|
4
|
+
const nx_1 = require("../../utils/nx");
|
|
5
|
+
const generator_1 = require("../astro-docs/generator");
|
|
6
|
+
exports.TS_DOCS_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
7
|
+
const tsDocsGenerator = async (tree, schema) => {
|
|
8
|
+
const { framework: _framework, ...rest } = schema;
|
|
9
|
+
return (0, generator_1.tsAstroDocsGenerator)(tree, rest);
|
|
10
|
+
};
|
|
11
|
+
exports.tsDocsGenerator = tsDocsGenerator;
|
|
12
|
+
exports.default = exports.tsDocsGenerator;
|
|
13
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/docs/generator.ts"],"names":[],"mappings":";;;AAMA,uCAAmE;AACnE,uDAA+D;AAElD,QAAA,sBAAsB,GACjC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,eAAe,GAAG,KAAK,EAClC,IAAU,EACV,MAA6B,EACD,EAAE;IAC9B,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IAClD,OAAO,IAAA,gCAAoB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC,CAAC;AANW,QAAA,eAAe,mBAM1B;AAEF,kBAAe,uBAAe,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
export interface TsDocsGeneratorSchema {
|
|
6
|
+
/**
|
|
7
|
+
* The name of the docs project. Defaults to 'docs'.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* The parent directory the docs project is placed in. Defaults to '.' (workspace root).
|
|
12
|
+
*/
|
|
13
|
+
directory?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The sub directory the docs project is placed in. Defaults to the kebab-case project name.
|
|
16
|
+
*/
|
|
17
|
+
subDirectory?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The documentation framework to use. Defaults to 'astro'.
|
|
20
|
+
*/
|
|
21
|
+
framework?: 'astro';
|
|
22
|
+
/**
|
|
23
|
+
* Opt out of the automated documentation translation pipeline.
|
|
24
|
+
*/
|
|
25
|
+
noTranslation?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Opt out of the starlight-blog plugin and sample blog post.
|
|
28
|
+
*/
|
|
29
|
+
noBlog?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Skip installing dependencies after the generator runs.
|
|
32
|
+
*/
|
|
33
|
+
skipInstall?: boolean;
|
|
34
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "ts#docs",
|
|
5
|
+
"title": "Create a documentation site",
|
|
6
|
+
"description": "Generates a documentation site. Use the `framework` option to select the underlying docs framework.",
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"command": "nx g ts#docs",
|
|
10
|
+
"description": "Generate a docs site using Astro (default framework)"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"command": "nx g ts#docs --framework=astro --noTranslation",
|
|
14
|
+
"description": "Generate an Astro docs site without the automated translation pipeline"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"type": "object",
|
|
18
|
+
"properties": {
|
|
19
|
+
"name": {
|
|
20
|
+
"description": "The name of the docs project.",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "docs",
|
|
23
|
+
"$default": {
|
|
24
|
+
"$source": "argv",
|
|
25
|
+
"index": 0
|
|
26
|
+
},
|
|
27
|
+
"x-prompt": "What name would you like to use for the docs project?",
|
|
28
|
+
"pattern": "^[a-zA-Z][^:]*$"
|
|
29
|
+
},
|
|
30
|
+
"directory": {
|
|
31
|
+
"description": "The parent directory the docs project is placed in.",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"alias": "dir",
|
|
34
|
+
"x-priority": "important",
|
|
35
|
+
"default": ".",
|
|
36
|
+
"x-prompt": "Which parent directory would you like to place the docs project in?"
|
|
37
|
+
},
|
|
38
|
+
"subDirectory": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "The sub directory the docs project is placed in. Defaults to the kebab-case project name.",
|
|
41
|
+
"x-prompt": "Which sub directory should the docs project be created in? (default: kebab-case of the name)"
|
|
42
|
+
},
|
|
43
|
+
"framework": {
|
|
44
|
+
"description": "The documentation framework to use.",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"enum": ["astro"],
|
|
47
|
+
"default": "astro",
|
|
48
|
+
"x-priority": "important",
|
|
49
|
+
"x-prompt": "Which documentation framework would you like to use?"
|
|
50
|
+
},
|
|
51
|
+
"noTranslation": {
|
|
52
|
+
"description": "Opt out of the automated documentation translation pipeline (Strands Agent on Amazon Bedrock + a `translate` project target).",
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"default": false,
|
|
55
|
+
"x-prompt": "Would you like to opt out of automated documentation translation?"
|
|
56
|
+
},
|
|
57
|
+
"noBlog": {
|
|
58
|
+
"description": "Opt out of the `starlight-blog` plugin and the sample blog post.",
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"default": false,
|
|
61
|
+
"x-prompt": "Would you like to opt out of the blog?"
|
|
62
|
+
},
|
|
63
|
+
"skipInstall": {
|
|
64
|
+
"description": "Skip installing dependencies after the generator runs.",
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"default": false
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"required": ["name"]
|
|
70
|
+
}
|
|
@@ -2029,7 +2029,8 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2029
2029
|
"tags": [],
|
|
2030
2030
|
"metadata": {
|
|
2031
2031
|
"generator": "ts#react-website",
|
|
2032
|
-
"uxProvider": "Cloudscape"
|
|
2032
|
+
"uxProvider": "Cloudscape",
|
|
2033
|
+
"framework": "react"
|
|
2033
2034
|
},
|
|
2034
2035
|
"targets": {
|
|
2035
2036
|
"build": {
|
|
@@ -3655,7 +3656,8 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
3655
3656
|
"tags": [],
|
|
3656
3657
|
"metadata": {
|
|
3657
3658
|
"generator": "ts#react-website",
|
|
3658
|
-
"uxProvider": "Cloudscape"
|
|
3659
|
+
"uxProvider": "Cloudscape",
|
|
3660
|
+
"framework": "react"
|
|
3659
3661
|
},
|
|
3660
3662
|
"targets": {
|
|
3661
3663
|
"build": {
|
|
@@ -141,6 +141,7 @@ async function tsReactWebsiteGenerator(tree, schema) {
|
|
|
141
141
|
(0, devkit_1.updateProjectConfiguration)(tree, fullyQualifiedName, projectConfiguration);
|
|
142
142
|
(0, nx_1.addGeneratorMetadata)(tree, projectConfiguration.name, exports.REACT_WEBSITE_APP_GENERATOR_INFO, {
|
|
143
143
|
uxProvider,
|
|
144
|
+
framework: 'react',
|
|
144
145
|
});
|
|
145
146
|
await (0, ts_project_utils_1.configureTsProject)(tree, {
|
|
146
147
|
dir: websiteContentPath,
|
|
@@ -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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
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
6
|
+
import { TsWebsiteGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../../utils/nx';
|
|
8
|
+
export declare const TS_WEBSITE_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare const tsWebsiteGenerator: (tree: Tree, schema: TsWebsiteGeneratorSchema) => Promise<GeneratorCallback>;
|
|
10
|
+
export default tsWebsiteGenerator;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tsWebsiteGenerator = exports.TS_WEBSITE_GENERATOR_INFO = void 0;
|
|
4
|
+
const generator_1 = require("../../react-website/app/generator");
|
|
5
|
+
const nx_1 = require("../../../utils/nx");
|
|
6
|
+
exports.TS_WEBSITE_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
7
|
+
const tsWebsiteGenerator = async (tree, schema) => {
|
|
8
|
+
const { framework: _framework, ...rest } = schema;
|
|
9
|
+
return (0, generator_1.tsReactWebsiteGenerator)(tree, rest);
|
|
10
|
+
};
|
|
11
|
+
exports.tsWebsiteGenerator = tsWebsiteGenerator;
|
|
12
|
+
exports.default = exports.tsWebsiteGenerator;
|
|
13
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/website/app/generator.ts"],"names":[],"mappings":";;;AAMA,iEAA4E;AAC5E,0CAAsE;AAEzD,QAAA,yBAAyB,GACpC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,kBAAkB,GAAG,KAAK,EACrC,IAAU,EACV,MAAgC,EACJ,EAAE;IAC9B,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IAClD,OAAO,IAAA,mCAAuB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B;AAEF,kBAAe,0BAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { IacProviderOption } from '../../../utils/iac';
|
|
6
|
+
import { UxProviderOption } from '../../react-website/app/generator';
|
|
7
|
+
|
|
8
|
+
export type WebsiteFramework = 'react';
|
|
9
|
+
|
|
10
|
+
export interface TsWebsiteGeneratorSchema {
|
|
11
|
+
name: string;
|
|
12
|
+
framework?: WebsiteFramework;
|
|
13
|
+
directory?: string;
|
|
14
|
+
subDirectory?: string;
|
|
15
|
+
skipInstall?: boolean;
|
|
16
|
+
enableTanstackRouter?: boolean;
|
|
17
|
+
enableTailwind?: boolean;
|
|
18
|
+
uxProvider?: UxProviderOption;
|
|
19
|
+
iacProvider: IacProviderOption;
|
|
20
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "Website",
|
|
5
|
+
"title": "Create a Website",
|
|
6
|
+
"description": "Create a website application for Nx.",
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"command": "nx g app myapp --directory=myorg",
|
|
10
|
+
"description": "Generate `apps/myorg/myapp` and `apps/myorg/myapp-e2e`"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"name": {
|
|
16
|
+
"description": "The name of the application.",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"$default": {
|
|
19
|
+
"$source": "argv",
|
|
20
|
+
"index": 0
|
|
21
|
+
},
|
|
22
|
+
"x-prompt": "What name would you like to use for the application?",
|
|
23
|
+
"pattern": "^[a-zA-Z][^:]*$"
|
|
24
|
+
},
|
|
25
|
+
"framework": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "The frontend framework to use.",
|
|
28
|
+
"enum": ["react"],
|
|
29
|
+
"default": "react",
|
|
30
|
+
"x-priority": "important",
|
|
31
|
+
"x-prompt": "Which frontend framework would you like to use?"
|
|
32
|
+
},
|
|
33
|
+
"directory": {
|
|
34
|
+
"description": "The directory of the new application.",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"alias": "dir",
|
|
37
|
+
"x-priority": "important",
|
|
38
|
+
"default": "packages",
|
|
39
|
+
"x-prompt": "What directory would you like to store your application in?"
|
|
40
|
+
},
|
|
41
|
+
"subDirectory": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "The sub directory the project is placed in. By default this is the project name.",
|
|
44
|
+
"x-prompt": "Which sub directory do you want to create the project in? (By default this is the project name)"
|
|
45
|
+
},
|
|
46
|
+
"uxProvider": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "The preferred UX provider.",
|
|
49
|
+
"enum": ["None", "Cloudscape", "Shadcn"],
|
|
50
|
+
"x-priority": "important",
|
|
51
|
+
"default": "Cloudscape",
|
|
52
|
+
"x-prompt": {
|
|
53
|
+
"message": "Which UX provider should we scaffold for this app?",
|
|
54
|
+
"type": "list",
|
|
55
|
+
"items": [
|
|
56
|
+
{
|
|
57
|
+
"value": "None",
|
|
58
|
+
"label": "None (plain React/Vite without a UI kit)"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"value": "Cloudscape",
|
|
62
|
+
"label": "Cloudscape (AWS-first components with ready-made layouts)"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"value": "Shadcn",
|
|
66
|
+
"label": "Shadcn (shared UI library under packages/common/shadcn)"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"default": "Cloudscape"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"enableTailwind": {
|
|
73
|
+
"description": "Enable TailwindCSS for utility-first styling.",
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"default": true,
|
|
76
|
+
"x-priority": "important",
|
|
77
|
+
"x-prompt": "Would you like to enable TailwindCSS for additional styling capabilities?"
|
|
78
|
+
},
|
|
79
|
+
"enableTanstackRouter": {
|
|
80
|
+
"description": "Enable Tanstack router for type-safe routing.",
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"default": true,
|
|
83
|
+
"x-priority": "important",
|
|
84
|
+
"x-prompt": "Would you like to enable Tanstack Router for type-safe routing?"
|
|
85
|
+
},
|
|
86
|
+
"iacProvider": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
89
|
+
"enum": ["Inherit", "CDK", "Terraform"],
|
|
90
|
+
"x-priority": "important",
|
|
91
|
+
"default": "Inherit",
|
|
92
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: Inherit)"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"required": ["name"],
|
|
96
|
+
"examplesFile": "../../../docs/application-examples.md"
|
|
97
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { Tree } from '@nx/devkit';
|
|
6
|
+
import { TsWebsiteAuthGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../../utils/nx';
|
|
8
|
+
export declare const TS_WEBSITE_AUTH_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare function tsWebsiteAuthGenerator(tree: Tree, schema: TsWebsiteAuthGeneratorSchema): Promise<() => void>;
|
|
10
|
+
export default tsWebsiteAuthGenerator;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TS_WEBSITE_AUTH_GENERATOR_INFO = void 0;
|
|
4
|
+
exports.tsWebsiteAuthGenerator = tsWebsiteAuthGenerator;
|
|
5
|
+
const generator_1 = require("../../react-website/cognito-auth/generator");
|
|
6
|
+
const nx_1 = require("../../../utils/nx");
|
|
7
|
+
exports.TS_WEBSITE_AUTH_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
8
|
+
async function tsWebsiteAuthGenerator(tree, schema) {
|
|
9
|
+
return (0, generator_1.tsReactWebsiteAuthGenerator)(tree, {
|
|
10
|
+
project: schema.project,
|
|
11
|
+
allowSignup: schema.allowSignup,
|
|
12
|
+
cognitoDomain: schema.cognitoDomain,
|
|
13
|
+
iacProvider: schema.iacProvider,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
exports.default = tsWebsiteAuthGenerator;
|
|
17
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/website/auth/generator.ts"],"names":[],"mappings":";;;AAYA,wDAUC;AAhBD,0EAAyF;AACzF,0CAAsE;AAEzD,QAAA,8BAA8B,GACzC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,sBAAsB,CAC1C,IAAU,EACV,MAAoC;IAEpC,OAAO,IAAA,uCAA2B,EAAC,IAAI,EAAE;QACvC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,WAAW,EAAE,MAAM,CAAC,WAAW;KAChC,CAAC,CAAC;AACL,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { IacProviderOption } from '../../../utils/iac';
|
|
6
|
+
|
|
7
|
+
export interface TsWebsiteAuthGeneratorSchema {
|
|
8
|
+
project: string;
|
|
9
|
+
allowSignup: boolean;
|
|
10
|
+
cognitoDomain?: string;
|
|
11
|
+
iacProvider: IacProviderOption;
|
|
12
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "Website Auth",
|
|
5
|
+
"title": "Website Auth",
|
|
6
|
+
"description": "Adds auth to an existing website.",
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"command": "nx g @aws/nx-plugin:ts#website#auth --project=my-website",
|
|
10
|
+
"description": "Add Cognito auth to an existing website"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"project": {
|
|
16
|
+
"description": "The root directory of the website.",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"alias": "dir",
|
|
19
|
+
"x-priority": "important",
|
|
20
|
+
"x-prompt": "the root directory for your website.",
|
|
21
|
+
"x-dropdown": "projects"
|
|
22
|
+
},
|
|
23
|
+
"cognitoDomain": {
|
|
24
|
+
"description": "The cognito domain prefix to use. If omitted, a value is derived from the npm scope and website project name.",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"x-priority": "important",
|
|
27
|
+
"x-prompt": "the cognito domain prefix to use i.e: https://{{cognitoDomain}}-123456789.auth.ap-southeast-2.amazoncognito.com (leave blank to derive from scope and project name)"
|
|
28
|
+
},
|
|
29
|
+
"allowSignup": {
|
|
30
|
+
"description": "Whether to allow self-signup",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"default": false,
|
|
33
|
+
"x-prompt": "Enable self signup?",
|
|
34
|
+
"x-priority": "important"
|
|
35
|
+
},
|
|
36
|
+
"iacProvider": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
39
|
+
"enum": ["Inherit", "CDK", "Terraform"],
|
|
40
|
+
"x-priority": "important",
|
|
41
|
+
"default": "Inherit",
|
|
42
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: Inherit)"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": ["project"]
|
|
46
|
+
}
|