@nikovirtala/projen-constructs 0.3.77 → 0.3.79
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 +111 -58
- package/README.md +18 -0
- package/docs/api/assets/search.js +1 -1
- package/docs/api/classes/AwsCdkConstructLibraryProject.html +1 -1
- package/docs/api/classes/AwsCdkTypeScriptAppProject.html +1 -1
- package/docs/api/classes/Colima.html +1 -1
- package/docs/api/classes/Homebrew.html +1 -1
- package/docs/api/classes/JsiiProject.html +1 -1
- package/docs/api/classes/LambdaFunctionCodeBundler.html +26 -15
- package/docs/api/classes/LambdaFunctionConstructGenerator.html +1 -1
- package/docs/api/classes/LocalStack.html +1 -1
- package/docs/api/classes/Mise.html +1 -1
- package/docs/api/classes/ProjectGenerator.html +1 -1
- package/docs/api/classes/TypeDoc.html +1 -1
- package/docs/api/classes/TypeScriptProject.html +1 -1
- package/docs/api/classes/Vitest.html +1 -1
- package/docs/api/index.html +8 -0
- package/docs/api/interfaces/ProjectGeneratorOptions.html +1 -1
- package/docs/api/interfaces/VitestOptions.html +48 -3
- package/lib/components/bundle-lambda-function-code.d.ts +5 -2
- package/lib/components/bundle-lambda-function-code.js +14 -9
- package/lib/components/colima.js +1 -1
- package/lib/components/homebrew.js +1 -1
- package/lib/components/lambda-function-construct-generator.js +1 -1
- package/lib/components/localstack.js +1 -1
- package/lib/components/mise.js +1 -1
- package/lib/components/typedoc.js +1 -1
- package/lib/components/vitest.d.ts +29 -0
- package/lib/components/vitest.js +38 -35
- package/lib/project-generator.js +1 -1
- package/lib/projects/awscdk-construct-library.generated.js +1 -1
- package/lib/projects/awscdk-typescript-app.generated.js +1 -1
- package/lib/projects/jsii.generated.js +1 -1
- package/lib/projects/typescript.generated.js +1 -1
- package/package.json +1 -1
package/.jsii
CHANGED
|
@@ -4196,7 +4196,7 @@
|
|
|
4196
4196
|
},
|
|
4197
4197
|
"name": "@nikovirtala/projen-constructs",
|
|
4198
4198
|
"readme": {
|
|
4199
|
-
"markdown": "# @nikovirtala/projen-constructs\n\nProjen project types with standard configuration for consistent project setup across all repositories.\n\n## Installation\n\n```bash\npnpm add -D @nikovirtala/projen-constructs projen constructs\n```\n\nRequires pnpm 11 and `projen` >= 0.101.27. `@mrgrain/cdk-esbuild` and `constructs` are peer\ndependencies as well.\n\nTo create a project from scratch:\n\n```bash\npnpm dlx projen new --from @nikovirtala/projen-constructs aws_cdk_construct_library\n```\n\n## Features\n\n- **Standard Configuration**: Opinionated defaults for author, release branch, package manager, Node.js, TypeScript, and tooling\n- **Automatic Project Type Discovery**: Generates the `ProjectType` enum from Projen's JSII manifest (19 project types)\n- **Component System**: Reusable components (Vitest, TypeDoc, Mise, Homebrew, Colima, LocalStack, Lambda bundling)\n- **Code Generation**: `ProjectGenerator` creates project classes with standard configuration\n- **ES Modules**: TypeScript and CDK App projects use ES modules (JSII uses CommonJS)\n- **Code Quality**: Biome for formatting and linting\n- **Testing**: Vitest with coverage\n- **Auto-merge**: Enabled with auto-approve\n- **VSCode**: Recommended extensions and settings\n- **mise**: Node version management\n\n## Standard Configuration\n\n- **Author**: Niko Virtala (niko.virtala@hey.com)\n- **Default Release Branch**: main\n- **Package Manager**: pnpm 11.20.0\n- **Node Version**: 24.19.0\n- **TypeScript**: 6.0.3\n- **CDK Version**: 2.263.0 (for CDK projects)\n- **JSII Version**: ~6.0.3 (for JSII projects)\n\nThe AWS CDK, Node.js and TypeScript versions live in `src/versions.json` and are refreshed by the\n`update-versions` task, which the dependency upgrade workflow runs.\n\n### pnpm\n\npnpm reads its settings from `pnpm-workspace.yaml`, not `.npmrc`, since pnpm 11. Generated projects\nget:\n\n| Setting | Value | Reason |\n| ---------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------ |\n| `nodeLinker` | `hoisted` | jsii tooling resolves dependencies from a flat `node_modules` |\n| `allowBuilds` | `esbuild: true` | esbuild links its platform binary in a postinstall script, and pnpm 11 fails an install with ignored builds |\n| `verifyDepsBeforeRun` | `false` | projen resolves the task `PATH` with `$(pnpm -c exec ...)`, which otherwise re-enters `pnpm install` and deadlocks |\n| `minimumReleaseAge` | `0` | the pnpm 11 default of 1440 minutes makes pnpm write `minimumReleaseAgeExclude` entries into this generated file |\n\n### TypeScript configuration\n\nProjen renders three configs, and none of them should be edited directly:\n\n- `tsconfig.json` compiles `src` to `lib`. For JSII projects, jsii validates it against its `strict`\n rule set, so it only carries compiler options jsii accepts.\n- `test/tsconfig.json` extends it and is type-check only. This is the config Vitest type checking and\n the editor use, and the one `tsconfigDev` points at.\n- `projenrc/tsconfig.json` covers `.projenrc.ts`.\n\n## Customization\n\nOverride any option by passing it to the constructor:\n\n```typescript\nconst project = new JsiiProject({\n name: \"my-project\",\n repositoryUrl: \"https://github.com/nikovirtala/my-project.git\",\n minNodeVersion: \"24.0.0\",\n author: \"Custom Author\",\n authorAddress: \"custom@example.com\",\n mise: false,\n vitest: false,\n tsconfig: {\n compilerOptions: {\n noUnusedLocals: false,\n },\n },\n biomeOptions: {\n biomeConfig: {\n formatter: {\n lineWidth: 100,\n },\n },\n },\n});\n```\n\nEvery component is exposed as an enable flag (`mise`, `vitest`, ...) plus an options property\n(`miseOptions`, `vitestOptions`, ...).\n\n## Usage\n\n### Projects\n\n#### AWS CDK Construct Library Project\n\n```typescript\nimport { AwsCdkConstructLibraryProject } from \"@nikovirtala/projen-constructs\";\n\nconst project = new AwsCdkConstructLibraryProject({\n name: \"my-cdk-construct\",\n repositoryUrl: \"https://github.com/nikovirtala/my-cdk-construct.git\",\n});\n\nproject.synth();\n```\n\n#### AWS CDK TypeScript App Project\n\n```typescript\nimport { AwsCdkTypeScriptAppProject } from \"@nikovirtala/projen-constructs\";\n\nconst project = new AwsCdkTypeScriptAppProject({\n name: \"my-cdk-app\",\n repositoryUrl: \"https://github.com/nikovirtala/my-cdk-app.git\",\n});\n\nproject.synth();\n```\n\n#### JSII Project\n\n```typescript\nimport { JsiiProject } from \"@nikovirtala/projen-constructs\";\n\nconst project = new JsiiProject({\n name: \"my-jsii-project\",\n repositoryUrl: \"https://github.com/nikovirtala/my-jsii-project.git\",\n});\n\nproject.synth();\n```\n\n#### TypeScript Project\n\n```typescript\nimport { TypeScriptProject } from \"@nikovirtala/projen-constructs\";\n\nconst project = new TypeScriptProject({\n name: \"my-typescript-project\",\n repositoryUrl: \"https://github.com/nikovirtala/my-typescript-project.git\",\n});\n\nproject.synth();\n```\n\n### Components\n\nThe package includes reusable components for common development tasks:\n\n#### Vitest\n\n[Vitest](https://vitest.dev) testing framework component.\n\n```typescript\nimport { Vitest } from \"@nikovirtala/projen-constructs\";\n\nnew Vitest(project, {\n vitestVersion: \"^4\",\n config: {\n coverageProvider: CoverageProvider.V8,\n coverageReporters: [CoverageReporter.TEXT, CoverageReporter.LCOV],\n },\n});\n```\n\nType checking runs against the project's development tsconfig (`test/tsconfig.json`) unless\n`config.typecheckTsconfig` says otherwise.\n\n#### TypeDoc\n\n[TypeDoc](https://typedoc.org) documentation generation component.\n\n```typescript\nimport { TypeDoc, EntryPointStrategy } from \"@nikovirtala/projen-constructs\";\n\nnew TypeDoc(project, {\n version: \"^0.28\",\n typeDocConfig: {\n entryPointStrategy: EntryPointStrategy.EXPAND,\n out: \"docs/api\",\n exclude: [\"**/*.test.ts\"],\n },\n});\n```\n\n#### Mise\n\n[Mise](https://mise.jdx.dev) dev tools/runtimes management component.\n\n```typescript\nimport { Mise } from \"@nikovirtala/projen-constructs\";\n\nnew Mise(project, {\n nodeVersion: \"24.19.0\",\n});\n```\n\n#### Homebrew\n\n[Homebrew](https://brew.sh) package management component. Writes a `Brewfile` and adds an\n`install:homebrew` task that bootstraps Homebrew and runs `brew bundle`.\n\n```typescript\nimport { Homebrew } from \"@nikovirtala/projen-constructs\";\n\nconst homebrew = new Homebrew(project, {\n packages: [\"jq\", \"yq\"],\n});\n\nhomebrew.addPackage(\"gh\");\n```\n\n#### Colima\n\n[Colima](https://github.com/abiosoft/colima) container runtime component. Alternative for Docker.\n\n```typescript\nimport { Colima } from \"@nikovirtala/projen-constructs\";\n\nnew Colima(project);\n```\n\n#### LocalStack\n\n[LocalStack](https://www.localstack.cloud) AWS emulation component.\n\n```typescript\nimport { LocalStack } from \"@nikovirtala/projen-constructs\";\n\nnew LocalStack(project, {\n services: [\"s3\", \"lambda\", \"dynamodb\"],\n port: 4566,\n debug: true,\n});\n```\n\n#### LambdaFunctionConstructGenerator\n\nGenerates AWS CDK Lambda Function constructs and bundles their code.\n\n```typescript\nimport { LambdaFunctionConstructGenerator } from \"@nikovirtala/projen-constructs\";\n\nnew LambdaFunctionConstructGenerator(project, {\n sourceDir: \"src/handlers\",\n outputDir: \"src/constructs/lambda\",\n filePattern: \"*.lambda.ts\",\n esbuildOptions: {\n minify: true,\n sourcemap: true,\n },\n});\n```\n\n#### Bundler\n\nLow-level bundling utilities for Lambda functions.\n\n```typescript\nimport {\n Bundler,\n LambdaFunctionCodeBundle,\n} from \"@nikovirtala/projen-constructs\";\n\nconst bundler = new Bundler(project, {\n assetsDir: \"assets\",\n esbuildVersion: \"^0.25\",\n});\n\nnew LambdaFunctionCodeBundle(project, {\n entrypoint: \"src/my-function.lambda.ts\",\n extension: \".lambda.ts\",\n});\n```\n\n#### ProjectGenerator\n\nGenerates TypeScript project classes with standard configuration.\n\n```typescript\nimport { ProjectGenerator, ProjectType } from \"@nikovirtala/projen-constructs\";\n\nnew ProjectGenerator(project, {\n name: \"TypeScriptProject\",\n projectType: ProjectType.TYPE_SCRIPT_PROJECT,\n filePath: \"./src/projects/typescript.generated.ts\",\n components: [\n { componentClass: Mise },\n { componentClass: Vitest }, // Auto-detects VitestOptions from JSII manifest\n ],\n});\n```\n\nFeatures:\n\n- Automatically generates the `ProjectType` enum from Projen's JSII manifest\n- Auto-detects component options types from JSII manifests\n- Strips Projen's `@pjnew` annotation from `packageManager`, which `projen new` would otherwise\n render into a generated `.projenrc.ts` as the package manager that ran the command\n- Validates paths to prevent directory traversal attacks\n- Structured error handling with custom error classes\n\n## Development\n\nThis project is managed by Projen and generates itself: `.projenrc.ts` defines the project using the\n`JsiiProject` type from `src/`. Configuration changes belong in `.projenrc.ts`, never in the\ngenerated files.\n\n```bash\npnpm projen # synthesize project files\npnpm build # synthesize, compile, test and package\npnpm test # biome, vitest, typedoc\npnpm test:watch # vitest in watch mode\npnpm test:update # update snapshots\npnpm biome # format and lint\npnpm docgen # regenerate API.md from the .jsii manifest\npnpm update-versions # refresh src/versions.json\npnpm upgrade # upgrade dependencies\n```\n\n### Build process\n\n```mermaid\nflowchart TD\n projenrc[\".projenrc.ts\"]\n\n subgraph synthesize[\"default (synthesize)\"]\n direction TB\n synth[\"tsx .projenrc.ts\"]\n generator[\"ProjectGenerator\"]\n generated[\"src/project-type.ts<br/>src/projects/*.generated.ts<br/>src/projects/*-options.generated.ts\"]\n projenfiles[\"package.json, tsconfig.json,<br/>pnpm-workspace.yaml, workflows, ...\"]\n brew[\"install:homebrew<br/>brew bundle\"]\n definecfg[\"bundle-vitest-define-config<br/>esbuild → lib/vitest-define-config.js\"]\n\n synth --> generator --> generated\n synth --> projenfiles\n synth --> brew\n synth --> definecfg\n end\n\n subgraph compile[\"compile\"]\n direction TB\n jsii[\"jsii<br/>validates tsconfig.json against the strict rule set\"]\n lib[\"lib/**\"]\n manifest[\".jsii manifest\"]\n\n jsii --> lib\n jsii --> manifest\n end\n\n subgraph test[\"test\"]\n direction TB\n biome[\"biome check --write\"]\n vitest[\"vitest run<br/>+ type checking\"]\n typedoc[\"typedoc → docs/api\"]\n\n biome --> vitest --> typedoc\n end\n\n subgraph package[\"package\"]\n direction TB\n pacmak[\"jsii-pacmak<br/>--pack-command 'pnpm pack'\"]\n dist[\"dist/js/*.tgz\"]\n\n pacmak --> dist\n end\n\n projenrc --> synthesize\n synthesize --> compile\n compile --> test\n test --> package\n\n manifest -. \"component options FQNs<br/>read on the next synthesis\" .-> generator\n docgen[\"docgen<br/>jsii-docgen → API.md\"]\n manifest --> docgen\n\n classDef artifact fill:#eef,stroke:#88a\n class generated,projenfiles,lib,manifest,dist artifact\n```\n\nThe dashed edge is the part worth knowing about: `ProjectGenerator` reads the committed `.jsii`\nmanifest to resolve component options types, so the manifest produced by `compile` feeds the *next*\nsynthesis. This is why `.jsii` is committed rather than ignored. A component options type that is\nmissing from the manifest is reported as a warning and its options property is left out of the\ngenerated interface, which is expected only while a new component is being introduced: compile once,\nthen synthesize again.\n\n`package` runs `package:js` on CI and `package-all` locally; both end up in `jsii-pacmak`.\n`docgen` is not part of `build` and has to be run explicitly after the manifest changes.\n"
|
|
4199
|
+
"markdown": "# @nikovirtala/projen-constructs\n\nProjen project types with standard configuration for consistent project setup across all repositories.\n\n## Installation\n\n```bash\npnpm add -D @nikovirtala/projen-constructs projen constructs\n```\n\nRequires pnpm 11 and `projen` >= 0.101.27. `@mrgrain/cdk-esbuild` and `constructs` are peer\ndependencies as well.\n\nTo create a project from scratch:\n\n```bash\npnpm dlx projen new --from @nikovirtala/projen-constructs aws_cdk_construct_library\n```\n\n## Features\n\n- **Standard Configuration**: Opinionated defaults for author, release branch, package manager, Node.js, TypeScript, and tooling\n- **Automatic Project Type Discovery**: Generates the `ProjectType` enum from Projen's JSII manifest (19 project types)\n- **Component System**: Reusable components (Vitest, TypeDoc, Mise, Homebrew, Colima, LocalStack, Lambda bundling)\n- **Code Generation**: `ProjectGenerator` creates project classes with standard configuration\n- **ES Modules**: TypeScript and CDK App projects use ES modules (JSII uses CommonJS)\n- **Code Quality**: Biome for formatting and linting\n- **Testing**: Vitest with coverage\n- **Auto-merge**: Enabled with auto-approve\n- **VSCode**: Recommended extensions and settings\n- **mise**: Node version management\n\n## Standard Configuration\n\n- **Author**: Niko Virtala (niko.virtala@hey.com)\n- **Default Release Branch**: main\n- **Package Manager**: pnpm 11.20.0\n- **Node Version**: 24.19.0\n- **TypeScript**: 6.0.3\n- **CDK Version**: 2.263.0 (for CDK projects)\n- **JSII Version**: ~6.0.3 (for JSII projects)\n\nThe AWS CDK, Node.js and TypeScript versions live in `src/versions.json` and are refreshed by the\n`update-versions` task, which the dependency upgrade workflow runs.\n\n### pnpm\n\npnpm reads its settings from `pnpm-workspace.yaml`, not `.npmrc`, since pnpm 11. Generated projects\nget:\n\n| Setting | Value | Reason |\n| ---------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------ |\n| `nodeLinker` | `hoisted` | jsii tooling resolves dependencies from a flat `node_modules` |\n| `allowBuilds` | `esbuild: true` | esbuild links its platform binary in a postinstall script, and pnpm 11 fails an install with ignored builds |\n| `verifyDepsBeforeRun` | `false` | projen resolves the task `PATH` with `$(pnpm -c exec ...)`, which otherwise re-enters `pnpm install` and deadlocks |\n| `minimumReleaseAge` | `0` | the pnpm 11 default of 1440 minutes makes pnpm write `minimumReleaseAgeExclude` entries into this generated file |\n\n### TypeScript configuration\n\nProjen renders three configs, and none of them should be edited directly:\n\n- `tsconfig.json` compiles `src` to `lib`. For JSII projects, jsii validates it against its `strict`\n rule set, so it only carries compiler options jsii accepts.\n- `test/tsconfig.json` extends it and is type-check only. This is the config Vitest type checking and\n the editor use, and the one `tsconfigDev` points at.\n- `projenrc/tsconfig.json` covers `.projenrc.ts`.\n\n## Customization\n\nOverride any option by passing it to the constructor:\n\n```typescript\nconst project = new JsiiProject({\n name: \"my-project\",\n repositoryUrl: \"https://github.com/nikovirtala/my-project.git\",\n minNodeVersion: \"24.0.0\",\n author: \"Custom Author\",\n authorAddress: \"custom@example.com\",\n mise: false,\n vitest: false,\n tsconfig: {\n compilerOptions: {\n noUnusedLocals: false,\n },\n },\n biomeOptions: {\n biomeConfig: {\n formatter: {\n lineWidth: 100,\n },\n },\n },\n});\n```\n\nEvery component is exposed as an enable flag (`mise`, `vitest`, ...) plus an options property\n(`miseOptions`, `vitestOptions`, ...).\n\n## Usage\n\n### Projects\n\n#### AWS CDK Construct Library Project\n\n```typescript\nimport { AwsCdkConstructLibraryProject } from \"@nikovirtala/projen-constructs\";\n\nconst project = new AwsCdkConstructLibraryProject({\n name: \"my-cdk-construct\",\n repositoryUrl: \"https://github.com/nikovirtala/my-cdk-construct.git\",\n});\n\nproject.synth();\n```\n\n#### AWS CDK TypeScript App Project\n\n```typescript\nimport { AwsCdkTypeScriptAppProject } from \"@nikovirtala/projen-constructs\";\n\nconst project = new AwsCdkTypeScriptAppProject({\n name: \"my-cdk-app\",\n repositoryUrl: \"https://github.com/nikovirtala/my-cdk-app.git\",\n});\n\nproject.synth();\n```\n\n#### JSII Project\n\n```typescript\nimport { JsiiProject } from \"@nikovirtala/projen-constructs\";\n\nconst project = new JsiiProject({\n name: \"my-jsii-project\",\n repositoryUrl: \"https://github.com/nikovirtala/my-jsii-project.git\",\n});\n\nproject.synth();\n```\n\n#### TypeScript Project\n\n```typescript\nimport { TypeScriptProject } from \"@nikovirtala/projen-constructs\";\n\nconst project = new TypeScriptProject({\n name: \"my-typescript-project\",\n repositoryUrl: \"https://github.com/nikovirtala/my-typescript-project.git\",\n});\n\nproject.synth();\n```\n\n### Components\n\nThe package includes reusable components for common development tasks:\n\n#### Vitest\n\n[Vitest](https://vitest.dev) testing framework component.\n\n```typescript\nimport { Vitest } from \"@nikovirtala/projen-constructs\";\n\nnew Vitest(project, {\n vitestVersion: \"^4\",\n config: {\n coverageProvider: CoverageProvider.V8,\n coverageReporters: [CoverageReporter.TEXT, CoverageReporter.LCOV],\n },\n});\n```\n\nType checking runs against the project's development tsconfig (`test/tsconfig.json`) unless\n`config.typecheckTsconfig` says otherwise.\n\nFor Vitest settings that `config` doesn't cover, use `extraTestConfig` (merged into `test`) and\n`extraConfig` (top-level options next to `test`):\n\n```typescript\nnew Vitest(project, {\n extraTestConfig: {\n setupFiles: [\"test/setup.ts\"],\n },\n extraConfig: {\n resolve: { alias: { \"@\": \"/src\" } },\n },\n});\n```\n\n`extraTestConfig` is deep-merged over the generated `test` options: objects merge, and other values\n(including arrays) replace the generated value. Both options are rendered as JSON, so their values\ncan't contain functions or regular expressions, which rules out plugins.\n\n#### TypeDoc\n\n[TypeDoc](https://typedoc.org) documentation generation component.\n\n```typescript\nimport { TypeDoc, EntryPointStrategy } from \"@nikovirtala/projen-constructs\";\n\nnew TypeDoc(project, {\n version: \"^0.28\",\n typeDocConfig: {\n entryPointStrategy: EntryPointStrategy.EXPAND,\n out: \"docs/api\",\n exclude: [\"**/*.test.ts\"],\n },\n});\n```\n\n#### Mise\n\n[Mise](https://mise.jdx.dev) dev tools/runtimes management component.\n\n```typescript\nimport { Mise } from \"@nikovirtala/projen-constructs\";\n\nnew Mise(project, {\n nodeVersion: \"24.19.0\",\n});\n```\n\n#### Homebrew\n\n[Homebrew](https://brew.sh) package management component. Writes a `Brewfile` and adds an\n`install:homebrew` task that bootstraps Homebrew and runs `brew bundle`.\n\n```typescript\nimport { Homebrew } from \"@nikovirtala/projen-constructs\";\n\nconst homebrew = new Homebrew(project, {\n packages: [\"jq\", \"yq\"],\n});\n\nhomebrew.addPackage(\"gh\");\n```\n\n#### Colima\n\n[Colima](https://github.com/abiosoft/colima) container runtime component. Alternative for Docker.\n\n```typescript\nimport { Colima } from \"@nikovirtala/projen-constructs\";\n\nnew Colima(project);\n```\n\n#### LocalStack\n\n[LocalStack](https://www.localstack.cloud) AWS emulation component.\n\n```typescript\nimport { LocalStack } from \"@nikovirtala/projen-constructs\";\n\nnew LocalStack(project, {\n services: [\"s3\", \"lambda\", \"dynamodb\"],\n port: 4566,\n debug: true,\n});\n```\n\n#### LambdaFunctionConstructGenerator\n\nGenerates AWS CDK Lambda Function constructs and bundles their code.\n\n```typescript\nimport { LambdaFunctionConstructGenerator } from \"@nikovirtala/projen-constructs\";\n\nnew LambdaFunctionConstructGenerator(project, {\n sourceDir: \"src/handlers\",\n outputDir: \"src/constructs/lambda\",\n filePattern: \"*.lambda.ts\",\n esbuildOptions: {\n minify: true,\n sourcemap: true,\n },\n});\n```\n\n#### Bundler\n\nLow-level bundling utilities for Lambda functions.\n\n```typescript\nimport {\n Bundler,\n LambdaFunctionCodeBundle,\n} from \"@nikovirtala/projen-constructs\";\n\nconst bundler = new Bundler(project, {\n assetsDir: \"assets\",\n esbuildVersion: \"^0.25\",\n});\n\nnew LambdaFunctionCodeBundle(project, {\n entrypoint: \"src/my-function.lambda.ts\",\n extension: \".lambda.ts\",\n});\n```\n\n#### ProjectGenerator\n\nGenerates TypeScript project classes with standard configuration.\n\n```typescript\nimport { ProjectGenerator, ProjectType } from \"@nikovirtala/projen-constructs\";\n\nnew ProjectGenerator(project, {\n name: \"TypeScriptProject\",\n projectType: ProjectType.TYPE_SCRIPT_PROJECT,\n filePath: \"./src/projects/typescript.generated.ts\",\n components: [\n { componentClass: Mise },\n { componentClass: Vitest }, // Auto-detects VitestOptions from JSII manifest\n ],\n});\n```\n\nFeatures:\n\n- Automatically generates the `ProjectType` enum from Projen's JSII manifest\n- Auto-detects component options types from JSII manifests\n- Strips Projen's `@pjnew` annotation from `packageManager`, which `projen new` would otherwise\n render into a generated `.projenrc.ts` as the package manager that ran the command\n- Validates paths to prevent directory traversal attacks\n- Structured error handling with custom error classes\n\n## Development\n\nThis project is managed by Projen and generates itself: `.projenrc.ts` defines the project using the\n`JsiiProject` type from `src/`. Configuration changes belong in `.projenrc.ts`, never in the\ngenerated files.\n\n```bash\npnpm projen # synthesize project files\npnpm build # synthesize, compile, test and package\npnpm test # biome, vitest, typedoc\npnpm test:watch # vitest in watch mode\npnpm test:update # update snapshots\npnpm biome # format and lint\npnpm docgen # regenerate API.md from the .jsii manifest\npnpm update-versions # refresh src/versions.json\npnpm upgrade # upgrade dependencies\n```\n\n### Build process\n\n```mermaid\nflowchart TD\n projenrc[\".projenrc.ts\"]\n\n subgraph synthesize[\"default (synthesize)\"]\n direction TB\n synth[\"tsx .projenrc.ts\"]\n generator[\"ProjectGenerator\"]\n generated[\"src/project-type.ts<br/>src/projects/*.generated.ts<br/>src/projects/*-options.generated.ts\"]\n projenfiles[\"package.json, tsconfig.json,<br/>pnpm-workspace.yaml, workflows, ...\"]\n brew[\"install:homebrew<br/>brew bundle\"]\n definecfg[\"bundle-vitest-define-config<br/>esbuild → lib/vitest-define-config.js\"]\n\n synth --> generator --> generated\n synth --> projenfiles\n synth --> brew\n synth --> definecfg\n end\n\n subgraph compile[\"compile\"]\n direction TB\n jsii[\"jsii<br/>validates tsconfig.json against the strict rule set\"]\n lib[\"lib/**\"]\n manifest[\".jsii manifest\"]\n\n jsii --> lib\n jsii --> manifest\n end\n\n subgraph test[\"test\"]\n direction TB\n biome[\"biome check --write\"]\n vitest[\"vitest run<br/>+ type checking\"]\n typedoc[\"typedoc → docs/api\"]\n\n biome --> vitest --> typedoc\n end\n\n subgraph package[\"package\"]\n direction TB\n pacmak[\"jsii-pacmak<br/>--pack-command 'pnpm pack'\"]\n dist[\"dist/js/*.tgz\"]\n\n pacmak --> dist\n end\n\n projenrc --> synthesize\n synthesize --> compile\n compile --> test\n test --> package\n\n manifest -. \"component options FQNs<br/>read on the next synthesis\" .-> generator\n docgen[\"docgen<br/>jsii-docgen → API.md\"]\n manifest --> docgen\n\n classDef artifact fill:#eef,stroke:#88a\n class generated,projenfiles,lib,manifest,dist artifact\n```\n\nThe dashed edge is the part worth knowing about: `ProjectGenerator` reads the committed `.jsii`\nmanifest to resolve component options types, so the manifest produced by `compile` feeds the *next*\nsynthesis. This is why `.jsii` is committed rather than ignored. A component options type that is\nmissing from the manifest is reported as a warning and its options property is left out of the\ngenerated interface, which is expected only while a new component is being introduced: compile once,\nthen synthesize again.\n\n`package` runs `package:js` on CI and `package-all` locally; both end up in `jsii-pacmak`.\n`docgen` is not part of `build` and has to be run explicitly after the manifest changes.\n"
|
|
4200
4200
|
},
|
|
4201
4201
|
"repository": {
|
|
4202
4202
|
"type": "git",
|
|
@@ -10995,7 +10995,7 @@
|
|
|
10995
10995
|
"kind": "interface",
|
|
10996
10996
|
"locationInModule": {
|
|
10997
10997
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
10998
|
-
"line":
|
|
10998
|
+
"line": 158
|
|
10999
10999
|
},
|
|
11000
11000
|
"name": "Bundle",
|
|
11001
11001
|
"properties": [
|
|
@@ -11007,7 +11007,7 @@
|
|
|
11007
11007
|
"immutable": true,
|
|
11008
11008
|
"locationInModule": {
|
|
11009
11009
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11010
|
-
"line":
|
|
11010
|
+
"line": 159
|
|
11011
11011
|
},
|
|
11012
11012
|
"name": "bundleTask",
|
|
11013
11013
|
"type": {
|
|
@@ -11022,7 +11022,7 @@
|
|
|
11022
11022
|
"immutable": true,
|
|
11023
11023
|
"locationInModule": {
|
|
11024
11024
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11025
|
-
"line":
|
|
11025
|
+
"line": 161
|
|
11026
11026
|
},
|
|
11027
11027
|
"name": "outdir",
|
|
11028
11028
|
"type": {
|
|
@@ -11037,7 +11037,7 @@
|
|
|
11037
11037
|
"immutable": true,
|
|
11038
11038
|
"locationInModule": {
|
|
11039
11039
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11040
|
-
"line":
|
|
11040
|
+
"line": 160
|
|
11041
11041
|
},
|
|
11042
11042
|
"name": "outfile",
|
|
11043
11043
|
"type": {
|
|
@@ -11060,7 +11060,7 @@
|
|
|
11060
11060
|
},
|
|
11061
11061
|
"locationInModule": {
|
|
11062
11062
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11063
|
-
"line":
|
|
11063
|
+
"line": 50
|
|
11064
11064
|
},
|
|
11065
11065
|
"parameters": [
|
|
11066
11066
|
{
|
|
@@ -11081,7 +11081,7 @@
|
|
|
11081
11081
|
"kind": "class",
|
|
11082
11082
|
"locationInModule": {
|
|
11083
11083
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11084
|
-
"line":
|
|
11084
|
+
"line": 37
|
|
11085
11085
|
},
|
|
11086
11086
|
"methods": [
|
|
11087
11087
|
{
|
|
@@ -11090,7 +11090,7 @@
|
|
|
11090
11090
|
},
|
|
11091
11091
|
"locationInModule": {
|
|
11092
11092
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11093
|
-
"line":
|
|
11093
|
+
"line": 38
|
|
11094
11094
|
},
|
|
11095
11095
|
"name": "of",
|
|
11096
11096
|
"parameters": [
|
|
@@ -11115,7 +11115,7 @@
|
|
|
11115
11115
|
},
|
|
11116
11116
|
"locationInModule": {
|
|
11117
11117
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11118
|
-
"line":
|
|
11118
|
+
"line": 71
|
|
11119
11119
|
},
|
|
11120
11120
|
"name": "addBundle",
|
|
11121
11121
|
"parameters": [
|
|
@@ -11148,7 +11148,7 @@
|
|
|
11148
11148
|
"immutable": true,
|
|
11149
11149
|
"locationInModule": {
|
|
11150
11150
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11151
|
-
"line":
|
|
11151
|
+
"line": 44
|
|
11152
11152
|
},
|
|
11153
11153
|
"name": "bundledir",
|
|
11154
11154
|
"type": {
|
|
@@ -11162,7 +11162,7 @@
|
|
|
11162
11162
|
"immutable": true,
|
|
11163
11163
|
"locationInModule": {
|
|
11164
11164
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11165
|
-
"line":
|
|
11165
|
+
"line": 58
|
|
11166
11166
|
},
|
|
11167
11167
|
"name": "bundleTask",
|
|
11168
11168
|
"type": {
|
|
@@ -11176,7 +11176,7 @@
|
|
|
11176
11176
|
"immutable": true,
|
|
11177
11177
|
"locationInModule": {
|
|
11178
11178
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11179
|
-
"line":
|
|
11179
|
+
"line": 43
|
|
11180
11180
|
},
|
|
11181
11181
|
"name": "esbuildVersion",
|
|
11182
11182
|
"optional": true,
|
|
@@ -11197,7 +11197,7 @@
|
|
|
11197
11197
|
"kind": "interface",
|
|
11198
11198
|
"locationInModule": {
|
|
11199
11199
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11200
|
-
"line":
|
|
11200
|
+
"line": 30
|
|
11201
11201
|
},
|
|
11202
11202
|
"name": "BundlerOptions",
|
|
11203
11203
|
"properties": [
|
|
@@ -11209,7 +11209,7 @@
|
|
|
11209
11209
|
"immutable": true,
|
|
11210
11210
|
"locationInModule": {
|
|
11211
11211
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11212
|
-
"line":
|
|
11212
|
+
"line": 33
|
|
11213
11213
|
},
|
|
11214
11214
|
"name": "addToPreCompile",
|
|
11215
11215
|
"optional": true,
|
|
@@ -11225,7 +11225,7 @@
|
|
|
11225
11225
|
"immutable": true,
|
|
11226
11226
|
"locationInModule": {
|
|
11227
11227
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11228
|
-
"line":
|
|
11228
|
+
"line": 32
|
|
11229
11229
|
},
|
|
11230
11230
|
"name": "assetsDir",
|
|
11231
11231
|
"optional": true,
|
|
@@ -11241,7 +11241,7 @@
|
|
|
11241
11241
|
"immutable": true,
|
|
11242
11242
|
"locationInModule": {
|
|
11243
11243
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11244
|
-
"line":
|
|
11244
|
+
"line": 31
|
|
11245
11245
|
},
|
|
11246
11246
|
"name": "esbuildVersion",
|
|
11247
11247
|
"optional": true,
|
|
@@ -11257,7 +11257,7 @@
|
|
|
11257
11257
|
"immutable": true,
|
|
11258
11258
|
"locationInModule": {
|
|
11259
11259
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11260
|
-
"line":
|
|
11260
|
+
"line": 34
|
|
11261
11261
|
},
|
|
11262
11262
|
"name": "loaders",
|
|
11263
11263
|
"optional": true,
|
|
@@ -11283,7 +11283,7 @@
|
|
|
11283
11283
|
"kind": "interface",
|
|
11284
11284
|
"locationInModule": {
|
|
11285
11285
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11286
|
-
"line":
|
|
11286
|
+
"line": 164
|
|
11287
11287
|
},
|
|
11288
11288
|
"name": "BundlingOptions",
|
|
11289
11289
|
"properties": [
|
|
@@ -11295,7 +11295,7 @@
|
|
|
11295
11295
|
"immutable": true,
|
|
11296
11296
|
"locationInModule": {
|
|
11297
11297
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11298
|
-
"line":
|
|
11298
|
+
"line": 176
|
|
11299
11299
|
},
|
|
11300
11300
|
"name": "banner",
|
|
11301
11301
|
"optional": true,
|
|
@@ -11311,7 +11311,7 @@
|
|
|
11311
11311
|
"immutable": true,
|
|
11312
11312
|
"locationInModule": {
|
|
11313
11313
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11314
|
-
"line":
|
|
11314
|
+
"line": 165
|
|
11315
11315
|
},
|
|
11316
11316
|
"name": "externals",
|
|
11317
11317
|
"optional": true,
|
|
@@ -11332,7 +11332,7 @@
|
|
|
11332
11332
|
"immutable": true,
|
|
11333
11333
|
"locationInModule": {
|
|
11334
11334
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11335
|
-
"line":
|
|
11335
|
+
"line": 172
|
|
11336
11336
|
},
|
|
11337
11337
|
"name": "format",
|
|
11338
11338
|
"optional": true,
|
|
@@ -11348,7 +11348,7 @@
|
|
|
11348
11348
|
"immutable": true,
|
|
11349
11349
|
"locationInModule": {
|
|
11350
11350
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11351
|
-
"line":
|
|
11351
|
+
"line": 171
|
|
11352
11352
|
},
|
|
11353
11353
|
"name": "loaders",
|
|
11354
11354
|
"optional": true,
|
|
@@ -11369,7 +11369,7 @@
|
|
|
11369
11369
|
"immutable": true,
|
|
11370
11370
|
"locationInModule": {
|
|
11371
11371
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11372
|
-
"line":
|
|
11372
|
+
"line": 175
|
|
11373
11373
|
},
|
|
11374
11374
|
"name": "mainFields",
|
|
11375
11375
|
"optional": true,
|
|
@@ -11385,7 +11385,7 @@
|
|
|
11385
11385
|
"immutable": true,
|
|
11386
11386
|
"locationInModule": {
|
|
11387
11387
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11388
|
-
"line":
|
|
11388
|
+
"line": 173
|
|
11389
11389
|
},
|
|
11390
11390
|
"name": "minify",
|
|
11391
11391
|
"optional": true,
|
|
@@ -11401,7 +11401,7 @@
|
|
|
11401
11401
|
"immutable": true,
|
|
11402
11402
|
"locationInModule": {
|
|
11403
11403
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11404
|
-
"line":
|
|
11404
|
+
"line": 169
|
|
11405
11405
|
},
|
|
11406
11406
|
"name": "outfile",
|
|
11407
11407
|
"optional": true,
|
|
@@ -11417,7 +11417,7 @@
|
|
|
11417
11417
|
"immutable": true,
|
|
11418
11418
|
"locationInModule": {
|
|
11419
11419
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11420
|
-
"line":
|
|
11420
|
+
"line": 168
|
|
11421
11421
|
},
|
|
11422
11422
|
"name": "platform",
|
|
11423
11423
|
"optional": true,
|
|
@@ -11433,7 +11433,7 @@
|
|
|
11433
11433
|
"immutable": true,
|
|
11434
11434
|
"locationInModule": {
|
|
11435
11435
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11436
|
-
"line":
|
|
11436
|
+
"line": 166
|
|
11437
11437
|
},
|
|
11438
11438
|
"name": "sourcemap",
|
|
11439
11439
|
"optional": true,
|
|
@@ -11449,7 +11449,7 @@
|
|
|
11449
11449
|
"immutable": true,
|
|
11450
11450
|
"locationInModule": {
|
|
11451
11451
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11452
|
-
"line":
|
|
11452
|
+
"line": 174
|
|
11453
11453
|
},
|
|
11454
11454
|
"name": "sourcesContent",
|
|
11455
11455
|
"optional": true,
|
|
@@ -11465,7 +11465,7 @@
|
|
|
11465
11465
|
"immutable": true,
|
|
11466
11466
|
"locationInModule": {
|
|
11467
11467
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11468
|
-
"line":
|
|
11468
|
+
"line": 167
|
|
11469
11469
|
},
|
|
11470
11470
|
"name": "target",
|
|
11471
11471
|
"optional": true,
|
|
@@ -11481,7 +11481,7 @@
|
|
|
11481
11481
|
"immutable": true,
|
|
11482
11482
|
"locationInModule": {
|
|
11483
11483
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
11484
|
-
"line":
|
|
11484
|
+
"line": 170
|
|
11485
11485
|
},
|
|
11486
11486
|
"name": "tsconfigPath",
|
|
11487
11487
|
"optional": true,
|
|
@@ -15273,7 +15273,7 @@
|
|
|
15273
15273
|
},
|
|
15274
15274
|
"locationInModule": {
|
|
15275
15275
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15276
|
-
"line":
|
|
15276
|
+
"line": 188
|
|
15277
15277
|
},
|
|
15278
15278
|
"parameters": [
|
|
15279
15279
|
{
|
|
@@ -15293,7 +15293,7 @@
|
|
|
15293
15293
|
"kind": "class",
|
|
15294
15294
|
"locationInModule": {
|
|
15295
15295
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15296
|
-
"line":
|
|
15296
|
+
"line": 187
|
|
15297
15297
|
},
|
|
15298
15298
|
"name": "LambdaFunctionCodeBundle",
|
|
15299
15299
|
"symbolId": "src/components/bundle-lambda-function-code:LambdaFunctionCodeBundle"
|
|
@@ -15308,7 +15308,7 @@
|
|
|
15308
15308
|
"kind": "interface",
|
|
15309
15309
|
"locationInModule": {
|
|
15310
15310
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15311
|
-
"line":
|
|
15311
|
+
"line": 179
|
|
15312
15312
|
},
|
|
15313
15313
|
"name": "LambdaFunctionCodeBundleOptions",
|
|
15314
15314
|
"properties": [
|
|
@@ -15320,7 +15320,7 @@
|
|
|
15320
15320
|
"immutable": true,
|
|
15321
15321
|
"locationInModule": {
|
|
15322
15322
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15323
|
-
"line":
|
|
15323
|
+
"line": 180
|
|
15324
15324
|
},
|
|
15325
15325
|
"name": "entrypoint",
|
|
15326
15326
|
"type": {
|
|
@@ -15335,7 +15335,7 @@
|
|
|
15335
15335
|
"immutable": true,
|
|
15336
15336
|
"locationInModule": {
|
|
15337
15337
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15338
|
-
"line":
|
|
15338
|
+
"line": 181
|
|
15339
15339
|
},
|
|
15340
15340
|
"name": "extension",
|
|
15341
15341
|
"type": {
|
|
@@ -15350,7 +15350,7 @@
|
|
|
15350
15350
|
"immutable": true,
|
|
15351
15351
|
"locationInModule": {
|
|
15352
15352
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15353
|
-
"line":
|
|
15353
|
+
"line": 184
|
|
15354
15354
|
},
|
|
15355
15355
|
"name": "bundlingOptions",
|
|
15356
15356
|
"optional": true,
|
|
@@ -15366,7 +15366,7 @@
|
|
|
15366
15366
|
"immutable": true,
|
|
15367
15367
|
"locationInModule": {
|
|
15368
15368
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15369
|
-
"line":
|
|
15369
|
+
"line": 182
|
|
15370
15370
|
},
|
|
15371
15371
|
"name": "constructFile",
|
|
15372
15372
|
"optional": true,
|
|
@@ -15382,7 +15382,7 @@
|
|
|
15382
15382
|
"immutable": true,
|
|
15383
15383
|
"locationInModule": {
|
|
15384
15384
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15385
|
-
"line":
|
|
15385
|
+
"line": 183
|
|
15386
15386
|
},
|
|
15387
15387
|
"name": "constructName",
|
|
15388
15388
|
"optional": true,
|
|
@@ -15395,9 +15395,10 @@
|
|
|
15395
15395
|
},
|
|
15396
15396
|
"@nikovirtala/projen-constructs.LambdaFunctionCodeBundler": {
|
|
15397
15397
|
"assembly": "@nikovirtala/projen-constructs",
|
|
15398
|
-
"base": "projen.
|
|
15398
|
+
"base": "projen.cdk.AutoDiscoverBase",
|
|
15399
15399
|
"docs": {
|
|
15400
|
-
"stability": "stable"
|
|
15400
|
+
"stability": "stable",
|
|
15401
|
+
"summary": "Creates Lambda Function code bundles from entrypoints discovered in the project's source tree."
|
|
15401
15402
|
},
|
|
15402
15403
|
"fqn": "@nikovirtala/projen-constructs.LambdaFunctionCodeBundler",
|
|
15403
15404
|
"initializer": {
|
|
@@ -15406,7 +15407,7 @@
|
|
|
15406
15407
|
},
|
|
15407
15408
|
"locationInModule": {
|
|
15408
15409
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15409
|
-
"line":
|
|
15410
|
+
"line": 250
|
|
15410
15411
|
},
|
|
15411
15412
|
"parameters": [
|
|
15412
15413
|
{
|
|
@@ -15426,7 +15427,7 @@
|
|
|
15426
15427
|
"kind": "class",
|
|
15427
15428
|
"locationInModule": {
|
|
15428
15429
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15429
|
-
"line":
|
|
15430
|
+
"line": 249
|
|
15430
15431
|
},
|
|
15431
15432
|
"name": "LambdaFunctionCodeBundler",
|
|
15432
15433
|
"symbolId": "src/components/bundle-lambda-function-code:LambdaFunctionCodeBundler"
|
|
@@ -15441,7 +15442,7 @@
|
|
|
15441
15442
|
"kind": "interface",
|
|
15442
15443
|
"locationInModule": {
|
|
15443
15444
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15444
|
-
"line":
|
|
15445
|
+
"line": 240
|
|
15445
15446
|
},
|
|
15446
15447
|
"name": "LambdaFunctionCodeBundlerOptions",
|
|
15447
15448
|
"properties": [
|
|
@@ -15453,7 +15454,7 @@
|
|
|
15453
15454
|
"immutable": true,
|
|
15454
15455
|
"locationInModule": {
|
|
15455
15456
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15456
|
-
"line":
|
|
15457
|
+
"line": 241
|
|
15457
15458
|
},
|
|
15458
15459
|
"name": "extension",
|
|
15459
15460
|
"type": {
|
|
@@ -15468,7 +15469,7 @@
|
|
|
15468
15469
|
"immutable": true,
|
|
15469
15470
|
"locationInModule": {
|
|
15470
15471
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15471
|
-
"line":
|
|
15472
|
+
"line": 242
|
|
15472
15473
|
},
|
|
15473
15474
|
"name": "srcdir",
|
|
15474
15475
|
"type": {
|
|
@@ -15483,7 +15484,7 @@
|
|
|
15483
15484
|
"immutable": true,
|
|
15484
15485
|
"locationInModule": {
|
|
15485
15486
|
"filename": "src/components/bundle-lambda-function-code.ts",
|
|
15486
|
-
"line":
|
|
15487
|
+
"line": 243
|
|
15487
15488
|
},
|
|
15488
15489
|
"name": "bundleOptions",
|
|
15489
15490
|
"optional": true,
|
|
@@ -20574,7 +20575,7 @@
|
|
|
20574
20575
|
},
|
|
20575
20576
|
"locationInModule": {
|
|
20576
20577
|
"filename": "src/components/vitest.ts",
|
|
20577
|
-
"line":
|
|
20578
|
+
"line": 344
|
|
20578
20579
|
},
|
|
20579
20580
|
"parameters": [
|
|
20580
20581
|
{
|
|
@@ -20595,7 +20596,7 @@
|
|
|
20595
20596
|
"kind": "class",
|
|
20596
20597
|
"locationInModule": {
|
|
20597
20598
|
"filename": "src/components/vitest.ts",
|
|
20598
|
-
"line":
|
|
20599
|
+
"line": 315
|
|
20599
20600
|
},
|
|
20600
20601
|
"methods": [
|
|
20601
20602
|
{
|
|
@@ -20604,7 +20605,7 @@
|
|
|
20604
20605
|
},
|
|
20605
20606
|
"locationInModule": {
|
|
20606
20607
|
"filename": "src/components/vitest.ts",
|
|
20607
|
-
"line":
|
|
20608
|
+
"line": 316
|
|
20608
20609
|
},
|
|
20609
20610
|
"name": "of",
|
|
20610
20611
|
"parameters": [
|
|
@@ -20629,7 +20630,7 @@
|
|
|
20629
20630
|
},
|
|
20630
20631
|
"locationInModule": {
|
|
20631
20632
|
"filename": "src/components/vitest.ts",
|
|
20632
|
-
"line":
|
|
20633
|
+
"line": 417
|
|
20633
20634
|
},
|
|
20634
20635
|
"name": "addExclude",
|
|
20635
20636
|
"parameters": [
|
|
@@ -20647,7 +20648,7 @@
|
|
|
20647
20648
|
},
|
|
20648
20649
|
"locationInModule": {
|
|
20649
20650
|
"filename": "src/components/vitest.ts",
|
|
20650
|
-
"line":
|
|
20651
|
+
"line": 412
|
|
20651
20652
|
},
|
|
20652
20653
|
"name": "addInclude",
|
|
20653
20654
|
"parameters": [
|
|
@@ -20665,7 +20666,7 @@
|
|
|
20665
20666
|
},
|
|
20666
20667
|
"locationInModule": {
|
|
20667
20668
|
"filename": "src/components/vitest.ts",
|
|
20668
|
-
"line":
|
|
20669
|
+
"line": 427
|
|
20669
20670
|
},
|
|
20670
20671
|
"name": "configureCoverageProvider",
|
|
20671
20672
|
"parameters": [
|
|
@@ -20683,7 +20684,7 @@
|
|
|
20683
20684
|
},
|
|
20684
20685
|
"locationInModule": {
|
|
20685
20686
|
"filename": "src/components/vitest.ts",
|
|
20686
|
-
"line":
|
|
20687
|
+
"line": 446
|
|
20687
20688
|
},
|
|
20688
20689
|
"name": "configureCoverageReporters",
|
|
20689
20690
|
"parameters": [
|
|
@@ -20706,7 +20707,7 @@
|
|
|
20706
20707
|
},
|
|
20707
20708
|
"locationInModule": {
|
|
20708
20709
|
"filename": "src/components/vitest.ts",
|
|
20709
|
-
"line":
|
|
20710
|
+
"line": 422
|
|
20710
20711
|
},
|
|
20711
20712
|
"name": "configureEnvironment",
|
|
20712
20713
|
"parameters": [
|
|
@@ -20724,7 +20725,7 @@
|
|
|
20724
20725
|
},
|
|
20725
20726
|
"locationInModule": {
|
|
20726
20727
|
"filename": "src/components/vitest.ts",
|
|
20727
|
-
"line":
|
|
20728
|
+
"line": 451
|
|
20728
20729
|
},
|
|
20729
20730
|
"name": "configureGlobals"
|
|
20730
20731
|
},
|
|
@@ -20735,7 +20736,7 @@
|
|
|
20735
20736
|
},
|
|
20736
20737
|
"locationInModule": {
|
|
20737
20738
|
"filename": "src/components/vitest.ts",
|
|
20738
|
-
"line":
|
|
20739
|
+
"line": 402
|
|
20739
20740
|
},
|
|
20740
20741
|
"name": "preSynthesize",
|
|
20741
20742
|
"overrides": "projen.Component"
|
|
@@ -21172,6 +21173,58 @@
|
|
|
21172
21173
|
"primitive": "string"
|
|
21173
21174
|
}
|
|
21174
21175
|
},
|
|
21176
|
+
{
|
|
21177
|
+
"abstract": true,
|
|
21178
|
+
"docs": {
|
|
21179
|
+
"default": "- no additional top-level options",
|
|
21180
|
+
"example": "{ resolve: { alias: { \"@\": \"/src\" } } }",
|
|
21181
|
+
"remarks": "Values are rendered as JSON, so they must be JSON-serializable (no functions or regular expressions,\nwhich rules out plugins). Use `extraTestConfig` for `test` options.",
|
|
21182
|
+
"see": "https://vitest.dev/config/",
|
|
21183
|
+
"stability": "stable",
|
|
21184
|
+
"summary": "Additional top-level config options, next to `test`, such as `resolve`."
|
|
21185
|
+
},
|
|
21186
|
+
"immutable": true,
|
|
21187
|
+
"locationInModule": {
|
|
21188
|
+
"filename": "src/components/vitest.ts",
|
|
21189
|
+
"line": 312
|
|
21190
|
+
},
|
|
21191
|
+
"name": "extraConfig",
|
|
21192
|
+
"optional": true,
|
|
21193
|
+
"type": {
|
|
21194
|
+
"collection": {
|
|
21195
|
+
"elementtype": {
|
|
21196
|
+
"primitive": "any"
|
|
21197
|
+
},
|
|
21198
|
+
"kind": "map"
|
|
21199
|
+
}
|
|
21200
|
+
}
|
|
21201
|
+
},
|
|
21202
|
+
{
|
|
21203
|
+
"abstract": true,
|
|
21204
|
+
"docs": {
|
|
21205
|
+
"default": "- no additional test options",
|
|
21206
|
+
"example": "{ setupFiles: [\"test/setup.ts\"], expect: { requireAssertions: true } }",
|
|
21207
|
+
"remarks": "Deep-merged over the options generated from `config`: objects are merged, other values (including\narrays) replace the generated value. Values are rendered as JSON, so they must be JSON-serializable\n(no functions or regular expressions).",
|
|
21208
|
+
"see": "https://vitest.dev/config/",
|
|
21209
|
+
"stability": "stable",
|
|
21210
|
+
"summary": "Additional `test` options for settings that `config` doesn't cover, such as `setupFiles` or `expect`."
|
|
21211
|
+
},
|
|
21212
|
+
"immutable": true,
|
|
21213
|
+
"locationInModule": {
|
|
21214
|
+
"filename": "src/components/vitest.ts",
|
|
21215
|
+
"line": 300
|
|
21216
|
+
},
|
|
21217
|
+
"name": "extraTestConfig",
|
|
21218
|
+
"optional": true,
|
|
21219
|
+
"type": {
|
|
21220
|
+
"collection": {
|
|
21221
|
+
"elementtype": {
|
|
21222
|
+
"primitive": "any"
|
|
21223
|
+
},
|
|
21224
|
+
"kind": "map"
|
|
21225
|
+
}
|
|
21226
|
+
}
|
|
21227
|
+
},
|
|
21175
21228
|
{
|
|
21176
21229
|
"abstract": true,
|
|
21177
21230
|
"docs": {
|
|
@@ -21194,6 +21247,6 @@
|
|
|
21194
21247
|
"symbolId": "src/components/vitest:VitestOptions"
|
|
21195
21248
|
}
|
|
21196
21249
|
},
|
|
21197
|
-
"version": "0.3.
|
|
21198
|
-
"fingerprint": "
|
|
21250
|
+
"version": "0.3.79",
|
|
21251
|
+
"fingerprint": "VRPwvbb0ZYcBikmET25BdRi+oXVjSIHOXFDkc0B/2DE="
|
|
21199
21252
|
}
|
package/README.md
CHANGED
|
@@ -175,6 +175,24 @@ new Vitest(project, {
|
|
|
175
175
|
Type checking runs against the project's development tsconfig (`test/tsconfig.json`) unless
|
|
176
176
|
`config.typecheckTsconfig` says otherwise.
|
|
177
177
|
|
|
178
|
+
For Vitest settings that `config` doesn't cover, use `extraTestConfig` (merged into `test`) and
|
|
179
|
+
`extraConfig` (top-level options next to `test`):
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
new Vitest(project, {
|
|
183
|
+
extraTestConfig: {
|
|
184
|
+
setupFiles: ["test/setup.ts"],
|
|
185
|
+
},
|
|
186
|
+
extraConfig: {
|
|
187
|
+
resolve: { alias: { "@": "/src" } },
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
`extraTestConfig` is deep-merged over the generated `test` options: objects merge, and other values
|
|
193
|
+
(including arrays) replace the generated value. Both options are rendered as JSON, so their values
|
|
194
|
+
can't contain functions or regular expressions, which rules out plugins.
|
|
195
|
+
|
|
178
196
|
#### TypeDoc
|
|
179
197
|
|
|
180
198
|
[TypeDoc](https://typedoc.org) documentation generation component.
|