@mrgrain/cdk-esbuild 4.0.0-alpha.5 → 4.0.0-alpha.8

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 CHANGED
@@ -7,9 +7,6 @@
7
7
  ],
8
8
  "url": "https://moritzkornher.de"
9
9
  },
10
- "bundled": {
11
- "which": "^2.0.2"
12
- },
13
10
  "dependencies": {
14
11
  "aws-cdk-lib": "^2.0.0",
15
12
  "constructs": "^10.0.5"
@@ -2780,7 +2777,7 @@
2780
2777
  "stability": "stable"
2781
2778
  },
2782
2779
  "homepage": "https://github.com/mrgrain/cdk-esbuild",
2783
- "jsiiVersion": "1.60.1 (build 2799dc8)",
2780
+ "jsiiVersion": "1.61.0 (build abf4039)",
2784
2781
  "keywords": [
2785
2782
  "aws-cdk",
2786
2783
  "bundler",
@@ -2803,7 +2800,7 @@
2803
2800
  },
2804
2801
  "name": "@mrgrain/cdk-esbuild",
2805
2802
  "readme": {
2806
- "markdown": "# cdk-esbuild\n\n_CDK constructs for [esbuild](https://github.com/evanw/esbuild), an extremely fast JavaScript bundler_\n\n[Getting started](#getting-started) | [Migrating to v3](#migrating-to-v3) |\n[Documentation](#documentation) | [API Reference](#api-reference) | [Versioning](#versioning)\n\n> This version is compatible with AWS CDK v2. For the previous, AWS CDK v1 compatible release, see [cdk-esbuild@v2](https://github.com/mrgrain/cdk-esbuild/tree/v2).\n\n## Why?\n\n_esbuild_ is an extremely fast bundler and minifier for Typescript and JavaScript.\nThis package makes _esbuild_ available to deploy lambda functions, static websites or to publish build artefacts (assets) for further use.\n\nAWS CDK [supports _esbuild_ with Lambda Functions](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-nodejs-readme.html). However the implementation cannot be used with any other Constructs and doesn't expose all of _esbuild_'s build interface.\n\nThis package is running _esbuild_ directly in Node.js and bypasses Docker which the AWS CDK implementation uses. The approach is quicker and easier to use for Node.js users, but incompatible with other languages.\n\n**Production readiness**\n\nThis package is stable and ready to be used in production, as many do. However _esbuild_ has not yet released a version 1.0.0 and its API is still in active development. Please read the guide on [esbuild's production readiness](https://esbuild.github.io/faq/#production-readiness).\n\nNotably upgrades of the _esbuild_ minimum version requirement will be introduced in **minor versions** of this package and will inherit breaking changes from _esbuild_.\n\n## Getting started\n\nInstall `cdk-esbuild`:\n\n```\nnpm install @mrgrain/cdk-esbuild@3\n```\n\nIf _peer_ or _optional dependencies_ are not installed automatically (e.g. when using npm v4-6), please use this command to install all of them:\n\n```\nnpm install @mrgrain/cdk-esbuild@3 esbuild\n```\n\n### AWS Lambda: Serverless function\n\n> 💡 See [Lambda Function](examples/lambda) for a complete working example of a how to deploy a lambda function.\n\nUse `TypeScriptCode` as the `code` of a [lambda function](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html#code):\n\n```ts\nimport * as lambda from \"aws-cdk-lib/aws-lambda\";\nimport { TypeScriptCode } from \"@mrgrain/cdk-esbuild\";\n\nconst bundledCode = new TypeScriptCode(\"src/index.ts\");\n\nconst fn = new lambda.Function(stack, \"MyFunction\", {\n runtime: lambda.Runtime.NODEJS_16_X,\n handler: \"index.handler\",\n code: bundledCode,\n});\n```\n\n### AWS S3: Static Website\n\n> 💡 See [Static Website with React](examples/website) for a complete working example of a how to deploy a React app to S3.\n\nUse `TypeScriptSource` as one of the `sources` of a [static website deployment](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-s3-deployment-readme.html#roadmap):\n\n```ts\nimport * as s3 from \"aws-cdk-lib/aws-s3\";\nimport * as s3deploy from \"aws-cdk-lib/aws-s3-deployment\";\nimport { TypeScriptSource } from \"@mrgrain/cdk-esbuild\";\n\nconst websiteBundle = new TypeScriptSource(\"src/index.tsx\");\n\nconst websiteBucket = new s3.Bucket(stack, \"WebsiteBucket\", {\n autoDeleteObjects: true,\n publicReadAccess: true,\n removalPolicy: RemovalPolicy.DESTROY,\n websiteIndexDocument: \"index.html\",\n});\n\nnew s3deploy.BucketDeployment(stack, \"DeployWebsite\", {\n destinationBucket: websiteBucket,\n sources: [websiteBundle],\n});\n```\n\n### Amazon CloudWatch Synthetics: Canary monitoring\n\n> 💡 See [Monitored Website](examples/website) for a complete working example of a deployed and monitored website.\n\nSynthetics runs a canary to produce traffic to an application for monitoring purposes. Use `TypeScriptCode` as the `code` of a Canary test:\n\n> ℹ️ This feature depends on the `@aws-cdk/aws-synthetics-alpha` package which is a developer preview. You may need to update your source code when upgrading to a newer version of this package.\n>\n> ```\n> npm i @aws-cdk/aws-synthetics-alpha\n> ```\n\n```ts\nimport * as synthetics from \"@aws-cdk/aws-synthetics-alpha\";\nimport { TypeScriptCode } from \"@mrgrain/cdk-esbuild\";\n\nconst bundledCode = new TypeScriptCode(\"src/index.ts\", {\n buildOptions: {\n outdir: \"nodejs/node_modules\", // This is required by Synthetics\n },\n});\n\nconst canary = new synthetics.Canary(stack, \"MyCanary\", {\n runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_2,\n test: synthetics.Test.custom({\n code: bundledCode,\n handler: \"index.handler\",\n });\n});\n```\n\n## Documentation\n\nThe package exports various different constructs for use with existing CDK features. A major guiding design principal for this package is to _extend, don't replace_. Expect constructs that you can provide as props, not complete replacements.\n\nFor use in **Lambda Functions** and **Synthetic Canaries**, the following classes implement `lambda.Code` ([reference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Code.html)) and `synthetics.Code` ([reference](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-synthetics-alpha.Code.html)):\n\n- `TypeScriptCode` & `JavaScriptCode`\n\nInline code is only supported by **Lambda**:\n\n- `InlineTypeScriptCode` & `InlineJavaScriptCode`\n- `InlineTsxCode` & `InlineJsxCode`\n\nFor use with **S3 bucket deployments**, classes implementing `s3deploy.ISource` ([reference](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-s3-deployment-readme.html)):\n\n- `TypeScriptSource` & `JavaScriptSource`\n\n> _Code and Source constructs seamlessly plug-in to other high-level CDK constructs. They share the same set of parameters, props and build options._\n\nThe following classes power the other features. You normally won't have to use them, but they are there if you need them:\n\n- `TypeScriptAsset` & `JavaScriptAsset` implements `s3.Asset` ([reference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3_assets.Asset.html)) \\\n creates an asset uploaded to S3 which can be referenced by other constructs\n\n- `EsbuildBundler` implements `core.BundlingOptions` ([reference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.BundlingOptions.html)) \\\n provides an interface for a _esbuild_ bundler wherever needed\n\n### [API Reference](API.md)\n\nAuto-generated reference for classes and structs. This information is also available as part of your IDE's code completion.\n\n### Escape hatches\n\nIt's possible that you want to use an implementation of esbuild that's different to the default one. Common reasons are:\n\n- The current version constraints for esbuild are not suitable\n- To use a version of esbuild that is installed by any other means than `npm`, including Docker\n- Plugin support is needed for building\n\nFor these situations, this package offers an escape hatch to bypass regular the implementation and provide a custom build and transform function.\n\n#### Custom build function\n\n> 💡 See [Using esbuild with plugins](examples/esbuild-with-plugins) for a complete working example of a custom build function using this escape hatch.\n\nConstructs that result in starting a build, take a `buildFn` as optional prop. While the defined type for this function is `any`, it must implement the same signature as esbuild's `buildSync` function.\n\n```ts\nnew TypeScriptCode(\"fixtures/handlers/ts-handler.ts\", {\n buildFn: (options: BuildOptions): BuildResult => {\n try {\n // custom implementation returning BuildResult\n } catch (error) {\n // throw BuildFailure exception here\n }\n },\n});\n```\n\nInstead of esbuild, the provided function will be invoked with the calculated build options. The custom build function can amend, change or discard any of these. However integration with CDK relies heavily on the values `outdir`/`outfile` are set to and it's usually required to use them unchanged.\n\nFailures have to cause a `BuildFailure` exception in order to be fully handled.\n\n#### Custom transform function\n\nConstructs that result in starting a transformation, take a `transformFn` as optional prop. While the defined type for this function is `any`, it must implement the same signature as esbuild's `transformSync` function.\n\n```ts\nnew InlineTypeScriptCode(\"let x: number = 1\", {\n transformFn: (options: TransformOptions): TransformResult => {\n try {\n // custom implementation returning TransformResult\n } catch (error) {\n // throw TransformFailure exception here\n }\n },,\n});\n```\n\nInstead of esbuild, the provided function will be invoked with the calculated transform options. The custom transform function can amend, change or discard any of these.\n\nFailures have to cause a `TransformFailure` exception in order to be fully handled.\n\n### Migrating to v3\n\nThe release of cdk-esbuild v3 brings compatibility with AWS CDK v2. Furthermore all deprecated properties and classes have been removed. In particular `InlineCode` classes now take `TransformerProps` as second parameter instead of transform options.\n\n#### Upgrading\n\n- This version requires AWS CDK v2. Follow the [official migration guide](https://docs.aws.amazon.com/cdk/latest/guide/work-with-cdk-v2.html) to upgrade.\n- Update the package dependency to v3: `npm install --save @mrgrain/cdk-esbuild@^3.0.0`\n- `esbuild` is installed as an optional dependency. If your setup does not automatically install optional dependencies, make sure to add it as an explicit dependency.\n- Any use of `InlineCode` variations has to be updated. Previously the second parameter was either of type `TransformerProps` or `TransformOptions`. Now it must be `TransformerProps`.\\\n If the passed value is of type `TransformOptions`, turn it into the correct type like this:\n\n ```ts\n const oldOptions: TransformOptions = {...}\n\n new InlineTypeScriptCode('// inline code', {\n transformOptions: oldOptions\n });\n ```\n\n## Versioning\n\nThis package follows [Semantic Versioning](https://semver.org/), with the exception of upgrades to `esbuild`. These will be released as **minor versions** and often include breaking changes from `esbuild`.\n\n### Npm Tags\n\nSome users prefer to use tags over version ranges. The following stable tags are available for use:\n\n- `cdk-v1`, `cdk-v2` are provided for the latest release compatible with each version of the AWS CDK.\n\n- `latest` is the most recent stable release.\n\nThese tags also exist, but usage is strongly not recommended:\n\n- `unstable`, `next` are used for pre-release of the current and next major version respectively.\n\n- ~~`cdk-1.x.x`~~ tags have been deprecated in favour of `cdk-v1`. Use that one instead.\n\n## Roadmap & Contributions\n\n[The project's roadmap is available on GitHub.](https://github.com/mrgrain/cdk-esbuild/projects/1) Please submit any feature requests as issues to the repository.\n\nAll contributions are welcome, no matter if they are for already planned or completely new features.\n\n## Library authors\n\nBuilding a library consumed by other packages that relies on `cdk-esbuild` might require you to set `buildOptions.absWorkingDir`. The easiest way to do this, is to resolve based on the directory name of the calling file, and traverse the tree upwards to the root of your library package (that's where `package.json` and `tsconfig.json` are):\n\n```ts\n// file: project/src/index.ts\nconst props = {\n buildOptions: {\n absWorkingDir: path.resolve(__dirname, \"..\"), // now: /user/project\n },\n};\n```\n\nThis will dynamically resolve to the correct path, wherever the package is installed.\n\nPlease open an issue if you encounter any difficulties.\n"
2803
+ "markdown": "# cdk-esbuild\n\n_CDK constructs for [esbuild](https://github.com/evanw/esbuild), an extremely fast JavaScript bundler_\n\n[Getting started](#getting-started)\n[Documentation](#documentation) | [API Reference](#api-reference) | [Versioning](#versioning) | [Upgrading from AWS CDK v1](#upgrading-from-aws-cdk-v1)\n\n[![View on Construct Hub](https://constructs.dev/badge?package=%40mrgrain%2Fcdk-esbuild)](https://constructs.dev/packages/@mrgrain/cdk-esbuild)\n\n## Why?\n\n_esbuild_ is an extremely fast bundler and minifier for Typescript and JavaScript.\nThis package makes _esbuild_ available to deploy lambda functions, static websites or to publish build artefacts (assets) for further use.\n\nAWS CDK [supports _esbuild_ with Lambda Functions](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-nodejs-readme.html). However the implementation cannot be used with any other Constructs and doesn't expose all of _esbuild_'s build interface.\n\nThis package is running _esbuild_ directly in Node.js and bypasses Docker which the AWS CDK implementation uses. The approach is quicker and easier to use for Node.js users, but incompatible with other languages.\n\n**Production readiness**\n\nThis package is stable and ready to be used in production, as many do. However _esbuild_ has not yet released a version 1.0.0 and its API is still in active development. Please read the guide on [esbuild's production readiness](https://esbuild.github.io/faq/#production-readiness).\n\nNotably upgrades of the _esbuild_ minimum version requirement will be introduced in **minor versions** of this package and will inherit breaking changes from _esbuild_.\n\n## Getting started\n\nInstall `cdk-esbuild`:\n\n```\nnpm install @mrgrain/cdk-esbuild@3\n```\n\nIf _peer_ or _optional dependencies_ are not installed automatically (e.g. when using npm v4-6), please use this command to install all of them:\n\n```\nnpm install @mrgrain/cdk-esbuild@3 esbuild\n```\n\n### AWS Lambda: Serverless function\n\n> 💡 See [Lambda Function](examples/lambda) for a complete working example of a how to deploy a lambda function.\n\nUse `TypeScriptCode` as the `code` of a [lambda function](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html#code):\n\n```ts\nimport * as lambda from \"aws-cdk-lib/aws-lambda\";\nimport { TypeScriptCode } from \"@mrgrain/cdk-esbuild\";\n\nconst bundledCode = new TypeScriptCode(\"src/index.ts\");\n\nconst fn = new lambda.Function(stack, \"MyFunction\", {\n runtime: lambda.Runtime.NODEJS_16_X,\n handler: \"index.handler\",\n code: bundledCode,\n});\n```\n\n### AWS S3: Static Website\n\n> 💡 See [Static Website with React](examples/website) for a complete working example of a how to deploy a React app to S3.\n\nUse `TypeScriptSource` as one of the `sources` of a [static website deployment](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-s3-deployment-readme.html#roadmap):\n\n```ts\nimport * as s3 from \"aws-cdk-lib/aws-s3\";\nimport * as s3deploy from \"aws-cdk-lib/aws-s3-deployment\";\nimport { TypeScriptSource } from \"@mrgrain/cdk-esbuild\";\n\nconst websiteBundle = new TypeScriptSource(\"src/index.tsx\");\n\nconst websiteBucket = new s3.Bucket(stack, \"WebsiteBucket\", {\n autoDeleteObjects: true,\n publicReadAccess: true,\n removalPolicy: RemovalPolicy.DESTROY,\n websiteIndexDocument: \"index.html\",\n});\n\nnew s3deploy.BucketDeployment(stack, \"DeployWebsite\", {\n destinationBucket: websiteBucket,\n sources: [websiteBundle],\n});\n```\n\n### Amazon CloudWatch Synthetics: Canary monitoring\n\n> 💡 See [Monitored Website](examples/website) for a complete working example of a deployed and monitored website.\n\nSynthetics runs a canary to produce traffic to an application for monitoring purposes. Use `TypeScriptCode` as the `code` of a Canary test:\n\n> ℹ️ This feature depends on the `@aws-cdk/aws-synthetics-alpha` package which is a developer preview. You may need to update your source code when upgrading to a newer version of this package.\n>\n> ```\n> npm i @aws-cdk/aws-synthetics-alpha\n> ```\n\n```ts\nimport * as synthetics from \"@aws-cdk/aws-synthetics-alpha\";\nimport { TypeScriptCode } from \"@mrgrain/cdk-esbuild\";\n\nconst bundledCode = new TypeScriptCode(\"src/index.ts\", {\n buildOptions: {\n outdir: \"nodejs/node_modules\", // This is required by Synthetics\n },\n});\n\nconst canary = new synthetics.Canary(stack, \"MyCanary\", {\n runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_2,\n test: synthetics.Test.custom({\n code: bundledCode,\n handler: \"index.handler\",\n });\n});\n```\n\n## Documentation\n\nThe package exports various different constructs for use with existing CDK features. A major guiding design principal for this package is to _extend, don't replace_. Expect constructs that you can provide as props, not complete replacements.\n\nFor use in **Lambda Functions** and **Synthetic Canaries**, the following classes implement `lambda.Code` ([reference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Code.html)) and `synthetics.Code` ([reference](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-synthetics-alpha.Code.html)):\n\n- `TypeScriptCode` & `JavaScriptCode`\n\nInline code is only supported by **Lambda**:\n\n- `InlineTypeScriptCode` & `InlineJavaScriptCode`\n- `InlineTsxCode` & `InlineJsxCode`\n\nFor use with **S3 bucket deployments**, classes implementing `s3deploy.ISource` ([reference](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-s3-deployment-readme.html)):\n\n- `TypeScriptSource` & `JavaScriptSource`\n\n> _Code and Source constructs seamlessly plug-in to other high-level CDK constructs. They share the same set of parameters, props and build options._\n\nThe following classes power the other features. You normally won't have to use them, but they are there if you need them:\n\n- `TypeScriptAsset` & `JavaScriptAsset` implements `s3.Asset` ([reference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3_assets.Asset.html)) \\\n creates an asset uploaded to S3 which can be referenced by other constructs\n\n- `EsbuildBundler` implements `core.BundlingOptions` ([reference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.BundlingOptions.html)) \\\n provides an interface for a _esbuild_ bundler wherever needed\n\n### [API Reference](API.md)\n\nAuto-generated reference for classes and structs. This information is also available as part of your IDE's code completion.\n\n### Escape hatches\n\nIt's possible that you want to use an implementation of esbuild that's different to the default one. Common reasons are:\n\n- The current version constraints for esbuild are not suitable\n- To use a version of esbuild that is installed by any other means than `npm`, including Docker\n- Plugin support is needed for building\n\nFor these situations, this package offers an escape hatch to bypass regular the implementation and provide a custom build and transform function.\n\n#### Esbuild binary path\n\nIt is possible to override the binary used by esbuild. The usual way to do this is to set the `ESBUILD_BINARY_PATH` environment variable. For convenience this package allows to set the binary path as a prop:\n\n```ts\nnew TypeScriptCode(\"fixtures/handlers/ts-handler.ts\", {\n esbuildBinaryPath: \"path/to/esbuild/binary\"\n});\n```\n\n#### Custom build function\n\n> 💡 See [Using esbuild with plugins](examples/esbuild-with-plugins) for a complete working example of a custom build function using this escape hatch.\n\nConstructs that result in starting a build, take a `buildFn` as optional prop. While the defined type for this function is `any`, it must implement the same signature as esbuild's `buildSync` function.\n\n```ts\nnew TypeScriptCode(\"fixtures/handlers/ts-handler.ts\", {\n buildFn: (options: BuildOptions): BuildResult => {\n try {\n // custom implementation returning BuildResult\n } catch (error) {\n // throw BuildFailure exception here\n }\n },\n});\n```\n\nInstead of esbuild, the provided function will be invoked with the calculated build options. The custom build function can amend, change or discard any of these. However integration with CDK relies heavily on the values `outdir`/`outfile` are set to and it's usually required to use them unchanged.\n\nFailures have to cause a `BuildFailure` exception in order to be fully handled.\n\n#### Custom transform function\n\nConstructs that result in starting a transformation, take a `transformFn` as optional prop. While the defined type for this function is `any`, it must implement the same signature as esbuild's `transformSync` function.\n\n```ts\nnew InlineTypeScriptCode(\"let x: number = 1\", {\n transformFn: (options: TransformOptions): TransformResult => {\n try {\n // custom implementation returning TransformResult\n } catch (error) {\n // throw TransformFailure exception here\n }\n },,\n});\n```\n\nInstead of esbuild, the provided function will be invoked with the calculated transform options. The custom transform function can amend, change or discard any of these.\n\nFailures have to cause a `TransformFailure` exception in order to be fully handled.\n\n### Upgrading from AWS CDK v1\n\nThis version is compatible with AWS CDK v2. For the previous, AWS CDK v1 compatible release, see [cdk-esbuild@v2](https://github.com/mrgrain/cdk-esbuild/tree/v2).\n\nTo upgrade from AWS CDK v1 and cdk-esbuild@v2, please follow these steps:\n\n- This version requires AWS CDK v2. Follow the [official migration guide](https://docs.aws.amazon.com/cdk/latest/guide/work-with-cdk-v2.html) to upgrade.\n- Update the package dependency to v3: `npm install --save @mrgrain/cdk-esbuild@^3.0.0`\n- `esbuild` is installed as an optional dependency. If your setup does not automatically install optional dependencies, make sure to add it as an explicit dependency.\n- Any use of `InlineCode` variations has to be updated. Previously the second parameter was either of type `TransformerProps` or `TransformOptions`. Now it must be `TransformerProps`.\\\n If the passed value is of type `TransformOptions`, turn it into the correct type like this:\n\n ```ts\n const oldOptions: TransformOptions = {...}\n\n new InlineTypeScriptCode('// inline code', {\n transformOptions: oldOptions\n });\n ```\n\n## Versioning\n\nThis package follows [Semantic Versioning](https://semver.org/), with the exception of upgrades to `esbuild`. These will be released as **minor versions** and often include breaking changes from `esbuild`.\n\n### Npm Tags\n\nSome users prefer to use tags over version ranges. The following stable tags are available for use:\n\n- `cdk-v1`, `cdk-v2` are provided for the latest release compatible with each version of the AWS CDK.\n\n- `latest` is the most recent stable release.\n\nThese tags also exist, but usage is strongly not recommended:\n\n- `unstable`, `next` are used for pre-release of the current and next major version respectively.\n\n- ~~`cdk-1.x.x`~~ tags have been deprecated in favour of `cdk-v1`. Use that one instead.\n\n## Roadmap & Contributions\n\n[The project's roadmap is available on GitHub.](https://github.com/mrgrain/cdk-esbuild/projects/1) Please submit any feature requests as issues to the repository.\n\nAll contributions are welcome, no matter if they are for already planned or completely new features.\n\n## Library authors\n\nBuilding a library consumed by other packages that relies on `cdk-esbuild` might require you to set `buildOptions.absWorkingDir`. The easiest way to do this, is to resolve based on the directory name of the calling file, and traverse the tree upwards to the root of your library package (that's where `package.json` and `tsconfig.json` are):\n\n```ts\n// file: project/src/index.ts\nconst props = {\n buildOptions: {\n absWorkingDir: path.resolve(__dirname, \"..\"), // now: /user/project\n },\n};\n```\n\nThis will dynamically resolve to the correct path, wherever the package is installed.\n\nPlease open an issue if you encounter any difficulties.\n"
2807
2804
  },
