forked from cdklabs/decdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.projenrc.ts
120 lines (109 loc) · 2.68 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import { typescript, vscode } from 'projen';
const project = new typescript.TypeScriptProject({
projenrcTs: true,
defaultReleaseBranch: 'main',
name: 'decdk',
description:
'Declarative CDK: a CloudFormation-like syntax for defining CDK stacks',
authorName: 'Amazon Web Services',
authorUrl: 'https://aws.amazon.com',
authorOrganization: true,
prerelease: 'pre',
deps: [
'aws-cdk-lib',
'constructs@^10',
'fs-extra@^8',
'jsii-reflect',
'jsonschema',
'yaml',
'yargs',
'chalk@^4',
'semver',
],
devDeps: [
'@types/fs-extra@^8',
'@types/yaml',
'@types/yargs',
'@types/semver',
'jsii',
'fast-check',
],
releaseToNpm: true,
autoApproveOptions: {
allowedUsernames: ['cdklabs-automation'],
secret: 'GITHUB_TOKEN',
},
autoApproveUpgrades: true,
jestOptions: {
extraCliOptions: ['--runInBand'],
jestConfig: {
testTimeout: 10000,
setupFilesAfterEnv: ['<rootDir>/test/util.ts'],
},
},
prettier: true,
prettierOptions: {
settings: {
singleQuote: true,
},
},
tsconfig: {
compilerOptions: {
target: 'ES2020',
lib: ['es2020'],
},
},
gitignore: ['cdk.out', '/.idea'],
});
// Build schema after compilation
project.tasks
.tryFind('post-compile')
?.exec('node bin/decdk-schema --no-warnings > cdk.schema.json');
// Build deCDK specs after compilation
project.tasks
.tryFind('post-compile')
?.exec('node bin/decdk-specs --no-warnings > decdk.specs.json');
// resolve @types/[email protected] conflicts with
// typescript 3.9 (required by current jsii)
project.addFields({
resolutions: {
'@types/prettier': '2.6.0',
},
});
// VSCode
const vsCode = new vscode.VsCode(project);
vsCode.extensions.addRecommendations(
'dbaeumer.vscode-eslint',
'esbenp.prettier-vscode',
'orta.vscode-jest',
'redhat.vscode-yaml'
);
vsCode.settings.addSettings({
'editor.defaultFormatter': 'esbenp.prettier-vscode',
'eslint.format.enable': true,
'jest.autoRun': 'off',
'jest.jestCommandLine': './node_modules/.bin/jest',
});
vsCode.settings.addSettings(
{ 'editor.defaultFormatter': 'dbaeumer.vscode-eslint' },
['javascript', 'typescript']
);
vsCode.launchConfiguration.addConfiguration({
type: 'node',
name: 'vscode-jest-tests.v2',
request: 'launch',
internalConsoleOptions: vscode.InternalConsoleOptions.NEVER_OPEN,
program: '${workspaceFolder}/node_modules/.bin/jest',
args: [
'--runInBand',
'--watchAll=false',
'--testNamePattern',
'${jest.testNamePattern}',
'--runTestsByPath',
'${jest.testFile}',
],
console: vscode.Console.INTEGRATED_TERMINAL,
disableOptimisticBPs: true,
cwd: '${workspaceFolder}',
});
project.synth();