From 40e9829fe70c5fb506277bcc1d5899b1c435260e Mon Sep 17 00:00:00 2001 From: Matt Wise <768067+diranged@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:33:58 -0700 Subject: [PATCH] chore: cleanup and formatting (#7) --- .eslintrc.json | 235 ------------------------ .eslintrc.yml | 101 ++++++++++ .gitattributes | 4 +- .github/workflows/pull-request-lint.yml | 9 +- .gitignore | 4 +- .prettierignore | 1 + .prettierrc.yml | 6 + .projen/deps.json | 12 ++ .projen/files.json | 4 +- .projen/tasks.json | 4 +- .projenrc.ts | 31 +++- API.md | 14 -- package.json | 5 +- src/aws-credentials.ts | 10 +- src/github-common.ts | 2 + src/json-patch.ts | 2 + src/oidc-provider.ts | 23 ++- src/pipeline.ts | 49 ++--- src/private/aws-credentials.ts | 6 +- src/stage-options.ts | 2 + src/stage.ts | 2 + src/steps/github-action-step.ts | 2 + src/wave.ts | 8 +- src/workflows-model.ts | 78 ++++++-- src/yaml-file.ts | 7 +- test/example-app.ts | 1 - test/manual-test.ts | 2 + test/oidc-provider.test.ts | 57 +++--- test/runner-provided.test.ts | 2 + test/stage-options.test.ts | 44 ++--- test/testutil.ts | 13 +- test/yaml-file.test.ts | 9 +- yarn.lock | 199 +++++++++++++++++++- 33 files changed, 555 insertions(+), 393 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 .eslintrc.yml create mode 100644 .prettierignore create mode 100644 .prettierrc.yml diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index d741455a..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,235 +0,0 @@ -// ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". -{ - "env": { - "jest": true, - "node": true - }, - "root": true, - "plugins": [ - "@typescript-eslint", - "import" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 2018, - "sourceType": "module", - "project": "./tsconfig.dev.json" - }, - "extends": [ - "plugin:import/typescript" - ], - "settings": { - "import/parsers": { - "@typescript-eslint/parser": [ - ".ts", - ".tsx" - ] - }, - "import/resolver": { - "node": {}, - "typescript": { - "project": "./tsconfig.dev.json", - "alwaysTryTypes": true - } - } - }, - "ignorePatterns": [ - "*.js", - "*.d.ts", - "node_modules/", - "*.generated.ts", - "coverage", - "!.projenrc.ts", - "!projenrc/**/*.ts" - ], - "rules": { - "indent": [ - "off" - ], - "@typescript-eslint/indent": [ - "error", - 2 - ], - "quotes": [ - "error", - "single", - { - "avoidEscape": true - } - ], - "comma-dangle": [ - "error", - "always-multiline" - ], - "comma-spacing": [ - "error", - { - "before": false, - "after": true - } - ], - "no-multi-spaces": [ - "error", - { - "ignoreEOLComments": false - } - ], - "array-bracket-spacing": [ - "error", - "never" - ], - "array-bracket-newline": [ - "error", - "consistent" - ], - "object-curly-spacing": [ - "error", - "always" - ], - "object-curly-newline": [ - "error", - { - "multiline": true, - "consistent": true - } - ], - "object-property-newline": [ - "error", - { - "allowAllPropertiesOnSameLine": true - } - ], - "keyword-spacing": [ - "error" - ], - "brace-style": [ - "error", - "1tbs", - { - "allowSingleLine": true - } - ], - "space-before-blocks": [ - "error" - ], - "curly": [ - "error", - "multi-line", - "consistent" - ], - "@typescript-eslint/member-delimiter-style": [ - "error" - ], - "semi": [ - "error", - "always" - ], - "max-len": [ - "error", - { - "code": 150, - "ignoreUrls": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreComments": true, - "ignoreRegExpLiterals": true - } - ], - "quote-props": [ - "error", - "consistent-as-needed" - ], - "@typescript-eslint/no-require-imports": [ - "error" - ], - "import/no-extraneous-dependencies": [ - "error", - { - "devDependencies": [ - "**/test/**", - "**/build-tools/**", - ".projenrc.ts", - "projenrc/**/*.ts" - ], - "optionalDependencies": false, - "peerDependencies": true - } - ], - "import/no-unresolved": [ - "error" - ], - "import/order": [ - "warn", - { - "groups": [ - "builtin", - "external" - ], - "alphabetize": { - "order": "asc", - "caseInsensitive": true - } - } - ], - "no-duplicate-imports": [ - "error" - ], - "no-shadow": [ - "off" - ], - "@typescript-eslint/no-shadow": [ - "error" - ], - "key-spacing": [ - "error" - ], - "no-multiple-empty-lines": [ - "error" - ], - "@typescript-eslint/no-floating-promises": [ - "error" - ], - "no-return-await": [ - "off" - ], - "@typescript-eslint/return-await": [ - "error" - ], - "no-trailing-spaces": [ - "error" - ], - "dot-notation": [ - "error" - ], - "no-bitwise": [ - "error" - ], - "@typescript-eslint/member-ordering": [ - "error", - { - "default": [ - "public-static-field", - "public-static-method", - "protected-static-field", - "protected-static-method", - "private-static-field", - "private-static-method", - "field", - "constructor", - "method" - ] - } - ] - }, - "overrides": [ - { - "files": [ - ".projenrc.ts" - ], - "rules": { - "@typescript-eslint/no-require-imports": "off", - "import/no-extraneous-dependencies": "off" - } - } - ] -} diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..089a6776 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,101 @@ +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + +env: + jest: true + node: true +root: true +plugins: + - "@typescript-eslint" + - import + - prettier +parser: "@typescript-eslint/parser" +parserOptions: + ecmaVersion: 2018 + sourceType: module + project: ./tsconfig.dev.json +extends: + - plugin:import/typescript + - prettier + - plugin:prettier/recommended +settings: + import/parsers: + "@typescript-eslint/parser": + - .ts + - .tsx + import/resolver: + node: {} + typescript: + project: ./tsconfig.dev.json + alwaysTryTypes: true +ignorePatterns: + - "*.js" + - "*.d.ts" + - node_modules/ + - "*.generated.ts" + - coverage + - "!.projenrc.ts" + - "!projenrc/**/*.ts" +rules: + prettier/prettier: + - error + "@typescript-eslint/no-require-imports": + - error + import/no-extraneous-dependencies: + - error + - devDependencies: + - "**/test/**" + - "**/build-tools/**" + - .projenrc.ts + - projenrc/**/*.ts + optionalDependencies: false + peerDependencies: true + import/no-unresolved: + - error + import/order: + - warn + - groups: + - builtin + - external + alphabetize: + order: asc + caseInsensitive: true + no-duplicate-imports: + - error + no-shadow: + - off + "@typescript-eslint/no-shadow": + - error + key-spacing: + - error + no-multiple-empty-lines: + - error + "@typescript-eslint/no-floating-promises": + - error + no-return-await: + - off + "@typescript-eslint/return-await": + - error + no-trailing-spaces: + - error + dot-notation: + - error + no-bitwise: + - error + "@typescript-eslint/member-ordering": + - error + - default: + - public-static-field + - public-static-method + - protected-static-field + - protected-static-method + - private-static-field + - private-static-method + - field + - constructor + - method +overrides: + - files: + - .projenrc.ts + rules: + "@typescript-eslint/no-require-imports": off + import/no-extraneous-dependencies: off diff --git a/.gitattributes b/.gitattributes index 8159be3c..c0bd2d04 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,7 @@ # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". *.snap linguist-generated -/.eslintrc.json linguist-generated +/.eslintrc.yml linguist-generated /.gitattributes linguist-generated /.github/pull_request_template.md linguist-generated /.github/workflows/build.yml linguist-generated @@ -12,6 +12,8 @@ /.mergify.yml linguist-generated /.npmignore linguist-generated /.npmrc linguist-generated +/.prettierignore linguist-generated +/.prettierrc.yml linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated /.projen/files.json linguist-generated diff --git a/.github/workflows/pull-request-lint.yml b/.github/workflows/pull-request-lint.yml index 3c16c6de..57000929 100644 --- a/.github/workflows/pull-request-lint.yml +++ b/.github/workflows/pull-request-lint.yml @@ -22,8 +22,15 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: types: |- + build + chore feat + ci + docs + style + refactor + perf + test fix - chore requireScope: false githubBaseUrl: ${{ github.api_url }} diff --git a/.gitignore b/.gitignore index 38d71db6..9d4d9ef9 100644 --- a/.gitignore +++ b/.gitignore @@ -41,13 +41,15 @@ junit.xml !/.mergify.yml !/.github/workflows/upgrade-nextdoor.yml !/.github/pull_request_template.md +!/.prettierignore +!/.prettierrc.yml !/.npmrc !/test/ !/tsconfig.dev.json !/src/ /lib /dist/ -!/.eslintrc.json +!/.eslintrc.yml .jsii tsconfig.json !/API.md diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..3385eb82 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 00000000..291e7f6e --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,6 @@ +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + +insertPragma: true +printWidth: 120 +singleQuote: true +overrides: [] diff --git a/.projen/deps.json b/.projen/deps.json index dd66cbe0..6e883086 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -43,6 +43,10 @@ "version": "10.0.46", "type": "build" }, + { + "name": "eslint-config-prettier", + "type": "build" + }, { "name": "eslint-import-resolver-node", "type": "build" @@ -55,6 +59,10 @@ "name": "eslint-plugin-import", "type": "build" }, + { + "name": "eslint-plugin-prettier", + "type": "build" + }, { "name": "eslint", "version": "^8", @@ -97,6 +105,10 @@ "version": "^16", "type": "build" }, + { + "name": "prettier", + "type": "build" + }, { "name": "projen", "type": "build" diff --git a/.projen/files.json b/.projen/files.json index 5386a417..8350b3c1 100644 --- a/.projen/files.json +++ b/.projen/files.json @@ -1,6 +1,6 @@ { "files": [ - ".eslintrc.json", + ".eslintrc.yml", ".gitattributes", ".github/pull_request_template.md", ".github/workflows/build.yml", @@ -10,6 +10,8 @@ ".gitignore", ".mergify.yml", ".npmrc", + ".prettierignore", + ".prettierrc.yml", ".projen/deps.json", ".projen/files.json", ".projen/tasks.json", diff --git a/.projen/tasks.json b/.projen/tasks.json index 62dd29a2..69a49878 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -275,13 +275,13 @@ "exec": "yarn upgrade npm-check-updates" }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws-cdk/integ-runner,@aws-cdk/integ-tests-alpha,@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,cdklabs-projen-project-types,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest-junit,jest,jsii-diff,jsii-docgen,jsii-pacmak,npm-check-updates,projen,standard-version,ts-jest,ts-node,typescript,decamelize,fast-json-patch,yaml,aws-cdk-lib,constructs" + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws-cdk/integ-runner,@aws-cdk/integ-tests-alpha,@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,cdklabs-projen-project-types,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,jest-junit,jest,jsii-diff,jsii-docgen,jsii-pacmak,npm-check-updates,prettier,projen,standard-version,ts-jest,ts-node,typescript,decamelize,fast-json-patch,yaml,aws-cdk-lib,constructs" }, { "exec": "yarn install --check-files" }, { - "exec": "yarn upgrade @aws-cdk/integ-runner @aws-cdk/integ-tests-alpha @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser cdklabs-projen-project-types eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest-junit jest jsii-diff jsii-docgen jsii-pacmak npm-check-updates projen standard-version ts-jest ts-node typescript decamelize fast-json-patch yaml aws-cdk-lib constructs" + "exec": "yarn upgrade @aws-cdk/integ-runner @aws-cdk/integ-tests-alpha @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser cdklabs-projen-project-types eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint jest-junit jest jsii-diff jsii-docgen jsii-pacmak npm-check-updates prettier projen standard-version ts-jest ts-node typescript decamelize fast-json-patch yaml aws-cdk-lib constructs" }, { "exec": "npx projen" diff --git a/.projenrc.ts b/.projenrc.ts index 1b9ff229..bae1d736 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -13,7 +13,7 @@ const project = new AwsCdkConstructLibrary({ cdkVersion: '2.9.0', constructsVersion: '10.0.46', defaultReleaseBranch: 'nextdoor', - repositoryUrl: 'https://github.com/cdklabs/cdk-pipelines-github.git', + repositoryUrl: 'https://github.com/Nextdoor/cdk-pipelines-github.git', bundledDeps: ['decamelize', 'yaml', 'fast-json-patch'], devDeps: [ 'cdklabs-projen-project-types', @@ -33,6 +33,35 @@ const project = new AwsCdkConstructLibrary({ npmDistTag: 'latest', npmRegistryUrl: 'https://npm.pkg.github.com', npmTokenSecret: 'GITHUB_TOKEN', + + /** + * Style + */ + eslintOptions: { + dirs: ['src'], + yaml: true, + }, + prettier: true, + prettierOptions: { + yaml: true, + settings: { + insertPragma: true, + printWidth: 120, + singleQuote: true, + }, + }, + + /** + * Pull Request Formatting + */ + githubOptions: { + // https://projen.io/api/API.html#projen-github-pullrequestlint + pullRequestLintOptions: { + semanticTitleOptions: { + types: ['build', 'chore', 'feat', 'ci', 'docs', 'style', 'refactor', 'perf', 'test', 'fix'], + }, + }, + }, }); // JSII sets this to `false` so we need to be compatible diff --git a/API.md b/API.md index 5c692f0b..4d389eb7 100644 --- a/API.md +++ b/API.md @@ -2318,7 +2318,6 @@ const gitHubWorkflowProps: GitHubWorkflowProps = { ... } | jobSettings | JobSettings | Job level settings that will be applied to all jobs in the workflow, including synth and asset deploy jobs. | | postBuildSteps | JobStep[] | GitHub workflow steps to execute after build. | | preBuildSteps | JobStep[] | GitHub workflow steps to execute before build. | -| preSynthed | boolean | Indicates if the repository already contains a synthesized `cdk.out` directory, in which case we will simply checkout the repo in jobs that require `cdk.out`. | | runner | Runner | The type of runner to run the job on. | | workflowName | string | Name of the workflow. | | workflowPath | string | File path for the GitHub workflow. | @@ -2441,19 +2440,6 @@ GitHub workflow steps to execute before build. --- -##### `preSynthed`Optional - -```typescript -public readonly preSynthed: boolean; -``` - -- *Type:* boolean -- *Default:* false - -Indicates if the repository already contains a synthesized `cdk.out` directory, in which case we will simply checkout the repo in jobs that require `cdk.out`. - ---- - ##### `runner`Optional ```typescript diff --git a/package.json b/package.json index 7126adbe..c421e6c9 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "GitHub Workflows support for CDK Pipelines", "repository": { "type": "git", - "url": "https://github.com/cdklabs/cdk-pipelines-github.git" + "url": "https://github.com/Nextdoor/cdk-pipelines-github.git" }, "scripts": { "build": "npx projen build", @@ -46,9 +46,11 @@ "cdklabs-projen-project-types": "^0.1.163", "constructs": "10.0.46", "eslint": "^8", + "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-node": "^0.3.9", "eslint-import-resolver-typescript": "^2.7.1", "eslint-plugin-import": "^2.28.1", + "eslint-plugin-prettier": "^5.0.0", "jest": "^27", "jest-junit": "^15", "jsii": "1.x", @@ -57,6 +59,7 @@ "jsii-pacmak": "^1.88.0", "jsii-rosetta": "1.x", "npm-check-updates": "^16", + "prettier": "^3.0.3", "projen": "^0.73.6", "standard-version": "^9", "ts-jest": "^27", diff --git a/src/aws-credentials.ts b/src/aws-credentials.ts index dca0f406..4bf6c829 100644 --- a/src/aws-credentials.ts +++ b/src/aws-credentials.ts @@ -58,14 +58,14 @@ class GitHubSecretsProvider extends AwsCredentialsProvider { secretAccessKey: `\${{ secrets.${this.secretAccessKey} }}`, ...(this.sessionToken ? { - sessionToken: `\${{ secrets.${this.sessionToken} }}`, - } + sessionToken: `\${{ secrets.${this.sessionToken} }}`, + } : undefined), ...(assumeRoleArn ? { - roleToAssume: assumeRoleArn, - roleExternalId: 'Pipeline', - } + roleToAssume: assumeRoleArn, + roleExternalId: 'Pipeline', + } : undefined), }), ]; diff --git a/src/github-common.ts b/src/github-common.ts index db33491f..1be0cdb7 100644 --- a/src/github-common.ts +++ b/src/github-common.ts @@ -1,3 +1,5 @@ +/** @format */ + import { AddStageOpts } from 'aws-cdk-lib/pipelines'; import { JobSettings } from './pipeline'; import { StackCapabilities } from './stage-options'; diff --git a/src/json-patch.ts b/src/json-patch.ts index 162e33b8..a9f508c0 100644 --- a/src/json-patch.ts +++ b/src/json-patch.ts @@ -1,3 +1,5 @@ +/** @format */ + // copied from https://github.com/cdk8s-team/cdk8s-core/blob/6b317a7a6a2504e228bc56bf96fc98829f88c2be/src/json-patch.ts // under Apache 2.0 license import { applyPatch, Operation } from 'fast-json-patch'; diff --git a/src/oidc-provider.ts b/src/oidc-provider.ts index 6d54415e..792a9bb5 100644 --- a/src/oidc-provider.ts +++ b/src/oidc-provider.ts @@ -1,3 +1,5 @@ +/** @format */ + import { Aws, CfnOutput } from 'aws-cdk-lib'; import * as iam from 'aws-cdk-lib/aws-iam'; import { Construct } from 'constructs'; @@ -99,11 +101,13 @@ export class GitHubActionRole extends Construct { const providerUrl = `https://${rawEndpoint}`; // uses the given provider or creates a new one. - const provider = props.provider ?? new iam.OpenIdConnectProvider(this, 'github-provider', { - url: providerUrl, - clientIds: ['sts.amazonaws.com'], - thumbprints: props.thumbprints ?? GITHUB_OIDC_THUMBPRINTS, - }); + const provider = + props.provider ?? + new iam.OpenIdConnectProvider(this, 'github-provider', { + url: providerUrl, + clientIds: ['sts.amazonaws.com'], + thumbprints: props.thumbprints ?? GITHUB_OIDC_THUMBPRINTS, + }); // create a role that references the provider as a trusted entity const principal = new iam.FederatedPrincipal( @@ -123,12 +127,7 @@ export class GitHubActionRole extends Construct { resources: ['*'], conditions: { 'ForAnyValue:StringEquals': { - 'iam:ResourceTag/aws-cdk:bootstrap-role': [ - 'deploy', - 'lookup', - 'file-publishing', - 'image-publishing', - ], + 'iam:ResourceTag/aws-cdk:bootstrap-role': ['deploy', 'lookup', 'file-publishing', 'image-publishing'], }, }, }); @@ -163,4 +162,4 @@ function formatRepos(repos: string[]) { formattedRepos.push(`repo:${repo}:*`); } return formattedRepos; -} \ No newline at end of file +} diff --git a/src/pipeline.ts b/src/pipeline.ts index 5466e505..15474502 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -69,14 +69,6 @@ export interface GitHubWorkflowProps extends PipelineBaseProps { */ readonly cdkCliVersion?: string; - /** - * Indicates if the repository already contains a synthesized `cdk.out` directory, in which - * case we will simply checkout the repo in jobs that require `cdk.out`. - * - * @default false - */ - readonly preSynthed?: boolean; - /** * Configure provider for AWS credentials used for deployment. * @@ -146,12 +138,12 @@ export class GitHubWorkflow extends PipelineBase { private readonly jobOutputs: Record = {}; private readonly runner: github.Runner; private readonly stackProperties: Record< - string, - { - environment: AddGitHubStageOptions['gitHubEnvironment']; - capabilities: AddGitHubStageOptions['stackCapabilities']; - settings: AddGitHubStageOptions['jobSettings']; - } + string, + { + environment: AddGitHubStageOptions['gitHubEnvironment']; + capabilities: AddGitHubStageOptions['stackCapabilities']; + settings: AddGitHubStageOptions['jobSettings']; + } > = {}; private readonly jobSettings?: JobSettings; // in order to keep track of if this pipeline has been built so we can @@ -401,9 +393,8 @@ export class GitHubWorkflow extends PipelineBase { default: // The 'as any' is temporary, until the change upstream rolls out throw new Error( - `GitHubWorfklow does not support graph nodes of type '${ - (node.data as any)?.type - }'. You are probably using a feature this CDK Pipelines implementation does not support.`, + `GitHubWorfklow does not support graph nodes of type '${(node.data as any) + ?.type}'. You are probably using a feature this CDK Pipelines implementation does not support.`, ); } } @@ -475,11 +466,11 @@ export class GitHubWorkflow extends PipelineBase { const installSteps = step.installCommands.length > 0 ? [ - { - name: 'Install', - run: step.installCommands.join('\n'), - }, - ] + { + name: 'Install', + run: step.installCommands.join('\n'), + }, + ] : []; return { @@ -514,8 +505,8 @@ export class GitHubWorkflow extends PipelineBase { name: 'Upload', uses: 'actions/upload-artifact@v3', with: { - 'name': 'source', - 'path': '/tmp/workspace.tgz', + name: 'source', + path: '/tmp/workspace.tgz', 'if-no-files-found': 'error', }, }, @@ -586,11 +577,11 @@ export class GitHubWorkflow extends PipelineBase { const installSteps = step.installCommands.length > 0 ? [ - { - name: 'Install', - run: step.installCommands.join('\n'), - }, - ] + { + name: 'Install', + run: step.installCommands.join('\n'), + }, + ] : []; return { diff --git a/src/private/aws-credentials.ts b/src/private/aws-credentials.ts index d2602811..addc2a26 100644 --- a/src/private/aws-credentials.ts +++ b/src/private/aws-credentials.ts @@ -77,9 +77,9 @@ export function awsCredentialStep(stepName: string, props: AwsCredentialsStepPro params['aws-region'] = props.region; (params['role-duration-seconds'] = props.sessionDuration || DEFAULT_SESSION_DURATION), - // Session tagging requires the role to have `sts:TagSession` permissions, - // which CDK bootstrapped roles do not currently have. - (params['role-skip-session-tagging'] = props.roleSkipSessionTagging ?? true); + // Session tagging requires the role to have `sts:TagSession` permissions, + // which CDK bootstrapped roles do not currently have. + (params['role-skip-session-tagging'] = props.roleSkipSessionTagging ?? true); params['aws-access-key-id'] = props.accessKeyId; params['aws-secret-access-key'] = props.secretAccessKey; diff --git a/src/stage-options.ts b/src/stage-options.ts index 0eb049d7..a3145b7f 100644 --- a/src/stage-options.ts +++ b/src/stage-options.ts @@ -1,8 +1,10 @@ /** * Acknowledge IAM resources in AWS CloudFormation templates. * + * @format * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities */ + export enum StackCapabilities { /** Acknowledge your stack includes IAM resources */ IAM = 'CAPABILITY_IAM', diff --git a/src/stage.ts b/src/stage.ts index 94da37fe..35dd8181 100644 --- a/src/stage.ts +++ b/src/stage.ts @@ -1,3 +1,5 @@ +/** @format */ + import { Stage, StageProps } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { GitHubCommonProps } from './github-common'; diff --git a/src/steps/github-action-step.ts b/src/steps/github-action-step.ts index e5bfa414..cf1a747f 100644 --- a/src/steps/github-action-step.ts +++ b/src/steps/github-action-step.ts @@ -1,3 +1,5 @@ +/** @format */ + import { Step } from 'aws-cdk-lib/pipelines'; import { JobStep } from '../workflows-model'; diff --git a/src/wave.ts b/src/wave.ts index 617cd5b1..100909ab 100644 --- a/src/wave.ts +++ b/src/wave.ts @@ -1,3 +1,5 @@ +/** @format */ + import { Stage } from 'aws-cdk-lib'; import { AddStageOpts, StageDeployment, Wave, WaveProps } from 'aws-cdk-lib/pipelines'; import { AddGitHubStageOptions } from './github-common'; @@ -13,7 +15,6 @@ import { GitHubWorkflow } from './pipeline'; */ export class GitHubWave extends Wave { - /** * Create with `GitHubWorkflow.addWave()` or `GitHubWorkflow.addGitHubWave()`. * You should not have to instantiate a GitHubWave yourself. @@ -44,10 +45,7 @@ export class GitHubWave extends Wave { * It will be deployed in parallel with all other stages in this * wave. */ - public addStageWithGitHubOptions( - stage: Stage, - options?: AddGitHubStageOptions, - ): StageDeployment { + public addStageWithGitHubOptions(stage: Stage, options?: AddGitHubStageOptions): StageDeployment { const stageDeployment = super.addStage(stage, options); this.pipeline._addStageFromWave(stage, stageDeployment, options); return stageDeployment; diff --git a/src/workflows-model.ts b/src/workflows-model.ts index dad05bf1..7e012edc 100644 --- a/src/workflows-model.ts +++ b/src/workflows-model.ts @@ -1,3 +1,5 @@ +/** @format */ + // @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions /** @@ -131,7 +133,6 @@ export interface Job { * cycle of the service containers. */ readonly services?: Record; - } /** @@ -435,7 +436,6 @@ export interface ContainerCredentials { readonly password: string; } - /** * The set of available triggers for GitHub Workflows. * @@ -708,7 +708,24 @@ export interface IssuesOptions { * * @defaults - all activity types */ - readonly types?: Array<'opened' | 'edited' | 'deleted' | 'transferred' | 'pinned' | 'unpinned' | 'closed' | 'reopened' | 'assigned' | 'unassigned' | 'labeled' | 'unlabeled' | 'locked' | 'unlocked' | 'milestoned' | 'demilestoned'>; + readonly types?: Array< + | 'opened' + | 'edited' + | 'deleted' + | 'transferred' + | 'pinned' + | 'unpinned' + | 'closed' + | 'reopened' + | 'assigned' + | 'unassigned' + | 'labeled' + | 'unlabeled' + | 'locked' + | 'unlocked' + | 'milestoned' + | 'demilestoned' + >; } /** @@ -780,7 +797,22 @@ export interface PullRequestOptions { * * @defaults - all activity types */ - readonly types?: Array<'assigned' | 'unassigned' | 'labeled' | 'unlabeled' | 'opened' | 'edited' | 'closed' | 'reopened' | 'synchronize' | 'ready_for_review' | 'locked' | 'unlocked' | 'review_requested' | 'review_request_removed'>; + readonly types?: Array< + | 'assigned' + | 'unassigned' + | 'labeled' + | 'unlabeled' + | 'opened' + | 'edited' + | 'closed' + | 'reopened' + | 'synchronize' + | 'ready_for_review' + | 'locked' + | 'unlocked' + | 'review_requested' + | 'review_request_removed' + >; } /** @@ -816,7 +848,22 @@ export interface PullRequestTargetOptions extends PushOptions { * * @defaults - all activity types */ - readonly types?: Array<'assigned' | 'unassigned' | 'labeled' | 'unlabeled' | 'opened' | 'edited' | 'closed' | 'reopened' | 'synchronize' | 'ready_for_review' | 'locked' | 'unlocked' | 'review_requested' | 'review_request_removed'>; + readonly types?: Array< + | 'assigned' + | 'unassigned' + | 'labeled' + | 'unlabeled' + | 'opened' + | 'edited' + | 'closed' + | 'reopened' + | 'synchronize' + | 'ready_for_review' + | 'locked' + | 'unlocked' + | 'review_requested' + | 'review_request_removed' + >; } /** @@ -834,7 +881,6 @@ export interface PushOptions { */ readonly branches?: string[]; - /** * When using the push and pull_request events, you can configure a workflow * to run on specific branches or tags. For a pull_request event, only @@ -909,50 +955,50 @@ export interface WorkflowRunOptions { /** * The Workflow dispatch event accepts no options. */ -export interface WorkflowDispatchOptions { } +export interface WorkflowDispatchOptions {} /** * The Create event accepts no options. */ -export interface CreateOptions { } +export interface CreateOptions {} /** * The Delete event accepts no options. */ -export interface DeleteOptions { } +export interface DeleteOptions {} /** * The Deployment event accepts no options. */ -export interface DeploymentOptions { } +export interface DeploymentOptions {} /** * The Deployment status event accepts no options. */ -export interface DeploymentStatusOptions { } +export interface DeploymentStatusOptions {} /** * The Fork event accepts no options. */ -export interface ForkOptions { } +export interface ForkOptions {} /** * The Gollum event accepts no options. */ -export interface GollumOptions { } +export interface GollumOptions {} /** * The Page build event accepts no options. */ -export interface PageBuildOptions { } +export interface PageBuildOptions {} /** * The Public event accepts no options. */ -export interface PublicOptions { } +export interface PublicOptions {} /** * The Status event accepts no options. */ -export interface StatusOptions { } +export interface StatusOptions {} //#endregion diff --git a/src/yaml-file.ts b/src/yaml-file.ts index 7136aafe..9ef8d331 100644 --- a/src/yaml-file.ts +++ b/src/yaml-file.ts @@ -1,3 +1,5 @@ +/** @format */ + import { writeFileSync } from 'fs'; import * as YAML from 'yaml'; import { JsonPatch } from './json-patch'; @@ -129,7 +131,10 @@ Generated by AWS CDK and [cdk-pipelines-github](https://github.com/cdklabs/cdk-p return yamlDoc.toString({ commentString: (comment) => - comment.split('\n').map((x) => x == '' ? '' : `# ${x}`).join('\n'), + comment + .split('\n') + .map((x) => (x == '' ? '' : `# ${x}`)) + .join('\n'), indent: 2, }); } diff --git a/test/example-app.ts b/test/example-app.ts index 5d6d92d0..7fb5609a 100644 --- a/test/example-app.ts +++ b/test/example-app.ts @@ -70,7 +70,6 @@ export class GitHubExampleApp extends App { commands: ['echo "nothing to do (cdk.out is committed)"'], }), workflowPath: path.join(workflowsDir, 'deploy.yml'), - preSynthed: true, buildContainer: { image: 'alpine' }, preBuildSteps: [ { diff --git a/test/manual-test.ts b/test/manual-test.ts index 76919da8..3007f3ca 100644 --- a/test/manual-test.ts +++ b/test/manual-test.ts @@ -1,3 +1,5 @@ +/** @format */ + // This is a CDK app that uses CDK Pipelines with a GitHub workflows backend. It // is intended to be executed from the root directory of a GitHub repository and // it will synthesize a `cdk.out` and `.github/workflows` directory, both of which diff --git a/test/oidc-provider.test.ts b/test/oidc-provider.test.ts index f8ced2ff..0ab2e8a5 100644 --- a/test/oidc-provider.test.ts +++ b/test/oidc-provider.test.ts @@ -1,3 +1,5 @@ +/** @format */ + import { Stack } from 'aws-cdk-lib'; import { Template } from 'aws-cdk-lib/assertions'; import { GitHubActionRole } from '../src'; @@ -16,7 +18,6 @@ describe('GithubActionRole construct', () => { // has custom resource that creates provider Template.fromStack(stack).resourceCountIs('Custom::AWSCDKOpenIdConnectProvider', 1); - // has iam role Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { AssumeRolePolicyDocument: { @@ -45,18 +46,13 @@ describe('GithubActionRole construct', () => { // WHEN new GitHubActionRole(stack, 'MyProvider', { - repos: [ - 'myuser/myrepo', - 'myuser/myrepo2', - 'myuser/myrepo3', - ], + repos: ['myuser/myrepo', 'myuser/myrepo2', 'myuser/myrepo3'], }); // THEN // has custom resource that creates provider Template.fromStack(stack).resourceCountIs('Custom::AWSCDKOpenIdConnectProvider', 1); - // has iam role Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { AssumeRolePolicyDocument: { @@ -139,29 +135,34 @@ describe('GithubActionRole construct', () => { // THEN Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { - Policies: [{ - PolicyDocument: { - Statement: [{ - Action: 'sts:AssumeRole', - Resource: '*', - Effect: 'Allow', - Condition: { - 'ForAnyValue:StringEquals': { - 'iam:ResourceTag/aws-cdk:bootstrap-role': [ - 'deploy', - 'lookup', - 'file-publishing', - 'image-publishing', - ], + Policies: [ + { + PolicyDocument: { + Statement: [ + { + Action: 'sts:AssumeRole', + Resource: '*', + Effect: 'Allow', + Condition: { + 'ForAnyValue:StringEquals': { + 'iam:ResourceTag/aws-cdk:bootstrap-role': [ + 'deploy', + 'lookup', + 'file-publishing', + 'image-publishing', + ], + }, + }, }, - }, - }, { - Action: 'ecr:GetAuthorizationToken', - Resource: '*', - Effect: 'Allow', - }], + { + Action: 'ecr:GetAuthorizationToken', + Resource: '*', + Effect: 'Allow', + }, + ], + }, }, - }], + ], }); }); }); diff --git a/test/runner-provided.test.ts b/test/runner-provided.test.ts index 4a4f144c..beda94b5 100644 --- a/test/runner-provided.test.ts +++ b/test/runner-provided.test.ts @@ -1,3 +1,5 @@ +/** @format */ + import { readFileSync } from 'fs'; import { Stack, Stage } from 'aws-cdk-lib'; import { ShellStep } from 'aws-cdk-lib/pipelines'; diff --git a/test/stage-options.test.ts b/test/stage-options.test.ts index d795ac91..c9eadba8 100644 --- a/test/stage-options.test.ts +++ b/test/stage-options.test.ts @@ -1,3 +1,5 @@ +/** @format */ + import { readFileSync } from 'fs'; import { Stack, Stage } from 'aws-cdk-lib'; import { ShellStep } from 'aws-cdk-lib/pipelines'; @@ -47,9 +49,7 @@ describe('github environment', () => { app.synth(); - expect(readFileSync(pipeline.workflowPath, 'utf-8')).toContain( - 'environment: test\n', - ); + expect(readFileSync(pipeline.workflowPath, 'utf-8')).toContain('environment: test\n'); }); }); @@ -158,11 +158,7 @@ describe('cloudformation stack capabilities', () => { new Stack(stage, 'MyStack'); pipeline.addStageWithGitHubOptions(stage, { - stackCapabilities: [ - StackCapabilities.NAMED_IAM, - StackCapabilities.IAM, - StackCapabilities.AUTO_EXPAND, - ], + stackCapabilities: [StackCapabilities.NAMED_IAM, StackCapabilities.IAM, StackCapabilities.AUTO_EXPAND], }); app.synth(); @@ -229,12 +225,8 @@ describe('job settings', () => { app.synth(); const workflowFileContents = readFileSync(pipeline.workflowPath, 'utf-8'); - expect(workflowFileContents).toContain( - "if: github.repository == 'another/repoA'\n", - ); - expect(workflowFileContents).toContain( - "if: github.repository == 'github/repoB'\n", - ); + expect(workflowFileContents).toContain("if: github.repository == 'another/repoA'\n"); + expect(workflowFileContents).toContain("if: github.repository == 'github/repoB'\n"); }); }); }); @@ -270,7 +262,7 @@ test('can set pre/post github action job step', () => { uses: 'my-pre-deploy-action@1.0.0', with: { 'app-id': 1234, - 'secrets': 'my-secrets', + secrets: 'my-secrets', }, }, ], @@ -289,7 +281,7 @@ test('can set pre/post github action job step', () => { uses: 'my-post-deploy-action@1.0.0', with: { 'app-id': 4321, - 'secrets': 'secrets', + secrets: 'secrets', }, }, ], @@ -304,12 +296,8 @@ test('can set pre/post github action job step', () => { expect(workflowFileContents).toContain('my-pre-deploy-action@1.0.0'); expect(workflowFileContents).toContain('my-post-deploy-action@1.0.0'); expect(workflowFileContents).toContain('actions/checkout@v3'); - expect(workflowFileContents).toContain( - 'contains(fromJson(\'["push", "pull_request"]\'), github.event_name)', - ); - expect(workflowFileContents).toContain( - "success() && contains(github.event.issue.labels.*.name, 'deploy')", - ); + expect(workflowFileContents).toContain('contains(fromJson(\'["push", "pull_request"]\'), github.event_name)'); + expect(workflowFileContents).toContain("success() && contains(github.event.issue.labels.*.name, 'deploy')"); }); }); @@ -416,7 +404,7 @@ test('github stages in waves works', () => { uses: 'my-pre-wave-action@1.0.0', with: { 'app-id': 1234, - 'secrets': 'my-secrets', + secrets: 'my-secrets', }, }, ], @@ -435,7 +423,7 @@ test('github stages in waves works', () => { uses: 'my-post-wave-action@1.0.0', with: { 'app-id': 4321, - 'secrets': 'secrets', + secrets: 'secrets', }, }, ], @@ -543,7 +531,9 @@ test('stages added to a pipeline after build will fail', () => { app.synth(); - expect(() => pipeline.addStage(stageB)).toThrowErrorMatchingInlineSnapshot('"addStage: can\'t add Stages anymore after buildPipeline() has been called"'); + expect(() => pipeline.addStage(stageB)).toThrowErrorMatchingInlineSnapshot( + '"addStage: can\'t add Stages anymore after buildPipeline() has been called"', + ); }); }); @@ -572,6 +562,8 @@ test('waves added to a pipeline after build will fail', () => { app.synth(); - expect(() => pipeline.addGitHubWave('wave2')).toThrowErrorMatchingInlineSnapshot('"addWave: can\'t add Waves anymore after buildPipeline() has been called"'); + expect(() => pipeline.addGitHubWave('wave2')).toThrowErrorMatchingInlineSnapshot( + '"addWave: can\'t add Waves anymore after buildPipeline() has been called"', + ); }); }); diff --git a/test/testutil.ts b/test/testutil.ts index b693d389..11511491 100644 --- a/test/testutil.ts +++ b/test/testutil.ts @@ -1,4 +1,9 @@ -/* eslint-disable import/no-extraneous-dependencies */ +/** + * eslint-disable import/no-extraneous-dependencies + * + * @format + */ + import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; @@ -27,7 +32,9 @@ export class TestApp extends App { */ export function stackTemplate(stack: Stack) { const stage = Stage.of(stack); - if (!stage) { throw new Error('stack not in a Stage'); } + if (!stage) { + throw new Error('stack not in a Stage'); + } return stage.synth().getStackArtifact(stack.artifactId); } @@ -38,4 +45,4 @@ export function withTemporaryDirectory(callback: (dir: string) => T): T { } finally { fs.rmSync(tmpdir, { recursive: true }); } -} \ No newline at end of file +} diff --git a/test/yaml-file.test.ts b/test/yaml-file.test.ts index ba9f707e..4e8ca882 100644 --- a/test/yaml-file.test.ts +++ b/test/yaml-file.test.ts @@ -1,3 +1,5 @@ +/** @format */ + import { readFileSync } from 'fs'; import * as path from 'path'; import * as YAML from 'yaml'; @@ -76,7 +78,6 @@ describe('patch', () => { }); }); - describe('yaml file comments', () => { function commentTest(commentAtTop: string | undefined, initialObj: any, assetDoc: string) { withTemporaryDirectory((dir) => { @@ -94,11 +95,7 @@ describe('yaml file comments', () => { test('comment at top works', () => { const commentBeforeYaml = 'commentAtTopTest.yml'; - commentTest( - 'Comment before', - { first: { second: { array: ['0'] } } }, - commentBeforeYaml, - ); + commentTest('Comment before', { first: { second: { array: ['0'] } } }, commentBeforeYaml); }); test('multi-line comments work', () => { diff --git a/yarn.lock b/yarn.lock index 69e3409b..729ce77c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -752,6 +752,18 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@pkgr/utils@^2.3.1": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@pkgr/utils/-/utils-2.4.2.tgz#9e638bbe9a6a6f165580dc943f138fd3309a2cbc" + integrity sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw== + dependencies: + cross-spawn "^7.0.3" + fast-glob "^3.3.0" + is-glob "^4.0.3" + open "^9.1.0" + picocolors "^1.0.0" + tslib "^2.6.0" + "@pnpm/config.env-replace@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz#ab29da53df41e8948a00f2433f085f54de8b3a4c" @@ -1472,6 +1484,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +big-integer@^1.6.44: + version "1.6.51" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" + integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== + boxen@^7.0.0: version "7.1.1" resolved "https://registry.yarnpkg.com/boxen/-/boxen-7.1.1.tgz#f9ba525413c2fec9cdb88987d835c4f7cad9c8f4" @@ -1486,6 +1503,13 @@ boxen@^7.0.0: widest-line "^4.0.1" wrap-ansi "^8.1.0" +bplist-parser@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.2.0.tgz#43a9d183e5bf9d545200ceac3e712f79ebbe8d0e" + integrity sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw== + dependencies: + big-integer "^1.6.44" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -1549,6 +1573,13 @@ builtins@^5.0.0: dependencies: semver "^7.0.0" +bundle-name@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bundle-name/-/bundle-name-3.0.0.tgz#ba59bcc9ac785fb67ccdbf104a2bf60c099f0e1a" + integrity sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw== + dependencies: + run-applescript "^5.0.0" + cacache@^17.0.0: version "17.1.4" resolved "https://registry.yarnpkg.com/cacache/-/cacache-17.1.4.tgz#b3ff381580b47e85c6e64f801101508e26604b35" @@ -2156,11 +2187,34 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== +default-browser-id@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/default-browser-id/-/default-browser-id-3.0.0.tgz#bee7bbbef1f4e75d31f98f4d3f1556a14cea790c" + integrity sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA== + dependencies: + bplist-parser "^0.2.0" + untildify "^4.0.0" + +default-browser@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/default-browser/-/default-browser-4.0.0.tgz#53c9894f8810bf86696de117a6ce9085a3cbc7da" + integrity sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA== + dependencies: + bundle-name "^3.0.0" + default-browser-id "^3.0.0" + execa "^7.1.1" + titleize "^3.0.0" + defer-to-connect@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== +define-lazy-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz#dbb19adfb746d7fc6d734a06b72f4a00d021255f" + integrity sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg== + define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" @@ -2419,6 +2473,11 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" +eslint-config-prettier@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f" + integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw== + eslint-import-resolver-node@^0.3.7, eslint-import-resolver-node@^0.3.9: version "0.3.9" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" @@ -2469,6 +2528,14 @@ eslint-plugin-import@^2.28.1: semver "^6.3.1" tsconfig-paths "^3.14.2" +eslint-plugin-prettier@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz#6887780ed95f7708340ec79acfdf60c35b9be57a" + integrity sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w== + dependencies: + prettier-linter-helpers "^1.0.0" + synckit "^0.8.5" + eslint-scope@^7.2.2: version "7.2.2" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" @@ -2578,6 +2645,21 @@ execa@^5.0.0: signal-exit "^3.0.3" strip-final-newline "^2.0.0" +execa@^7.1.1: + version "7.2.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-7.2.0.tgz#657e75ba984f42a70f38928cedc87d6f2d4fe4e9" + integrity sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.1" + human-signals "^4.3.0" + is-stream "^3.0.0" + merge-stream "^2.0.0" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^3.0.7" + strip-final-newline "^3.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -2603,7 +2685,12 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.2.9, fast-glob@^3.3.1: +fast-diff@^1.1.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" + integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== + +fast-glob@^3.2.9, fast-glob@^3.3.0, fast-glob@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== @@ -3217,6 +3304,11 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +human-signals@^4.3.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-4.3.1.tgz#ab7f811e851fca97ffbd2c1fe9a958964de321b2" + integrity sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ== + humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -3383,6 +3475,16 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" +is-docker@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== + +is-docker@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-3.0.0.tgz#90093aa3106277d8a77a5910dbae71747e15a200" + integrity sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ== + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -3405,6 +3507,13 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: dependencies: is-extglob "^2.1.1" +is-inside-container@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-inside-container/-/is-inside-container-1.0.0.tgz#e81fba699662eb31dbdaf26766a61d4814717ea4" + integrity sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA== + dependencies: + is-docker "^3.0.0" + is-installed-globally@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" @@ -3480,6 +3589,11 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== +is-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-3.0.0.tgz#e6bfd7aa6bef69f4f472ce9bb681e3e57b4319ac" + integrity sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== + is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" @@ -3520,6 +3634,13 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" +is-wsl@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + is-yarn-global@^0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.4.1.tgz#b312d902b313f81e4eaf98b6361ba2b45cd694bb" @@ -4527,6 +4648,11 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +mimic-fn@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" + integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== + mimic-response@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" @@ -4861,6 +4987,13 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" +npm-run-path@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.1.0.tgz#bc62f7f3f6952d9894bd08944ba011a6ee7b7e00" + integrity sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q== + dependencies: + path-key "^4.0.0" + npmlog@^6.0.0: version "6.0.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-6.0.2.tgz#c8166017a42f2dea92d6453168dd865186a70830" @@ -4938,11 +5071,28 @@ onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" +onetime@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-6.0.0.tgz#7c24c18ed1fd2e9bca4bd26806a33613c77d34b4" + integrity sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ== + dependencies: + mimic-fn "^4.0.0" + oo-ascii-tree@^1.88.0: version "1.88.0" resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.88.0.tgz#3ed84cdcaab9e5b7970fcfc2d086c2c069db65b7" integrity sha512-A7m3z7XlUD3DnXSYxWmAdKQTIY6+1JzWS0lhaqgPGhj6g7a/odCsV1ctaRnjJljCB3zQBrbp2QHdYTUsD9AXcQ== +open@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/open/-/open-9.1.0.tgz#684934359c90ad25742f5a26151970ff8c6c80b6" + integrity sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg== + dependencies: + default-browser "^4.0.0" + define-lazy-prop "^3.0.0" + is-inside-container "^1.0.0" + is-wsl "^2.2.0" + optionator@^0.9.3: version "0.9.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" @@ -5115,6 +5265,11 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== +path-key@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-4.0.0.tgz#295588dc3aee64154f877adb9d780b81c554bf18" + integrity sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== + path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" @@ -5177,6 +5332,18 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" + integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== + pretty-format@^27.0.0, pretty-format@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" @@ -5532,6 +5699,13 @@ rimraf@^5.0.1: dependencies: glob "^10.2.5" +run-applescript@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/run-applescript/-/run-applescript-5.0.0.tgz#e11e1c932e055d5c6b40d98374e0268d9b11899c" + integrity sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg== + dependencies: + execa "^5.0.0" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -5957,6 +6131,11 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== +strip-final-newline@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" + integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== + strip-indent@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" @@ -6018,6 +6197,14 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== +synckit@^0.8.5: + version "0.8.5" + resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.5.tgz#b7f4358f9bb559437f9f167eb6bc46b3c9818fa3" + integrity sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q== + dependencies: + "@pkgr/utils" "^2.3.1" + tslib "^2.5.0" + tar@^6.1.11, tar@^6.1.2: version "6.1.15" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.15.tgz#c9738b0b98845a3b344d334b8fa3041aaba53a69" @@ -6082,6 +6269,11 @@ through@2, "through@>=2.2.7 <3": resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== +titleize@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/titleize/-/titleize-3.0.0.tgz#71c12eb7fdd2558aa8a44b0be83b8a76694acd53" + integrity sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ== + tmpl@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" @@ -6169,6 +6361,11 @@ tsconfig-paths@^3.14.1, tsconfig-paths@^3.14.2: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@^2.5.0, tslib@^2.6.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + tuf-js@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-1.1.7.tgz#21b7ae92a9373015be77dfe0cb282a80ec3bbe43"