2808
2805
  "repository": {
2809
2806
  "type": "git",
@@ -2907,7 +2904,7 @@
2907
2904
  "kind": "interface",
2908
2905
  "locationInModule": {
2909
2906
  "filename": "src/esbuild-types.ts",
2910
- "line": 76
2907
+ "line": 78
2911
2908
  },
2912
2909
  "name": "BuildOptions",
2913
2910
  "properties": [
@@ -2920,7 +2917,7 @@
2920
2917
  "immutable": true,
2921
2918
  "locationInModule": {
2922
2919
  "filename": "src/esbuild-types.ts",
2923
- "line": 128
2920
+ "line": 130
2924
2921
  },
2925
2922
  "name": "absWorkingDir",
2926
2923
  "optional": true,
@@ -2937,7 +2934,7 @@
2937
2934
  "immutable": true,
2938
2935
  "locationInModule": {
2939
2936
  "filename": "src/esbuild-types.ts",
2940
- "line": 106
2937
+ "line": 108
2941
2938
  },
2942
2939
  "name": "allowOverwrite",
2943
2940
  "optional": true,
@@ -2954,7 +2951,7 @@
2954
2951
  "immutable": true,
2955
2952
  "locationInModule": {
2956
2953
  "filename": "src/esbuild-types.ts",
2957
- "line": 118
2954
+ "line": 120
2958
2955
  },
2959
2956
  "name": "assetNames",
2960
2957
  "optional": true,
@@ -2971,7 +2968,7 @@
2971
2968
  "immutable": true,
2972
2969
  "locationInModule": {
2973
2970
  "filename": "src/esbuild-types.ts",
2974
- "line": 122
2971
+ "line": 124
2975
2972
  },
2976
2973
  "name": "banner",
2977
2974
  "optional": true,
@@ -2993,7 +2990,7 @@
2993
2990
  "immutable": true,
2994
2991
  "locationInModule": {
2995
2992
  "filename": "src/esbuild-types.ts",
2996
- "line": 78
2993
+ "line": 80
2997
2994
  },
2998
2995
  "name": "bundle",
2999
2996
  "optional": true,
@@ -3010,7 +3007,7 @@
3010
3007
  "immutable": true,
3011
3008
  "locationInModule": {
3012
3009
  "filename": "src/esbuild-types.ts",
3013
- "line": 46
3010
+ "line": 48
3014
3011
  },
3015
3012
  "name": "charset",
3016
3013
  "optional": true,
@@ -3027,7 +3024,7 @@
3027
3024
  "immutable": true,
3028
3025
  "locationInModule": {
3029
3026
  "filename": "src/esbuild-types.ts",
3030
- "line": 116
3027
+ "line": 118
3031
3028
  },
3032
3029
  "name": "chunkNames",
3033
3030
  "optional": true,
@@ -3044,7 +3041,7 @@
3044
3041
  "immutable": true,
3045
3042
  "locationInModule": {
3046
3043
  "filename": "src/esbuild-types.ts",
3047
- "line": 67
3044
+ "line": 69
3048
3045
  },
3049
3046
  "name": "color",
3050
3047
  "optional": true,
@@ -3061,7 +3058,7 @@
3061
3058
  "immutable": true,
3062
3059
  "locationInModule": {
3063
3060
  "filename": "src/esbuild-types.ts",
3064
- "line": 102
3061
+ "line": 104
3065
3062
  },
3066
3063
  "name": "conditions",
3067
3064
  "optional": true,
@@ -3083,7 +3080,7 @@
3083
3080
  "immutable": true,
3084
3081
  "locationInModule": {
3085
3082
  "filename": "src/esbuild-types.ts",
3086
- "line": 60
3083
+ "line": 62
3087
3084
  },
3088
3085
  "name": "define",
3089
3086
  "optional": true,
@@ -3105,7 +3102,7 @@
3105
3102
  "immutable": true,
3106
3103
  "locationInModule": {
3107
3104
  "filename": "src/esbuild-types.ts",
3108
- "line": 36
3105
+ "line": 38
3109
3106
  },
3110
3107
  "name": "drop",
3111
3108
  "optional": true,
@@ -3127,7 +3124,7 @@
3127
3124
  "immutable": true,
3128
3125
  "locationInModule": {
3129
3126
  "filename": "src/esbuild-types.ts",
3130
- "line": 114
3127
+ "line": 116
3131
3128
  },
3132
3129
  "name": "entryNames",
3133
3130
  "optional": true,
@@ -3144,7 +3141,7 @@
3144
3141
  "immutable": true,
3145
3142
  "locationInModule": {
3146
3143
  "filename": "src/esbuild-types.ts",
3147
- "line": 94
3144
+ "line": 96
3148
3145
  },
3149
3146
  "name": "external",
3150
3147
  "optional": true,
@@ -3166,7 +3163,7 @@
3166
3163
  "immutable": true,
3167
3164
  "locationInModule": {
3168
3165
  "filename": "src/esbuild-types.ts",
3169
- "line": 124
3166
+ "line": 126
3170
3167
  },
3171
3168
  "name": "footer",
3172
3169
  "optional": true,
@@ -3222,7 +3219,7 @@
3222
3219
  "immutable": true,
3223
3220
  "locationInModule": {
3224
3221
  "filename": "src/esbuild-types.ts",
3225
- "line": 50
3222
+ "line": 52
3226
3223
  },
3227
3224
  "name": "ignoreAnnotations",
3228
3225
  "optional": true,
@@ -3239,7 +3236,7 @@
3239
3236
  "immutable": true,
3240
3237
  "locationInModule": {
3241
3238
  "filename": "src/esbuild-types.ts",
3242
- "line": 126
3239
+ "line": 128
3243
3240
  },
3244
3241
  "name": "incremental",
3245
3242
  "optional": true,
@@ -3256,7 +3253,7 @@
3256
3253
  "immutable": true,
3257
3254
  "locationInModule": {
3258
3255
  "filename": "src/esbuild-types.ts",
3259
- "line": 120
3256
+ "line": 122
3260
3257
  },
3261
3258
  "name": "inject",
3262
3259
  "optional": true,
@@ -3278,7 +3275,7 @@
3278
3275
  "immutable": true,
3279
3276
  "locationInModule": {
3280
3277
  "filename": "src/esbuild-types.ts",
3281
- "line": 53
3278
+ "line": 55
3282
3279
  },
3283
3280
  "name": "jsx",
3284
3281
  "optional": true,
@@ -3295,7 +3292,7 @@
3295
3292
  "immutable": true,
3296
3293
  "locationInModule": {
3297
3294
  "filename": "src/esbuild-types.ts",
3298
- "line": 55
3295
+ "line": 57
3299
3296
  },
3300
3297
  "name": "jsxFactory",
3301
3298
  "optional": true,
@@ -3312,7 +3309,7 @@
3312
3309
  "immutable": true,
3313
3310
  "locationInModule": {
3314
3311
  "filename": "src/esbuild-types.ts",
3315
- "line": 57
3312
+ "line": 59
3316
3313
  },
3317
3314
  "name": "jsxFragment",
3318
3315
  "optional": true,
@@ -3329,7 +3326,7 @@
3329
3326
  "immutable": true,
3330
3327
  "locationInModule": {
3331
3328
  "filename": "src/esbuild-types.ts",
3332
- "line": 64
3329
+ "line": 66
3333
3330
  },
3334
3331
  "name": "keepNames",
3335
3332
  "optional": true,
@@ -3363,7 +3360,7 @@
3363
3360
  "immutable": true,
3364
3361
  "locationInModule": {
3365
3362
  "filename": "src/esbuild-types.ts",
3366
- "line": 96
3363
+ "line": 98
3367
3364
  },
3368
3365
  "name": "loader",
3369
3366
  "optional": true,
@@ -3385,7 +3382,7 @@
3385
3382
  "immutable": true,
3386
3383
  "locationInModule": {
3387
3384
  "filename": "src/esbuild-types.ts",
3388
- "line": 69
3385
+ "line": 71
3389
3386
  },
3390
3387
  "name": "logLevel",
3391
3388
  "optional": true,
@@ -3402,7 +3399,7 @@
3402
3399
  "immutable": true,
3403
3400
  "locationInModule": {
3404
3401
  "filename": "src/esbuild-types.ts",
3405
- "line": 71
3402
+ "line": 73
3406
3403
  },
3407
3404
  "name": "logLimit",
3408
3405
  "optional": true,
@@ -3419,7 +3416,7 @@
3419
3416
  "immutable": true,
3420
3417
  "locationInModule": {
3421
3418
  "filename": "src/esbuild-types.ts",
3422
- "line": 73
3419
+ "line": 75
3423
3420
  },
3424
3421
  "name": "logOverride",
3425
3422
  "optional": true,
@@ -3441,7 +3438,7 @@
3441
3438
  "immutable": true,
3442
3439
  "locationInModule": {
3443
3440
  "filename": "src/esbuild-types.ts",
3444
- "line": 100
3441
+ "line": 102
3445
3442
  },
3446
3443
  "name": "mainFields",
3447
3444
  "optional": true,
@@ -3463,7 +3460,7 @@
3463
3460
  "immutable": true,
3464
3461
  "locationInModule": {
3465
3462
  "filename": "src/esbuild-types.ts",
3466
- "line": 34
3463
+ "line": 36
3467
3464
  },
3468
3465
  "name": "mangleCache",
3469
3466
  "optional": true,
@@ -3494,7 +3491,7 @@
3494
3491
  "immutable": true,
3495
3492
  "locationInModule": {
3496
3493
  "filename": "src/esbuild-types.ts",
3497
- "line": 28
3494
+ "line": 30
3498
3495
  },
3499
3496
  "name": "mangleProps",
3500
3497
  "optional": true,
@@ -3511,7 +3508,7 @@
3511
3508
  "immutable": true,
3512
3509
  "locationInModule": {
3513
3510
  "filename": "src/esbuild-types.ts",
3514
- "line": 32
3511
+ "line": 34
3515
3512
  },
3516
3513
  "name": "mangleQuoted",
3517
3514
  "optional": true,
@@ -3528,7 +3525,7 @@
3528
3525
  "immutable": true,
3529
3526
  "locationInModule": {
3530
3527
  "filename": "src/esbuild-types.ts",
3531
- "line": 86
3528
+ "line": 88
3532
3529
  },
3533
3530
  "name": "metafile",
3534
3531
  "optional": true,
@@ -3545,7 +3542,7 @@
3545
3542
  "immutable": true,
3546
3543
  "locationInModule": {
3547
3544
  "filename": "src/esbuild-types.ts",
3548
- "line": 38
3545
+ "line": 40
3549
3546
  },
3550
3547
  "name": "minify",
3551
3548
  "optional": true,
@@ -3562,7 +3559,7 @@
3562
3559
  "immutable": true,
3563
3560
  "locationInModule": {
3564
3561
  "filename": "src/esbuild-types.ts",
3565
- "line": 42
3562
+ "line": 44
3566
3563
  },
3567
3564
  "name": "minifyIdentifiers",
3568
3565
  "optional": true,
@@ -3579,7 +3576,7 @@
3579
3576
  "immutable": true,
3580
3577
  "locationInModule": {
3581
3578
  "filename": "src/esbuild-types.ts",
3582
- "line": 44
3579
+ "line": 46
3583
3580
  },
3584
3581
  "name": "minifySyntax",
3585
3582
  "optional": true,
@@ -3596,7 +3593,7 @@
3596
3593
  "immutable": true,
3597
3594
  "locationInModule": {
3598
3595
  "filename": "src/esbuild-types.ts",
3599
- "line": 40
3596
+ "line": 42
3600
3597
  },
3601
3598
  "name": "minifyWhitespace",
3602
3599
  "optional": true,
@@ -3613,7 +3610,7 @@
3613
3610
  "immutable": true,
3614
3611
  "locationInModule": {
3615
3612
  "filename": "src/esbuild-types.ts",
3616
- "line": 130
3613
+ "line": 132
3617
3614
  },
3618
3615
  "name": "nodePaths",
3619
3616
  "optional": true,
@@ -3635,7 +3632,7 @@
3635
3632
  "immutable": true,
3636
3633
  "locationInModule": {
3637
3634
  "filename": "src/esbuild-types.ts",
3638
- "line": 90
3635
+ "line": 92
3639
3636
  },
3640
3637
  "name": "outbase",
3641
3638
  "optional": true,
@@ -3652,7 +3649,7 @@
3652
3649
  "immutable": true,
3653
3650
  "locationInModule": {
3654
3651
  "filename": "src/esbuild-types.ts",
3655
- "line": 88
3652
+ "line": 90
3656
3653
  },
3657
3654
  "name": "outdir",
3658
3655
  "optional": true,
@@ -3669,7 +3666,7 @@
3669
3666
  "immutable": true,
3670
3667
  "locationInModule": {
3671
3668
  "filename": "src/esbuild-types.ts",
3672
- "line": 110
3669
+ "line": 112
3673
3670
  },
3674
3671
  "name": "outExtension",
3675
3672
  "optional": true,
@@ -3691,7 +3688,7 @@
3691
3688
  "immutable": true,
3692
3689
  "locationInModule": {
3693
3690
  "filename": "src/esbuild-types.ts",
3694
- "line": 84
3691
+ "line": 86
3695
3692
  },
3696
3693
  "name": "outfile",
3697
3694
  "optional": true,
@@ -3708,7 +3705,7 @@
3708
3705
  "immutable": true,
3709
3706
  "locationInModule": {
3710
3707
  "filename": "src/esbuild-types.ts",
3711
- "line": 92
3708
+ "line": 94
3712
3709
  },
3713
3710
  "name": "platform",
3714
3711
  "optional": true,
@@ -3725,7 +3722,7 @@
3725
3722
  "immutable": true,
3726
3723
  "locationInModule": {
3727
3724
  "filename": "src/esbuild-types.ts",
3728
- "line": 82
3725
+ "line": 84
3729
3726
  },
3730
3727
  "name": "preserveSymlinks",
3731
3728
  "optional": true,
@@ -3742,7 +3739,7 @@
3742
3739
  "immutable": true,
3743
3740
  "locationInModule": {
3744
3741
  "filename": "src/esbuild-types.ts",
3745
- "line": 112
3742
+ "line": 114
3746
3743
  },
3747
3744
  "name": "publicPath",
3748
3745
  "optional": true,
@@ -3759,7 +3756,7 @@
3759
3756
  "immutable": true,
3760
3757
  "locationInModule": {
3761
3758
  "filename": "src/esbuild-types.ts",
3762
- "line": 62
3759
+ "line": 64
3763
3760
  },
3764
3761
  "name": "pure",
3765
3762
  "optional": true,
@@ -3781,7 +3778,7 @@
3781
3778
  "immutable": true,
3782
3779
  "locationInModule": {
3783
3780
  "filename": "src/esbuild-types.ts",
3784
- "line": 30
3781
+ "line": 32
3785
3782
  },
3786
3783
  "name": "reserveProps",
3787
3784
  "optional": true,
@@ -3798,7 +3795,7 @@
3798
3795
  "immutable": true,
3799
3796
  "locationInModule": {
3800
3797
  "filename": "src/esbuild-types.ts",
3801
- "line": 98
3798
+ "line": 100
3802
3799
  },
3803
3800
  "name": "resolveExtensions",
3804
3801
  "optional": true,
@@ -3880,7 +3877,7 @@
3880
3877
  "immutable": true,
3881
3878
  "locationInModule": {
3882
3879
  "filename": "src/esbuild-types.ts",
3883
- "line": 80
3880
+ "line": 82
3884
3881
  },
3885
3882
  "name": "splitting",
3886
3883
  "optional": true,
@@ -3888,6 +3885,28 @@
3888
3885
  "primitive": "boolean"
3889
3886
  }
3890
3887
  },
