-
Notifications
You must be signed in to change notification settings - Fork 13
/
.projenrc.ts
104 lines (92 loc) · 3.04 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
import { CdklabsTypeScriptProject } from 'cdklabs-projen-project-types';
import { JsonPatch } from 'projen';
import { RosettaPeerDependency, RosettaVersionLines } from './projenrc/rosetta';
const project = new CdklabsTypeScriptProject({
stability: 'stable',
private: false,
projenrcTs: true,
name: 'jsii-docgen',
description: 'generates api docs for jsii modules',
repository: 'https://github.com/cdklabs/jsii-docgen',
authorName: 'Amazon Web Services',
authorUrl: 'https://aws.amazon.com',
authorOrganization: true,
defaultReleaseBranch: 'main',
bin: {
'jsii-docgen': 'bin/jsii-docgen',
},
devDeps: [
'@types/fs-extra',
'@types/semver',
],
deps: [
'@jsii/spec',
'case',
'fs-extra',
'glob-promise',
'glob',
'jsii-reflect',
'semver',
'yargs',
],
peerDependencyOptions: {
pinnedDevDependency: false,
},
releaseToNpm: true,
autoApproveOptions: {
allowedUsernames: ['cdklabs-automation'],
secret: 'GITHUB_TOKEN',
},
autoApproveUpgrades: true,
minNodeVersion: '18.12.0',
setNodeEngineVersion: false,
workflowNodeVersion: '18.x',
jestOptions: {
jestConfig: {
setupFilesAfterEnv: ['<rootDir>/test/setup-jest.ts'],
testMatch: [
// On Windows the standard tests paths are not matched
// Use this simplified version instead that works good enough in this repo
'<rootDir>/test/**/*.test.ts',
],
},
},
tsconfig: {
compilerOptions: {
target: 'ES2019',
lib: ['es2019'], // allow Array.prototype.flat etc.
skipLibCheck: true,
},
},
// Because githubOptions: { mergify: false } has no effect on this project type
enablePRAutoMerge: true,
});
// Suppress upgrade prompts, in particular from test runs.
project.tasks.addEnvironment('JSII_SUPPRESS_UPGRADE_PROMPT', 'true');
// Add the new version line here
new RosettaPeerDependency(project, {
supportedVersions: {
[RosettaVersionLines.V1_X]: '^1.85.0',
[RosettaVersionLines.V5_0]: '~5.0.14',
[RosettaVersionLines.V5_1]: '~5.1.2',
[RosettaVersionLines.V5_2]: '~5.2.0',
[RosettaVersionLines.V5_3]: '~5.3.0',
[RosettaVersionLines.V5_4]: '~5.4.0',
[RosettaVersionLines.V5_5]: '~5.5.0',
[RosettaVersionLines.V5_6]: '~5.6.0',
[RosettaVersionLines.V5_7]: '~5.7.0',
},
});
project.github?.tryFindWorkflow('release')?.file?.patch(JsonPatch.add('/jobs/release/env/NODE_OPTIONS', '--max_old_space_size=4096'));
project.github?.tryFindWorkflow('build')?.file?.patch(JsonPatch.add('/jobs/build/env/NODE_OPTIONS', '--max_old_space_size=4096'));
const libraryFixtures = ['construct-library'];
// compile the test fixtures with jsii
for (const library of libraryFixtures) {
project.compileTask.exec('npm ci', { cwd: `./test/__fixtures__/libraries/${library}` });
project.compileTask.exec('npm run compile', { cwd: `./test/__fixtures__/libraries/${library}` });
}
// artifacts created by transpilation in tests
project.gitignore.exclude('test/**/.jsii.*');
// local vscode configuration
project.gitignore.exclude('.vscode/');
project.synth();