@xpertss/projen-types 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +28 -138
- package/API.md +3 -305
- package/README.md +16 -1
- package/lib/actions/action-build-workflow.js +1 -1
- package/lib/actions/action-dogfood-workflow.js +1 -1
- package/lib/actions/action-sonar-workflow.js +1 -1
- package/lib/actions/github-action-project.d.ts +4 -4
- package/lib/actions/github-action-project.js +5 -7
- package/lib/cdk/app-runtime-scaffold.js +1 -1
- package/lib/cdk/cdk-app-project.js +1 -1
- package/lib/cdk/cdk-infra-project.js +1 -1
- package/lib/cdk/cdk-typescript-base.js +2 -4
- package/lib/cdk/components/ecr-ecs-constructs.js +1 -1
- package/lib/cdk/components/edge-networking-constructs.js +1 -1
- package/lib/cdk/database-component.js +1 -1
- package/lib/common/internal-actions.d.ts +7 -4
- package/lib/common/internal-actions.js +27 -10
- package/lib/common/manual-deploy-workflow.js +2 -2
- package/lib/common/projen-drift-check-workflow.js +4 -4
- package/lib/common/workflow-change-notice-workflow.js +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -2
- package/lib/java/components/cdk-deploy-hook.js +1 -1
- package/lib/java/components/code-index-workflow.js +1 -1
- package/lib/java/components/docker-publish.js +1 -1
- package/lib/java/components/flyway-migration.js +1 -1
- package/lib/java/components/github-packages-publish.js +1 -1
- package/lib/java/components/maven-central-publish.js +1 -1
- package/lib/java/java-app-project.js +1 -1
- package/lib/java/java-library-project.js +1 -1
- package/lib/java/java-maven-base.js +2 -4
- package/lib/java/java-service-project.js +1 -1
- package/package.json +1 -1
- package/lib/common/actions-allowlist-guard.d.ts +0 -37
- package/lib/common/actions-allowlist-guard.js +0 -72
package/.jsii
CHANGED
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
},
|
|
107
107
|
"name": "@xpertss/projen-types",
|
|
108
108
|
"readme": {
|
|
109
|
-
"markdown": "# @xpertss/projen-types\n\nProjen project types for CDK/TypeScript and Java/Maven projects.\n\nInstead of hand-maintaining `pom.xml`, `cdk.json`, and GitHub workflows, you declare a project type in a `.projenrc.ts` file and let [projen](https://github.com/projen/projen) generate (and keep up to date) the whole scaffold: build files, source skeletons, CI workflows, and deploy pipelines.\n\n## Project types at a glance\n\n| Type | What it is | Publishes to | Generated workflows |\n| --- | --- | --- | --- |\n| `CdkInfraProject` | Pure-infrastructure CDK stacks (CloudFront, Route53, SQS, API Gateway, Cognito, ECR/ECS for externally-built images) | - | `build` (PR checks), `deploy` (manual dispatch) |\n| `CdkAppProject` | Full TypeScript service behind API Gateway: infra + app source + database | - | `build`, `deploy`, `app-build` (PR checks) |\n| `JavaLibraryProject` | Reusable Java library | Maven Central | `build`, `upgrade` (nightly), `publish-maven-central`, `codeindex` |\n| `JavaServiceProject` | Spring Boot service | Docker Hub | `build`, `upgrade` (nightly), `publish-docker`, `deploy-cdk` |\n| `JavaAppProject` | GUI/TUI/CLI Java application | GitHub Packages | `build`, `upgrade` (nightly), `publish-ghpackages` |\n| `GitHubActionProject` | Reusable GitHub Action or Workflow | GitHub Releases | `build`, `test-dogfood`, `sonar`, `release` |\n\nTwo foundation classes are also exported for advanced use: `CdkTypescriptProject` (shared CDK + TypeScript base for the CDK types) and `JavaMavenProject` (shared Maven base for the Java types).\n\nAll project types:\n\n- run a **drift check** in PR builds - a job that re-runs projen and fails if generated files were hand-edited. Edit `.projenrc.ts`, then run `npx projen`; never edit generated files directly.\n- use the GitHub secret `PROJEN_GITHUB_TOKEN` (a fine-grained PAT) for projen's automation. Override with `gheTokenSecret`.\n- make all publishing/deploying **manual** (workflow_dispatch) rather than on every merge.\n\n## Getting started\n\nScaffold the repo with projen's own bootstrap, pointed at this package:\n\n```bash\nmkdir my-project && cd my-project\ngit init\nnpx projen new --from @xpertss/projen-types cdk_infra --name my-project\n```\n\nThat writes a starter `.projenrc.ts`, synthesizes the whole scaffold and\ninstalls dependencies. The type names `projen new` accepts are `cdk_infra`,\n`cdk_app`, `java_library`, `java_service`, `java_app` and\n`git_hub_action`; pass a bogus one to have it list them. Required options\nbecome flags: `--name` for every type, plus `--group-id`/`--artifact-id`\n(Java) and `--sonar-host-url` (`git_hub_action`). Any other plainly-typed\noption can be passed the same way - `--cdk-deploy-target-repo owner/repo`,\n`--docker-registry ghcr.io`, `--no-use-flyway`, and so on.\n\nCommit the result. From then on, every change to the scaffold goes through\n`.projenrc.ts` followed by `npx projen`:\n\n```bash\nnpx projen\n```\n\nEvery type scaffolds from that one command; no option is *required* that\n`projen new` cannot pass. The structured options - `environments` and\n`GitHubActionProject`'s `dogfood` - are ones projen's CLI cannot render\ninto a projenrc, so they are added afterwards by editing `.projenrc.ts` and\nre-running `npx projen`. Leaving `environments` out simply generates no\ndeploy workflow; leaving `dogfood` out (or a service's\n`cdkDeployTargetRepo`) still generates the workflow, with one step that\nfails and tells you what to add - a gate this package considers load-bearing\nis allowed to be missing loudly, never silently.\n\nThe `name` option must match the `name` field in the project's `package.json` (for the CDK types) or the project name used by projen's `java.JavaProject` (for the Java types).\n\n## Examples\n\n### CdkInfraProject\n\nPure infrastructure stacks with optional ECR/ECS and edge-networking constructs.\n\n```typescript\n// .projenrc.ts\nimport { CdkInfraProject } from '@xpertss/projen-types';\n\nconst project = new CdkInfraProject({\n name: 'media-edge-infra',\n environments: [\n 'dev',\n { name: 'stage', accountId: '111111111111', region: 'eu-central-1' },\n { name: 'prod', accountId: '222222222222', region: 'eu-central-1', requiresApproval: true },\n ],\n edgeResources: ['cloudfront', 'route53', 'sqs'],\n ecrEcs: { enabled: true, externalImageSource: true },\n slackWebhookSecret: 'SLACK_DEPLOY_WEBHOOK',\n});\n\nproject.synth();\n```\n\nYou get:\n\n- `cdk.json`, `cdk synth` / `cdk diff` / `cdk deploy` tasks, and the standard `AwsCdkTypeScriptApp` layout (CDK 2.189.1 by default).\n- `.github/workflows/build.yml` - PR build that hard-fails on projen drift.\n- `.github/workflows/deploy.yml` - manual dispatch with one `deploy-<env>` job per environment (runs `cdk deploy --all` with `--context environment=<env>`); `requiresApproval` environments get a GitHub Environment approval gate; a Slack notification step is added when `slackWebhookSecret` is set.\n- `src/constructs/edge-networking.ts` - helper constructs only for the requested `edgeResources` (`cloudfront`, `route53`, `apigateway`, `cognito`, `sqs`).\n- `src/constructs/ecr-ecs.ts` when `ecrEcs.enabled` - ECR repo + Fargate service; `externalImageSource: true` (default) means the service pulls an image built outside this repo.\n\n### CdkAppProject\n\n`CdkInfraProject` plus application source, a database construct, and an app-level build workflow.\n\n```typescript\n// .projenrc.ts\nimport { CdkAppProject } from '@xpertss/projen-types';\n\nconst project = new CdkAppProject({\n name: 'video-api',\n environments: ['dev', 'prod'],\n edgeResources: ['apigateway'],\n database: { engine: 'postgres', migrationTool: 'flyway' },\n appEntryPoint: 'src/app.ts',\n});\n\nproject.synth();\n```\n\nEverything from `CdkInfraProject`, plus:\n\n- `src/app.ts` - application entrypoint stub (`export function handler()`).\n- `src/handlers/example.ts` - API Gateway proxy handler stub, with `@types/aws-lambda` added as a dev dependency.\n- `src/constructs/database.ts` - a `Database` construct stub for the chosen engine (`postgres`/`mysql` -> RDS, `dynamodb` -> DynamoDB). `migrationTool` (no default, intentionally) is added as a dev dependency and referenced in the stub - wiring it up is left to you.\n- `.github/workflows/app-build.yml` - runs the project's test task on every PR, then checks for projen drift.\n\n### JavaLibraryProject\n\nA reusable Java library published to Maven Central.\n\n```typescript\n// .projenrc.ts\nimport { JavaLibraryProject } from '@xpertss/projen-types';\n\nconst project = new JavaLibraryProject({\n name: 'common-utils',\n groupId: 'org.xpertss',\n artifactId: 'common-utils',\n version: '1.0.0',\n sonarProjectKey: 'org.xpertss:common-utils',\n mavenCentralOidc: true,\n});\n\nproject.synth();\n```\n\nYou get:\n\n- `pom.xml` (via projen's `java.JavaProject`) with the given GAV coordinates.\n- `.github/workflows/build.yml` - PR build + projen drift check, plus a SonarQube scan step when `sonarProjectKey` is set (needs a `SONAR_TOKEN` secret).\n- `.github/workflows/upgrade.yml` - nightly (03:00 UTC) PR running `mvn versions:use-latest-releases versions:update-properties`.\n- `.github/workflows/publish-maven-central.yml` - manual dispatch running `mvn -B deploy -P release`. With `mavenCentralOidc: true` it uses Maven Central's OIDC trusted publishing (no GPG secrets needed); otherwise it expects the secrets `MAVEN_GPG_PRIVATE_KEY`, `MAVEN_GPG_PASSPHRASE`, `MAVEN_CENTRAL_USERNAME`, `MAVEN_CENTRAL_PASSWORD`.\n- `.github/workflows/codeindex.yml` - on push to `main`, generates a Java source index under `.cai/` (disable with `publishCodeIndex: false`).\n\n### JavaServiceProject\n\nA Spring Boot service that publishes a Docker image and can trigger deploys in a companion CDK repo.\n\n```typescript\n// .projenrc.ts\nimport { JavaServiceProject } from '@xpertss/projen-types';\n\nconst project = new JavaServiceProject({\n name: 'stream-processor',\n groupId: 'org.xpertss',\n artifactId: 'stream-processor',\n dockerRegistry: 'docker.io/xpertss',\n cdkDeployTargetRepo: 'xpertss/stream-infra',\n environments: ['dev', { name: 'prod', requiresApproval: true }],\n});\n\nproject.synth();\n```\n\nYou get (everything from `JavaMavenProject` - `pom.xml`, `build` + drift check, nightly `upgrade` - plus):\n\n- `spring-boot-starter-web` added to the pom.\n- `.github/workflows/publish-docker.yml` - manual dispatch: `mvn -B package && docker build -t <registry>/<name>:<sha>`, logged in with the `DOCKER_USERNAME` / `DOCKER_PASSWORD` secrets. `dockerRegistry` defaults to `docker.io`.\n- Flyway wiring when `useFlyway` (default `true`): `flyway-maven-plugin` ^10 + `flyway-core` ^10 in the pom, and `src/main/resources/db/migration/V1__init.sql`.\n- `.github/workflows/deploy-cdk.yml` (the `CdkDeployHook`, generated by default) - manual dispatch with an environment selector; each job sends a `workflow_dispatch` to `deploy.yml` in the companion `cdkDeployTargetRepo` (a `CdkInfraProject`/`CdkAppProject` repo). With no `cdkDeployTargetRepo` set, the workflow is still generated but each job's only step fails with instructions - it is dispatch-only, so that lands on whoever tries to deploy rather than on every PR. Turn the workflow off entirely with `cdkDeployHook: false`. `environments` defaults to `['prod']`.\n\n### JavaAppProject\n\nA GUI/TUI/CLI Java application published to GitHub Packages only - no Maven Central, no Docker, no CDK deploy hook.\n\n```typescript\n// .projenrc.ts\nimport { JavaAppProject } from '@xpertss/projen-types';\n\nconst project = new JavaAppProject({\n name: 'studio-cli',\n groupId: 'org.xpertss',\n artifactId: 'studio-cli',\n ghPackagesRegistry: 'https://maven.pkg.github.com/xpertss/studio-cli',\n});\n\nproject.synth();\n```\n\nYou get everything from `JavaMavenProject`, plus `.github/workflows/publish-ghpackages.yml` - manual dispatch running `mvn -B deploy -DaltDeploymentRepository=github::<registry>`, authenticated with `GITHUB_TOKEN`. `ghPackagesRegistry` defaults to `https://maven.pkg.github.com/<repo>` derived from the repository URL.\n\n### GitHubActionProject\n\nA reusable GitHub Action or Workflow. This example scaffolds an action that stages a folder and, only if it changed, commits and pushes it.\n\n```typescript\n// .projenrc.ts\nimport { GitHubActionProject } from '@xpertss/projen-types';\n\nconst project = new GitHubActionProject({\n name: 'auto-commit',\n description: 'Stage a folder and, only if it changed, commit and push it',\n sonarHostUrl: 'https://sonarcloud.io', // required, no default - your SonarCloud URL\n dogfood: {\n // Two scenario steps: the \"changed\" path and the \"no-op\" path are both\n // load-bearing behavior for this action (a double-commit or a\n // push-when-empty bug is the failure mode a hand-rolled inline-shell\n // alternative is most likely to introduce).\n scenario: [\n {\n name: 'Changed path',\n fixtureSteps: [\n 'echo \"$(date -u +%Y%m%dT%H%M%SZ)\" >> test/fixtures/dogfood-state.txt',\n ],\n inputs: {\n commit_message: 'test: dogfood',\n branches: 'test/dogfood',\n },\n assertions: [\n // step id defaults to a slug of `name` - here \"changed-path-0\"\n '[ \"${{ steps.changed-path-0.outputs.committed }}\" = \"true\" ]',\n ],\n },\n {\n // No fixture change this time - nothing new to commit.\n name: 'No-op path',\n id: 'no-op-check', // pin an explicit id instead of relying on the default slug\n inputs: {\n commit_message: 'test: dogfood',\n branches: 'test/dogfood',\n },\n assertions: [\n '[ \"${{ steps.no-op-check.outputs.committed }}\" = \"false\" ]',\n ],\n },\n ],\n cleanup: [\n 'git push origin --delete test/dogfood || true',\n ],\n },\n});\n\nproject.synth();\n```\n\nYou get:\n\n- `action.yml` and `auto-commit.sh` are hand-written - this type only lints their content via `build.yml`'s shellcheck/yamllint/actionlint checks.\n- `.github/workflows/build.yml` - lint gate: `apt`-installed shellcheck/yamllint plus a pinned, SHA-256-verified `actionlint` release binary. Gates `main` alongside `sonar.yml`.\n- `.github/workflows/test-dogfood.yml` - runs the `dogfood.scenario` steps above against this repo's own `action.yml` (via `uses: .`), then the shared `cleanup`, on `workflow_dispatch`, every `pull_request`, and nightly. Omit `dogfood` and the workflow still exists, with one step that fails on every PR until you declare a scenario - AD-001 allows a dogfood to be missing loudly, never silently. A *partial* `dogfood` (a scenario with no cleanup) is a synth error.\n- `.github/workflows/sonar.yml` - SonarCloud scan via the Scanner CLI (the quality gate blocks the PR), scanning `action.yml`/`.github/workflows/**`/`**/*.sh` explicitly.\n- `.github/workflows/release.yml` - `feat:`/`fix:` commits on `main` bump the version, tag `vX.Y.Z`, and create a GitHub Release.\n- `.github/workflows/projen-drift-check.yml`, `workflow-change-notice.yml`, `actions-allowlist-guard.yml` - drift detection, a change notice, and an action allow-list guard, always included.\n- `package.json` (**private**, version source only), `.yamllint`, `LICENSE` (MIT by default), and a `README.md` template - all regenerated by `npx projen`.\n\nNeeds the same two secrets as everything else in this package: `PROJEN_GITHUB_TOKEN` (used for automated PR comments) and `SONAR_TOKEN` (the Sonar scan). Onboard a brand-new action repo following [Getting started](#getting-started), write the `.projenrc.ts` above, then hand-write `action.yml`/`auto-commit.sh`/`test/fixtures/`.\n\n## Common options\n\nCDK project types (`CdkInfraProjectOptions` / `CdkAppProjectOptions`):\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `name` | - (required) | Project name; must match `package.json` |\n| `cdkVersion` | `2.189.1` | AWS CDK version |\n| `gheTokenSecret` | `PROJEN_GITHUB_TOKEN` | GitHub secret holding projen's PAT |\n| `slackWebhookSecret` | - | GitHub secret with a Slack webhook URL for deploy notifications |\n| `environments` | - (no `deploy` workflow) | Deploy targets for the `deploy` workflow; strings or `EnvironmentOptions` |\n| `ecrEcs` | - | `EcrEcsOptions` - `enabled`, `externalImageSource` (default `true`) |\n| `edgeResources` | - | Subset of `cloudfront`, `route53`, `apigateway`, `cognito`, `sqs` |\n| `database` | - (app only) | `DatabaseOptions` - `engine` (`postgres`/`mysql`/`dynamodb`, default `postgres`), `migrationTool` |\n| `appEntryPoint` | `src/app.ts` (app only) | Path of the generated application entrypoint |\n\nJava project types (`JavaLibraryProjectOptions` / `JavaServiceProjectOptions` / `JavaAppProjectOptions`):\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `name` | - (required) | Project name |\n| `groupId` | - (required) | Maven group id |\n| `artifactId` | - (required) | Maven artifact id |\n| `version` | `0.1.0` | Maven version |\n| `sonarProjectKey` | - | SonarQube project key; the sonar step is skipped when unset |\n| `gheTokenSecret` | `PROJEN_GITHUB_TOKEN` | GitHub secret holding projen's PAT |\n| `cdkDeployTargetRepo` | - (service only; `deploy-cdk.yml` fails until set) | Companion CDK repo (`owner/repo`) whose `deploy.yml` the deploy hook dispatches |\n| `cdkDeployHook` | `true` (service only) | Whether to generate `deploy-cdk.yml` at all |\n| `dockerRegistry` | `docker.io` (service only) | Registry the Docker image is pushed to |\n| `useFlyway` | `true` (service only) | Flyway plugin/dependency + `V1__init.sql` |\n\n`EnvironmentOptions` for deploy targets:\n\n```text\ninterface EnvironmentOptions {\n readonly name: string; // e.g. \"dev\", \"stage\", \"prod\"\n readonly accountId?: string; // AWS account id (CDK deploys)\n readonly region?: string; // AWS region (CDK deploys)\n readonly requiresApproval?: boolean; // GitHub Environment approval gate (default false)\n}\n```\n\nPlain strings (`'dev'`) are shorthand for `{ name: 'dev' }`.\n\n`GitHubActionProjectOptions`:\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `name` | - (required) | Project name |\n| `description` | - | One-line description; used in the default README template and recorded in the private `package.json` |\n| `sonarHostUrl` | - (required) | URL of your SonarCloud instance (e.g. `https://sonarcloud.io`); must be reachable from github.com-hosted runners |\n| `sonarTokenSecret` | `SONAR_TOKEN` | GitHub secret holding the Sonar token |\n| `sonarPullRequestGate` | `true` | Whether `sonar.yml` also runs on `pull_request` as a pass/fail gate |\n| `dogfood` | - (a `test-dogfood.yml` that fails until you declare one) | `ActionDogfoodOptions` - the scenario that exercises the action end-to-end via `uses: .` |\n| `license` | `MIT` | SPDX identifier for the generated `LICENSE` |\n| `gheTokenSecret` | `PROJEN_GITHUB_TOKEN` | GitHub secret holding projen's PAT |\n\n`ActionDogfoodOptions`/`ActionDogfoodStep` - the dogfood scenario (`test-dogfood.yml`):\n\n```text\ninterface ActionDogfoodOptions {\n readonly scenario: ActionDogfoodStep[]; // one or more, run in order - required\n readonly cleanup: string[]; // shared, run once at the end with `if: always()` - required\n}\n\ninterface ActionDogfoodStep {\n readonly name: string; // labels this step-group's generated workflow steps\n readonly id?: string; // step id for the `uses: .` call; default: a slug of `name`\n readonly fixtureSteps?: string[]; // shell, before the invocation (default: none)\n readonly inputs?: Record<string, string>; // `with:` for this invocation (default: none)\n readonly assertions: string[]; // shell, after the invocation - required, job fails unless all exit 0\n}\n```\n\nMost actions need exactly one `scenario` step. Actions with a re-run/no-op/idempotency behavior to verify (e.g. `auto-commit`'s no-op-on-no-change path, `create-pull-request`'s reuse-the-PR path) declare two - the second typically omits `fixtureSteps` so its invocation sees no new state, and its assertion checks the opposite outcome of the first. Reference an invocation's own outputs from a later assertion via `${{ steps.<id>.outputs.<name> }}`, using either the default slug or an explicit `id`.\n\n## Required GitHub secrets\n\n| Secret | Used by | Notes |\n| --- | --- | --- |\n| `PROJEN_GITHUB_TOKEN` | all types | PAT for projen's self-mutation/automation; override via `gheTokenSecret` |\n| `SONAR_TOKEN` | Java types with `sonarProjectKey`; `GitHubActionProject` | SonarQube scan step in `build.yml` / `sonar.yml`; override via `sonarTokenSecret` on `GitHubActionProject` |\n| `DOCKER_USERNAME` / `DOCKER_PASSWORD` | `JavaServiceProject` | Docker image push |\n| `MAVEN_GPG_PRIVATE_KEY`, `MAVEN_GPG_PASSPHRASE`, `MAVEN_CENTRAL_USERNAME`, `MAVEN_CENTRAL_PASSWORD` | `JavaLibraryProject` without `mavenCentralOidc` | Not needed with OIDC trusted publishing |\n| (your Slack webhook secret) | CDK types with `slackWebhookSecret` | Deploy notifications |\n\n## Going further\n\nThe project types are composed from smaller components you can also attach to your own projects:\n\n| Component | Applies to | Purpose |\n| --- | --- | --- |\n| `AppRuntimeScaffold` | `NodeProject` | App source skeleton (`app.ts` + handlers) |\n| `DatabaseComponent` | `NodeProject` | Database construct stub + migration tool wiring |\n| `EcrEcsConstructs` | `Project` | ECR + Fargate ECS construct helper |\n| `EdgeNetworkingConstructs` | `Project` | Per-resource edge networking construct helpers |\n| `MavenCentralPublish` | `JavaProject` | Manual-dispatch Maven Central publish workflow |\n| `DockerPublish` | `JavaProject` | Manual-dispatch Docker build+push workflow |\n| `GitHubPackagesPublish` | `JavaProject` | Manual-dispatch GitHub Packages publish workflow |\n| `FlywayMigration` | `JavaProject` | Flyway plugin/dependency + migrations directory |\n| `CdkDeployHook` | `JavaProject` | Manual-dispatch workflow that triggers `deploy.yml` in a companion CDK repo |\n| `CodeIndexWorkflow` | `JavaProject` | Code index generation on push to `main` |\n| `ActionBuildWorkflow` | `GitHubProject` | The `lint` task (shellcheck/yamllint/pinned actionlint) + `build.yml` |\n| `ActionDogfoodWorkflow` | `GitHubProject` | `test-dogfood.yml` from an `ActionDogfoodOptions` scenario |\n| `ActionSonarWorkflow` | `GitHubProject` | `sonar.yml` (SonarCloud scan via the Scanner CLI) |\n\nExample - adding a Docker publish to a plain projen `JavaProject`:\n\n```typescript\nimport { java } from 'projen';\nimport { DockerPublish } from '@xpertss/projen-types';\n\nconst project = new java.JavaProject({\n name: 'my-service',\n groupId: 'org.xpertss',\n artifactId: 'my-service',\n});\n\nnew DockerPublish(project, { dockerRegistry: 'ghcr.io' });\n\nproject.synth();\n```\n\nThe full API reference, including every option and property, is in [API.md](./API.md).\n"
|
|
109
|
+
"markdown": "# @xpertss/projen-types\n\nProjen project types for CDK/TypeScript and Java/Maven projects.\n\nInstead of hand-maintaining `pom.xml`, `cdk.json`, and GitHub workflows, you declare a project type in a `.projenrc.ts` file and let [projen](https://github.com/projen/projen) generate (and keep up to date) the whole scaffold: build files, source skeletons, CI workflows, and deploy pipelines.\n\n## Project types at a glance\n\n| Type | What it is | Publishes to | Generated workflows |\n| --- | --- | --- | --- |\n| `CdkInfraProject` | Pure-infrastructure CDK stacks (CloudFront, Route53, SQS, API Gateway, Cognito, ECR/ECS for externally-built images) | - | `build` (PR checks), `deploy` (manual dispatch) |\n| `CdkAppProject` | Full TypeScript service behind API Gateway: infra + app source + database | - | `build`, `deploy`, `app-build` (PR checks) |\n| `JavaLibraryProject` | Reusable Java library | Maven Central | `build`, `upgrade` (nightly), `publish-maven-central`, `codeindex` |\n| `JavaServiceProject` | Spring Boot service | Docker Hub | `build`, `upgrade` (nightly), `publish-docker`, `deploy-cdk` |\n| `JavaAppProject` | GUI/TUI/CLI Java application | GitHub Packages | `build`, `upgrade` (nightly), `publish-ghpackages` |\n| `GitHubActionProject` | Reusable GitHub Action or Workflow | GitHub Releases | `build`, `test-dogfood`, `sonar`, `release` |\n\nTwo foundation classes are also exported for advanced use: `CdkTypescriptProject` (shared CDK + TypeScript base for the CDK types) and `JavaMavenProject` (shared Maven base for the Java types).\n\nAll project types:\n\n- run a **drift check** in PR builds - a job that re-runs projen and fails if generated files were hand-edited. Edit `.projenrc.ts`, then run `npx projen`; never edit generated files directly.\n- use the GitHub secret `PROJEN_GITHUB_TOKEN` (a fine-grained PAT) for projen's automation. Override with `gheTokenSecret`.\n- make all publishing/deploying **manual** (workflow_dispatch) rather than on every merge.\n\n## Getting started\n\nScaffold the repo with projen's own bootstrap, pointed at this package:\n\n```bash\nmkdir my-project && cd my-project\ngit init\nnpx projen new --from @xpertss/projen-types cdk_infra --name my-project\n```\n\nThat writes a starter `.projenrc.ts`, synthesizes the whole scaffold and\ninstalls dependencies. The type names `projen new` accepts are `cdk_infra`,\n`cdk_app`, `java_library`, `java_service`, `java_app` and\n`git_hub_action`; pass a bogus one to have it list them. Required options\nbecome flags: `--name` for every type, plus `--group-id`/`--artifact-id`\n(Java) and `--sonar-host-url` (`git_hub_action`). Any other plainly-typed\noption can be passed the same way - `--cdk-deploy-target-repo owner/repo`,\n`--docker-registry ghcr.io`, `--no-use-flyway`, and so on.\n\nCommit the result. From then on, every change to the scaffold goes through\n`.projenrc.ts` followed by `npx projen`:\n\n```bash\nnpx projen\n```\n\nEvery type scaffolds from that one command; no option is *required* that\n`projen new` cannot pass. The structured options - `environments` and\n`GitHubActionProject`'s `dogfood` - are ones projen's CLI cannot render\ninto a projenrc, so they are added afterwards by editing `.projenrc.ts` and\nre-running `npx projen`. Leaving `environments` out simply generates no\ndeploy workflow; leaving `dogfood` out (or a service's\n`cdkDeployTargetRepo`) still generates the workflow, with one step that\nfails and tells you what to add - a gate this package considers load-bearing\nis allowed to be missing loudly, never silently.\n\nThe `name` option must match the `name` field in the project's `package.json` (for the CDK types) or the project name used by projen's `java.JavaProject` (for the Java types).\n\n## Updating an existing project when this package changes\n\nYour generated scaffold reflects the *installed* version of `@xpertss/projen-types` - `npx projen` reads your project type from the package in `node_modules`, not from this repository. So when this package ships a change (a bug fix, a new generated file, or altered workflow behavior), an existing project picks it up by bumping the dependency and re-synthesizing. A stale `node_modules` silently regenerates with the old behavior, so the bump is the load-bearing step.\n\nUsing the [`auto-commit` action](#githubactionproject) as a running example, say a new release adds the `# Purpose:` workflow header and SonarCloud wording. In the `auto-commit` repo:\n\n```bash\nnpm view @xpertss/projen-types version # what's the newest release?\nnpm i -D @xpertss/projen-types@latest # bump the installed project type\nnpx projen # re-synthesize every generated file\ngit diff # review before committing\n```\n\nThe diff here is the workflows gaining a `# Purpose:` comment and `sonar.yml` reflecting the SonarCloud wording. Commit the result with a normal `chore:` or `fix:` message - you never hand-edit the generated files themselves.\n\n## Examples\n\n### CdkInfraProject\n\nPure infrastructure stacks with optional ECR/ECS and edge-networking constructs.\n\n```typescript\n// .projenrc.ts\nimport { CdkInfraProject } from '@xpertss/projen-types';\n\nconst project = new CdkInfraProject({\n name: 'media-edge-infra',\n environments: [\n 'dev',\n { name: 'stage', accountId: '111111111111', region: 'eu-central-1' },\n { name: 'prod', accountId: '222222222222', region: 'eu-central-1', requiresApproval: true },\n ],\n edgeResources: ['cloudfront', 'route53', 'sqs'],\n ecrEcs: { enabled: true, externalImageSource: true },\n slackWebhookSecret: 'SLACK_DEPLOY_WEBHOOK',\n});\n\nproject.synth();\n```\n\nYou get:\n\n- `cdk.json`, `cdk synth` / `cdk diff` / `cdk deploy` tasks, and the standard `AwsCdkTypeScriptApp` layout (CDK 2.189.1 by default).\n- `.github/workflows/build.yml` - PR build that hard-fails on projen drift.\n- `.github/workflows/deploy.yml` - manual dispatch with one `deploy-<env>` job per environment (runs `cdk deploy --all` with `--context environment=<env>`); `requiresApproval` environments get a GitHub Environment approval gate; a Slack notification step is added when `slackWebhookSecret` is set.\n- `src/constructs/edge-networking.ts` - helper constructs only for the requested `edgeResources` (`cloudfront`, `route53`, `apigateway`, `cognito`, `sqs`).\n- `src/constructs/ecr-ecs.ts` when `ecrEcs.enabled` - ECR repo + Fargate service; `externalImageSource: true` (default) means the service pulls an image built outside this repo.\n\n### CdkAppProject\n\n`CdkInfraProject` plus application source, a database construct, and an app-level build workflow.\n\n```typescript\n// .projenrc.ts\nimport { CdkAppProject } from '@xpertss/projen-types';\n\nconst project = new CdkAppProject({\n name: 'video-api',\n environments: ['dev', 'prod'],\n edgeResources: ['apigateway'],\n database: { engine: 'postgres', migrationTool: 'flyway' },\n appEntryPoint: 'src/app.ts',\n});\n\nproject.synth();\n```\n\nEverything from `CdkInfraProject`, plus:\n\n- `src/app.ts` - application entrypoint stub (`export function handler()`).\n- `src/handlers/example.ts` - API Gateway proxy handler stub, with `@types/aws-lambda` added as a dev dependency.\n- `src/constructs/database.ts` - a `Database` construct stub for the chosen engine (`postgres`/`mysql` -> RDS, `dynamodb` -> DynamoDB). `migrationTool` (no default, intentionally) is added as a dev dependency and referenced in the stub - wiring it up is left to you.\n- `.github/workflows/app-build.yml` - runs the project's test task on every PR, then checks for projen drift.\n\n### JavaLibraryProject\n\nA reusable Java library published to Maven Central.\n\n```typescript\n// .projenrc.ts\nimport { JavaLibraryProject } from '@xpertss/projen-types';\n\nconst project = new JavaLibraryProject({\n name: 'common-utils',\n groupId: 'org.xpertss',\n artifactId: 'common-utils',\n version: '1.0.0',\n sonarProjectKey: 'org.xpertss:common-utils',\n mavenCentralOidc: true,\n});\n\nproject.synth();\n```\n\nYou get:\n\n- `pom.xml` (via projen's `java.JavaProject`) with the given GAV coordinates.\n- `.github/workflows/build.yml` - PR build + projen drift check, plus a SonarQube scan step when `sonarProjectKey` is set (needs a `SONAR_TOKEN` secret).\n- `.github/workflows/upgrade.yml` - nightly (03:00 UTC) PR running `mvn versions:use-latest-releases versions:update-properties`.\n- `.github/workflows/publish-maven-central.yml` - manual dispatch running `mvn -B deploy -P release`. With `mavenCentralOidc: true` it uses Maven Central's OIDC trusted publishing (no GPG secrets needed); otherwise it expects the secrets `MAVEN_GPG_PRIVATE_KEY`, `MAVEN_GPG_PASSPHRASE`, `MAVEN_CENTRAL_USERNAME`, `MAVEN_CENTRAL_PASSWORD`.\n- `.github/workflows/codeindex.yml` - on push to `main`, generates a Java source index under `.cai/` (disable with `publishCodeIndex: false`).\n\n### JavaServiceProject\n\nA Spring Boot service that publishes a Docker image and can trigger deploys in a companion CDK repo.\n\n```typescript\n// .projenrc.ts\nimport { JavaServiceProject } from '@xpertss/projen-types';\n\nconst project = new JavaServiceProject({\n name: 'stream-processor',\n groupId: 'org.xpertss',\n artifactId: 'stream-processor',\n dockerRegistry: 'docker.io/xpertss',\n cdkDeployTargetRepo: 'xpertss/stream-infra',\n environments: ['dev', { name: 'prod', requiresApproval: true }],\n});\n\nproject.synth();\n```\n\nYou get (everything from `JavaMavenProject` - `pom.xml`, `build` + drift check, nightly `upgrade` - plus):\n\n- `spring-boot-starter-web` added to the pom.\n- `.github/workflows/publish-docker.yml` - manual dispatch: `mvn -B package && docker build -t <registry>/<name>:<sha>`, logged in with the `DOCKER_USERNAME` / `DOCKER_PASSWORD` secrets. `dockerRegistry` defaults to `docker.io`.\n- Flyway wiring when `useFlyway` (default `true`): `flyway-maven-plugin` ^10 + `flyway-core` ^10 in the pom, and `src/main/resources/db/migration/V1__init.sql`.\n- `.github/workflows/deploy-cdk.yml` (the `CdkDeployHook`, generated by default) - manual dispatch with an environment selector; each job sends a `workflow_dispatch` to `deploy.yml` in the companion `cdkDeployTargetRepo` (a `CdkInfraProject`/`CdkAppProject` repo). With no `cdkDeployTargetRepo` set, the workflow is still generated but each job's only step fails with instructions - it is dispatch-only, so that lands on whoever tries to deploy rather than on every PR. Turn the workflow off entirely with `cdkDeployHook: false`. `environments` defaults to `['prod']`.\n\n### JavaAppProject\n\nA GUI/TUI/CLI Java application published to GitHub Packages only - no Maven Central, no Docker, no CDK deploy hook.\n\n```typescript\n// .projenrc.ts\nimport { JavaAppProject } from '@xpertss/projen-types';\n\nconst project = new JavaAppProject({\n name: 'studio-cli',\n groupId: 'org.xpertss',\n artifactId: 'studio-cli',\n ghPackagesRegistry: 'https://maven.pkg.github.com/xpertss/studio-cli',\n});\n\nproject.synth();\n```\n\nYou get everything from `JavaMavenProject`, plus `.github/workflows/publish-ghpackages.yml` - manual dispatch running `mvn -B deploy -DaltDeploymentRepository=github::<registry>`, authenticated with `GITHUB_TOKEN`. `ghPackagesRegistry` defaults to `https://maven.pkg.github.com/<repo>` derived from the repository URL.\n\n### GitHubActionProject\n\nA reusable GitHub Action or Workflow. This example scaffolds an action that stages a folder and, only if it changed, commits and pushes it.\n\n```typescript\n// .projenrc.ts\nimport { GitHubActionProject } from '@xpertss/projen-types';\n\nconst project = new GitHubActionProject({\n name: 'auto-commit',\n description: 'Stage a folder and, only if it changed, commit and push it',\n sonarHostUrl: 'https://sonarcloud.io', // required, no default - your SonarCloud URL\n dogfood: {\n // Two scenario steps: the \"changed\" path and the \"no-op\" path are both\n // load-bearing behavior for this action (a double-commit or a\n // push-when-empty bug is the failure mode a hand-rolled inline-shell\n // alternative is most likely to introduce).\n scenario: [\n {\n name: 'Changed path',\n fixtureSteps: [\n 'echo \"$(date -u +%Y%m%dT%H%M%SZ)\" >> test/fixtures/dogfood-state.txt',\n ],\n inputs: {\n commit_message: 'test: dogfood',\n branches: 'test/dogfood',\n },\n assertions: [\n // step id defaults to a slug of `name` - here \"changed-path-0\"\n '[ \"${{ steps.changed-path-0.outputs.committed }}\" = \"true\" ]',\n ],\n },\n {\n // No fixture change this time - nothing new to commit.\n name: 'No-op path',\n id: 'no-op-check', // pin an explicit id instead of relying on the default slug\n inputs: {\n commit_message: 'test: dogfood',\n branches: 'test/dogfood',\n },\n assertions: [\n '[ \"${{ steps.no-op-check.outputs.committed }}\" = \"false\" ]',\n ],\n },\n ],\n cleanup: [\n 'git push origin --delete test/dogfood || true',\n ],\n },\n});\n\nproject.synth();\n```\n\nYou get:\n\n- `action.yml` and `auto-commit.sh` are hand-written - this type only lints their content via `build.yml`'s shellcheck/yamllint/actionlint checks.\n- `.github/workflows/build.yml` - lint gate: `apt`-installed shellcheck/yamllint plus a pinned, SHA-256-verified `actionlint` release binary. Gates `main` alongside `sonar.yml`.\n- `.github/workflows/test-dogfood.yml` - runs the `dogfood.scenario` steps above against this repo's own `action.yml` (via `uses: .`), then the shared `cleanup`, on `workflow_dispatch`, every `pull_request`, and nightly. Omit `dogfood` and the workflow still exists, with one step that fails on every PR until you declare a scenario - AD-001 allows a dogfood to be missing loudly, never silently. A *partial* `dogfood` (a scenario with no cleanup) is a synth error.\n- `.github/workflows/sonar.yml` - SonarCloud scan via the Scanner CLI (the quality gate blocks the PR), scanning `action.yml`/`.github/workflows/**`/`**/*.sh` explicitly.\n- `.github/workflows/release.yml` - `feat:`/`fix:` commits on `main` bump the version, tag `vX.Y.Z`, and create a GitHub Release.\n- `.github/workflows/projen-drift-check.yml` and `workflow-change-notice.yml` - drift detection and a change notice, always included.\n- `package.json` (**private**, version source only), `.yamllint`, `LICENSE` (MIT by default), and a `README.md` template - all regenerated by `npx projen`.\n\nNeeds the same two secrets as everything else in this package: `PROJEN_GITHUB_TOKEN` (used for automated PR comments) and `SONAR_TOKEN` (the Sonar scan). Onboard a brand-new action repo following [Getting started](#getting-started), write the `.projenrc.ts` above, then hand-write `action.yml`/`auto-commit.sh`/`test/fixtures/`.\n\n## Common options\n\nCDK project types (`CdkInfraProjectOptions` / `CdkAppProjectOptions`):\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `name` | - (required) | Project name; must match `package.json` |\n| `cdkVersion` | `2.189.1` | AWS CDK version |\n| `gheTokenSecret` | `PROJEN_GITHUB_TOKEN` | GitHub secret holding projen's PAT |\n| `slackWebhookSecret` | - | GitHub secret with a Slack webhook URL for deploy notifications |\n| `environments` | - (no `deploy` workflow) | Deploy targets for the `deploy` workflow; strings or `EnvironmentOptions` |\n| `ecrEcs` | - | `EcrEcsOptions` - `enabled`, `externalImageSource` (default `true`) |\n| `edgeResources` | - | Subset of `cloudfront`, `route53`, `apigateway`, `cognito`, `sqs` |\n| `database` | - (app only) | `DatabaseOptions` - `engine` (`postgres`/`mysql`/`dynamodb`, default `postgres`), `migrationTool` |\n| `appEntryPoint` | `src/app.ts` (app only) | Path of the generated application entrypoint |\n\nJava project types (`JavaLibraryProjectOptions` / `JavaServiceProjectOptions` / `JavaAppProjectOptions`):\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `name` | - (required) | Project name |\n| `groupId` | - (required) | Maven group id |\n| `artifactId` | - (required) | Maven artifact id |\n| `version` | `0.1.0` | Maven version |\n| `sonarProjectKey` | - | SonarQube project key; the sonar step is skipped when unset |\n| `gheTokenSecret` | `PROJEN_GITHUB_TOKEN` | GitHub secret holding projen's PAT |\n| `cdkDeployTargetRepo` | - (service only; `deploy-cdk.yml` fails until set) | Companion CDK repo (`owner/repo`) whose `deploy.yml` the deploy hook dispatches |\n| `cdkDeployHook` | `true` (service only) | Whether to generate `deploy-cdk.yml` at all |\n| `dockerRegistry` | `docker.io` (service only) | Registry the Docker image is pushed to |\n| `useFlyway` | `true` (service only) | Flyway plugin/dependency + `V1__init.sql` |\n\n`EnvironmentOptions` for deploy targets:\n\n```text\ninterface EnvironmentOptions {\n readonly name: string; // e.g. \"dev\", \"stage\", \"prod\"\n readonly accountId?: string; // AWS account id (CDK deploys)\n readonly region?: string; // AWS region (CDK deploys)\n readonly requiresApproval?: boolean; // GitHub Environment approval gate (default false)\n}\n```\n\nPlain strings (`'dev'`) are shorthand for `{ name: 'dev' }`.\n\n`GitHubActionProjectOptions`:\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `name` | - (required) | Project name |\n| `description` | - | One-line description; used in the default README template and recorded in the private `package.json` |\n| `sonarHostUrl` | - (required) | URL of your SonarCloud instance (e.g. `https://sonarcloud.io`); must be reachable from github.com-hosted runners |\n| `sonarTokenSecret` | `SONAR_TOKEN` | GitHub secret holding the Sonar token |\n| `sonarPullRequestGate` | `true` | Whether `sonar.yml` also runs on `pull_request` as a pass/fail gate |\n| `dogfood` | - (a `test-dogfood.yml` that fails until you declare one) | `ActionDogfoodOptions` - the scenario that exercises the action end-to-end via `uses: .` |\n| `license` | `MIT` | SPDX identifier for the generated `LICENSE` |\n| `gheTokenSecret` | `PROJEN_GITHUB_TOKEN` | GitHub secret holding projen's PAT |\n\n`ActionDogfoodOptions`/`ActionDogfoodStep` - the dogfood scenario (`test-dogfood.yml`):\n\n```text\ninterface ActionDogfoodOptions {\n readonly scenario: ActionDogfoodStep[]; // one or more, run in order - required\n readonly cleanup: string[]; // shared, run once at the end with `if: always()` - required\n}\n\ninterface ActionDogfoodStep {\n readonly name: string; // labels this step-group's generated workflow steps\n readonly id?: string; // step id for the `uses: .` call; default: a slug of `name`\n readonly fixtureSteps?: string[]; // shell, before the invocation (default: none)\n readonly inputs?: Record<string, string>; // `with:` for this invocation (default: none)\n readonly assertions: string[]; // shell, after the invocation - required, job fails unless all exit 0\n}\n```\n\nMost actions need exactly one `scenario` step. Actions with a re-run/no-op/idempotency behavior to verify (e.g. `auto-commit`'s no-op-on-no-change path, `create-pull-request`'s reuse-the-PR path) declare two - the second typically omits `fixtureSteps` so its invocation sees no new state, and its assertion checks the opposite outcome of the first. Reference an invocation's own outputs from a later assertion via `${{ steps.<id>.outputs.<name> }}`, using either the default slug or an explicit `id`.\n\n## Required GitHub secrets\n\n| Secret | Used by | Notes |\n| --- | --- | --- |\n| `PROJEN_GITHUB_TOKEN` | all types | PAT for projen's self-mutation/automation; override via `gheTokenSecret` |\n| `SONAR_TOKEN` | Java types with `sonarProjectKey`; `GitHubActionProject` | SonarQube scan step in `build.yml` / `sonar.yml`; override via `sonarTokenSecret` on `GitHubActionProject` |\n| `DOCKER_USERNAME` / `DOCKER_PASSWORD` | `JavaServiceProject` | Docker image push |\n| `MAVEN_GPG_PRIVATE_KEY`, `MAVEN_GPG_PASSPHRASE`, `MAVEN_CENTRAL_USERNAME`, `MAVEN_CENTRAL_PASSWORD` | `JavaLibraryProject` without `mavenCentralOidc` | Not needed with OIDC trusted publishing |\n| (your Slack webhook secret) | CDK types with `slackWebhookSecret` | Deploy notifications |\n\n## Going further\n\nThe project types are composed from smaller components you can also attach to your own projects:\n\n| Component | Applies to | Purpose |\n| --- | --- | --- |\n| `AppRuntimeScaffold` | `NodeProject` | App source skeleton (`app.ts` + handlers) |\n| `DatabaseComponent` | `NodeProject` | Database construct stub + migration tool wiring |\n| `EcrEcsConstructs` | `Project` | ECR + Fargate ECS construct helper |\n| `EdgeNetworkingConstructs` | `Project` | Per-resource edge networking construct helpers |\n| `MavenCentralPublish` | `JavaProject` | Manual-dispatch Maven Central publish workflow |\n| `DockerPublish` | `JavaProject` | Manual-dispatch Docker build+push workflow |\n| `GitHubPackagesPublish` | `JavaProject` | Manual-dispatch GitHub Packages publish workflow |\n| `FlywayMigration` | `JavaProject` | Flyway plugin/dependency + migrations directory |\n| `CdkDeployHook` | `JavaProject` | Manual-dispatch workflow that triggers `deploy.yml` in a companion CDK repo |\n| `CodeIndexWorkflow` | `JavaProject` | Code index generation on push to `main` |\n| `ActionBuildWorkflow` | `GitHubProject` | The `lint` task (shellcheck/yamllint/pinned actionlint) + `build.yml` |\n| `ActionDogfoodWorkflow` | `GitHubProject` | `test-dogfood.yml` from an `ActionDogfoodOptions` scenario |\n| `ActionSonarWorkflow` | `GitHubProject` | `sonar.yml` (SonarCloud scan via the Scanner CLI) |\n\nExample - adding a Docker publish to a plain projen `JavaProject`:\n\n```typescript\nimport { java } from 'projen';\nimport { DockerPublish } from '@xpertss/projen-types';\n\nconst project = new java.JavaProject({\n name: 'my-service',\n groupId: 'org.xpertss',\n artifactId: 'my-service',\n});\n\nnew DockerPublish(project, { dockerRegistry: 'ghcr.io' });\n\nproject.synth();\n```\n\nThe full API reference, including every option and property, is in [API.md](./API.md).\n"
|
|
110
110
|
},
|
|
111
111
|
"repository": {
|
|
112
112
|
"type": "git",
|
|
@@ -542,116 +542,6 @@
|
|
|
542
542
|
],
|
|
543
543
|
"symbolId": "src/actions/action-sonar-workflow:ActionSonarWorkflowOptions"
|
|
544
544
|
},
|
|
545
|
-
"@xpertss/projen-types.ActionsAllowlistGuard": {
|
|
546
|
-
"assembly": "@xpertss/projen-types",
|
|
547
|
-
"base": "projen.Component",
|
|
548
|
-
"docs": {
|
|
549
|
-
"stability": "experimental"
|
|
550
|
-
},
|
|
551
|
-
"fqn": "@xpertss/projen-types.ActionsAllowlistGuard",
|
|
552
|
-
"initializer": {
|
|
553
|
-
"docs": {
|
|
554
|
-
"stability": "experimental"
|
|
555
|
-
},
|
|
556
|
-
"locationInModule": {
|
|
557
|
-
"filename": "src/common/actions-allowlist-guard.ts",
|
|
558
|
-
"line": 42
|
|
559
|
-
},
|
|
560
|
-
"parameters": [
|
|
561
|
-
{
|
|
562
|
-
"name": "scope",
|
|
563
|
-
"type": {
|
|
564
|
-
"fqn": "projen.github.GitHubProject"
|
|
565
|
-
}
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
"name": "options",
|
|
569
|
-
"optional": true,
|
|
570
|
-
"type": {
|
|
571
|
-
"fqn": "@xpertss/projen-types.ActionsAllowlistGuardOptions"
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
]
|
|
575
|
-
},
|
|
576
|
-
"kind": "class",
|
|
577
|
-
"locationInModule": {
|
|
578
|
-
"filename": "src/common/actions-allowlist-guard.ts",
|
|
579
|
-
"line": 39
|
|
580
|
-
},
|
|
581
|
-
"name": "ActionsAllowlistGuard",
|
|
582
|
-
"properties": [
|
|
583
|
-
{
|
|
584
|
-
"docs": {
|
|
585
|
-
"stability": "experimental"
|
|
586
|
-
},
|
|
587
|
-
"immutable": true,
|
|
588
|
-
"locationInModule": {
|
|
589
|
-
"filename": "src/common/actions-allowlist-guard.ts",
|
|
590
|
-
"line": 40
|
|
591
|
-
},
|
|
592
|
-
"name": "workflow",
|
|
593
|
-
"type": {
|
|
594
|
-
"fqn": "projen.github.GithubWorkflow"
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
],
|
|
598
|
-
"symbolId": "src/common/actions-allowlist-guard:ActionsAllowlistGuard"
|
|
599
|
-
},
|
|
600
|
-
"@xpertss/projen-types.ActionsAllowlistGuardOptions": {
|
|
601
|
-
"assembly": "@xpertss/projen-types",
|
|
602
|
-
"datatype": true,
|
|
603
|
-
"docs": {
|
|
604
|
-
"remarks": "Runs on `pull_request_target` so it always executes the copy of this\nworkflow committed on the base branch - a PR cannot edit this file to\ndisable or weaken the check. It checks out and executes nothing from the\nPR; it only reads the PR head's file content via the GitHub API. Because\n`pull_request_target` runs with the base repo's token even for\nfork-originated PRs, the failure comment posts reliably.\n\n It performs a flat, unconditional scan of the PR's head ref (no\n base-vs-head comparison): fetch the content of every GitHub workflow and\n composite-action file, extract every `uses:` value, and fail if any does\n not start with one of the three trusted namespaces from AD-001\n (`actions/`, `docker/`, `xpertss/`). The single\nexemption is a local same-repo reference (`uses: .` or\n`uses: ./.github/actions/<name>`) - the repo's own hand-committed action,\nto which the org policy's \"allow select actions\" setting does not apply.",
|
|
605
|
-
"stability": "experimental",
|
|
606
|
-
"summary": "Blocking, tamper-proof PR check that stops a disallowed GitHub Action reference from ever (re)appearing in a repo's workflow or composite-action files."
|
|
607
|
-
},
|
|
608
|
-
"fqn": "@xpertss/projen-types.ActionsAllowlistGuardOptions",
|
|
609
|
-
"kind": "interface",
|
|
610
|
-
"locationInModule": {
|
|
611
|
-
"filename": "src/common/actions-allowlist-guard.ts",
|
|
612
|
-
"line": 26
|
|
613
|
-
},
|
|
614
|
-
"name": "ActionsAllowlistGuardOptions",
|
|
615
|
-
"properties": [
|
|
616
|
-
{
|
|
617
|
-
"abstract": true,
|
|
618
|
-
"docs": {
|
|
619
|
-
"default": "\"PROJEN_GITHUB_TOKEN\"",
|
|
620
|
-
"remarks": "The check still fails without it, so fork PRs -\nwhich get no secrets - are only missing the extra comment.",
|
|
621
|
-
"stability": "experimental",
|
|
622
|
-
"summary": "GitHub secret holding a token with permission to comment on PRs, used for the failure comment."
|
|
623
|
-
},
|
|
624
|
-
"immutable": true,
|
|
625
|
-
"locationInModule": {
|
|
626
|
-
"filename": "src/common/actions-allowlist-guard.ts",
|
|
627
|
-
"line": 33
|
|
628
|
-
},
|
|
629
|
-
"name": "gheTokenSecret",
|
|
630
|
-
"optional": true,
|
|
631
|
-
"type": {
|
|
632
|
-
"primitive": "string"
|
|
633
|
-
}
|
|
634
|
-
},
|
|
635
|
-
{
|
|
636
|
-
"abstract": true,
|
|
637
|
-
"docs": {
|
|
638
|
-
"default": "\"actions-allowlist-guard\"",
|
|
639
|
-
"stability": "experimental"
|
|
640
|
-
},
|
|
641
|
-
"immutable": true,
|
|
642
|
-
"locationInModule": {
|
|
643
|
-
"filename": "src/common/actions-allowlist-guard.ts",
|
|
644
|
-
"line": 36
|
|
645
|
-
},
|
|
646
|
-
"name": "workflowName",
|
|
647
|
-
"optional": true,
|
|
648
|
-
"type": {
|
|
649
|
-
"primitive": "string"
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
],
|
|
653
|
-
"symbolId": "src/common/actions-allowlist-guard:ActionsAllowlistGuardOptions"
|
|
654
|
-
},
|
|
655
545
|
"@xpertss/projen-types.AppRuntimeScaffold": {
|
|
656
546
|
"assembly": "@xpertss/projen-types",
|
|
657
547
|
"base": "projen.Component",
|
|
@@ -1012,7 +902,7 @@
|
|
|
1012
902
|
},
|
|
1013
903
|
"locationInModule": {
|
|
1014
904
|
"filename": "src/cdk/cdk-typescript-base.ts",
|
|
1015
|
-
"line":
|
|
905
|
+
"line": 29
|
|
1016
906
|
},
|
|
1017
907
|
"parameters": [
|
|
1018
908
|
{
|
|
@@ -1026,7 +916,7 @@
|
|
|
1026
916
|
"kind": "class",
|
|
1027
917
|
"locationInModule": {
|
|
1028
918
|
"filename": "src/cdk/cdk-typescript-base.ts",
|
|
1029
|
-
"line":
|
|
919
|
+
"line": 28
|
|
1030
920
|
},
|
|
1031
921
|
"name": "CdkTypescriptProject",
|
|
1032
922
|
"symbolId": "src/cdk/cdk-typescript-base:CdkTypescriptProject"
|
|
@@ -1044,7 +934,7 @@
|
|
|
1044
934
|
"kind": "interface",
|
|
1045
935
|
"locationInModule": {
|
|
1046
936
|
"filename": "src/cdk/cdk-typescript-base.ts",
|
|
1047
|
-
"line":
|
|
937
|
+
"line": 17
|
|
1048
938
|
},
|
|
1049
939
|
"name": "CdkTypescriptProjectOptions",
|
|
1050
940
|
"properties": [
|
|
@@ -1056,7 +946,7 @@
|
|
|
1056
946
|
"immutable": true,
|
|
1057
947
|
"locationInModule": {
|
|
1058
948
|
"filename": "src/cdk/cdk-typescript-base.ts",
|
|
1059
|
-
"line":
|
|
949
|
+
"line": 18
|
|
1060
950
|
},
|
|
1061
951
|
"name": "environments",
|
|
1062
952
|
"optional": true,
|
|
@@ -1721,7 +1611,7 @@
|
|
|
1721
1611
|
"base": "projen.github.GitHubProject",
|
|
1722
1612
|
"docs": {
|
|
1723
1613
|
"stability": "experimental",
|
|
1724
|
-
"summary": "Scaffolds the repo lifecycle (AD-001) around a hand-committed, composite (shell) GitHub Action: the `build`/`test-dogfood`/`sonar`/`release`
|
|
1614
|
+
"summary": "Scaffolds the repo lifecycle (AD-001) around a hand-committed, composite (shell) GitHub Action: the `build`/`test-dogfood`/`sonar`/`release` workflows, versioning and release discipline, the F003 verify components, and repo boilerplate (a private version-source `package.json`, `.yamllint`, `LICENSE`, and a `README.md` template). The action's own content (`action.yml`, its shell scripts, `test/` fixtures) is authored by hand per the action's own F### spec - this type only lints it."
|
|
1725
1615
|
},
|
|
1726
1616
|
"fqn": "@xpertss/projen-types.GitHubActionProject",
|
|
1727
1617
|
"initializer": {
|
|
@@ -1730,7 +1620,7 @@
|
|
|
1730
1620
|
},
|
|
1731
1621
|
"locationInModule": {
|
|
1732
1622
|
"filename": "src/actions/github-action-project.ts",
|
|
1733
|
-
"line":
|
|
1623
|
+
"line": 133
|
|
1734
1624
|
},
|
|
1735
1625
|
"parameters": [
|
|
1736
1626
|
{
|
|
@@ -1744,7 +1634,7 @@
|
|
|
1744
1634
|
"kind": "class",
|
|
1745
1635
|
"locationInModule": {
|
|
1746
1636
|
"filename": "src/actions/github-action-project.ts",
|
|
1747
|
-
"line":
|
|
1637
|
+
"line": 127
|
|
1748
1638
|
},
|
|
1749
1639
|
"name": "GitHubActionProject",
|
|
1750
1640
|
"properties": [
|
|
@@ -1755,7 +1645,7 @@
|
|
|
1755
1645
|
"immutable": true,
|
|
1756
1646
|
"locationInModule": {
|
|
1757
1647
|
"filename": "src/actions/github-action-project.ts",
|
|
1758
|
-
"line":
|
|
1648
|
+
"line": 128
|
|
1759
1649
|
},
|
|
1760
1650
|
"name": "buildWorkflow",
|
|
1761
1651
|
"type": {
|
|
@@ -1769,7 +1659,7 @@
|
|
|
1769
1659
|
"immutable": true,
|
|
1770
1660
|
"locationInModule": {
|
|
1771
1661
|
"filename": "src/actions/github-action-project.ts",
|
|
1772
|
-
"line":
|
|
1662
|
+
"line": 129
|
|
1773
1663
|
},
|
|
1774
1664
|
"name": "dogfoodWorkflow",
|
|
1775
1665
|
"type": {
|
|
@@ -1783,7 +1673,7 @@
|
|
|
1783
1673
|
"immutable": true,
|
|
1784
1674
|
"locationInModule": {
|
|
1785
1675
|
"filename": "src/actions/github-action-project.ts",
|
|
1786
|
-
"line":
|
|
1676
|
+
"line": 131
|
|
1787
1677
|
},
|
|
1788
1678
|
"name": "release",
|
|
1789
1679
|
"type": {
|
|
@@ -1797,7 +1687,7 @@
|
|
|
1797
1687
|
"immutable": true,
|
|
1798
1688
|
"locationInModule": {
|
|
1799
1689
|
"filename": "src/actions/github-action-project.ts",
|
|
1800
|
-
"line":
|
|
1690
|
+
"line": 130
|
|
1801
1691
|
},
|
|
1802
1692
|
"name": "sonarWorkflow",
|
|
1803
1693
|
"type": {
|
|
@@ -1820,7 +1710,7 @@
|
|
|
1820
1710
|
"kind": "interface",
|
|
1821
1711
|
"locationInModule": {
|
|
1822
1712
|
"filename": "src/actions/github-action-project.ts",
|
|
1823
|
-
"line":
|
|
1713
|
+
"line": 35
|
|
1824
1714
|
},
|
|
1825
1715
|
"name": "GitHubActionProjectOptions",
|
|
1826
1716
|
"properties": [
|
|
@@ -1833,7 +1723,7 @@
|
|
|
1833
1723
|
"immutable": true,
|
|
1834
1724
|
"locationInModule": {
|
|
1835
1725
|
"filename": "src/actions/github-action-project.ts",
|
|
1836
|
-
"line":
|
|
1726
|
+
"line": 56
|
|
1837
1727
|
},
|
|
1838
1728
|
"name": "sonarHostUrl",
|
|
1839
1729
|
"type": {
|
|
@@ -1850,7 +1740,7 @@
|
|
|
1850
1740
|
"immutable": true,
|
|
1851
1741
|
"locationInModule": {
|
|
1852
1742
|
"filename": "src/actions/github-action-project.ts",
|
|
1853
|
-
"line":
|
|
1743
|
+
"line": 41
|
|
1854
1744
|
},
|
|
1855
1745
|
"name": "description",
|
|
1856
1746
|
"optional": true,
|
|
@@ -1869,7 +1759,7 @@
|
|
|
1869
1759
|
"immutable": true,
|
|
1870
1760
|
"locationInModule": {
|
|
1871
1761
|
"filename": "src/actions/github-action-project.ts",
|
|
1872
|
-
"line":
|
|
1762
|
+
"line": 82
|
|
1873
1763
|
},
|
|
1874
1764
|
"name": "dogfood",
|
|
1875
1765
|
"optional": true,
|
|
@@ -1882,12 +1772,12 @@
|
|
|
1882
1772
|
"docs": {
|
|
1883
1773
|
"default": "\"PROJEN_GITHUB_TOKEN\"",
|
|
1884
1774
|
"stability": "experimental",
|
|
1885
|
-
"summary": "Name of the GitHub Actions secret holding the PAT used for projen-automation PR comments (F003
|
|
1775
|
+
"summary": "Name of the GitHub Actions secret holding the PAT used for projen-automation PR comments (F003) and, when the action has a `token` input, the dogfood's invocation of it."
|
|
1886
1776
|
},
|
|
1887
1777
|
"immutable": true,
|
|
1888
1778
|
"locationInModule": {
|
|
1889
1779
|
"filename": "src/actions/github-action-project.ts",
|
|
1890
|
-
"line":
|
|
1780
|
+
"line": 49
|
|
1891
1781
|
},
|
|
1892
1782
|
"name": "gheTokenSecret",
|
|
1893
1783
|
"optional": true,
|
|
@@ -1905,7 +1795,7 @@
|
|
|
1905
1795
|
"immutable": true,
|
|
1906
1796
|
"locationInModule": {
|
|
1907
1797
|
"filename": "src/actions/github-action-project.ts",
|
|
1908
|
-
"line":
|
|
1798
|
+
"line": 88
|
|
1909
1799
|
},
|
|
1910
1800
|
"name": "license",
|
|
1911
1801
|
"optional": true,
|
|
@@ -1923,7 +1813,7 @@
|
|
|
1923
1813
|
"immutable": true,
|
|
1924
1814
|
"locationInModule": {
|
|
1925
1815
|
"filename": "src/actions/github-action-project.ts",
|
|
1926
|
-
"line":
|
|
1816
|
+
"line": 65
|
|
1927
1817
|
},
|
|
1928
1818
|
"name": "sonarPullRequestGate",
|
|
1929
1819
|
"optional": true,
|
|
@@ -1940,7 +1830,7 @@
|
|
|
1940
1830
|
"immutable": true,
|
|
1941
1831
|
"locationInModule": {
|
|
1942
1832
|
"filename": "src/actions/github-action-project.ts",
|
|
1943
|
-
"line":
|
|
1833
|
+
"line": 59
|
|
1944
1834
|
},
|
|
1945
1835
|
"name": "sonarTokenSecret",
|
|
1946
1836
|
"optional": true,
|
|
@@ -2197,7 +2087,7 @@
|
|
|
2197
2087
|
},
|
|
2198
2088
|
"locationInModule": {
|
|
2199
2089
|
"filename": "src/java/java-maven-base.ts",
|
|
2200
|
-
"line":
|
|
2090
|
+
"line": 23
|
|
2201
2091
|
},
|
|
2202
2092
|
"parameters": [
|
|
2203
2093
|
{
|
|
@@ -2211,7 +2101,7 @@
|
|
|
2211
2101
|
"kind": "class",
|
|
2212
2102
|
"locationInModule": {
|
|
2213
2103
|
"filename": "src/java/java-maven-base.ts",
|
|
2214
|
-
"line":
|
|
2104
|
+
"line": 19
|
|
2215
2105
|
},
|
|
2216
2106
|
"name": "JavaMavenProject",
|
|
2217
2107
|
"properties": [
|
|
@@ -2222,7 +2112,7 @@
|
|
|
2222
2112
|
"immutable": true,
|
|
2223
2113
|
"locationInModule": {
|
|
2224
2114
|
"filename": "src/java/java-maven-base.ts",
|
|
2225
|
-
"line":
|
|
2115
|
+
"line": 21
|
|
2226
2116
|
},
|
|
2227
2117
|
"name": "buildVerifyWorkflow",
|
|
2228
2118
|
"type": {
|
|
@@ -2236,7 +2126,7 @@
|
|
|
2236
2126
|
"immutable": true,
|
|
2237
2127
|
"locationInModule": {
|
|
2238
2128
|
"filename": "src/java/java-maven-base.ts",
|
|
2239
|
-
"line":
|
|
2129
|
+
"line": 20
|
|
2240
2130
|
},
|
|
2241
2131
|
"name": "upgradeTask",
|
|
2242
2132
|
"type": {
|
|
@@ -2259,7 +2149,7 @@
|
|
|
2259
2149
|
"kind": "interface",
|
|
2260
2150
|
"locationInModule": {
|
|
2261
2151
|
"filename": "src/java/java-maven-base.ts",
|
|
2262
|
-
"line":
|
|
2152
|
+
"line": 11
|
|
2263
2153
|
},
|
|
2264
2154
|
"name": "JavaMavenProjectOptions",
|
|
2265
2155
|
"symbolId": "src/java/java-maven-base:JavaMavenProjectOptions"
|
|
@@ -2741,6 +2631,6 @@
|
|
|
2741
2631
|
"symbolId": "src/common/workflow-change-notice-workflow:WorkflowChangeNoticeWorkflowOptions"
|
|
2742
2632
|
}
|
|
2743
2633
|
},
|
|
2744
|
-
"version": "0.0.
|
|
2745
|
-
"fingerprint": "
|
|
2634
|
+
"version": "0.0.9",
|
|
2635
|
+
"fingerprint": "dojaWCudrteak9wTmbbmwILVoLKk1jJGjhAoCsLBuF0="
|
|
2746
2636
|
}
|