3888
+ {
3889
+ "abstract": true,
3890
+ "docs": {
3891
+ "stability": "stable",
3892
+ "summary": "Documentation: https://esbuild.github.io/api/#supported."
3893
+ },
3894
+ "immutable": true,
3895
+ "locationInModule": {
3896
+ "filename": "src/esbuild-types.ts",
3897
+ "line": 27
3898
+ },
3899
+ "name": "supported",
3900
+ "optional": true,
3901
+ "type": {
3902
+ "collection": {
3903
+ "elementtype": {
3904
+ "primitive": "boolean"
3905
+ },
3906
+ "kind": "map"
3907
+ }
3908
+ }
3909
+ },
3891
3910
  {
3892
3911
  "abstract": true,
3893
3912
  "docs": {
@@ -3928,7 +3947,7 @@
3928
3947
  "immutable": true,
3929
3948
  "locationInModule": {
3930
3949
  "filename": "src/esbuild-types.ts",
3931
- "line": 48
3950
+ "line": 50
3932
3951
  },
3933
3952
  "name": "treeShaking",
3934
3953
  "optional": true,
@@ -3945,7 +3964,7 @@
3945
3964
  "immutable": true,
3946
3965
  "locationInModule": {
3947
3966
  "filename": "src/esbuild-types.ts",
3948
- "line": 108
3967
+ "line": 110
3949
3968
  },
3950
3969
  "name": "tsconfig",
3951
3970
  "optional": true,
@@ -3962,7 +3981,7 @@
3962
3981
  "immutable": true,
3963
3982
  "locationInModule": {
3964
3983
  "filename": "src/esbuild-types.ts",
3965
- "line": 104
3984
+ "line": 106
3966
3985
  },
3967
3986
  "name": "write",
3968
3987
  "optional": true,
@@ -4083,6 +4102,24 @@
4083
4102
  ]
4084
4103
  }
