/
.projenrc.js
105 lines (94 loc) · 2.72 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
const { AwsCdkConstructLibrary, FileBase, NodePackageManager } = require("projen");
class ContentFile extends FileBase {
constructor(project, path, options) {
super(project, path, options);
this.options = options;
}
synthesizeContent() {
return this.options.content;
}
}
const project = new AwsCdkConstructLibrary({
packageManager: NodePackageManager.NPM,
cdkVersion: "1.66.0",
name: "@JordanSinko/the-slack-pipeline-approval",
authorName: "Jordan Sinko",
authorAddress: "jordan5sinko@gmail.com",
repository: "https://github.com/JordanSinko/the-slack-pipeline-approval",
scripts: {
clean: "rimraf coverage dist lib node_modules",
format: "pretty-quick --staged",
"compile:construct": "jsii --silence-warnings=reserved-word --no-fix-peer-dependencies && jsii-docgen",
"compile:handlers": "npm run compile:requester && npm run compile:approver",
"compile:requester":
"esbuild src/requester/index.ts --outfile=lib/requester/index.js --platform=node --target=es2019 --format=cjs --bundle",
"compile:approver":
"esbuild src/approver/index.ts --outfile=lib/approver/index.js --platform=node --target=es2019 --format=cjs --bundle",
},
devDependencies: {
esbuild: "^0.7.9",
husky: "^4.3.0",
prettier: "^2.1.2",
"pretty-quick": "^3.0.2",
"npm-run-all": "^4.1.5",
// Dependencies for handlers which are bundled with esbuild
"@types/aws-lambda": "^8.10.63",
"aws-sdk": "^2.766.0",
phin: "^3.5.0",
},
cdkDependencies: [
"@aws-cdk/core",
"@aws-cdk/aws-codepipeline",
"@aws-cdk/aws-codepipeline-actions",
"@aws-cdk/aws-sns",
"@aws-cdk/aws-sns-subscriptions",
"@aws-cdk/aws-iam",
"@aws-cdk/aws-lambda",
"@aws-cdk/aws-apigatewayv2",
],
cdkTestDependencies: ["@aws-cdk/assert"],
eslint: false,
releaseWorkflow: true,
buildWorkflow: true,
mergify: true,
npmRegistry: "npm.pkg.github.com",
});
project.addScript("compile", "npm run compile:construct && npm run compile:handlers");
project.addFields({
jsii: {
...project.manifest.jsii,
excludeTypescript: ["src/approver", "src/requester"],
},
});
new ContentFile(project, ".prettierignore", {
content: `package.json
API.md
.versionrc.json
`,
});
new ContentFile(project, "husky.config.js", {
content: `module.exports = {
hooks: {
"pre-commit": "run-s format",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
},
};
`,
});
new ContentFile(project, "commitlint.config.js", {
content: `module.exports = {
extends: ["@commitlint/config-conventional"],
};
`,
});
new ContentFile(project, "prettier.config.js", {
content: `module.exports = {
tabWidth: 2,
semi: true,
singleQuote: false,
printWidth: 120,
endOfLine: "lf",
};
`,
});
project.synth();