-
Notifications
You must be signed in to change notification settings - Fork 0
/
.projenrc.ts
105 lines (83 loc) · 2.34 KB
/
.projenrc.ts
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import {
EslintConfig,
GitConfig,
PrettierConfig,
VscodeConfig,
} from '@atws/projen-config'
import { awscdk } from 'projen'
import { NodePackageManager } from 'projen/lib/javascript'
const project = new awscdk.AwsCdkConstructLibrary({
author: 'Lorenz Nimmervoll',
authorAddress: 'admin@nimmervoll.work',
cdkVersion: '2.51.0',
defaultReleaseBranch: 'main',
deps: [],
description: 'Deploy turborepo-remote-cache serverless on aws',
devDeps: ['esbuild', '@atws/projen-config', 'turborepo-remote-cache'],
eslint: false,
jsiiVersion: '~5.0.0',
keywords: ['cdk', 'awscdk', 'aws-cdk', 'turborepo', 'remote-cache'],
name: 'cdk-turborepo-remote-cache',
packageManager: NodePackageManager.YARN2,
packageName: 'cdk-turborepo-remote-cache',
projenrcTs: true,
repositoryUrl: 'https://github.com/NimmLor/cdk-turborepo-remote-cache.git',
workflowNodeVersion: '18.x',
})
new PrettierConfig(project)
new EslintConfig(project, {
ignorePaths: ['lib/**/*'],
projenFileRegex: '{src,test,lambda}/**/*.ts',
})
.getFiles()
.eslintConfig.addOverride('overrides.0.parserOptions.tsconfigRootDir', './')
new VscodeConfig(project, {
vscodeExtensions: {
addCdkExtensions: false,
addCoreExtensions: false,
addNodeExtensions: false,
},
})
const ignorePatterns = [
'cache',
'install-state.gz',
'!frontend/tsconfig.json',
'frontend/dist',
'.env.local',
'cdk.out',
'.yarn',
]
new GitConfig(project)
project.gitignore.addPatterns(...ignorePatterns)
project.npmignore?.addPatterns(
...ignorePatterns,
'.editorconfig',
'.eslintignore',
'.eslintrc',
'.gitattributes',
'.prettierrc.js',
'.projenrc.ts',
'.yarn',
'.yarnrc.yml',
'lambda',
'frontend',
'!lib/lambda',
'!lib/lambda/frontend/index.html',
'!lib',
'dist',
'logo.png',
'ui.png',
'yarn-error.log',
'tsconfig.tsbuildinfo'
)
// const external = "@aws-sdk/*"
const external = 'aws-sdk'
const buildLambdaCommand = `esbuild lambda/src/index.ts --bundle --outdir=lib/lambda --platform=node --external":${external}" --minify --target=ES2022 --format=cjs`
const buildTask = project.preCompileTask
buildTask.exec(buildLambdaCommand)
project.setScript('cdk', 'cdk')
project.setScript(
'e2e',
'yarn build && yarn cdk deploy --all --app "./lib/integ.default.js" --require-approval never --outputs-file ./cdk.out/integ-outputs.json'
)
project.synth()