4085
4104
  }
4105
+ },
4106
+ {
4107
+ "abstract": true,
4108
+ "docs": {
4109
+ "remarks": "This is the same as setting the ESBUILD_BINARY_PATH environment variable.",
4110
+ "stability": "experimental",
4111
+ "summary": "Path to the binary used by esbuild."
4112
+ },
4113
+ "immutable": true,
4114
+ "locationInModule": {
4115
+ "filename": "src/bundler.ts",
4116
+ "line": 88
4117
+ },
4118
+ "name": "esbuildBinaryPath",
4119
+ "optional": true,
4120
+ "type": {
4121
+ "primitive": "string"
4122
+ }
4086
4123
  }
4087
4124
  ],
4088
4125
  "symbolId": "src/bundler:BundlerProps"
@@ -4091,34 +4128,119 @@
4091
4128
  "assembly": "@mrgrain/cdk-esbuild",
4092
4129
  "datatype": true,
4093
4130
  "docs": {
4094
- "stability": "stable"
4131
+ "stability": "stable",
4132
+ "summary": "Result of binding `Code` into a `Function`."
4095
4133
  },
4096
4134
  "fqn": "@mrgrain/cdk-esbuild.CodeConfig",
4097
4135
  "kind": "interface",
4098
4136
  "locationInModule": {
4099
- "filename": "src/code.ts",
4100
- "line": 18
4137
+ "filename": "node_modules/aws-cdk-lib/aws-lambda/lib/code.d.ts",
4138
+ "line": 94
4101
4139
  },
