@mrgrain/cdk-esbuild 2.0.0-alpha.0 → 2.0.0-alpha.5

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
@@ -9,6 +9,7 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@aws-cdk/aws-lambda": "^1.99.0",
12
+ "@aws-cdk/aws-s3": "^1.99.0",
12
13
  "@aws-cdk/aws-s3-assets": "^1.99.0",
13
14
  "@aws-cdk/aws-s3-deployment": "^1.99.0",
14
15
  "@aws-cdk/aws-synthetics": "^1.99.0",
@@ -968,7 +969,7 @@
968
969
  },
969
970
  "name": "@mrgrain/cdk-esbuild",
970
971
  "readme": {
971
- "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) | [Documentation](#documentation) | [Versioning](#versioning)\n\n## ⚠️ Alpha Version of `jsii` compatible package\n\nDocumentation has not yet been updated.\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## Getting started\n\nInstall `cdk-esbuild`:\n\n```\nnpm install @mrgrain/cdk-esbuild\n```\n\n⚠️ When using an older version of npm (4-6), the required peer dependencies have to be installed manually. Use this command instead:\n\n```\nnpm install @mrgrain/cdk-esbuild @aws-cdk/core @aws-cdk/aws-lambda @aws-cdk/aws-s3-assets @aws-cdk/aws-s3-deployment @aws-cdk/aws-synthetics\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/latest/docs/@aws-cdk_aws-lambda.Function.html#code):\n\n```ts\nimport * as lambda from \"@aws-cdk/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_14_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/aws-s3\";\nimport * as s3deploy from \"@aws-cdk/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> ⚠️ **Status: Experimental** \\\n> Expect the interface to change. Please report any issues!\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```ts\nimport * as synthetics from \"@aws-cdk/aws-synthetics\";\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/latest/docs/@aws-cdk_aws-lambda.Code.html)) and `synthetics.Code` ([reference](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-synthetics.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 plugin to high-level CDK features. They share the same set of parameters, props and build options:_\n\nUnderlying classes the 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/latest/docs/@aws-cdk_aws-s3-assets.Asset.html)) \\\n creates an asset uploaded to S3 which can be referenced by other constructs\n\n- `EsbuildBundling` implements `core.BundlingOptions` ([reference](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.BundlingOptions.html)) \\\n provides a _esbuild_ bundling interface wherever needed\n\n## `TypeScriptCode`, `JavaScriptCode`\n\n> ℹ️ _Although these classes are currently identical, please use the appropriate class as functionality might diverge in future releases._\n\n**Default build options:**\n\n- `bundle=true`\n- `platform=node`\n- `target=nodeX` with `X` being the major node version running the code\n\n### Parameters\n\n- `entryPoints: string | string[] | Record<string, string>` \\\n A single or list of relative paths to the entry points of your code from the root of the project.\n\n### Props\n\n- `props.buildOptions?` as per esbuild [(reference)](https://esbuild.github.io/getting-started/#build-scripts) \\\n **All build options are optional.** \\\n Same defaults and functionalities apply, with a few changes as noted below. Generally speaking usage of entry and output options are different, as these are inferred by CDK.\n\n- ❌ `buildOptions.entryPoints` \\\n _Not available. Option is exposed as parameter._\n\n- `buildOptions.outdir: string` \\\n The actual path for the output directory is defined by CDK. However setting this option allows to write files into a subdirectory. \\\n For example `{ outdir: 'js' }` will create an asset with a single directory called `js`, which contains all built files. This approach can be useful for static website deployments, where JavaScript code should be placed into a subdirectory. \\\n _Cannot be used together with `outfile`._\n\n- `buildOptions.outfile: string` \\\n Relative path to a file inside the CDK asset output directory. \\\n For example `{ outfile: 'js/index.js' }` will create an asset with a single directory called `js`, which contains a single file `index.js`. This can be useful to rename the entry point.\\\n _Cannot be used with multiple `entryPoints` or together with `outdir`._\n\n- `buildOptions.absWorkingDir: string` \\\n Absolute path to the [esbuild working directory](https://esbuild.github.io/api/#working-directory) and defaults to the [current working directory](https://en.wikipedia.org/wiki/Working_directory).\\\n Docker-based builds also use this path to mount local files into the container. A large `absWorkingDir` can slow down the Docker build. \\\n If paths cannot be found, a good starting point is to look at the concatenation of `absWorkingDir + entryPoint`. It must always be a valid absolute path pointing to the entry point. When needed, the probably easiest way to set `absWorkingDir` is to use a combination of `resolve` and `__dirname` (see \"A note for library authors\" below).\n\n> **⚠️ A note for library authors**\n>\n> When developing a library consumed by other packages, you'll most likely have to set `absWorkingDir`. The easiest way to do this, is to resolve based on the directory name of the 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\n> const props = {\n> buildOptions: {\n> absWorkingDir: path.resolve(__dirname, \"..\"), // now: /user/project\n> },\n> };\n> ```\n>\n> This will dynamically resolve to the correct path, wherever the package is installed.\n\n- `props.copyDir?: string` \\\n **⚠️ Experimental** - _Likely to change once esbuild supports this natively_ \\\n Relative path to a directory copied to the output before the build is run (i.e esbuild will overwrite existing files).\n\n- `props.bundlerPriority?: BundlerPriority (BundlerPriority.AttemptLocal)` \\\n Set the priority order of available bundlers. It can be useful to limit use to one of the bundlers. For Docker, the `absWorkingDir` path (or current working directory) will be mounted into the container as context. By default bundling with a locally installed binary is attempted first and Docker will only be used if the local bundling fails.\n\n## `TypeScriptSource`, `JavaScriptSource`\n\n> ℹ️ _Although these classes are currently identical, please use the appropriate class as functionality might diverge in future releases._\n\n**Default build options:**\n\n- `bundle=true`\n- `platform=browser`\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\n### Parameters & Props\n\n➡️ _Code and Source constructs share the same set of parameters, props and build options. Please see above for details._\n\n## `InlineTypeScriptCode`, `InlineJavaScriptCode`, `InlineTsxCode`, `InlineJsxCode`\n\n**⚠️ Status: Unstable**\n\nAn implementation of `lambda.InlineCode` ([reference](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.InlineCode.html)) using the esbuild Transform API.\nInline function code is limited to 4 KiB _after_ transformation.\n\n### Parameters\n\n- `code: string` \\\n The inline code to be transformed.\n\n- `transformOptions: TransformOptions` \\\n Options from the [esbuild Transform API](https://esbuild.github.io/api/#transform-api).\n\n **Default transform options:** \\\n • `loader=ts|js|tsx|jsx` (one of `ts,js,tsx,jsx` depending on the used class)\n\n## `TypeScriptAsset`, `JavaScriptAsset`\n\nBundles the entry points and creates a CDK asset which is uploaded to the bootstrapped CDK S3 bucket during deployment. The asset can be used by other constructs.\n\n> ℹ️ _The high-level constructs for `TypeScriptSource` and `TypeScriptCode` (and respective JavaScript classes) actually just use this asset._\n\n**Default build options:**\n\n- `bundle=true`\n\n### Parameters\n\n- `scope: cdk.Construct`\n- `id: string`\n- `props: TypeScriptAssetProps|JavaScriptAssetProps`\n\n### Props\n\n- `props.entryPoints: string | string[] | Record<string, string>` \\\n A single or list of relative paths to the entry points of your code from the root of the project.\n\n- `props.copyDir?: string` \\\n **⚠️ Experimental** - _Likely to change once esbuild supports this natively_ \\\n Relative path to a directory copied to the output before the build is run (i.e esbuild will overwrite existing files).\n\n- `props.bundlerPriority?: BundlerPriority (BundlerPriority.AttemptLocal)` \\\n Set the priority order of available bundlers. It can be useful to limit use to one of the bundlers. For Docker, the `absWorkingDir` path (or current working directory) will be mounted into the container as context. By default bundling with a locally installed binary is attempted first and Docker will only be used if the local bundling fails.\n\n- `props.buildOptions?` as per esbuild [(reference)](https://esbuild.github.io/getting-started/#build-scripts) \\\n **All build options are optional.** \\\n ➡️ See `TypeScriptCode` for detailed explanation on options.\n\n## `EsbuildBundling`\n\n**⚠️ Status: Unstable**\n\nLow-level class that can be used where a `BundlingOptions` are required. This class provides the local und Docker-based bundling but doesn't come with any kind of safeguards.\n\n### Parameters\n\n- `buildOptions?` \\\n All esbuild options are available, with adapted functionality as described above.\n\n- `props.priority?: BundlerPriority (BundlerPriority.AttemptLocal)` \\\n Priority order of available bundlers. Default `BundlerPriority.AttemptLocal` is to attempt using a locally installed binary first, retrying with Docker in case of failure. Can be set to only use either the local or Docker bundler.\n\n- `props.copyDir?: string` \\\n Copy additional files to the output directory, before the build runs.\n\n- `props.esbuildVersion?: string` \\\n _Docker build only._ A npm compatible version constraint. If not provided will attempt to read from a `package-lock.json` or `package.json` in the `absWorkingDir`. Otherwise uses the constraint provided by this package (usually `^0.x.0`).\n\n## Versioning\n\n**⚠️ Status: Unstable**\n\n_Because esbuild is still in major version zero, this package must be considered unstable. Notably updates to the minimal version requirement of esbuild will be introduced in minor versions of this package and thus will contain any breaking changes esbuild introduces._\n\n**Upcoming changes to versioning! See Future section below.**\n\nThe package tracks the **minor** version number of CDK releases. It might work with newer versions of CDK, but has not been tested. Features changes, including breaking changes, will only be introduced alongside minor releases.\n\n**Patches releases** will contain fixes to this library only and do not necessarily reflect CDK patches.\n\nAny parts of the code marked as `unstable` can change at any time. Please note that the unstable flag is applied to all new or experimental features and internal classes.\n\n### Future\n\n### `jsii` compatibility\n\nI am actively working on a [jsii](https://aws.github.io/jsii/) compatible version of this constructs library, see the [next branch](https://github.com/mrgrain/cdk-esbuild/tree/next) for further details. Amongst other things, this will allow me to publish the package to the [Construct Hub](https://constructs.dev/).\n\n**The release of this will be in a new major version 2.** Versioning will evolve further towards semantic versioning,with `esbuild` upgrades being the exception. They will continue to be shipped as part of minor version updates and might include breaking changes.\n\n**Most of the package will remain the same** and migration will be easy. However some interfaces need to be updated for `jsii` and deprecated features will be removed.\n\n### AWS CDK v2\n\nWith the monolithic version 2 of CDK (aka Mono-CDK) on the horizon, versioning for this library will change as well.\n\nA major release will be marked alongside CDK. From that point on, this package will mostly use _semantic versioning_ and not longer align version numbers with AWS CDK.\n\nThe big exceptions will be updates to the minimal version requirement of esbuild. As long as esbuild is still in major version zero, these requirement updates will be introduced as minor version updates.\n\nAdditionally any parts of the code marked as `unstable` can change at any time. Please note that the unstable flag is applied to new experimental features and internal classes.\n\n### Stable esbuild\n\nOnce `esbuild` has reached a stable version 1.0, a new major version will be released for _all_ breaking changes, including updated of minimum (peer) dependencies.\n\nAdditionally any parts of the code marked as `unstable` can change at any time. Please note that the unstable flag is applied to new experimental features and internal classes.\n"
972
+ "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 v2](#migrating-to-v2) |\n[Documentation](#documentation) | [API Reference](#api-reference) | [Versioning](#versioning)\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**⚠️ A note on stability**\n\nThis package is generally stable and ready to be used in production as many do. However _esbuild_ is still on major version zero, which you should consider. Please check their guide on [production readiness](https://esbuild.github.io/faq/#production-readiness).\n\nNotably upgrades of the _esbuild_ 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\n```\n\nIf _peer_ and _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 esbuild @aws-cdk/core @aws-cdk/aws-lambda @aws-cdk/aws-s3-assets @aws-cdk/aws-s3-deployment @aws-cdk/aws-synthetics\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/latest/docs/@aws-cdk_aws-lambda.Function.html#code):\n\n```ts\nimport * as lambda from \"@aws-cdk/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_14_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/aws-s3\";\nimport * as s3deploy from \"@aws-cdk/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```ts\nimport * as synthetics from \"@aws-cdk/aws-synthetics\";\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/latest/docs/@aws-cdk_aws-lambda.Code.html)) and `synthetics.Code` ([reference](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-synthetics.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 plugin to high-level CDK features. They share the same set of parameters, props and build options._\n\nUnderlying 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/latest/docs/@aws-cdk_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/latest/docs/@aws-cdk_core.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 within the code completion of your IDE.\n\n## Migrating to v2\n\nThe main changes in cdk-esbuild v2 are:\n\n- The package is now `jsii` compliant and published in the [Construct Hub](https://constructs.dev/). This will also enable a possible feature release for other languages.\n- Deprecated properties and classes have been removed, most notably the previous support for bundling via a Docker container. The implementation had a few issues that cannot be easily resolved. However more generic support for custom executables might arrive in later versions.\n- `esbuild` is now installed as an optional dependency. It's not optional at all, but this is a ramification of using `jsii`. In practice this will have no impact on most people.\n- Interfaces have been streamlined and the names and setup of internal types have been changed. In the unlikely case that someone was relying on these, upgrading will be straight forward.\n\n### Upgrading\n\n- Update the package dependency to v2: `npm install --save @mrgrain/cdk-esbuild@^2.0.0`\n- `esbuild` is now installed as an optional dependency. If your setup does not automatically install optional dependencies, add it as an explicit dependency.\n- Remove any use of `bundlerPriority`.\n- Unstable construct `EsbuildBundling` has been renamed to `EsbuildBundler` and its interface has slightly changed. Like most other constructs, it now takes `entryPoints` as first parameter, with an optional `props` object as the second.\n\n## Versioning\n\nThis package _mostly_ 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\nAlthough great care is taken to avoid this, all features marked as `@unstable` may change with minor versions. Please note that the unstable flag is applied to all new or experimental features and internal classes.\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## Future releases\n\n### AWS CDK v2\n\nThe monolithic version 2 of CDK (aka Mono-CDK) is on the horizon. A new major release of this package will be marked alongside CDK. Support for AWS CDK v1.x.x will be continued, however no new features will be added.\n\n### Stable esbuild\n\nOnce `esbuild` has reached a stable version 1.0, a new major version will be released for _all_ breaking changes, including updates to minimum (peer) dependencies.\n\n## Library authors\n\nWhen developing a library consumed by other packages, you'll most likely have to set `buildOptions.absWorkingDir`. The easiest way to do this, is to resolve based on the directory name of the 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"
972
973
  },
