-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.projenrc.ts
143 lines (131 loc) · 5.13 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { ConstructLibraryCdktf } from "projen/lib/cdktf";
import { NpmAccess, UpgradeDependenciesSchedule } from "projen/lib/javascript";
import { AutoApprove } from "./projenrc/auto-approve";
import { Automerge } from "./projenrc/automerge";
import { JsiiDocgen } from "./projenrc/custom-docgen";
import { CustomizedLicense } from "./projenrc/customized-license";
import { UpgradeCDKTF } from "./projenrc/upgrade-cdktf";
import { UpgradeJSIIAndTypeScript } from "./projenrc/upgrade-jsii-typescript";
const githubActionPinnedVersions = {
"actions/checkout": "11bd71901bbe5b1630ceea73d27597364c9af683", // v4.2.2
"actions/download-artifact": "95815c38cf2ff2164869cbab79da8d1f422bc89e", // v4.2.1
"actions/github-script": "60a0d83039c74a4aee543508d2ffcb1c3799cdea", // v7.0.1
"actions/setup-dotnet": "67a3573c9a986a3f9c594539f4ab511d57bb3ce9", // v4.3.1
"actions/setup-go": "0aaccfd150d50ccaeb58ebd88d36e91967a5f35b", // v5.4.0
"actions/setup-java": "3a4f6e1af504cf6a31855fa899c6aa5355ba6c12", // v4.7.0
"actions/setup-node": "cdca7365b2dadb8aad0a33bc7601856ffabcc48e", // v4.3.0
"actions/setup-python": "42375524e23c412d93fb67b49958b491fce71c38", // v5.4.0
"actions/upload-artifact": "ea165f8d65b6e75b540449e92b4886f43607fa02", // v4.6.2
"amannn/action-semantic-pull-request":
"0723387faaf9b38adef4775cd42cfd5155ed6017", // v5.5.3
"hashicorp/setup-copywrite": "32638da2d4e81d56a0764aa1547882fc4d209636", // v1.1.3
"peter-evans/create-pull-request": "271a8d0340265f705b14b6d32b9829c1cb33d45e", // v7.0.8
};
const constructsVersion = "10.3.0";
/** JSII and TS should always use the same major/minor version range */
const typescriptVersion = "~5.6.0";
const project = new ConstructLibraryCdktf({
author: "HashiCorp",
authorAddress: "https://hashicorp.com",
authorOrganization: true,
defaultReleaseBranch: "main",
name: "@cdktf/tf-module-stack",
repositoryUrl: "https://github.com/cdktf/cdktf-tf-module-stack.git",
prettier: true,
projenrcTs: true,
licensed: false,
pullRequestTemplate: false,
npmAccess: NpmAccess.PUBLIC,
mergify: false,
depsUpgradeOptions: {
workflowOptions: {
labels: ["auto-approve", "automerge", "dependencies"],
schedule: UpgradeDependenciesSchedule.WEEKLY,
},
},
minMajorVersion: 1,
cdktfVersion: "0.20.0",
description:
"A drop-in replacement for cdktf.TerraformStack that lets you define Terraform modules as constructs" /* The description is just a string that helps people understand the purpose of the package. */,
workflowGitIdentity: {
name: "team-tf-cdk",
email: "[email protected]",
},
publishToPypi: {
distName: "cdktf-tf-module-stack",
module: "cdktf_tf_module_stack",
},
publishToNuget: {
dotNetNamespace: "HashiCorp.Cdktf.TfModuleStack",
packageId: "HashiCorp.Cdktf.TfModuleStack",
},
publishToMaven: {
javaPackage: "com.hashicorp.cdktf.tf_module_stack",
mavenGroupId: "com.hashicorp",
mavenArtifactId: "cdktf-tf-module-stack",
mavenEndpoint: "https://hashicorp.oss.sonatype.org",
},
publishToGo: {
gitUserEmail: "[email protected]",
gitUserName: "CDK for Terraform Team",
moduleName: `github.com/cdktf/cdktf-tf-module-stack-go`,
packageName: "tfmodulestack",
},
docgen: false,
typescriptVersion,
jsiiVersion: typescriptVersion,
});
new CustomizedLicense(project);
new AutoApprove(project);
new Automerge(project);
new UpgradeCDKTF(project);
new UpgradeJSIIAndTypeScript(project, typescriptVersion);
project.addPeerDeps("cdktf@>=0.20.0", `constructs@^${constructsVersion}`);
project.addDevDeps(
"@cdktf/provider-null@>=10.0.0",
"@cdktf/provider-random@>=11.0.0"
);
new JsiiDocgen(project, {
// We don't have docs for go because major changes lead to documentation changes
// This blocks the release process
languages: ["typescript", "python", "java", "csharp"],
});
project.jest?.addIgnorePattern("dist");
project.addKeywords("cdktf", "terraform");
project.addPackageIgnore("scripts");
project.addPackageIgnore("projenrc");
project.addPackageIgnore("/.projenrc.ts");
project.addPackageIgnore(".copywrite.hcl");
// Run copywrite tool to add copyright headers to all files
project.buildWorkflow?.addPostBuildSteps(
{
name: "Setup Copywrite tool",
uses: "hashicorp/setup-copywrite",
},
{ name: "Add headers using Copywrite tool", run: "copywrite headers" }
);
// Use pinned versions of github actions
Object.entries(githubActionPinnedVersions).forEach(([action, sha]) => {
project.github?.actions.set(action, `${action}@${sha}`);
});
const releaseWorkflow = project.tryFindObjectFile(
".github/workflows/release.yml"
);
releaseWorkflow?.addOverride("on.push", {
branches: ["main"],
"paths-ignore": [
// don't do a release if the change was only to these files/directories
"examples/**",
".github/ISSUE_TEMPLATE/**",
".github/CODEOWNERS",
".github/dependabot.yml",
".github/**/*.md",
],
});
// always publish a new GitHub release, even when publishing to a particular package manager fails
releaseWorkflow?.addOverride("jobs.release_github.needs", "release");
project.synth();