create-aws-project 1.2.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/README.md +118 -0
- package/dist/__tests__/generator/replace-tokens.spec.d.ts +1 -0
- package/dist/__tests__/generator/replace-tokens.spec.js +281 -0
- package/dist/__tests__/generator.spec.d.ts +1 -0
- package/dist/__tests__/generator.spec.js +162 -0
- package/dist/__tests__/validation/project-name.spec.d.ts +1 -0
- package/dist/__tests__/validation/project-name.spec.js +57 -0
- package/dist/__tests__/wizard.spec.d.ts +1 -0
- package/dist/__tests__/wizard.spec.js +232 -0
- package/dist/aws/iam.d.ts +75 -0
- package/dist/aws/iam.js +264 -0
- package/dist/aws/organizations.d.ts +79 -0
- package/dist/aws/organizations.js +168 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +206 -0
- package/dist/commands/setup-github.d.ts +4 -0
- package/dist/commands/setup-github.js +185 -0
- package/dist/generator/copy-file.d.ts +15 -0
- package/dist/generator/copy-file.js +56 -0
- package/dist/generator/generate-project.d.ts +14 -0
- package/dist/generator/generate-project.js +81 -0
- package/dist/generator/index.d.ts +4 -0
- package/dist/generator/index.js +3 -0
- package/dist/generator/replace-tokens.d.ts +29 -0
- package/dist/generator/replace-tokens.js +68 -0
- package/dist/github/secrets.d.ts +109 -0
- package/dist/github/secrets.js +275 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/prompts/auth.d.ts +3 -0
- package/dist/prompts/auth.js +23 -0
- package/dist/prompts/aws-config.d.ts +2 -0
- package/dist/prompts/aws-config.js +14 -0
- package/dist/prompts/features.d.ts +2 -0
- package/dist/prompts/features.js +10 -0
- package/dist/prompts/github-setup.d.ts +53 -0
- package/dist/prompts/github-setup.js +208 -0
- package/dist/prompts/org-structure.d.ts +9 -0
- package/dist/prompts/org-structure.js +93 -0
- package/dist/prompts/platforms.d.ts +2 -0
- package/dist/prompts/platforms.js +12 -0
- package/dist/prompts/project-name.d.ts +2 -0
- package/dist/prompts/project-name.js +8 -0
- package/dist/prompts/theme.d.ts +2 -0
- package/dist/prompts/theme.js +14 -0
- package/dist/templates/index.d.ts +4 -0
- package/dist/templates/index.js +2 -0
- package/dist/templates/manifest.d.ts +11 -0
- package/dist/templates/manifest.js +99 -0
- package/dist/templates/tokens.d.ts +39 -0
- package/dist/templates/tokens.js +37 -0
- package/dist/templates/types.d.ts +52 -0
- package/dist/templates/types.js +1 -0
- package/dist/types.d.ts +27 -0
- package/dist/types.js +1 -0
- package/dist/validation/project-name.d.ts +1 -0
- package/dist/validation/project-name.js +12 -0
- package/dist/wizard.d.ts +2 -0
- package/dist/wizard.js +81 -0
- package/package.json +68 -0
- package/templates/.github/actions/build-and-test/action.yml +24 -0
- package/templates/.github/actions/deploy-cdk/action.yml +46 -0
- package/templates/.github/actions/deploy-web/action.yml +72 -0
- package/templates/.github/actions/setup/action.yml +29 -0
- package/templates/.github/pull_request_template.md +15 -0
- package/templates/.github/workflows/deploy-dev.yml +80 -0
- package/templates/.github/workflows/deploy-prod.yml +67 -0
- package/templates/.github/workflows/deploy-stage.yml +77 -0
- package/templates/.github/workflows/pull-request.yml +72 -0
- package/templates/.vscode/extensions.json +7 -0
- package/templates/.vscode/settings.json +67 -0
- package/templates/apps/api/.eslintrc.json +18 -0
- package/templates/apps/api/cdk/app.ts +93 -0
- package/templates/apps/api/cdk/auth/cognito-stack.ts +164 -0
- package/templates/apps/api/cdk/cdk.json +73 -0
- package/templates/apps/api/cdk/deployment-user-stack.ts +187 -0
- package/templates/apps/api/cdk/org-stack.ts +67 -0
- package/templates/apps/api/cdk/static-stack.ts +361 -0
- package/templates/apps/api/cdk/tsconfig.json +39 -0
- package/templates/apps/api/cdk/user-stack.ts +255 -0
- package/templates/apps/api/jest.config.ts +38 -0
- package/templates/apps/api/lambdas.yml +84 -0
- package/templates/apps/api/project.json.template +58 -0
- package/templates/apps/api/src/__tests__/setup.ts +10 -0
- package/templates/apps/api/src/handlers/users/create-user.ts +52 -0
- package/templates/apps/api/src/handlers/users/delete-user.ts +45 -0
- package/templates/apps/api/src/handlers/users/get-me.ts +72 -0
- package/templates/apps/api/src/handlers/users/get-user.ts +45 -0
- package/templates/apps/api/src/handlers/users/get-users.ts +23 -0
- package/templates/apps/api/src/handlers/users/index.ts +17 -0
- package/templates/apps/api/src/handlers/users/update-user.ts +72 -0
- package/templates/apps/api/src/lib/dynamo/dynamo-model.ts +504 -0
- package/templates/apps/api/src/lib/dynamo/index.ts +12 -0
- package/templates/apps/api/src/lib/dynamo/utils.ts +39 -0
- package/templates/apps/api/src/middleware/auth0-auth.ts +97 -0
- package/templates/apps/api/src/middleware/cognito-auth.ts +90 -0
- package/templates/apps/api/src/models/UserModel.ts +109 -0
- package/templates/apps/api/src/schemas/user.schema.ts +44 -0
- package/templates/apps/api/src/services/user-service.ts +108 -0
- package/templates/apps/api/src/utils/auth-context.ts +60 -0
- package/templates/apps/api/src/utils/common/helpers.ts +26 -0
- package/templates/apps/api/src/utils/lambda-handler.ts +148 -0
- package/templates/apps/api/src/utils/response.ts +52 -0
- package/templates/apps/api/src/utils/validator.ts +75 -0
- package/templates/apps/api/tsconfig.app.json +15 -0
- package/templates/apps/api/tsconfig.json +19 -0
- package/templates/apps/api/tsconfig.spec.json +17 -0
- package/templates/apps/mobile/.env.example +5 -0
- package/templates/apps/mobile/.eslintrc.json +33 -0
- package/templates/apps/mobile/app.json +33 -0
- package/templates/apps/mobile/assets/.gitkeep +0 -0
- package/templates/apps/mobile/babel.config.js +19 -0
- package/templates/apps/mobile/index.js +7 -0
- package/templates/apps/mobile/jest.config.ts +22 -0
- package/templates/apps/mobile/metro.config.js +35 -0
- package/templates/apps/mobile/package.json +22 -0
- package/templates/apps/mobile/project.json.template +64 -0
- package/templates/apps/mobile/src/App.tsx +367 -0
- package/templates/apps/mobile/src/__tests__/App.spec.tsx +46 -0
- package/templates/apps/mobile/src/__tests__/store/user-store.spec.ts +156 -0
- package/templates/apps/mobile/src/config/api.ts +16 -0
- package/templates/apps/mobile/src/store/user-store.ts +56 -0
- package/templates/apps/mobile/src/test-setup.ts +10 -0
- package/templates/apps/mobile/tsconfig.json +22 -0
- package/templates/apps/web/.env.example +13 -0
- package/templates/apps/web/.eslintrc.json +26 -0
- package/templates/apps/web/index.html +13 -0
- package/templates/apps/web/jest.config.ts +24 -0
- package/templates/apps/web/package.json +15 -0
- package/templates/apps/web/project.json.template +66 -0
- package/templates/apps/web/src/App.tsx +352 -0
- package/templates/apps/web/src/__mocks__/config/api.ts +41 -0
- package/templates/apps/web/src/__tests__/App.spec.tsx +240 -0
- package/templates/apps/web/src/__tests__/store/user-store.spec.ts +185 -0
- package/templates/apps/web/src/auth/auth0-provider.tsx +103 -0
- package/templates/apps/web/src/auth/cognito-provider.tsx +143 -0
- package/templates/apps/web/src/auth/index.ts +7 -0
- package/templates/apps/web/src/auth/use-auth.ts +16 -0
- package/templates/apps/web/src/config/amplify-config.ts +31 -0
- package/templates/apps/web/src/config/api.ts +38 -0
- package/templates/apps/web/src/config/auth0-config.ts +17 -0
- package/templates/apps/web/src/main.tsx +41 -0
- package/templates/apps/web/src/store/user-store.ts +56 -0
- package/templates/apps/web/src/styles.css +165 -0
- package/templates/apps/web/src/test-setup.ts +1 -0
- package/templates/apps/web/src/theme/index.ts +30 -0
- package/templates/apps/web/src/vite-env.d.ts +19 -0
- package/templates/apps/web/tsconfig.app.json +24 -0
- package/templates/apps/web/tsconfig.json +22 -0
- package/templates/apps/web/tsconfig.spec.json +28 -0
- package/templates/apps/web/vite.config.ts +87 -0
- package/templates/manifest.json +28 -0
- package/templates/packages/api-client/.eslintrc.json +18 -0
- package/templates/packages/api-client/jest.config.ts +13 -0
- package/templates/packages/api-client/package.json +8 -0
- package/templates/packages/api-client/project.json.template +34 -0
- package/templates/packages/api-client/src/__tests__/api-client.spec.ts +408 -0
- package/templates/packages/api-client/src/api-client.ts +201 -0
- package/templates/packages/api-client/src/config.ts +193 -0
- package/templates/packages/api-client/src/index.ts +9 -0
- package/templates/packages/api-client/tsconfig.json +22 -0
- package/templates/packages/api-client/tsconfig.lib.json +11 -0
- package/templates/packages/api-client/tsconfig.spec.json +14 -0
- package/templates/packages/common-types/.eslintrc.json +18 -0
- package/templates/packages/common-types/package.json +6 -0
- package/templates/packages/common-types/project.json.template +26 -0
- package/templates/packages/common-types/src/api.types.ts +24 -0
- package/templates/packages/common-types/src/auth.types.ts +36 -0
- package/templates/packages/common-types/src/common.types.ts +46 -0
- package/templates/packages/common-types/src/index.ts +19 -0
- package/templates/packages/common-types/src/lambda.types.ts +39 -0
- package/templates/packages/common-types/src/user.types.ts +31 -0
- package/templates/packages/common-types/tsconfig.json +19 -0
- package/templates/packages/common-types/tsconfig.lib.json +11 -0
- package/templates/root/.editorconfig +23 -0
- package/templates/root/.nvmrc +1 -0
- package/templates/root/eslint.config.js +61 -0
- package/templates/root/jest.preset.js +16 -0
- package/templates/root/nx.json +29 -0
- package/templates/root/package.json +131 -0
- package/templates/root/tsconfig.base.json +29 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{PROJECT_NAME}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Nx monorepo with React web client, AWS Lambda API, and shared types",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=22.0.0",
|
|
7
|
+
"npm": ">=10.0.0"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"web": "nx serve web",
|
|
11
|
+
"web:dev": "nx serve web --configuration=development",
|
|
12
|
+
"web:prod": "nx serve web --configuration=production",
|
|
13
|
+
"mobile": "nx start mobile",
|
|
14
|
+
"mobile:ios": "nx start:ios mobile",
|
|
15
|
+
"mobile:android": "nx start:android mobile",
|
|
16
|
+
"build:web": "nx build web",
|
|
17
|
+
"build:web:dev": "nx build web --configuration=development",
|
|
18
|
+
"build:api": "nx build api",
|
|
19
|
+
"build:all": "nx run-many --target=build --all",
|
|
20
|
+
"lint": "nx run-many --target=lint --all",
|
|
21
|
+
"lint:fix": "nx run-many --target=lint --all --fix",
|
|
22
|
+
"test": "NODE_OPTIONS='--localstorage-file=/tmp/jest-localstorage' nx run-many --target=test --all",
|
|
23
|
+
"test:web": "NODE_OPTIONS='--localstorage-file=/tmp/jest-localstorage' nx test web",
|
|
24
|
+
"test:api": "NODE_OPTIONS='--localstorage-file=/tmp/jest-localstorage' nx test api",
|
|
25
|
+
"test:mobile": "NODE_OPTIONS='--localstorage-file=/tmp/jest-localstorage' nx test mobile",
|
|
26
|
+
"test:watch": "nx test web --watch",
|
|
27
|
+
"test:coverage": "NODE_OPTIONS='--localstorage-file=/tmp/jest-localstorage' nx run-many --target=test --all --coverage",
|
|
28
|
+
"test:unit": "NODE_OPTIONS='--localstorage-file=/tmp/jest-localstorage' nx run-many --target=test --all",
|
|
29
|
+
"graph": "nx graph",
|
|
30
|
+
"cdk:synth": "cd apps/api/cdk && cdk synth",
|
|
31
|
+
"cdk:deploy": "cd apps/api/cdk && cdk deploy --all -c environment=dev",
|
|
32
|
+
"cdk:deploy:local": "cd apps/api/cdk && cdklocal deploy --all",
|
|
33
|
+
"cdk:deploy:stage": "cd apps/api/cdk && cdk deploy --all -c environment=stage",
|
|
34
|
+
"cdk:deploy:prod": "cd apps/api/cdk && cdk deploy --all -c environment=prod",
|
|
35
|
+
"cdk:diff": "cd apps/api/cdk && cdk diff",
|
|
36
|
+
"cdk:destroy": "cd apps/api/cdk && cdk destroy --all",
|
|
37
|
+
"cdk:destroy:local": "cd apps/api/cdk && cdklocal destroy --all",
|
|
38
|
+
"cdk:bootstrap": "cd apps/api/cdk && cdk bootstrap",
|
|
39
|
+
"cdk:bootstrap:local": "cd apps/api/cdk && cdklocal bootstrap",
|
|
40
|
+
"deploy:web": "npm run build:web && aws s3 sync dist/apps/web s3://$(aws cloudformation describe-stacks --stack-name {{PROJECT_NAME_PASCAL}}-Static-dev --query 'Stacks[0].Outputs[?OutputKey==`BucketName`].OutputValue' --output text) --delete",
|
|
41
|
+
"invalidate:cdn": "aws cloudfront create-invalidation --distribution-id $(aws cloudformation describe-stacks --stack-name {{PROJECT_NAME_PASCAL}}-Static-dev --query 'Stacks[0].Outputs[?OutputKey==`DistributionId`].OutputValue' --output text) --paths '/*'"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"nx",
|
|
45
|
+
"monorepo",
|
|
46
|
+
"react",
|
|
47
|
+
"aws",
|
|
48
|
+
"lambda",
|
|
49
|
+
"typescript"
|
|
50
|
+
],
|
|
51
|
+
"author": "",
|
|
52
|
+
"license": "ISC",
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@aws-lambda-powertools/logger": "^2.29.0",
|
|
55
|
+
"@aws-sdk/client-dynamodb": "^3.940.0",
|
|
56
|
+
"@aws-sdk/lib-dynamodb": "^3.940.0",
|
|
57
|
+
"@aws-sdk/types": "^3.930.0",
|
|
58
|
+
"@aws-sdk/util-dynamodb": "^3.940.0",
|
|
59
|
+
"@eslint/eslintrc": "^3.3.0",
|
|
60
|
+
"@eslint/js": "^9.39.1",
|
|
61
|
+
"@nx/esbuild": "22.3.3",
|
|
62
|
+
"@nx/eslint": "22.3.3",
|
|
63
|
+
"@nx/eslint-plugin": "22.3.3",
|
|
64
|
+
"@nx/jest": "22.3.3",
|
|
65
|
+
"@nx/js": "22.3.3",
|
|
66
|
+
"@nx/react": "22.3.3",
|
|
67
|
+
"@nx/vite": "22.3.3",
|
|
68
|
+
"@nx/workspace": "22.3.3",
|
|
69
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
70
|
+
"@testing-library/jest-native": "^5.4.3",
|
|
71
|
+
"@testing-library/react": "^14.3.1",
|
|
72
|
+
"@testing-library/react-native": "^12.4.0",
|
|
73
|
+
"@testing-library/user-event": "^14.6.1",
|
|
74
|
+
"@types/jest": "^30.0.0",
|
|
75
|
+
"@types/js-yaml": "^4.0.9",
|
|
76
|
+
"@types/node": "^24.10.1",
|
|
77
|
+
"@types/react": "^19.2.4",
|
|
78
|
+
"@types/react-dom": "^19.2.3",
|
|
79
|
+
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
80
|
+
"@typescript-eslint/parser": "^8.48.0",
|
|
81
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
82
|
+
"aws-cdk": "^2.1100.1",
|
|
83
|
+
"aws-cdk-lib": "^2.224.0",
|
|
84
|
+
"aws-cdk-local": "^3.0.1",
|
|
85
|
+
"babel-plugin-module-resolver": "^5.0.0",
|
|
86
|
+
"babel-preset-expo": "^11.0.0",
|
|
87
|
+
"constructs": "^10.4.3",
|
|
88
|
+
"esbuild": "^0.27.0",
|
|
89
|
+
"eslint": "^9.39.1",
|
|
90
|
+
"eslint-plugin-react": "^7.37.5",
|
|
91
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
92
|
+
"eslint-plugin-react-native": "^5.0.0",
|
|
93
|
+
"expo": "~52.0.0",
|
|
94
|
+
"jest": "^30.2.0",
|
|
95
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
96
|
+
"jest-environment-node": "^30.2.0",
|
|
97
|
+
"jest-expo": "^52.0.0",
|
|
98
|
+
"jest-jasmine2": "^30.2.0",
|
|
99
|
+
"jest-junit": "^16.0.0",
|
|
100
|
+
"js-yaml": "^4.1.1",
|
|
101
|
+
"nx": "22.3.3",
|
|
102
|
+
"nyc": "^17.1.0",
|
|
103
|
+
"react": "^19.2.0",
|
|
104
|
+
"react-dom": "^19.2.0",
|
|
105
|
+
"source-map-support": "^0.5.21",
|
|
106
|
+
"ts-jest": "^29.4.5",
|
|
107
|
+
"ts-node": "^10.9.2",
|
|
108
|
+
"typescript": "^5.9.3",
|
|
109
|
+
"vite": "^7.2.2"
|
|
110
|
+
},
|
|
111
|
+
"overrides": {
|
|
112
|
+
"react-native": {
|
|
113
|
+
"jest-environment-node": "$jest-environment-node"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"dependencies": {
|
|
117
|
+
"@chakra-ui/icons": "^2.2.4",
|
|
118
|
+
"aws-jwt-verify": "^4.0.0",
|
|
119
|
+
"jose": "^5.2.0",
|
|
120
|
+
"@chakra-ui/react": "^2.10.9",
|
|
121
|
+
"@emotion/react": "^11.14.0",
|
|
122
|
+
"@emotion/styled": "^11.14.1",
|
|
123
|
+
"ajv": "^8.17.1",
|
|
124
|
+
"ajv-formats": "^3.0.1",
|
|
125
|
+
"axios": "^1.13.2",
|
|
126
|
+
"expo-status-bar": "~2.0.0",
|
|
127
|
+
"framer-motion": "^10.18.0",
|
|
128
|
+
"react-native": "0.76.5",
|
|
129
|
+
"zustand": "^5.0.8"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": false,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": ".",
|
|
5
|
+
"sourceMap": true,
|
|
6
|
+
"declaration": false,
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"emitDecoratorMetadata": true,
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"importHelpers": true,
|
|
11
|
+
"target": "ES2020",
|
|
12
|
+
"module": "esnext",
|
|
13
|
+
"lib": ["ES2020", "dom"],
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"skipDefaultLibCheck": true,
|
|
16
|
+
"baseUrl": ".",
|
|
17
|
+
"paths": {
|
|
18
|
+
"{{PACKAGE_SCOPE}}/common-types": ["packages/common-types/src/index.ts"],
|
|
19
|
+
"{{PACKAGE_SCOPE}}/api-client": ["packages/api-client/src/index.ts"]
|
|
20
|
+
},
|
|
21
|
+
"esModuleInterop": true,
|
|
22
|
+
"allowSyntheticDefaultImports": true,
|
|
23
|
+
"strict": true,
|
|
24
|
+
"forceConsistentCasingInFileNames": true,
|
|
25
|
+
"noImplicitReturns": true,
|
|
26
|
+
"noFallthroughCasesInSwitch": true
|
|
27
|
+
},
|
|
28
|
+
"exclude": ["node_modules", "tmp"]
|
|
29
|
+
}
|