4102
4140
  "name": "CodeConfig",
4103
4141
  "properties": [
4104
4142
  {
4105
4143
  "abstract": true,
4106
4144
  "docs": {
4145
+ "default": "- code is not an ECR container image",
4107
4146
  "stability": "stable",
4108
- "summary": "The location of the code in S3."
4147
+ "summary": "Docker image configuration (mutually exclusive with `s3Location` and `inlineCode`)."
4109
4148
  },
4110
4149
  "immutable": true,
4111
4150
  "locationInModule": {
4112
- "filename": "src/code.ts",
4113
- "line": 24
4151
+ "filename": "node_modules/aws-cdk-lib/aws-lambda/lib/code.d.ts",
4152
+ "line": 115
4153
+ },
4154
+ "name": "image",
4155
+ "optional": true,
4156
+ "type": {
4157
+ "fqn": "aws-cdk-lib.aws_lambda.CodeImageConfig"
4158
+ }
4159
+ },
4160
+ {
4161
+ "abstract": true,
4162
+ "docs": {
4163
+ "default": "- code is not inline code",
4164
+ "stability": "stable",
4165
+ "summary": "Inline code (mutually exclusive with `s3Location` and `image`)."
4166
+ },
4167
+ "immutable": true,
4168
+ "locationInModule": {
4169
+ "filename": "node_modules/aws-cdk-lib/aws-lambda/lib/code.d.ts",
4170
+ "line": 108
4171
+ },
4172
+ "name": "inlineCode",
4173
+ "optional": true,
4174
+ "type": {
4175
+ "primitive": "string"
4176
+ }
4177
+ },
4178
+ {
4179
+ "abstract": true,
4180
+ "docs": {
4181
+ "default": "- code is not an s3 location",
4182
+ "stability": "stable",
4183
+ "summary": "The location of the code in S3 (mutually exclusive with `inlineCode` and `image`)."
4184
+ },
4185
+ "immutable": true,
4186
+ "locationInModule": {
4187
+ "filename": "node_modules/aws-cdk-lib/aws-lambda/lib/code.d.ts",
4188
+ "line": 101
4114
4189
  },
4115
4190
  "name": "s3Location",
4191
+ "optional": true,
4116
4192
  "type": {
4117
4193
  "fqn": "aws-cdk-lib.aws_s3.Location"
4118
4194
  }
4119
4195
  }
4120
4196
  ],
4121
- "symbolId": "src/code:CodeConfig"
4197
+ "symbolId": "aws-lambda/lib/code:CodeConfig"
4198
+ },
4199
+ "@mrgrain/cdk-esbuild.EsbuildAsset": {
4200
+ "assembly": "@mrgrain/cdk-esbuild",
4201
+ "base": "aws-cdk-lib.aws_s3_assets.Asset",
4202
+ "docs": {
4203
+ "remarks": "You should always use `TypeScriptAsset` or `JavaScriptAsset`.",
4204
+ "stability": "experimental",
4205
+ "summary": "Represents a generic esbuild asset."
4206
+ },
4207
+ "fqn": "@mrgrain/cdk-esbuild.EsbuildAsset",
4208
+ "initializer": {
4209
+ "docs": {
4210
+ "stability": "stable"
4211
+ },
4212
+ "locationInModule": {
4213
+ "filename": "src/asset.ts",
4214
+ "line": 46
4215
+ },
4216
+ "parameters": [
4217
+ {
4218
+ "name": "scope",
4219
+ "type": {
4220
+ "fqn": "constructs.Construct"
4221
+ }
4222
+ },
4223
+ {
4224
+ "name": "id",
4225
+ "type": {
4226
+ "primitive": "string"
4227
+ }
4228
+ },
4229
+ {
4230
+ "name": "props",
4231
+ "type": {
4232
+ "fqn": "@mrgrain/cdk-esbuild.AssetProps"
4233
+ }
4234
+ }
4235
+ ]
4236
+ },
4237
+ "kind": "class",
4238
+ "locationInModule": {
4239
+ "filename": "src/asset.ts",
4240
+ "line": 42
4241
+ },
4242
+ "name": "EsbuildAsset",
4243
+ "symbolId": "src/asset:EsbuildAsset"
4122
4244
  },
4123
4245
  "@mrgrain/cdk-esbuild.EsbuildBundler": {
4124
4246
  "assembly": "@mrgrain/cdk-esbuild",
@@ -4134,7 +4256,7 @@
4134
4256
  },
4135
4257
  "locationInModule": {
4136
4258
  "filename": "src/bundler.ts",
4137
- "line": 106
4259
+ "line": 115
4138
4260
  },
