Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: refactor API for simpler usage (v1.x) #11

Merged
merged 13 commits into from
Apr 5, 2024
6 changes: 1 addition & 5 deletions .eslintrc.json

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

1 change: 1 addition & 0 deletions .gitattributes

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

1 change: 1 addition & 0 deletions .gitignore

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

6 changes: 5 additions & 1 deletion .projen/deps.json

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

1 change: 1 addition & 0 deletions .projen/files.json

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

3 changes: 2 additions & 1 deletion .projen/tasks.json

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

19 changes: 13 additions & 6 deletions .projenrc.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { ProjenStruct, Struct } from "@mrgrain/jsii-struct-builder";
import { ReleasableCommits, awscdk } from "projen";
import { ProseWrap } from "projen/lib/javascript";

const project = new awscdk.AwsCdkConstructLibrary({
author: "Ben Limmer",
authorAddress: "[email protected]",
cdkVersion: "2.1.0",
cdkVersion: "2.73.0", // Released in April 2023
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I'm using jsii-struct-builder to extend RoleProps, I'm bumping to a more modern minimum CDK version. This was released one year ago, so it feels reasonable to ask people to be on at least this version when upgrading.

defaultReleaseBranch: "main",
name: "@blimmer/cdk-circleci-oidc",
repositoryUrl: "https://github.com/blimmer/cdk-circleci-oidc.git",
majorVersion: 1,

projenrcTs: true,

Expand All @@ -19,20 +21,25 @@ const project = new awscdk.AwsCdkConstructLibrary({
module: "cdk_circleci_oidc",
},

// deps: [],
devDeps: ["@mrgrain/jsii-struct-builder"],
depsUpgrade: false,

eslintOptions: {
dirs: ["src"],
ignorePatterns: ["src/generated/*.ts"], // ignore generated files
},
prettier: true,
prettierOptions: {
settings: {
printWidth: 120,
proseWrap: ProseWrap.ALWAYS,
},
},

// deps: [], /* Runtime dependencies of this module. */
// description: undefined, /* The description is just a string that helps people understand the purpose of the package. */
// devDeps: [], /* Build dependencies for this module. */
// packageName: undefined, /* The "name" in package.json. */
});

new ProjenStruct(project, { name: "RoleProps", filePath: "src/generated/IamRoleProps.ts" }).mixin(
Struct.fromFqn("aws-cdk-lib.aws_iam.RoleProps").omit("assumedBy").withoutDeprecated(),
);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSII can't handle statements like:

type MyRoleProps = Omit<RoleProps, 'assumedBy'>;

So I'm using jsii-struct-builder to accomplish the same thing.


project.synth();
Loading