forked from RicoToothless/cdk-cloudfront-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.projenrc.js
115 lines (106 loc) · 2.75 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
const { awscdk, DevEnvironmentDockerImage, Gitpod } = require('projen');
const AUTOMATION_TOKEN = 'PROJEN_GITHUB_TOKEN';
const project = new awscdk.AwsCdkConstructLibrary({
author: 'Pahud Hsieh',
authorAddress: '[email protected]',
description: 'CDK construct library for CloudFront Extensions',
cdkVersion: '1.73.0',
defaultReleaseBranch: 'main',
jsiiFqn: 'projen.AwsCdkConstructLibrary',
name: 'cdk-cloudfront-plus',
repositoryUrl: 'https://github.com/pahud/cdk-cloudfront-plus.git',
cdkDependencies: [
'@aws-cdk/core',
'@aws-cdk/aws-apigatewayv2',
'@aws-cdk/aws-apigatewayv2-integrations',
'@aws-cdk/aws-lambda',
'@aws-cdk/aws-cloudfront',
'@aws-cdk/aws-cloudfront-origins',
'@aws-cdk/aws-iam',
'@aws-cdk/aws-kinesisfirehose',
'@aws-cdk/aws-lambda-nodejs',
'@aws-cdk/aws-sam',
'@aws-cdk/aws-s3',
'@aws-cdk/aws-s3-deployment',
],
devDeps: [
'@types/node',
'aws-sdk',
'esbuild',
'axios',
],
bundledDeps: [
'dotenv',
'esbuild',
],
publishToPypi: {
distName: 'cdk-cloudfront-plus',
module: 'cdk_cloudfront_plus',
},
keywords: [
'cdk',
'cloudfront',
'cdn',
'extension',
],
cdkTestDependencies: [
'@aws-cdk/aws-s3',
'@aws-cdk/aws-s3-deployment',
],
testdir: 'src/__tests__',
depsUpgradeOptions: {
ignoreProjen: false,
workflowOptions: {
labels: ['auto-approve', 'auto-merge'],
secret: AUTOMATION_TOKEN,
},
},
autoApproveOptions: {
ignoreProjen: false,
secret: 'GITHUB_TOKEN',
allowedUsernames: ['pahud'],
},
});
project.package.addField('resolutions', {
'pac-resolver': '^5.0.0',
'set-value': '^4.0.1',
'ansi-regex': '^5.0.1',
});
const gitpodPrebuild = project.addTask('gitpod:prebuild', {
description: 'Prebuild setup for Gitpod',
});
// install and compile only, do not test or package.
gitpodPrebuild.exec('yarn install --frozen-lockfile --check-files');
gitpodPrebuild.exec('npx projen compile');
let gitpod = new Gitpod(project, {
dockerImage: DevEnvironmentDockerImage.fromImage('public.ecr.aws/pahudnet/gitpod-workspace:latest'),
prebuilds: {
addCheck: true,
addBadge: true,
addLabel: true,
branches: true,
pullRequests: true,
pullRequestsFromForks: true,
},
});
gitpod.addCustomTask({
init: 'yarn gitpod:prebuild',
// always upgrade after init
command: 'npx projen upgrade',
});
gitpod.addVscodeExtensions(
'dbaeumer.vscode-eslint',
'ms-azuretools.vscode-docker',
'AmazonWebServices.aws-toolkit-vscode',
);
const common_exclude = [
'cdk.out',
'cdk.context.json',
'yarn-error.log',
'dependabot.yml',
'demo-assets',
'.env',
];
project.npmignore.exclude(...common_exclude, 'images');
project.gitignore.exclude(...common_exclude);
project.synth();