Skip to content

Commit

Permalink
chore(ci): pin version of cssstyle to allow upgrade-main to succeed (#…
Browse files Browse the repository at this point in the history
…987)

Signed-off-by: team-tf-cdk <[email protected]>
Co-authored-by: team-tf-cdk <[email protected]>
  • Loading branch information
xiehan and team-tf-cdk authored Jan 14, 2025
1 parent 6d8b2f9 commit 00f0d0e
Show file tree
Hide file tree
Showing 18 changed files with 1,433 additions and 1,723 deletions.
6 changes: 3 additions & 3 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ const project = new CdktfAwsCdkProject({
projenrcTs: true,
});

project.package.addPackageResolutions("@types/[email protected]");

// Use pinned versions of github actions
Object.entries(githubActionPinnedVersions).forEach(([name, sha]) => {
project.github?.actions.set(name, `${name}@${sha}`);
Expand Down
16 changes: 8 additions & 8 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 14 additions & 11 deletions projenrc/cdktf-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,43 @@ export class CdktfConfig {
project.addDevDeps("@typescript-eslint/eslint-plugin@^6");
project.addDevDeps("@typescript-eslint/parser@^6");

// This is a temporary workaround to allow upgrade-main to succeed until we upgrade to Node 20
project.package.addPackageResolutions(`[email protected]`);

// for update-supported-types script
project.addDevDeps("@aws-sdk/client-cloudformation@^3.36.0");
project.setScript(
"fetch:types",
`mkdir -p src/awscc && rm -rf ./src/awscc/* && node ./scripts/update-supported-types.js`,
`mkdir -p src/awscc && rm -rf ./src/awscc/* && node ./scripts/update-supported-types.js`
);
project.addPackageIgnore("scripts");

project.setScript(
"fetch",
`mkdir -p src/aws && rm -rf ./src/aws/* && cdktf get && cp -R .gen/providers/${providerName}/* ./src/aws/` +
` && mkdir -p src/time && rm -rf ./src/time/* && cp -R .gen/providers/time/* ./src/time/`,
` && mkdir -p src/time && rm -rf ./src/time/* && cp -R .gen/providers/time/* ./src/time/`
);
project.setScript(
"commit",
'git add -A && git commit -am "Update provider" || echo "No changes to commit"',
'git add -A && git commit -am "Update provider" || echo "No changes to commit"'
);
// eslint-disable-next-line quotes
project.setScript(
"should-release",
`! git diff --exit-code v$(cat version.json | jq -r '.version') ./src ./package.json`,
`! git diff --exit-code v$(cat version.json | jq -r '.version') ./src ./package.json`
);
project.setScript(
"prebump",
"yarn fetch && yarn compile && yarn run commit && yarn run should-release",
"yarn fetch && yarn compile && yarn run commit && yarn run should-release"
);
project.setScript(
"compile",
'NODE_OPTIONS="--max-old-space-size=7516" jsii --silence-warnings=reserved-word',
'NODE_OPTIONS="--max-old-space-size=7516" jsii --silence-warnings=reserved-word'
);

project.setScript(
"build-provider",
"yarn fetch && yarn compile && yarn docgen",
"yarn fetch && yarn compile && yarn docgen"
);
project.setScript("test", "jest");

Expand Down Expand Up @@ -136,7 +139,7 @@ export class CdktfConfig {
project.annotateGenerated("/docs/*.md");

[project.compileTask, project.testTask].forEach((task) =>
task.env("NODE_OPTIONS", "--max-old-space-size=6144"),
task.env("NODE_OPTIONS", "--max-old-space-size=6144")
);
project.testTask.env("DEBUG", "jest");

Expand Down Expand Up @@ -177,19 +180,19 @@ export class CdktfConfig {
"yarn install --check-files --ignore-engines && yarn upgrade --ignore-engines",
{
cwd: "examples/typescript-manual-mapping",
},
}
);
updateExamples.exec(
"yarn install --check-files --ignore-engines && yarn upgrade --ignore-engines",
{
cwd: "examples/typescript-step-functions",
},
}
);
updateExamples.exec(
"yarn install --check-files --ignore-engines && yarn upgrade --ignore-engines",
{
cwd: "examples/typescript-step-functions-mixed",
},
}
);

// Consider turning on the below if Dependabot is not working for us anymore
Expand Down
8 changes: 4 additions & 4 deletions projenrc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class CdktfAwsCdkProject extends cdk.JsiiProject {
name: "Setup Copywrite tool",
uses: "hashicorp/setup-copywrite",
},
{ name: "Add headers using Copywrite tool", run: "copywrite headers" },
{ name: "Add headers using Copywrite tool", run: "copywrite headers" }
);
this.addPackageIgnore(".copywrite.hcl");

Expand All @@ -268,7 +268,7 @@ export class CdktfAwsCdkProject extends cdk.JsiiProject {
]);

const upgradeWorkflow = this.tryFindObjectFile(
".github/workflows/upgrade-main.yml",
".github/workflows/upgrade-main.yml"
);
upgradeWorkflow?.addOverride("on.schedule", [
{
Expand All @@ -281,7 +281,7 @@ export class CdktfAwsCdkProject extends cdk.JsiiProject {
]);

const releaseWorkflow = this.tryFindObjectFile(
".github/workflows/release.yml",
".github/workflows/release.yml"
);
releaseWorkflow?.addOverride("on.push", {
branches: ["main"],
Expand Down Expand Up @@ -330,7 +330,7 @@ export class CdktfAwsCdkProject extends cdk.JsiiProject {
},
if: "steps.check_files.outputs.no_changes",
run: "gh run cancel $RUN_ID \ngh run watch $RUN_ID",
} as JobStep,
} as JobStep
);
buildWorkflow?.addDeletionOverride("jobs.self-mutation.steps.0.with.token");
}
Expand Down
2 changes: 1 addition & 1 deletion projenrc/semver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class Semver {
private constructor(version: string, mode?: string) {
if (mode && !ALLOWED_MODES.includes(mode)) {
throw new Error(
`mode "${mode}" not allowed. allowed modes: ${ALLOWED_MODES.join(",")}`,
`mode "${mode}" not allowed. allowed modes: ${ALLOWED_MODES.join(",")}`
);
}

Expand Down
4 changes: 2 additions & 2 deletions projenrc/util/random-cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export function generateRandomCron(options: RandomCronOptions) {
schedule === Schedule.Weekly
? "1"
: schedule === Schedule.Weekdays
? "1-5"
: "*";
? "1-5"
: "*";

return `${minute} ${(hour + hourOffset) % 24} ${dayOfMonth} * ${dayOfWeek}`;
}
Loading

0 comments on commit 00f0d0e

Please sign in to comment.