-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.projenrc.js
101 lines (89 loc) · 4.11 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
92
93
94
95
96
97
98
99
100
101
const { awscdk } = require('projen');
const cdkVersion = '2.100.0';
const project = new awscdk.AwsCdkConstructLibrary({
author: 'Josh Kellendonk',
authorAddress: '[email protected]',
cdkVersion,
defaultReleaseBranch: 'main',
name: '@wheatstalk/cdk-intrinsic-validator',
repositoryUrl: 'https://github.com/wheatstalk/cdk-intrinsic-validator.git',
description: 'Make deployments safer by adding intrinsic validation to your stacks',
keywords: [
'cdk',
'fargate',
'testing',
'deployment',
'rollback',
'cloudformation',
'projen',
],
releaseEveryCommit: true,
releaseToNpm: true,
projenUpgradeSecret: 'YARN_UPGRADE_TOKEN',
autoApproveUpgrades: true,
autoApproveOptions: {
secret: 'GITHUB_TOKEN',
allowedUsernames: ['github-actions', 'github-actions[bot]', 'misterjoshua'],
},
devDeps: [
'ts-node@^10',
`aws-cdk@^${cdkVersion}`,
`aws-cdk-lib@^${cdkVersion}`,
'aws-sdk@^2.963.0',
'constructs@^10',
'markmac@^0.1',
'shx',
'@wheatstalk/lit-snip@^0.0',
'node-fetch@^2',
'node-abort-controller@^3',
'esbuild',
],
gitignore: [
'cdk.context.json',
'cdk.out',
'.idea',
'*.iml',
'/lambda',
],
npmignore: [
'cdk.context.json',
'cdk.out',
'.idea',
'*.iml',
'/images',
],
tsconfig: {
compilerOptions: {
lib: ['es2019', 'dom'],
},
},
// cdkDependencies: undefined, /* Which AWS CDK modules (those that start with "@aws-cdk/") does this library require when consumed? */
// cdkTestDependencies: undefined, /* AWS CDK modules required for testing. */
// deps: [], /* Runtime dependencies of this module. */
// description: undefined, /* The description is just a string that helps people understand the purpose of the package. */
// devDeps: [], /* Build dependencies for this module. */
// packageName: undefined, /* The "name" in package.json. */
// projectType: ProjectType.UNKNOWN, /* Which type of project this is (library/app). */
// release: undefined, /* Add release management to this project. */
});
project.package.setScript('integ:dev', 'cdk --app "ts-node -P tsconfig.dev.json test/integ/integ.dev.ts"');
project.package.setScript('integ:main', 'cdk --app "ts-node -P tsconfig.dev.json test/integ/integ.main.lit.ts"');
project.package.setScript('integ:fargate', 'cdk --app "ts-node -P tsconfig.dev.json test/integ/integ.fargate.lit.ts"');
project.package.setScript('integ:fargate-puppeteer', 'cdk --app "ts-node -P tsconfig.dev.json test/integ/integ.fargate-puppeteer.lit.ts"');
project.package.setScript('integ:cloudwatch-alarm', 'cdk --app "ts-node -P tsconfig.dev.json test/integ/integ.cloudwatch-alarm.lit.ts"');
project.package.setScript('integ:lambda', 'cdk --app "ts-node -P tsconfig.dev.json test/integ/integ.lambda.lit.ts"');
project.package.setScript('integ:http-check', 'cdk --app "ts-node -P tsconfig.dev.json test/integ/integ.http-check.lit.ts"');
project.package.setScript('integ:step-function', 'cdk --app "ts-node -P tsconfig.dev.json test/integ/integ.step-function.lit.ts"');
project.package.setScript('integ:alarm-monitor', 'cdk --app "ts-node -P tsconfig.dev.json test/integ/integ.alarm-monitor.ts"');
project.package.setScript('integ:error-message', 'cdk --app "ts-node -P tsconfig.dev.json test/integ/integ.error-message.ts"');
const macros = project.addTask('readme-macros');
macros.exec('shx mv README.md README.md.bak');
macros.exec('shx cat README.md.bak | markmac > README.md');
macros.exec('shx rm README.md.bak');
project.buildWorkflow.addPostBuildJobTask(macros);
const commonOptions = '--bundle --platform=node';
const preCompileTask = project.tasks.tryFind('pre-compile');
preCompileTask.exec(`esbuild ${commonOptions} src/lambda/intrinsic-validator-provider/lambda.ts --outfile=lambda/intrinsic-validator-provider.js`);
preCompileTask.exec(`esbuild ${commonOptions} src/lambda/http-check/lambda.ts --outfile=lambda/http-check.js`);
preCompileTask.exec(`esbuild ${commonOptions} src/lambda/check-alarm-status/lambda.ts --outfile=lambda/check-alarm-status.js`);
project.synth();