-
Notifications
You must be signed in to change notification settings - Fork 4
/
.projenrc.ts
77 lines (65 loc) · 2.33 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
import { CdklabsTypeScriptProject } from 'cdklabs-projen-project-types';
import { NpmAccess } from 'projen/lib/javascript';
import { DeprecatedTypes } from './projenrc/deprecated-types';
import { generatePackages, updateReadme } from './projenrc/generate-packages';
import { UpdateRegistry } from './projenrc/update-registry';
const project = new CdklabsTypeScriptProject({
setNodeEngineVersion: false,
defaultReleaseBranch: 'main',
name: 'cdk-cloudformation',
projenrcTs: true,
sampleCode: false,
npmAccess: NpmAccess.PUBLIC,
});
project.addDevDeps('cdk-import@^0.2.112');
project.addDevDeps('case');
project.addDevDeps('aws-sdk');
project.addDevDeps('constructs@^10.0.5');
project.addDevDeps('aws-cdk-lib');
project.addDevDeps('jsii');
project.addDevDeps('jsii-pacmak');
project.addDevDeps('jsii-rosetta');
project.addDevDeps('aws-cdk-github-oidc@^2.2.0');
project.addDevDeps('ts-node@^10');
project.addDevDeps('@types/[email protected]'); // last version compatible with jsii 1.x
project.addDevDeps('@typescript-eslint/eslint-plugin@^6');
project.addDevDeps('@typescript-eslint/parser@^6');
// the root is not really a library
project.compileTask.reset();
project.packageTask.reset();
const packagesDir = 'packages';
const scope = '@cdk-cloudformation';
const packagesPath = `${packagesDir}/${scope}`;
// convenience tasks from to-level
project.addTask('compile-pkg', {
exec: `cd ${packagesPath}/$@ && ${project.runTaskCommand(project.compileTask)}`,
receiveArgs: true,
});
project.addTask('package-pkg', {
exec: `cd ${packagesPath}/$@ && ${project.runTaskCommand(project.packageTask)}`,
receiveArgs: true,
});
project.addTask('build-pkg', {
exec: `cd ${packagesPath}/$@ && ${project.runTaskCommand(project.buildTask)}`,
receiveArgs: true,
});
project.package.addField('workspaces', {
packages: [`${packagesDir}/${scope}/*`],
});
project.package.addField('resolutions', {
// Newer @types package doesn't work with old TypeScript
'@types/prettier': '2.4.4',
});
project.addExcludeFromCleanup('packages/**');
const projects = generatePackages(project, {
excludeTypes: [
'TF::Akamai::DnsRecord', // https://github.com/cdklabs/cdk-cloudformation/runs/4131637186
],
dir: packagesDir,
scope: scope,
prerelease: 'alpha.7',
});
updateReadme(project, projects);
new UpdateRegistry(project);
new DeprecatedTypes(project);
project.synth();