-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.projenrc.js
91 lines (80 loc) · 2.35 KB
/
.projenrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
const { web, AwsCdkTypeScriptApp } = require('projen');
const project = new AwsCdkTypeScriptApp({
authorAddress: 'damadden88@googlemail.com',
authorName: 'martin.mueller',
name: 'aws-cdk-todolist-ui',
defaultReleaseBranch: 'main',
cdkVersion: '1.93.0',
cdkVersionPinning: true,
cdkDependencies: [
'@aws-cdk/aws-iam',
'@aws-cdk/aws-s3-deployment',
'@aws-cdk/aws-s3',
'@aws-cdk/aws-codepipeline',
'@aws-cdk/aws-codepipeline-actions',
'@aws-cdk/pipelines',
'@aws-cdk/aws-lambda-nodejs',
],
deps: [
'aws-cdk-staging-pipeline',
],
context: {
'@aws-cdk/core:enableStackNameDuplicates': true,
'aws-cdk:enableDiffNoFail': true,
'@aws-cdk/core:stackRelativeExports': true,
'@aws-cdk/core:newStyleStackSynthesis': true,
},
releaseWorkflow: false,
});
project.buildTask.prependExec('cd frontend && yarn install && yarn build && cd ..');
project.setScript('cdkDeploy', 'cdk deploy');
project.setScript('cdkDestroy', 'cdk destroy');
project.synth();
const frontendProject = new web.ReactTypeScriptProject({
defaultReleaseBranch: 'main',
outdir: 'frontend',
parent: project,
name: 'aws-cdk-todolist-ui-frontend',
deps: [
'@aws-amplify/auth',
'@aws-amplify/ui-components',
'@aws-amplify/ui-react',
'aws-amplify',
'react-query@^2',
'react-router',
'react-router-dom',
'@types/react-router-dom',
],
devDeps: [
'@graphql-codegen/cli',
'@graphql-codegen/typescript',
'@graphql-codegen/typescript-operations',
'@graphql-codegen/typescript-react-query@alpha',
'amplify-graphql-docs-generator',
'aws-sdk@^2',
'graphql',
],
tsconfig: {
compilerOptions: {
forceConsistentCasingInFileNames: false,
strictNullChecks: false,
},
},
releaseWorkflow: false,
});
frontendProject.addTask('dev', {
description: 'Runs the application locally',
exec: 'react-scripts start',
});
frontendProject.addTask('generate-exports', {
description: 'Generates aws-exports.js',
exec: 'node bin/generateExports.js dev && node bin/generateExports.js prod',
});
frontendProject.addTask('generate-statements', {
exec: 'node bin/generateStatements.js',
});
frontendProject.addTask('codegen', {
description: 'Generates frontend GraphQL wrapper API code',
exec: 'yarn run generate-statements && graphql-codegen --config codegen.yml',
});
frontendProject.synth();