-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.projenrc.ts
100 lines (90 loc) · 3.07 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
import { CdklabsConstructLibrary, JsiiLanguage } from 'cdklabs-projen-project-types';
import { JsonPatch } from 'projen';
import { JestReporter } from 'projen/lib/javascript';
import { IntegTests } from './projenrc/integ-tests';
const coverageThreshold = 95;
// pinning sdk version because upgrading it requires
// updating integration test snapshosts, which cannot be done
// automatically, and thus prevents automatic upgrades of other dependencies.
const sdkVersion = '3.734.0';
const project = new CdklabsConstructLibrary({
author: 'AWS',
authorAddress: '[email protected]',
cdkVersion: '2.177.0',
defaultReleaseBranch: 'main',
devDeps: [
'cdklabs-projen-project-types',
'aws-cdk',
`@aws-sdk/client-s3@${sdkVersion}`,
`@aws-sdk/client-dynamodb@${sdkVersion}`,
`@aws-sdk/client-api-gateway@${sdkVersion}`,
`@aws-sdk/client-sts@${sdkVersion}`,
`@aws-sdk/client-scheduler@${sdkVersion}`,
`@aws-sdk/client-cloudformation@${sdkVersion}`,
`@aws-sdk/client-lambda@${sdkVersion}`,
`@aws-sdk/client-ecs@${sdkVersion}`,
`@aws-sdk/client-ecr@${sdkVersion}`,
`@aws-sdk/credential-providers@${sdkVersion}`,
'unzipper',
'@smithy/util-stream',
'@smithy/types',
'@types/aws-lambda',
'@types/unzipper',
'aws-sdk-client-mock',
'aws-sdk-client-mock-jest',
'@cdklabs/cdk-atmosphere-client',
],
name: '@cdklabs/cdk-atmosphere-service',
projenrcTs: true,
release: true,
private: false,
enablePRAutoMerge: true,
cdklabsPublishingDefaults: true,
jsiiTargetLanguages: [JsiiLanguage.PYTHON],
jestOptions: {
jestConfig: {
coverageThreshold: {
statements: coverageThreshold,
lines: coverageThreshold,
functions: coverageThreshold,
branches: coverageThreshold,
},
coveragePathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/test/',
],
coverageReporters: ['text-summary'],
reporters: [new JestReporter('default', { summaryThreshold: 1 })],
},
// we just want our own custom reporter that prints
// a summary at the end.
preserveDefaultReporters: false,
},
// this would have been nice but it doesn't
// actually work with integ-runner.
// we have our own mini discovery framework.
// TODO - possibly pull our framework upstream if it proves useful.
integrationTestAutoDiscover: false,
});
project.package.file.patch(JsonPatch.add('/jest/randomize', true));
IntegTests.discover(project);
const bundleAll = project.tasks.tryFind('bundle')!;
const cleanupBundle = project.tasks.addTask('bundle:cleanup');
const taskPath = 'src/cleanup/cleanup.task.ts';
const outfile = 'src/cleanup/image/index.js';
const command = [
'esbuild',
'--bundle',
taskPath,
'--target=\"node18\"',
'--platform=\"node\"',
`--outfile=\"${outfile}\"`,
'--tsconfig=\"tsconfig.dev.json\"',
];
cleanupBundle.exec(command.join(' '));
bundleAll.spawn(cleanupBundle);
project.gitignore.exclude(outfile);
// we sometimes run `cdk` commands directly from the root
// for dev/testing purposes
project.gitignore.exclude('cdk.out');
project.synth();