@aws/nx-plugin 0.5.1 → 0.6.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/LICENSE-THIRD-PARTY +104 -0
- package/generators.json +10 -0
- package/package.json +3 -1
- package/src/cloudscape-website/app/__snapshots__/generator.spec.ts.snap +4 -2
- package/src/cloudscape-website/app/files/common/constructs/src/app/static-websites/__websiteNameKebabCase__.ts.template +1 -1
- package/src/cloudscape-website/app/generator.js +25 -10
- package/src/cloudscape-website/app/generator.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +24 -41
- package/src/infra/app/generator.js +2 -1
- package/src/infra/app/generator.js.map +1 -1
- package/src/py/fast-api/files/app/__name__/main.py.template +9 -0
- package/src/py/fast-api/files/app/tests/test_main.py +7 -0
- package/src/py/fast-api/files/common/constructs/src/app/http-apis/__apiNameKebabCase__.ts.template +22 -0
- package/src/py/fast-api/generator.d.ts +11 -0
- package/src/py/fast-api/generator.js +116 -0
- package/src/py/fast-api/generator.js.map +1 -0
- package/src/py/fast-api/schema.d.ts +9 -0
- package/src/py/fast-api/schema.json +22 -0
- package/src/py/project/generator.d.ts +31 -0
- package/src/py/project/generator.js +103 -0
- package/src/py/project/generator.js.map +1 -0
- package/src/py/project/schema.d.ts +11 -0
- package/src/py/project/schema.json +32 -0
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +50 -44
- package/src/trpc/backend/files/common/constructs/src/app/{trpc-apis → http-apis}/__apiNameKebabCase__.ts.template +7 -3
- package/src/trpc/backend/generator.js +29 -23
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/trpc/react/files/src/hooks/useSigV4.tsx.template +1 -1
- package/src/trpc/react/generator.js +1 -40
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +12 -33
- package/src/ts/lib/eslint.js +28 -0
- package/src/ts/lib/eslint.js.map +1 -1
- package/src/ts/lib/generator.js +20 -12
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/ts-project-utils.js +2 -2
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/{trpc/backend/files/common/constructs/src/core/trpc-api.ts.template → utils/files/http-api/common/constructs/src/core/http-api.ts.template} +20 -18
- package/src/utils/http-api.d.ts +6 -0
- package/src/utils/http-api.js +61 -0
- package/src/utils/http-api.js.map +1 -0
- package/src/utils/names.d.ts +1 -0
- package/src/utils/names.js +4 -1
- package/src/utils/names.js.map +1 -1
- package/src/utils/npm-scope.js +2 -2
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +8 -0
- package/src/utils/nx.js +11 -0
- package/src/utils/nx.js.map +1 -0
- package/src/utils/shared-constructs.js +1 -1
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/versions.d.ts +5 -2
- package/src/utils/versions.js +4 -1
- package/src/utils/versions.js.map +1 -1
package/LICENSE-THIRD-PARTY
CHANGED
|
@@ -4222,6 +4222,21 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
4222
4222
|
|
|
4223
4223
|
---
|
|
4224
4224
|
|
|
4225
|
+
The following software may be included in this product: @nxlv/python (20.5.1)
|
|
4226
|
+
This software contains the following license and notice below:
|
|
4227
|
+
|
|
4228
|
+
MIT License
|
|
4229
|
+
|
|
4230
|
+
Copyright (c) The maintainers of @nxlv/python <https://github.com/lucasvieirasilva/nx-plugins#readme>
|
|
4231
|
+
|
|
4232
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4233
|
+
|
|
4234
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
4235
|
+
|
|
4236
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
4237
|
+
|
|
4238
|
+
---
|
|
4239
|
+
|
|
4225
4240
|
The following software may be included in this product: @phenomnomnominal/tsquery (5.0.1)
|
|
4226
4241
|
This software contains the following license and notice below:
|
|
4227
4242
|
|
|
@@ -8188,6 +8203,33 @@ THE SOFTWARE.
|
|
|
8188
8203
|
|
|
8189
8204
|
---
|
|
8190
8205
|
|
|
8206
|
+
The following software may be included in this product: command-exists (1.2.9)
|
|
8207
|
+
This software contains the following license and notice below:
|
|
8208
|
+
|
|
8209
|
+
The MIT License (MIT)
|
|
8210
|
+
|
|
8211
|
+
Copyright (c) 2014 Matthew Conlen
|
|
8212
|
+
|
|
8213
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8214
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8215
|
+
in the Software without restriction, including without limitation the rights
|
|
8216
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8217
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8218
|
+
furnished to do so, subject to the following conditions:
|
|
8219
|
+
|
|
8220
|
+
The above copyright notice and this permission notice shall be included in all
|
|
8221
|
+
copies or substantial portions of the Software.
|
|
8222
|
+
|
|
8223
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
8224
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
8225
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
8226
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
8227
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
8228
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
8229
|
+
SOFTWARE.
|
|
8230
|
+
|
|
8231
|
+
---
|
|
8232
|
+
|
|
8191
8233
|
The following software may be included in this product: commander (2.20.3)
|
|
8192
8234
|
This software contains the following license and notice below:
|
|
8193
8235
|
|
|
@@ -11028,6 +11070,32 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
11028
11070
|
|
|
11029
11071
|
---
|
|
11030
11072
|
|
|
11073
|
+
The following software may be included in this product: file-uri-to-path (2.0.0)
|
|
11074
|
+
This software contains the following license and notice below:
|
|
11075
|
+
|
|
11076
|
+
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
|
|
11077
|
+
|
|
11078
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
11079
|
+
a copy of this software and associated documentation files (the
|
|
11080
|
+
'Software'), to deal in the Software without restriction, including
|
|
11081
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
11082
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
11083
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11084
|
+
the following conditions:
|
|
11085
|
+
|
|
11086
|
+
The above copyright notice and this permission notice shall be
|
|
11087
|
+
included in all copies or substantial portions of the Software.
|
|
11088
|
+
|
|
11089
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
11090
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
11091
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
11092
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
11093
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
11094
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
11095
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
11096
|
+
|
|
11097
|
+
---
|
|
11098
|
+
|
|
11031
11099
|
The following software may be included in this product: fill-range (7.1.1)
|
|
11032
11100
|
This software contains the following license and notice below:
|
|
11033
11101
|
|
|
@@ -11369,6 +11437,27 @@ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHE
|
|
|
11369
11437
|
|
|
11370
11438
|
---
|
|
11371
11439
|
|
|
11440
|
+
The following software may be included in this product: fs-extra (11.2.0)
|
|
11441
|
+
This software contains the following license and notice below:
|
|
11442
|
+
|
|
11443
|
+
(The MIT License)
|
|
11444
|
+
|
|
11445
|
+
Copyright (c) 2011-2017 JP Richardson
|
|
11446
|
+
|
|
11447
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
|
11448
|
+
(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
|
|
11449
|
+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
11450
|
+
furnished to do so, subject to the following conditions:
|
|
11451
|
+
|
|
11452
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
11453
|
+
|
|
11454
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
11455
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
11456
|
+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
11457
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
11458
|
+
|
|
11459
|
+
---
|
|
11460
|
+
|
|
11372
11461
|
The following software may be included in this product: fsevents (2.3.3)
|
|
11373
11462
|
This software contains the following license and notice below:
|
|
11374
11463
|
|
|
@@ -27111,6 +27200,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
27111
27200
|
|
|
27112
27201
|
---
|
|
27113
27202
|
|
|
27203
|
+
The following software may be included in this product: uuid (9.0.1)
|
|
27204
|
+
This software contains the following license and notice below:
|
|
27205
|
+
|
|
27206
|
+
The MIT License (MIT)
|
|
27207
|
+
|
|
27208
|
+
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
|
27209
|
+
|
|
27210
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
27211
|
+
|
|
27212
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
27213
|
+
|
|
27214
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
27215
|
+
|
|
27216
|
+
---
|
|
27217
|
+
|
|
27114
27218
|
The following software may be included in this product: v8-compile-cache-lib (3.0.1)
|
|
27115
27219
|
This software contains the following license and notice below:
|
|
27116
27220
|
|
package/generators.json
CHANGED
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
"schema": "./src/ts/lib/schema.json",
|
|
9
9
|
"description": "Generates a TypeScript library"
|
|
10
10
|
},
|
|
11
|
+
"py#project": {
|
|
12
|
+
"factory": "./src/py/project/generator",
|
|
13
|
+
"schema": "./src/py/project/schema.json",
|
|
14
|
+
"description": "Generates a Python project"
|
|
15
|
+
},
|
|
16
|
+
"py#fast-api": {
|
|
17
|
+
"factory": "./src/py/fast-api/generator",
|
|
18
|
+
"schema": "./src/py/fast-api/schema.json",
|
|
19
|
+
"description": "Generates a FastAPI Python project"
|
|
20
|
+
},
|
|
11
21
|
"cloudscape-website#app": {
|
|
12
22
|
"factory": "./src/cloudscape-website/app/generator",
|
|
13
23
|
"schema": "./src/cloudscape-website/app/schema.json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws/nx-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,9 +21,11 @@
|
|
|
21
21
|
"@nx/js": "^20.4.0",
|
|
22
22
|
"@nx/react": "^20.4.0",
|
|
23
23
|
"@nx/vite": "^20.4.0",
|
|
24
|
+
"@nxlv/python": "^20.5.1",
|
|
24
25
|
"@phenomnomnominal/tsquery": "6.1.3",
|
|
25
26
|
"fast-glob": "^3.3.3",
|
|
26
27
|
"lodash.kebabcase": "4.1.1",
|
|
28
|
+
"lodash.snakecase": "4.1.1",
|
|
27
29
|
"minimatch": "^10.0.1",
|
|
28
30
|
"typescript": "~5.5.4",
|
|
29
31
|
"vite": "^5.4.0",
|
|
@@ -21,7 +21,8 @@ exports[`cloudscape-website generator > should configure TypeScript correctly >
|
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
23
|
exports[`cloudscape-website generator > should configure vite correctly > vite.config.ts 1`] = `
|
|
24
|
-
"import
|
|
24
|
+
"import tsconfigPaths from 'vite-tsconfig-paths';
|
|
25
|
+
import { TanStackRouterVite } from '@tanstack/router-plugin/vite';
|
|
25
26
|
/// <reference types='vitest' />
|
|
26
27
|
import { defineConfig } from 'vite';
|
|
27
28
|
import react from '@vitejs/plugin-react';
|
|
@@ -46,6 +47,7 @@ export default defineConfig({
|
|
|
46
47
|
nxViteTsPaths(),
|
|
47
48
|
nxCopyAssetsPlugin(['*.md']),
|
|
48
49
|
TanStackRouterVite(),
|
|
50
|
+
tsconfigPaths(),
|
|
49
51
|
],
|
|
50
52
|
build: {
|
|
51
53
|
outDir: '../dist/test-app',
|
|
@@ -509,7 +511,7 @@ export class TestApp extends StaticWebsite {
|
|
|
509
511
|
constructor(scope: Construct, id: string) {
|
|
510
512
|
super(scope, id, {
|
|
511
513
|
websiteFilePath: url.fileURLToPath(
|
|
512
|
-
new URL('../../../../../../dist/test-app', import.meta.url),
|
|
514
|
+
new URL('../../../../../../dist/test-app/bundle', import.meta.url),
|
|
513
515
|
),
|
|
514
516
|
});
|
|
515
517
|
}
|
|
@@ -6,7 +6,7 @@ export class <%= websiteNameClassName %> extends StaticWebsite {
|
|
|
6
6
|
constructor(scope: Construct, id: string) {
|
|
7
7
|
super(scope, id, {
|
|
8
8
|
websiteFilePath: url.fileURLToPath(
|
|
9
|
-
new URL('../../../../../../<%= websiteContentPath
|
|
9
|
+
new URL('../../../../../../<%= websiteContentPath %>/bundle', import.meta.url)
|
|
10
10
|
),
|
|
11
11
|
});
|
|
12
12
|
}
|
|
@@ -18,6 +18,8 @@ const paths_1 = require("../../utils/paths");
|
|
|
18
18
|
const names_1 = require("../../utils/names");
|
|
19
19
|
const ast_1 = require("../../utils/ast");
|
|
20
20
|
const format_1 = require("../../utils/format");
|
|
21
|
+
const path_1 = require("path");
|
|
22
|
+
const nx_1 = require("../../utils/nx");
|
|
21
23
|
function appGenerator(tree, schema) {
|
|
22
24
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
25
|
var _a, _b, _c;
|
|
@@ -43,19 +45,28 @@ function appGenerator(tree, schema) {
|
|
|
43
45
|
},
|
|
44
46
|
};
|
|
45
47
|
const buildTarget = targets['build'];
|
|
46
|
-
targets['compile'] =
|
|
48
|
+
targets['compile'] = {
|
|
49
|
+
executor: 'nx:run-commands',
|
|
50
|
+
outputs: ['{workspaceRoot}/dist/{projectRoot}/tsc'],
|
|
51
|
+
options: {
|
|
52
|
+
command: 'tsc --build tsconfig.app.json',
|
|
53
|
+
cwd: '{projectRoot}',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
targets['bundle'] = Object.assign(Object.assign({}, buildTarget), { options: Object.assign(Object.assign({}, buildTarget.options), { outputPath: (0, devkit_1.joinPathFragments)('dist', websiteContentPath, 'bundle') }) });
|
|
47
57
|
targets['build'] = {
|
|
48
|
-
dependsOn: [
|
|
58
|
+
dependsOn: [
|
|
59
|
+
'lint',
|
|
60
|
+
'compile',
|
|
61
|
+
'bundle',
|
|
62
|
+
'test',
|
|
63
|
+
...((_b = buildTarget.dependsOn) !== null && _b !== void 0 ? _b : []),
|
|
64
|
+
],
|
|
49
65
|
options: {
|
|
50
66
|
outputPath: (0, devkit_1.joinPathFragments)('dist', websiteContentPath),
|
|
51
67
|
},
|
|
52
68
|
};
|
|
53
|
-
projectConfiguration.targets =
|
|
54
|
-
.sort()
|
|
55
|
-
.reduce((obj, key) => {
|
|
56
|
-
obj[key] = targets[key];
|
|
57
|
-
return obj;
|
|
58
|
-
}, {});
|
|
69
|
+
projectConfiguration.targets = (0, nx_1.sortProjectTargets)(targets);
|
|
59
70
|
(0, devkit_1.updateProjectConfiguration)(tree, fullyQualifiedName, projectConfiguration);
|
|
60
71
|
(0, ts_project_utils_1.configureTsProject)(tree, {
|
|
61
72
|
dir: websiteContentPath,
|
|
@@ -122,6 +133,7 @@ function appGenerator(tree, schema) {
|
|
|
122
133
|
if (viteConfigContents) {
|
|
123
134
|
let viteConfigUpdatedContents = viteConfigContents;
|
|
124
135
|
viteConfigUpdatedContents = (0, ast_1.destructuredImport)(tree, viteConfigPath, ['TanStackRouterVite'], '@tanstack/router-plugin/vite');
|
|
136
|
+
viteConfigUpdatedContents = (0, ast_1.singleImport)(tree, viteConfigPath, 'tsconfigPaths', 'vite-tsconfig-paths');
|
|
125
137
|
viteConfigUpdatedContents = tsquery_1.tsquery
|
|
126
138
|
.map((0, tsquery_1.ast)(viteConfigUpdatedContents), 'ObjectLiteralExpression', (node) => {
|
|
127
139
|
const updatedProperties = node.properties.map((prop) => {
|
|
@@ -141,6 +153,7 @@ function appGenerator(tree, schema) {
|
|
|
141
153
|
return typescript_1.factory.createPropertyAssignment('plugins', typescript_1.factory.createArrayLiteralExpression([
|
|
142
154
|
...pluginsConfig.elements,
|
|
143
155
|
typescript_1.factory.createCallExpression(typescript_1.factory.createIdentifier('TanStackRouterVite'), undefined, []),
|
|
156
|
+
typescript_1.factory.createCallExpression(typescript_1.factory.createIdentifier('tsconfigPaths'), undefined, []),
|
|
144
157
|
], true));
|
|
145
158
|
}
|
|
146
159
|
return prop;
|
|
@@ -163,13 +176,15 @@ function appGenerator(tree, schema) {
|
|
|
163
176
|
}
|
|
164
177
|
}
|
|
165
178
|
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(websiteContentPath, 'tsconfig.json'), (tsconfig) => (Object.assign(Object.assign({}, tsconfig), { compilerOptions: Object.assign(Object.assign({}, tsconfig.compilerOptions), { moduleResolution: 'Bundler', module: 'Preserve' }) })));
|
|
166
|
-
(0,
|
|
179
|
+
const outDirToRootRelativePath = (0, path_1.relative)((0, devkit_1.joinPathFragments)(tree.root, websiteContentPath), tree.root);
|
|
180
|
+
const distDir = (0, devkit_1.joinPathFragments)(outDirToRootRelativePath, 'dist', websiteContentPath, 'tsc');
|
|
181
|
+
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(websiteContentPath, 'tsconfig.app.json'), (tsconfig) => (Object.assign(Object.assign({}, tsconfig), { compilerOptions: Object.assign(Object.assign({}, tsconfig.compilerOptions), { outDir: distDir, tsBuildInfoFile: (0, devkit_1.joinPathFragments)(distDir, 'tsconfig.lib.tsbuildinfo'), lib: ['DOM'] }) })));
|
|
167
182
|
(0, devkit_1.addDependenciesToPackageJson)(tree, (0, versions_1.withVersions)([
|
|
168
183
|
'@cloudscape-design/components',
|
|
169
184
|
'@cloudscape-design/board-components',
|
|
170
185
|
'@cloudscape-design/global-styles',
|
|
171
186
|
'@tanstack/react-router',
|
|
172
|
-
]), (0, versions_1.withVersions)(['@tanstack/router-plugin']));
|
|
187
|
+
]), (0, versions_1.withVersions)(['@tanstack/router-plugin', 'vite-tsconfig-paths']));
|
|
173
188
|
yield (0, format_1.formatFilesInSubtree)(tree);
|
|
174
189
|
return () => {
|
|
175
190
|
if (!schema.skipInstall) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/cloudscape-website/app/generator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/cloudscape-website/app/generator.ts"],"names":[],"mappings":";;AA6CA,oCA8YC;;AA3bD;;;GAGG;AACH,uCAaoB;AACpB,uDAAyD;AACzD,2CAKoB;AAEpB,qCAAiD;AACjD,qEAIuC;AACvC,qDAAwE;AACxE,oEAAmE;AACnE,mDAAoD;AACpD,6CAA0D;AAC1D,6CAA6D;AAC7D,yCAIyB;AACzB,+CAA0D;AAC1D,+BAAgC;AACh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ACV,CAAC;QACF,MAAM,OAAO,GAAG,IAAA,0BAAiB,EAC/B,wBAAwB,EACxB,MAAM,EACN,kBAAkB,EAClB,KAAK,CACN,CAAC;QACF,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EAAC,kBAAkB,EAAE,mBAAmB,CAAC,EAC1D,CAAC,QAAQ,EAAE,EAAE,CAAC,iCACT,QAAQ,KACX,eAAe,kCACV,QAAQ,CAAC,eAAe,KAC3B,MAAM,EAAE,OAAO,EACf,eAAe,EAAE,IAAA,0BAAiB,EAAC,OAAO,EAAE,0BAA0B,CAAC,EACvE,GAAG,EAAE,CAAC,KAAK,CAAC,OAEd,CACH,CAAC;QACF,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC;YACX,+BAA+B;YAC/B,qCAAqC;YACrC,kCAAkC;YAClC,wBAAwB;SACzB,CAAC,EACF,IAAA,uBAAY,EAAC,CAAC,yBAAyB,EAAE,qBAAqB,CAAC,CAAC,CACjE,CAAC;QAEF,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;QACjC,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBACxB,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CAAA;AACD,kBAAe,YAAY,CAAC"}
|
|
@@ -6,7 +6,7 @@ exports[`infra generator > should add required dependencies to package.json > de
|
|
|
6
6
|
"aws-cdk": "^2.166.0",
|
|
7
7
|
"aws-cdk-lib": "^2.166.0",
|
|
8
8
|
"constructs": "^10.4.2",
|
|
9
|
-
"esbuild": "^0.
|
|
9
|
+
"esbuild": "^0.25.0",
|
|
10
10
|
"source-map-support": "^0.5.21",
|
|
11
11
|
}
|
|
12
12
|
`;
|
|
@@ -22,6 +22,7 @@ exports[`infra generator > should add required dependencies to package.json > de
|
|
|
22
22
|
"@swc-node/register": "~1.9.1",
|
|
23
23
|
"@swc/core": "~1.5.7",
|
|
24
24
|
"@swc/helpers": "~0.5.11",
|
|
25
|
+
"@types/node": "^22.13.1",
|
|
25
26
|
"@vitest/coverage-v8": "^1.0.4",
|
|
26
27
|
"@vitest/ui": "^1.3.1",
|
|
27
28
|
"eslint": "^9.8.0",
|
|
@@ -45,7 +46,7 @@ exports[`infra generator > should add required dependencies to package.json > pa
|
|
|
45
46
|
"aws-cdk": "^2.166.0",
|
|
46
47
|
"aws-cdk-lib": "^2.166.0",
|
|
47
48
|
"constructs": "^10.4.2",
|
|
48
|
-
"esbuild": "^0.
|
|
49
|
+
"esbuild": "^0.25.0",
|
|
49
50
|
"source-map-support": "^0.5.21",
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
@@ -58,6 +59,7 @@ exports[`infra generator > should add required dependencies to package.json > pa
|
|
|
58
59
|
"@swc-node/register": "~1.9.1",
|
|
59
60
|
"@swc/core": "~1.5.7",
|
|
60
61
|
"@swc/helpers": "~0.5.11",
|
|
62
|
+
"@types/node": "^22.13.1",
|
|
61
63
|
"@vitest/coverage-v8": "^1.0.4",
|
|
62
64
|
"@vitest/ui": "^1.3.1",
|
|
63
65
|
"eslint": "^9.8.0",
|
|
@@ -120,17 +122,13 @@ exports[`infra generator > should configure project.json with correct targets >
|
|
|
120
122
|
],
|
|
121
123
|
},
|
|
122
124
|
"compile": {
|
|
123
|
-
"executor": "
|
|
125
|
+
"executor": "nx:run-commands",
|
|
124
126
|
"options": {
|
|
125
|
-
"
|
|
126
|
-
|
|
127
|
-
],
|
|
128
|
-
"main": "packages/test/src/main.ts",
|
|
129
|
-
"outputPath": "dist/packages/test",
|
|
130
|
-
"tsConfig": "packages/test/tsconfig.json",
|
|
127
|
+
"command": "tsc --build tsconfig.lib.json",
|
|
128
|
+
"cwd": "{projectRoot}",
|
|
131
129
|
},
|
|
132
130
|
"outputs": [
|
|
133
|
-
"{
|
|
131
|
+
"{workspaceRoot}/dist/packages/test/tsc",
|
|
134
132
|
],
|
|
135
133
|
},
|
|
136
134
|
"deploy": {
|
|
@@ -140,9 +138,6 @@ exports[`infra generator > should configure project.json with correct targets >
|
|
|
140
138
|
"cwd": "packages/test",
|
|
141
139
|
},
|
|
142
140
|
},
|
|
143
|
-
"lint": {
|
|
144
|
-
"executor": "@nx/eslint:lint",
|
|
145
|
-
},
|
|
146
141
|
"synth": {
|
|
147
142
|
"cache": true,
|
|
148
143
|
"dependsOn": [
|
|
@@ -462,23 +457,18 @@ exports[`infra generator > should generate files with correct content > project-
|
|
|
462
457
|
"dependsOn": ["lint", "compile", "test", "synth"]
|
|
463
458
|
},
|
|
464
459
|
"compile": {
|
|
465
|
-
"executor": "
|
|
466
|
-
"outputs": ["{
|
|
460
|
+
"executor": "nx:run-commands",
|
|
461
|
+
"outputs": ["{workspaceRoot}/dist/packages/test/tsc"],
|
|
467
462
|
"options": {
|
|
468
|
-
"
|
|
469
|
-
"
|
|
470
|
-
"tsConfig": "packages/test/tsconfig.json",
|
|
471
|
-
"assets": ["packages/test/*.md"]
|
|
463
|
+
"command": "tsc --build tsconfig.lib.json",
|
|
464
|
+
"cwd": "{projectRoot}"
|
|
472
465
|
}
|
|
473
466
|
},
|
|
474
|
-
"
|
|
475
|
-
"executor": "
|
|
476
|
-
},
|
|
477
|
-
"test": {
|
|
478
|
-
"executor": "@nx/vite:test",
|
|
479
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
467
|
+
"deploy": {
|
|
468
|
+
"executor": "nx:run-commands",
|
|
480
469
|
"options": {
|
|
481
|
-
"
|
|
470
|
+
"cwd": "packages/test",
|
|
471
|
+
"command": "cdk deploy --require-approval=never --app ../../dist/packages/test/cdk.out"
|
|
482
472
|
}
|
|
483
473
|
},
|
|
484
474
|
"synth": {
|
|
@@ -491,11 +481,11 @@ exports[`infra generator > should generate files with correct content > project-
|
|
|
491
481
|
"command": "cdk synth"
|
|
492
482
|
}
|
|
493
483
|
},
|
|
494
|
-
"
|
|
495
|
-
"executor": "nx:
|
|
484
|
+
"test": {
|
|
485
|
+
"executor": "@nx/vite:test",
|
|
486
|
+
"outputs": ["{options.reportsDirectory}"],
|
|
496
487
|
"options": {
|
|
497
|
-
"
|
|
498
|
-
"command": "cdk deploy --require-approval=never --app ../../dist/packages/test/cdk.out"
|
|
488
|
+
"reportsDirectory": "../../coverage/packages/test"
|
|
499
489
|
}
|
|
500
490
|
}
|
|
501
491
|
}
|
|
@@ -766,17 +756,13 @@ exports[`infra generator > should handle custom project names correctly > custom
|
|
|
766
756
|
],
|
|
767
757
|
},
|
|
768
758
|
"compile": {
|
|
769
|
-
"executor": "
|
|
759
|
+
"executor": "nx:run-commands",
|
|
770
760
|
"options": {
|
|
771
|
-
"
|
|
772
|
-
|
|
773
|
-
],
|
|
774
|
-
"main": "packages/custom-infra/src/main.ts",
|
|
775
|
-
"outputPath": "dist/packages/custom-infra",
|
|
776
|
-
"tsConfig": "packages/custom-infra/tsconfig.json",
|
|
761
|
+
"command": "tsc --build tsconfig.lib.json",
|
|
762
|
+
"cwd": "{projectRoot}",
|
|
777
763
|
},
|
|
778
764
|
"outputs": [
|
|
779
|
-
"{
|
|
765
|
+
"{workspaceRoot}/dist/packages/custom-infra/tsc",
|
|
780
766
|
],
|
|
781
767
|
},
|
|
782
768
|
"deploy": {
|
|
@@ -786,9 +772,6 @@ exports[`infra generator > should handle custom project names correctly > custom
|
|
|
786
772
|
"cwd": "packages/custom-infra",
|
|
787
773
|
},
|
|
788
774
|
},
|
|
789
|
-
"lint": {
|
|
790
|
-
"executor": "@nx/eslint:lint",
|
|
791
|
-
},
|
|
792
775
|
"synth": {
|
|
793
776
|
"cache": true,
|
|
794
777
|
"dependsOn": [
|
|
@@ -14,6 +14,7 @@ const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
|
14
14
|
const ast_1 = require("../../utils/ast");
|
|
15
15
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
16
16
|
const format_1 = require("../../utils/format");
|
|
17
|
+
const nx_1 = require("../../utils/nx");
|
|
17
18
|
function infraGenerator(tree, schema) {
|
|
18
19
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
20
|
const lib = (0, generator_1.getTsLibDetails)(tree, schema);
|
|
@@ -46,7 +47,6 @@ function infraGenerator(tree, schema) {
|
|
|
46
47
|
...((_a = config.targets.build.dependsOn) !== null && _a !== void 0 ? _a : []),
|
|
47
48
|
'synth',
|
|
48
49
|
];
|
|
49
|
-
config.targets.compile.options.main = (0, devkit_1.joinPathFragments)(libraryRoot, 'src', 'main.ts');
|
|
50
50
|
config.targets.synth = {
|
|
51
51
|
cache: true,
|
|
52
52
|
executor: 'nx:run-commands',
|
|
@@ -64,6 +64,7 @@ function infraGenerator(tree, schema) {
|
|
|
64
64
|
command: `cdk deploy --require-approval=never --app ${synthDirFromProject}`,
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
|
+
config.targets = (0, nx_1.sortProjectTargets)(config.targets);
|
|
67
68
|
return config;
|
|
68
69
|
});
|
|
69
70
|
(0, ast_1.addStarExport)(tree, (0, devkit_1.joinPathFragments)(shared_constructs_1.PACKAGES_DIR, shared_constructs_1.SHARED_CONSTRUCTS_DIR, 'src', 'core', 'index.ts'), './cfn-guard.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/infra/app/generator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/infra/app/generator.ts"],"names":[],"mappings":";;AA+BA,wCAuHC;;AAtJD;;;GAGG;AACH,uCAYoB;AAEpB,4EAAyE;AACzE,mDAAoD;AACpD,qDAAwE;AACxE,qEAIuC;AACvC,yCAAgD;AAChD,wDAAwB;AACxB,+CAA0D;AAC1D,uCAAoD;AAEpD,SAAsB,cAAc,CAClC,IAAU,EACV,MAA4B;;QAE5B,MAAM,GAAG,GAAG,IAAA,2BAAe,EAAC,IAAI,EAAE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AA,mBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EACf,gCAAY,EACZ,yCAAqB,EACrB,KAAK,EACL,MAAM,EACN,UAAU,CACX,EACD,gBAAgB,CACjB,CAAC;QACF,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC;YACX,iCAAiC;YACjC,aAAa;YACb,SAAS;YACT,SAAS;YACT,YAAY;YACZ,oBAAoB;SACrB,CAAC,EACF,IAAA,uBAAY,EAAC,CAAC,KAAK,CAAC,CAAC,CACtB,CAAC;QAEF,IAAA,mBAAU,EAAC,IAAI,EAAE,GAAG,WAAW,gBAAgB,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,iCAC1D,QAAQ,KACX,UAAU,EAAE;gBACV,GAAG,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC;gBAC9B;oBACE,IAAI,EAAE,GAAG,cAAI,CAAC,QAAQ,CACpB,WAAW,EACX,GAAG,IAAI,CAAC,IAAI,IAAI,gCAAY,EAAE,CAC/B,IAAI,yCAAqB,gBAAgB;iBAC3C;aACF,IACD,CAAC,CAAC;QAEJ,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;QACjC,OAAO,GAAG,EAAE;YACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC;CAAA;AACD,kBAAe,cAAc,CAAC"}
|
package/src/py/fast-api/files/common/constructs/src/app/http-apis/__apiNameKebabCase__.ts.template
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import * as url from 'url';
|
|
3
|
+
import { HttpApi } from '../../core/http-api.js';
|
|
4
|
+
import { HttpIamAuthorizer } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
|
|
5
|
+
import { Runtime } from 'aws-cdk-lib/aws-lambda';
|
|
6
|
+
|
|
7
|
+
export class <%= apiNameClassName %> extends HttpApi {
|
|
8
|
+
constructor(scope: Construct, id: string) {
|
|
9
|
+
super(scope, id, {
|
|
10
|
+
defaultAuthorizer: new HttpIamAuthorizer(),
|
|
11
|
+
apiName: '<%= apiNameClassName %>',
|
|
12
|
+
runtime: Runtime.PYTHON_3_12,
|
|
13
|
+
handler: '<%= apiNameSnakeCase %>.main.handler',
|
|
14
|
+
handlerFilePath: url.fileURLToPath(
|
|
15
|
+
new URL(
|
|
16
|
+
'../../../../../../dist/<%= dir %>/bundle',
|
|
17
|
+
import.meta.url
|
|
18
|
+
)
|
|
19
|
+
)
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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 { FastApiProjectGeneratorSchema } from './schema';
|
|
7
|
+
/**
|
|
8
|
+
* Generates a Python FastAPI project
|
|
9
|
+
*/
|
|
10
|
+
export declare const fastApiProjectGenerator: (tree: Tree, schema: FastApiProjectGeneratorSchema) => Promise<GeneratorCallback>;
|
|
11
|
+
export default fastApiProjectGenerator;
|