973
974
  "repository": {
974
975
  "type": "git",
@@ -981,6 +982,83 @@
981
982
  }
982
983
  },
983
984
  "types": {
985
+ "@mrgrain/cdk-esbuild.AssetProps": {
986
+ "assembly": "@mrgrain/cdk-esbuild",
987
+ "datatype": true,
988
+ "docs": {
989
+ "stability": "stable"
990
+ },
991
+ "fqn": "@mrgrain/cdk-esbuild.AssetProps",
992
+ "interfaces": [
993
+ "@mrgrain/cdk-esbuild.BundlerProps"
994
+ ],
995
+ "kind": "interface",
996
+ "locationInModule": {
997
+ "filename": "src/asset.ts",
998
+ "line": 22
999
+ },
1000
+ "name": "AssetProps",
1001
+ "properties": [
1002
+ {
1003
+ "abstract": true,
1004
+ "docs": {
1005
+ "remarks": "E.g. `src/index.ts`.",
1006
+ "stability": "stable",
1007
+ "summary": "A relative path or list or map of relative paths to the entry points of your code from the root of the project."
1008
+ },
1009
+ "immutable": true,
1010
+ "locationInModule": {
1011
+ "filename": "src/asset.ts",
1012
+ "line": 28
1013
+ },
1014
+ "name": "entryPoints",
1015
+ "type": {
1016
+ "union": {
1017
+ "types": [
1018
+ {
1019
+ "primitive": "string"
1020
+ },
1021
+ {
1022
+ "collection": {
1023
+ "elementtype": {
1024
+ "primitive": "string"
1025
+ },
1026
+ "kind": "array"
1027
+ }
1028
+ },
1029
+ {
1030
+ "collection": {
1031
+ "elementtype": {
1032
+ "primitive": "string"
1033
+ },
1034
+ "kind": "map"
1035
+ }
1036
+ }
1037
+ ]
1038
+ }
1039
+ }
1040
+ },
1041
+ {
1042
+ "abstract": true,
1043
+ "docs": {
1044
+ "remarks": "As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed.\n\nDefaults to a hash of all files in the resulting bundle.",
1045
+ "stability": "stable",
1046
+ "summary": "A hash of this asset, which is available at construction time."
1047
+ },
1048
+ "immutable": true,
1049
+ "locationInModule": {
1050
+ "filename": "src/asset.ts",
1051
+ "line": 19
1052
+ },
1053
+ "name": "assetHash",
1054
+ "optional": true,
1055
+ "type": {
1056
+ "primitive": "string"
1057
+ }
1058
+ }
1059
+ ],
1060
+ "symbolId": "src/asset:AssetProps"
1061
+ },
984
1062
  "@mrgrain/cdk-esbuild.BuildOptions": {
985
1063
  "assembly": "@mrgrain/cdk-esbuild",
986
1064
  "datatype": true,
@@ -991,7 +1069,7 @@
991
1069
  "kind": "interface",
992
1070
  "locationInModule": {
993
1071
  "filename": "src/esbuild-types.ts",
994
- "line": 38
1072
+ "line": 40
995
1073
  },
996
1074
  "name": "BuildOptions",
997
1075
  "properties": [
@@ -1003,7 +1081,7 @@
1003
1081
  "immutable": true,
1004
1082
  "locationInModule": {
1005
1083
  "filename": "src/esbuild-types.ts",
1006
- "line": 64
1084
+ "line": 66
1007
1085
  },
1008
1086
  "name": "absWorkingDir",
1009
1087
  "optional": true,
@@ -1019,7 +1097,7 @@
1019
1097
  "immutable": true,
1020
1098
  "locationInModule": {
1021
1099
  "filename": "src/esbuild-types.ts",
1022
- "line": 53
1100
+ "line": 55
1023
1101
  },
1024
1102
  "name": "allowOverwrite",
1025
1103
  "optional": true,
@@ -1035,7 +1113,7 @@
1035
1113
  "immutable": true,
1036
1114
  "locationInModule": {
1037
1115
  "filename": "src/esbuild-types.ts",
1038
- "line": 59
1116
+ "line": 61
1039
1117
  },
1040
1118
  "name": "assetNames",
1041
1119
  "optional": true,
@@ -1051,7 +1129,7 @@
1051
1129
  "immutable": true,
1052
1130
  "locationInModule": {
1053
1131
  "filename": "src/esbuild-types.ts",
1054
- "line": 61
1132
+ "line": 63
1055
1133
  },
1056
1134
  "name": "banner",
1057
1135
  "optional": true,
@@ -1072,7 +1150,7 @@
1072
1150
  "immutable": true,
1073
1151
  "locationInModule": {
1074
1152
  "filename": "src/esbuild-types.ts",
1075
- "line": 39
1153
+ "line": 41
1076
1154
  },
1077
1155
  "name": "bundle",
1078
1156
  "optional": true,
@@ -1088,7 +1166,7 @@
1088
1166
  "immutable": true,
1089
1167
  "locationInModule": {
1090
1168
  "filename": "src/esbuild-types.ts",
1091
- "line": 21
1169
+ "line": 23
1092
1170
  },
1093
1171
  "name": "charset",
1094
1172
  "optional": true,
@@ -1104,7 +1182,7 @@
1104
1182
  "immutable": true,
1105
1183
  "locationInModule": {
1106
1184
  "filename": "src/esbuild-types.ts",
1107
- "line": 58
1185
+ "line": 60
1108
1186
  },
1109
1187
  "name": "chunkNames",
1110
1188
  "optional": true,
@@ -1120,7 +1198,7 @@
1120
1198
  "immutable": true,
1121
1199
  "locationInModule": {
1122
1200
  "filename": "src/esbuild-types.ts",
1123
- "line": 33
1201
+ "line": 35
1124
1202
  },
1125
1203
  "name": "color",
1126
1204
  "optional": true,
@@ -1136,7 +1214,7 @@
1136
1214
  "immutable": true,
1137
1215
  "locationInModule": {
1138
1216
  "filename": "src/esbuild-types.ts",
1139
- "line": 51
1217
+ "line": 53
1140
1218
  },
1141
1219
  "name": "conditions",
1142
1220
  "optional": true,
@@ -1157,7 +1235,7 @@
1157
1235
  "immutable": true,
1158
1236
  "locationInModule": {
1159
1237
  "filename": "src/esbuild-types.ts",
1160
- "line": 29
1238
+ "line": 31
1161
1239
  },
1162
1240
  "name": "define",
1163
1241
  "optional": true,
@@ -1178,7 +1256,7 @@
1178
1256
  "immutable": true,
1179
1257
  "locationInModule": {
1180
1258
  "filename": "src/esbuild-types.ts",
1181
- "line": 57
1259
+ "line": 59
1182
1260
  },
1183
1261
  "name": "entryNames",
1184
1262
  "optional": true,
@@ -1194,7 +1272,7 @@
1194
1272
  "immutable": true,
1195
1273
  "locationInModule": {
1196
1274
  "filename": "src/esbuild-types.ts",
1197
- "line": 47
1275
+ "line": 49
1198
1276
  },
1199
1277
  "name": "external",
1200
1278
  "optional": true,
@@ -1215,7 +1293,7 @@
1215
1293
  "immutable": true,
1216
1294
  "locationInModule": {
1217
1295
  "filename": "src/esbuild-types.ts",
1218
- "line": 62
1296
+ "line": 64
1219
1297
  },
1220
1298
  "name": "footer",
1221
1299
  "optional": true,
@@ -1236,7 +1314,7 @@
1236
1314
  "immutable": true,
1237
1315
  "locationInModule": {
1238
1316
  "filename": "src/esbuild-types.ts",
1239
- "line": 13
1317
+ "line": 15
1240
1318
  },
1241
1319
  "name": "format",
1242
1320
  "optional": true,
@@ -1252,7 +1330,7 @@
1252
1330
  "immutable": true,
1253
1331
  "locationInModule": {
1254
1332
  "filename": "src/esbuild-types.ts",
1255
- "line": 14
1333
+ "line": 16
1256
1334
  },
1257
1335
  "name": "globalName",
1258
1336
  "optional": true,
@@ -1268,7 +1346,7 @@
1268
1346
  "immutable": true,
1269
1347
  "locationInModule": {
1270
1348
  "filename": "src/esbuild-types.ts",
1271
- "line": 23
1349
+ "line": 25
1272
1350
  },
1273
1351
  "name": "ignoreAnnotations",
1274
1352
  "optional": true,
@@ -1284,7 +1362,7 @@
1284
1362
  "immutable": true,
1285
1363
  "locationInModule": {
1286
1364
  "filename": "src/esbuild-types.ts",
1287
- "line": 63
1365
+ "line": 65
1288
1366
  },
1289
1367
  "name": "incremental",
1290
1368
  "optional": true,
@@ -1300,7 +1378,7 @@
1300
1378
  "immutable": true,
1301
1379
  "locationInModule": {
1302
1380
  "filename": "src/esbuild-types.ts",
1303
- "line": 60
1381
+ "line": 62
1304
1382
  },
1305
1383
  "name": "inject",
1306
1384
  "optional": true,
@@ -1321,7 +1399,7 @@
1321
1399
  "immutable": true,
1322
1400
  "locationInModule": {
1323
1401
  "filename": "src/esbuild-types.ts",
1324
- "line": 25
1402
+ "line": 27
1325
1403
  },
1326
1404
  "name": "jsx",
1327
1405
  "optional": true,
@@ -1337,7 +1415,7 @@
1337
1415
  "immutable": true,
1338
1416
  "locationInModule": {
1339
1417
  "filename": "src/esbuild-types.ts",
1340
- "line": 26
1418
+ "line": 28
1341
1419
  },
1342
1420
  "name": "jsxFactory",
1343
1421
  "optional": true,
@@ -1353,7 +1431,7 @@
1353
1431
  "immutable": true,
1354
1432
  "locationInModule": {
1355
1433
  "filename": "src/esbuild-types.ts",
1356
- "line": 27
1434
+ "line": 29
1357
1435
  },
1358
1436
  "name": "jsxFragment",
1359
1437
  "optional": true,
@@ -1369,7 +1447,7 @@
1369
1447
  "immutable": true,
1370
1448
  "locationInModule": {
1371
1449
  "filename": "src/esbuild-types.ts",
1372
- "line": 31
1450
+ "line": 33
1373
1451
  },
1374
1452
  "name": "keepNames",
1375
1453
  "optional": true,
@@ -1385,7 +1463,7 @@
1385
1463
  "immutable": true,
1386
1464
  "locationInModule": {
1387
1465
  "filename": "src/esbuild-types.ts",
1388
- "line": 9
1466
+ "line": 11
1389
1467
  },
1390
1468
  "name": "legalComments",
1391
1469
  "optional": true,
@@ -1401,7 +1479,7 @@
1401
1479
  "immutable": true,
1402
1480
  "locationInModule": {
1403
1481
  "filename": "src/esbuild-types.ts",
1404
- "line": 48
1482
+ "line": 50
1405
1483
  },
1406
1484
  "name": "loader",
1407
1485
  "optional": true,
@@ -1422,7 +1500,7 @@
1422
1500
  "immutable": true,
1423
1501
  "locationInModule": {
1424
1502
  "filename": "src/esbuild-types.ts",
1425
- "line": 34
1503
+ "line": 36
1426
1504
  },
1427
1505
  "name": "logLevel",
1428
1506
  "optional": true,
@@ -1438,7 +1516,7 @@
1438
1516
  "immutable": true,
1439
1517
  "locationInModule": {
1440
1518
  "filename": "src/esbuild-types.ts",
1441
- "line": 35
1519
+ "line": 37
1442
1520
  },
1443
1521
  "name": "logLimit",
1444
1522
  "optional": true,
@@ -1454,7 +1532,7 @@
1454
1532
  "immutable": true,
1455
1533
  "locationInModule": {
1456
1534
  "filename": "src/esbuild-types.ts",
1457
- "line": 50
1535
+ "line": 52
1458
1536
  },
1459
1537
  "name": "mainFields",
1460
1538
  "optional": true,
@@ -1475,7 +1553,7 @@
1475
1553
  "immutable": true,
1476
1554
  "locationInModule": {
1477
1555
  "filename": "src/esbuild-types.ts",
1478
- "line": 43
1556
+ "line": 45
1479
1557
  },
1480
1558
  "name": "metafile",
1481
1559
  "optional": true,
@@ -1491,7 +1569,7 @@
1491
1569
  "immutable": true,
1492
1570
  "locationInModule": {
1493
1571
  "filename": "src/esbuild-types.ts",
1494
- "line": 17
1572
+ "line": 19
1495
1573
  },
1496
1574
  "name": "minify",
1497
1575
  "optional": true,
@@ -1507,7 +1585,7 @@
1507
1585
  "immutable": true,
1508
1586
  "locationInModule": {
1509
1587
  "filename": "src/esbuild-types.ts",
1510
- "line": 19
1588
+ "line": 21
1511
1589
  },
1512
1590
  "name": "minifyIdentifiers",
1513
1591
  "optional": true,
@@ -1523,7 +1601,7 @@
1523
1601
  "immutable": true,
1524
1602
  "locationInModule": {
1525
1603
  "filename": "src/esbuild-types.ts",
1526
- "line": 20
1604
+ "line": 22
1527
1605
  },
1528
1606
  "name": "minifySyntax",
1529
1607
  "optional": true,
@@ -1539,7 +1617,7 @@
1539
1617
  "immutable": true,
1540
1618
  "locationInModule": {
1541
1619
  "filename": "src/esbuild-types.ts",
1542
- "line": 18
1620
+ "line": 20
1543
1621
  },
1544
1622
  "name": "minifyWhitespace",
1545
1623
  "optional": true,
@@ -1555,7 +1633,7 @@
1555
1633
  "immutable": true,
1556
1634
  "locationInModule": {
1557
1635
  "filename": "src/esbuild-types.ts",
1558
- "line": 65
1636
+ "line": 67
1559
1637
  },
1560
1638
  "name": "nodePaths",
1561
1639
  "optional": true,
@@ -1576,7 +1654,7 @@
1576
1654
  "immutable": true,
1577
1655
  "locationInModule": {
1578
1656
  "filename": "src/esbuild-types.ts",
1579
- "line": 45
1657
+ "line": 47
1580
1658
  },
1581
1659
  "name": "outbase",
1582
1660
  "optional": true,
@@ -1592,7 +1670,7 @@
1592
1670
  "immutable": true,
1593
1671
  "locationInModule": {
1594
1672
  "filename": "src/esbuild-types.ts",
1595
- "line": 44
1673
+ "line": 46
1596
1674
  },
1597
1675
  "name": "outdir",
1598
1676
  "optional": true,
@@ -1608,7 +1686,7 @@
1608
1686
  "immutable": true,
1609
1687
  "locationInModule": {
1610
1688
  "filename": "src/esbuild-types.ts",
1611
- "line": 55
1689
+ "line": 57
1612
1690
  },
1613
1691
  "name": "outExtension",
1614
1692
  "optional": true,
@@ -1629,7 +1707,7 @@
1629
1707
  "immutable": true,
1630
1708
  "locationInModule": {
1631
1709
  "filename": "src/esbuild-types.ts",
1632
- "line": 42
1710
+ "line": 44
1633
1711
  },
1634
1712
  "name": "outfile",
1635
1713
  "optional": true,
@@ -1645,7 +1723,7 @@
1645
1723
  "immutable": true,
1646
1724
  "locationInModule": {
1647
1725
  "filename": "src/esbuild-types.ts",
1648
- "line": 46
1726
+ "line": 48
1649
1727
  },
1650
1728
  "name": "platform",
1651
1729
  "optional": true,
@@ -1661,7 +1739,7 @@
1661
1739
  "immutable": true,
1662
1740
  "locationInModule": {
1663
1741
  "filename": "src/esbuild-types.ts",
1664
- "line": 41
1742
+ "line": 43
1665
1743
  },
1666
1744
  "name": "preserveSymlinks",
1667
1745
  "optional": true,
@@ -1677,7 +1755,7 @@
1677
1755
  "immutable": true,
1678
1756
  "locationInModule": {
1679
1757
  "filename": "src/esbuild-types.ts",
1680
- "line": 56
1758
+ "line": 58
1681
1759
  },
1682
1760
  "name": "publicPath",
1683
1761
  "optional": true,
@@ -1693,7 +1771,7 @@
1693
1771
  "immutable": true,
1694
1772
  "locationInModule": {
1695
1773
  "filename": "src/esbuild-types.ts",
1696
- "line": 30
1774
+ "line": 32
1697
1775
  },
1698
1776
  "name": "pure",
1699
1777
  "optional": true,
@@ -1714,7 +1792,7 @@
1714
1792
  "immutable": true,
1715
1793
  "locationInModule": {
1716
1794
  "filename": "src/esbuild-types.ts",
1717
- "line": 49
1795
+ "line": 51
1718
1796
  },
1719
1797
  "name": "resolveExtensions",
1720
1798
  "optional": true,
@@ -1735,7 +1813,7 @@
1735
1813
  "immutable": true,
1736
1814
  "locationInModule": {
1737
1815
  "filename": "src/esbuild-types.ts",
1738
- "line": 8
1816
+ "line": 10
1739
1817
  },
1740
1818
  "name": "sourcemap",
1741
1819
  "optional": true,
@@ -1760,7 +1838,7 @@
1760
1838
  "immutable": true,
1761
1839
  "locationInModule": {
1762
1840
  "filename": "src/esbuild-types.ts",
1763
- "line": 10
1841
+ "line": 12
1764
1842
  },
1765
1843
  "name": "sourceRoot",
1766
1844
  "optional": true,
@@ -1776,7 +1854,7 @@
1776
1854
  "immutable": true,
1777
1855
  "locationInModule": {
1778
1856
  "filename": "src/esbuild-types.ts",
1779
- "line": 11
1857
+ "line": 13
1780
1858
  },
1781
1859
  "name": "sourcesContent",
1782
1860
  "optional": true,
@@ -1792,7 +1870,7 @@
1792
1870
  "immutable": true,
1793
1871
  "locationInModule": {
1794
1872
  "filename": "src/esbuild-types.ts",
1795
- "line": 40
1873
+ "line": 42
1796
1874
  },
1797
1875
  "name": "splitting",
1798
1876
  "optional": true,
@@ -1808,7 +1886,7 @@
1808
1886
  "immutable": true,
1809
1887
  "locationInModule": {
1810
1888
  "filename": "src/esbuild-types.ts",
1811
- "line": 15
1889
+ "line": 17
1812
1890
  },
1813
1891
  "name": "target",
1814
1892
  "optional": true,
@@ -1838,7 +1916,7 @@
1838
1916
  "immutable": true,
1839
1917
  "locationInModule": {
1840
1918
  "filename": "src/esbuild-types.ts",
1841
- "line": 22
1919
+ "line": 24
1842
1920
  },
1843
1921
  "name": "treeShaking",
1844
1922
  "optional": true,
@@ -1854,7 +1932,7 @@
1854
1932
  "immutable": true,
1855
1933
  "locationInModule": {
1856
1934
  "filename": "src/esbuild-types.ts",
1857
- "line": 54
1935
+ "line": 56
1858
1936
  },
1859
1937
  "name": "tsconfig",
1860
1938
  "optional": true,
@@ -1870,7 +1948,7 @@
1870
1948
  "immutable": true,
1871
1949
  "locationInModule": {
1872
1950
  "filename": "src/esbuild-types.ts",
1873
- "line": 52
1951
+ "line": 54
1874
1952
  },
1875
1953
  "name": "write",
1876
1954
  "optional": true,
@@ -1881,260 +1959,180 @@
1881
1959
  ],
1882
1960
  "symbolId": "src/esbuild-types:BuildOptions"
1883
1961
  },
1884
- "@mrgrain/cdk-esbuild.CodeConfig": {
1962
+ "@mrgrain/cdk-esbuild.BundlerProps": {
1885
1963
  "assembly": "@mrgrain/cdk-esbuild",
1886
1964
  "datatype": true,
1887
1965
  "docs": {
1888
1966
  "stability": "stable"
1889
1967
  },
1890
- "fqn": "@mrgrain/cdk-esbuild.CodeConfig",
1968
+ "fqn": "@mrgrain/cdk-esbuild.BundlerProps",
1891
1969
  "kind": "interface",
1892
1970
  "locationInModule": {
1893
- "filename": "src/code.ts",
1894
- "line": 21
1971
+ "filename": "src/bundler.ts",
1972
+ "line": 22
1895
1973
  },
1896
- "name": "CodeConfig",
1974
+ "name": "BundlerProps",
1897
1975
  "properties": [
1898
1976
  {
1899
1977
  "abstract": true,
1900
1978
  "docs": {
1901
- "stability": "stable"
1979
+ "remarks": "- `buildOptions.outdir: string` \\\nThe actual path for the output directory is defined by CDK. However setting this option allows to write files into a subdirectory. \\\nFor example `{ outdir: 'js' }` will create an asset with a single directory called `js`, which contains all built files. This approach can be useful for static website deployments, where JavaScript code should be placed into a subdirectory. \\\n*Cannot be used together with `outfile`*.\n- `buildOptions.outfile: string` \\\nRelative path to a file inside the CDK asset output directory. \\\nFor example `{ outfile: 'js/index.js' }` will create an asset with a single directory called `js`, which contains a single file `index.js`. This can be useful to rename the entry point. \\\n*Cannot be used with multiple entryPoints or together with `outdir`.*\n- `buildOptions.absWorkingDir: string` \\\nAbsolute path to the [esbuild working directory](https://esbuild.github.io/api/#working-directory) and defaults to the [current working directory](https://en.wikipedia.org/wiki/Working_directory). \\\nIf paths cannot be found, a good starting point is to look at the concatenation of `absWorkingDir + entryPoint`. It must always be a valid absolute path pointing to the entry point. When needed, the probably easiest way to set absWorkingDir is to use a combination of `resolve` and `__dirname` (see \"Library authors\" section in the documentation).",
1980
+ "see": "https://esbuild.github.io/api/#build-api",
1981
+ "stability": "stable",
1982
+ "summary": "Build options passed on to esbuild. Please refer to the esbuild Build API docs for details."
1902
1983
  },
1903
1984
  "immutable": true,
1904
1985
  "locationInModule": {
1905
- "filename": "src/code.ts",
1906
- "line": 23
1986
+ "filename": "src/bundler.ts",
1987
+ "line": 41
1907
1988
  },
1908
- "name": "inlineCode",
1989
+ "name": "buildOptions",
1909
1990
  "optional": true,
1910
1991
  "type": {
1911
- "primitive": "string"
1992
+ "fqn": "@mrgrain/cdk-esbuild.BuildOptions"
1912
1993
  }
1913
1994
  },
1914
1995
  {
1915
1996
  "abstract": true,
1916
1997
  "docs": {
1917
- "stability": "stable"
1998
+ "remarks": "Files copied like this will be overwritten by esbuild if they share the same name as any of the outputs.",
1999
+ "stability": "stable",
2000
+ "summary": "Copy additional files to the output directory, before the build runs."
1918
2001
  },
1919
2002
  "immutable": true,
1920
2003
  "locationInModule": {
1921
- "filename": "src/code.ts",
1922
- "line": 22
2004
+ "filename": "src/bundler.ts",
2005
+ "line": 49
1923
2006
  },
1924
- "name": "s3Location",
2007
+ "name": "copyDir",
1925
2008
  "optional": true,
1926
2009
  "type": {
1927
- "fqn": "@mrgrain/cdk-esbuild.Location"
2010
+ "primitive": "string"
1928
2011
  }
1929
2012
  }
1930
2013
  ],
1931
- "symbolId": "src/code:CodeConfig"
2014
+ "symbolId": "src/bundler:BundlerProps"
1932
2015
  },
1933
- "@mrgrain/cdk-esbuild.EsbuildAssetProps": {
2016
+ "@mrgrain/cdk-esbuild.CodeConfig": {
1934
2017
  "assembly": "@mrgrain/cdk-esbuild",
1935
2018
  "datatype": true,
1936
2019
  "docs": {
1937
2020
  "stability": "stable"
1938
2021
  },
1939
- "fqn": "@mrgrain/cdk-esbuild.EsbuildAssetProps",
1940
- "interfaces": [
1941
- "@mrgrain/cdk-esbuild.EsbuildProps"
1942
- ],
2022
+ "fqn": "@mrgrain/cdk-esbuild.CodeConfig",
1943
2023
  "kind": "interface",
1944
2024
  "locationInModule": {
1945
- "filename": "src/asset.ts",
1946
- "line": 29
2025
+ "filename": "src/code.ts",
2026
+ "line": 17
1947
2027
  },
1948
- "name": "EsbuildAssetProps",
2028
+ "name": "CodeConfig",
1949
2029
  "properties": [
1950
2030
  {
1951
2031
  "abstract": true,
1952
2032
  "docs": {
1953
2033
  "stability": "stable",
1954
- "summary": "Relative paths to the entrypoints of your code, e.g. `src/index.ts`."
2034
+ "summary": "The location of the code in S3."
1955
2035
  },
1956
2036
  "immutable": true,
1957
2037
  "locationInModule": {
1958
- "filename": "src/asset.ts",
1959
- "line": 33
2038
+ "filename": "src/code.ts",
2039
+ "line": 23
1960
2040
  },
1961
- "name": "entryPoints",
2041
+ "name": "s3Location",
1962
2042
  "type": {
1963
- "union": {
1964
- "types": [
1965
- {
1966
- "primitive": "string"
1967
- },
1968
- {
1969
- "collection": {
1970
- "elementtype": {
1971
- "primitive": "string"
1972
- },
1973
- "kind": "array"
1974
- }
1975
- },
1976
- {
1977
- "collection": {
1978
- "elementtype": {
1979
- "primitive": "string"
1980
- },
1981
- "kind": "map"
1982
- }
1983
- }
1984
- ]
1985
- }
2043
+ "fqn": "@aws-cdk/aws-s3.Location"
1986
2044
  }
1987
2045
  }
1988
2046
  ],
1989
- "symbolId": "src/asset:EsbuildAssetProps"
2047
+ "symbolId": "src/code:CodeConfig"
1990
2048
  },
1991
- "@mrgrain/cdk-esbuild.EsbuildBundling": {
2049
+ "@mrgrain/cdk-esbuild.EsbuildBundler": {
1992
2050
  "assembly": "@mrgrain/cdk-esbuild",
1993
2051
  "docs": {
1994
- "stability": "experimental"
2052
+ "remarks": "This class directly interfaces with esbuild and provides almost no configuration safeguards.",
2053
+ "stability": "experimental",
2054
+ "summary": "Low-level construct that can be used where `BundlingOptions` are required."
1995
2055
  },
1996
- "fqn": "@mrgrain/cdk-esbuild.EsbuildBundling",
2056
+ "fqn": "@mrgrain/cdk-esbuild.EsbuildBundler",
1997
2057
  "initializer": {
1998
2058
  "docs": {
1999
2059
  "stability": "experimental"
2000
2060
  },
2001
2061
  "locationInModule": {
2002
- "filename": "src/bundling.ts",
2003
- "line": 16
2062
+ "filename": "src/bundler.ts",
2063
+ "line": 76
2004
2064
  },
2005
2065
  "parameters": [
2006
2066
  {
2007
- "name": "buildOptions",
2067
+ "docs": {
2068
+ "remarks": "E.g. `src/index.ts`.",
2069
+ "stability": "experimental",
2070
+ "summary": "A relative path or list or map of relative paths to the entry points of your code from the root of the project."
2071
+ },
2072
+ "name": "entryPoints",
2008
2073
  "type": {
2009
- "fqn": "@mrgrain/cdk-esbuild.EsbuildOptions"
2074
+ "union": {
2075
+ "types": [
2076
+ {
2077
+ "primitive": "string"
2078
+ },
2079
+ {
2080
+ "collection": {
2081
+ "elementtype": {
2082
+ "primitive": "string"
2083
+ },
2084
+ "kind": "array"
2085
+ }
2086
+ },
2087
+ {
2088
+ "collection": {
2089
+ "elementtype": {
2090
+ "primitive": "string"
2091
+ },
2092
+ "kind": "map"
2093
+ }
2094
+ }
2095
+ ]
2096
+ }
2010
2097
  }
2011
2098
  },
2012
2099
  {
2013
- "name": "bundlerProps",
2014
- "optional": true,
2100
+ "docs": {
2101
+ "stability": "experimental",
2102
+ "summary": "Props to change the behaviour of the bundler."
2103
+ },
2104
+ "name": "props",
2015
2105
  "type": {
2016
- "fqn": "@mrgrain/cdk-esbuild.EsbuildBundlingProps"
2106
+ "fqn": "@mrgrain/cdk-esbuild.BundlerProps"
2017
2107
  }
2018
2108
  }
2019
2109
  ]
2020
2110
  },
2021
2111
  "kind": "class",
2022
2112
  "locationInModule": {
2023
- "filename": "src/bundling.ts",
2024
- "line": 11
2025
- },
2026
- "name": "EsbuildBundling",
2027
- "properties": [
2028
- {
2029
- "docs": {
2030
- "stability": "experimental"
2031
- },
2032
- "immutable": true,
2033
- "locationInModule": {
2034
- "filename": "src/bundling.ts",
2035
- "line": 17
2036
- },
2037
- "name": "buildOptions",
2038
- "type": {
2039
- "fqn": "@mrgrain/cdk-esbuild.EsbuildOptions"
2040
- }
2041
- },
2042
- {
2043
- "docs": {
2044
- "stability": "experimental"
2045
- },
2046
- "immutable": true,
2047
- "locationInModule": {
2048
- "filename": "src/bundling.ts",
2049
- "line": 14
2050
- },
2051
- "name": "image",
2052
- "type": {
2053
- "fqn": "@aws-cdk/core.DockerImage"
2054
- }
2055
- },
2056
- {
2057
- "docs": {
2058
- "stability": "experimental"
2059
- },
2060
- "immutable": true,
2061
- "locationInModule": {
2062
- "filename": "src/bundling.ts",
2063
- "line": 12
2064
- },
2065
- "name": "local",
2066
- "type": {
2067
- "fqn": "@mrgrain/cdk-esbuild.LocalBundler"
2068
- }
2069
- }
2070
- ],
2071
- "symbolId": "src/bundling:EsbuildBundling"
2072
- },
2073
- "@mrgrain/cdk-esbuild.EsbuildBundlingProps": {
2074
- "assembly": "@mrgrain/cdk-esbuild",
2075
- "datatype": true,
2076
- "docs": {
2077
- "stability": "stable"
2078
- },
2079
- "fqn": "@mrgrain/cdk-esbuild.EsbuildBundlingProps",
2080
- "kind": "interface",
2081
- "locationInModule": {
2082
- "filename": "src/bundlers.ts",
2083
- "line": 15
2084
- },
2085
- "name": "EsbuildBundlingProps",
2086
- "properties": [
2087
- {
2088
- "abstract": true,
2089
- "docs": {
2090
- "stability": "stable",
2091
- "summary": "Relative path to a directory copied to the output before esbuild is run (i.e esbuild will overwrite existing files)."
2092
- },
2093
- "immutable": true,
2094
- "locationInModule": {
2095
- "filename": "src/bundlers.ts",
2096
- "line": 19
2097
- },
2098
- "name": "copyDir",
2099
- "optional": true,
2100
- "type": {
2101
- "primitive": "string"
2102
- }
2103
- }
2104
- ],
2105
- "symbolId": "src/bundlers:EsbuildBundlingProps"
2106
- },
2107
- "@mrgrain/cdk-esbuild.EsbuildOptions": {
2108
- "assembly": "@mrgrain/cdk-esbuild",
2109
- "datatype": true,
2110
- "docs": {
2111
- "stability": "stable"
2112
- },
2113
- "fqn": "@mrgrain/cdk-esbuild.EsbuildOptions",
2114
- "interfaces": [
2115
- "@mrgrain/cdk-esbuild.BuildOptions"
2116
- ],
2117
- "kind": "interface",
2118
- "locationInModule": {
2119
- "filename": "src/bundlers.ts",
2120
- "line": 11
2113
+ "filename": "src/bundler.ts",
2114
+ "line": 58
2121
2115
  },
2122
- "name": "EsbuildOptions",
2116
+ "name": "EsbuildBundler",
2123
2117
  "properties": [
2124
2118
  {
2125
- "abstract": true,
2126
2119
  "docs": {
2127
- "stability": "stable"
2120
+ "remarks": "E.g. `src/index.ts`.",
2121
+ "stability": "experimental",
2122
+ "summary": "A relative path or list or map of relative paths to the entry points of your code from the root of the project."
2128
2123
  },
2129
2124
  "immutable": true,
2130
2125
  "locationInModule": {
2131
- "filename": "src/bundlers.ts",
2132
- "line": 12
2126
+ "filename": "src/bundler.ts",
2127
+ "line": 83
2133
2128
  },
2134
2129
  "name": "entryPoints",
2135
2130
  "type": {
2136
2131
  "union": {
2137
2132
  "types": [
2133
+ {
2134
+ "primitive": "string"
2135
+ },
2138
2136
  {
2139
2137
  "collection": {
2140
2138
  "elementtype": {
@@ -2154,84 +2152,61 @@
2154
2152
  ]
2155
2153
  }
2156
2154
  }
2157
- }
2158
- ],
2159
- "symbolId": "src/bundlers:EsbuildOptions"
2160
- },
2161
- "@mrgrain/cdk-esbuild.EsbuildProps": {
2162
- "assembly": "@mrgrain/cdk-esbuild",
2163
- "datatype": true,
2164
- "docs": {
2165
- "stability": "stable"
2166
- },
2167
- "fqn": "@mrgrain/cdk-esbuild.EsbuildProps",
2168
- "kind": "interface",
2169
- "locationInModule": {
2170
- "filename": "src/asset.ts",
2171
- "line": 8
2172
- },
2173
- "name": "EsbuildProps",
2174
- "properties": [
2155
+ },
2175
2156
  {
2176
- "abstract": true,
2177
2157
  "docs": {
2178
- "remarks": "As this is a plain string, it\ncan be used in construct IDs in order to enforce creation of a new resource when the content\nhash has changed.",
2179
- "stability": "stable",
2180
- "summary": "A hash of this asset, which is available at construction time."
2158
+ "deprecated": "This value is ignored since the bundler is always using a locally installed version of esbuild. However the property is required to comply with the `BundlingOptions` interface.",
2159
+ "stability": "deprecated"
2181
2160
  },
2182
2161
  "immutable": true,
2183
2162
  "locationInModule": {
2184
- "filename": "src/asset.ts",
2185
- "line": 26
2163
+ "filename": "src/bundler.ts",
2164
+ "line": 71
2186
2165
  },
2187
- "name": "assetHash",
2188
- "optional": true,
2166
+ "name": "image",
2189
2167
  "type": {
2190
- "primitive": "string"
2168
+ "fqn": "@aws-cdk/core.DockerImage"
2191
2169
  }
2192
2170
  },
2193
2171
  {
2194
- "abstract": true,
2195
2172
  "docs": {
2196
- "stability": "stable",
2197
- "summary": "Options passed on to esbuild."
2173
+ "stability": "experimental",
2174
+ "summary": "Implementation of `ILocalBundling` interface, responsible for calling esbuild functions."
2198
2175
  },
2199
2176
  "immutable": true,
2200
2177
  "locationInModule": {
2201
- "filename": "src/asset.ts",
2202
- "line": 17
2178
+ "filename": "src/bundler.ts",
2179
+ "line": 64
2203
2180
  },
2204
- "name": "buildOptions",
2205
- "optional": true,
2181
+ "name": "local",
2206
2182
  "type": {
2207
- "fqn": "@mrgrain/cdk-esbuild.BuildOptions"
2183
+ "fqn": "@aws-cdk/core.ILocalBundling"
2208
2184
  }
2209
2185
  },
2210
2186
  {
2211
- "abstract": true,
2212
2187
  "docs": {
2213
- "stability": "stable",
2214
- "summary": "Relative path to a directory copied to the output BEFORE esbuild is run (i.e esbuild will overwrite existing files)."
2188
+ "stability": "experimental",
2189
+ "summary": "Props to change the behaviour of the bundler."
2215
2190
  },
2216
2191
  "immutable": true,
2217
2192
  "locationInModule": {
2218
- "filename": "src/asset.ts",
2219
- "line": 12
2193
+ "filename": "src/bundler.ts",
2194
+ "line": 90
2220
2195
  },
2221
- "name": "copyDir",
2222
- "optional": true,
2196
+ "name": "props",
2223
2197
  "type": {
2224
- "primitive": "string"
2198
+ "fqn": "@mrgrain/cdk-esbuild.BundlerProps"
2225
2199
  }
2226
2200
  }
2227
2201
  ],
2228
- "symbolId": "src/asset:EsbuildProps"
2202
+ "symbolId": "src/bundler:EsbuildBundler"
2229
2203
  },
2230
2204
  "@mrgrain/cdk-esbuild.InlineJavaScriptCode": {
2231
2205
  "assembly": "@mrgrain/cdk-esbuild",
2232
2206
  "base": "@aws-cdk/aws-lambda.InlineCode",
2233
2207
  "docs": {
2234
- "stability": "experimental"
2208
+ "stability": "experimental",
2209
+ "summary": "An implementation of `lambda.InlineCode` using the esbuild Transform API. Inline function code is limited to 4 KiB after transformation."
2235
2210
  },
2236
2211
  "fqn": "@mrgrain/cdk-esbuild.InlineJavaScriptCode",
2237
2212
  "initializer": {
@@ -2240,16 +2215,26 @@
2240
2215
  },
2241
2216
  "locationInModule": {
2242
2217
  "filename": "src/inline-code.ts",
2243
- "line": 32
2218
+ "line": 34
2244
2219
  },
2245
2220
  "parameters": [
2246
2221
  {
2222
+ "docs": {
2223
+ "stability": "experimental",
2224
+ "summary": "The inline code to be transformed."
2225
+ },
2247
2226
  "name": "code",
2248
2227
  "type": {
2249
2228
  "primitive": "string"
2250
2229
  }
2251
2230
  },
2252
2231
  {
2232
+ "docs": {
2233
+ "remarks": "Please refer to the esbuild Transform API docs for details. \\\nDefault values for `transformOptions`:\n- `loader='js'`",
2234
+ "see": "https://esbuild.github.io/api/#transform-api",
2235
+ "stability": "experimental",
2236
+ "summary": "Transform options passed on to esbuild."
2237
+ },
2253
2238
  "name": "transformOptions",
2254
2239
  "optional": true,
2255
2240
  "type": {
@@ -2261,7 +2246,7 @@
2261
2246
  "kind": "class",
2262
2247
  "locationInModule": {
2263
2248
  "filename": "src/inline-code.ts",
2264
- "line": 31
2249
+ "line": 33
2265
2250
  },
2266
2251
  "name": "InlineJavaScriptCode",
2267
2252
  "symbolId": "src/inline-code:InlineJavaScriptCode"
@@ -2270,7 +2255,8 @@
2270
2255
  "assembly": "@mrgrain/cdk-esbuild",
2271
2256
  "base": "@aws-cdk/aws-lambda.InlineCode",
2272
2257
  "docs": {
2273
- "stability": "experimental"
2258
+ "stability": "experimental",
2259
+ "summary": "An implementation of `lambda.InlineCode` using the esbuild Transform API. Inline function code is limited to 4 KiB after transformation."
2274
2260
  },
2275
2261
  "fqn": "@mrgrain/cdk-esbuild.InlineJsxCode",
2276
2262
  "initializer": {
@@ -2279,16 +2265,26 @@
2279
2265
  },
2280
2266
  "locationInModule": {
2281
2267
  "filename": "src/inline-code.ts",
2282
- "line": 41
2268
+ "line": 63
2283
2269
  },
2284
2270
  "parameters": [
2285
2271
  {
2272
+ "docs": {
2273
+ "stability": "experimental",
2274
+ "summary": "The inline code to be transformed."
2275
+ },
2286
2276
  "name": "code",
2287
2277
  "type": {
2288
2278
  "primitive": "string"
2289
2279
  }
2290
2280
  },
2291
2281
  {
2282
+ "docs": {
2283
+ "remarks": "Please refer to the esbuild Transform API docs for details. \\\nDefault values for `transformOptions`:\n- `loader='jsx'`",
2284
+ "see": "https://esbuild.github.io/api/#transform-api",
2285
+ "stability": "experimental",
2286
+ "summary": "Transform options passed on to esbuild."
2287
+ },
2292
2288
  "name": "transformOptions",
2293
2289
  "optional": true,
2294
2290
  "type": {
@@ -2300,7 +2296,7 @@
2300
2296
  "kind": "class",
2301
2297
  "locationInModule": {
2302
2298
  "filename": "src/inline-code.ts",
2303
- "line": 40
2299
+ "line": 62
2304
2300
  },
2305
2301
  "name": "InlineJsxCode",
2306
2302
  "symbolId": "src/inline-code:InlineJsxCode"
@@ -2309,7 +2305,8 @@
2309
2305
  "assembly": "@mrgrain/cdk-esbuild",
2310
2306
  "base": "@aws-cdk/aws-lambda.InlineCode",
2311
2307
  "docs": {
2312
- "stability": "experimental"
2308
+ "stability": "experimental",
2309
+ "summary": "An implementation of `lambda.InlineCode` using the esbuild Transform API. Inline function code is limited to 4 KiB after transformation."
2313
2310
  },
2314
2311
  "fqn": "@mrgrain/cdk-esbuild.InlineTsxCode",
2315
2312
  "initializer": {
@@ -2318,16 +2315,26 @@
2318
2315
  },
2319
2316
  "locationInModule": {
2320
2317
  "filename": "src/inline-code.ts",
2321
- "line": 59
2318
+ "line": 121
2322
2319
  },
2323
2320
  "parameters": [
2324
2321
  {
2322
+ "docs": {
2323
+ "stability": "experimental",
2324
+ "summary": "The inline code to be transformed."
2325
+ },
2325
2326
  "name": "code",
2326
2327
  "type": {
2327
2328
  "primitive": "string"
2328
2329
  }
2329
2330
  },
2330
2331
  {
2332
+ "docs": {
2333
+ "remarks": "Please refer to the esbuild Transform API docs for details. \\\nDefault values for `transformOptions`:\n- `loader='tsx'`",
2334
+ "see": "https://esbuild.github.io/api/#transform-api",
2335
+ "stability": "experimental",
2336
+ "summary": "Transform options passed on to esbuild."
2337
+ },
2331
2338
  "name": "transformOptions",
2332
2339
  "optional": true,
2333
2340
  "type": {
@@ -2339,7 +2346,7 @@
2339
2346
  "kind": "class",
2340
2347
  "locationInModule": {
2341
2348
  "filename": "src/inline-code.ts",
2342
- "line": 58
2349
+ "line": 120
2343
2350
  },
2344
2351
  "name": "InlineTsxCode",
2345
2352
  "symbolId": "src/inline-code:InlineTsxCode"
@@ -2348,7 +2355,8 @@
2348
2355
  "assembly": "@mrgrain/cdk-esbuild",
2349
2356
  "base": "@aws-cdk/aws-lambda.InlineCode",
2350
2357
  "docs": {
2351
- "stability": "experimental"
2358
+ "stability": "experimental",
2359
+ "summary": "An implementation of `lambda.InlineCode` using the esbuild Transform API. Inline function code is limited to 4 KiB after transformation."
2352
2360
  },
2353
2361
  "fqn": "@mrgrain/cdk-esbuild.InlineTypeScriptCode",
2354
2362
  "initializer": {
@@ -2357,16 +2365,26 @@
2357
2365
  },
2358
2366
  "locationInModule": {
2359
2367
  "filename": "src/inline-code.ts",
2360
- "line": 50
2368
+ "line": 92
2361
2369
  },
2362
2370
  "parameters": [
2363
2371
  {
2372
+ "docs": {
2373
+ "stability": "experimental",
2374
+ "summary": "The inline code to be transformed."
2375
+ },
2364
2376
  "name": "code",
2365
2377
  "type": {
2366
2378
  "primitive": "string"
2367
2379
  }
2368
2380
  },
2369
2381
  {
2382
+ "docs": {
2383
+ "remarks": "Please refer to the esbuild Transform API docs for details. \\\nDefault values for `transformOptions`:\n- `loader='ts'`",
2384
+ "see": "https://esbuild.github.io/api/#transform-api",
2385
+ "stability": "experimental",
2386
+ "summary": "Transform options passed on to esbuild."
2387
+ },
2370
2388
  "name": "transformOptions",
2371
2389
  "optional": true,
2372
2390
  "type": {
@@ -2378,7 +2396,7 @@
2378
2396
  "kind": "class",
2379
2397
  "locationInModule": {
2380
2398
  "filename": "src/inline-code.ts",
2381
- "line": 49
2399
+ "line": 91
2382
2400
  },
2383
2401
  "name": "InlineTypeScriptCode",
2384
2402
  "symbolId": "src/inline-code:InlineTypeScriptCode"
@@ -2386,16 +2404,18 @@
2386
2404
  "@mrgrain/cdk-esbuild.JavaScriptAsset": {
2387
2405
  "assembly": "@mrgrain/cdk-esbuild",
2388
2406
  "docs": {
2389
- "stability": "experimental"
2407
+ "remarks": "The asset can be used by other constructs.",
2408
+ "stability": "stable",
2409
+ "summary": "Bundles the entry points and creates a CDK asset which is uploaded to the bootstrapped CDK S3 bucket during deployment."
2390
2410
  },
2391
2411
  "fqn": "@mrgrain/cdk-esbuild.JavaScriptAsset",
2392
2412
  "initializer": {
2393
2413
  "docs": {
2394
- "stability": "experimental"
2414
+ "stability": "stable"
2395
2415
  },
2396
2416
  "locationInModule": {
2397
2417
  "filename": "src/asset.ts",
2398
- "line": 40
2418
+ "line": 41
2399
2419
  },
2400
2420
  "parameters": [
2401
2421
  {
@@ -2411,9 +2431,9 @@
2411
2431
  }
2412
2432
  },
2413
2433
  {
2414
- "name": "__2",
2434
+ "name": "props",
2415
2435
  "type": {
2416
- "fqn": "@mrgrain/cdk-esbuild.EsbuildAssetProps"
2436
+ "fqn": "@mrgrain/cdk-esbuild.AssetProps"
2417
2437
  }
2418
2438
  }
2419
2439
  ]
@@ -2421,7 +2441,7 @@
2421
2441
  "kind": "class",
2422
2442
  "locationInModule": {
2423
2443
  "filename": "src/asset.ts",
2424
- "line": 91
2444
+ "line": 94
2425
2445
  },
2426
2446
  "name": "JavaScriptAsset",
2427
2447
  "symbolId": "src/asset:JavaScriptAsset"
@@ -2429,7 +2449,8 @@
2429
2449
  "@mrgrain/cdk-esbuild.JavaScriptCode": {
2430
2450
  "assembly": "@mrgrain/cdk-esbuild",
2431
2451
  "docs": {
2432
- "stability": "stable"
2452
+ "stability": "stable",
2453
+ "summary": "Represents the deployed JavaScript Code."
2433
2454
  },
2434
2455
  "fqn": "@mrgrain/cdk-esbuild.JavaScriptCode",
2435
2456
  "initializer": {
@@ -2438,10 +2459,15 @@
2438
2459
  },
2439
2460
  "locationInModule": {
2440
2461
  "filename": "src/code.ts",
2441
- "line": 107
2462
+ "line": 123
2442
2463
  },
2443
2464
  "parameters": [
2444
2465
  {
2466
+ "docs": {
2467
+ "remarks": "E.g. `src/index.ts`.",
2468
+ "stability": "stable",
2469
+ "summary": "A relative path or list or map of relative paths to the entry points of your code from the root of the project."
2470
+ },
2445
2471
  "name": "entryPoints",
2446
2472
  "type": {
2447
2473
  "union": {
@@ -2470,10 +2496,15 @@
2470
2496
  }
2471
2497
  },
2472
2498
  {
2499
+ "docs": {
2500
+ "remarks": "Default values for `props.buildOptions`:\n- `bundle=true`\n- `platform=node`\n- `target=nodeX` with X being the major node version running locally",
2501
+ "stability": "stable",
2502
+ "summary": "Props to change the behavior of the bundler."
2503
+ },
2473
2504
  "name": "props",
2474
2505
  "optional": true,
2475
2506
  "type": {
2476
- "fqn": "@mrgrain/cdk-esbuild.EsbuildProps"
2507
+ "fqn": "@mrgrain/cdk-esbuild.JavaScriptCodeProps"
2477
2508
  }
2478
2509
  }
2479
2510
  ]
@@ -2481,7 +2512,7 @@
2481
2512
  "kind": "class",
2482
2513
  "locationInModule": {
2483
2514
  "filename": "src/code.ts",
2484
- "line": 104
2515
+ "line": 120
2485
2516
  },
2486
2517
  "methods": [
2487
2518
  {
@@ -2490,7 +2521,7 @@
2490
2521
  },
2491
2522
  "locationInModule": {
2492
2523
  "filename": "src/code.ts",
2493
- "line": 68
2524
+ "line": 73
2494
2525
  },
2495
2526
  "name": "bind",
2496
2527
  "parameters": [
@@ -2509,11 +2540,13 @@
2509
2540
  },
2510
2541
  {
2511
2542
  "docs": {
2512
- "stability": "stable"
2543
+ "remarks": "Specifically it's required to allow assets to add\nmetadata for tooling like SAM CLI to be able to find their origins.",
2544
+ "stability": "stable",
2545
+ "summary": "Called after the CFN function resource has been created to allow the code class to bind to it."
2513
2546
  },
2514
2547
  "locationInModule": {
2515
2548
  "filename": "src/code.ts",
2516
- "line": 94
2549
+ "line": 105
2517
2550
  },
2518
2551
  "name": "bindToResource",
2519
2552
  "parameters": [
@@ -2535,6 +2568,21 @@
2535
2568
  ],
2536
2569
  "name": "JavaScriptCode",
2537
2570
  "properties": [
2571
+ {
2572
+ "docs": {
2573
+ "stability": "stable"
2574
+ },
2575
+ "immutable": true,
2576
+ "locationInModule": {
2577
+ "filename": "src/code.ts",
2578
+ "line": 121
2579
+ },
2580
+ "name": "assetClass",
2581
+ "protected": true,
2582
+ "type": {
2583
+ "fqn": "@mrgrain/cdk-esbuild.JavaScriptAsset"
2584
+ }
2585
+ },
2538
2586
  {
2539
2587
  "docs": {
2540
2588
  "stability": "stable"
@@ -2560,15 +2608,17 @@
2560
2608
  },
2561
2609
  {
2562
2610
  "docs": {
2563
- "stability": "stable"
2611
+ "deprecated": "this value is ignored since inline is now determined based on the the inlineCode field of CodeConfig returned from bind().",
2612
+ "stability": "deprecated",
2613
+ "summary": "Determines whether this Code is inline code or not."
2564
2614
  },
2565
2615
  "locationInModule": {
2566
2616
  "filename": "src/code.ts",
2567
- "line": 105
2617
+ "line": 48
2568
2618
  },
2569
- "name": "assetClass",
2619
+ "name": "isInline",
2570
2620
  "type": {
2571
- "fqn": "@mrgrain/cdk-esbuild.JavaScriptAsset"
2621
+ "primitive": "boolean"
2572
2622
  }
2573
2623
  },
2574
2624
  {
@@ -2577,29 +2627,54 @@
2577
2627
  },
2578
2628
  "locationInModule": {
2579
2629
  "filename": "src/code.ts",
2580
- "line": 43
2630
+ "line": 39
2581
2631
  },
2582
- "name": "isInline",
2632
+ "name": "props",
2633
+ "protected": true,
2583
2634
  "type": {
2584
- "primitive": "boolean"
2635
+ "fqn": "@mrgrain/cdk-esbuild.AssetProps"
2585
2636
  }
2586
- },
2637
+ }
2638
+ ],
2639
+ "symbolId": "src/code:JavaScriptCode"
2640
+ },
2641
+ "@mrgrain/cdk-esbuild.JavaScriptCodeProps": {
2642
+ "assembly": "@mrgrain/cdk-esbuild",
2643
+ "datatype": true,
2644
+ "docs": {
2645
+ "stability": "stable"
2646
+ },
2647
+ "fqn": "@mrgrain/cdk-esbuild.JavaScriptCodeProps",
2648
+ "interfaces": [
2649
+ "@mrgrain/cdk-esbuild.BundlerProps"
2650
+ ],
2651
+ "kind": "interface",
2652
+ "locationInModule": {
2653
+ "filename": "src/code.ts",
2654
+ "line": 26
2655
+ },
2656
+ "name": "JavaScriptCodeProps",
2657
+ "properties": [
2587
2658
  {
2659
+ "abstract": true,
2588
2660
  "docs": {
2589
- "stability": "stable"
2661
+ "remarks": "As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed.\n\nDefaults to a hash of all files in the resulting bundle.",
2662
+ "stability": "stable",
2663
+ "summary": "A hash of this asset, which is available at construction time."
2590
2664
  },
2665
+ "immutable": true,
2591
2666
  "locationInModule": {
2592
- "filename": "src/code.ts",
2593
- "line": 39
2667
+ "filename": "src/asset.ts",
2668
+ "line": 19
2594
2669
  },
2595
- "name": "props",
2596
- "protected": true,
2670
+ "name": "assetHash",
2671
+ "optional": true,
2597
2672
  "type": {
2598
- "fqn": "@mrgrain/cdk-esbuild.EsbuildAssetProps"
2673
+ "primitive": "string"
2599
2674
  }
2600
2675
  }
2601
2676
  ],
2602
- "symbolId": "src/code:JavaScriptCode"
2677
+ "symbolId": "src/code:JavaScriptCodeProps"
2603
2678
  },
2604
2679
  "@mrgrain/cdk-esbuild.JavaScriptSource": {
2605
2680
  "assembly": "@mrgrain/cdk-esbuild",
@@ -2613,7 +2688,7 @@
2613
2688
  },
2614
2689
  "locationInModule": {
2615
2690
  "filename": "src/source.ts",
2616
- "line": 87
2691
+ "line": 88
2617
2692
  },
2618
2693
  "parameters": [
2619
2694
  {
@@ -2648,7 +2723,7 @@
2648
2723
  "name": "props",
2649
2724
  "optional": true,
2650
2725
  "type": {
2651
- "fqn": "@mrgrain/cdk-esbuild.EsbuildProps"
2726
+ "fqn": "@mrgrain/cdk-esbuild.JavaScriptSourceProps"
2652
2727
  }
2653
2728
  }
2654
2729
  ]
@@ -2659,7 +2734,7 @@
2659
2734
  "kind": "class",
2660
2735
  "locationInModule": {
2661
2736
  "filename": "src/source.ts",
2662
- "line": 81
2737
+ "line": 82
2663
2738
  },
2664
2739
  "methods": [
2665
2740
  {
@@ -2669,7 +2744,7 @@
2669
2744
  },
2670
2745
  "locationInModule": {
2671
2746
  "filename": "src/source.ts",
2672
- "line": 47
2747
+ "line": 48
2673
2748
  },
2674
2749
  "name": "bind",
2675
2750
  "overrides": "@aws-cdk/aws-s3-deployment.ISource",
@@ -2703,7 +2778,7 @@
2703
2778
  },
2704
2779
  "locationInModule": {
2705
2780
  "filename": "src/source.ts",
2706
- "line": 25
2781
+ "line": 26
2707
2782
  },
2708
2783
  "name": "asset",
2709
2784
  "protected": true,
@@ -2726,7 +2801,7 @@
2726
2801
  },
2727
2802
  "locationInModule": {
2728
2803
  "filename": "src/source.ts",
2729
- "line": 85
2804
+ "line": 86
2730
2805
  },
2731
2806
  "name": "assetClass",
2732
2807
  "type": {
@@ -2739,168 +2814,54 @@
2739
2814
  },
2740
2815
  "locationInModule": {
2741
2816
  "filename": "src/source.ts",
2742
- "line": 23
2817
+ "line": 24
2743
2818
  },
2744
2819
  "name": "props",
2745
2820
  "protected": true,
2746
2821
  "type": {
2747
- "fqn": "@mrgrain/cdk-esbuild.EsbuildAssetProps"
2822
+ "fqn": "@mrgrain/cdk-esbuild.AssetProps"
2748
2823
  }
2749
2824
  }
2750
2825
  ],
2751
2826
  "symbolId": "src/source:JavaScriptSource"
2752
2827
  },
2753
- "@mrgrain/cdk-esbuild.LocalBundler": {
2828
+ "@mrgrain/cdk-esbuild.JavaScriptSourceProps": {
2754
2829
  "assembly": "@mrgrain/cdk-esbuild",
2830
+ "datatype": true,
2755
2831
  "docs": {
2756
2832
  "stability": "stable"
2757
2833
  },
2758
- "fqn": "@mrgrain/cdk-esbuild.LocalBundler",
2759
- "initializer": {
2760
- "docs": {
2761
- "stability": "stable"
2762
- },
2763
- "locationInModule": {
2764
- "filename": "src/bundlers.ts",
2765
- "line": 46
2766
- },
2767
- "parameters": [
2768
- {
2769
- "name": "buildOptions",
2770
- "type": {
2771
- "fqn": "@mrgrain/cdk-esbuild.EsbuildOptions"
2772
- }
2773
- },
2774
- {
2775
- "name": "props",
2776
- "optional": true,
2777
- "type": {
2778
- "fqn": "@mrgrain/cdk-esbuild.EsbuildBundlingProps"
2779
- }
2780
- }
2781
- ]
2782
- },
2834
+ "fqn": "@mrgrain/cdk-esbuild.JavaScriptSourceProps",
2783
2835
  "interfaces": [
2784
- "@aws-cdk/core.ILocalBundling"
2785
- ],
2786
- "kind": "class",
2787
- "locationInModule": {
2788
- "filename": "src/bundlers.ts",
2789
- "line": 45
2790
- },
2791
- "methods": [
2792
- {
2793
- "docs": {
2794
- "remarks": "If the local bundler exists, and bundling\nwas performed locally, return `true`. Otherwise, return `false`.",
2795
- "stability": "stable",
2796
- "summary": "This method is called before attempting docker bundling to allow the bundler to be executed locally."
2797
- },
2798
- "locationInModule": {
2799
- "filename": "src/bundlers.ts",
2800
- "line": 51
2801
- },
2802
- "name": "tryBundle",
2803
- "overrides": "@aws-cdk/core.ILocalBundling",
2804
- "parameters": [
2805
- {
2806
- "name": "outputDir",
2807
- "type": {
2808
- "primitive": "string"
2809
- }
2810
- },
2811
- {
2812
- "name": "_options",
2813
- "type": {
2814
- "fqn": "@aws-cdk/core.BundlingOptions"
2815
- }
2816
- }
2817
- ],
2818
- "returns": {
2819
- "type": {
2820
- "primitive": "boolean"
2821
- }
2822
- }
2823
- }
2824
- ],
2825
- "name": "LocalBundler",
2826
- "properties": [
2827
- {
2828
- "docs": {
2829
- "stability": "stable"
2830
- },
2831
- "immutable": true,
2832
- "locationInModule": {
2833
- "filename": "src/bundlers.ts",
2834
- "line": 47
2835
- },
2836
- "name": "buildOptions",
2837
- "type": {
2838
- "fqn": "@mrgrain/cdk-esbuild.EsbuildOptions"
2839
- }
2840
- },
2841
- {
2842
- "docs": {
2843
- "stability": "stable"
2844
- },
2845
- "immutable": true,
2846
- "locationInModule": {
2847
- "filename": "src/bundlers.ts",
2848
- "line": 48
2849
- },
2850
- "name": "props",
2851
- "type": {
2852
- "fqn": "@mrgrain/cdk-esbuild.EsbuildBundlingProps"
2853
- }
2854
- }
2836
+ "@mrgrain/cdk-esbuild.BundlerProps"
2855
2837
  ],
2856
- "symbolId": "src/bundlers:LocalBundler"
2857
- },
2858
- "@mrgrain/cdk-esbuild.Location": {
2859
- "assembly": "@mrgrain/cdk-esbuild",
2860
- "datatype": true,
2861
- "docs": {
2862
- "stability": "stable"
2863
- },
2864
- "fqn": "@mrgrain/cdk-esbuild.Location",
2865
2838
  "kind": "interface",
2866
2839
  "locationInModule": {
2867
- "filename": "src/code.ts",
2868
- "line": 17
2840
+ "filename": "src/source.ts",
2841
+ "line": 11
2869
2842
  },
2870
- "name": "Location",
2843
+ "name": "JavaScriptSourceProps",
2871
2844
  "properties": [
2872
2845
  {
2873
2846
  "abstract": true,
2874
2847
  "docs": {
2875
- "stability": "stable"
2876
- },
2877
- "immutable": true,
2878
- "locationInModule": {
2879
- "filename": "src/code.ts",
2880
- "line": 18
2881
- },
2882
- "name": "bucketName",
2883
- "type": {
2884
- "primitive": "string"
2885
- }
2886
- },
2887
- {
2888
- "abstract": true,
2889
- "docs": {
2890
- "stability": "stable"
2848
+ "remarks": "As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed.\n\nDefaults to a hash of all files in the resulting bundle.",
2849
+ "stability": "stable",
2850
+ "summary": "A hash of this asset, which is available at construction time."
2891
2851
  },
2892
2852
  "immutable": true,
2893
2853
  "locationInModule": {
2894
- "filename": "src/code.ts",
2854
+ "filename": "src/asset.ts",
2895
2855
  "line": 19
2896
2856
  },
2897
- "name": "objectKey",
2857
+ "name": "assetHash",
2858
+ "optional": true,
2898
2859
  "type": {
2899
2860
  "primitive": "string"
2900
2861
  }
2901
2862
  }
2902
2863
  ],
2903
- "symbolId": "src/code:Location"
2864
+ "symbolId": "src/source:JavaScriptSourceProps"
2904
2865
  },
2905
2866
  "@mrgrain/cdk-esbuild.TransformOptions": {
2906
2867
  "assembly": "@mrgrain/cdk-esbuild",
@@ -2912,7 +2873,7 @@
2912
2873
  "kind": "interface",
2913
2874
  "locationInModule": {
2914
2875
  "filename": "src/esbuild-types.ts",
2915
- "line": 156
2876
+ "line": 158
2916
2877
  },
2917
2878
  "name": "TransformOptions",
2918
2879
  "properties": [
@@ -2924,7 +2885,7 @@
2924
2885
  "immutable": true,
2925
2886
  "locationInModule": {
2926
2887
  "filename": "src/esbuild-types.ts",
2927
- "line": 160
2888
+ "line": 163
2928
2889
  },
2929
2890
  "name": "banner",
2930
2891
  "optional": true,
@@ -2940,7 +2901,7 @@
2940
2901
  "immutable": true,
2941
2902
  "locationInModule": {
2942
2903
  "filename": "src/esbuild-types.ts",
2943
- "line": 21
2904
+ "line": 23
2944
2905
  },
2945
2906
  "name": "charset",
2946
2907
  "optional": true,
@@ -2956,7 +2917,7 @@
2956
2917
  "immutable": true,
2957
2918
  "locationInModule": {
2958
2919
  "filename": "src/esbuild-types.ts",
2959
- "line": 33
2920
+ "line": 35
2960
2921
  },
2961
2922
  "name": "color",
2962
2923
  "optional": true,
@@ -2972,7 +2933,7 @@
2972
2933
  "immutable": true,
2973
2934
  "locationInModule": {
2974
2935
  "filename": "src/esbuild-types.ts",
2975
- "line": 29
2936
+ "line": 31
2976
2937
  },
2977
2938
  "name": "define",
2978
2939
  "optional": true,
@@ -2993,7 +2954,7 @@
2993
2954
  "immutable": true,
2994
2955
  "locationInModule": {
2995
2956
  "filename": "src/esbuild-types.ts",
2996
- "line": 161
2957
+ "line": 164
2997
2958
  },
2998
2959
  "name": "footer",
2999
2960
  "optional": true,
@@ -3009,7 +2970,7 @@
3009
2970
  "immutable": true,
3010
2971
  "locationInModule": {
3011
2972
  "filename": "src/esbuild-types.ts",
3012
- "line": 13
2973
+ "line": 15
3013
2974
  },
3014
2975
  "name": "format",
3015
2976
  "optional": true,
@@ -3025,7 +2986,7 @@
3025
2986
  "immutable": true,
3026
2987
  "locationInModule": {
3027
2988
  "filename": "src/esbuild-types.ts",
3028
- "line": 14
2989
+ "line": 16
3029
2990
  },
3030
2991
  "name": "globalName",
3031
2992
  "optional": true,
@@ -3041,7 +3002,7 @@
3041
3002
  "immutable": true,
3042
3003
  "locationInModule": {
3043
3004
  "filename": "src/esbuild-types.ts",
3044
- "line": 23
3005
+ "line": 25
3045
3006
  },
3046
3007
  "name": "ignoreAnnotations",
3047
3008
  "optional": true,
@@ -3057,7 +3018,7 @@
3057
3018
  "immutable": true,
3058
3019
  "locationInModule": {
3059
3020
  "filename": "src/esbuild-types.ts",
3060
- "line": 25
3021
+ "line": 27
3061
3022
  },
3062
3023
  "name": "jsx",
3063
3024
  "optional": true,
@@ -3073,7 +3034,7 @@
3073
3034
  "immutable": true,
3074
3035
  "locationInModule": {
3075
3036
  "filename": "src/esbuild-types.ts",
3076
- "line": 26
3037
+ "line": 28
3077
3038
  },
3078
3039
  "name": "jsxFactory",
3079
3040
  "optional": true,
@@ -3089,7 +3050,7 @@
3089
3050
  "immutable": true,
3090
3051
  "locationInModule": {
3091
3052
  "filename": "src/esbuild-types.ts",
3092
- "line": 27
3053
+ "line": 29
3093
3054
  },
3094
3055
  "name": "jsxFragment",
3095
3056
  "optional": true,
@@ -3105,7 +3066,7 @@
3105
3066
  "immutable": true,
3106
3067
  "locationInModule": {
3107
3068
  "filename": "src/esbuild-types.ts",
3108
- "line": 31
3069
+ "line": 33
3109
3070
  },
3110
3071
  "name": "keepNames",
3111
3072
  "optional": true,
@@ -3121,7 +3082,7 @@
3121
3082
  "immutable": true,
3122
3083
  "locationInModule": {
3123
3084
  "filename": "src/esbuild-types.ts",
3124
- "line": 9
3085
+ "line": 11
3125
3086
  },
3126
3087
  "name": "legalComments",
3127
3088
  "optional": true,
@@ -3137,7 +3098,7 @@
3137
3098
  "immutable": true,
3138
3099
  "locationInModule": {
3139
3100
  "filename": "src/esbuild-types.ts",
3140
- "line": 159
3101
+ "line": 162
3141
3102
  },
3142
3103
  "name": "loader",
3143
3104
  "optional": true,
@@ -3153,7 +3114,7 @@
3153
3114
  "immutable": true,
3154
3115
  "locationInModule": {
3155
3116
  "filename": "src/esbuild-types.ts",
3156
- "line": 34
3117
+ "line": 36
3157
3118
  },
3158
3119
  "name": "logLevel",
3159
3120
  "optional": true,
@@ -3169,7 +3130,7 @@
3169
3130
  "immutable": true,
3170
3131
  "locationInModule": {
3171
3132
  "filename": "src/esbuild-types.ts",
3172
- "line": 35
3133
+ "line": 37
3173
3134
  },
3174
3135
  "name": "logLimit",
3175
3136
  "optional": true,
@@ -3185,7 +3146,7 @@
3185
3146
  "immutable": true,
3186
3147
  "locationInModule": {
3187
3148
  "filename": "src/esbuild-types.ts",
3188
- "line": 17
3149
+ "line": 19
3189
3150
  },
3190
3151
  "name": "minify",
3191
3152
  "optional": true,
@@ -3201,7 +3162,7 @@
3201
3162
  "immutable": true,
3202
3163
  "locationInModule": {
3203
3164
  "filename": "src/esbuild-types.ts",
3204
- "line": 19
3165
+ "line": 21
3205
3166
  },
3206
3167
  "name": "minifyIdentifiers",
3207
3168
  "optional": true,
@@ -3217,7 +3178,7 @@
3217
3178
  "immutable": true,
3218
3179
  "locationInModule": {
3219
3180
  "filename": "src/esbuild-types.ts",
3220
- "line": 20
3181
+ "line": 22
3221
3182
  },
3222
3183
  "name": "minifySyntax",
3223
3184
  "optional": true,
@@ -3233,7 +3194,7 @@
3233
3194
  "immutable": true,
3234
3195
  "locationInModule": {
3235
3196
  "filename": "src/esbuild-types.ts",
3236
- "line": 18
3197
+ "line": 20
3237
3198
  },
3238
3199
  "name": "minifyWhitespace",
3239
3200
  "optional": true,
@@ -3249,7 +3210,7 @@
3249
3210
  "immutable": true,
3250
3211
  "locationInModule": {
3251
3212
  "filename": "src/esbuild-types.ts",
3252
- "line": 30
3213
+ "line": 32
3253
3214
  },
3254
3215
  "name": "pure",
3255
3216
  "optional": true,
@@ -3270,7 +3231,7 @@
3270
3231
  "immutable": true,
3271
3232
  "locationInModule": {
3272
3233
  "filename": "src/esbuild-types.ts",
3273
- "line": 158
3234
+ "line": 161
3274
3235
  },
3275
3236
  "name": "sourcefile",
3276
3237
  "optional": true,
@@ -3286,7 +3247,7 @@
3286
3247
  "immutable": true,
3287
3248
  "locationInModule": {
3288
3249
  "filename": "src/esbuild-types.ts",
3289
- "line": 8
3250
+ "line": 10
3290
3251
  },
3291
3252
  "name": "sourcemap",
3292
3253
  "optional": true,
@@ -3311,7 +3272,7 @@
3311
3272
  "immutable": true,
3312
3273
  "locationInModule": {
3313
3274
  "filename": "src/esbuild-types.ts",
3314
- "line": 10
3275
+ "line": 12
3315
3276
  },
3316
3277
  "name": "sourceRoot",
3317
3278
  "optional": true,
@@ -3327,7 +3288,7 @@
3327
3288
  "immutable": true,
3328
3289
  "locationInModule": {
3329
3290
  "filename": "src/esbuild-types.ts",
3330
- "line": 11
3291
+ "line": 13
3331
3292
  },
3332
3293
  "name": "sourcesContent",
3333
3294
  "optional": true,
@@ -3343,7 +3304,7 @@
3343
3304
  "immutable": true,
3344
3305
  "locationInModule": {
3345
3306
  "filename": "src/esbuild-types.ts",
3346
- "line": 15
3307
+ "line": 17
3347
3308
  },
3348
3309
  "name": "target",
3349
3310
  "optional": true,
@@ -3373,7 +3334,7 @@
3373
3334
  "immutable": true,
3374
3335
  "locationInModule": {
3375
3336
  "filename": "src/esbuild-types.ts",
3376
- "line": 22
3337
+ "line": 24
3377
3338
  },
3378
3339
  "name": "treeShaking",
3379
3340
  "optional": true,
@@ -3389,7 +3350,7 @@
3389
3350
  "immutable": true,
3390
3351
  "locationInModule": {
3391
3352
  "filename": "src/esbuild-types.ts",
3392
- "line": 157
3353
+ "line": 159
3393
3354
  },
3394
3355
  "name": "tsconfigRaw",
3395
3356
  "optional": true,
@@ -3403,16 +3364,18 @@
3403
3364
  "@mrgrain/cdk-esbuild.TypeScriptAsset": {
3404
3365
  "assembly": "@mrgrain/cdk-esbuild",
3405
3366
  "docs": {
3406
- "stability": "experimental"
3367
+ "remarks": "The asset can be used by other constructs.",
3368
+ "stability": "stable",
3369
+ "summary": "Bundles the entry points and creates a CDK asset which is uploaded to the bootstrapped CDK S3 bucket during deployment."
3407
3370
  },
3408
3371
  "fqn": "@mrgrain/cdk-esbuild.TypeScriptAsset",
3409
3372
  "initializer": {
3410
3373
  "docs": {
3411
- "stability": "experimental"
3374
+ "stability": "stable"
3412
3375
  },
3413
3376
  "locationInModule": {
3414
3377
  "filename": "src/asset.ts",
3415
- "line": 40
3378
+ "line": 41
3416
3379
  },
3417
3380
  "parameters": [
3418
3381
  {
@@ -3428,9 +3391,9 @@
3428
3391
  }
3429
3392
  },
3430
3393
  {
3431
- "name": "__2",
3394
+ "name": "props",
3432
3395
  "type": {
3433
- "fqn": "@mrgrain/cdk-esbuild.EsbuildAssetProps"
3396
+ "fqn": "@mrgrain/cdk-esbuild.AssetProps"
3434
3397
  }
3435
3398
  }
3436
3399
  ]
@@ -3438,7 +3401,7 @@
3438
3401
  "kind": "class",
3439
3402
  "locationInModule": {
3440
3403
  "filename": "src/asset.ts",
3441
- "line": 96
3404
+ "line": 103
3442
3405
  },
3443
3406
  "name": "TypeScriptAsset",
3444
3407
  "symbolId": "src/asset:TypeScriptAsset"
@@ -3446,7 +3409,8 @@
3446
3409
  "@mrgrain/cdk-esbuild.TypeScriptCode": {
3447
3410
  "assembly": "@mrgrain/cdk-esbuild",
3448
3411
  "docs": {
3449
- "stability": "stable"
3412
+ "stability": "stable",
3413
+ "summary": "Represents the deployed TypeScript Code."
3450
3414
  },
3451
3415
  "fqn": "@mrgrain/cdk-esbuild.TypeScriptCode",
3452
3416
  "initializer": {
@@ -3455,10 +3419,15 @@
3455
3419
  },
3456
3420
  "locationInModule": {
3457
3421
  "filename": "src/code.ts",
3458
- "line": 117
3422
+ "line": 155
3459
3423
  },
3460
3424
  "parameters": [
3461
3425
  {
3426
+ "docs": {
3427
+ "remarks": "E.g. `src/index.ts`.",
3428
+ "stability": "stable",
3429
+ "summary": "A relative path or list or map of relative paths to the entry points of your code from the root of the project."
3430
+ },
3462
3431
  "name": "entryPoints",
3463
3432
  "type": {
3464
3433
  "union": {
@@ -3487,10 +3456,15 @@
3487
3456
  }
3488
3457
  },
3489
3458
  {
3459
+ "docs": {
3460
+ "remarks": "Default values for `props.buildOptions`:\n- `bundle=true`\n- `platform=node`\n- `target=nodeX` with X being the major node version running locally",
3461
+ "stability": "stable",
3462
+ "summary": "Props to change the behavior of the bundler."
3463
+ },
3490
3464
  "name": "props",
3491
3465
  "optional": true,
3492
3466
  "type": {
3493
- "fqn": "@mrgrain/cdk-esbuild.EsbuildProps"
3467
+ "fqn": "@mrgrain/cdk-esbuild.TypeScriptCodeProps"
3494
3468
  }
3495
3469
  }
3496
3470
  ]
@@ -3498,7 +3472,7 @@
3498
3472
  "kind": "class",
3499
3473
  "locationInModule": {
3500
3474
  "filename": "src/code.ts",
3501
- "line": 114
3475
+ "line": 152
3502
3476
  },
3503
3477
  "methods": [
3504
3478
  {
@@ -3507,7 +3481,7 @@
3507
3481
  },
3508
3482
  "locationInModule": {
3509
3483
  "filename": "src/code.ts",
3510
- "line": 68
3484
+ "line": 73
3511
3485
  },
3512
3486
  "name": "bind",
3513
3487
  "parameters": [
@@ -3526,11 +3500,13 @@
3526
3500
  },
3527
3501
  {
3528
3502
  "docs": {
3529
- "stability": "stable"
3503
+ "remarks": "Specifically it's required to allow assets to add\nmetadata for tooling like SAM CLI to be able to find their origins.",
3504
+ "stability": "stable",
3505
+ "summary": "Called after the CFN function resource has been created to allow the code class to bind to it."
3530
3506
  },
3531
3507
  "locationInModule": {
3532
3508
  "filename": "src/code.ts",
3533
- "line": 94
3509
+ "line": 105
3534
3510
  },
3535
3511
  "name": "bindToResource",
3536
3512
  "parameters": [
@@ -3552,6 +3528,21 @@
3552
3528
  ],
3553
3529
  "name": "TypeScriptCode",
3554
3530
  "properties": [
3531
+ {
3532
+ "docs": {
3533
+ "stability": "stable"
3534
+ },
3535
+ "immutable": true,
3536
+ "locationInModule": {
3537
+ "filename": "src/code.ts",
3538
+ "line": 153
3539
+ },
3540
+ "name": "assetClass",
3541
+ "protected": true,
3542
+ "type": {
3543
+ "fqn": "@mrgrain/cdk-esbuild.TypeScriptAsset"
3544
+ }
3545
+ },
3555
3546
  {
3556
3547
  "docs": {
3557
3548
  "stability": "stable"
@@ -3577,15 +3568,17 @@
3577
3568
  },
3578
3569
  {
3579
3570
  "docs": {
3580
- "stability": "stable"
3571
+ "deprecated": "this value is ignored since inline is now determined based on the the inlineCode field of CodeConfig returned from bind().",
3572
+ "stability": "deprecated",
3573
+ "summary": "Determines whether this Code is inline code or not."
3581
3574
  },
3582
3575
  "locationInModule": {
3583
3576
  "filename": "src/code.ts",
3584
- "line": 115
3577
+ "line": 48
3585
3578
  },
3586
- "name": "assetClass",
3579
+ "name": "isInline",
3587
3580
  "type": {
3588
- "fqn": "@mrgrain/cdk-esbuild.TypeScriptAsset"
3581
+ "primitive": "boolean"
3589
3582
  }
3590
3583
  },
3591
3584
  {
@@ -3594,29 +3587,54 @@
3594
3587
  },
3595
3588
  "locationInModule": {
3596
3589
  "filename": "src/code.ts",
3597
- "line": 43
3590
+ "line": 39
3598
3591
  },
3599
- "name": "isInline",
3592
+ "name": "props",
3593
+ "protected": true,
3600
3594
  "type": {
3601
- "primitive": "boolean"
3595
+ "fqn": "@mrgrain/cdk-esbuild.AssetProps"
3602
3596
  }
3603
- },
3597
+ }
3598
+ ],
3599
+ "symbolId": "src/code:TypeScriptCode"
3600
+ },
3601
+ "@mrgrain/cdk-esbuild.TypeScriptCodeProps": {
3602
+ "assembly": "@mrgrain/cdk-esbuild",
3603
+ "datatype": true,
3604
+ "docs": {
3605
+ "stability": "stable"
3606
+ },
3607
+ "fqn": "@mrgrain/cdk-esbuild.TypeScriptCodeProps",
3608
+ "interfaces": [
3609
+ "@mrgrain/cdk-esbuild.BundlerProps"
3610
+ ],
3611
+ "kind": "interface",
3612
+ "locationInModule": {
3613
+ "filename": "src/code.ts",
3614
+ "line": 27
3615
+ },
3616
+ "name": "TypeScriptCodeProps",
3617
+ "properties": [
3604
3618
  {
3619
+ "abstract": true,
3605
3620
  "docs": {
3606
- "stability": "stable"
3621
+ "remarks": "As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed.\n\nDefaults to a hash of all files in the resulting bundle.",
3622
+ "stability": "stable",
3623
+ "summary": "A hash of this asset, which is available at construction time."
3607
3624
  },
3625
+ "immutable": true,
3608
3626
  "locationInModule": {
3609
- "filename": "src/code.ts",
3610
- "line": 39
3627
+ "filename": "src/asset.ts",
3628
+ "line": 19
3611
3629
  },
3612
- "name": "props",
3613
- "protected": true,
3630
+ "name": "assetHash",
3631
+ "optional": true,
3614
3632
  "type": {
3615
- "fqn": "@mrgrain/cdk-esbuild.EsbuildAssetProps"
3633
+ "primitive": "string"
3616
3634
  }
3617
3635
  }
3618
3636
  ],
3619
- "symbolId": "src/code:TypeScriptCode"
3637
+ "symbolId": "src/code:TypeScriptCodeProps"
3620
3638
  },
3621
3639
  "@mrgrain/cdk-esbuild.TypeScriptSource": {
3622
3640
  "assembly": "@mrgrain/cdk-esbuild",
@@ -3630,7 +3648,7 @@
3630
3648
  },
3631
3649
  "locationInModule": {
3632
3650
  "filename": "src/source.ts",
3633
- "line": 101
3651
+ "line": 102
3634
3652
  },
3635
3653
  "parameters": [
3636
3654
  {
@@ -3665,7 +3683,7 @@
3665
3683
  "name": "props",
3666
3684
  "optional": true,
3667
3685
  "type": {
3668
- "fqn": "@mrgrain/cdk-esbuild.EsbuildProps"
3686
+ "fqn": "@mrgrain/cdk-esbuild.TypeScriptSourceProps"
3669
3687
  }
3670
3688
  }
3671
3689
  ]
@@ -3676,7 +3694,7 @@
3676
3694
  "kind": "class",
3677
3695
  "locationInModule": {
3678
3696
  "filename": "src/source.ts",
3679
- "line": 95
3697
+ "line": 96
3680
3698
  },
3681
3699
  "methods": [
3682
3700
  {
@@ -3686,7 +3704,7 @@
3686
3704
  },
3687
3705
  "locationInModule": {
3688
3706
  "filename": "src/source.ts",
3689
- "line": 47
3707
+ "line": 48
3690
3708
  },
3691
3709
  "name": "bind",
3692
3710
  "overrides": "@aws-cdk/aws-s3-deployment.ISource",
@@ -3720,7 +3738,7 @@
3720
3738
  },
3721
3739
  "locationInModule": {
3722
3740
  "filename": "src/source.ts",
3723
- "line": 25
3741
+ "line": 26
3724
3742
  },
3725
3743
  "name": "asset",
3726
3744
  "protected": true,
@@ -3743,7 +3761,7 @@
3743
3761
  },
3744
3762
  "locationInModule": {
3745
3763
  "filename": "src/source.ts",
3746
- "line": 99
3764
+ "line": 100
3747
3765
  },
3748
3766
  "name": "assetClass",
3749
3767
  "type": {
@@ -3756,18 +3774,56 @@
3756
3774
  },
3757
3775
  "locationInModule": {
3758
3776
  "filename": "src/source.ts",
3759
- "line": 23
3777
+ "line": 24
3760
3778
  },
3761
3779
  "name": "props",
3762
3780
  "protected": true,
3763
3781
  "type": {
3764
- "fqn": "@mrgrain/cdk-esbuild.EsbuildAssetProps"
3782
+ "fqn": "@mrgrain/cdk-esbuild.AssetProps"
3765
3783
  }
3766
3784
  }
3767
3785
  ],
3768
3786
  "symbolId": "src/source:TypeScriptSource"
3787
+ },
3788
+ "@mrgrain/cdk-esbuild.TypeScriptSourceProps": {
3789
+ "assembly": "@mrgrain/cdk-esbuild",
3790
+ "datatype": true,
3791
+ "docs": {
3792
+ "stability": "stable"
3793
+ },
3794
+ "fqn": "@mrgrain/cdk-esbuild.TypeScriptSourceProps",
3795
+ "interfaces": [
3796
+ "@mrgrain/cdk-esbuild.BundlerProps"
3797
+ ],
3798
+ "kind": "interface",
3799
+ "locationInModule": {
3800
+ "filename": "src/source.ts",
3801
+ "line": 12
3802
+ },
3803
+ "name": "TypeScriptSourceProps",
3804
+ "properties": [
3805
+ {
3806
+ "abstract": true,
3807
+ "docs": {
3808
+ "remarks": "As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed.\n\nDefaults to a hash of all files in the resulting bundle.",
3809
+ "stability": "stable",
3810
+ "summary": "A hash of this asset, which is available at construction time."
3811
+ },
3812
+ "immutable": true,
3813
+ "locationInModule": {
3814
+ "filename": "src/asset.ts",
3815
+ "line": 19
3816
+ },
3817
+ "name": "assetHash",
3818
+ "optional": true,
3819
+ "type": {
3820
+ "primitive": "string"
3821
+ }
3822
+ }
3823
+ ],
3824
+ "symbolId": "src/source:TypeScriptSourceProps"
3769
3825
  }
3770
3826
  },
3771
- "version": "2.0.0-alpha.0",
3772
- "fingerprint": "BwAqft59KLNBkqOMqrUI1zzg62FMlqUWiymEl6Yb5WU="
3827
+ "version": "2.0.0-alpha.5",
3828
+ "fingerprint": "AdL6hJY8jZk+fh5n+ST+KSygY3qF3N0pEjQ75LE0OcQ="
3773
3829
  }