4139
4261
  "parameters": [
4140
4262
  {
@@ -4185,7 +4307,7 @@
4185
4307
  "kind": "class",
4186
4308
  "locationInModule": {
4187
4309
  "filename": "src/bundler.ts",
4188
- "line": 88
4310
+ "line": 97
4189
4311
  },
4190
4312
  "name": "EsbuildBundler",
4191
4313
  "properties": [
@@ -4198,7 +4320,7 @@
4198
4320
  "immutable": true,
4199
4321
  "locationInModule": {
4200
4322
  "filename": "src/bundler.ts",
4201
- "line": 113
4323
+ "line": 122
4202
4324
  },
4203
4325
  "name": "entryPoints",
4204
4326
  "type": {
@@ -4235,7 +4357,7 @@
4235
4357
  "immutable": true,
4236
4358
  "locationInModule": {
4237
4359
  "filename": "src/bundler.ts",
4238
- "line": 101
4360
+ "line": 110
4239
4361
  },
4240
4362
  "name": "image",
4241
4363
  "type": {
@@ -4250,7 +4372,7 @@
4250
4372
  "immutable": true,
4251
4373
  "locationInModule": {
4252
4374
  "filename": "src/bundler.ts",
4253
- "line": 94
4375
+ "line": 103
4254
4376
  },
4255
4377
  "name": "local",
4256
4378
  "type": {
@@ -4265,7 +4387,7 @@
4265
4387
  "immutable": true,
4266
4388
  "locationInModule": {
4267
4389
  "filename": "src/bundler.ts",
4268
- "line": 120
4390
+ "line": 129
4269
4391
  },
4270
4392
  "name": "props",
4271
4393
  "type": {
@@ -4275,50 +4397,72 @@
4275
4397
  ],
4276
4398
  "symbolId": "src/bundler:EsbuildBundler"
4277
4399
  },
4278
- "@mrgrain/cdk-esbuild.InlineJavaScriptCode": {
4400
+ "@mrgrain/cdk-esbuild.EsbuildCode": {
4279
4401
  "assembly": "@mrgrain/cdk-esbuild",
4280
- "base": "aws-cdk-lib.aws_lambda.InlineCode",
4402
+ "base": "aws-cdk-lib.aws_lambda.Code",
4281
4403
  "docs": {
4404
+ "remarks": "You should always use `TypeScriptCode` or `JavaScriptCode`.",
4282
4405
  "stability": "experimental",
4283
- "summary": "An implementation of `lambda.InlineCode` using the esbuild Transform API. Inline function code is limited to 4 KiB after transformation."
4406
+ "summary": "Represents a generic esbuild code bundle."
4284
4407
  },
4285
- "fqn": "@mrgrain/cdk-esbuild.InlineJavaScriptCode",
4408
+ "fqn": "@mrgrain/cdk-esbuild.EsbuildCode",
4286
4409
  "initializer": {
4287
4410
  "docs": {
4288
4411
  "stability": "experimental"
4289
4412
  },
4290
4413
  "locationInModule": {
4291
- "filename": "src/inline-code.ts",
4292
- "line": 84
4414
+ "filename": "src/code.ts",
4415
+ "line": 51
4293
4416
  },
4294
4417
  "parameters": [
4295
4418
  {
4296
4419
  "docs": {
4297
- "stability": "experimental",
4298
- "summary": "The inline code to be transformed."
4420
+ "remarks": "E.g. `src/index.ts`.",
4421
+ "stability": "stable",
4422
+ "summary": "A relative path or list or map of relative paths to the entry points of your code from the root of the project."
4299
4423
  },
4300
- "name": "code",
4424
+ "name": "entryPoints",
4301
4425
  "type": {
4302
- "primitive": "string"
4426
+ "union": {
4427
+ "types": [
4428
+ {
4429
+ "primitive": "string"
4430
+ },
4431
+ {
4432
+ "collection": {
4433
+ "elementtype": {
4434
+ "primitive": "string"
4435
+ },
4436
+ "kind": "array"
4437
+ }
4438
+ },
4439
+ {
4440
+ "collection": {
4441
+ "elementtype": {
4442
+ "primitive": "string"
4443
+ },
4444
+ "kind": "map"
4445
+ }
4446
+ }
4447
+ ]
4448
+ }
4303
4449
  }
4304
4450
  },
4305
4451
  {
4306
4452
  "docs": {
4307
- "remarks": "Props to change the behaviour of the transformer.\n\nDefault values for `props.transformOptions`:\n- `loader='js'`",
4308
- "see": "https://esbuild.github.io/api/#transform-api",
4309
- "stability": "experimental",
4310
- "summary": "Support for `TransformOptions` is deprecated. Please provide `TransformerProps`!"
4453
+ "remarks": "Default values for `props.buildOptions`:\n- `bundle=true`\n- `platform=node`\n- `target=nodeX` with X being the major node version running locally",
4454
+ "stability": "stable",
4455
+ "summary": "Props to change the behavior of the bundler."
4311
4456
  },
4312
4457
  "name": "props",
4313
- "optional": true,
4314
4458
  "type": {
4315
4459
  "union": {
4316
4460
  "types": [
4317
4461
  {
4318
- "fqn": "@mrgrain/cdk-esbuild.TransformOptions"
4462
+ "fqn": "@mrgrain/cdk-esbuild.JavaScriptCodeProps"
4319
4463
  },
4320
4464
  {
4321
- "fqn": "@mrgrain/cdk-esbuild.TransformerProps"
4465
+ "fqn": "@mrgrain/cdk-esbuild.TypeScriptCodeProps"
4322
4466
  }
4323
4467
  ]
4324
4468
  }
@@ -4328,14 +4472,235 @@
4328
4472
  },
4329
4473
  "kind": "class",
4330
4474
  "locationInModule": {
4331
- "filename": "src/inline-code.ts",
4332
- "line": 83
4475
+ "filename": "src/code.ts",
4476
+ "line": 29
4333
4477
  },
4334
- "name": "InlineJavaScriptCode",
4335
- "symbolId": "src/inline-code:InlineJavaScriptCode"
4336
- },
4337
- "@mrgrain/cdk-esbuild.InlineJsxCode": {
4338
- "assembly": "@mrgrain/cdk-esbuild",
4478
+ "methods": [
4479
+ {
4480
+ "docs": {
4481
+ "stability": "experimental",
4482
+ "summary": "Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun."
4483
+ },
4484
+ "locationInModule": {
4485
+ "filename": "src/code.ts",
4486
+ "line": 91
4487
+ },
4488
+ "name": "bind",
4489
+ "overrides": "aws-cdk-lib.aws_lambda.Code",
4490
+ "parameters": [
4491
+ {
4492
+ "name": "scope",
4493
+ "type": {
4494
+ "fqn": "constructs.Construct"
4495
+ }
4496
+ }
4497
+ ],
4498
+ "returns": {
4499
+ "type": {
4500
+ "fqn": "aws-cdk-lib.aws_lambda.CodeConfig"
4501
+ }
4502
+ }
4503
+ },
4504
+ {
4505
+ "docs": {
4506
+ "remarks": "Specifically it's required to allow assets to add\nmetadata for tooling like SAM CLI to be able to find their origins.",
4507
+ "stability": "stable",
4508
+ "summary": "Called after the CFN function resource has been created to allow the code class to bind to it."
4509
+ },
4510
+ "locationInModule": {
4511
+ "filename": "src/code.ts",
4512
+ "line": 119
4513
+ },
4514
+ "name": "bindToResource",
4515
+ "overrides": "aws-cdk-lib.aws_lambda.Code",
4516
+ "parameters": [
4517
+ {
4518
+ "name": "resource",
4519
+ "type": {
4520
+ "fqn": "aws-cdk-lib.CfnResource"
4521
+ }
4522
+ },
4523
+ {
4524
+ "name": "options",
4525
+ "optional": true,
4526
+ "type": {
4527
+ "fqn": "aws-cdk-lib.aws_lambda.ResourceBindOptions"
4528
+ }
4529
+ }
4530
+ ]
4531
+ },
4532
+ {
4533
+ "docs": {
4534
+ "stability": "experimental"
4535
+ },
4536
+ "locationInModule": {
4537
+ "filename": "src/code.ts",
4538
+ "line": 32
4539
+ },
4540
+ "name": "getAsset",
4541
+ "parameters": [
4542
+ {
4543
+ "name": "scope",
4544
+ "type": {
4545
+ "fqn": "constructs.Construct"
4546
+ }
4547
+ }
4548
+ ],
4549
+ "protected": true,
4550
+ "returns": {
4551
+ "type": {
4552
+ "fqn": "@mrgrain/cdk-esbuild.EsbuildAsset"
4553
+ }
4554
+ }
4555
+ }
4556
+ ],
4557
+ "name": "EsbuildCode",
4558
+ "properties": [
4559
+ {
4560
+ "docs": {
4561
+ "remarks": "E.g. `src/index.ts`.",
4562
+ "stability": "stable",
4563
+ "summary": "A relative path or list or map of relative paths to the entry points of your code from the root of the project."
4564
+ },
4565
+ "immutable": true,
4566
+ "locationInModule": {
4567
+ "filename": "src/code.ts",
4568
+ "line": 58
4569
+ },
4570
+ "name": "entryPoints",
4571
+ "type": {
4572
+ "union": {
4573
+ "types": [
4574
+ {
4575
+ "primitive": "string"
4576
+ },
4577
+ {
4578
+ "collection": {
4579
+ "elementtype": {
4580
+ "primitive": "string"
4581
+ },
4582
+ "kind": "array"
4583
+ }
4584
+ },
4585
+ {
4586
+ "collection": {
4587
+ "elementtype": {
4588
+ "primitive": "string"
4589
+ },
4590
+ "kind": "map"
4591
+ }
4592
+ }
4593
+ ]
4594
+ }
4595
+ }
4596
+ },
4597
+ {
4598
+ "docs": {
4599
+ "stability": "experimental"
4600
+ },
4601
+ "locationInModule": {
4602
+ "filename": "src/code.ts",
4603
+ "line": 42
4604
+ },
4605
+ "name": "asset",
4606
+ "protected": true,
4607
+ "type": {
4608
+ "fqn": "@mrgrain/cdk-esbuild.EsbuildAsset"
4609
+ }
4610
+ },
4611
+ {
4612
+ "docs": {
4613
+ "deprecated": "this value is ignored since inline is now determined based on the the inlineCode field of CodeConfig returned from bind().",
4614
+ "stability": "deprecated",
4615
+ "summary": "Determines whether this Code is inline code or not."
4616
+ },
4617
+ "locationInModule": {
4618
+ "filename": "src/code.ts",
4619
+ "line": 49
4620
+ },
4621
+ "name": "isInline",
4622
+ "type": {
4623
+ "primitive": "boolean"
4624
+ }
4625
+ },
4626
+ {
4627
+ "docs": {
4628
+ "stability": "experimental"
4629
+ },
4630
+ "locationInModule": {
4631
+ "filename": "src/code.ts",
4632
+ "line": 40
4633
+ },
4634
+ "name": "props",
4635
+ "protected": true,
4636
+ "type": {
4637
+ "fqn": "@mrgrain/cdk-esbuild.AssetProps"
4638
+ }
4639
+ }
4640
+ ],
4641
+ "symbolId": "src/code:EsbuildCode"
4642
+ },
4643
+ "@mrgrain/cdk-esbuild.InlineJavaScriptCode": {
4644
+ "assembly": "@mrgrain/cdk-esbuild",
4645
+ "base": "aws-cdk-lib.aws_lambda.InlineCode",
4646
+ "docs": {
4647
+ "stability": "experimental",
4648
+ "summary": "An implementation of `lambda.InlineCode` using the esbuild Transform API. Inline function code is limited to 4 KiB after transformation."
4649
+ },
4650
+ "fqn": "@mrgrain/cdk-esbuild.InlineJavaScriptCode",
4651
+ "initializer": {
4652
+ "docs": {
4653
+ "stability": "experimental"
4654
+ },
4655
+ "locationInModule": {
4656
+ "filename": "src/inline-code.ts",
4657
+ "line": 84
4658
+ },
4659
+ "parameters": [
4660
+ {
4661
+ "docs": {
4662
+ "stability": "experimental",
4663
+ "summary": "The inline code to be transformed."
4664
+ },
4665
+ "name": "code",
4666
+ "type": {
4667
+ "primitive": "string"
4668
+ }
4669
+ },
4670
+ {
4671
+ "docs": {
4672
+ "remarks": "Props to change the behaviour of the transformer.\n\nDefault values for `props.transformOptions`:\n- `loader='js'`",
4673
+ "see": "https://esbuild.github.io/api/#transform-api",
4674
+ "stability": "experimental",
4675
+ "summary": "Support for `TransformOptions` is deprecated. Please provide `TransformerProps`!"
4676
+ },
4677
+ "name": "props",
4678
+ "optional": true,
4679
+ "type": {
4680
+ "union": {
4681
+ "types": [
4682
+ {
4683
+ "fqn": "@mrgrain/cdk-esbuild.TransformOptions"
4684
+ },
4685
+ {
4686
+ "fqn": "@mrgrain/cdk-esbuild.TransformerProps"
4687
+ }
4688
+ ]
4689
+ }
4690
+ }
4691
+ }
4692
+ ]
4693
+ },
4694
+ "kind": "class",
4695
+ "locationInModule": {
4696
+ "filename": "src/inline-code.ts",
4697
+ "line": 83
4698
+ },
4699
+ "name": "InlineJavaScriptCode",
4700
+ "symbolId": "src/inline-code:InlineJavaScriptCode"
4701
+ },
4702
+ "@mrgrain/cdk-esbuild.InlineJsxCode": {
4703
+ "assembly": "@mrgrain/cdk-esbuild",
4339
4704
  "base": "aws-cdk-lib.aws_lambda.InlineCode",
4340
4705
  "docs": {
4341
4706
  "stability": "experimental",
@@ -4513,6 +4878,7 @@
4513
4878
  },
4514
4879
  "@mrgrain/cdk-esbuild.JavaScriptAsset": {
4515
4880
  "assembly": "@mrgrain/cdk-esbuild",
4881
+ "base": "@mrgrain/cdk-esbuild.EsbuildAsset",
4516
4882
  "docs": {
4517
4883
  "remarks": "The asset can be used by other constructs.",
4518
4884
  "stability": "stable",
@@ -4525,7 +4891,7 @@
4525
4891
  },
4526
4892
  "locationInModule": {
4527
4893
  "filename": "src/asset.ts",
4528
- "line": 42
4894
+ "line": 46
4529
4895
  },
4530
4896
  "parameters": [
4531
4897
  {
@@ -4551,13 +4917,14 @@
4551
4917
  "kind": "class",
4552
4918
  "locationInModule": {
4553
4919
  "filename": "src/asset.ts",
4554
- "line": 97
4920
+ "line": 101
4555
4921
  },
4556
4922
  "name": "JavaScriptAsset",
4557
4923
  "symbolId": "src/asset:JavaScriptAsset"
4558
4924
  },
4559
4925
  "@mrgrain/cdk-esbuild.JavaScriptCode": {
4560
4926
  "assembly": "@mrgrain/cdk-esbuild",
4927
+ "base": "@mrgrain/cdk-esbuild.EsbuildCode",
4561
4928
  "docs": {
4562
4929
  "stability": "stable",
4563
4930
  "summary": "Represents the deployed JavaScript Code."
@@ -4569,7 +4936,7 @@
4569
4936
  },
4570
4937
  "locationInModule": {
4571
4938
  "filename": "src/code.ts",
4572
- "line": 124
4939
+ "line": 143
4573
4940
  },
4574
4941
  "parameters": [
4575
4942
  {
@@ -4622,7 +4989,7 @@
4622
4989
  "kind": "class",
4623
4990
  "locationInModule": {
4624
4991
  "filename": "src/code.ts",
4625
- "line": 121
4992
+ "line": 134
4626
4993
  },
4627
4994
  "methods": [
4628
4995
  {
@@ -4631,9 +4998,10 @@
4631
4998
  },
4632
4999
  "locationInModule": {
4633
5000
  "filename": "src/code.ts",
4634
- "line": 74
5001
+ "line": 135
4635
5002
  },
4636
- "name": "bind",
5003
+ "name": "getAsset",
5004
+ "overrides": "@mrgrain/cdk-esbuild.EsbuildCode",
4637
5005
  "parameters": [
4638
5006
  {
4639
5007
  "name": "scope",
@@ -4642,110 +5010,15 @@
4642
5010
  }
4643
5011
  }
4644
5012
  ],
5013
+ "protected": true,
4645
5014
  "returns": {
4646
5015
  "type": {
4647
- "fqn": "@mrgrain/cdk-esbuild.CodeConfig"
5016
+ "fqn": "@mrgrain/cdk-esbuild.EsbuildAsset"
4648
5017
  }
4649
5018
  }
4650
- },
4651
- {
4652
- "docs": {
4653
- "remarks": "Specifically it's required to allow assets to add\nmetadata for tooling like SAM CLI to be able to find their origins.",
4654
- "stability": "stable",
4655
- "summary": "Called after the CFN function resource has been created to allow the code class to bind to it."
4656
- },
4657
- "locationInModule": {
4658
- "filename": "src/code.ts",
4659
- "line": 106
4660
- },
4661
- "name": "bindToResource",
4662
- "parameters": [
4663
- {
4664
- "name": "resource",
4665
- "type": {
4666
- "fqn": "aws-cdk-lib.CfnResource"
4667
- }
4668
- },
4669
- {
4670
- "name": "options",
4671
- "optional": true,
4672
- "type": {
4673
- "fqn": "aws-cdk-lib.aws_lambda.ResourceBindOptions"
4674
- }
4675
- }
4676
- ]
4677
5019
  }
4678
5020
  ],
4679
5021
  "name": "JavaScriptCode",
4680
- "properties": [
4681
- {
4682
- "docs": {
4683
- "stability": "stable"
4684
- },
4685
- "immutable": true,
4686
- "locationInModule": {
4687
- "filename": "src/code.ts",
4688
- "line": 122
4689
- },
4690
- "name": "assetClass",
4691
- "protected": true,
4692
- "type": {
4693
- "fqn": "@mrgrain/cdk-esbuild.JavaScriptAsset"
4694
- }
4695
- },
4696
- {
4697
- "docs": {
4698
- "stability": "stable"
4699
- },
4700
- "locationInModule": {
4701
- "filename": "src/code.ts",
4702
- "line": 42
4703
- },
4704
- "name": "asset",
4705
- "protected": true,
4706
- "type": {
4707
- "union": {
4708
- "types": [
4709
- {
4710
- "fqn": "@mrgrain/cdk-esbuild.JavaScriptAsset"
4711
- },
4712
- {
4713
- "fqn": "@mrgrain/cdk-esbuild.TypeScriptAsset"
4714
- }
4715
- ]
4716
- }
4717
- }
4718
- },
4719
- {
4720
- "docs": {
4721
- "deprecated": "this value is ignored since inline is now determined based on the the inlineCode field of CodeConfig returned from bind().",
4722
- "stability": "deprecated",
4723
- "summary": "Determines whether this Code is inline code or not."
4724
- },
4725
- "locationInModule": {
4726
- "filename": "src/code.ts",
4727
- "line": 49
4728
- },
4729
- "name": "isInline",
4730
- "type": {
4731
- "primitive": "boolean"
4732
- }
4733
- },
4734
- {
4735
- "docs": {
4736
- "stability": "stable"
4737
- },
4738
- "locationInModule": {
4739
- "filename": "src/code.ts",
4740
- "line": 40
4741
- },
4742
- "name": "props",
4743
- "protected": true,
4744
- "type": {
4745
- "fqn": "@mrgrain/cdk-esbuild.AssetProps"
4746
- }
4747
- }
4748
- ],
4749
5022
  "symbolId": "src/code:JavaScriptCode"
4750
5023
  },
4751
5024
  "@mrgrain/cdk-esbuild.JavaScriptCodeProps": {
@@ -4761,7 +5034,7 @@
4761
5034
  "kind": "interface",
4762
5035
  "locationInModule": {
4763
5036
  "filename": "src/code.ts",
4764
- "line": 27
5037
+ "line": 19
4765
5038
  },
4766
5039
  "name": "JavaScriptCodeProps",
4767
5040
  "properties": [
@@ -4983,7 +5256,7 @@
4983
5256
  "kind": "interface",
4984
5257
  "locationInModule": {
4985
5258
  "filename": "src/esbuild-types.ts",
4986
- "line": 237
5259
+ "line": 240
4987
5260
  },
4988
5261
  "name": "TransformOptions",
4989
5262
  "properties": [
@@ -4995,7 +5268,7 @@
4995
5268
  "immutable": true,
4996
5269
  "locationInModule": {
4997
5270
  "filename": "src/esbuild-types.ts",
4998
- "line": 242
5271
+ "line": 245
4999
5272
  },
5000
5273
  "name": "banner",
5001
5274
  "optional": true,
@@ -5012,7 +5285,7 @@
5012
5285
  "immutable": true,
5013
5286
  "locationInModule": {
5014
5287
  "filename": "src/esbuild-types.ts",
5015
- "line": 46
5288
+ "line": 48
5016
5289
  },
5017
5290
  "name": "charset",
5018
5291
  "optional": true,
@@ -5029,7 +5302,7 @@
5029
5302
  "immutable": true,
5030
5303
  "locationInModule": {
5031
5304
  "filename": "src/esbuild-types.ts",
5032
- "line": 67
5305
+ "line": 69
5033
5306
  },
5034
5307
  "name": "color",
5035
5308
  "optional": true,
@@ -5046,7 +5319,7 @@
5046
5319
  "immutable": true,
5047
5320
  "locationInModule": {
5048
5321
  "filename": "src/esbuild-types.ts",
5049
- "line": 60
5322
+ "line": 62
5050
5323
  },
5051
5324
  "name": "define",
5052
5325
  "optional": true,
@@ -5068,7 +5341,7 @@
5068
5341
  "immutable": true,
5069
5342
  "locationInModule": {
5070
5343
  "filename": "src/esbuild-types.ts",
5071
- "line": 36
5344
+ "line": 38
5072
5345
  },
5073
5346
  "name": "drop",
5074
5347
  "optional": true,
@@ -5089,7 +5362,7 @@
5089
5362
  "immutable": true,
5090
5363
  "locationInModule": {
5091
5364
  "filename": "src/esbuild-types.ts",
5092
- "line": 243
5365
+ "line": 246
5093
5366
  },
5094
5367
  "name": "footer",
5095
5368
  "optional": true,
@@ -5140,7 +5413,7 @@
5140
5413
  "immutable": true,
5141
5414
  "locationInModule": {
5142
5415
  "filename": "src/esbuild-types.ts",
5143
- "line": 50
5416
+ "line": 52
5144
5417
  },
5145
5418
  "name": "ignoreAnnotations",
5146
5419
  "optional": true,
@@ -5157,7 +5430,7 @@
5157
5430
  "immutable": true,
5158
5431
  "locationInModule": {
5159
5432
  "filename": "src/esbuild-types.ts",
5160
- "line": 53
5433
+ "line": 55
5161
5434
  },
5162
5435
  "name": "jsx",
5163
5436
  "optional": true,
@@ -5174,7 +5447,7 @@
5174
5447
  "immutable": true,
5175
5448
  "locationInModule": {
5176
5449
  "filename": "src/esbuild-types.ts",
5177
- "line": 55
5450
+ "line": 57
5178
5451
  },
5179
5452
  "name": "jsxFactory",
5180
5453
  "optional": true,
@@ -5191,7 +5464,7 @@
5191
5464
  "immutable": true,
5192
5465
  "locationInModule": {
5193
5466
  "filename": "src/esbuild-types.ts",
5194
- "line": 57
5467
+ "line": 59
5195
5468
  },
5196
5469
  "name": "jsxFragment",
5197
5470
  "optional": true,
@@ -5208,7 +5481,7 @@
5208
5481
  "immutable": true,
5209
5482
  "locationInModule": {
5210
5483
  "filename": "src/esbuild-types.ts",
5211
- "line": 64
5484
+ "line": 66
5212
5485
  },
5213
5486
  "name": "keepNames",
5214
5487
  "optional": true,
@@ -5241,7 +5514,7 @@
5241
5514
  "immutable": true,
5242
5515
  "locationInModule": {
5243
5516
  "filename": "src/esbuild-types.ts",
5244
- "line": 241
5517
+ "line": 244
5245
5518
  },
5246
5519
  "name": "loader",
5247
5520
  "optional": true,
@@ -5258,7 +5531,7 @@
5258
5531
  "immutable": true,
5259
5532
  "locationInModule": {
5260
5533
  "filename": "src/esbuild-types.ts",
5261
- "line": 69
5534
+ "line": 71
5262
5535
  },
5263
5536
  "name": "logLevel",
5264
5537
  "optional": true,
@@ -5275,7 +5548,7 @@
5275
5548
  "immutable": true,
5276
5549
  "locationInModule": {
5277
5550
  "filename": "src/esbuild-types.ts",
5278
- "line": 71
5551
+ "line": 73
5279
5552
  },
5280
5553
  "name": "logLimit",
5281
5554
  "optional": true,
@@ -5292,7 +5565,7 @@
5292
5565
  "immutable": true,
5293
5566
  "locationInModule": {
5294
5567
  "filename": "src/esbuild-types.ts",
5295
- "line": 73
5568
+ "line": 75
5296
5569
  },
5297
5570
  "name": "logOverride",
5298
5571
  "optional": true,
@@ -5314,7 +5587,7 @@
5314
5587
  "immutable": true,
5315
5588
  "locationInModule": {
5316
5589
  "filename": "src/esbuild-types.ts",
5317
- "line": 34
5590
+ "line": 36
5318
5591
  },
5319
5592
  "name": "mangleCache",
5320
5593
  "optional": true,
@@ -5345,7 +5618,7 @@
5345
5618
  "immutable": true,
5346
5619
  "locationInModule": {
5347
5620
  "filename": "src/esbuild-types.ts",
5348
- "line": 28
5621
+ "line": 30
5349
5622
  },
5350
5623
  "name": "mangleProps",
5351
5624
  "optional": true,
@@ -5362,7 +5635,7 @@
5362
5635
  "immutable": true,
5363
5636
  "locationInModule": {
5364
5637
  "filename": "src/esbuild-types.ts",
5365
- "line": 32
5638
+ "line": 34
5366
5639
  },
5367
5640
  "name": "mangleQuoted",
5368
5641
  "optional": true,
@@ -5379,7 +5652,7 @@
5379
5652
  "immutable": true,
5380
5653
  "locationInModule": {
5381
5654
  "filename": "src/esbuild-types.ts",
5382
- "line": 38
5655
+ "line": 40
5383
5656
  },
5384
5657
  "name": "minify",
5385
5658
  "optional": true,
@@ -5396,7 +5669,7 @@
5396
5669
  "immutable": true,
5397
5670
  "locationInModule": {
5398
5671
  "filename": "src/esbuild-types.ts",
5399
- "line": 42
5672
+ "line": 44
5400
5673
  },
5401
5674
  "name": "minifyIdentifiers",
5402
5675
  "optional": true,
@@ -5413,7 +5686,7 @@
5413
5686
  "immutable": true,
5414
5687
  "locationInModule": {
5415
5688
  "filename": "src/esbuild-types.ts",
5416
- "line": 44
5689
+ "line": 46
5417
5690
  },
5418
5691
  "name": "minifySyntax",
5419
5692
  "optional": true,
@@ -5430,7 +5703,7 @@
5430
5703
  "immutable": true,
5431
5704
  "locationInModule": {
5432
5705
  "filename": "src/esbuild-types.ts",
5433
- "line": 40
5706
+ "line": 42
5434
5707
  },
5435
5708
  "name": "minifyWhitespace",
5436
5709
  "optional": true,
@@ -5447,7 +5720,7 @@
5447
5720
  "immutable": true,
5448
5721
  "locationInModule": {
5449
5722
  "filename": "src/esbuild-types.ts",
5450
- "line": 62
5723
+ "line": 64
5451
5724
  },
5452
5725
  "name": "pure",
5453
5726
  "optional": true,
@@ -5469,7 +5742,7 @@
5469
5742
  "immutable": true,
5470
5743
  "locationInModule": {
5471
5744
  "filename": "src/esbuild-types.ts",
5472
- "line": 30
5745
+ "line": 32
5473
5746
  },
5474
5747
  "name": "reserveProps",
5475
5748
  "optional": true,
@@ -5485,7 +5758,7 @@
5485
5758
  "immutable": true,
5486
5759
  "locationInModule": {
5487
5760
  "filename": "src/esbuild-types.ts",
5488
- "line": 240
5761
+ "line": 243
5489
5762
  },
5490
5763
  "name": "sourcefile",
5491
5764
  "optional": true,
@@ -5553,6 +5826,28 @@
5553
5826
  "primitive": "boolean"
5554
5827
  }
5555
5828
  },
5829
+ {
5830
+ "abstract": true,
5831
+ "docs": {
5832
+ "stability": "stable",
5833
+ "summary": "Documentation: https://esbuild.github.io/api/#supported."
5834
+ },
5835
+ "immutable": true,
5836
+ "locationInModule": {
5837
+ "filename": "src/esbuild-types.ts",
5838
+ "line": 27
5839
+ },
5840
+ "name": "supported",
5841
+ "optional": true,
5842
+ "type": {
5843
+ "collection": {
5844
+ "elementtype": {
5845
+ "primitive": "boolean"
5846
+ },
5847
+ "kind": "map"
5848
+ }
5849
+ }
5850
+ },
5556
5851
  {
5557
5852
  "abstract": true,
5558
5853
  "docs": {
@@ -5593,7 +5888,7 @@
5593
5888
  "immutable": true,
5594
5889
  "locationInModule": {
5595
5890
  "filename": "src/esbuild-types.ts",
5596
- "line": 48
5891
+ "line": 50
5597
5892
  },
5598
5893
  "name": "treeShaking",
5599
5894
  "optional": true,
@@ -5609,7 +5904,7 @@
5609
5904
  "immutable": true,
5610
5905
  "locationInModule": {
5611
5906
  "filename": "src/esbuild-types.ts",
5612
- "line": 238
5907
+ "line": 241
5613
5908
  },
5614
5909
  "name": "tsconfigRaw",
5615
5910
  "optional": true,
@@ -5682,6 +5977,7 @@
5682
5977
  },
5683
5978
  "@mrgrain/cdk-esbuild.TypeScriptAsset": {
5684
5979
  "assembly": "@mrgrain/cdk-esbuild",
5980
+ "base": "@mrgrain/cdk-esbuild.EsbuildAsset",
5685
5981
  "docs": {
5686
5982
  "remarks": "The asset can be used by other constructs.",
5687
5983
  "stability": "stable",
@@ -5694,7 +5990,7 @@
5694
5990
  },
5695
5991
  "locationInModule": {
5696
5992
  "filename": "src/asset.ts",
5697
- "line": 42
5993
+ "line": 46
5698
5994
  },
5699
5995
  "parameters": [
5700
5996
  {
@@ -5720,13 +6016,14 @@
5720
6016
  "kind": "class",
5721
6017
  "locationInModule": {
5722
6018
  "filename": "src/asset.ts",
5723
- "line": 106
6019
+ "line": 110
5724
6020
  },
5725
6021
  "name": "TypeScriptAsset",
5726
6022
  "symbolId": "src/asset:TypeScriptAsset"
5727
6023
  },
5728
6024
  "@mrgrain/cdk-esbuild.TypeScriptCode": {
5729
6025
  "assembly": "@mrgrain/cdk-esbuild",
6026
+ "base": "@mrgrain/cdk-esbuild.EsbuildCode",
5730
6027
  "docs": {
5731
6028
  "stability": "stable",
5732
6029
  "summary": "Represents the deployed TypeScript Code."
@@ -5738,7 +6035,7 @@
5738
6035
  },
5739
6036
  "locationInModule": {
5740
6037
  "filename": "src/code.ts",
5741
- "line": 156
6038
+ "line": 181
5742
6039
  },
5743
6040
  "parameters": [
5744
6041
  {
@@ -5791,7 +6088,7 @@
5791
6088
  "kind": "class",
5792
6089
  "locationInModule": {
5793
6090
  "filename": "src/code.ts",
5794
- "line": 153
6091
+ "line": 172
5795
6092
  },
5796
6093
  "methods": [
5797
6094
  {
@@ -5800,9 +6097,10 @@
5800
6097
  },
5801
6098
  "locationInModule": {
5802
6099
  "filename": "src/code.ts",
5803
- "line": 74
6100
+ "line": 173
5804
6101
  },
5805
- "name": "bind",
6102
+ "name": "getAsset",
6103
+ "overrides": "@mrgrain/cdk-esbuild.EsbuildCode",
5806
6104
  "parameters": [
5807
6105
  {
5808
6106
  "name": "scope",
@@ -5811,110 +6109,15 @@
5811
6109
  }
5812
6110
  }
5813
6111
  ],
6112
+ "protected": true,
5814
6113
  "returns": {
5815
6114
  "type": {
5816
- "fqn": "@mrgrain/cdk-esbuild.CodeConfig"
6115
+ "fqn": "@mrgrain/cdk-esbuild.EsbuildAsset"
5817
6116
  }
5818
6117
  }
5819
- },
5820
- {
5821
- "docs": {
5822
- "remarks": "Specifically it's required to allow assets to add\nmetadata for tooling like SAM CLI to be able to find their origins.",
5823
- "stability": "stable",
5824
- "summary": "Called after the CFN function resource has been created to allow the code class to bind to it."
5825
- },
5826
- "locationInModule": {
5827
- "filename": "src/code.ts",
5828
- "line": 106
5829
- },
5830
- "name": "bindToResource",
5831
- "parameters": [
5832
- {
5833
- "name": "resource",
5834
- "type": {
5835
- "fqn": "aws-cdk-lib.CfnResource"
5836
- }
5837
- },
5838
- {
5839
- "name": "options",
5840
- "optional": true,
5841
- "type": {
5842
- "fqn": "aws-cdk-lib.aws_lambda.ResourceBindOptions"
5843
- }
5844
- }
5845
- ]
5846
6118
  }
5847
6119
  ],
5848
6120
  "name": "TypeScriptCode",
5849
- "properties": [
5850
- {
5851
- "docs": {
5852
- "stability": "stable"
5853
- },
5854
- "immutable": true,
5855
- "locationInModule": {
5856
- "filename": "src/code.ts",
5857
- "line": 154
5858
- },
5859
- "name": "assetClass",
5860
- "protected": true,
5861
- "type": {
5862
- "fqn": "@mrgrain/cdk-esbuild.TypeScriptAsset"
5863
- }
5864
- },
5865
- {
5866
- "docs": {
5867
- "stability": "stable"
5868
- },
5869
- "locationInModule": {
5870
- "filename": "src/code.ts",
5871
- "line": 42
5872
- },
5873
- "name": "asset",
5874
- "protected": true,
5875
- "type": {
5876
- "union": {
5877
- "types": [
5878
- {
5879
- "fqn": "@mrgrain/cdk-esbuild.JavaScriptAsset"
5880
- },
5881
- {
5882
- "fqn": "@mrgrain/cdk-esbuild.TypeScriptAsset"
5883
- }
5884
- ]
5885
- }
5886
- }
5887
- },
5888
- {
5889
- "docs": {
5890
- "deprecated": "this value is ignored since inline is now determined based on the the inlineCode field of CodeConfig returned from bind().",
5891
- "stability": "deprecated",
5892
- "summary": "Determines whether this Code is inline code or not."
5893
- },
5894
- "locationInModule": {
5895
- "filename": "src/code.ts",
5896
- "line": 49
5897
- },
5898
- "name": "isInline",
5899
- "type": {
5900
- "primitive": "boolean"
5901
- }
5902
- },
5903
- {
5904
- "docs": {
5905
- "stability": "stable"
5906
- },
5907
- "locationInModule": {
5908
- "filename": "src/code.ts",
5909
- "line": 40
5910
- },
5911
- "name": "props",
5912
- "protected": true,
5913
- "type": {
5914
- "fqn": "@mrgrain/cdk-esbuild.AssetProps"
5915
- }
5916
- }
5917
- ],
5918
6121
  "symbolId": "src/code:TypeScriptCode"
5919
6122
  },
5920
6123
  "@mrgrain/cdk-esbuild.TypeScriptCodeProps": {
@@ -5930,7 +6133,7 @@
5930
6133
  "kind": "interface",
5931
6134
  "locationInModule": {
5932
6135
  "filename": "src/code.ts",
5933
- "line": 28
6136
+ "line": 20
5934
6137
  },
5935
6138
  "name": "TypeScriptCodeProps",
5936
6139
  "properties": [
@@ -6143,6 +6346,6 @@
6143
6346
  "symbolId": "src/source:TypeScriptSourceProps"
6144
6347
  }
6145
6348
  },
6146
- "version": "4.0.0-alpha.5",
6147
- "fingerprint": "CPFlr7DVRE3la6iAuZGACsF90yHD3EkW3cTNGpm8BcM="
6349
+ "version": "4.0.0-alpha.8",
6350
+ "fingerprint": "8MURwY4BSmgsy1As8iitI7E981KW259pIKcdAY9BDuE="
6148
6351
  }