main f6fc50702f6a cached
842 files
2.6 MB
732.6k tokens
3319 symbols
1 requests
Download .txt
Showing preview only (2,918K chars total). Download the full file or copy to clipboard to get everything.
Repository: dealmore/terraform-aws-next-js
Branch: main
Commit: f6fc50702f6a
Files: 842
Total size: 2.6 MB

Directory structure:
gitextract_ad_x_yca/

├── .editorconfig
├── .github/
│   └── workflows/
│       ├── CI.yml
│       ├── lint.yml
│       ├── release.yml
│       └── tf-docs.yml
├── .gitignore
├── .prettierrc.js
├── .terraform-docs.yml
├── .vscode/
│   ├── extensions.json
│   ├── launch.json
│   └── settings.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── docker-compose.yml
├── docs/
│   └── development.md
├── examples/
│   ├── .gitignore
│   ├── atomic-deployments/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── package.json
│   │   └── pages/
│   │       └── index.js
│   ├── complete/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── components/
│   │   │   └── header.js
│   │   ├── main.tf
│   │   ├── next.config.js
│   │   ├── package.json
│   │   └── pages/
│   │       ├── about.js
│   │       ├── api/
│   │       │   └── robots.js
│   │       ├── index.js
│   │       └── test/
│   │           └── [...slug].js
│   ├── next-image/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── app.css
│   │   ├── components/
│   │   │   ├── view-source.js
│   │   │   └── view-source.module.css
│   │   ├── main.tf
│   │   ├── next.config.js
│   │   ├── package.json
│   │   ├── pages/
│   │   │   ├── _app.js
│   │   │   ├── background.js
│   │   │   ├── index.js
│   │   │   ├── layout-fill.js
│   │   │   ├── layout-fixed.js
│   │   │   ├── layout-intrinsic.js
│   │   │   └── layout-responsive.js
│   │   └── styles.module.css
│   ├── static/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── package.json
│   │   └── pages/
│   │       ├── about.js
│   │       ├── blog/
│   │       │   └── index.js
│   │       └── index.js
│   ├── with-custom-domain/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── package.json
│   │   └── pages/
│   │       └── index.js
│   └── with-existing-cloudfront/
│       ├── .gitignore
│       ├── LICENSE
│       ├── README.md
│       ├── main.tf
│       ├── package.json
│       └── pages/
│           └── index.js
├── jest.config.js
├── main.tf
├── modules/
│   ├── api/
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   └── variables.tf
│   ├── cloudfront-main/
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── variables.tf
│   │   └── versions.tf
│   ├── cloudfront-proxy-config/
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── variables.tf
│   │   └── versions.tf
│   ├── deploy-controller/
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── variables.tf
│   │   └── versions.tf
│   ├── lambda-worker/
│   │   ├── LICENSE
│   │   ├── iam.tf
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── variables.tf
│   │   └── versions.tf
│   ├── proxy/
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── variables.tf
│   │   └── versions.tf
│   └── statics-deploy/
│       ├── main.tf
│       ├── outputs.tf
│       ├── variables.tf
│       └── versions.tf
├── outputs.tf
├── package.json
├── packages/
│   ├── api/
│   │   ├── .gitignore
│   │   ├── jest.config.js
│   │   ├── ncc.config.json
│   │   ├── package.json
│   │   ├── schema.ts
│   │   ├── schema.yaml
│   │   ├── src/
│   │   │   ├── actions/
│   │   │   │   ├── alias/
│   │   │   │   │   ├── alias-utils.ts
│   │   │   │   │   ├── create-or-update-alias.ts
│   │   │   │   │   ├── delete-alias-by-id.ts
│   │   │   │   │   └── list-aliases.ts
│   │   │   │   └── deployment/
│   │   │   │       ├── create-deployment.ts
│   │   │   │       ├── delete-deployment-by-id.ts
│   │   │   │       ├── get-deployment-by-id.ts
│   │   │   │       └── list-deployments.ts
│   │   │   ├── api.ts
│   │   │   ├── declarations.d.ts
│   │   │   ├── handler.ts
│   │   │   ├── serializers/
│   │   │   │   └── deployment.ts
│   │   │   └── services/
│   │   │       ├── cloudformation.ts
│   │   │       ├── dynamodb.ts
│   │   │       └── s3.ts
│   │   ├── test/
│   │   │   ├── actions/
│   │   │   │   ├── alias/
│   │   │   │   │   ├── create-or-update-alias.test.ts
│   │   │   │   │   ├── delete-alias-by-id.test.ts
│   │   │   │   │   └── list-aliases.test.ts
│   │   │   │   └── deployment/
│   │   │   │       ├── create-deployment.test.ts
│   │   │   │       ├── delete-deployment-by-id.test.ts
│   │   │   │       ├── get-deployment-by-id.test.ts
│   │   │   │       └── list-deployments.test.ts
│   │   │   └── test-utils.ts
│   │   └── tsconfig.json
│   ├── deploy-controller/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── jest.config.js
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── controller.ts
│   │   │   ├── declarations.d.ts
│   │   │   ├── handler.ts
│   │   │   └── utils/
│   │   │       ├── ensure-env.ts
│   │   │       ├── parse-cloudformation-event.ts
│   │   │       └── parse-lambda-routes.ts
│   │   ├── test/
│   │   │   ├── controller.test.ts
│   │   │   ├── test-utils.ts
│   │   │   └── utils/
│   │   │       ├── parse-cloudformation-event.test.ts
│   │   │       └── parse-lambda-routes.test.ts
│   │   └── tsconfig.json
│   ├── deploy-trigger/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── jest.config.js
│   │   ├── ncc.config.json
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── cdk/
│   │   │   │   ├── aws-construct-function-urls.ts
│   │   │   │   ├── aws-construct.ts
│   │   │   │   ├── cdk-utils.ts
│   │   │   │   ├── create-cloudformation-stack.ts
│   │   │   │   └── to-cloudformation.ts
│   │   │   ├── constants.ts
│   │   │   ├── create-invalidation.ts
│   │   │   ├── declarations.d.ts
│   │   │   ├── deploy-trigger.ts
│   │   │   ├── get-or-create-manifest.ts
│   │   │   ├── handler.ts
│   │   │   ├── types.ts
│   │   │   ├── update-manifest.ts
│   │   │   └── utils/
│   │   │       ├── ensure-env.ts
│   │   │       └── random-id.ts
│   │   ├── test/
│   │   │   ├── create-invalidation.test.ts
│   │   │   ├── deploy-trigger.test.ts
│   │   │   ├── get-or-create-manifest.test.ts
│   │   │   ├── test-utils.ts
│   │   │   └── update-manifest.test.ts
│   │   └── tsconfig.json
│   ├── dynamodb-actions/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── jest.config.js
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── alias/
│   │   │   │   ├── create-alias.ts
│   │   │   │   ├── delete-alias-by-id.ts
│   │   │   │   ├── get-alias-by-hostname.ts
│   │   │   │   ├── get-alias-by-id.ts
│   │   │   │   └── list-aliases-for-deployment.ts
│   │   │   ├── deployment/
│   │   │   │   ├── create-deployment.ts
│   │   │   │   ├── delete-deployment-by-id.ts
│   │   │   │   ├── get-deployment-by-id.ts
│   │   │   │   ├── list-deployments.ts
│   │   │   │   ├── update-deployment-status-create-failed.ts
│   │   │   │   ├── update-deployment-status-create-in-progress.ts
│   │   │   │   ├── update-deployment-status-destroy-failed.ts
│   │   │   │   ├── update-deployment-status-destroy-in-progress.ts
│   │   │   │   ├── update-deployment-status-destroy-requested.ts
│   │   │   │   ├── update-deployment-status-finished.ts
│   │   │   │   ├── update-deployment-status.ts
│   │   │   │   └── update-deployment.ts
│   │   │   ├── index.ts
│   │   │   ├── types.ts
│   │   │   └── utils/
│   │   │       ├── dynamodb/
│   │   │       │   ├── index.ts
│   │   │       │   └── update-item.ts
│   │   │       └── reverse-hostname.ts
│   │   ├── test/
│   │   │   ├── alias/
│   │   │   │   ├── create-alias.test.ts
│   │   │   │   ├── delete-alias-by-id.test.ts
│   │   │   │   ├── get-alias-by-id.test.ts
│   │   │   │   └── list-aliases-for-deployment.test.ts
│   │   │   ├── deployment/
│   │   │   │   ├── create-deployment.test.ts
│   │   │   │   ├── delete-deployment.test.ts
│   │   │   │   ├── get-deployment-by-id.test.ts
│   │   │   │   ├── list-deployments.test.ts
│   │   │   │   └── update-deployment.test.ts
│   │   │   ├── test-utils.ts
│   │   │   └── utils/
│   │   │       └── reverse-hostname.test.ts
│   │   └── tsconfig.json
│   ├── node-bridge/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── jest.config.js
│   │   ├── package.json
│   │   ├── src/
│   │   │   └── bridge.ts
│   │   ├── test/
│   │   │   └── bridge.test.js
│   │   └── tsconfig.json
│   ├── proxy/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── error.html
│   │   ├── jest.config.js
│   │   ├── ncc.config.json
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── actions/
│   │   │   │   ├── fetch-cached.ts
│   │   │   │   ├── fetch-file-system.ts
│   │   │   │   └── fetch-proxy-config.ts
│   │   │   ├── error/
│   │   │   │   ├── alias-not-configured.ts
│   │   │   │   ├── missing-config.ts
│   │   │   │   └── render-error.ts
│   │   │   ├── handler.ts
│   │   │   ├── index.ts
│   │   │   ├── proxy.ts
│   │   │   ├── types.ts
│   │   │   └── util/
│   │   │       ├── append-querystring.ts
│   │   │       ├── custom-origin.ts
│   │   │       ├── etag-cache.ts
│   │   │       ├── fetch-timeout.ts
│   │   │       ├── generate-cloudfront-headers.ts
│   │   │       ├── get-env.ts
│   │   │       ├── is-url.ts
│   │   │       ├── resolve-route-parameters.ts
│   │   │       └── ttl-cache.ts
│   │   ├── test/
│   │   │   ├── actions/
│   │   │   │   └── fetch-cached.test.ts
│   │   │   ├── handler.test.ts
│   │   │   ├── proxy.test.ts
│   │   │   ├── proxy.unit.test.ts
│   │   │   ├── res/
│   │   │   │   ├── config-001.json
│   │   │   │   ├── config-002.json
│   │   │   │   ├── config-003.json
│   │   │   │   └── config-004.json
│   │   │   ├── resolve-route-parameters.test.ts
│   │   │   ├── test-utils.ts
│   │   │   └── util/
│   │   │       ├── append-querystring.test.ts
│   │   │       └── ttl-cache.test.ts
│   │   └── tsconfig.json
│   ├── proxy-config/
│   │   ├── .gitignore
│   │   ├── jest.config.js
│   │   ├── ncc.config.json
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── actions/
│   │   │   │   ├── deployment-file-exists.ts
│   │   │   │   └── get-alias.ts
│   │   │   ├── errors/
│   │   │   │   └── not-found-error.ts
│   │   │   ├── handler.ts
│   │   │   └── utils/
│   │   │       ├── get-env.ts
│   │   │       └── split-at-character.ts
│   │   ├── test/
│   │   │   └── utils/
│   │   │       └── split-at-character.test.ts
│   │   └── tsconfig.json
│   ├── runtime/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── build.sh
│   │   ├── jest.config.js
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── create-serverless-config.ts
│   │   │   ├── dev-server.ts
│   │   │   ├── index.ts
│   │   │   ├── legacy-launcher.ts
│   │   │   ├── legacy-versions.ts
│   │   │   ├── templated-launcher-shared.ts
│   │   │   ├── templated-launcher.ts
│   │   │   └── utils.ts
│   │   ├── test/
│   │   │   ├── fixtures/
│   │   │   │   ├── 00-i18n-support/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── another.js
│   │   │   │   │   │   ├── auto-export/
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── dynamic/
│   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   ├── gsp/
│   │   │   │   │   │   │   ├── blocking/
│   │   │   │   │   │   │   │   └── [[...slug]].js
│   │   │   │   │   │   │   ├── fallback/
│   │   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   │   └── no-fallback/
│   │   │   │   │   │   │       └── [slug].js
│   │   │   │   │   │   ├── gssp/
│   │   │   │   │   │   │   ├── [slug].js
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   ├── links.js
│   │   │   │   │   │   └── not-found/
│   │   │   │   │   │       ├── fallback/
│   │   │   │   │   │       │   └── [slug].js
│   │   │   │   │   │       └── index.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── hello.txt
│   │   │   │   ├── 00-i18n-support-no-locale-detection/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── another.js
│   │   │   │   │   │   ├── auto-export/
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── dynamic/
│   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   ├── gsp/
│   │   │   │   │   │   │   ├── blocking/
│   │   │   │   │   │   │   │   └── [[...slug]].js
│   │   │   │   │   │   │   ├── fallback/
│   │   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   │   └── no-fallback/
│   │   │   │   │   │   │       └── [slug].js
│   │   │   │   │   │   ├── gssp/
│   │   │   │   │   │   │   ├── [slug].js
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   ├── links.js
│   │   │   │   │   │   └── not-found/
│   │   │   │   │   │       ├── fallback/
│   │   │   │   │   │       │   └── [slug].js
│   │   │   │   │   │       └── index.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── hello.txt
│   │   │   │   ├── 00-i18n-support-no-shared-lambdas/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── another.js
│   │   │   │   │   │   ├── auto-export/
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── dynamic/
│   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   ├── gsp/
│   │   │   │   │   │   │   ├── fallback/
│   │   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   │   └── no-fallback/
│   │   │   │   │   │   │       └── [slug].js
│   │   │   │   │   │   ├── gssp/
│   │   │   │   │   │   │   ├── [slug].js
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   ├── links.js
│   │   │   │   │   │   └── not-found/
│   │   │   │   │   │       ├── fallback/
│   │   │   │   │   │       │   └── [slug].js
│   │   │   │   │   │       └── index.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── hello.txt
│   │   │   │   ├── 00-i18n-support-root-catchall/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   └── [[...slug]].js
│   │   │   │   │   └── public/
│   │   │   │   │       └── hello.txt
│   │   │   │   ├── 00-optional-fallback-revalidate/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── [[...slug]].js
│   │   │   │   │   │   └── posts/
│   │   │   │   │   │       └── [[...slug]].js
│   │   │   │   │   └── vercel.json
│   │   │   │   ├── 00-public-dir-output-dir/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── web/
│   │   │   │   │       ├── pages/
│   │   │   │   │       │   ├── dynamic/
│   │   │   │   │       │   │   └── [slug].js
│   │   │   │   │       │   ├── dynamic-ssr/
│   │   │   │   │       │   │   └── [slug].js
│   │   │   │   │       │   └── index.js
│   │   │   │   │       └── public/
│   │   │   │   │           ├── hello.txt
│   │   │   │   │           └── public/
│   │   │   │   │               └── data.txt
│   │   │   │   ├── 00-root-optional-revalidate/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── [[...slug]].js
│   │   │   │   ├── 00-shared-lambdas/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── [teamSlug]/
│   │   │   │   │       │   └── [project]/
│   │   │   │   │       │       └── [id].js
│   │   │   │   │       ├── groups/
│   │   │   │   │       │   └── [id].js
│   │   │   │   │       └── teams/
│   │   │   │   │           └── invite/
│   │   │   │   │               └── [inviteCode].js
│   │   │   │   ├── 00-trailing-slash-add-export/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── 404.js
│   │   │   │   │       └── foo.js
│   │   │   │   ├── 00-trailing-slash-remove/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── abc/
│   │   │   │   │   │   │   └── def.js
│   │   │   │   │   │   └── foo.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── test.txt
│   │   │   │   ├── 01-cache-headers/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── [team]/
│   │   │   │   │       │   ├── [project]/
│   │   │   │   │       │   │   ├── [deployment]/
│   │   │   │   │       │   │   │   ├── [another]/
│   │   │   │   │       │   │   │   │   ├── [final]/
│   │   │   │   │       │   │   │   │   │   └── index.js
│   │   │   │   │       │   │   │   │   └── index.js
│   │   │   │   │       │   │   │   └── index.js
│   │   │   │   │       │   │   └── index.js
│   │   │   │   │       │   └── index.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 03-next-8/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── hello1.js
│   │   │   │   │       └── nested/
│   │   │   │   │           └── hello2.js
│   │   │   │   ├── 04-firebase-node-10/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── nested/
│   │   │   │   │           ├── fb.js
│   │   │   │   │           └── moar/
│   │   │   │   │               └── [dynamic_fb].js
│   │   │   │   ├── 05-spr-support/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── api/
│   │   │   │   │       │   └── noop.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── lambda.js
│   │   │   │   ├── 06-lambda-with-memory/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── src/
│   │   │   │   │       └── pages/
│   │   │   │   │           └── api/
│   │   │   │   │               ├── index.js
│   │   │   │   │               ├── memory.js
│   │   │   │   │               └── sub/
│   │   │   │   │                   ├── another.ts
│   │   │   │   │                   └── index.ts
│   │   │   │   ├── 07-custom-routes/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── hello.js
│   │   │   │   │       └── params.js
│   │   │   │   ├── 08-custom-routes-catchall/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── hello.js
│   │   │   │   │       └── params.js
│   │   │   │   ├── 09-yarn-workspaces/
│   │   │   │   │   ├── .gitignore
│   │   │   │   │   ├── lerna.json
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── packages/
│   │   │   │   │       ├── common/
│   │   │   │   │       │   ├── dist/
│   │   │   │   │       │   │   ├── index.d.ts
│   │   │   │   │       │   │   └── index.js
│   │   │   │   │       │   ├── package.json
│   │   │   │   │       │   ├── src/
│   │   │   │   │       │   │   └── index.ts
│   │   │   │   │       │   └── tsconfig.json
│   │   │   │   │       └── web/
│   │   │   │   │           ├── next-env.d.ts
│   │   │   │   │           ├── next.config.js
│   │   │   │   │           ├── package.json
│   │   │   │   │           ├── pages/
│   │   │   │   │           │   ├── _app.tsx
│   │   │   │   │           │   └── index.tsx
│   │   │   │   │           └── tsconfig.json
│   │   │   │   ├── 10-export-cache-headers/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── 11-export-clean-urls/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── about.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 12-no-export-auto/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── about.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 13-export-custom-routes/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── about.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 14-next-offline/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── about.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 16-base-path/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── api/
│   │   │   │   │       │   ├── [slug]/
│   │   │   │   │       │   │   ├── another.js
│   │   │   │   │       │   │   └── index.js
│   │   │   │   │       │   └── hello.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── comments.js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── blog-ssg/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── comments.js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 17-static-404/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── 18-ssg-fallback-support/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── api/
│   │   │   │   │       │   └── noop.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── lambda.js
│   │   │   │   ├── 19-pages-404/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── 404.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 20-pages-404-lambda/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── 404.js
│   │   │   │   │       ├── _app.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 21-server-props/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── lambda.js
│   │   │   │   ├── 22-ssg-v2/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── api/
│   │   │   │   │       │   └── noop.js
│   │   │   │   │       ├── api-docs/
│   │   │   │   │       │   └── [...slug].js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       ├── lambda.js
│   │   │   │   │       └── nofallback/
│   │   │   │   │           └── [slug].js
│   │   │   │   ├── 22-ssg-v2-catchall/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── [...path].js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 23-custom-routes-verbose/
│   │   │   │   │   ├── .gitignore
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── a/
│   │   │   │   │   │   │   └── catch-all.js
│   │   │   │   │   │   ├── another/
│   │   │   │   │   │   │   └── [id].js
│   │   │   │   │   │   ├── api/
│   │   │   │   │   │   │   ├── dynamic/
│   │   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   │   └── hello.js
│   │   │   │   │   │   ├── b/
│   │   │   │   │   │   │   └── [123].js
│   │   │   │   │   │   ├── blog/
│   │   │   │   │   │   │   └── [post]/
│   │   │   │   │   │   │       └── index.js
│   │   │   │   │   │   ├── c/
│   │   │   │   │   │   │   └── [alongparamnameshouldbeallowedeventhoughweird].js
│   │   │   │   │   │   ├── catchall-dash/
│   │   │   │   │   │   │   └── [...hello-world].js
│   │   │   │   │   │   ├── dash/
│   │   │   │   │   │   │   └── [hello-world].js
│   │   │   │   │   │   ├── docs/
│   │   │   │   │   │   │   └── v2/
│   │   │   │   │   │   │       └── more/
│   │   │   │   │   │   │           └── now-for-github.js
│   │   │   │   │   │   ├── hello-again.js
│   │   │   │   │   │   ├── hello.js
│   │   │   │   │   │   ├── multi-rewrites.js
│   │   │   │   │   │   ├── nav.js
│   │   │   │   │   │   ├── params.js
│   │   │   │   │   │   ├── redirect-override.js
│   │   │   │   │   │   └── with-params.js
│   │   │   │   │   └── public/
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── data.json
│   │   │   │   │       └── static/
│   │   │   │   │           └── hello.txt
│   │   │   │   ├── 24-custom-output-dir/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── ssg/
│   │   │   │   │           └── [slug].js
│   │   │   │   ├── 25-index-routes/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── api/
│   │   │   │   │       │   └── sub/
│   │   │   │   │       │       ├── [id].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       ├── nested-index/
│   │   │   │   │       │   └── index/
│   │   │   │   │       │       └── index.js
│   │   │   │   │       └── sub/
│   │   │   │   │           ├── [id].js
│   │   │   │   │           └── index.js
│   │   │   │   ├── 25-mono-repo-404/
│   │   │   │   │   ├── .gitignore
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── packages/
│   │   │   │   │   │   └── webapp/
│   │   │   │   │   │       ├── next.config.js
│   │   │   │   │   │       ├── package.json
│   │   │   │   │   │       └── pages/
│   │   │   │   │   │           ├── 404.js
│   │   │   │   │   │           └── index.js
│   │   │   │   │   └── vercel.json
│   │   │   │   ├── 26-mono-repo-404-lambda/
│   │   │   │   │   ├── .gitignore
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── packages/
│   │   │   │   │       └── webapp/
│   │   │   │   │           ├── next.config.js
│   │   │   │   │           ├── package.json
│   │   │   │   │           └── pages/
│   │   │   │   │               ├── 404.js
│   │   │   │   │               ├── _app.js
│   │   │   │   │               └── index.js
│   │   │   │   ├── 27-non-word-param/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── [...path-segments].js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 27-preview-mode/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── api/
│   │   │   │   │       │   ├── disable.js
│   │   │   │   │       │   └── enable.js
│   │   │   │   │       └── docs/
│   │   │   │   │           ├── [...rest].js
│   │   │   │   │           └── index.js
│   │   │   │   ├── 28-nested-public/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   └── index.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── republic/
│   │   │   │   │           └── test.txt
│   │   │   │   ├── 29-ssg-all-static/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another-index/
│   │   │   │   │       │   └── index.js
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── nofallback/
│   │   │   │   │           └── [slug].js
│   │   │   │   ├── 29-ssg-all-static-custom-404/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── 404.js
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── nofallback/
│   │   │   │   │           └── [slug].js
│   │   │   │   ├── 30-monorepo-no-script/
│   │   │   │   │   ├── .gitignore
│   │   │   │   │   ├── babel.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── packages/
│   │   │   │   │       └── www/
│   │   │   │   │           ├── next.config.js
│   │   │   │   │           ├── package.json
│   │   │   │   │           └── pages/
│   │   │   │   │               └── index.jsx
│   │   │   │   ├── 31-blocking-fallback/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── fixed/
│   │   │   │   │       │   └── [slug].js
│   │   │   │   │       └── regenerated/
│   │   │   │   │           └── [slug].js
│   │   │   │   └── 32-custom-install-command/
│   │   │   │       ├── .gitignore
│   │   │   │       ├── .yarn/
│   │   │   │       │   └── releases/
│   │   │   │       │       └── yarn-berry.cjs
│   │   │   │       ├── .yarnrc.yml
│   │   │   │       ├── install.js
│   │   │   │       ├── next.config.js
│   │   │   │       ├── package.json
│   │   │   │       ├── pages/
│   │   │   │       │   └── index.js
│   │   │   │       └── vercel.json
│   │   │   ├── integration/
│   │   │   │   ├── gip-gsp-404/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── 404.js
│   │   │   │   │       ├── _app.js
│   │   │   │   │       ├── api/
│   │   │   │   │       │   └── hello.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── index.test.js
│   │   │   │   ├── legacy-custom-dependency/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── legacy-standard/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── legacy-static-files/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   └── index.js
│   │   │   │   │   └── static/
│   │   │   │   │       └── test.txt
│   │   │   │   ├── monorepo/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── shared/
│   │   │   │   │   │   └── hello.js
│   │   │   │   │   └── www/
│   │   │   │   │       ├── next.config.js
│   │   │   │   │       ├── package.json
│   │   │   │   │       ├── pages/
│   │   │   │   │       │   └── index.js
│   │   │   │   │       ├── public/
│   │   │   │   │       │   └── data.txt
│   │   │   │   │       └── static/
│   │   │   │   │           └── test.txt
│   │   │   │   ├── no-package-json-and-next-config/
│   │   │   │   │   ├── now.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── postinstall/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── goodbye.js
│   │   │   │   │   │   └── index.js
│   │   │   │   │   ├── postinstall.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── .gitkeep
│   │   │   │   ├── public-files/
│   │   │   │   │   ├── create-public-file.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   └── index.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── robots.txt
│   │   │   │   ├── serverless-config/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── serverless-config-async/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── serverless-config-monorepo-missing/
│   │   │   │   │   ├── nested/
│   │   │   │   │   │   ├── package.json
│   │   │   │   │   │   └── pages/
│   │   │   │   │   │       ├── goodbye.js
│   │   │   │   │   │       └── index.js
│   │   │   │   │   └── now.json
│   │   │   │   ├── serverless-config-monorepo-present/
│   │   │   │   │   ├── nested/
│   │   │   │   │   │   ├── next.config.js
│   │   │   │   │   │   ├── package.json
│   │   │   │   │   │   └── pages/
│   │   │   │   │   │       ├── goodbye.js
│   │   │   │   │   │       └── index.js
│   │   │   │   │   └── now.json
│   │   │   │   ├── serverless-config-object/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── serverless-config-promise/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── serverless-no-config/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── serverless-no-config-build/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── standard/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── static-files/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   └── index.js
│   │   │   │   │   └── static/
│   │   │   │   │       └── test.txt
│   │   │   │   └── static-site/
│   │   │   │       ├── package.json
│   │   │   │       ├── pages/
│   │   │   │       │   ├── another.js
│   │   │   │       │   ├── dynamic.js
│   │   │   │       │   └── index.js
│   │   │   │       └── vercel.json
│   │   │   ├── lib/
│   │   │   │   └── run-build-lambda.js
│   │   │   ├── unit/
│   │   │   │   ├── __snapshots__/
│   │   │   │   │   └── utils.test.js.snap
│   │   │   │   ├── build.test.js
│   │   │   │   ├── export.test.js
│   │   │   │   ├── fixtures/
│   │   │   │   │   ├── entry/
│   │   │   │   │   │   └── next.config.js
│   │   │   │   │   └── next.config.js
│   │   │   │   └── utils.test.js
│   │   │   └── utils.js
│   │   └── tsconfig.json
│   └── tf-next/
│       ├── .gitignore
│       ├── README.md
│       ├── index.js
│       ├── package.json
│       ├── src/
│       │   ├── client/
│       │   │   ├── aws-profile.ts
│       │   │   ├── client.ts
│       │   │   ├── index.ts
│       │   │   └── services/
│       │   │       ├── api/
│       │   │       │   ├── api.ts
│       │   │       │   ├── index.ts
│       │   │       │   └── middleware.ts
│       │   │       └── output/
│       │   │           ├── create-spinner.ts
│       │   │           ├── index.ts
│       │   │           └── output.ts
│       │   ├── commands/
│       │   │   ├── alias/
│       │   │   │   ├── alias-list.ts
│       │   │   │   ├── alias-remove.ts
│       │   │   │   ├── alias-set.ts
│       │   │   │   ├── alias.ts
│       │   │   │   └── index.ts
│       │   │   ├── build/
│       │   │   │   ├── build.ts
│       │   │   │   └── index.ts
│       │   │   ├── deploy/
│       │   │   │   ├── deploy.ts
│       │   │   │   └── index.ts
│       │   │   ├── deployment/
│       │   │   │   ├── deployment-list.ts
│       │   │   │   ├── deployment-remove.ts
│       │   │   │   ├── deployment.ts
│       │   │   │   └── index.ts
│       │   │   └── main.ts
│       │   ├── index.ts
│       │   ├── middleware/
│       │   │   └── global.ts
│       │   ├── types.ts
│       │   └── utils/
│       │       ├── errors/
│       │       │   ├── cli-error.ts
│       │       │   ├── errors.ts
│       │       │   ├── index.ts
│       │       │   └── response-error.ts
│       │       ├── index.ts
│       │       ├── project-config.ts
│       │       ├── routes.ts
│       │       ├── strlen.ts
│       │       └── trim-protocol.ts
│       └── tsconfig.json
├── patches/
│   └── aws-cdk-lib+2.25.0.patch
├── scripts/
│   └── publish-release.sh
├── test/
│   ├── README.md
│   ├── build-fixtures.js
│   ├── fixtures/
│   │   ├── 00-shared-lambdas/
│   │   │   ├── next.config.js
│   │   │   ├── package.json
│   │   │   ├── pages/
│   │   │   │   ├── [teamSlug]/
│   │   │   │   │   └── [project]/
│   │   │   │   │       └── [id].js
│   │   │   │   ├── groups/
│   │   │   │   │   └── [id].js
│   │   │   │   ├── products/
│   │   │   │   │   └── [pid]/
│   │   │   │   │       └── index.js
│   │   │   │   └── teams/
│   │   │   │       └── invite/
│   │   │   │           └── [inviteCode].js
│   │   │   └── probes.json
│   │   ├── 00-trailing-slash-add/
│   │   │   ├── next.config.js
│   │   │   ├── package.json
│   │   │   ├── pages/
│   │   │   │   ├── abc/
│   │   │   │   │   └── def.js
│   │   │   │   ├── api/
│   │   │   │   │   └── hello.js
│   │   │   │   ├── blog/
│   │   │   │   │   └── [post].js
│   │   │   │   └── foo.js
│   │   │   ├── probes.json
│   │   │   └── public/
│   │   │       └── test.txt
│   │   ├── 01-custom-routing/
│   │   │   ├── next.config.js
│   │   │   ├── package.json
│   │   │   ├── pages/
│   │   │   │   ├── hello.js
│   │   │   │   ├── index.js
│   │   │   │   └── param.js
│   │   │   └── probes.json
│   │   ├── 02-api/
│   │   │   ├── next.config.js
│   │   │   ├── package.json
│   │   │   ├── pages/
│   │   │   │   ├── api/
│   │   │   │   │   ├── actions/
│   │   │   │   │   │   └── [actionId]/
│   │   │   │   │   │       └── info.js
│   │   │   │   │   ├── host.js
│   │   │   │   │   ├── index.js
│   │   │   │   │   └── viewer-header.js
│   │   │   │   └── test.js
│   │   │   └── probes.json
│   │   └── 03-yarn-workspaces/
│   │       ├── lerna.json
│   │       ├── package.json
│   │       ├── packages/
│   │       │   ├── common/
│   │       │   │   ├── dist/
│   │       │   │   │   ├── index.d.ts
│   │       │   │   │   └── index.js
│   │       │   │   ├── package.json
│   │       │   │   ├── src/
│   │       │   │   │   └── index.ts
│   │       │   │   └── tsconfig.json
│   │       │   └── web/
│   │       │       ├── next-env.d.ts
│   │       │       ├── next.config.js
│   │       │       ├── package.json
│   │       │       ├── pages/
│   │       │       │   ├── _app.tsx
│   │       │       │   └── index.tsx
│   │       │       └── tsconfig.json
│   │       └── probes.json
│   ├── jest.setup.ts
│   ├── routes.test.ts
│   ├── tsconfig.json
│   └── utils/
│       ├── attach-logger.ts
│       ├── host-ip-address.ts
│       ├── index.ts
│       └── s3-create-bucket.ts
├── test.env
├── tsconfig.json
├── turbo.json
├── variables.tf
└── versions.tf

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true



================================================
FILE: .github/workflows/CI.yml
================================================
name: CI

on:
  push:
    branches:
      - main
      - v[0-9]+.[0-9x]+.x
  pull_request:

env:
  NEXT_TELEMETRY_DISABLED: 1

jobs:
  build:
    runs-on: ubuntu-latest
    container: public.ecr.aws/sam/build-nodejs14.x:latest

    steps:
      - name: Install yarn
        run: npm install --global yarn@1.22.17

      - uses: actions/checkout@v2

      - name: Cache
        uses: actions/cache@v2
        with:
          path: |
            .yarn
            **/node_modules
          key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}

      - name: Install dependencies
        run: yarn --frozen-lockfile --cache-folder .yarn

      - name: Build
        run: yarn build

      - name: Upload build artifacts
        uses: actions/upload-artifact@v2
        with:
          name: dist
          path: |
            packages/api/dist/
            packages/api/dist.zip
            packages/deploy-controller/dist/
            packages/deploy-controller/dist.zip
            packages/deploy-trigger/dist/
            packages/deploy-trigger/dist.zip
            packages/proxy/dist/
            packages/proxy/dist.zip
            packages/proxy-config/dist/
            packages/proxy-config/dist.zip
            packages/runtime/dist/
            packages/tf-next/dist/
          if-no-files-found: error

  test-integration:
    needs: build
    runs-on: ubuntu-latest
    container: public.ecr.aws/sam/build-nodejs14.x:latest
    services:
      s3:
        image: registry.gitlab.com/dealmore/dealmore-build-images:s3-emulator
        env:
          MINIO_ACCESS_KEY: test
          MINIO_SECRET_KEY: testtest
      dynamodb:
        image: amazon/dynamodb-local:latest
        # @note Github overwrites WORKDIR to repository path, so overwrite that again
        options: >-
          --workdir /home/dynamodblocal

    env:
      # Increase heap size for running the tests
      NODE_OPTIONS: '--max_old_space_size=4096'
      MINIO_ACCESS_KEY: test
      MINIO_SECRET_KEY: testtest
      S3_ENDPOINT: s3:9000
      TEST_DYNAMO_ENDPOINT: http://dynamodb:8000

    steps:
      - name: Install yarn
        run: npm install --global yarn@1.22.17

      - uses: actions/checkout@v2

      - name: Cache
        uses: actions/cache@v2
        with:
          path: |
            .yarn
            **/node_modules
          key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}

      - name: Install dependencies
        run: yarn --frozen-lockfile --cache-folder .yarn

      - name: Download build artifacts
        uses: actions/download-artifact@v2
        with:
          name: dist
          path: packages

      - name: Jest
        run: yarn test:not:runtime

  # We run the runtime tests in a dedicated task since running it with the
  # other integration tests would cause a memory overflow.
  test-integration-runtime:
    needs: build
    runs-on: ubuntu-latest
    container: public.ecr.aws/sam/build-nodejs14.x:latest

    steps:
      - name: Install yarn
        run: npm install --global yarn@1.22.17

      - uses: actions/checkout@v2

      - name: Cache
        uses: actions/cache@v2
        with:
          path: |
            .yarn
            **/node_modules
          key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}

      - name: Install dependencies
        run: yarn --frozen-lockfile --cache-folder .yarn

      - name: Download build artifacts
        uses: actions/download-artifact@v2
        with:
          name: dist
          path: packages

      - name: Jest
        run: yarn test:runtime

  test-e2e-prepare:
    needs: build
    runs-on: ubuntu-latest
    container: public.ecr.aws/sam/build-nodejs14.x:latest
    steps:
      - name: Install yarn
        run: npm install --global yarn@1.22.17

      - uses: actions/checkout@v2

      - name: Cache
        uses: actions/cache@v2
        with:
          path: |
            .yarn
            **/node_modules
          key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}

      - name: Yarn install
        run: yarn --frozen-lockfile --cache-folder .yarn

      - name: Download build artifacts
        uses: actions/download-artifact@v2
        with:
          name: dist
          path: packages

      - name: Build e2e fixtures
        run: yarn test:e2e:prepare

      - name: Upload e2e fixtures
        uses: actions/upload-artifact@v2
        with:
          name: e2e-fixtures
          path: test/fixtures/**/.next-tf/**/*
          if-no-files-found: error

  publishRelease:
    name: Potentially publish release
    runs-on: ubuntu-latest
    needs: [build, test-integration, test-integration-runtime]
    if: github.ref == 'refs/heads/main'
    env:
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 25

      - name: Fetch git tags
        run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

      - name: Setup node
        uses: actions/setup-node@v2
        with:
          node-version: '14'
          cache: 'yarn'

      - name: Install dependencies
        run: yarn --frozen-lockfile

      - name: Download build artifacts
        uses: actions/download-artifact@v2
        with:
          name: dist
          path: packages

      # git user is required (bot not used) by release-it
      - name: Set git user to GitHub Actions
        uses: fregante/setup-git-user@v1.0.1

      - name: Set registry for publish
        run: yarn config set registry https://registry.npmjs.org

      - name: Publish packages
        run: ./scripts/publish-release.sh


================================================
FILE: .github/workflows/lint.yml
================================================
name: Lint

on:
  push:
    branches:
      - main
      - v[0-9]+.[0-9x]+.x
  pull_request:

jobs:
  lint-tf:
    name: Lint Terraform
    runs-on: ubuntu-latest
    container: hashicorp/terraform
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Lint Terraform
        run: terraform fmt -check -recursive -diff


================================================
FILE: .github/workflows/release.yml
================================================
name: Release

on:
  workflow_dispatch:
    inputs:
      tag:
        description: 'Tag'
        required: true
      releaseBranch:
        description: 'Release branch'
        required: true
        default: 'release'

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      # Do a full checkout (all branches)
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - uses: milliHQ/gh-action-release-branch@v2.0.0
        with:
          release-branch: ${{ github.event.inputs.releaseBranch }}
          release-tag: ${{ github.event.inputs.tag }}
          exclude: |
            .vscode/**/*
            packages/**/*
            test/**/*
            docker-compose.yml
            jest.config.js
            package.json
            tsconfig.json
            yarn.lock


================================================
FILE: .github/workflows/tf-docs.yml
================================================
# GitHub action to make sure that the terraform docs in the README are
# up-to-date on every push to the main branch

name: Terraform docs

on:
  push:
    branches:
      - main
      - v[0-9]+.[0-9x]+.x

jobs:
  update-docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Update Terraform docs in README
        uses: terraform-docs/gh-actions@v0.10.0
        with:
          config-file: '.terraform-docs.yml'
          output-file: README.md
          git-push: 'true'
          git-commit-message: 'docs: Update Terraform docs'


================================================
FILE: .gitignore
================================================
node_modules
.DS_STORE

# Terraform
**/.terraform/*
*.tfstate
*.tfstate.*

# Build output
.next
.next-tf

# Temp files
*.swp*

# Log files
*.log

# direnv
.direnv
.envrc

# Turbo
.turbo


================================================
FILE: .prettierrc.js
================================================
module.exports = {
  trailingComma: 'es5',
  singleQuote: true,
};


================================================
FILE: .terraform-docs.yml
================================================
formatter: 'markdown table'

sections:
  hide:
    - 'data-sources'
    - 'modules'
    - 'resources'

settings:
  anchor: false


================================================
FILE: .vscode/extensions.json
================================================
{
  "recommendations": ["Orta.vscode-jest", "esbenp.prettier-vscode"]
}


================================================
FILE: .vscode/launch.json
================================================
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug Jest Tests",
      "type": "node",
      "request": "launch",
      "runtimeArgs": [
        "--inspect-brk",
        "${workspaceRoot}/node_modules/.bin/jest",
        "--runInBand"
      ],
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "port": 9229
    },
    {
      "name": "Debug Current Jest File",
      "type": "node",
      "request": "launch",
      "runtimeArgs": [
        "--inspect-brk",
        "${workspaceRoot}/node_modules/.bin/jest",
        "--runInBand",
        "${file}"
      ],
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "port": 9229
    },
    // Default launch configuration for VSCode Jest extension
    {
      "name": "vscode-jest-tests",
      "type": "node",
      "request": "launch",
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "disableOptimisticBPs": true,
      "program": "${workspaceRoot}/node_modules/.bin/jest",
      "cwd": "${workspaceFolder}",
      "args": ["--runInBand", "--watchAll=false"]
    }
  ]
}


================================================
FILE: .vscode/settings.json
================================================
{
  "files.associations": {
    "**/test/**/probes.json": "jsonc"
  }
}


================================================
FILE: CHANGELOG.md
================================================
# Changelog

## [Unreleased]

## [1.0.0-canary.5] - 2022-07-12

- Adds alias for profile, improves error message ([#344](https://github.com/milliHQ/terraform-aws-next-js/pull/344))

## [1.0.0-canary.4] - 2022-06-07

- Correctly increase version number of new packages

## [1.0.0-canary.3] - 2022-06-07

- Fixes deployments without Lambdas ([#325](https://github.com/milliHQ/terraform-aws-next-js/pull/325))
- Use CloudFormation role ([#324](https://github.com/milliHQ/terraform-aws-next-js/pull/324))
- Improve CLI ([#323](https://github.com/milliHQ/terraform-aws-next-js/pull/323))
- Fix runtime bundle ([#322](https://github.com/milliHQ/terraform-aws-next-js/pull/322))

## [1.0.0-canary.2] - 2022-05-31

- Adds static prefix to files served from S3 ([#321](https://github.com/milliHQ/terraform-aws-next-js/pull/321))
- Add CLI commands ([#317](https://github.com/milliHQ/terraform-aws-next-js/pull/317))
- No longer require reserved concurrency ([#319](https://github.com/milliHQ/terraform-aws-next-js/pull/319), [#251](https://github.com/milliHQ/terraform-aws-next-js/issues/251))
- Use CLI and CDK for deployments ([#300](https://github.com/milliHQ/terraform-aws-next-js/pull/300))

## [0.12.2] - 2022-04-16

- Append querystring to redirects ([#296](https://github.com/milliHQ/terraform-aws-next-js/issues/296), [#304](https://github.com/milliHQ/terraform-aws-next-js/pull/304))

## [0.12.1] - 2022-04-11

- Pass image settings to the optimization module ([#297](https://github.com/milliHQ/terraform-aws-next-js/issues/297), [#299](https://github.com/milliHQ/terraform-aws-next-js/pull/299))

## [0.12.0] - 2022-04-07

- Ensure compatibility with AWS Provider Version 4 ([#286](https://github.com/milliHQ/terraform-aws-next-js/issues/286), [#291](https://github.com/milliHQ/terraform-aws-next-js/pull/291))
- Add switch for attaching additional policy documents ([#276](https://github.com/milliHQ/terraform-aws-next-js/pull/276))

## [0.11.5] - 2022-04-02

- Adds support for route-manifest v4 ([#292](https://github.com/milliHQ/terraform-aws-next-js/pull/292))  
  This ensures the builder works with Next.js versions `>= v12.1.3`.
- Restrict [image optimizer](https://github.com/milliHQ/terraform-aws-next-js-image-optimization) submodule version to `<= v12.0.10` ([#293](https://github.com/milliHQ/terraform-aws-next-js/pull/293))  
  Since the `v12.0.10` release is the last version with support for [Terraform AWS Provider](https://registry.terraform.io/providers/hashicorp/aws/) `v3.x` this update ensures existing setups will not break in the future.
- Bump @vercel/build-utils from `2.10.1` to `2.12.1` ([#287](https://github.com/milliHQ/terraform-aws-next-js/pull/287))

## [0.11.4] - 2022-02-01

### Fixed

- Determine content-type correctly for localized pre-rendered HTML pages ([#278](https://github.com/milliHQ/terraform-aws-next-js/pull/278), [#277](https://github.com/milliHQ/terraform-aws-next-js/issues/277))

## [0.11.3] - 2022-01-30

### Added

- Adds new output for Lambda role ARNs `lambda_execution_role_arns` ([#270](https://github.com/milliHQ/terraform-aws-next-js/pull/270))

## [0.11.2] - 2022-01-23

### Added

- Support for response headers policy (`cloudfront_response_headers_policy`) for the internal CloudFront distribution ([#265](https://github.com/milliHQ/terraform-aws-next-js/pull/265), [#268](https://github.com/milliHQ/terraform-aws-next-js/pull/268))  
  This also increases the minimum required [Terraform AWS provider](https://github.com/hashicorp/terraform-provider-aws) version from `3.43.0` to `3.64.0`.

### Fixed

- Bash script for uploading assets to S3 now uses the standard endpoint and is now compatible with newer AWS regions ([#263](https://github.com/milliHQ/terraform-aws-next-js/pull/263))
- Components fetched from npm registry now use relative paths that are stored in the Terraform state, which prevents unnecessary deployments ([#261](https://github.com/milliHQ/terraform-aws-next-js/pull/261))

## [0.11.1] - 2022-01-15

### Fixed

- Fix for cloudfront invalidation dynamic routing paths ([#258](https://github.com/milliHQ/terraform-aws-next-js/pull/258))

## [0.11.0] - 2022-01-13

### Added

- Option for attaching a waf policy to the internal CloudFront distribution ([#250](https://github.com/milliHQ/terraform-aws-next-js/pull/250))

### Changed

- TTL for `Cache-Control` header is set to `0` (no cache) when the header is not sent from origin ([#241](https://github.com/milliHQ/terraform-aws-next-js/pull/241), [#236](https://github.com/milliHQ/terraform-aws-next-js/issues/236))

### Fixed

- Static routes were falsely generated when running on Windows ([#246](https://github.com/milliHQ/terraform-aws-next-js/issues/246), [#254](https://github.com/milliHQ/terraform-aws-next-js/pull/254))

## [0.10.2] (November 29, 2021)

Bugfix release that ensures compatibility with the `v12.0.0` version of the [Terraform Next.js Image Optimization module for AWS](https://github.com/milliHQ/terraform-aws-next-js-image-optimization).

- `create_image_optimization` breaks because of breaking change in the newest 12.0.0 release ([#243](https://github.com/milliHQ/terraform-aws-next-js/issues/243), [#244](https://github.com/milliHQ/terraform-aws-next-js/pull/244))

## 0.10.1 (October 23, 2021)

This release ensures that static generated routes with dynamic parts (e.g. `/test/[...slug]`) are invalidated correctly when running terraform apply.
We also added a new option to define tags exclusively on S3 buckets created by this module.

- Ensure correct invalidation for slug paths ([#140](https://github.com/milliHQ/terraform-aws-next-js/issues/140), [#229](https://github.com/milliHQ/terraform-aws-next-js/pull/229), [#228](https://github.com/milliHQ/terraform-aws-next-js/issues/228))
- Adds new input variable `tags_s3_bucket` ([#216](https://github.com/milliHQ/terraform-aws-next-js/issues/216), [#230](https://github.com/milliHQ/terraform-aws-next-js/pull/230))

## 0.10.0 (October 16, 2021)

Beginning with this release we streamline the versioning of the Terraform module with its npm-packages.
So when you use the Terraform module in version [`0.10.0`](https://registry.terraform.io/modules/milliHQ/next-js/aws/) you should also use the [`tf-next@0.10.0`](https://www.npmjs.com/package/tf-next) npm-package for building the Next.js project.

This release also increases the minimum required Terraform version from `0.13` to `0.15`.

- Forward correct `host` header to server-side rendered pages ([#156](https://github.com/milliHQ/terraform-aws-next-js/issues/156), [#161](https://github.com/milliHQ/terraform-aws-next-js/pull/161))
- Adds charset to `Content-Type` header for static routes and files served by S3 ([#214](https://github.com/milliHQ/terraform-aws-next-js/issues/214), [#226](https://github.com/milliHQ/terraform-aws-next-js/pull/226))
- Removes empty provider warning when running Terraform commands ([#155](https://github.com/milliHQ/terraform-aws-next-js/issues/155), [#219](https://github.com/milliHQ/terraform-aws-next-js/pull/219))
- Removes random ids from resource names ([#212](https://github.com/milliHQ/terraform-aws-next-js/issues/212), [#227](https://github.com/milliHQ/terraform-aws-next-js/pull/227))

## 0.9.3 (October 09, 2021)

This release fixes the routing behavior for dynamic routes that are statically generated (served from S3).

### Proxy

- Fixes dynamic routing for statically generated routes ([#218](https://github.com/milliHQ/terraform-aws-next-js/issues/218), [#221](https://github.com/milliHQ/terraform-aws-next-js/pull/221))

## 0.9.2 (September 19, 2021)

⚠️ Namespace changed ⚠️

We [recently changed](https://github.com/milliHQ/terraform-aws-next-js/issues/194) the namespace of this module from `dealmore` to `milliHQ`. Make sure to upgrade the source of the module accordingly:

```diff
module "tf_next" {
-  source = "dealmore/next-js/aws"
+  source = "milliHQ/next-js/aws"

 ...
}
```

---

Besides from the namespace change, this release has now an improved experience when using it with [custom domains](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/with-custom-domain) and some bugfixes to the proxy component when using the [`trailingSlash` option](https://nextjs.org/docs/api-reference/next.config.js/trailing-slash) from Next.js.

### Terraform module

- It's now possible to use domain aliases without creating an external CloudFront distribution ([#192](https://github.com/milliHQ/terraform-aws-next-js/pull/192))
- Ensure `x-nextjs-page` header gets forwarded ([#190](https://github.com/milliHQ/terraform-aws-next-js/pull/190))
- Bump `milliHQ/download/npm` from 1.1.0 to 2.0.0 ([#193](https://github.com/milliHQ/terraform-aws-next-js/pull/193))

### Proxy (0.8.0)

- Improve filesystem routes for trailing slashes ([#162](https://github.com/milliHQ/terraform-aws-next-js/pull/162), [#180](https://github.com/milliHQ/terraform-aws-next-js/issues/180), [#182](https://github.com/milliHQ/terraform-aws-next-js/pull/182), [#191](https://github.com/milliHQ/terraform-aws-next-js/pull/191))

## 0.9.1 (June 20, 2021)

This is a maintenance release which upgrades the image optimizer module to the latest version.
We also changed the behavior of the proxy module so that the default root object in CloudFront is no longer necessary.

No configuration changes should be necessary when upgrading from the `0.9.0` release.

### Terraform module

- Upgrades Proxy component to 0.7.0 ([#139](https://github.com/milliHQ/terraform-aws-next-js/issues/139), [#141](https://github.com/milliHQ/terraform-aws-next-js/pull/141))
- Upgrades [Terraform Next.js Image Optimization module for AWS](https://github.com/milliHQ/terraform-aws-next-js-image-optimization) to `11.x.x` release ([#142](https://github.com/milliHQ/terraform-aws-next-js/issues/142), [#144](https://github.com/milliHQ/terraform-aws-next-js/pull/144))  
  The image optimizer Lambda now uses `2048mb` RAM by default (from `1024mb`) to improve resizing speed.
  You can change that amount with the newly introduced variable `image_optimization_lambda_memory_size`.
  This has no effect on the Lambda functions that serve the Next.js pages or api routes (they remain at `1024mb` by default).
- Bump AWS Lambda Terraform module from 1.47.0 to 2.4.0 ([#145](https://github.com/milliHQ/terraform-aws-next-js/pull/145))
- Bump AWS API Gateway Terraform module from 0.11.0 to 1.1.0 ([#146](https://github.com/milliHQ/terraform-aws-next-js/pull/146))

### Proxy (0.7.0)

- Fix root route rewrites ([#139](https://github.com/milliHQ/terraform-aws-next-js/issues/139), [#141](https://github.com/milliHQ/terraform-aws-next-js/pull/141))

## 0.9.0 - (June 15, 2021)

**⚠️ Breaking Changes ⚠️**

Since the main CloudFront distribution is a central resource that may need advanced customization, we decided to introduce a new way to fully customize the distribution for to your needs.

As part of this change a few input variables are no longer supported and should be removed from the module.

If you are not using one of these variables you can safely upgrade to this release without further changes.

If you use one of the following input variables read below for more information how to upgrade:

- `cloudfront_custom_behaviors`
- `cloudfront_geo_restriction`
- `cloudfront_origins`
- `cloudfront_viewer_certificate_arn`
- `cloudfront_minimum_protocol_version`
- `create_domain_name_records`
- `domain_names`
- `domain_zone_names`

If you are already using one of these input variables you should now create a new CloudFront resource in your `main.tf` file and link it with the Next.js module.

For more information please see the ["with existing CloudFront"](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/with-existing-cloudfront) and ["with custom domain"](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/with-custom-domain) examples.

### Terraform module

- Enable usage of external CloudFront resource ([#55](https://github.com/milliHQ/terraform-aws-next-js/issues/55), [#134](https://github.com/milliHQ/terraform-aws-next-js/pull/134), [#137](https://github.com/milliHQ/terraform-aws-next-js/pull/137))
- Queue CloudFront invalidations ([#48](https://github.com/milliHQ/terraform-aws-next-js/issues/48), [#125](https://github.com/milliHQ/terraform-aws-next-js/pull/125))
- Attaching Lambda to VPC ([#110](https://github.com/milliHQ/terraform-aws-next-js/issues/110), [#111](https://github.com/milliHQ/terraform-aws-next-js/pull/111))  
  Thanks to [@chamilad](https://github.com/chamilad) for contributing!
- Remove provider proxy from proxy-config module ([#102](https://github.com/milliHQ/terraform-aws-next-js/issues/102), [#124](https://github.com/milliHQ/terraform-aws-next-js/pull/124))

## Proxy (0.6.0)

- Support rewriting to an external URL ([#65](https://github.com/milliHQ/terraform-aws-next-js/issues/65), [#120](https://github.com/milliHQ/terraform-aws-next-js/pull/120))
- Bump runtime from `nodejs12.x` to `nodejs14.x` ([#136](https://github.com/milliHQ/terraform-aws-next-js/pull/136))

### Deploy trigger (0.4.0)

- Queue CloudFront invalidations ([#48](https://github.com/milliHQ/terraform-aws-next-js/issues/48), [#125](https://github.com/milliHQ/terraform-aws-next-js/pull/125))

## tf-next (0.7.0)

- Adds support for yarn workspaces ([#93](https://github.com/milliHQ/terraform-aws-next-js/issues/93), [#107](https://github.com/milliHQ/terraform-aws-next-js/pull/107))

### Runtime (1.1.0)

- Bump @vercel/nft from 0.9.5 to 0.10.0 ([#112](https://github.com/milliHQ/terraform-aws-next-js/pull/112))

## 0.8.1 - (April 27, 2021)

### Terraform module

- Fixes compatibility with Terraform 0.15 ([#115](https://github.com/milliHQ/terraform-aws-next-js/issues/115), [#118](https://github.com/milliHQ/terraform-aws-next-js/pull/118))
- Bump AWS Lambda Terraform module from 1.34.0 to 1.47.0 ([#117](https://github.com/milliHQ/terraform-aws-next-js/pull/117))
- Bump Next.js Image Optimization module from 10.0.5 to 10.0.8 ([#116](https://github.com/milliHQ/terraform-aws-next-js/pull/116))

## 0.8.0 - (April 05, 2021)

This release enables Brotli in addition to gzip as default compression method.

**⚠️ Breaking Changes ⚠️**

Before upgrading make sure that you define a new alias `global_region` for the AWS Provider in the `us-east-1` region.
This provider alias is used to create the Lambda@Edge function that must be created in `us-east-1`.

```diff
# main.tf
provider "aws" {
  region = "us-west-2"
}

+ provider "aws" {
+   alias  = "global_region"
+   region = "us-east-1"
+ }

module "tf_next" {
  source = "dealmore/next-js/aws"

+ providers = {
+   aws.global_region = aws.global_region
+ }
}
```

### Terraform module

- Removes internal AWS provider for `us-east-1` region ([#50](https://github.com/milliHQ/terraform-aws-next-js/issues/50), [#101](https://github.com/milliHQ/terraform-aws-next-js/pull/101))
- Enable Brotli compression for CloudFront ([#8](https://github.com/milliHQ/terraform-aws-next-js/issues/8), [#82](https://github.com/milliHQ/terraform-aws-next-js/pull/82))
- Adds `cloudfront_geo_restriction` variable ([#97](https://github.com/milliHQ/terraform-aws-next-js/pull/97))
- Use `nodejs14.x` as default runtime for Lambda ([#67](https://github.com/milliHQ/terraform-aws-next-js/pull/67), [#80](https://github.com/milliHQ/terraform-aws-next-js/issues/80), [#81](https://github.com/milliHQ/terraform-aws-next-js/pull/81))

### Deploy trigger (0.3.0)

- CloudFront invalidations for static files (e.g. static prerendered HTML or files from `public/`) are only issues if the eTag of the file changes ([#48](https://github.com/milliHQ/terraform-aws-next-js/issues/48), [#91](https://github.com/milliHQ/terraform-aws-next-js/pull/91))

### tf-next (0.6.1)

- Ensure that `INIT_CWD` environment variable is set to the correct working directory ([#87](https://github.com/milliHQ/terraform-aws-next-js/pull/87))

### tf-next (0.6.0)

- Allows dependencies (e.g. Prisma & Blitz.js) to correctly detect the build environment ([#70](https://github.com/milliHQ/terraform-aws-next-js/issues/70), [#73](https://github.com/milliHQ/terraform-aws-next-js/issues/73), [#85](https://github.com/milliHQ/terraform-aws-next-js/pull/85))

## 0.7.4 (April 03, 2021)

### Terraform module

- Use `concat` instead of `merge` for custom CloudFront origins and cache behaviors ([#66](https://github.com/milliHQ/terraform-aws-next-js/issues/66), [#105](https://github.com/milliHQ/terraform-aws-next-js/pull/105))

## 0.7.3 (March 08, 2021)

### Terraform module

- Bump internal module `terraform-aws-modules/apigateway-v2/aws` from `0.5.0` to `0.11.0` ([#68](https://github.com/milliHQ/terraform-aws-next-js/pull/68))
- Bump internal module `dealmore/next-js-image-optimization/aws` from `2.0.0` to `2.0.1` ([#68](https://github.com/milliHQ/terraform-aws-next-js/pull/68))

## 0.7.2 (March 04, 2021)

### Terraform module

- Fix for invalid function argument error introduced by `0.7.1` release ([#59](https://github.com/milliHQ/terraform-aws-next-js/issues/59))

## 0.7.1 (March 04, 2021)

### Terraform module

- Add option to set the image optimizer version ([#58](https://github.com/milliHQ/terraform-aws-next-js/issues/58))

## 0.7.0 (February 13, 2021)

This release brings support for [Next.js image optimization](https://nextjs.org/docs/basic-features/image-optimization) 📸.  
No extra config is needed, simply update the Terraform module and the `tf-next` package to the latest version!  
Check out our example for more information: [Next image component example](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/next-image)

You can always opt-out from creating resources for image optimization by setting `create_image_optimization = false`.

### Terraform module

- Adds support for `next/image` component ([#28](https://github.com/milliHQ/terraform-aws-next-js/issues/28), [#51](https://github.com/milliHQ/terraform-aws-next-js/pull/51))
- Refactoring: Outsources a previously private Terraform module, that is now used across multiple projects. Is now avaiable here: [NPM Download Terraform module
  ](https://registry.terraform.io/modules/milliHQ/download/npm) ([#41](https://github.com/milliHQ/terraform-aws-next-js/issues/41))

### tf-next (0.5.0)

- Adds support for `next/image` component ([#28](https://github.com/milliHQ/terraform-aws-next-js/issues/28), [#51](https://github.com/milliHQ/terraform-aws-next-js/pull/51))

### Proxy (0.5.0)

- Internal refactoring which changes the way the module is bundled. No feature changes ([#43](https://github.com/milliHQ/terraform-aws-next-js/issues/43))

### Deploy trigger (0.2.0)

- Internal refactoring which changes the way the module is bundled. No feature changes ([#43](https://github.com/milliHQ/terraform-aws-next-js/issues/43))

## 0.6.2 (January 19, 2021)

### Terraform module

- Bump internal module version of `terraform-aws-modules/lambda/aws`: 1.31.0 -> 1.34.0  
  This should fix an issue when performing a direct upgrade from `v0.3.0` to `v0.6.x`

## 0.6.1 (January 18, 2021)

### Terraform module

- Fix: Correctly propagate the permissions boundary (`lambda_role_permissions_boundary`) to all Lambda & Lambda@Edge functions ([#38](https://github.com/milliHQ/terraform-aws-next-js/pull/38))

### tf-next (0.4.1)

- Fix: Request cookie header should be semi-colon delimitated ([#39](https://github.com/milliHQ/terraform-aws-next-js/pull/39))

## 0.6.0 (January 16, 2021)

**⚠️ Breaking Changes ⚠️**

You need to update the `tf-next` package to the latest version in order to use it with the `v0.6.0` release.

```sh
npm upgrade tf-next@latest   # npm
yarn upgrade tf-next@latest  # yarn
```

### Terraform module

- Upgrade to API Gateway Payload V2.0 ([#29](https://github.com/milliHQ/terraform-aws-next-js/issues/29), [#31](https://github.com/milliHQ/terraform-aws-next-js/pull/31))  
  This is only an upgrade of the internally API used by Lambda and API Gateway (Not the resource itself, since we already use API Gateway V2). See this [guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html) for a detailed look at the differences between the V1.0 and V2.0 format.
  It fixes a bug where no multi-value headers could be sent by a SSR or API page.
- Sends an error message when you try to use the Terraform module together with an old version of `tf-next` ([#5](https://github.com/milliHQ/terraform-aws-next-js/issues/5), [#37](https://github.com/milliHQ/terraform-aws-next-js/pull/37))
- Upgrades proxy component to `v0.4.0`

### tf-next (0.4.0)

- Adds a version number to the config file, so that the Terraform module is able to warn about a possible version mismatch ([#5](https://github.com/milliHQ/terraform-aws-next-js/issues/5), [#37](https://github.com/milliHQ/terraform-aws-next-js/pull/37))

### Proxy (0.4.0)

- Fix to handle `resource` handle type properly

## 0.5.3 (January 15, 2021)

### Terraform module

- Fix: Pass permissions boundary to edge proxy lambda ([#35](https://github.com/milliHQ/terraform-aws-next-js/pull/35))

## 0.5.2 (January 14, 2021)

### Terraform module

- Adds `tags` variable to set tags on supported AWS resources ([#34](https://github.com/milliHQ/terraform-aws-next-js/pull/34))
- Adds `lambda_role_permissions_boundary` variable for setting a permission boundary for the Lambda role ([#33](https://github.com/milliHQ/terraform-aws-next-js/pull/33))

## 0.5.1 (January 13, 2021)

### Terraform module

- Adds `cloudfront_hosted_zone_id` output ([#30](https://github.com/milliHQ/terraform-aws-next-js/pull/30)).

## 0.5.0 (January 03, 2021)

Happy New Year! 🍾  
With this release we bring native support for [redirects](https://nextjs.org/docs/api-reference/next.config.js/redirects) in Next.js.

### Proxy (0.3.0)

- Adds ability to handle redirects ([#10](https://github.com/milliHQ/terraform-aws-next-js/issues/10), [#24](https://github.com/milliHQ/terraform-aws-next-js/pull/24)).

### tf-next (0.3.0)

- The build tool got a new name, now it is simply `tf-next` instead of `@dealmore/terraform-next-build`.  
  For backwards compatibility we plan to release new versions to both the old and the new package name until v1.0.

- When running `tf-next build` we now filter out routes with the prefix `_next/static/*` since they are handled directly by CloudFront and will never hit the Proxy.

## 0.4.0 (December 30, 2020)

- Adds [new example](https://github.com/milliHQ/terraform-aws-next-js/blob/main/examples/custom-domain) how to use custom domains.

### Terraform module

- Adds ability to change the price class of the associated CloudFront distributions (`cloudfront_price_class`).
- Adds new option after how many days the static assets of previous deployments should be deleted from S3(`expire_static_assets`).
- Updates deploy trigger Lambda function to `v0.1.0`.

### Deploy trigger

- Static routes are now cached much longer by CloudFront.
- Static routes from CloudFront now get invalidated when a new deployment is pushed.
- Updates deploy trigger Lambda function to support expiration of previous deployments.

## 0.3.0 (December 23, 2020)

### Terraform module

- Adds support for Terraform `v0.14`
- Drops support for Terraform `v0.12`

## 0.2.0 (December 22, 2020)

> **Note:** This will be the last release with support for Terraform `v12.x`, see [#18](https://github.com/milliHQ/terraform-aws-next-js/issues/18) for more information.

### Terraform module

- Destroy non-empty S3 buckets on stack deletion
- Experimental support for pre-Rendered routes ([#16](https://github.com/milliHQ/terraform-aws-next-js/issues/16))

### Terraform Next Build

- Experimental support for pre-Rendered routes ([#16](https://github.com/milliHQ/terraform-aws-next-js/issues/16))

### Proxy

- Experimental support for pre-Rendered routes ([#16](https://github.com/milliHQ/terraform-aws-next-js/issues/16))


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

Contributions are welcome!

As a general advice it is always a good idea to raise an [issue](https://github.com/milliHQ/terraform-aws-next-js/issues) before creating a new pull request.
This ensures that we don't have to reject pull requests that are not aligning with our roadmap and not wasting your valuable time.

## Contribution Prerequisites

The project is a monorepo which contains both the Terraform module and the CLI (`tf-next`) that is used to prepare the Next.js to be served by AWS Lambda written in Node.js.
It also contains components (`proxy` and `deploy-trigger`) that are directly published to AWS Lambda. They are also written in Node.js.

For the Terraform part you should have installed:

- [Terraform CLI](https://www.terraform.io/downloads.html) at 0.13+

For the CLI and the components you should have installed:

- [Node.js](https://nodejs.org/) at v14.0.0+
- [Yarn 1](https://classic.yarnpkg.com/) at v1.2.0+

## Development Workflow

### Terraform module

> **Note:** You should not make changes to the documentation of the **Requirements**, **Providers**, **Inputs** and **Outputs** sections in the `README.md` when contributing.
> The values there are auto generated by a GitHub action task once a PR is merged.

#### Codestyle

We use a [GitHub Action](https://github.com/milliHQ/terraform-aws-next-js/actions/workflows/lint.yml) to make sure that the committed code is properly formatted.
Before submitting a PR, you should make sure that the code is properly formatted.

You can do this by running the Terraform [`fmt` command](https://www.terraform.io/docs/cli/commands/fmt.html) in the root of the repository:

```sh
terraform fmt -recursive
```

### CLI and components

After cloning the repository, run `yarn` to fetch and install its dependencies.

## Testing

Automatic testing is only done for the worker component written in Node.js.
The Terraform module is **not** covered by automatic tests.

### Testing Terraform module

Since the Terraform module itself is not covered by automatic tests, testing has to be done manually.
The repository contains some examples in the [`examples/*`](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples) folder, that can be used to run a quick acceptance test against your own AWS account.

You may need to change a few settings in the `main.tf` file in the root of the example:

#### Use local development version of the module

To use the local development version instead of downloading it from the Terraform registry you have to change the source to the local path of the module.
When working with one of the examples zou can simply use the relative path to the root of the cloned repository:

```diff
module "tf_next" {
- source = "milliHQ/next-js/aws"
+ source = "../.."
  ...
}
```

#### Use local build of the components

Instead of downloading the components from npm you can also specify the `debug_use_local_packages` to use the local version.
To do so, make sure that the components are built by running the following commands:

```sh
yarn --cwd packages/proxy build
yarn --cwd packages/deploy-trigger build
```

After that you should have a `dist.zip` file in the root of each package.

To deploy the local built components, you also need to set `debug_use_local_packages = true`:

```diff
module "tf_next" {
  source = "../.."
  ...
+ debug_use_local_packages = true
}
```

### End-to-end (e2e) testing (CLI + components)

The end-to-end testing is only used for testing the the CLI (`tf-next`) and components (`proxy` and `deploy-trigger`).
A local environment of AWS Lambda is created for this to simulate a execution under the same conditions as it would run in a AWS data center.

#### 0. Prerequisites

- [Docker Desktop + Docker Compose](https://www.docker.com/products/docker-desktop)  
  (Docker Compose comes bundled with Docker Desktop on MacOS and Windows)
- [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)

You should check after install if they are available from your command-line:

```sh
docker --version
# > Docker version 20.10.2, build 2291f61

docker-compose --version
# > docker-compose version 1.27.4, build 40524192

sam --version
# > SAM CLI, version 1.17.0
```

#### 1. Build the CLI & components

Before running a e2e-test make sure that the CLI and the components are built:

```sh
# CLI (Order is important here!)
yarn --cwd packages/runtime build
yarn --cwd packages/tf-next build

# Components
yarn --cwd packages/proxy build
yarn --cwd packages/deploy-trigger build
```

#### 2. Build the fixtures

The fixtures are real Next.js apps that need to be built with `tf-next build` before passing them to the e2e-test.
You can build all fixtures by running:

```sh
yarn test:e2e:prepare
```

#### 3. Local S3 instance

Before running the e2e-tests, make sure that the local S3 emulator from docker-compose is running.
From the root of the project run:

```sh
docker-compose up -d
```

#### 4. Run tests

After that you should be able to execute the e2e-tests locally by running the `test:e2e` task:

```sh
yarn test:e2e
```

The e2e-tests are executed from the `test/routes.test.ts` file.
Each fixture in `test/fixtures/*` contains a `probes.json` file that contains the actual test cases.


================================================
FILE: LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright 2020 Felix Haus (milliVolt infrastructure)

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: README.md
================================================
<blockquote>
  <p align="center">
    <strong>Note</strong>
    <br />
    The main branch currently contains the atomic deployments alpha preview.
    <br />
    For the lastest stable release, check out the <a href="https://github.com/milliHQ/terraform-aws-next-js/tree/v0.x"><code>v0.x</code> branch</a>.
  </p>
  <p align="center">
    Please see our blog post <a href="https://milli.is/blog/the-road-to-atomic-deployments" target="_blank" rel="noopener">"The road to Atomic Deployments"</a><br />or watch the latest release review for more information:
    <br />
    <br />
    <a aria-label="Terraform Next.js for AWS: First look at the new atomic deployments feature" href="https://www.youtube.com/watch?v=NY3zKnIcLd4" target="_blank" rel="noopener">
      <img src="https://img.youtube.com/vi/NY3zKnIcLd4/0.jpg" height="260px">
    </a>

  </p>
</blockquote>

---

# Terraform Next.js module for AWS

![CI status](https://github.com/milliHQ/terraform-aws-next-js/workflows/CI/badge.svg)

A zero-config Terraform module for self-hosting Next.js sites serverless on AWS Lambda.

## Features

Some features are still under development, here is a list of features that are currently supported and what we plan to bring with the next releases:

- ✅ &nbsp;Supports any version of [Next.js](https://nextjs.org/)
- ✅ &nbsp;[Terraform](https://www.terraform.io/) `v0.15+`
- ✅ &nbsp;Unlimited parallel deployments of Next.js apps (atomic deployments)
- ✅ &nbsp;Static, SSG, Lambda and API pages (with [dynamic routes](https://nextjs.org/docs/routing/dynamic-routes))
- ✅ &nbsp;Automatic expiration of old static assets
- ✅ &nbsp;[Rewrites](https://nextjs.org/docs/api-reference/next.config.js/rewrites) & [Redirects](https://nextjs.org/docs/api-reference/next.config.js/redirects)
- ✅ &nbsp;[Image Component & Image Optimization](https://nextjs.org/docs/basic-features/image-optimization) support
- 🚧 &nbsp;[Incremental Static Regeneration](https://nextjs.org/docs/basic-features/data-fetching#incremental-static-regeneration)
- ⛔️&nbsp; [Middleware](https://nextjs.org/docs/advanced-features/middleware) (Not supported by Lambda@Edge / CloudFront functions)

## Architecture

The Next.js Terraform module is designed as a full stack AWS app. It relies on multiple AWS services and connects them to work as a single application:

![Architecture overview diagram](https://github.com/milliHQ/terraform-aws-next-js/blob/main/docs/assets/architecture.png?raw=true)

## Usage

### Prerequisites

You should have the following tools installed:

- [Terraform](https://www.terraform.io/downloads)
- [Node.js](https://nodejs.org)
- [Bash](https://www.gnu.org/software/bash/) & [curl](https://curl.se/) (Should be available by default on many Linux based images or macOS)

> **Note:** Additionally we assume here that you already have a public [Route53 Hosted Zone](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html) associated with your AWS account.
>
> This is a requirement in the preview phase of atomic deployments, where each deployment gets a unique subdomain assigned.
> It will change once atomic deployments become generally available.

### Setup the Next.js Terraform module

The Terraform module contains the system that is later used for creating new deployments and managing the aliases (domains) for your Next.js app(s).
Creating the Terraform stack is only required on initial setup and creates the global resources (CloudFront distributions, DynamoDB tables, S3 storage) that is used for handling incoming requests to your website.

Create a new `main.tf` file in an empty folder (or add it to your existing Terraform stack) and add the following content:

```tf
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

# Main region where the resources should be created in
# Should be close to the location of your viewers
provider "aws" {
  region = "us-west-2"
}

# Provider used for creating the Lambda@Edge function which must be deployed
# to us-east-1 region (Should not be changed)
provider "aws" {
  alias  = "global_region"
  region = "us-east-1"
}

###########
# Variables
###########

variable "custom_domain" {
  description = "Your custom domain"
  type        = string
  default     = "example.com"
}

# Assuming that the ZONE of your domain is already available in your AWS account (Route 53)
# https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html
variable "custom_domain_zone_name" {
  description = "The Route53 zone name of the custom domain"
  type        = string
  default     = "example.com."
}

########
# Locals
########

locals {
  # A wildcard domain(ex: *.example.com) has to be added when using atomic deployments:
  aliases = [var.custom_domain, "*.${var.custom_domain}"]
}

#######################
# Route53 Domain record
#######################

# Get the hosted zone for the custom domain
data "aws_route53_zone" "custom_domain_zone" {
  name = var.custom_domain_zone_name
}

# Create a new record in Route 53 for the domain
resource "aws_route53_record" "cloudfront_alias_domain" {
  for_each = toset(local.aliases)

  zone_id = data.aws_route53_zone.custom_domain_zone.zone_id
  name    = each.key
  type    = "A"

  alias {
    name                   = module.tf_next.cloudfront_domain_name
    zone_id                = module.tf_next.cloudfront_hosted_zone_id
    evaluate_target_health = false
  }
}

##########
# SSL Cert
##########

# Creates a free SSL certificate for CloudFront distribution
# For more options (e.g. multiple domains) see:
# https://registry.terraform.io/modules/terraform-aws-modules/acm/aws/
module "cloudfront_cert" {
  source  = "terraform-aws-modules/acm/aws"
  version = "~> 3.0"

  domain_name               = var.custom_domain
  zone_id                   = data.aws_route53_zone.custom_domain_zone.zone_id
  subject_alternative_names = slice(local.aliases, 1, length(local.aliases))

  wait_for_validation = true

  tags = {
    Name = "CloudFront ${var.custom_domain}"
  }

  # CloudFront works only with certs stored in us-east-1
  providers = {
    aws = aws.global_region
  }
}

##########################
# Terraform Next.js Module
##########################

module "tf_next" {
  source  = "milliHQ/next-js/aws"
  version = "1.0.0-canary.4"

  cloudfront_aliases             = local.aliases
  cloudfront_acm_certificate_arn = module.cloudfront_cert.acm_certificate_arn

  deployment_name = "atomic-deployments"

  enable_multiple_deployments      = true
  multiple_deployments_base_domain = "*.${var.custom_domain}"

  providers = {
    aws.global_region = aws.global_region
  }
}

#########
# Outputs
#########

output "api_endpoint" {
  value = module.tf_next.api_endpoint
}

output "api_endpoint_access_policy_arn" {
  value = module.tf_next.api_endpoint_access_policy_arn
}
```

To create the resources in your AWS account, run the following commands:

```sh
terraform init    # Only needed on the first time running Terraform

terraform plan    # (Optional) See what resources Terraform will create
terraform apply   # Create the resources in your AWS account

> Apply complete!
>
> Outputs:
>
> api_endpoint = "https://<api-id>.execute-api.us-west-2.amazonaws.com"
> api_endpoint_access_policy_arn = "arn:aws:iam::123456789012:policy/access-api"
```

The `api_endpoint` is later used by the CLI tool to create new deployments.

With the `api_endpoint_access_policy_arn` AWS policy you can create new users (and assign that policy) that only can use the CLI tool `tf-next` but cannot access other resources inside of your AWS account.

After the successful deployment your Next.js app is publicly available at the CloudFront subdomain from the `cloudfront_domain_name` output.

### Deploy a Next.js App

For building and deploying Next.js apps to the system we created a CLI tool called [`tf-next`](https://www.npmjs.com/package/tf-next).

It is a npm package that can be installed with:

```sh
npm i -g tf-next@canary
```

Next, we need to build the Next.js so that it can run in a serverless environment (with AWS Lambda).
This is archived by running `tf-next build` in the same directory where your Next.js app is located (Right where your `package.json` or `next.config.js` files are located):

```
tf-next build

> All serverless functions created in: 20.791ms
> 1752924 total bytes
> Build successful!
```

Now deploy the Next.js app by running `tf-next deploy` from the same directory.
The deploy command communicates through a secured (and authenticated with your AWS credentials) API with the Terraform module.

To tell the command where to deploy the app, an additional `--endpoint` flag must be provided, which should use the value from the `api_endpoint` output from the `terraform apply` step:

```
tf-next deploy --endpoint https://<api-id>.execute-api.us-west-2.amazonaws.com

> Available at: https://3edade7a2bf7bb0343699af6b851bbfa.example.com/
```

The preview deployment can now be accessed by the displayed url.  
To make the deployment available from a more readable url, you can use the `tf-next alias` subcommand:

```
tf-next alias set my-app.example.com 3edade7a2bf7bb0343699af6b851bbfa.example.com

> Available at: https://my-app.example.com/
```

For a full list of available commands that can be used with `tf-next`, check the [command reference](https://github.com/milliHQ/terraform-aws-next-js/blob/main/packages/tf-next/README.md).

## Examples

- [Atomic Deployments](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/atomic-deployments)  
  Each deployment gets a unique url from where it can be previewed.
- [Complete](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/complete)  
  Complete example with SSR, API and static pages.
- [Static](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/static)  
  Example that uses static pages only (No SSR).
- [Next Image](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/next-image)  
  Images are optimized on the fly by AWS Lambda.
- [Existing CloudFront](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/with-existing-cloudfront)  
  Use the module together with an existing CloudFront distribution that can be fully customized.
- [Custom Domain](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/with-custom-domain)  
  Use the module with your own domain from Route 53.

<!-- prettier-ignore-start -->
<!--- BEGIN_TF_DOCS --->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 0.15 |
| aws | >= 4.8 |

## Providers

| Name | Version |
|------|---------|
| aws | >= 4.8 |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| cloudfront\_acm\_certificate\_arn | ACM certificate arn for custom\_domain | `string` | `null` | no |
| cloudfront\_aliases | Aliases for custom\_domain | `list(string)` | `[]` | no |
| cloudfront\_cache\_key\_headers | Header keys that should be used to calculate the cache key in CloudFront. | `list(string)` | <pre>[<br>  "Authorization"<br>]</pre> | no |
| cloudfront\_create\_distribution | Controls whether the main CloudFront distribution should be created. | `bool` | `true` | no |
| cloudfront\_external\_arn | When using an external CloudFront distribution provide its arn. | `string` | `null` | no |
| cloudfront\_external\_id | When using an external CloudFront distribution provide its id. | `string` | `null` | no |
| cloudfront\_minimum\_protocol\_version | The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. One of SSLv3, TLSv1, TLSv1\_2016, TLSv1.1\_2016, TLSv1.2\_2018 or TLSv1.2\_2019. | `string` | `"TLSv1"` | no |
| cloudfront\_origin\_request\_policy | Id of a custom request policy that overrides the default policy (AllViewer). Can be custom or managed. | `string` | `null` | no |
| cloudfront\_price\_class | Price class for the CloudFront distributions (main & proxy config). One of PriceClass\_All, PriceClass\_200, PriceClass\_100. | `string` | `"PriceClass_100"` | no |
| cloudfront\_response\_headers\_policy | Id of a response headers policy. Can be custom or managed. Default is empty. | `string` | `null` | no |
| cloudfront\_webacl\_id | An optional webacl2 arn or webacl id to associate with the cloudfront distribution | `string` | `null` | no |
| create\_image\_optimization | Controls whether resources for image optimization support should be created or not. | `bool` | `true` | no |
| debug\_use\_local\_packages | Use locally built packages rather than download them from npm. | `bool` | `false` | no |
| deployment\_name | Identifier for the deployment group (only lowercase alphanumeric characters and hyphens are allowed). | `string` | `"tf-next"` | no |
| enable\_multiple\_deployments | Controls whether it should be possible to run multiple deployments in parallel (requires multiple\_deployments\_base\_domain). | `bool` | `false` | no |
| image\_optimization\_lambda\_memory\_size | Amount of memory in MB the worker Lambda Function for image optimization can use. Valid value between 128 MB to 10,240 MB, in 1 MB increments. | `number` | `2048` | no |
| lambda\_attach\_policy\_json | Whether to deploy additional lambda JSON policies. If false, lambda\_policy\_json will not be attached to the lambda function. (Necessary since policy strings are only known after apply when using Terraforms data.aws\_iam\_policy\_document) | `bool` | `false` | no |
| lambda\_attach\_to\_vpc | Set to true if the Lambda functions should be attached to a VPC. Use this setting if VPC resources should be accessed by the Lambda functions. When setting this to true, use vpc\_security\_group\_ids and vpc\_subnet\_ids to specify the VPC networking. Note that attaching to a VPC would introduce a delay on to cold starts | `bool` | `false` | no |
| lambda\_policy\_json | Additional policy document as JSON to attach to the Lambda Function role | `string` | `null` | no |
| lambda\_role\_permissions\_boundary | ARN of IAM policy that scopes aws\_iam\_role access for the lambda | `string` | `null` | no |
| multiple\_deployments\_base\_domain | Default wildcard domain where new deployments should be available. Should be in the form of *.example.com. | `string` | `null` | no |
| tags | Tag metadata to label AWS resources that support tags. | `map(string)` | `{}` | no |
| tags\_s3\_bucket | Tag metadata to label AWS S3 buckets. Overrides tags with the same name in input variable tags. | `map(string)` | `{}` | no |
| vpc\_security\_group\_ids | The list of Security Group IDs to be used by the Lambda functions. lambda\_attach\_to\_vpc should be set to true for these to be applied. | `list(string)` | `[]` | no |
| vpc\_subnet\_ids | The list of VPC subnet IDs to attach the Lambda functions. lambda\_attach\_to\_vpc should be set to true for these to be applied. | `list(string)` | `[]` | no |

## Outputs

| Name | Description |
|------|-------------|
| api\_endpoint | API endpoint that is used by the CLI. |
| api\_endpoint\_access\_policy\_arn | ARN of the policy that grants access to the API endpoint. |
| cloudfront\_custom\_error\_response | Preconfigured custom error response the CloudFront distribution should use. |
| cloudfront\_default\_cache\_behavior | Preconfigured default cache behavior the CloudFront distribution should use. |
| cloudfront\_default\_root\_object | Preconfigured root object the CloudFront distribution should use. |
| cloudfront\_domain\_name | Domain of the main CloudFront distribution (When created). |
| cloudfront\_hosted\_zone\_id | Zone id of the main CloudFront distribution (When created). |
| cloudfront\_ordered\_cache\_behaviors | Preconfigured ordered cache behaviors the CloudFront distribution should use. |
| cloudfront\_origins | Preconfigured origins the CloudFront distribution should use. |
| upload\_bucket\_id | n/a |

<!--- END_TF_DOCS --->
<!-- prettier-ignore-end -->

## Known issues

Under the hood this module uses a lot of [Vercel's](https://github.com/vercel/vercel/) build pipeline.
So issues that exist on Vercel are likely to occur on this project too.

- Stack deletion (`terraform destroy`) fails on first run ([terraform-provider-aws#1721](https://github.com/hashicorp/terraform-provider-aws/issues/1721))

  This is intentional because we cannot delete a Lambda@Edge function (Used by proxy module) in a synchronous way.
  It can take up to an hour for AWS to unbind a Lambda@Edge function from it's CloudFront distribution even when the distribution is already destroyed.

  **Workaround:**

  After running the initial `terraform destroy` command (that failed) wait ~1 hour and run the command again.
  This time it should run successfully and delete the rest of the stack.

- Initial apply fails with error message `Error: error creating Lambda Event Source Mapping` ([#138](https://github.com/milliHQ/terraform-aws-next-js/issues/138))

  There is some race condition when the permissions are created for the static deployment Lambda.
  This should only happen on the first deployment.

  **Workaround:**

  You should be able to run`terraform apply` again and the stack creation would proceed without this error.

## Contributing

Contributions are welcome!  
If you want to improve this module, please take a look at our [contributing guidelines](https://github.com/milliHQ/terraform-aws-next-js/tree/main/CONTRIBUTING.md) to get started.

## About

This project is maintained by [milliVolt infrastructure](https://milli.is).  
We build custom infrastructure solutions for any cloud provider.

## License

Apache-2.0 - see [LICENSE](./LICENSE) for details.

> **Note:** All sample projects in [`examples/*`](./examples) are licensed as MIT to comply with the official [Next.js examples](https://github.com/vercel/next.js/tree/canary/examples).


================================================
FILE: docker-compose.yml
================================================
################################################################################
# This docker-compose file is only meant for e2e testing packages that
# require an S3 / dynamoDB connection:
# - test/routes.test.ts
# - packages/deploy-trigger
################################################################################

version: '3.6'

services:
  local-s3:
    image: minio/minio
    ports:
      - 9000:9000
    command: server /data
    volumes:
      - s3-data:/data
    env_file:
      - ./test.env

  dynamodb-local:
    image: amazon/dynamodb-local:latest
    ports:
      - "8000:8000"

volumes:
  s3-data:


================================================
FILE: docs/development.md
================================================
# Development

This is a small guide to get started with development of this module.
From time to time I come back to it as well when I forgot something.

## Testing

For local testing make sure that you have the following tools installed on your machine:

- [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/) (Already included in Docker for Mac & Windows)
- [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)

We have 2 kinds of tests:

- **Unit tests**

  Unit tests have mostly no external requirements.
  However some of them (e.g. `deploy-trigger`) need a connection to external services like S3 which is emulated locally by docker containers.
  The unit tests are located at their corresponding packages.

  Before executing any unit tests, you should make sure to start the services from the workspace root:

  ```sh
  docker-compose up -d
  ```

- **e2e tests**

  The e2e tests ensure that real Next.js are bundled and deployed in the right way.
  To do this we have fixture apps in `/test/fixtures/` directory that are builded and then deployed locally in Docker containers via AWS SAM CLI.
  Running e2e tests consist of two steps:

  1. Building the fixtures with `terraform-next-build`:

     ```sh
     yarn test:e2e:prepare
     ```

  2. Run the actual tests

     ```sh
     yarn test:e2e
     ```


================================================
FILE: examples/.gitignore
================================================
*.lock.hcl


================================================
FILE: examples/atomic-deployments/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# Terraform
**/.terraform/*
*.tfstate
*.tfstate.*

# tf-next
/.tf-next/


================================================
FILE: examples/atomic-deployments/LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2022 Felix Haus (milliVolt infrastructure)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================
FILE: examples/atomic-deployments/README.md
================================================
# Atomic Deployments Example

This example shows how to use the atomic deployments feature with the [Next.js Terraform module for AWS](https://registry.terraform.io/modules/milliHQ/next-js/aws).

To learn more about this feature, please see the blog post ["The road to Atomic Deployments"](https://milli.is/blog/the-road-to-atomic-deployments) or watch the release review: [First look at the new atomic deployments feature](https://youtu.be/NY3zKnIcLd4).

## Features

- ✅ &nbsp;Unlimited parallel deployments of Next.js apps served by a single CloudFront distribution
- ✅ &nbsp;Preview deployment subdomains, e.g. `<deployment-id>.example.com`

> **Notice:** You can find the full example code on [GitHub](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/atomic-deployments).

## How to use

> **Cost disclaimer**: All resources that are created in your AWS account are designed to be fully serverless.
> This means it produces **no running costs** until it is actually used (e.g. by deploying a Next.js application or when your app starts receiving requests from the web).
> Most of the resources created are also eligible for the [AWS always free tier](https://aws.amazon.com/free/).
>
> Highest cost factor in this example is the Route 53 hosted zone which can [produce costs of up to $0.50 / month](https://aws.amazon.com/route53/pricing/#Hosted_Zones_and_Records) when creating a new one.

Run [`create-next-app`](https://www.npmjs.com/package/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [yarn](https://classic.yarnpkg.com/en/docs/cli/create/) or [pnpm](https://pnpm.io/cli/create) to bootstrap the example:

```sh
npx create-next-app --example https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/atomic-deployments atomic-deployments
# or
yarn create next-app --example https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/atomic-deployments atomic-deployments
# or
pnpm create next-app --example https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/atomic-deployments atomic-deployments
```

### Terraform setup

Use Terraform to deploy the base system to your AWS account.

Open the `main.tf` file in the root of the Next.js app, and set the custom domain that should be assigned to the CloudFront distribution:

```tf
# main.tf
...

variable "custom_domain" {
  description = "Your custom domain"
  type        = string
  default     = "example.com"
}

variable "custom_domain_zone_name" {
  description = "The Route53 zone name of the custom domain"
  type        = string
  default     = "example.com."
}

...
```

You can change `example.com` to every domain (or subdomain) that is associated with Route 53 in your AWS account.

Then deploy the base system.

```sh
# Expose your AWS Access Keys (administrator) to the current terminal session
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

terraform init    # Only needed on the first time running Terraform

terraform plan    # (Optional) See what resources Terraform will create
terraform apply   # Deploy the base system
```

After the deployment was successful, you should see the following output:

```sh
> Apply complete!
>
> Outputs:
>
> api_endpoint = "https://<api-id>.execute-api.<region>.amazonaws.com"
> api_endpoint_access_policy_arn = "arn:aws:iam::123456789012:policy/access-api"
```

> For deploying your apps in the next step you can optionally [create a new IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html) and assign it the policy that you got from the `api_endpoint_access_policy_arn` output.  
> This is a security feature that prevents a full AWS account access during deployments. It only allows access to the internal API, but not to create, destroy or modify any resources in the AWS account directly.

### Build

First, install the [`tf-next`](https://github.com/milliHQ/terraform-aws-next-js/tree/main/packages/tf-next) CLI by running:

```
npm i -g tf-next@canary
# or
yarn global add tf-next@canary
# or
pnpm add -g tf-next@canary
```

Then prepare your Next.js application for a serverless deployment:

```sh
tf-next build
```

### Deploy

Deploy the previously built Next.js app to your AWS infrastructure. For the `--endpoint` flag use the domain you got from the `api_endpoint` output in the previous [Terraform Setup](#terraform-setup) step.

```sh
tf-next deploy --endpoint https://<api-id>.execute-api.<region>.amazonaws.com

> success Deployment package uploaded.
> success Deployment ready
> Available at: https://<deployment-id>.example.com/ (copied to clipboard)
```

You can now access your Next.js app in the browser at the `https://<deployment-id>.example.com` domain.  
Repeat the [build](#build) & [deploy](#deploy) step for each new app or deployment you want to push to the system.

## Cleanup

To delete all resources from your AWS account that were created in this examples follow this steps:

1. **Cleanup all deployments with the `tf-next` CLI**  
   First, get all active deployments through the CLI

   ```
   tf-next deployment ls

   >   age ▼   deployment-id                      status
   >   5m      59ec3b01f4325c906af8573efe0d75ba   ready
   ```

   Then remove each deployment by its id:

   ```
   tf-next deployment rm 59ec3b01f4325c906af8573efe0d75ba
   ```

   Repeat this until `tf-next deployment ls` shows no more active deployments.

2. **Remove the Terraform module**  
   To remove the deployment system (with it's global resources like CloudFront, S3 etc.) that were created with Terraform:

   ```
   terraform destroy
   ```

   > **Note:** The destroy command could fail on the first execution since [Lambda@Edge functions cannot be deleted in a synchronous way](https://github.com/hashicorp/terraform-provider-aws/issues/1721). You can workaround this by simply wait ~30 minutes and then run `terraform destroy` again.


================================================
FILE: examples/atomic-deployments/main.tf
================================================
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

# Main region where the resources should be created in
# Should be close to the location of your viewers
provider "aws" {
  region = "us-west-2"
}

# Provider used for creating the Lambda@Edge function which must be deployed
# to us-east-1 region (Should not be changed)
provider "aws" {
  alias  = "global_region"
  region = "us-east-1"
}

###########
# Variables
###########

variable "custom_domain" {
  description = "Your custom domain"
  type        = string
  default     = "example.com"
}

# Assuming that the ZONE of your domain is already available in your AWS account (Route 53)
# https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html
variable "custom_domain_zone_name" {
  description = "The Route53 zone name of the custom domain"
  type        = string
  default     = "example.com."
}

########
# Locals
########

locals {
  # A wildcard domain(ex: *.example.com) has to be added when using atomic deployments:
  aliases = [var.custom_domain, "*.${var.custom_domain}"]
}

#######################
# Route53 Domain record
#######################

# Get the hosted zone for the custom domain
data "aws_route53_zone" "custom_domain_zone" {
  name = var.custom_domain_zone_name
}

# Create a new record in Route 53 for the domain
resource "aws_route53_record" "cloudfront_alias_domain" {
  for_each = toset(local.aliases)

  zone_id = data.aws_route53_zone.custom_domain_zone.zone_id
  name    = each.key
  type    = "A"

  alias {
    name                   = module.tf_next.cloudfront_domain_name
    zone_id                = module.tf_next.cloudfront_hosted_zone_id
    evaluate_target_health = false
  }
}

##########
# SSL Cert
##########

# Creates a free SSL certificate for CloudFront distribution
# For more options (e.g. multiple domains) see:
# https://registry.terraform.io/modules/terraform-aws-modules/acm/aws/
module "cloudfront_cert" {
  source  = "terraform-aws-modules/acm/aws"
  version = "~> 3.0"

  domain_name               = var.custom_domain
  zone_id                   = data.aws_route53_zone.custom_domain_zone.zone_id
  subject_alternative_names = slice(local.aliases, 1, length(local.aliases))

  wait_for_validation = true

  tags = {
    Name = "CloudFront ${var.custom_domain}"
  }

  # CloudFront works only with certs stored in us-east-1
  providers = {
    aws = aws.global_region
  }
}

##########################
# Terraform Next.js Module
##########################

module "tf_next" {
  source  = "milliHQ/next-js/aws"
  version = "1.0.0-canary.5"

  cloudfront_aliases             = local.aliases
  cloudfront_acm_certificate_arn = module.cloudfront_cert.acm_certificate_arn

  deployment_name = "atomic-deployments"

  enable_multiple_deployments      = true
  multiple_deployments_base_domain = "*.${var.custom_domain}"

  providers = {
    aws.global_region = aws.global_region
  }

  # Uncomment when using in the cloned monorepo for tf-next development
  # source = "../.."
  # debug_use_local_packages = true
}

#########
# Outputs
#########

output "api_endpoint" {
  value = module.tf_next.api_endpoint
}

output "api_endpoint_access_policy_arn" {
  value = module.tf_next.api_endpoint_access_policy_arn
}


================================================
FILE: examples/atomic-deployments/package.json
================================================
{
  "name": "terraform-next-js-example-custom-domain",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "next",
    "build": "next build",
    "tf-next": "tf-next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "latest",
    "react": "latest",
    "react-dom": "latest"
  },
  "devDependencies": {
    "tf-next": "canary"
  },
  "license": "MIT"
}


================================================
FILE: examples/atomic-deployments/pages/index.js
================================================
export default function IndexPage() {
  return (
    <div>
      <h1>Custom domain example</h1>
    </div>
  );
}


================================================
FILE: examples/complete/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# Terraform
**/.terraform/*
*.tfstate
*.tfstate.*

# tf-next
/.tf-next/


================================================
FILE: examples/complete/LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2020 Felix Haus (milliVolt infrastructure)
Copyright (c) 2020 Vercel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================
FILE: examples/complete/README.md
================================================
# Terraform Next.js complete example

> **Warning:** This example is not fully updated for the upcoming `v1.0.0` release.  
> We recommend following the [Atomic Deployments Example](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/atomic-deployments) instead until this example gets an update.

This example contains a fully featured Next.js app (Static files, API-Routes, SSR) that can be deployed using the [Terraform Next.js for AWS](https://registry.terraform.io/modules/milliHQ/next-js/aws) module.

> **Notice:** You can find the full example code on [GitHub](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/complete).

## Setup

Download the files from the example app:

```sh
yarn create next-app --example https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/complete my-app

cd my-app
```

## Build

Prepare the Next.js application to be deployed with Terraform:

```sh
yarn tf-next
```

## Deploy

Use Terraform to deploy the Next.js app to your AWS account:

```sh
# Expose your AWS Access Keys to the current terminal session
# Only needed when running Terraform commands
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

terraform init    # Only needed on the first time running Terraform

terraform plan    # (Optional) See what resources Terraform will create
terraform apply   # Deploy the Next.js app to your AWS account
```

After the deployment was successful, you should see the following output:

```sh
> Apply complete!
>
> Outputs:
>
> cloudfront_domain_name = "<distribution-id>.cloudfront.net"
```

You can now access your Next.js app in the browser under the [https://&lt;distribution-id&gt;.cloudfront.net](https://<distribution-id>.cloudfront.net) domain.


================================================
FILE: examples/complete/components/header.js
================================================
import * as React from 'react';
import Link from 'next/link';

export const Header = () => {
  return (
    <header>
      <nav>
        <Link href="/">
          <a>Home</a>
        </Link>
        <Link href="/test/[...slug]" as={`/test/a/b/c`}>
          <a>Slug Test</a>
        </Link>
        <Link href="/about">
          <a>About</a>
        </Link>
      </nav>
      <style jsx>{`
        nav {
          display: flex;
        }
        a {
          font-size: 14px;
          margin-right: 15px;
          text-decoration: none;
        }
        .is-active {
          text-decoration: underline;
        }
      `}</style>
    </header>
  );
};


================================================
FILE: examples/complete/main.tf
================================================
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

# Main region where the resources should be created in
# Should be close to the location of your viewers
provider "aws" {
  region = "us-west-2"
}

# Provider used for creating the Lambda@Edge function which must be deployed
# to us-east-1 region (Should not be changed)
provider "aws" {
  alias  = "global_region"
  region = "us-east-1"
}

module "tf_next" {
  source  = "milliHQ/next-js/aws"
  version = "1.0.0-canary.5"

  deployment_name = "tf-next-example-complete"

  providers = {
    aws.global_region = aws.global_region
  }

  # Uncomment when using in the cloned monorepo for tf-next development
  # source = "../.."
  # debug_use_local_packages = true
}

output "cloudfront_domain_name" {
  value = module.tf_next.cloudfront_domain_name
}


================================================
FILE: examples/complete/next.config.js
================================================
module.exports = {
  async rewrites() {
    return [
      {
        source: '/robots.txt',
        destination: '/api/robots',
      },
    ];
  },

  async redirects() {
    return [
      {
        source: '/blog/:slug*',
        destination: '/test/:slug*', // Matched parameters can be used in the destination
        permanent: true,
      },
    ];
  },
};


================================================
FILE: examples/complete/package.json
================================================
{
  "name": "terraform-next-js-example-complete",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "next",
    "build": "next build",
    "tf-next": "tf-next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "latest",
    "react": "latest",
    "react-dom": "latest"
  },
  "devDependencies": {
    "tf-next": "latest"
  },
  "license": "MIT"
}


================================================
FILE: examples/complete/pages/about.js
================================================
import { Header } from '../components/header';

export default function About() {
  return (
    <div>
      <Header />
      <h2>About us</h2>
    </div>
  );
}


================================================
FILE: examples/complete/pages/api/robots.js
================================================
const content = `# Example robots.txt

User-agent: *
Allow: /

Sitemap: http://www.example.com/sitemap.xml`;

const RobotsHandler = (_req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end(content);
};

export default RobotsHandler;


================================================
FILE: examples/complete/pages/index.js
================================================
import { useRouter } from 'next/router';
import { format } from 'url';

import { Header } from '../components/header';

let counter = 0;

export async function getServerSideProps() {
  counter++;
  return { props: { initialPropsCounter: counter } };
}

export default function Index({ initialPropsCounter }) {
  const router = useRouter();
  const { pathname, query } = router;
  const reload = () => {
    router.push(format({ pathname, query }));
  };
  const incrementCounter = () => {
    const currentCounter = query.counter ? parseInt(query.counter) : 0;
    const href = `/?counter=${currentCounter + 1}`;

    router.push(href, href, { shallow: true });
  };

  return (
    <div>
      <Header />

      <h2>This is the Home Page</h2>

      <button onClick={reload}>Reload</button>
      <button onClick={incrementCounter}>Change State Counter</button>
      <p>"getServerSideProps" ran for "{initialPropsCounter}" times.</p>
      <p>Counter: "{query.counter || 0}".</p>
    </div>
  );
}


================================================
FILE: examples/complete/pages/test/[...slug].js
================================================
import { useRouter } from 'next/router';
import Link from 'next/link';
import { format } from 'url';

import { Header } from '../../components/header';

let counter = 0;

export async function getServerSideProps(ctx) {
  counter++;
  return {
    props: {
      params: ctx.params,
      query: ctx.query,
      slug: ctx.query && ctx.query.slug,
      initialPropsCounter: counter,
    },
  };
}

export default function Index({
  initialPropsCounter,
  slug,
  params,
  query: serverQuery,
}) {
  const router = useRouter();
  const { pathname, query } = router;

  const reload = () => {
    router.push(format({ pathname, query }));
  };
  const incrementCounter = () => {
    const currentCounter = query.counter ? parseInt(query.counter) : 0;
    const href = `/?counter=${currentCounter + 1}`;

    router.push(href, href, { shallow: true });
  };

  return (
    <div>
      <Header />

      <h2>This is the Home Page</h2>
      <Link href="/about">
        <a>About</a>
      </Link>
      <button onClick={reload}>Reload</button>
      <pre>Server: {JSON.stringify(slug)}</pre>
      <pre>Client: {JSON.stringify(query.slug)}</pre>

      <pre>Params: {JSON.stringify(params)}</pre>
      <pre>Query: {JSON.stringify(serverQuery)}</pre>
      <button onClick={incrementCounter}>Change State Counter</button>
      <p>"getServerSideProps" ran for "{initialPropsCounter}" times.</p>
      <p>Counter: "{query.counter || 0}".</p>
    </div>
  );
}


================================================
FILE: examples/next-image/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# Terraform
**/.terraform/*
*.tfstate
*.tfstate.*

# tf-next
/.tf-next/


================================================
FILE: examples/next-image/LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2021 Felix Haus (milliVolt infrastructure)
Copyright (c) 2021 Vercel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================
FILE: examples/next-image/README.md
================================================
# Terraform Next.js Image component example

> **Warning:** This example is not fully updated for the upcoming `v1.0.0` release.  
> We recommend following the [Atomic Deployments Example](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/atomic-deployments) instead until this example gets an update.

This example shows the usage of Next.js together with the `next/image` component.
You can find the full example code on [GitHub](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/next-image).

> **Note:** Support for `next/image` component is enabled in the Terraform Next.js module by default and requires no extra config other than the standard setup!

## Setup

Download the files from the example app:

```sh
yarn create next-app --example https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/next-image my-app

cd my-app
```

## Build

Prepare the Next.js application to be deployed with Terraform:

```sh
yarn tf-next
```

## Deploy

Use Terraform to deploy the Next.js app to your AWS account:

```sh
# Expose your AWS Access Keys to the current terminal session
# Only needed when running Terraform commands
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

terraform init    # Only needed on the first time running Terraform

terraform plan    # (Optional) See what resources Terraform will create
terraform apply   # Deploy the Next.js app to your AWS account
```

After the deployment was successful, you should see the following output:

```sh
> Apply complete!
>
> Outputs:
>
> cloudfront_domain_name = "<distribution-id>.cloudfront.net"
```

You can now access your Next.js app in the browser under the [https://&lt;distribution-id&gt;.cloudfront.net](https://<distribution-id>.cloudfront.net) domain.


================================================
FILE: examples/next-image/app.css
================================================
body {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  background: black;
  color: white;
}

a {
  cursor: pointer;
  color: #0076ff;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid black;
}

a:hover {
  border-bottom: 1px solid #0076ff;
}


================================================
FILE: examples/next-image/components/view-source.js
================================================
import { svg, arm } from './view-source.module.css'

const ViewSource = ({ pathname }) => (
  <svg
    xmlns="http://www.w3.org/2000/svg"
    width="80"
    height="80"
    viewBox="0 0 250 250"
    fill="#151513"
    className={svg}
  >
    <a
      title="View Source"
      href={`https://github.com/vercel/next.js/tree/canary/examples/image-component/${pathname}`}
    >
      <path d="M0 0l115 115h15l12 27 108 108V0z" fill="#fff" />
      <path
        className={arm}
        d="M128 109c-15-9-9-19-9-19 3-7 2-11 2-11-1-7 3-2 3-2 4 5 2 11 2 11-3 10 5 15 9 16"
      />
      <path d="M115 115s4 2 5 0l14-14c3-2 6-3 8-3-8-11-15-24 2-41 5-5 10-7 16-7 1-2 3-7 12-11 0 0 5 3 7 16 4 2 8 5 12 9s7 8 9 12c14 3 17 7 17 7-4 8-9 11-11 11 0 6-2 11-7 16-16 16-30 10-41 2 0 3-1 7-5 11l-12 11c-1 1 1 5 1 5z" />
    </a>
  </svg>
)

export default ViewSource


================================================
FILE: examples/next-image/components/view-source.module.css
================================================
.svg {
  position: absolute;
  top: 0;
  right: 0;
}
.arm {
  transform-origin: 130px 106px;
}

.svg:hover .arm {
  animation: wave 560ms ease-in-out;
}

@keyframes wave {
  0% {
    transform: rotate(0deg);
  }

  20% {
    transform: rotate(-25deg);
  }

  40% {
    transform: rotate(10deg);
  }

  60% {
    transform: rotate(-25deg);
  }

  80% {
    transform: rotate(10deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

@media (max-width: 500px) {
  .svg:hover .arm {
    animation: none;
  }

  .svg:hover .arm {
    animation: wave 560ms ease-in-out;
  }
}


================================================
FILE: examples/next-image/main.tf
================================================
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

# Main region where the resources should be created in
# Should be close to the location of your viewers
provider "aws" {
  region = "us-west-2"
}

# Provider used for creating the Lambda@Edge function which must be deployed
# to us-east-1 region (Should not be changed)
provider "aws" {
  alias  = "global_region"
  region = "us-east-1"
}

module "tf_next" {
  source  = "milliHQ/next-js/aws"
  version = "1.0.0-canary.5"

  deployment_name = "tf-next-example-image"

  providers = {
    aws.global_region = aws.global_region
  }

  # Uncomment when using in the cloned monorepo for tf-next development
  # source = "../.."
  # debug_use_local_packages = true
}

output "cloudfront_domain_name" {
  value = module.tf_next.cloudfront_domain_name
}


================================================
FILE: examples/next-image/next.config.js
================================================
module.exports = {
  images: {
    domains: ['assets.vercel.com'],
  },
}


================================================
FILE: examples/next-image/package.json
================================================
{
  "name": "tf-next-example-next-image",
  "version": "1.0.0",
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "tf-next": "tf-next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "latest",
    "react": "latest",
    "react-dom": "latest"
  },
  "devDependencies": {
    "tf-next": "latest"
  },
  "license": "MIT"
}


================================================
FILE: examples/next-image/pages/_app.js
================================================
import '../app.css'

export default function MyApp({ Component, pageProps }) {
  return <Component {...pageProps} />
}


================================================
FILE: examples/next-image/pages/background.js
================================================
import Image from 'next/image'
import ViewSource from '../components/view-source'
import { bgWrap, bgText } from '../styles.module.css'

const Background = () => (
  <div>
    <ViewSource pathname="pages/background.js" />
    <div className={bgWrap}>
      <Image
        alt="Mountains"
        src="/mountains.jpg"
        layout="fill"
        objectFit="cover"
        quality={100}
      />
    </div>
    <p className={bgText}>
      Image Component
      <br />
      as a Background
    </p>
  </div>
)

export default Background


================================================
FILE: examples/next-image/pages/index.js
================================================
import styles from '../styles.module.css'
import Image from 'next/image'
import Link from 'next/link'
import ViewSource from '../components/view-source'

const Code = (p) => <code className={styles.inlineCode} {...p} />

const Index = () => (
  <div className={styles.container}>
    <ViewSource pathname="pages/index.js" />
    <div className={styles.card}>
      <h1>Image Component with Next.js</h1>
      <p>
        This page demonstrates the usage of the{' '}
        <a href="https://nextjs.org/docs/api-reference/next/image">
          next/image
        </a>{' '}
        component with live examples.
      </p>
      <p>
        This component is designed to{' '}
        <a href="https://nextjs.org/docs/basic-features/image-optimization">
          automatically optimizate
        </a>{' '}
        images on-demand as the browser requests them.
      </p>
      <hr className={styles.hr} />
      <h2 id="layout">Layout</h2>
      <p>
        The <Code>layout</Code> property tells the image to respond differently
        depending on the device size or the container size.
      </p>
      <p>
        Select a layout below and try resizing the window or rotating your
        device to see how the image reacts.
      </p>
      <ul>
        <li>
          <Link href="/layout-intrinsic">
            <a>layout="intrinsic"</a>
          </Link>
        </li>
        <li>
          <Link href="/layout-responsive">
            <a>layout="responsive"</a>
          </Link>
        </li>
        <li>
          <Link href="/layout-fixed">
            <a>layout="fixed"</a>
          </Link>
        </li>
        <li>
          <Link href="/layout-fill">
            <a>layout="fill"</a>
          </Link>
        </li>
        <li>
          <Link href="/background">
            <a>background demo</a>
          </Link>
        </li>
      </ul>
      <hr className={styles.hr} />
      <h2 id="internal">Internal Image</h2>
      <p>
        The following is an example of a reference to an interal image from the{' '}
        <Code>public</Code> directory.
      </p>
      <p>
        This image is intentionally large so you have to scroll down to the next
        image.
      </p>
      <Image alt="Vercel logo" src="/vercel.png" width={1000} height={1000} />
      <hr className={styles.hr} />
      <h2 id="external">External Image</h2>
      <p>
        The following is an example of a reference to an external image at{' '}
        <Code>assets.vercel.com</Code>.
      </p>
      <p>
        External domains must be configured in <Code>next.config.js</Code> using
        the <Code>domains</Code> property.
      </p>
      <Image
        alt="Next.js logo"
        src="https://assets.vercel.com/image/upload/v1538361091/repositories/next-js/next-js-bg.png"
        width={1200}
        height={400}
      />
      <hr className={styles.hr} />
      <h2 id="more">Learn More</h2>
      <p>
        You can optionally configure a cloud provider, device sizes, and more!
      </p>
      <p>
        Checkout the{' '}
        <a href="https://nextjs.org/docs/basic-features/image-optimization">
          Image Optimization documentation
        </a>{' '}
        to learn more.
      </p>
    </div>
  </div>
)

export default Index


================================================
FILE: examples/next-image/pages/layout-fill.js
================================================
import Image from 'next/image'
import ViewSource from '../components/view-source'

const Fill = () => (
  <div>
    <ViewSource pathname="pages/layout-fill.js" />
    <h1>Image Component With Layout Fill</h1>
    <div style={{ position: 'relative', width: '300px', height: '500px' }}>
      <Image
        alt="Mountains"
        src="/mountains.jpg"
        layout="fill"
        objectFit="cover"
      />
    </div>
    <div style={{ position: 'relative', width: '300px', height: '500px' }}>
      <Image
        alt="Mountains"
        src="/mountains.jpg"
        layout="fill"
        objectFit="contain"
      />
    </div>
    <div style={{ position: 'relative', width: '300px', height: '500px' }}>
      <Image
        alt="Mountains"
        src="/mountains.jpg"
        layout="fill"
        objectFit="none"
        quality={100}
      />
    </div>
  </div>
)

export default Fill


================================================
FILE: examples/next-image/pages/layout-fixed.js
================================================
import Image from 'next/image'
import ViewSource from '../components/view-source'

const Fixed = () => (
  <div>
    <ViewSource pathname="pages/layout-fixed.js" />
    <h1>Image Component With Layout Fixed</h1>
    <Image
      alt="Mountains"
      src="/mountains.jpg"
      layout="fixed"
      width={700}
      height={475}
    />
  </div>
)

export default Fixed


================================================
FILE: examples/next-image/pages/layout-intrinsic.js
================================================
import Image from 'next/image'
import ViewSource from '../components/view-source'

const Intrinsic = () => (
  <div>
    <ViewSource pathname="pages/layout-intrinsic.js" />
    <h1>Image Component With Layout Intrinsic</h1>
    <Image
      alt="Mountains"
      src="/mountains.jpg"
      layout="intrinsic"
      width={700}
      height={475}
    />
  </div>
)

export default Intrinsic


================================================
FILE: examples/next-image/pages/layout-responsive.js
================================================
import Image from 'next/image'
import ViewSource from '../components/view-source'

const Responsive = () => (
  <div>
    <ViewSource pathname="pages/layout-responsive.js" />
    <h1>Image Component With Layout Responsive</h1>
    <Image
      alt="Mountains"
      src="/mountains.jpg"
      layout="responsive"
      width={700}
      height={475}
    />
  </div>
)

export default Responsive


================================================
FILE: examples/next-image/styles.module.css
================================================
.container {
  padding: 4rem 1rem;
}

.container p {
  margin: 1.5rem 0;
}

.card {
  max-width: 60rem;
  box-shadow: -10px 10px 80px rgba(255, 255, 255, 0.1);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 2rem;
  margin: 0 auto;
}

.inlineCode {
  color: #be00ff;
  font-size: 16px;
  white-space: pre-wrap;
}

.inlineCode::before,
.inlineCode::after {
  content: '`';
}

.hr {
  border: 0;
  border-top: 1px solid #333;
  margin: 1.5rem 0;
}

.bgWrap {
  position: fixed;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  z-index: -1;
}

.bgText {
  margin: 0;
  font-size: 2rem;
  line-height: 3rem;
  text-align: center;
  padding-top: 40vh;
  text-shadow: 1px 1px 1px #3c5c5e;
}


================================================
FILE: examples/static/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# Terraform
**/.terraform/*
*.tfstate
*.tfstate.*

# tf-next
/.tf-next/


================================================
FILE: examples/static/LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2020 Felix Haus (milliVolt infrastructure)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================
FILE: examples/static/README.md
================================================
# Terraform Next.js static example

> **Warning:** This example is not fully updated for the upcoming `v1.0.0` release.  
> We recommend following the [Atomic Deployments Example](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/atomic-deployments) instead until this example gets an update.

This example shows a simple static Next.js app that is deployed to S3 without lambdas using the [Terraform Next.js for AWS](https://registry.terraform.io/modules/milliHQ/next-js/aws) module.

You can find the full example code on [GitHub](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/static).

## Setup

Download the files from the example app:

```sh
yarn create next-app --example https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/static my-app

cd my-app
```

## Build

Prepare the Next.js application to be deployed with Terraform:

```sh
yarn tf-next
```

## Deploy

Use Terraform to deploy the Next.js app to your AWS account:

```sh
# Expose your AWS Access Keys to the current terminal session
# Only needed when running Terraform commands
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

terraform init    # Only needed on the first time running Terraform

terraform plan    # (Optional) See what resources Terraform will create
terraform apply   # Deploy the Next.js app to your AWS account
```

After the deployment was successful, you should see the following output:

```sh
> Apply complete!
>
> Outputs:
>
> cloudfront_domain_name = "<distribution-id>.cloudfront.net"
```

You can now access your Next.js app in the browser under the [https://&lt;distribution-id&gt;.cloudfront.net](https://<distribution-id>.cloudfront.net) domain.


================================================
FILE: examples/static/main.tf
================================================
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

# Main region where the resources should be created in
# Should be close to the location of your viewers
provider "aws" {
  region = "us-west-2"
}

# Provider used for creating the Lambda@Edge function which must be deployed
# to us-east-1 region (Should not be changed)
provider "aws" {
  alias  = "global_region"
  region = "us-east-1"
}

module "tf_next" {
  source  = "milliHQ/next-js/aws"
  version = "1.0.0-canary.5"

  deployment_name = "tf-next-example-static"

  providers = {
    aws.global_region = aws.global_region
  }

  # Uncomment when using in the cloned monorepo for tf-next development
  # source = "../.."
  # debug_use_local_packages = true
}

output "cloudfront_domain_name" {
  value = module.tf_next.cloudfront_domain_name
}


================================================
FILE: examples/static/package.json
================================================
{
  "name": "terraform-next-js-example-static",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "next",
    "build": "next build",
    "tf-next": "tf-next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "latest",
    "react": "latest",
    "react-dom": "latest"
  },
  "devDependencies": {
    "tf-next": "latest"
  },
  "license": "MIT"
}


================================================
FILE: examples/static/pages/about.js
================================================
export default function AboutPage() {
  return (
    <div>
      <h1>About</h1>
    </div>
  );
}


================================================
FILE: examples/static/pages/blog/index.js
================================================
export default function BlogPage() {
  return (
    <div>
      <h1>Blog</h1>
    </div>
  );
}


================================================
FILE: examples/static/pages/index.js
================================================
export default function IndexPage() {
  return (
    <div>
      <h1>Home</h1>
    </div>
  );
}


================================================
FILE: examples/with-custom-domain/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# Terraform
**/.terraform/*
*.tfstate
*.tfstate.*

# tf-next
/.tf-next/


================================================
FILE: examples/with-custom-domain/LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2020 Felix Haus (milliVolt infrastructure)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================
FILE: examples/with-custom-domain/README.md
================================================
# Terraform Next.js custom domain example

> **Warning:** This example is not fully updated for the upcoming `v1.0.0` release.  
> We recommend following the [Atomic Deployments Example](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/atomic-deployments) instead until this example gets an update.

This example shows how to use a custom domain with the [Next.js Terraform module for AWS](https://registry.terraform.io/modules/milliHQ/next-js/aws).

## Features

- Creates a new domain record in Route53
- Provisions a free SSL certificate from the AWS Certificate Manager for the domain
- Assigns the domain and the SSL certificate to the CloudFront distribution

> **Note:** You can find the full example code on [GitHub](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/with-custom-domain).

## Setup

Download the files from the example app:

```sh
yarn create next-app --example https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/with-custom-domain my-app

cd my-app
```

## Build

Prepare the Next.js application to be deployed with Terraform:

```sh
yarn tf-next
```

## Setting the domain

Open the `main.tf` file in the root of the Next.js app, and set the custom domain that should be assigned to the CloudFront distribution:

```tf
# main.tf
...

variable "custom_domain" {
  description = "Your custom domain"
  type        = string
  default     = "example.com"
}

variable "custom_domain_zone_name" {
  description = "The Route53 zone name of the custom domain"
  type        = string
  default     = "example.com."
}

...
```

You can change `example.com` to every domain (or subdomain) that is associated with Route 53 in your AWS account.

## Deploy

Use Terraform to deploy the Next.js app to your AWS account:

```sh
# Expose your AWS Access Keys to the current terminal session
# Only needed when running Terraform commands
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

terraform init    # Only needed on the first time running Terraform

terraform plan    # (Optional) See what resources Terraform will create
terraform apply   # Deploy the Next.js app to your AWS account
```

After the deployment was successful, you should see the following output:

```sh
> Apply complete!
>
> Outputs:
>
> cloudfront_domain_name = "<distribution-id>.cloudfront.net"
> custom_domain_name     = "example.com"
```

You can now access your Next.js app in the browser under the [example.com](https://example.com) or [https://&lt;distribution-id&gt;.cloudfront.net](https://<distribution-id>.cloudfront.net) domain.


================================================
FILE: examples/with-custom-domain/main.tf
================================================
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

# Main region where the resources should be created in
# Should be close to the location of your viewers
provider "aws" {
  region = "us-west-2"
}

# Provider used for creating the Lambda@Edge function which must be deployed
# to us-east-1 region (Should not be changed)
provider "aws" {
  alias  = "global_region"
  region = "us-east-1"
}

###########
# Variables
###########

variable "custom_domain" {
  description = "Your custom domain"
  type        = string
  default     = "example.com"
}

# Assuming that the ZONE of your domain is already registrated in your AWS account (Route 53)
# https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html
variable "custom_domain_zone_name" {
  description = "The Route53 zone name of the custom domain"
  type        = string
  default     = "example.com."
}

###########
# Locals
###########

locals {
  aliases = [var.custom_domain]
  # If you need a wildcard domain(ex: *.example.com), you can add it like this:
  # aliases = [var.custom_domain, "*.${var.custom_domain}"]
}

#######################
# Route53 Domain record
#######################

# Get the hosted zone for the custom domain
data "aws_route53_zone" "custom_domain_zone" {
  name = var.custom_domain_zone_name
}

# Create a new record in Route 53 for the domain
resource "aws_route53_record" "cloudfront_alias_domain" {
  for_each = toset(local.aliases)

  zone_id = data.aws_route53_zone.custom_domain_zone.zone_id
  name    = each.key
  type    = "A"

  alias {
    name                   = module.tf_next.cloudfront_domain_name
    zone_id                = module.tf_next.cloudfront_hosted_zone_id
    evaluate_target_health = false
  }
}

##########
# SSL Cert
##########

# Creates a free SSL certificate for CloudFront distribution
# For more options (e.g. multiple domains) see:
# https://registry.terraform.io/modules/terraform-aws-modules/acm/aws/
module "cloudfront_cert" {
  source  = "terraform-aws-modules/acm/aws"
  version = "~> 3.0"

  domain_name               = var.custom_domain
  zone_id                   = data.aws_route53_zone.custom_domain_zone.zone_id
  subject_alternative_names = slice(local.aliases, 1, length(local.aliases))

  tags = {
    Name = "CloudFront ${var.custom_domain}"
  }

  # CloudFront works only with certs stored in us-east-1
  providers = {
    aws = aws.global_region
  }
}

##########################
# Terraform Next.js Module
##########################

module "tf_next" {
  source  = "milliHQ/next-js/aws"
  version = "1.0.0-canary.5"

  cloudfront_aliases             = local.aliases
  cloudfront_acm_certificate_arn = module.cloudfront_cert.acm_certificate_arn

  deployment_name = "tf-next-example-custom-domain"
  providers = {
    aws.global_region = aws.global_region
  }

  # Uncomment when using in the cloned monorepo for tf-next development
  # source = "../.."
  # debug_use_local_packages = true
}

#########
# Outputs
#########

output "cloudfront_domain_name" {
  value = module.tf_next.cloudfront_domain_name
}

output "custom_domain_name" {
  value = var.custom_domain
}


================================================
FILE: examples/with-custom-domain/package.json
================================================
{
  "name": "terraform-next-js-example-custom-domain",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "next",
    "build": "next build",
    "tf-next": "tf-next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "latest",
    "react": "latest",
    "react-dom": "latest"
  },
  "devDependencies": {
    "tf-next": "latest"
  },
  "license": "MIT"
}


================================================
FILE: examples/with-custom-domain/pages/index.js
================================================
export default function IndexPage() {
  return (
    <div>
      <h1>Custom domain example</h1>
    </div>
  );
}


================================================
FILE: examples/with-existing-cloudfront/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# Terraform
**/.terraform/*
*.tfstate
*.tfstate.*

# tf-next
/.tf-next/


================================================
FILE: examples/with-existing-cloudfront/LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2021 Felix Haus (milliVolt infrastructure)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================
FILE: examples/with-existing-cloudfront/README.md
================================================
# Example with existing CloudFront distribution

> **Warning:** This example is not fully updated for the upcoming `v1.0.0` release.  
> We recommend following the [Atomic Deployments Example](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/atomic-deployments) instead until this example gets an update.

This example shows how to integrate the Terraform Next.js module for AWS into an existing CloudFront distribution (Without creating a new one).

> **Note:** The full example code is available on [GitHub](https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/with-existing-cloudfront)

## Setup

Download the files from the example app:

```sh
yarn create next-app --example https://github.com/milliHQ/terraform-aws-next-js/tree/main/examples/with-existing-cloudfront my-app

cd my-app
```

## Build

Prepare the Next.js application to be deployed with Terraform:

```sh
yarn tf-next
```

## Deploy

Use Terraform to deploy the Next.js app to your AWS account:

```sh
# Expose your AWS Access Keys to the current terminal session
# Only needed when running Terraform commands
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

terraform init    # Only needed on the first time running Terraform

terraform plan    # (Optional) See what resources Terraform will create
terraform apply   # Deploy the Next.js app to your AWS account
```

After the deployment was successful, you should see the following output:

```sh
> Apply complete!
>
> Outputs:
>
> cloudfront_domain_name = "<distribution-id>.cloudfront.net"
```

You can now access your Next.js app in the browser under the [https://&lt;distribution-id&gt;.cloudfront.net](https://<distribution-id>.cloudfront.net) domain.


================================================
FILE: examples/with-existing-cloudfront/main.tf
================================================
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

# Main region where the resources should be created in
# Should be close to the location of your viewers
provider "aws" {
  region = "us-west-2"
}

# Provider used for creating the Lambda@Edge function which must be deployed
# to us-east-1 region (Should not be changed)
provider "aws" {
  alias  = "global_region"
  region = "us-east-1"
}

##########################
# Terraform Next.js Module
##########################

module "tf_next" {
  source  = "milliHQ/next-js/aws"
  version = "1.0.0-canary.5"

  # Prevent creation of the main CloudFront distribution
  cloudfront_create_distribution = false
  cloudfront_external_id         = aws_cloudfront_distribution.distribution.id
  cloudfront_external_arn        = aws_cloudfront_distribution.distribution.arn

  deployment_name = "tf-next-existing-cloudfront"

  providers = {
    aws.global_region = aws.global_region
  }

  # Uncomment when using in the cloned monorepo for tf-next development
  # source = "../.."
  # debug_use_local_packages = true
}

##################################
# Existing CloudFront distribution
##################################
# You can fully customize all the settings of the CloudFront distribution
# as described in the AWS Provider documentation:
# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_distribution

resource "aws_cloudfront_distribution" "distribution" {
  enabled             = true
  is_ipv6_enabled     = true
  comment             = "next-image-optimizer-example-external-cf"
  default_root_object = module.tf_next.cloudfront_default_root_object

  # Default cache behavior
  ########################
  # Inserts the preconfigured default cache behavior from the tf-next module
  # No manual edits should be neccessary here
  dynamic "default_cache_behavior" {
    for_each = module.tf_next.cloudfront_default_cache_behavior

    content {
      allowed_methods  = default_cache_behavior.value["allowed_methods"]
      cached_methods   = default_cache_behavior.value["cached_methods"]
      target_origin_id = default_cache_behavior.value["target_origin_id"]

      viewer_protocol_policy = default_cache_behavior.value["viewer_protocol_policy"]
      compress               = default_cache_behavior.value["compress"]

      origin_request_policy_id = default_cache_behavior.value["origin_request_policy_id"]
      cache_policy_id          = default_cache_behavior.value["cache_policy_id"]

      dynamic "lambda_function_association" {
        for_each = [default_cache_behavior.value["lambda_function_association"]]

        content {
          event_type   = lambda_function_association.value["event_type"]
          lambda_arn   = lambda_function_association.value["lambda_arn"]
          include_body = lambda_function_association.value["include_body"]
        }
      }
    }
  }

  # Ordered cache behaviors
  #########################
  # Inserts the preconfigured ordered cache behaviors from the tf-next module
  # No manual edits should be neccessary here
  dynamic "ordered_cache_behavior" {
    for_each = module.tf_next.cloudfront_ordered_cache_behaviors

    content {
      path_pattern     = ordered_cache_behavior.value["path_pattern"]
      allowed_methods  = ordered_cache_behavior.value["allowed_methods"]
      cached_methods   = ordered_cache_behavior.value["cached_methods"]
      target_origin_id = ordered_cache_behavior.value["target_origin_id"]

      compress               = ordered_cache_behavior.value["compress"]
      viewer_protocol_policy = ordered_cache_behavior.value["viewer_protocol_policy"]

      origin_request_policy_id = ordered_cache_behavior.value["origin_request_policy_id"]
      cache_policy_id          = ordered_cache_behavior.value["cache_policy_id"]
    }
  }

  # You can add your own cache behaviours here (uncomment the following block)
  # ordered_cache_behavior {
  #   path_pattern    = "/test/*"
  #   allowed_methods = ["GET", "HEAD", "OPTIONS"]
  #   cached_methods  = ["GET", "HEAD"]
  #   ...
  # }

  # Origins
  #########
  # Adds the preconfigured origins from the tf-next module
  # No manual edits should be neccessary here
  dynamic "origin" {
    for_each = module.tf_next.cloudfront_origins

    content {
      domain_name = origin.value["domain_name"]
      origin_id   = origin.value["origin_id"]

      # Origin Shield
      dynamic "origin_shield" {
        for_each = lookup(origin.value, "origin_shield", null) != null ? [true] : []

        content {
          enabled              = lookup(origin.value["origin_shield"], "enabled", false)
          origin_shield_region = lookup(origin.value["origin_shield"], "origin_shield_region", null)
        }
      }

      # S3 origin
      dynamic "s3_origin_config" {
        for_each = lookup(origin.value, "s3_origin_config", null) != null ? [true] : []
        content {
          origin_access_identity = lookup(origin.value["s3_origin_config"], "origin_access_identity", null)
        }
      }

      # Custom origin
      dynamic "custom_origin_config" {
        for_each = lookup(origin.value, "custom_origin_config", null) != null ? [true] : []

        content {
          http_port                = lookup(origin.value["custom_origin_config"], "http_port", null)
          https_port               = lookup(origin.value["custom_origin_config"], "https_port", null)
          origin_protocol_policy   = lookup(origin.value["custom_origin_config"], "origin_protocol_policy", null)
          origin_ssl_protocols     = lookup(origin.value["custom_origin_config"], "origin_ssl_protocols", null)
          origin_keepalive_timeout = lookup(origin.value["custom_origin_config"], "origin_keepalive_timeout", null)
          origin_read_timeout      = lookup(origin.value["custom_origin_config"], "origin_read_timeout", null)
        }
      }

      dynamic "custom_header" {
        for_each = lookup(origin.value, "custom_header", null) != null ? origin.value["custom_header"] : []

        content {
          name  = custom_header.value["name"]
          value = custom_header.value["value"]
        }
      }
    }
  }

  # You can add your own origins here (uncomment the following block)
  # origin {
  #   domain_name = "example.com"
  #   origin_id   = "My custom origin"
  #   ...
  # }

  # Custom Error response (S3 failover)
  #####################################
  # Adds the preconfigured custom error response from the tf-next module
  # No manual edits should be neccessary here
  dynamic "custom_error_response" {
    for_each = module.tf_next.cloudfront_custom_error_response

    content {
      error_caching_min_ttl = custom_error_response.value["error_caching_min_ttl"]
      error_code            = custom_error_response.value["error_code"]
      response_code         = custom_error_response.value["response_code"]
      response_page_path    = custom_error_response.value["response_page_path"]
    }
  }

  viewer_certificate {
    cloudfront_default_certificate = true
  }

  restrictions {
    geo_restriction {
      restriction_type = "none"
    }
  }
}

output "cloudfront_domain_name" {
  value = aws_cloudfront_distribution.distribution.domain_name
}


================================================
FILE: examples/with-existing-cloudfront/package.json
================================================
{
  "name": "terraform-next-js-example-existing-cloudfront",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "next",
    "build": "next build",
    "tf-next": "tf-next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "latest",
    "react": "latest",
    "react-dom": "latest"
  },
  "devDependencies": {
    "tf-next": "latest"
  },
  "license": "MIT"
}


================================================
FILE: examples/with-existing-cloudfront/pages/index.js
================================================
import { useRouter } from 'next/router';
import { format } from 'url';

let counter = 0;

export async function getServerSideProps() {
  counter++;
  return { props: { initialPropsCounter: counter } };
}

export default function Index({ initialPropsCounter }) {
  const router = useRouter();
  const { pathname, query } = router;
  const reload = () => {
    router.push(format({ pathname, query }));
  };
  const incrementCounter = () => {
    const currentCounter = query.counter ? parseInt(query.counter) : 0;
    const href = `/?counter=${currentCounter + 1}`;

    router.push(href, href, { shallow: true });
  };

  return (
    <div>
      <h2>This is the Home Page</h2>

      <button onClick={reload}>Reload</button>
      <button onClick={incrementCounter}>Change State Counter</button>
      <p>"getServerSideProps" ran for "{initialPropsCounter}" times.</p>
      <p>Counter: "{query.counter || 0}".</p>
    </div>
  );
}


================================================
FILE: jest.config.js
================================================
/** @type {import('ts-jest').InitialOptionsTsJest} */
module.exports = {
  projects: ['<rootDir>/packages/*'],
  globalSetup: '<rootDir>/test/jest.setup.ts',
};


================================================
FILE: main.tf
================================================
data "aws_region" "current" {}

##########
# DynamoDB
##########

# Please see the documentation in packages/dynamodb-actions for information
# about the used schema.

resource "aws_dynamodb_table" "aliases" {
  name         = "${var.deployment_name}_aliases"
  billing_mode = "PAY_PER_REQUEST"

  hash_key  = "PK"
  range_key = "SK"

  attribute {
    name = "PK"
    type = "S"
  }

  attribute {
    name = "SK"
    type = "S"
  }

  attribute {
    name = "GSI1PK"
    type = "S"
  }

  attribute {
    name = "GSI1SK"
    type = "S"
  }

  global_secondary_index {
    name            = "DeploymentIdIndex"
    hash_key        = "GSI1PK"
    range_key       = "GSI1SK"
    projection_type = "INCLUDE"
    non_key_attributes = [
      "BasePath",
      "CreateDate",
      "DeploymentId",
      "DeploymentAlias",
      "HostnameRev"
    ]
  }

  tags = var.tags
}

# Using infrequent access tier here since this table is only used during API
# operations (creating deployments and aliases), but serves no customer facing
# purposes.
resource "aws_dynamodb_table" "deployments" {
  name         = "${var.deployment_name}_deployments"
  billing_mode = "PAY_PER_REQUEST"
  table_class  = "STANDARD_INFREQUENT_ACCESS"

  hash_key  = "PK"
  range_key = "SK"

  attribute {
    name = "PK"
    type = "S"
  }

  attribute {
    name = "SK"
    type = "S"
  }

  attribute {
    name = "GSI1SK"
    type = "S"
  }

  global_secondary_index {
    name               = "CreateDateIndex"
    hash_key           = "PK"
    range_key          = "GSI1SK"
    projection_type    = "INCLUDE"
    non_key_attributes = ["CreateDate", "DeploymentAlias", "DeploymentId", "Status"]
  }

  tags = var.tags
}

#####################
# CloudFormation Role
#####################

# Policy that controls which actions can be performed when CloudFormation
# creates a substack (from CDK)
data "aws_iam_policy_document" "cloudformation_permission" {
  # Allow CloudFormation to publish status changes to the SNS queue
  statement {
    effect = "Allow"
    actions = [
      "sns:Publish"
    ]
    resources = [module.deploy_controller.sns_topic_arn]
  }

  # Allow CloudFormation to access the lambda content
  statement {
    effect = "Allow"
    actions = [
      "s3:GetObject"
    ]
    resources = [
      module.statics_deploy.static_bucket_arn,
      "${module.statics_deploy.static_bucket_arn}/*"
    ]
  }

  # Stack creation
  statement {
    effect = "Allow"
    actions = [
      # TODO: Restrict the API Gateway action more
      "apigateway:*",
      "iam:CreateRole",
      "iam:GetRole",
      "iam:GetRolePolicy",
      "iam:PassRole",
      "iam:PutRolePolicy",
      "iam:TagRole",
      "lambda:AddPermission",
      "lambda:CreateFunction",
      "lambda:CreateFunctionUrlConfig",
      "lambda:GetFunctionUrlConfig",
      "lambda:GetFunction",
      "lambda:TagResource",
      "logs:CreateLogGroup",
      "logs:PutRetentionPolicy",
      "logs:TagLogGroup"
    ]
    resources = ["*"]
  }

  # Stack deletion
  statement {
    effect = "Allow"
    actions = [
      "apigateway:*",
      "iam:DeleteRole",
      "iam:DeleteRolePolicy",
      "iam:UntagRole",
      "lambda:DeleteFunction",
      "lambda:DeleteFunctionUrlConfig",
      "lambda:RemovePermission",
      "lambda:UntagResource",
      "logs:DeleteLogGroup",
      "logs:DeleteRetentionPolicy",
      "logs:UntagLogGroup"
    ]
    resources = ["*"]
  }
}

data "aws_iam_policy_document" "cloudformation_permission_assume_role" {
  statement {
    effect  = "Allow"
    actions = ["sts:AssumeRole"]

    principals {
      type        = "Service"
      identifiers = ["cloudformation.amazonaws.com"]
    }
  }
}

resource "aws_iam_policy" "cloudformation_permission" {
  name        = "${var.deployment_name}_cf-control"
  description = "Managed by Terraform Next.js"
  policy      = data.aws_iam_policy_document.cloudformation_permission.json

  tags = var.tags
}

resource "aws_iam_role" "cloudformation_permission" {
  name               = "${var.deployment_name}_cf-control"
  assume_role_policy = data.aws_iam_policy_document.cloudformation_permission_assume_role.json
  managed_policy_arns = [
    aws_iam_policy.cloudformation_permission.arn
  ]
}

###################
# Deploy Controller
###################

module "deploy_controller" {
  source = "./modules/deploy-controller"

  dynamodb_region                 = data.aws_region.current.name
  dynamodb_table_aliases_arn      = aws_dynamodb_table.aliases.arn
  dynamodb_table_aliases_name     = aws_dynamodb_table.aliases.id
  dynamodb_table_deployments_arn  = aws_dynamodb_table.deployments.arn
  dynamodb_table_deployments_name = aws_dynamodb_table.deployments.id

  enable_multiple_deployments      = var.enable_multiple_deployments
  multiple_deployments_base_domain = var.multiple_deployments_base_domain

  deployment_name = var.deployment_name
  tags            = var.tags

  debug_use_local_packages = var.debug_use_local_packages
  tf_next_module_root      = path.module
}

###################
# Deployment Lambda
###################

# Static deployment to S3 website and handles CloudFront invalidations
module "statics_deploy" {
  source = "./modules/statics-deploy"

  cloudfront_id               = var.cloudfront_create_distribution ? module.cloudfront_main[0].cloudfront_id : var.cloudfront_external_id
  cloudfront_arn              = var.cloudfront_create_distribution ? module.cloudfront_main[0].cloudfront_arn : var.cloudfront_external_arn
  deploy_status_sns_topic_arn = module.deploy_controller.sns_topic_arn

  dynamodb_region                 = data.aws_region.current.name
  dynamodb_table_aliases_arn      = aws_dynamodb_table.aliases.arn
  dynamodb_table_aliases_name     = aws_dynamodb_table.aliases.id
  dynamodb_table_deployments_arn  = aws_dynamodb_table.deployments.arn
  dynamodb_table_deployments_name = aws_dynamodb_table.deployments.id

  cloudformation_role_arn = aws_iam_role.cloudformation_permission.arn

  enable_multiple_deployments      = var.enable_multiple_deployments
  multiple_deployments_base_domain = var.multiple_deployments_base_domain

  lambda_role_permissions_boundary = var.lambda_role_permissions_boundary

  deployment_name = var.deployment_name
  tags            = var.tags
  tags_s3_bucket  = var.tags_s3_bucket

  debug_use_local_packages = var.debug_use_local_packages
  tf_next_module_root      = path.module
}

#####
# API
#####

module "api" {
  source = "./modules/api"

  dynamodb_region                 = data.aws_region.current.name
  dynamodb_table_aliases_arn      = aws_dynamodb_table.aliases.arn
  dynamodb_table_aliases_name     = aws_dynamodb_table.aliases.id
  dynamodb_table_deployments_arn  = aws_dynamodb_table.deployments.arn
  dynamodb_table_deployments_name = aws_dynamodb_table.deployments.id
  upload_bucket_id                = module.statics_deploy.upload_bucket_id
  upload_bucket_region            = module.statics_deploy.upload_bucket_region
  upload_bucket_arn               = module.statics_deploy.upload_bucket_arn

  deployment_name = var.deployment_name
  tags            = var.tags

  debug_use_local_packages = var.debug_use_local_packages
  tf_next_module_root      = path.module
}

############
# Next/Image
############

# Permission for image optimizer to fetch images from S3 deployment
data "aws_iam_policy_document" "access_static_deployment" {
  statement {
    actions   = ["s3:GetObject"]
    resources = ["${module.statics_deploy.static_bucket_arn}/*"]
  }
}

module "next_image" {
  count = var.create_image_optimization ? 1 : 0

  source  = "milliHQ/next-js-image-optimization/aws"
  version = ">= 12.1.0"

  cloudfront_create_distribution = false

  # tf-next does not distinct between image and device sizes, because they
  # are eventually merged together on the image optimizer.
  # So we only use a single key (next_image_domains) to pass ALL (image &
  # device) sizes to the optimizer and by setting the other
  # (next_image_device_sizes) to an empty array which prevents the optimizer
  # from adding the default device settings

  # TODO: Find way to pass these dynamically from the deployment
  next_image_domains      = []
  next_image_image_sizes  = []
  next_image_device_sizes = []

  source_bucket_id = module.statics_deploy.static_bucket_id

  lambda_memory_size               = var.image_optimization_lambda_memory_size
  lambda_attach_policy_json        = true
  lambda_policy_json               = data.aws_iam_policy_document.access_static_deployment.json
  lambda_role_permissions_boundary = var.lambda_role_permissions_boundary

  deployment_name = "${var.deployment_name}_tfn-image"
  tags            = var.tags
}

#########################
# CloudFront Proxy Config
#########################

module "proxy_config" {
  source = "./modules/cloudfront-proxy-config"

  cloudfront_price_class           = var.cloudfront_price_class
  lambda_role_permissions_boundary = var.lambda_role_permissions_boundary

  dynamodb_region             = data.aws_region.current.name
  dynamodb_table_aliases_arn  = aws_dynamodb_table.aliases.arn
  dynamodb_table_aliases_name = aws_dynamodb_table.aliases.id

  static_deploy_bucket_region = module.statics_deploy.static_bucket_region
  static_deploy_bucket_arn    = module.statics_deploy.static_bucket_arn
  static_deploy_bucket_id     = module.statics_deploy.static_bucket_id

  deployment_name = var.deployment_name
  tags            = var.tags

  debug_use_local_packages = var.debug_use_local_packages
  tf_next_module_root      = path.module

  providers = {
    aws.global_region = aws.global_region
  }
}

#####################
# Proxy (Lambda@Edge)
#####################

module "proxy" {
  source = "./modules/proxy"

  lambda_role_permissions_boundary = var.lambda_role_permissions_boundary

  deployment_name = var.deployment_name
  tags            = var.tags

  debug_use_local_packages = var.debug_use_local_packages
  tf_next_module_root      = path.module

  providers = {
    aws.global_region = aws.global_region
  }
}

#########################
# CloudFront distribution
#########################

# Origin & Cache Policies
#########################

# Managed origin policy for default behavior
data "aws_cloudfront_origin_request_policy" "managed_all_viewer" {
  name = "Managed-AllViewer"
}

locals {
  # Default headers on which the cache key should be determined
  #
  # host - When using multiple domains host header ensures that each
  #        (sub-)domain has a unique cache key
  cloudfront_cache_default_key_headers = ["host"]
  cloudfront_cache_key_headers = sort(concat(
    local.cloudfront_cache_default_key_headers,
    var.cloudfront_cache_key_headers
  ))
}

resource "aws_cloudfront_cache_policy" "this" {
  name    = "${var.deployment_name}_tfn-cache"
  comment = "Managed by Terraform Next.js"

  # Default values (Should be provided by origin)
  min_ttl     = 0
  default_ttl = 0
  max_ttl     = 31536000

  parameters_in_cache_key_and_forwarded_to_origin {
    cookies_config {
      cookie_behavior = "all"
    }

    headers_config {
      header_behavior = "whitelist"

      headers {
        items = local.cloudfront_cache_key_headers
      }
    }

    query_strings_config {
      query_string_behavior = "all"
    }

    enable_accept_encoding_gzip   = true
    enable_accept_encoding_brotli = true
  }
}

locals {
  # CloudFront default root object
  ################################
  cloudfront_default_root_object = ""

  # CloudFront Origins
  ####################

  # Default origin (With config for Lambda@Edge Proxy)
  cloudfront_origin_static_content = {
    domain_name = module.statics_deploy.static_bucket_endpoint
    origin_id   = "tf-next-s3-static-content"

    s3_origin_config = {
      origin_access_identity = module.statics_deploy.static_bucket_access_identity
    }

    custom_header = [
      {
        // Intentionally using http here (instead of https) to safe the time
        // the SSL handshake costs.
        name  = "x-env-config-endpoint"
        value = "http://${module.proxy_config.config_endpoint}"
      },
    ]
  }

  # Little hack here to create a dynamic object with different number of attributes
  # using filtering: https://www.terraform.io/docs/language/expressions/for.html#filtering-elements
  _cloudfront_origins = {
    static_content = merge(local.cloudfront_origin_static_content, { create = true })
    next_image = merge(
      var.create_image_optimization ? module.next_image[0].cloudfront_origin : null, {
        create = var.create_image_optimization
    })
  }

  cloudfront_origins = {
    for key, origin in local._cloudfront_origins : key => origin
    if origin.create
  }

  # CloudFront behaviors
  ######################

  # Default CloudFront behavior
  # (Lambda@Edge Proxy)
  cloudfront_default_behavior = {
    default_behavior = {
      allowed_methods  = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
      cached_methods   = ["GET", "HEAD"]
      target_origin_id = local.cloudfront_origin_static_content.origin_id

      compress               = true
      viewer_protocol_policy = "redirect-to-https"

      origin_request_policy_id   = var.cloudfront_origin_request_policy != null ? var.cloudfront_origin_request_policy : data.aws_cloudfront_origin_request_policy.managed_all_viewer.id
      response_headers_policy_id = var.cloudfront_response_headers_policy
      cache_policy_id            = aws_cloudfront_cache_policy.this.id

      lambda_function_association = {
        event_type   = "origin-request"
        lambda_arn   = module.proxy.lambda_edge_arn
        include_body = false
      }
    }
  }

  # next/image behavior
  cloudfront_ordered_cache_behavior_next_image = var.create_image_optimization ? module.next_image[0].cloudfront_cache_behavior : null

  # Little hack here to create a dynamic object with different number of attributes
  # using filtering: https://www.terraform.io/docs/language/expressions/for.html#filtering-elements
  _cloudfront_ordered_cache_behaviors = {
    next_image = merge(local.cloudfront_ordered_cache_behavior_next_image, {
      create = var.create_image_optimization
    })
  }

  cloudfront_ordered_cache_behaviors = {
    for key, behavior in local._cloudfront_ordered_cache_behaviors : key => behavior
    if behavior.create
  }

  cloudfront_custom_error_response = {
    s3_failover = {
      error_caching_min_ttl = 60
      error_code            = 403
      response_code         = 404
      response_page_path    = "/404"
    }
  }
}

module "cloudfront_main" {
  count = var.cloudfront_create_distribution ? 1 : 0

  source = "./modules/cloudfront-main"

  cloudfront_price_class              = var.cloudfront_price_class
  cloudfront_aliases                  = var.cloudfront_aliases
  cloudfront_acm_certificate_arn      = var.cloudfront_acm_certificate_arn
  cloudfront_minimum_protocol_version = var.cloudfront_minimum_protocol_version
  cloudfront_webacl_id                = var.cloudfront_webacl_id

  cloudfront_default_root_object     = local.cloudfront_default_root_object
  cloudfront_origins                 = local.cloudfront_origins
  cloudfront_default_behavior        = local.cloudfront_default_behavior
  cloudfront_ordered_cache_behaviors = local.cloudfront_ordered_cache_behaviors
  cloudfront_custom_error_response   = local.cloudfront_custom_error_response

  deployment_name = var.deployment_name
  tags            = var.tags
}


================================================
FILE: modules/api/main.tf
================================================
########
# Lambda
########

# For changing records in deployment & alias tables
data "aws_iam_policy_document" "access_dynamodb_tables" {
  statement {
    effect = "Allow"
    actions = [
      "dynamodb:GetItem",
      "dynamodb:DeleteItem",
      "dynamodb:PutItem",
      "dynamodb:Query",
      "dynamodb:UpdateItem"
    ]
    resources = [
      var.dynamodb_table_deployments_arn,
      "${var.dynamodb_table_deployments_arn}/index/*",
      var.dynamodb_table_aliases_arn,
      "${var.dynamodb_table_aliases_arn}/index/*",
    ]
  }
}

# For creating the presigned upload URL in S3
data "aws_iam_policy_document" "access_upload_bucket" {
  statement {
    effect = "Allow"
    actions = [
      "s3:PutObject"
    ]
    resources = [
      "${var.upload_bucket_arn}/*"
    ]
  }
}

# Initiate deletion of CloudFormation stacks
data "aws_iam_policy_document" "delete_cloudformation_stack" {
  statement {
    effect = "Allow"
    actions = [
      "cloudformation:DeleteStack"
    ]
    resources = [
      "arn:aws:cloudformation:*:*:stack/*/*"
    ]
  }
}

module "lambda" {
  source = "../lambda-worker"

  module_name       = "@millihq/terraform-next-api"
  module_version    = var.api_component_version
  module_asset_path = "dist.zip"
  local_cwd         = var.tf_next_module_root

  function_name = "${var.deployment_name}_tfn-api"
  description   = "Managed by Terraform Next.js"
  handler       = "handler.handler"
  memory_size   = 128

  attach_policy_jsons    = true
  number_of_policy_jsons = 3
  policy_jsons = [
    data.aws_iam_policy_document.access_dynamodb_tables.json,
    data.aws_iam_policy_document.access_upload_bucket.json,
    data.aws_iam_policy_document.delete_cloudformation_stack.json,
  ]

  environment_variables = {
    NODE_ENV               = "production"
    TABLE_REGION           = var.dynamodb_region
    TABLE_NAME_DEPLOYMENTS = var.dynamodb_table_deployments_name
    TABLE_NAME_ALIASES     = var.dynamodb_table_aliases_name
    UPLOAD_BUCKET_ID       = var.upload_bucket_id
    UPLOAD_BUCKET_REGION   = var.upload_bucket_region
  }

  allowed_triggers = {
    InvokeFromAPIGateway = {
      principal  = "apigateway.amazonaws.com"
      source_arn = "${aws_apigatewayv2_api.api.execution_arn}/*/*"
    }
  }

  tags = var.tags

  debug_use_local_packages = var.debug_use_local_packages
}

#############
# API Gateway
#############

resource "aws_apigatewayv2_api" "api" {
  name          = "${var.deployment_name}_api"
  protocol_type = "HTTP"

  tags = var.tags
}

resource "aws_apigatewayv2_integration" "lambda_integration" {
  api_id           = aws_apigatewayv2_api.api.id
  integration_type = "AWS_PROXY"

  connection_type        = "INTERNET"
  payload_format_version = "2.0"
  integration_uri        = module.lambda.lambda_function_invoke_arn
}

resource "aws_apigatewayv2_route" "lambda_integration" {
  api_id             = aws_apigatewayv2_api.api.id
  route_key          = "ANY /{proxy+}"
  authorization_type = "AWS_IAM"

  target = "integrations/${aws_apigatewayv2_integration.lambda_integration.id}"
}

resource "aws_apigatewayv2_stage" "default" {
  api_id      = aws_apigatewayv2_api.api.id
  name        = "$default"
  auto_deploy = true

  tags = var.tags
}

###################################
# Invoke Permission for API Gateway
###################################

data "aws_iam_policy_document" "access_api" {
  statement {
    effect = "Allow"
    actions = [
      "execute-api:Invoke",
    ]
    resources = [
      "${aws_apigatewayv2_api.api.execution_arn}/*/*"
    ]
  }
}

resource "aws_iam_policy" "access_api" {
  name = "${var.deployment_name}_api-access"

  description = "Managed by Terraform Next.js"

  policy = data.aws_iam_policy_document.access_api.json

  tags = var.tags
}


================================================
FILE: modules/api/outputs.tf
================================================
output "api_endpoint" {
  value = aws_apigatewayv2_api.api.api_endpoint
}

output "api_endpoint_access_policy_arn" {
  value = aws_iam_policy.access_api.arn
}


================================================
FILE: modules/api/variables.tf
================================================
variable "tf_next_module_root" {
  type = string
}

variable "api_component_version" {
  type    = string
  default = "1.0.0-canary.5"
}

##########
# Database
##########

variable "dynamodb_region" {
  type = string
}

variable "dynamodb_table_aliases_arn" {
  type = string
}

variable "dynamodb_table_aliases_name" {
  type = string
}

variable "dynamodb_table_deployments_arn" {
  type = string
}

variable "dynamodb_table_deployments_name" {
  type = string
}

###############
# Upload Bucket
###############

variable "upload_bucket_id" {
  type = string
}

variable "upload_bucket_region" {
  type = string
}

variable "upload_bucket_arn" {
  type = string
}

##########
# Labeling
##########

variable "deployment_name" {
  type = string
}

variable "tags" {
  type    = map(string)
  default = {}
}

#######
# Debug
#######

variable "debug_use_local_packages" {
  type    = bool
  default = false
}


================================================
FILE: modules/cloudfront-main/main.tf
================================================
resource "aws_cloudfront_distribution" "distribution" {
  enabled             = true
  is_ipv6_enabled     = true
  comment             = "${var.deployment_name} - Main"
  price_class         = var.cloudfront_price_class
  aliases             = var.cloudfront_aliases
  default_root_object = var.cloudfront_default_root_object
  web_acl_id          = var.cloudfront_webacl_id

  # Add CloudFront origins
  dynamic "origin" {
    for_each = var.cloudfront_origins

    content {
      domain_name = origin.value["domain_name"]
      origin_id   = origin.value["origin_id"]

      # Origin Shield
      dynamic "origin_shield" {
        for_each = lookup(origin.value, "origin_shield", null) != null ? [true] : []

        content {
          enabled              = lookup(origin.value["origin_shield"], "enabled", false)
          origin_shield_region = lookup(origin.value["origin_shield"], "origin_shield_region", null)
        }
      }

      # S3 origin
      dynamic "s3_origin_config" {
        for_each = lookup(origin.value, "s3_origin_config", null) != null ? [true] : []
        content {
          origin_access_identity = lookup(origin.value["s3_origin_config"], "origin_access_identity", null)
        }
      }

      # Custom origin
      dynamic "custom_origin_config" {
        for_each = lookup(origin.value, "custom_origin_config", null) != null ? [true] : []

        content {
          http_port                = lookup(origin.value["custom_origin_config"], "http_port", null)
          https_port               = lookup(origin.value["custom_origin_config"], "https_port", null)
          origin_protocol_policy   = lookup(origin.value["custom_origin_config"], "origin_protocol_policy", null)
          origin_ssl_protocols     = lookup(origin.value["custom_origin_config"], "origin_ssl_protocols", null)
          origin_keepalive_timeout = lookup(origin.value["custom_origin_config"], "origin_keepalive_timeout", null)
          origin_read_timeout      = lookup(origin.value["custom_origin_config"], "origin_read_timeout", null)
        }
      }

      dynamic "custom_header" {
        for_each = lookup(origin.value, "custom_header", null) != null ? origin.value["custom_header"] : []

        content {
          name  = custom_header.value["name"]
          value = custom_header.value["value"]
        }
      }
    }
  }

  # Lambda@Edge Proxy
  dynamic "default_cache_behavior" {
    for_each = var.cloudfront_default_behavior

    content {
      allowed_methods  = default_cache_behavior.value["allowed_methods"]
      cached_methods   = default_cache_behavior.value["cached_methods"]
      target_origin_id = default_cache_behavior.value["target_origin_id"]

      viewer_protocol_policy = default_cache_behavior.value["viewer_protocol_policy"]
      compress               = default_cache_behavior.value["compress"]

      origin_request_policy_id   = default_cache_behavior.value["origin_request_policy_id"]
      response_headers_policy_id = default_cache_behavior.value["response_headers_policy_id"]
      cache_policy_id            = default_cache_behavior.value["cache_policy_id"]

      dynamic "lambda_function_association" {
        for_each = [default_cache_behavior.value["lambda_function_association"]]

        content {
          event_type   = lambda_function_association.value["event_type"]
          lambda_arn   = lambda_function_association.value["lambda_arn"]
          include_body = lambda_function_association.value["include_body"]
        }
      }
    }
  }

  # Ordered cache behaviors
  dynamic "ordered_cache_behavior" {
    for_each = var.cloudfront_ordered_cache_behaviors

    content {
      path_pattern     = ordered_cache_behavior.value["path_pattern"]
      allowed_methods  = ordered_cache_behavior.value["allowed_methods"]
      cached_methods   = ordered_cache_behavior.value["cached_methods"]
      target_origin_id = ordered_cache_behavior.value["target_origin_id"]

      compress               = ordered_cache_behavior.value["compress"]
      viewer_protocol_policy = ordered_cache_behavior.value["viewer_protocol_policy"]

      origin_request_policy_id = ordered_cache_behavior.value["origin_request_policy_id"]
      cache_policy_id          = ordered_cache_behavior.value["cache_policy_id"]
    }
  }

  # Custom error response when a doc is not found in S3 (returns 403)
  # Then shows the 404 page
  dynamic "custom_error_response" {
    for_each = var.cloudfront_custom_error_response

    content {
      error_caching_min_ttl = custom_error_response.value["error_caching_min_ttl"]
      error_code            = custom_error_response.value["error_code"]
      response_code         = custom_error_response.value["response_code"]
      response_page_path    = custom_error_response.value["response_page_path"]
    }
  }

  viewer_certificate {
    cloudfront_default_certificate = var.cloudfront_acm_certificate_arn == null
    acm_certificate_arn            = var.cloudfront_acm_certificate_arn
    minimum_protocol_version       = var.cloudfront_minimum_protocol_version
    ssl_support_method             = var.cloudfront_acm_certificate_arn != null ? "sni-only" : null
  }

  restrictions {
    geo_restriction {
      restriction_type = "none"
    }
  }

  tags = var.tags
}


================================================
FILE: modules/cloudfront-main/outputs.tf
================================================
output "cloudfront_id" {
  value = aws_cloudfront_distribution.distribution.id
}

output "cloudfront_hosted_zone_id" {
  value = aws_cloudfront_distribution.distribution.hosted_zone_id
}

output "cloudfront_domain_name" {
  value = aws_cloudfront_distribution.distribution.domain_name
}

output "cloudfront_arn" {
  value = aws_cloudfront_distribution.distribution.arn
}


================================================
FILE: modules/cloudfront-main/variables.tf
================================================
############
# CloudFront
############

variable "cloudfront_price_class" {
  type = string
}

variable "cloudfront_aliases" {
  type    = list(string)
  default = []
}

variable "cloudfront_acm_certificate_arn" {
  type    = string
  default = null
}

variable "cloudfront_minimum_protocol_version" {
  type    = string
  default = "TLSv1"
}

variable "cloudfront_default_root_object" {
  type = string
}

variable "cloudfront_origins" {
  type    = any
  default = null
}

variable "cloudfront_default_behavior" {
  type    = any
  default = null
}

variable "cloudfront_ordered_cache_behaviors" {
  type    = any
  default = null
}

variable "cloudfront_custom_error_response" {
  type    = any
  default = null
}

variable "cloudfront_webacl_id" {
  description = "An optional webacl2 arn or webacl id to associate with the cloudfront distribution"
  type        = string
  default     = null
}

##########
# Labeling
##########
variable "deployment_name" {
  type = string
}

variable "tags" {
  type    = map(string)
  default = {}
}


================================================
FILE: modules/cloudfront-main/versions.tf
================================================
terraform {
  required_version = ">= 0.13"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 3.64.0"
    }
  }
}


================================================
FILE: modules/cloudfront-proxy-config/main.tf
================================================
locals {
  origin_id = "Proxy-Config-Edge"
}

#############
# Lambda@Edge
#############

data "aws_iam_policy_document" "access_resources" {
  # Access the aliases dynamodb table
  statement {
    effect = "Allow"
    actions = [
      "dynamodb:Query",
    ]
    resources = [
      var.dynamodb_table_aliases_arn
    ]
  }

  # Query the S3 bucket for static files
  statement {
    effect = "Allow"
    actions = [
      "s3:GetObject"
    ]
    resources = [
      "${var.static_deploy_bucket_arn}/*"
    ]
  }
}

module "proxy_config_package" {
  source  = "milliHQ/download/npm"
  version = "2.1.0"

  module_name    = "@millihq/terraform-next-proxy-config"
  module_version = var.proxy_config_module_version
  path_to_file   = "dist.zip"
  use_local      = var.debug_use_local_packages
  local_cwd      = var.tf_next_module_root
}

module "proxy_config" {
  source  = "terraform-aws-modules/lambda/aws"
  version = "3.1.0"

  lambda_at_edge = true

  function_name = "${var.deployment_name}_tfn-proxy-config"
  description   = "Managed by Terraform Next.js"
  handler       = "handler.handler"
  runtime       = var.lambda_runtime
  memory_size   = 1024
  timeout       = 30

  attach_policy_json        = true
  policy_json               = data.aws_iam_policy_document.access_resources.json
  role_permissions_boundary = var.lambda_role_permissions_boundary

  create_package         = false
  local_existing_package = module.proxy_config_package.rel_path

  cloudwatch_logs_retention_in_days = 30

  tags = var.tags

  providers = {
    aws = aws.global_region
  }
}

############
# CloudFront
############

# Managed origin request policy
data "aws_cloudfront_origin_request_policy" "managed_cors_custom_origin" {
  name = "Managed-CORS-CustomOrigin"
}

# Managed cache policy
data "aws_cloudfront_cache_policy" "managed_caching_optimized_for_uncompressed_objects" {
  name = "Managed-CachingOptimizedForUncompressedObjects"
}

resource "aws_cloudfront_distribution" "distribution" {
  enabled         = true
  is_ipv6_enabled = true
  comment         = "${var.deployment_name} - Proxy-Config"
  price_class     = var.cloudfront_price_class

  # Dummy origin, since all requests are served from Lambda@Edge and never
  # reach the custom origin endpoint.
  origin {
    domain_name = "milli.is"
    origin_id   = local.origin_id

    custom_origin_config {
      http_port              = 80
      https_port             = 443
      origin_protocol_policy = "https-only"
      origin_ssl_protocols   = ["SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"]
    }

    custom_header {
      name  = "x-env-dynamodb-region"
      value = var.dynamodb_region
    }

    custom_header {
      name  = "x-env-dynamodb-table-aliases"
      value = var.dynamodb_table_aliases_name
    }

    custom_header {
      name  = "x-env-bucket-region"
      value = var.static_deploy_bucket_region
    }

    custom_header {
      name  = "x-env-bucket-id"
      value = var.static_deploy_bucket_id
    }
  }

  default_cache_behavior {
    allowed_methods  = ["GET", "HEAD"]
    cached_methods   = ["GET", "HEAD"]
    target_origin_id = local.origin_id

    # Allow connections via HTTP to improve speed
    viewer_protocol_policy = "allow-all"

    origin_request_policy_id = data.aws_cloudfront_origin_request_policy.managed_cors_custom_origin.id
    cache_policy_id          = data.aws_cloudfront_cache_policy.managed_caching_optimized_for_uncompressed_objects.id
    lambda_function_association {
      event_type   = "origin-request"
      lambda_arn   = module.proxy_config.lambda_function_qualified_arn
      include_body = false
    }
  }

  viewer_certificate {
    cloudfront_default_certificate = true
  }

  restrictions {
    geo_restriction {
      restriction_type = "none"
    }
  }

  tags = var.tags
}


================================================
FILE: modules/cloudfront-proxy-config/outputs.tf
================================================
output "config_endpoint" {
  value = aws_cloudfront_distribution.distribution.domain_name
}


================================================
FILE: modules/cloudfront-proxy-config/variables.tf
================================================
############
# CloudFront
############

variable "proxy_config_module_version" {
  type    = string
  default = "1.0.0-canary.5"
}

variable "lambda_runtime" {
  type    = string
  default = "nodejs14.x"
}

variable "lambda_role_permissions_boundary" {
  type    = string
  default = null
}

variable "cloudfront_price_class" {
  type = string
}

###################
# Deployment Bucket
###################

variable "static_deploy_bucket_region" {
  type = string
}

variable "static_deploy_bucket_arn" {
  type = string
}

variable "static_deploy_bucket_id" {
  type = string
}

##########
# DynamoDB
##########

variable "dynamodb_region" {
  type = string
}

variable "dynamodb_table_aliases_arn" {
  type = string
}

variable "dynamodb_table_aliases_name" {
  type = string
}

##########
# Labeling
##########

variable "deployment_name" {
  type = string
}

variable "tags" {
  type    = map(string)
  default = {}
}

#######
# Debug
#######

variable "debug_use_local_packages" {
  type    = bool
  default = false
}

variable "tf_next_module_root" {
  type = string
}


================================================
FILE: modules/cloudfront-proxy-config/versions.tf
================================================
terraform {
  required_version = ">= 0.15"

  required_providers {
    aws = {
      source                = "hashicorp/aws"
      version               = ">= 4.0"
      configuration_aliases = [aws.global_region]
    }
  }
}


================================================
FILE: modules/deploy-controller/README.md
================================================
# Deploy Controller

The deploy controller is responsible for handling updates to the SubStacks and synchronizing the entries in the DynamoDB accordingly.


================================================
FILE: modules/deploy-controller/main.tf
================================================
locals {
  function_name = "${var.deployment_name}_tfn-controller"
}

###########
# SNS-Topic
###########

resource "aws_sns_topic" "cloudformation_updates" {
  name_prefix = var.deployment_name

  tags = var.tags
}

# CloudFormation sends events for each status change of each resource in the
# stack, including the stack itself.
# Unfortunately the payload of the stack events is always delivered as a single
# SNS message instead of using messageAttributes, so no filtering for updates
# that only affect the stack is possible.
# See: https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/635
resource "aws_sns_topic_subscription" "lambda" {
  topic_arn = aws_sns_topic.cloudformation_updates.arn
  protocol  = "lambda"
  endpoint  = module.worker.lambda_function_arn
}

#############
# Permissions
#############

# Access the dynamodb tables
data "aws_iam_policy_document" "access_dynamodb_tables" {
  statement {
    effect = "Allow"
    actions = [
      "dynamodb:GetItem",
      "dynamodb:PutItem",
      "dynamodb:Query",
      "dynamodb:UpdateItem",
      "dynamodb:DeleteItem"
    ]
    resources = [
      var.dynamodb_table_deployments_arn,
      var.dynamodb_table_aliases_arn
    ]
  }
}

# Read the output from the created CloudFormation stacks
data "aws_iam_policy_document" "access_cloudformation_stacks" {
  statement {
    effect = "Allow"
    actions = [
      "cloudformation:DescribeStacks",
    ]
    resources = [
      "*"
    ]
  }
}

###############
# Worker Lambda
###############

module "worker" {
  source = "../lambda-worker"

  module_name       = "@millihq/terraform-next-deploy-controller"
  module_version    = var.deploy_controller_component_version
  module_asset_path = "dist.zip"
  local_cwd         = var.tf_next_module_root

  function_name = "${var.deployment_name}_tfn-controller"
  description   = "Managed by Terraform Next.js"
  handler       = "handler.handler"
  memory_size   = 128

  attach_policy_jsons    = true
  number_of_policy_jsons = 2
  policy_jsons = [
    data.aws_iam_policy_document.access_dynamodb_tables.json,
    data.aws_iam_policy_document.access_cloudformation_stacks.json,
  ]

  environment_variables = {
    NODE_ENV               = "production"
    TABLE_REGION           = var.dynamodb_region
    TABLE_NAME_DEPLOYMENTS = var.dynamodb_table_deployments_name
    TABLE_NAME_ALIASES     = var.dynamodb_table_aliases_name
    # Remove the * from the base domain (e.g. *.example.com -> .example.com)
    MULTI_DEPLOYMENTS_BASE_DOMAIN = var.enable_multiple_deployments ? replace(var.multiple_deployments_base_domain, "/^\\*/", "") : null
  }

  allowed_triggers = {
    CloudFormationUpdates = {
      principal  = "sns.amazonaws.com"
      source_arn = aws_sns_topic.cloudformation_updates.arn
    }
  }

  tags = var.tags

  debug_use_local_packages = var.debug_use_local_packages
}


================================================
FILE: modules/deploy-controller/outputs.tf
================================================
output "sns_topic_arn" {
  value = aws_sns_topic.cloudformation_updates.arn
}


================================================
FILE: modules/deploy-controller/variables.tf
================================================
variable "tf_next_module_root" {
  type = string
}

variable "deploy_controller_component_version" {
  type    = string
  default = "1.0.0-canary.5"
}

#####################
# Deployment database
#####################

variable "dynamodb_region" {
  type = string
}

variable "dynamodb_table_aliases_arn" {
  type = string
}

variable "dynamodb_table_aliases_name" {
  type = string
}

variable "dynamodb_table_deployments_arn" {
  type = string
}

variable "dynamodb_table_deployments_name" {
  type = string
}

######################
# Multiple deployments
######################

variable "enable_multiple_deployments" {
  type = bool
}

variable "multiple_deployments_base_domain" {
  type    = string
  default = null
}

##########
# Labeling
##########

variable "deployment_name" {
  type = string
}

variable "tags" {
  type    = map(string)
  default = {}
}

#######
# Debug
#######

variable "debug_use_local_packages" {
  type    = bool
  default = false
}


================================================
FILE: modules/deploy-controller/versions.tf
================================================
terraform {
  required_version = ">= 0.13"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 3.0"
    }
  }
}


================================================
FILE: modules/lambda-worker/LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS


================================================
FILE: modules/lambda-worker/iam.tf
================================================
# This module is based on the terraform-aws-lambda module:
# https://github.com/terraform-aws-modules/terraform-aws-lambda
#
# See the LICENSE file in the directory of this module for more information.
#
# It simplifies the available options for configuration to match the needs of
# this project.

#############
# Lambda Role
#############

data "aws_iam_policy_document" "assume_role" {
  statement {
    effect  = "Allow"
    actions = ["sts:AssumeRole"]

    principals {
      type        = "Service"
      identifiers = ["lambda.amazonaws.com"]
    }
  }
}

resource "aws_iam_role" "lambda" {
  name               = var.function_name
  assume_role_policy = data.aws_iam_policy_document.assume_role.json

  tags = var.tags
}

#################
# Cloudwatch Logs
#################

data "aws_iam_policy_document" "logs" {
  statement {
    effect    = "Allow"
    actions   = ["logs:CreateLogStream", "logs:PutLogEvents"]
    resources = flatten([for _, v in ["%v:*", "%v:*:*"] : format(v, aws_cloudwatch_log_group.lambda.arn)])
  }
}

resource "aws_iam_policy" "logs" {
  name   = "${local.role_name}-logs"
  policy = data.aws_iam_policy_document.logs.json

  tags = var.tags
}

resource "aws_iam_role_policy_attachment" "logs" {
  role       = aws_iam_role.lambda.name
  policy_arn = aws_iam_policy.logs.arn
}


================================================
FILE: modules/lambda-worker/main.tf
================================================
# This module is based on the terraform-aws-lambda module:
# https://github.com/terraform-aws-modules/terraform-aws-lambda
#
# See the LICENSE file in the directory of this module for more information.
#
# It simplifies the available options for configuration to match the needs of
# this project.

locals {
  role_name = var.function_name
}

###############
# Lambda Source
###############

module "lambda_content" {
  source  = "milliHQ/download/npm"
  version = "2.1.0"

  module_name    = var.module_name
  module_version = var.module_version
  path_to_file   = "dist.zip"
  use_local      = var.debug_use_local_packages
  local_cwd      = var.local_cwd
}

###########
# Log Group
###########

resource "aws_cloudwatch_log_group" "lambda" {
  name              = "/aws/lambda/${var.function_name}"
  retention_in_days = var.cloudwatch_logs_retention_in_days

  tags = var.tags
}

##########
# Function
##########

resource "aws_lambda_function" "this" {
  function_name = var.function_name
  description   = var.description
  handler       = var.handler
  runtime       = var.runtime
  memory_size   = var.memory_size
  timeout       = var.timeout
  role          = aws_iam_role.lambda.arn

  filename         = module.lambda_content.rel_path
  source_code_hash = filebase64sha256(module.lambda_content.rel_path)

  dynamic "environment" {
    for_each = length(keys(var.environment_variables)) == 0 ? [] : [true]
    content {
      variables = var.environment_variables
    }
  }

  tags = var.tags

  # Wait until the creation of the log group is finished before the lambda is
  # deployed.
  depends_on = [aws_cloudwatch_log_group.lambda]
}

resource "aws_lambda_permission" "triggers" {
  for_each = var.allowed_triggers

  function_name = aws_lambda_function.this.function_name

  statement_id       = try(each.value.statement_id, each.key)
  action             = try(each.value.action, "lambda:InvokeFunction")
  principal          = try(each.value.principal, format("%s.amazonaws.com", try(each.value.service, "")))
  source_arn         = try(each.value.source_arn, null)
  source_account     = try(each.value.source_account, null)
  event_source_token = try(each.value.event_source_token, null)
}

####################################
# Additional policies (list of JSON)
####################################

resource "aws_iam_policy" "additional_jsons" {
  count = var.attach_policy_jsons ? var.number_of_policy_jsons : 0

  name   = "${local.role_name}-${count.index}"
  policy = var.policy_jsons[count.index]

  tags = var.tags
}

resource "aws_iam_role_policy_attachment" "additional_jsons" {
  count = var.attach_policy_jsons ? var.number_of_policy_jsons : 0

  role       = aws_iam_role.lambda.name
  policy_arn = aws_iam_policy.additional_jsons[count.index].arn
}


================================================
FILE: modules/lambda-worker/outputs.tf
================================================
# This module is based on the terraform-aws-lambda module:
# https://github.com/terraform-aws-modules/terraform-aws-lambda
#
# See the LICENSE file in the directory of this module for more information.
#
# It simplifies the available options for configuration to match the needs of
# this project.

output "lambda_function_arn" {
  description = "The ARN of the Lambda Function."
  value       = aws_lambda_function.this.arn
}

output "lambda_function_invoke_arn" {
  description = "ARN to be used for invoking Lambda Function from API Gateway."
  value       = aws_lambda_function.this.invoke_arn
}


================================================
FILE: modules/lambda-worker/variables.tf
================================================
# This module is based on the terraform-aws-lambda module:
# https://github.com/terraform-aws-modules/terraform-aws-lambda
#
# See the LICENSE file in the directory of this module for more information.
#
# It simplifies the available options for configuration to match the needs of
# this project.

###############
# Lambda Source
###############

variable "module_name" {
  description = "Name of the package that should be downloaded from npm."
  type        = string
}

variable "module_version" {
  description = "Version of the module that should be fetched from npm registry."
  type        = string
}

variable "module_asset_path" {
  description = "Path of the asset that should be used from the npm package."
  type        = string
  default     = "dist.zip"
}

variable "local_cwd" {
  description = "Root path where node.resolve should start looking for the local module."
}

########
# Lambda
########

variable "function_name" {
  description = "Name of the Lambda function."
  type        = string
}

variable "description" {
  description = "Description that should be added to the function."
  type        = string
}

variable "runtime" {
  description = "Runtime that the function should use."
  type        = string
  default     = "nodejs14.x"
}

variable "memory_size" {
  description = "Amount of memory that should be allocated by the function."
  type        = number
  default     = 128
}

variable "handler" {
  description = "Entry point of the function that should be called on execution"
  type        = string
}

variable "allowed_triggers" {
  description = "Map of allowed triggers to create Lambda permissions."
  type        = map(any)
  default     = {}
}

variable "environment_variables" {
  description = "Map that defines environment variables for the Lambda Function."
  type        = map(string)
  default     = {}
}

variable "timeout" {
  description = "Amount of time your Lambda Function has to run in seconds."
  type        = number
  default     = 3
}

###########
# Log Group
###########

variable "cloudwatch_logs_retention_in_days" {
  description = "Amount of days you want to retain log events of the function."
  type        = number
  default     = 30
}

##############
# IAM Policies
##############

variable "attach_policy_jsons" {
  description = "Controls whether policy_jsons should be added to IAM role for Lambda Function."
  type        = bool
  default     = false
}

variable "number_of_policy_jsons" {
  description = "Number of policies JSON to attach to IAM role for Lambda Function."
  type        = number
  default     = 0
}

variable "policy_jsons" {
  description = "List of additional policy documents as JSON to attach to Lambda Function role."
  type        = list(string)
  default     = []
}

##########
# Labeling
##########

variable "tags" {
  description = "Map of tags to assign to resources."
  type        = map(string)
  default     = {}
}

#######
# Debug
#######

variable "debug_use_local_packages" {
  description = "Instead of downloading the package content from the npm registry, resolve locally."
  type        = bool
  default     = false
}


================================================
FILE: modules/lambda-worker/versions.tf
================================================
# This module is based on the terraform-aws-lambda module:
# https://github.com/terraform-aws-modules/terraform-aws-lambda
#
# See the LICENSE file in the directory of this module for more information.
#
# It simplifies the available options for configuration to match the needs of
# this project.

terraform {
  required_version = ">= 0.13"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 3.0"
    }
  }
}


================================================
FILE: modules/proxy/main.tf
================================================
module "proxy_package" {
  source  = "milliHQ/download/npm"
  version = "2.1.0"

  module_name    = "@millihq/terraform-next-proxy"
  module_version = var.proxy_module_version
  path_to_file   = "dist.zip"
  use_local      = var.debug_use_local_packages
  local_cwd      = var.tf_next_module_root
}

#############
# Lambda@Edge
#############

module "edge_proxy" {
  source  = "terraform-aws-modules/lambda/aws"
  version = "3.1.0"

  lambda_at_edge = true

  function_name             = "${var.deployment_name}_tfn-proxy"
  description               = "Managed by Terraform Next.js"
  handler                   = "handler.handler"
  runtime                   = var.lambda_default_runtime
  role_permissions_boundary = var.lambda_role_permissions_boundary

  create_package         = false
  local_existing_package = module.proxy_package.rel_path

  cloudwatch_logs_retention_in_days = 30

  tags = var.tags

  providers = {
    aws = aws.global_region
  }
}


================================================
FILE: modules/proxy/outputs.tf
================================================
#############
# Lambda@Edge
#############

output "lambda_edge_arn" {
  value = module.edge_proxy.lambda_function_qualified_arn
}


================================================
FILE: modules/proxy/variables.tf
================================================
#############
# Lambda@Edge
#############

variable "proxy_module_version" {
  type    = string
  default = "1.0.0-canary.5"
}

variable "lambda_default_runtime" {
  type    = string
  default = "nodejs14.x"
}

variable "lambda_role_permissions_boundary" {
  type    = string
  default = null
}

##########
# Labeling
##########
variable "deployment_name" {
  type = string
}

variable "tags" {
  type    = map(string)
  default = {}
}

#######
# Debug
#######
variable "debug_use_local_packages" {
  type    = bool
  default = false
}

variable "tf_next_module_root" {
  type = string
}


================================================
FILE: modules/proxy/versions.tf
================================================
terraform {
  required_version = ">= 0.15"

  required_providers {
    aws = {
      source                = "hashicorp/aws"
      version               = ">= 3.0"
      configuration_aliases = [aws.global_region]
    }
  }
}


================================================
FILE: modules/statics-deploy/main.tf
================================================
locals {
  manifest_key   = "_tf-next/deployment.json"
  lambda_timeout = 60
}

########################
# Upload Bucket (zipped)
########################

resource "aws_s3_bucket" "static_upload" {
  bucket_prefix = "${var.deployment_name}-tfn-deploy"
  force_destroy = true

  tags = merge(var.tags, var.tags_s3_bucket)
}

resource "aws_s3_bucket_acl" "static_upload" {
  bucket = aws_s3_bucket.static_upload.id
  acl    = "private"
}

resource "aws_s3_bucket_notification" "on_create" {
  bucket = aws_s3_bucket.static_upload.id

  lambda_function {
    lambda_function_arn = module.deploy_trigger.lambda_function_arn
    events              = ["s3:ObjectCreated:*"]
  }
}

#########################
# Serve Bucket (unzipped)
#########################

resource "aws_s3_bucket" "static_deploy" {
  bucket_prefix = "${var.deployment_name}-tfn-static"
  force_destroy = true

  tags = merge(var.tags, var.tags_s3_bucket)
}

resource "aws_s3_bucket_acl" "static_deploy" {
  bucket = aws_s3_bucket.static_deploy.id
  acl    = "private"
}

# CloudFront permissions for the bucket
resource "aws_cloudfront_origin_access_identity" "this" {
  comment = "S3 CloudFront access ${aws_s3_bucket.static_deploy.id}"
}

data "aws_iam_policy_document" "cf_access" {
  statement {
    actions   = ["s3:GetObject"]
    resources = ["${aws_s3_bucket.static_deploy.arn}/*"]

    principals {
      type        = "AWS"
      identifiers = [aws_cloudfront_origin_access_identity.thi
Download .txt
gitextract_ad_x_yca/

├── .editorconfig
├── .github/
│   └── workflows/
│       ├── CI.yml
│       ├── lint.yml
│       ├── release.yml
│       └── tf-docs.yml
├── .gitignore
├── .prettierrc.js
├── .terraform-docs.yml
├── .vscode/
│   ├── extensions.json
│   ├── launch.json
│   └── settings.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── docker-compose.yml
├── docs/
│   └── development.md
├── examples/
│   ├── .gitignore
│   ├── atomic-deployments/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── package.json
│   │   └── pages/
│   │       └── index.js
│   ├── complete/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── components/
│   │   │   └── header.js
│   │   ├── main.tf
│   │   ├── next.config.js
│   │   ├── package.json
│   │   └── pages/
│   │       ├── about.js
│   │       ├── api/
│   │       │   └── robots.js
│   │       ├── index.js
│   │       └── test/
│   │           └── [...slug].js
│   ├── next-image/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── app.css
│   │   ├── components/
│   │   │   ├── view-source.js
│   │   │   └── view-source.module.css
│   │   ├── main.tf
│   │   ├── next.config.js
│   │   ├── package.json
│   │   ├── pages/
│   │   │   ├── _app.js
│   │   │   ├── background.js
│   │   │   ├── index.js
│   │   │   ├── layout-fill.js
│   │   │   ├── layout-fixed.js
│   │   │   ├── layout-intrinsic.js
│   │   │   └── layout-responsive.js
│   │   └── styles.module.css
│   ├── static/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── package.json
│   │   └── pages/
│   │       ├── about.js
│   │       ├── blog/
│   │       │   └── index.js
│   │       └── index.js
│   ├── with-custom-domain/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── package.json
│   │   └── pages/
│   │       └── index.js
│   └── with-existing-cloudfront/
│       ├── .gitignore
│       ├── LICENSE
│       ├── README.md
│       ├── main.tf
│       ├── package.json
│       └── pages/
│           └── index.js
├── jest.config.js
├── main.tf
├── modules/
│   ├── api/
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   └── variables.tf
│   ├── cloudfront-main/
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── variables.tf
│   │   └── versions.tf
│   ├── cloudfront-proxy-config/
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── variables.tf
│   │   └── versions.tf
│   ├── deploy-controller/
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── variables.tf
│   │   └── versions.tf
│   ├── lambda-worker/
│   │   ├── LICENSE
│   │   ├── iam.tf
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── variables.tf
│   │   └── versions.tf
│   ├── proxy/
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── variables.tf
│   │   └── versions.tf
│   └── statics-deploy/
│       ├── main.tf
│       ├── outputs.tf
│       ├── variables.tf
│       └── versions.tf
├── outputs.tf
├── package.json
├── packages/
│   ├── api/
│   │   ├── .gitignore
│   │   ├── jest.config.js
│   │   ├── ncc.config.json
│   │   ├── package.json
│   │   ├── schema.ts
│   │   ├── schema.yaml
│   │   ├── src/
│   │   │   ├── actions/
│   │   │   │   ├── alias/
│   │   │   │   │   ├── alias-utils.ts
│   │   │   │   │   ├── create-or-update-alias.ts
│   │   │   │   │   ├── delete-alias-by-id.ts
│   │   │   │   │   └── list-aliases.ts
│   │   │   │   └── deployment/
│   │   │   │       ├── create-deployment.ts
│   │   │   │       ├── delete-deployment-by-id.ts
│   │   │   │       ├── get-deployment-by-id.ts
│   │   │   │       └── list-deployments.ts
│   │   │   ├── api.ts
│   │   │   ├── declarations.d.ts
│   │   │   ├── handler.ts
│   │   │   ├── serializers/
│   │   │   │   └── deployment.ts
│   │   │   └── services/
│   │   │       ├── cloudformation.ts
│   │   │       ├── dynamodb.ts
│   │   │       └── s3.ts
│   │   ├── test/
│   │   │   ├── actions/
│   │   │   │   ├── alias/
│   │   │   │   │   ├── create-or-update-alias.test.ts
│   │   │   │   │   ├── delete-alias-by-id.test.ts
│   │   │   │   │   └── list-aliases.test.ts
│   │   │   │   └── deployment/
│   │   │   │       ├── create-deployment.test.ts
│   │   │   │       ├── delete-deployment-by-id.test.ts
│   │   │   │       ├── get-deployment-by-id.test.ts
│   │   │   │       └── list-deployments.test.ts
│   │   │   └── test-utils.ts
│   │   └── tsconfig.json
│   ├── deploy-controller/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── jest.config.js
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── controller.ts
│   │   │   ├── declarations.d.ts
│   │   │   ├── handler.ts
│   │   │   └── utils/
│   │   │       ├── ensure-env.ts
│   │   │       ├── parse-cloudformation-event.ts
│   │   │       └── parse-lambda-routes.ts
│   │   ├── test/
│   │   │   ├── controller.test.ts
│   │   │   ├── test-utils.ts
│   │   │   └── utils/
│   │   │       ├── parse-cloudformation-event.test.ts
│   │   │       └── parse-lambda-routes.test.ts
│   │   └── tsconfig.json
│   ├── deploy-trigger/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── jest.config.js
│   │   ├── ncc.config.json
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── cdk/
│   │   │   │   ├── aws-construct-function-urls.ts
│   │   │   │   ├── aws-construct.ts
│   │   │   │   ├── cdk-utils.ts
│   │   │   │   ├── create-cloudformation-stack.ts
│   │   │   │   └── to-cloudformation.ts
│   │   │   ├── constants.ts
│   │   │   ├── create-invalidation.ts
│   │   │   ├── declarations.d.ts
│   │   │   ├── deploy-trigger.ts
│   │   │   ├── get-or-create-manifest.ts
│   │   │   ├── handler.ts
│   │   │   ├── types.ts
│   │   │   ├── update-manifest.ts
│   │   │   └── utils/
│   │   │       ├── ensure-env.ts
│   │   │       └── random-id.ts
│   │   ├── test/
│   │   │   ├── create-invalidation.test.ts
│   │   │   ├── deploy-trigger.test.ts
│   │   │   ├── get-or-create-manifest.test.ts
│   │   │   ├── test-utils.ts
│   │   │   └── update-manifest.test.ts
│   │   └── tsconfig.json
│   ├── dynamodb-actions/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── jest.config.js
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── alias/
│   │   │   │   ├── create-alias.ts
│   │   │   │   ├── delete-alias-by-id.ts
│   │   │   │   ├── get-alias-by-hostname.ts
│   │   │   │   ├── get-alias-by-id.ts
│   │   │   │   └── list-aliases-for-deployment.ts
│   │   │   ├── deployment/
│   │   │   │   ├── create-deployment.ts
│   │   │   │   ├── delete-deployment-by-id.ts
│   │   │   │   ├── get-deployment-by-id.ts
│   │   │   │   ├── list-deployments.ts
│   │   │   │   ├── update-deployment-status-create-failed.ts
│   │   │   │   ├── update-deployment-status-create-in-progress.ts
│   │   │   │   ├── update-deployment-status-destroy-failed.ts
│   │   │   │   ├── update-deployment-status-destroy-in-progress.ts
│   │   │   │   ├── update-deployment-status-destroy-requested.ts
│   │   │   │   ├── update-deployment-status-finished.ts
│   │   │   │   ├── update-deployment-status.ts
│   │   │   │   └── update-deployment.ts
│   │   │   ├── index.ts
│   │   │   ├── types.ts
│   │   │   └── utils/
│   │   │       ├── dynamodb/
│   │   │       │   ├── index.ts
│   │   │       │   └── update-item.ts
│   │   │       └── reverse-hostname.ts
│   │   ├── test/
│   │   │   ├── alias/
│   │   │   │   ├── create-alias.test.ts
│   │   │   │   ├── delete-alias-by-id.test.ts
│   │   │   │   ├── get-alias-by-id.test.ts
│   │   │   │   └── list-aliases-for-deployment.test.ts
│   │   │   ├── deployment/
│   │   │   │   ├── create-deployment.test.ts
│   │   │   │   ├── delete-deployment.test.ts
│   │   │   │   ├── get-deployment-by-id.test.ts
│   │   │   │   ├── list-deployments.test.ts
│   │   │   │   └── update-deployment.test.ts
│   │   │   ├── test-utils.ts
│   │   │   └── utils/
│   │   │       └── reverse-hostname.test.ts
│   │   └── tsconfig.json
│   ├── node-bridge/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── jest.config.js
│   │   ├── package.json
│   │   ├── src/
│   │   │   └── bridge.ts
│   │   ├── test/
│   │   │   └── bridge.test.js
│   │   └── tsconfig.json
│   ├── proxy/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── error.html
│   │   ├── jest.config.js
│   │   ├── ncc.config.json
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── actions/
│   │   │   │   ├── fetch-cached.ts
│   │   │   │   ├── fetch-file-system.ts
│   │   │   │   └── fetch-proxy-config.ts
│   │   │   ├── error/
│   │   │   │   ├── alias-not-configured.ts
│   │   │   │   ├── missing-config.ts
│   │   │   │   └── render-error.ts
│   │   │   ├── handler.ts
│   │   │   ├── index.ts
│   │   │   ├── proxy.ts
│   │   │   ├── types.ts
│   │   │   └── util/
│   │   │       ├── append-querystring.ts
│   │   │       ├── custom-origin.ts
│   │   │       ├── etag-cache.ts
│   │   │       ├── fetch-timeout.ts
│   │   │       ├── generate-cloudfront-headers.ts
│   │   │       ├── get-env.ts
│   │   │       ├── is-url.ts
│   │   │       ├── resolve-route-parameters.ts
│   │   │       └── ttl-cache.ts
│   │   ├── test/
│   │   │   ├── actions/
│   │   │   │   └── fetch-cached.test.ts
│   │   │   ├── handler.test.ts
│   │   │   ├── proxy.test.ts
│   │   │   ├── proxy.unit.test.ts
│   │   │   ├── res/
│   │   │   │   ├── config-001.json
│   │   │   │   ├── config-002.json
│   │   │   │   ├── config-003.json
│   │   │   │   └── config-004.json
│   │   │   ├── resolve-route-parameters.test.ts
│   │   │   ├── test-utils.ts
│   │   │   └── util/
│   │   │       ├── append-querystring.test.ts
│   │   │       └── ttl-cache.test.ts
│   │   └── tsconfig.json
│   ├── proxy-config/
│   │   ├── .gitignore
│   │   ├── jest.config.js
│   │   ├── ncc.config.json
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── actions/
│   │   │   │   ├── deployment-file-exists.ts
│   │   │   │   └── get-alias.ts
│   │   │   ├── errors/
│   │   │   │   └── not-found-error.ts
│   │   │   ├── handler.ts
│   │   │   └── utils/
│   │   │       ├── get-env.ts
│   │   │       └── split-at-character.ts
│   │   ├── test/
│   │   │   └── utils/
│   │   │       └── split-at-character.test.ts
│   │   └── tsconfig.json
│   ├── runtime/
│   │   ├── .gitignore
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── build.sh
│   │   ├── jest.config.js
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── create-serverless-config.ts
│   │   │   ├── dev-server.ts
│   │   │   ├── index.ts
│   │   │   ├── legacy-launcher.ts
│   │   │   ├── legacy-versions.ts
│   │   │   ├── templated-launcher-shared.ts
│   │   │   ├── templated-launcher.ts
│   │   │   └── utils.ts
│   │   ├── test/
│   │   │   ├── fixtures/
│   │   │   │   ├── 00-i18n-support/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── another.js
│   │   │   │   │   │   ├── auto-export/
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── dynamic/
│   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   ├── gsp/
│   │   │   │   │   │   │   ├── blocking/
│   │   │   │   │   │   │   │   └── [[...slug]].js
│   │   │   │   │   │   │   ├── fallback/
│   │   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   │   └── no-fallback/
│   │   │   │   │   │   │       └── [slug].js
│   │   │   │   │   │   ├── gssp/
│   │   │   │   │   │   │   ├── [slug].js
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   ├── links.js
│   │   │   │   │   │   └── not-found/
│   │   │   │   │   │       ├── fallback/
│   │   │   │   │   │       │   └── [slug].js
│   │   │   │   │   │       └── index.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── hello.txt
│   │   │   │   ├── 00-i18n-support-no-locale-detection/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── another.js
│   │   │   │   │   │   ├── auto-export/
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── dynamic/
│   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   ├── gsp/
│   │   │   │   │   │   │   ├── blocking/
│   │   │   │   │   │   │   │   └── [[...slug]].js
│   │   │   │   │   │   │   ├── fallback/
│   │   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   │   └── no-fallback/
│   │   │   │   │   │   │       └── [slug].js
│   │   │   │   │   │   ├── gssp/
│   │   │   │   │   │   │   ├── [slug].js
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   ├── links.js
│   │   │   │   │   │   └── not-found/
│   │   │   │   │   │       ├── fallback/
│   │   │   │   │   │       │   └── [slug].js
│   │   │   │   │   │       └── index.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── hello.txt
│   │   │   │   ├── 00-i18n-support-no-shared-lambdas/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── another.js
│   │   │   │   │   │   ├── auto-export/
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── dynamic/
│   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   ├── gsp/
│   │   │   │   │   │   │   ├── fallback/
│   │   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   │   └── no-fallback/
│   │   │   │   │   │   │       └── [slug].js
│   │   │   │   │   │   ├── gssp/
│   │   │   │   │   │   │   ├── [slug].js
│   │   │   │   │   │   │   └── index.js
│   │   │   │   │   │   ├── index.js
│   │   │   │   │   │   ├── links.js
│   │   │   │   │   │   └── not-found/
│   │   │   │   │   │       ├── fallback/
│   │   │   │   │   │       │   └── [slug].js
│   │   │   │   │   │       └── index.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── hello.txt
│   │   │   │   ├── 00-i18n-support-root-catchall/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   └── [[...slug]].js
│   │   │   │   │   └── public/
│   │   │   │   │       └── hello.txt
│   │   │   │   ├── 00-optional-fallback-revalidate/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── [[...slug]].js
│   │   │   │   │   │   └── posts/
│   │   │   │   │   │       └── [[...slug]].js
│   │   │   │   │   └── vercel.json
│   │   │   │   ├── 00-public-dir-output-dir/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── web/
│   │   │   │   │       ├── pages/
│   │   │   │   │       │   ├── dynamic/
│   │   │   │   │       │   │   └── [slug].js
│   │   │   │   │       │   ├── dynamic-ssr/
│   │   │   │   │       │   │   └── [slug].js
│   │   │   │   │       │   └── index.js
│   │   │   │   │       └── public/
│   │   │   │   │           ├── hello.txt
│   │   │   │   │           └── public/
│   │   │   │   │               └── data.txt
│   │   │   │   ├── 00-root-optional-revalidate/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── [[...slug]].js
│   │   │   │   ├── 00-shared-lambdas/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── [teamSlug]/
│   │   │   │   │       │   └── [project]/
│   │   │   │   │       │       └── [id].js
│   │   │   │   │       ├── groups/
│   │   │   │   │       │   └── [id].js
│   │   │   │   │       └── teams/
│   │   │   │   │           └── invite/
│   │   │   │   │               └── [inviteCode].js
│   │   │   │   ├── 00-trailing-slash-add-export/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── 404.js
│   │   │   │   │       └── foo.js
│   │   │   │   ├── 00-trailing-slash-remove/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── abc/
│   │   │   │   │   │   │   └── def.js
│   │   │   │   │   │   └── foo.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── test.txt
│   │   │   │   ├── 01-cache-headers/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── [team]/
│   │   │   │   │       │   ├── [project]/
│   │   │   │   │       │   │   ├── [deployment]/
│   │   │   │   │       │   │   │   ├── [another]/
│   │   │   │   │       │   │   │   │   ├── [final]/
│   │   │   │   │       │   │   │   │   │   └── index.js
│   │   │   │   │       │   │   │   │   └── index.js
│   │   │   │   │       │   │   │   └── index.js
│   │   │   │   │       │   │   └── index.js
│   │   │   │   │       │   └── index.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 03-next-8/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── hello1.js
│   │   │   │   │       └── nested/
│   │   │   │   │           └── hello2.js
│   │   │   │   ├── 04-firebase-node-10/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── nested/
│   │   │   │   │           ├── fb.js
│   │   │   │   │           └── moar/
│   │   │   │   │               └── [dynamic_fb].js
│   │   │   │   ├── 05-spr-support/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── api/
│   │   │   │   │       │   └── noop.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── lambda.js
│   │   │   │   ├── 06-lambda-with-memory/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── src/
│   │   │   │   │       └── pages/
│   │   │   │   │           └── api/
│   │   │   │   │               ├── index.js
│   │   │   │   │               ├── memory.js
│   │   │   │   │               └── sub/
│   │   │   │   │                   ├── another.ts
│   │   │   │   │                   └── index.ts
│   │   │   │   ├── 07-custom-routes/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── hello.js
│   │   │   │   │       └── params.js
│   │   │   │   ├── 08-custom-routes-catchall/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── hello.js
│   │   │   │   │       └── params.js
│   │   │   │   ├── 09-yarn-workspaces/
│   │   │   │   │   ├── .gitignore
│   │   │   │   │   ├── lerna.json
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── packages/
│   │   │   │   │       ├── common/
│   │   │   │   │       │   ├── dist/
│   │   │   │   │       │   │   ├── index.d.ts
│   │   │   │   │       │   │   └── index.js
│   │   │   │   │       │   ├── package.json
│   │   │   │   │       │   ├── src/
│   │   │   │   │       │   │   └── index.ts
│   │   │   │   │       │   └── tsconfig.json
│   │   │   │   │       └── web/
│   │   │   │   │           ├── next-env.d.ts
│   │   │   │   │           ├── next.config.js
│   │   │   │   │           ├── package.json
│   │   │   │   │           ├── pages/
│   │   │   │   │           │   ├── _app.tsx
│   │   │   │   │           │   └── index.tsx
│   │   │   │   │           └── tsconfig.json
│   │   │   │   ├── 10-export-cache-headers/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── 11-export-clean-urls/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── about.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 12-no-export-auto/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── about.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 13-export-custom-routes/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── about.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 14-next-offline/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── about.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 16-base-path/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── api/
│   │   │   │   │       │   ├── [slug]/
│   │   │   │   │       │   │   ├── another.js
│   │   │   │   │       │   │   └── index.js
│   │   │   │   │       │   └── hello.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── comments.js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── blog-ssg/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── comments.js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 17-static-404/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── 18-ssg-fallback-support/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── api/
│   │   │   │   │       │   └── noop.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── lambda.js
│   │   │   │   ├── 19-pages-404/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── 404.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 20-pages-404-lambda/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── 404.js
│   │   │   │   │       ├── _app.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 21-server-props/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── lambda.js
│   │   │   │   ├── 22-ssg-v2/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── api/
│   │   │   │   │       │   └── noop.js
│   │   │   │   │       ├── api-docs/
│   │   │   │   │       │   └── [...slug].js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       ├── lambda.js
│   │   │   │   │       └── nofallback/
│   │   │   │   │           └── [slug].js
│   │   │   │   ├── 22-ssg-v2-catchall/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── [...path].js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 23-custom-routes-verbose/
│   │   │   │   │   ├── .gitignore
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── a/
│   │   │   │   │   │   │   └── catch-all.js
│   │   │   │   │   │   ├── another/
│   │   │   │   │   │   │   └── [id].js
│   │   │   │   │   │   ├── api/
│   │   │   │   │   │   │   ├── dynamic/
│   │   │   │   │   │   │   │   └── [slug].js
│   │   │   │   │   │   │   └── hello.js
│   │   │   │   │   │   ├── b/
│   │   │   │   │   │   │   └── [123].js
│   │   │   │   │   │   ├── blog/
│   │   │   │   │   │   │   └── [post]/
│   │   │   │   │   │   │       └── index.js
│   │   │   │   │   │   ├── c/
│   │   │   │   │   │   │   └── [alongparamnameshouldbeallowedeventhoughweird].js
│   │   │   │   │   │   ├── catchall-dash/
│   │   │   │   │   │   │   └── [...hello-world].js
│   │   │   │   │   │   ├── dash/
│   │   │   │   │   │   │   └── [hello-world].js
│   │   │   │   │   │   ├── docs/
│   │   │   │   │   │   │   └── v2/
│   │   │   │   │   │   │       └── more/
│   │   │   │   │   │   │           └── now-for-github.js
│   │   │   │   │   │   ├── hello-again.js
│   │   │   │   │   │   ├── hello.js
│   │   │   │   │   │   ├── multi-rewrites.js
│   │   │   │   │   │   ├── nav.js
│   │   │   │   │   │   ├── params.js
│   │   │   │   │   │   ├── redirect-override.js
│   │   │   │   │   │   └── with-params.js
│   │   │   │   │   └── public/
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── data.json
│   │   │   │   │       └── static/
│   │   │   │   │           └── hello.txt
│   │   │   │   ├── 24-custom-output-dir/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── ssg/
│   │   │   │   │           └── [slug].js
│   │   │   │   ├── 25-index-routes/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── api/
│   │   │   │   │       │   └── sub/
│   │   │   │   │       │       ├── [id].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       ├── nested-index/
│   │   │   │   │       │   └── index/
│   │   │   │   │       │       └── index.js
│   │   │   │   │       └── sub/
│   │   │   │   │           ├── [id].js
│   │   │   │   │           └── index.js
│   │   │   │   ├── 25-mono-repo-404/
│   │   │   │   │   ├── .gitignore
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── packages/
│   │   │   │   │   │   └── webapp/
│   │   │   │   │   │       ├── next.config.js
│   │   │   │   │   │       ├── package.json
│   │   │   │   │   │       └── pages/
│   │   │   │   │   │           ├── 404.js
│   │   │   │   │   │           └── index.js
│   │   │   │   │   └── vercel.json
│   │   │   │   ├── 26-mono-repo-404-lambda/
│   │   │   │   │   ├── .gitignore
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── packages/
│   │   │   │   │       └── webapp/
│   │   │   │   │           ├── next.config.js
│   │   │   │   │           ├── package.json
│   │   │   │   │           └── pages/
│   │   │   │   │               ├── 404.js
│   │   │   │   │               ├── _app.js
│   │   │   │   │               └── index.js
│   │   │   │   ├── 27-non-word-param/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── [...path-segments].js
│   │   │   │   │       └── index.js
│   │   │   │   ├── 27-preview-mode/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── api/
│   │   │   │   │       │   ├── disable.js
│   │   │   │   │       │   └── enable.js
│   │   │   │   │       └── docs/
│   │   │   │   │           ├── [...rest].js
│   │   │   │   │           └── index.js
│   │   │   │   ├── 28-nested-public/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   └── index.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── republic/
│   │   │   │   │           └── test.txt
│   │   │   │   ├── 29-ssg-all-static/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── another-index/
│   │   │   │   │       │   └── index.js
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── nofallback/
│   │   │   │   │           └── [slug].js
│   │   │   │   ├── 29-ssg-all-static-custom-404/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── 404.js
│   │   │   │   │       ├── another.js
│   │   │   │   │       ├── another2.js
│   │   │   │   │       ├── blog/
│   │   │   │   │       │   └── [post]/
│   │   │   │   │       │       ├── [comment].js
│   │   │   │   │       │       └── index.js
│   │   │   │   │       ├── forever.js
│   │   │   │   │       ├── index.js
│   │   │   │   │       └── nofallback/
│   │   │   │   │           └── [slug].js
│   │   │   │   ├── 30-monorepo-no-script/
│   │   │   │   │   ├── .gitignore
│   │   │   │   │   ├── babel.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── packages/
│   │   │   │   │       └── www/
│   │   │   │   │           ├── next.config.js
│   │   │   │   │           ├── package.json
│   │   │   │   │           └── pages/
│   │   │   │   │               └── index.jsx
│   │   │   │   ├── 31-blocking-fallback/
│   │   │   │   │   ├── additional.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── fixed/
│   │   │   │   │       │   └── [slug].js
│   │   │   │   │       └── regenerated/
│   │   │   │   │           └── [slug].js
│   │   │   │   └── 32-custom-install-command/
│   │   │   │       ├── .gitignore
│   │   │   │       ├── .yarn/
│   │   │   │       │   └── releases/
│   │   │   │       │       └── yarn-berry.cjs
│   │   │   │       ├── .yarnrc.yml
│   │   │   │       ├── install.js
│   │   │   │       ├── next.config.js
│   │   │   │       ├── package.json
│   │   │   │       ├── pages/
│   │   │   │       │   └── index.js
│   │   │   │       └── vercel.json
│   │   │   ├── integration/
│   │   │   │   ├── gip-gsp-404/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── 404.js
│   │   │   │   │       ├── _app.js
│   │   │   │   │       ├── api/
│   │   │   │   │       │   └── hello.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── index.test.js
│   │   │   │   ├── legacy-custom-dependency/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── legacy-standard/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── legacy-static-files/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   └── index.js
│   │   │   │   │   └── static/
│   │   │   │   │       └── test.txt
│   │   │   │   ├── monorepo/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── shared/
│   │   │   │   │   │   └── hello.js
│   │   │   │   │   └── www/
│   │   │   │   │       ├── next.config.js
│   │   │   │   │       ├── package.json
│   │   │   │   │       ├── pages/
│   │   │   │   │       │   └── index.js
│   │   │   │   │       ├── public/
│   │   │   │   │       │   └── data.txt
│   │   │   │   │       └── static/
│   │   │   │   │           └── test.txt
│   │   │   │   ├── no-package-json-and-next-config/
│   │   │   │   │   ├── now.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── postinstall/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   ├── goodbye.js
│   │   │   │   │   │   └── index.js
│   │   │   │   │   ├── postinstall.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── .gitkeep
│   │   │   │   ├── public-files/
│   │   │   │   │   ├── create-public-file.js
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   └── index.js
│   │   │   │   │   └── public/
│   │   │   │   │       └── robots.txt
│   │   │   │   ├── serverless-config/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── serverless-config-async/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── serverless-config-monorepo-missing/
│   │   │   │   │   ├── nested/
│   │   │   │   │   │   ├── package.json
│   │   │   │   │   │   └── pages/
│   │   │   │   │   │       ├── goodbye.js
│   │   │   │   │   │       └── index.js
│   │   │   │   │   └── now.json
│   │   │   │   ├── serverless-config-monorepo-present/
│   │   │   │   │   ├── nested/
│   │   │   │   │   │   ├── next.config.js
│   │   │   │   │   │   ├── package.json
│   │   │   │   │   │   └── pages/
│   │   │   │   │   │       ├── goodbye.js
│   │   │   │   │   │       └── index.js
│   │   │   │   │   └── now.json
│   │   │   │   ├── serverless-config-object/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── serverless-config-promise/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── serverless-no-config/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── serverless-no-config-build/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       └── index.js
│   │   │   │   ├── standard/
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   └── pages/
│   │   │   │   │       ├── goodbye.js
│   │   │   │   │       └── index.js
│   │   │   │   ├── static-files/
│   │   │   │   │   ├── next.config.js
│   │   │   │   │   ├── now.json
│   │   │   │   │   ├── package.json
│   │   │   │   │   ├── pages/
│   │   │   │   │   │   └── index.js
│   │   │   │   │   └── static/
│   │   │   │   │       └── test.txt
│   │   │   │   └── static-site/
│   │   │   │       ├── package.json
│   │   │   │       ├── pages/
│   │   │   │       │   ├── another.js
│   │   │   │       │   ├── dynamic.js
│   │   │   │       │   └── index.js
│   │   │   │       └── vercel.json
│   │   │   ├── lib/
│   │   │   │   └── run-build-lambda.js
│   │   │   ├── unit/
│   │   │   │   ├── __snapshots__/
│   │   │   │   │   └── utils.test.js.snap
│   │   │   │   ├── build.test.js
│   │   │   │   ├── export.test.js
│   │   │   │   ├── fixtures/
│   │   │   │   │   ├── entry/
│   │   │   │   │   │   └── next.config.js
│   │   │   │   │   └── next.config.js
│   │   │   │   └── utils.test.js
│   │   │   └── utils.js
│   │   └── tsconfig.json
│   └── tf-next/
│       ├── .gitignore
│       ├── README.md
│       ├── index.js
│       ├── package.json
│       ├── src/
│       │   ├── client/
│       │   │   ├── aws-profile.ts
│       │   │   ├── client.ts
│       │   │   ├── index.ts
│       │   │   └── services/
│       │   │       ├── api/
│       │   │       │   ├── api.ts
│       │   │       │   ├── index.ts
│       │   │       │   └── middleware.ts
│       │   │       └── output/
│       │   │           ├── create-spinner.ts
│       │   │           ├── index.ts
│       │   │           └── output.ts
│       │   ├── commands/
│       │   │   ├── alias/
│       │   │   │   ├── alias-list.ts
│       │   │   │   ├── alias-remove.ts
│       │   │   │   ├── alias-set.ts
│       │   │   │   ├── alias.ts
│       │   │   │   └── index.ts
│       │   │   ├── build/
│       │   │   │   ├── build.ts
│       │   │   │   └── index.ts
│       │   │   ├── deploy/
│       │   │   │   ├── deploy.ts
│       │   │   │   └── index.ts
│       │   │   ├── deployment/
│       │   │   │   ├── deployment-list.ts
│       │   │   │   ├── deployment-remove.ts
│       │   │   │   ├── deployment.ts
│       │   │   │   └── index.ts
│       │   │   └── main.ts
│       │   ├── index.ts
│       │   ├── middleware/
│       │   │   └── global.ts
│       │   ├── types.ts
│       │   └── utils/
│       │       ├── errors/
│       │       │   ├── cli-error.ts
│       │       │   ├── errors.ts
│       │       │   ├── index.ts
│       │       │   └── response-error.ts
│       │       ├── index.ts
│       │       ├── project-config.ts
│       │       ├── routes.ts
│       │       ├── strlen.ts
│       │       └── trim-protocol.ts
│       └── tsconfig.json
├── patches/
│   └── aws-cdk-lib+2.25.0.patch
├── scripts/
│   └── publish-release.sh
├── test/
│   ├── README.md
│   ├── build-fixtures.js
│   ├── fixtures/
│   │   ├── 00-shared-lambdas/
│   │   │   ├── next.config.js
│   │   │   ├── package.json
│   │   │   ├── pages/
│   │   │   │   ├── [teamSlug]/
│   │   │   │   │   └── [project]/
│   │   │   │   │       └── [id].js
│   │   │   │   ├── groups/
│   │   │   │   │   └── [id].js
│   │   │   │   ├── products/
│   │   │   │   │   └── [pid]/
│   │   │   │   │       └── index.js
│   │   │   │   └── teams/
│   │   │   │       └── invite/
│   │   │   │           └── [inviteCode].js
│   │   │   └── probes.json
│   │   ├── 00-trailing-slash-add/
│   │   │   ├── next.config.js
│   │   │   ├── package.json
│   │   │   ├── pages/
│   │   │   │   ├── abc/
│   │   │   │   │   └── def.js
│   │   │   │   ├── api/
│   │   │   │   │   └── hello.js
│   │   │   │   ├── blog/
│   │   │   │   │   └── [post].js
│   │   │   │   └── foo.js
│   │   │   ├── probes.json
│   │   │   └── public/
│   │   │       └── test.txt
│   │   ├── 01-custom-routing/
│   │   │   ├── next.config.js
│   │   │   ├── package.json
│   │   │   ├── pages/
│   │   │   │   ├── hello.js
│   │   │   │   ├── index.js
│   │   │   │   └── param.js
│   │   │   └── probes.json
│   │   ├── 02-api/
│   │   │   ├── next.config.js
│   │   │   ├── package.json
│   │   │   ├── pages/
│   │   │   │   ├── api/
│   │   │   │   │   ├── actions/
│   │   │   │   │   │   └── [actionId]/
│   │   │   │   │   │       └── info.js
│   │   │   │   │   ├── host.js
│   │   │   │   │   ├── index.js
│   │   │   │   │   └── viewer-header.js
│   │   │   │   └── test.js
│   │   │   └── probes.json
│   │   └── 03-yarn-workspaces/
│   │       ├── lerna.json
│   │       ├── package.json
│   │       ├── packages/
│   │       │   ├── common/
│   │       │   │   ├── dist/
│   │       │   │   │   ├── index.d.ts
│   │       │   │   │   └── index.js
│   │       │   │   ├── package.json
│   │       │   │   ├── src/
│   │       │   │   │   └── index.ts
│   │       │   │   └── tsconfig.json
│   │       │   └── web/
│   │       │       ├── next-env.d.ts
│   │       │       ├── next.config.js
│   │       │       ├── package.json
│   │       │       ├── pages/
│   │       │       │   ├── _app.tsx
│   │       │       │   └── index.tsx
│   │       │       └── tsconfig.json
│   │       └── probes.json
│   ├── jest.setup.ts
│   ├── routes.test.ts
│   ├── tsconfig.json
│   └── utils/
│       ├── attach-logger.ts
│       ├── host-ip-address.ts
│       ├── index.ts
│       └── s3-create-bucket.ts
├── test.env
├── tsconfig.json
├── turbo.json
├── variables.tf
└── versions.tf
Download .txt
Showing preview only (2,662K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3319 symbols across 309 files)

FILE: examples/atomic-deployments/pages/index.js
  function IndexPage (line 1) | function IndexPage() {

FILE: examples/complete/next.config.js
  method rewrites (line 2) | async rewrites() {
  method redirects (line 11) | async redirects() {

FILE: examples/complete/pages/about.js
  function About (line 3) | function About() {

FILE: examples/complete/pages/index.js
  function getServerSideProps (line 8) | async function getServerSideProps() {
  function Index (line 13) | function Index({ initialPropsCounter }) {

FILE: examples/complete/pages/test/[...slug].js
  function getServerSideProps (line 9) | async function getServerSideProps(ctx) {
  function Index (line 21) | function Index({

FILE: examples/next-image/pages/_app.js
  function MyApp (line 3) | function MyApp({ Component, pageProps }) {

FILE: examples/static/pages/about.js
  function AboutPage (line 1) | function AboutPage() {

FILE: examples/static/pages/blog/index.js
  function BlogPage (line 1) | function BlogPage() {

FILE: examples/static/pages/index.js
  function IndexPage (line 1) | function IndexPage() {

FILE: examples/with-custom-domain/pages/index.js
  function IndexPage (line 1) | function IndexPage() {

FILE: examples/with-existing-cloudfront/pages/index.js
  function getServerSideProps (line 6) | async function getServerSideProps() {
  function Index (line 11) | function Index({ initialPropsCounter }) {

FILE: packages/api/schema.ts
  type paths (line 6) | interface paths {
  type components (line 142) | interface components {
  type operations (line 197) | interface operations {}
  type external (line 199) | interface external {}

FILE: packages/api/src/actions/alias/alias-utils.ts
  type LikeRouteItem (line 4) | type LikeRouteItem = {
  function generateAliasId (line 14) | function generateAliasId<T extends LikeRouteItem>(routeItem: T) {

FILE: packages/api/src/actions/alias/create-or-update-alias.ts
  type SuccessResponse (line 16) | type SuccessResponse =
  type ErrorResponse (line 18) | type ErrorResponse =
  class CreateOrUpdateAliasPayload (line 21) | class CreateOrUpdateAliasPayload {
  function createOrUpdateAlias (line 44) | async function createOrUpdateAlias(

FILE: packages/api/src/actions/alias/delete-alias-by-id.ts
  type ErrorResponse (line 13) | type ErrorResponse =
  type NotFoundResponse (line 15) | type NotFoundResponse =
  class DeleteAliasRequestParams (line 18) | class DeleteAliasRequestParams {
  function deleteAliasById (line 32) | async function deleteAliasById(req: Request, res: Response) {

FILE: packages/api/src/actions/alias/list-aliases.ts
  type NotFoundResponse (line 11) | type NotFoundResponse =
  type ErrorResponse (line 13) | type ErrorResponse =
  type SuccessResponse (line 15) | type SuccessResponse =
  constant PAGE_LIMIT (line 21) | const PAGE_LIMIT = 25;
  constant START_AT_KEY_SPLIT_CHAR (line 22) | const START_AT_KEY_SPLIT_CHAR = '#';
  function listAliases (line 24) | async function listAliases(

FILE: packages/api/src/actions/deployment/create-deployment.ts
  type SuccessResponse (line 10) | type SuccessResponse =
  constant UPLOAD_LINK_EXPIRES_SECONDS (line 13) | const UPLOAD_LINK_EXPIRES_SECONDS = 60 * 5;
  constant DEPLOYMENT_ID_META_KEY (line 15) | const DEPLOYMENT_ID_META_KEY = 'x-amz-meta-tf-next-deployment-id';
  function generateRandomDeploymentId (line 17) | function generateRandomDeploymentId() {
  function createDeployment (line 21) | async function createDeployment(

FILE: packages/api/src/actions/deployment/delete-deployment-by-id.ts
  type SuccessResponse (line 16) | type SuccessResponse =
  type ErrorResponse (line 18) | type ErrorResponse =
  constant RESPONSE_DEPLOYMENT_DELETION_FAILED (line 21) | const RESPONSE_DEPLOYMENT_DELETION_FAILED: ErrorResponse = {
  function deleteDeploymentById (line 27) | async function deleteDeploymentById(

FILE: packages/api/src/actions/deployment/get-deployment-by-id.ts
  type SuccessResponse (line 8) | type SuccessResponse =
  type NotFoundResponse (line 10) | type NotFoundResponse =
  function getDeploymentById (line 13) | async function getDeploymentById(

FILE: packages/api/src/actions/deployment/list-deployments.ts
  constant PAGE_LIMIT (line 11) | const PAGE_LIMIT = 25;
  constant START_AT_KEY_SPLIT_CHAR (line 12) | const START_AT_KEY_SPLIT_CHAR = '#';
  type SuccessResponse (line 14) | type SuccessResponse =
  function listDeployments (line 17) | async function listDeployments(

FILE: packages/api/src/api.ts
  function createApi (line 15) | function createApi() {

FILE: packages/api/src/declarations.d.ts
  type ProcessEnv (line 2) | interface ProcessEnv {

FILE: packages/api/src/handler.ts
  function handler (line 7) | async function handler(event: APIGatewayProxyEvent, context: Context) {

FILE: packages/api/src/serializers/deployment.ts
  type Deployment (line 5) | type Deployment = components['schemas']['Deployment'];
  type DeploymentDefaultSerializerInput (line 11) | type DeploymentDefaultSerializerInput = Pick<
  function deploymentDefaultSerializer (line 16) | function deploymentDefaultSerializer<

FILE: packages/api/src/services/cloudformation.ts
  type CloudFormationServiceType (line 3) | type CloudFormationServiceType = typeof CloudFormationService;
  class CloudFormationService (line 5) | class CloudFormationService {
    method deleteStack (line 6) | static async deleteStack(stackName: string): Promise<void> {

FILE: packages/api/src/services/dynamodb.ts
  type DynamoDBServiceType (line 3) | type DynamoDBServiceType = typeof DynamoDBService;
  class DynamoDBService (line 5) | class DynamoDBService {
    method getDynamoDBClient (line 8) | static getDynamoDBClient() {
    method getAliasTableName (line 18) | static getAliasTableName() {
    method getDeploymentTableName (line 22) | static getDeploymentTableName() {

FILE: packages/api/src/services/s3.ts
  type S3ServiceType (line 3) | type S3ServiceType = typeof S3Service;
  class S3Service (line 5) | class S3Service {
    method getS3Client (line 8) | static getS3Client(): S3 {
    method getUploadBucketName (line 18) | static getUploadBucketName(): string {

FILE: packages/api/test/actions/deployment/delete-deployment-by-id.test.ts
  function mockFailedCloudFormationService (line 63) | function mockFailedCloudFormationService(): CloudFormationServiceType {

FILE: packages/api/test/test-utils.ts
  function createS3Bucket (line 20) | async function createS3Bucket(
  function mockS3Service (line 62) | async function mockS3Service(): Promise<[S3ServiceType, () => Promise<vo...
  function mockDynamoDBService (line 92) | async function mockDynamoDBService(): Promise<
  function mockCloudFormationService (line 128) | function mockCloudFormationService(): CloudFormationServiceType {
  type CreateAPIGatewayProxyEventV2Options (line 136) | type CreateAPIGatewayProxyEventV2Options = {
  function createAPIGatewayProxyEventV2 (line 142) | function createAPIGatewayProxyEventV2({

FILE: packages/deploy-controller/src/controller.ts
  type ControllerOptions (line 18) | type ControllerOptions = {
  type RuntimeOptions (line 23) | type RuntimeOptions = {
  class Controller (line 28) | class Controller {
    method constructor (line 32) | constructor({ dynamoDBClient, cloudFormationClient }: ControllerOption...
  function createController (line 183) | function createController(options: ControllerOptions) {

FILE: packages/deploy-controller/src/declarations.d.ts
  type ProcessEnv (line 2) | interface ProcessEnv {

FILE: packages/deploy-controller/src/handler.ts
  function handler (line 21) | async function handler(event: SNSEvent) {

FILE: packages/deploy-controller/src/utils/ensure-env.ts
  function ensureEnv (line 4) | function ensureEnv(key: string, defaultValue?: string): string {

FILE: packages/deploy-controller/src/utils/parse-cloudformation-event.ts
  type ResourceType (line 3) | type ResourceType = 'AWS::CloudFormation::Stack' | string;
  type CloudFormationEvent (line 5) | type CloudFormationEvent = {
  constant LINE (line 27) | const LINE =
  function parseCloudFormationEvent (line 35) | function parseCloudFormationEvent(

FILE: packages/deploy-controller/src/utils/parse-lambda-routes.ts
  function parseLambdaRoutes (line 6) | function parseLambdaRoutes(input: string): Record<string, string> {

FILE: packages/deploy-controller/test/test-utils.ts
  type CreateTestMessageOptions (line 3) | type CreateTestMessageOptions = {
  function createTestMessage (line 36) | function createTestMessage(options: CreateTestMessageOptions = {}): stri...
  function createTestSNSEvent (line 59) | function createTestSNSEvent(options: CreateTestMessageOptions = {}): SNS...

FILE: packages/deploy-trigger/src/cdk/aws-construct-function-urls.ts
  type AtomicDeploymentOptions (line 14) | type AtomicDeploymentOptions = {
  class AtomicDeploymentFunctionUrls (line 29) | class AtomicDeploymentFunctionUrls extends Stack {
    method constructor (line 30) | constructor({

FILE: packages/deploy-trigger/src/cdk/aws-construct.ts
  type AtomicDeploymentOptions (line 20) | type AtomicDeploymentOptions = {
  class AtomicDeploymentAPIGateway (line 35) | class AtomicDeploymentAPIGateway extends Stack {
    method constructor (line 36) | constructor({

FILE: packages/deploy-trigger/src/cdk/cdk-utils.ts
  function getRuntime (line 5) | function getRuntime(runtimeIdentifier: SupportedRuntime | string) {

FILE: packages/deploy-trigger/src/cdk/create-cloudformation-stack.ts
  type CreateCloudFormationStackReturnValue (line 6) | type CreateCloudFormationStackReturnValue = {
  type CreateCloudFormationStackOptions (line 13) | type CreateCloudFormationStackOptions = {
  function createCloudFormationStack (line 27) | async function createCloudFormationStack({

FILE: packages/deploy-trigger/src/cdk/to-cloudformation.ts
  function toCloudFormation (line 12) | function toCloudFormation(stack: Stack) {

FILE: packages/deploy-trigger/src/create-invalidation.ts
  function prepareInvalidations (line 15) | function prepareInvalidations(invalidationPaths: string[]) {
  function createInvalidationChunk (line 79) | function createInvalidationChunk(
  function createInvalidation (line 115) | function createInvalidation(

FILE: packages/deploy-trigger/src/declarations.d.ts
  type ProcessEnv (line 2) | interface ProcessEnv {

FILE: packages/deploy-trigger/src/deploy-trigger.ts
  constant DEPLOYMENT_ID_META_KEY (line 14) | const DEPLOYMENT_ID_META_KEY = 'tf-next-deployment-id';
  type Props (line 31) | interface Props {
  type Response (line 38) | interface Response {
  function deployTrigger (line 45) | async function deployTrigger({

FILE: packages/deploy-trigger/src/get-or-create-manifest.ts
  function getAllObjectsFromBucket (line 7) | async function getAllObjectsFromBucket(
  function getOrCreateManifest (line 37) | async function getOrCreateManifest(

FILE: packages/deploy-trigger/src/handler.ts
  type InvalidationSQSMessage (line 30) | interface InvalidationSQSMessage {
  function parseExpireAfterDays (line 47) | function parseExpireAfterDays() {
  function createCloudFrontInvalidation (line 51) | async function createCloudFrontInvalidation(
  function s3Handler (line 139) | async function s3Handler(Record: S3EventRecord) {
  function sqsHandler (line 293) | async function sqsHandler(Record: SQSRecord) {

FILE: packages/deploy-trigger/src/types.ts
  type SupportedRuntime (line 6) | type SupportedRuntime = 'nodejs12.x' | 'nodejs14.x' | 'nodejs16.x';
  type LambdaDefinition (line 8) | type LambdaDefinition = {
  type DeploymentConfig (line 31) | type DeploymentConfig = {
  type ExpireValue (line 53) | type ExpireValue = number | 'never';
  type ManifestFile (line 55) | interface ManifestFile {
  type Manifest (line 61) | interface Manifest {
  type FileResult (line 68) | interface FileResult {

FILE: packages/deploy-trigger/src/update-manifest.ts
  function expireFiles (line 11) | async function expireFiles(s3: S3, bucketId: string, files: string[]) {
  function removeExpirationFromFiles (line 52) | async function removeExpirationFromFiles(
  function deleteFiles (line 81) | async function deleteFiles(s3: S3, bucketId: string, files: string[]) {
  function getInvalidationKeys (line 96) | function getInvalidationKeys(files: string[]) {
  type Props (line 136) | interface Props {
  type Response (line 146) | interface Response {
  function updateManifest (line 160) | async function updateManifest({

FILE: packages/deploy-trigger/src/utils/ensure-env.ts
  function ensureEnv (line 4) | function ensureEnv(key: string, defaultValue?: string): string {

FILE: packages/deploy-trigger/src/utils/random-id.ts
  function generateRandomId (line 3) | function generateRandomId(length: number) {
  function generateRandomBuildId (line 7) | function generateRandomBuildId() {

FILE: packages/deploy-trigger/test/test-utils.ts
  function generateS3ClientForTesting (line 10) | function generateS3ClientForTesting() {
  function generateZipBundle (line 25) | async function generateZipBundle(
  function addFilesToS3Bucket (line 49) | function addFilesToS3Bucket(

FILE: packages/dynamodb-actions/src/alias/create-alias.ts
  type CreatedRouteItem (line 7) | type CreatedRouteItem = Pick<
  type CreateAliasOptions (line 24) | type CreateAliasOptions = {
  function createAlias (line 74) | async function createAlias({

FILE: packages/dynamodb-actions/src/alias/delete-alias-by-id.ts
  type DeleteAliasByIdBaseOptions (line 5) | interface DeleteAliasByIdBaseOptions {
  type DeleteAliasByIdHostnameOptions (line 19) | interface DeleteAliasByIdHostnameOptions extends DeleteAliasByIdBaseOpti...
  type DeleteAliasByIdKeyOptions (line 33) | interface DeleteAliasByIdKeyOptions extends DeleteAliasByIdBaseOptions {
  type DeleteAliasByIdOptions (line 40) | type DeleteAliasByIdOptions =
  function deleteAliasById (line 44) | async function deleteAliasById(options: DeleteAliasByIdOptions) {

FILE: packages/dynamodb-actions/src/alias/get-alias-by-hostname.ts
  type GetAliasByHostnameOptions (line 7) | type GetAliasByHostnameOptions = {
  function getAliasByHostname (line 26) | async function getAliasByHostname({

FILE: packages/dynamodb-actions/src/alias/get-alias-by-id.ts
  type GetAliasByIdOptions (line 7) | type GetAliasByIdOptions = {
  function getAliasById (line 30) | async function getAliasById({

FILE: packages/dynamodb-actions/src/alias/list-aliases-for-deployment.ts
  type StartKey (line 7) | type StartKey = {
  type ListAliasesForDeploymentOptions (line 14) | type ListAliasesForDeploymentOptions = {
  type ListAliasesResult (line 37) | type ListAliasesResult = {
  function listAliasesForDeployment (line 48) | async function listAliasesForDeployment({

FILE: packages/dynamodb-actions/src/deployment/create-deployment.ts
  type CreatedDeploymentItem (line 7) | type CreatedDeploymentItem = Pick<
  type CreateDeploymentOptions (line 19) | type CreateDeploymentOptions = {
  function createDeployment (line 45) | async function createDeployment({

FILE: packages/dynamodb-actions/src/deployment/delete-deployment-by-id.ts
  type DeleteDeploymentByIdOptions (line 8) | type DeleteDeploymentByIdOptions = {
  function deleteDeploymentById (line 29) | async function deleteDeploymentById({

FILE: packages/dynamodb-actions/src/deployment/get-deployment-by-id.ts
  type GetDeploymentByIdOptions (line 7) | type GetDeploymentByIdOptions = {
  function getDeploymentById (line 26) | async function getDeploymentById({

FILE: packages/dynamodb-actions/src/deployment/list-deployments.ts
  type StartKey (line 7) | type StartKey = {
  type ListDeploymentOptions (line 12) | type ListDeploymentOptions = {
  type ListDeploymentsResult (line 31) | type ListDeploymentsResult = {
  function listDeployments (line 45) | async function listDeployments({

FILE: packages/dynamodb-actions/src/deployment/update-deployment-status-create-failed.ts
  type UpdateDeploymentStatusCreateFailed (line 5) | type UpdateDeploymentStatusCreateFailed = {
  function updateDeploymentStatusCreateFailed (line 26) | function updateDeploymentStatusCreateFailed({

FILE: packages/dynamodb-actions/src/deployment/update-deployment-status-create-in-progress.ts
  type UpdateDeploymentStatusCreateInProgressOptions (line 5) | type UpdateDeploymentStatusCreateInProgressOptions = {
  function updateDeploymentStatusCreateInProgress (line 39) | function updateDeploymentStatusCreateInProgress({

FILE: packages/dynamodb-actions/src/deployment/update-deployment-status-destroy-failed.ts
  type UpdateDeploymentStatusDestroyFailed (line 5) | type UpdateDeploymentStatusDestroyFailed = {
  function updateDeploymentStatusDestroyFailed (line 26) | function updateDeploymentStatusDestroyFailed({

FILE: packages/dynamodb-actions/src/deployment/update-deployment-status-destroy-in-progress.ts
  type UpdateDeploymentStatusDestroyInProgress (line 5) | type UpdateDeploymentStatusDestroyInProgress = {
  function updateDeploymentStatusDestroyInProgress (line 26) | function updateDeploymentStatusDestroyInProgress({

FILE: packages/dynamodb-actions/src/deployment/update-deployment-status-destroy-requested.ts
  type UpdateDeploymentStatusDestroyRequested (line 5) | type UpdateDeploymentStatusDestroyRequested = {
  function updateDeploymentStatusDestroyRequested (line 26) | function updateDeploymentStatusDestroyRequested({

FILE: packages/dynamodb-actions/src/deployment/update-deployment-status-finished.ts
  type UpdateDeploymentStatusFinishedOptions (line 5) | type UpdateDeploymentStatusFinishedOptions = {
  function updateDeploymentStatusFinished (line 47) | function updateDeploymentStatusFinished({

FILE: packages/dynamodb-actions/src/deployment/update-deployment-status.ts
  type UpdateDeploymentStatusOptions (line 6) | type UpdateDeploymentStatusOptions = {
  function updateDeploymentStatus (line 35) | async function updateDeploymentStatus({

FILE: packages/dynamodb-actions/src/deployment/update-deployment.ts
  type UpdateDeploymentOptions (line 7) | type UpdateDeploymentOptions = {
  function updateDeployment (line 32) | async function updateDeployment({

FILE: packages/dynamodb-actions/src/types.ts
  type DeploymentTemplateType (line 4) | type DeploymentTemplateType = 'FUNCTION_URLS' | 'API_GATEWAY';
  type DeploymentItem (line 6) | type DeploymentItem = {
  type DeploymentItemCreateDateIndex (line 76) | type DeploymentItemCreateDateIndex = Pick<
  type RouteItem (line 81) | type RouteItem = {
  type RouteItemDeploymentIdIndex (line 143) | type RouteItemDeploymentIdIndex = Pick<
  type PaginatedQuery (line 156) | type PaginatedQuery<Item> = {

FILE: packages/dynamodb-actions/src/utils/dynamodb/update-item.ts
  type UpdateItemOptions (line 5) | type UpdateItemOptions = {
  function updateItem (line 31) | async function updateItem({ client, tableName, key, item }: UpdateItemOp...

FILE: packages/dynamodb-actions/src/utils/reverse-hostname.ts
  function reverseHostname (line 5) | function reverseHostname(hostname: string) {

FILE: packages/dynamodb-actions/test/test-utils.ts
  function createTestDynamoDBClient (line 5) | function createTestDynamoDBClient() {
  function createAliasTestTable (line 16) | async function createAliasTestTable(dynamoDBClient: DynamoDB) {
  function createDeploymentTestTable (line 91) | async function createDeploymentTestTable(dynamoDBClient: DynamoDB) {

FILE: packages/node-bridge/src/bridge.ts
  constant HEADER_KEY_X_FORWARDED_HOST (line 18) | const HEADER_KEY_X_FORWARDED_HOST = 'x-forwarded-host';
  constant HEADER_KEY_COOKIE (line 19) | const HEADER_KEY_COOKIE = 'cookie';
  constant HEADER_KEY_HOST (line 20) | const HEADER_KEY_HOST = 'host';
  type NowProxyRequest (line 22) | interface NowProxyRequest {
  type NowProxyResponse (line 29) | interface NowProxyResponse {
  type ServerLike (line 36) | interface ServerLike {
  function findInsensitiveKeyInObject (line 59) | function findInsensitiveKeyInObject(obj: Record<string, any>, key: strin...
  function normalizeAPIGatewayProxyEvent (line 76) | function normalizeAPIGatewayProxyEvent(
  class Bridge (line 136) | class Bridge {
    method constructor (line 144) | constructor(server?: ServerLike, shouldStoreEvents = false) {
    method setServer (line 161) | setServer(server: ServerLike) {
    method listen (line 165) | listen() {
    method launcher (line 206) | async launcher(
    method consumeEvent (line 323) | consumeEvent(reqId: string) {

FILE: packages/proxy-config/src/actions/deployment-file-exists.ts
  type DeploymentFileExistsOptions (line 7) | type DeploymentFileExistsOptions = {
  function deploymentFileExists (line 19) | async function deploymentFileExists({

FILE: packages/proxy-config/src/actions/get-alias.ts
  type GetAliasOptions (line 7) | type GetAliasOptions = {
  function getAlias (line 19) | async function getAlias({

FILE: packages/proxy-config/src/errors/not-found-error.ts
  class NotFoundError (line 3) | class NotFoundError extends Error {
    method toCloudFrontResponse (line 4) | toCloudFrontResponse(): CloudFrontResultResponse {

FILE: packages/proxy-config/src/handler.ts
  function handler (line 15) | async function handler(

FILE: packages/proxy-config/src/utils/get-env.ts
  function getEnv (line 6) | function getEnv(request: CloudFrontRequest, key: string) {

FILE: packages/proxy-config/src/utils/split-at-character.ts
  function splitAtCharacter (line 8) | function splitAtCharacter(

FILE: packages/proxy/src/actions/fetch-cached.ts
  type NodeFetch (line 4) | type NodeFetch = typeof import('node-fetch').default;
  constant FETCH_TIMEOUT (line 9) | const FETCH_TIMEOUT = 29500;
  function fetchCached (line 21) | async function fetchCached<Data extends { etag: string }>(

FILE: packages/proxy/src/actions/fetch-file-system.ts
  type NodeFetch (line 5) | type NodeFetch = typeof import('node-fetch').default;
  function fetchFileSystem (line 17) | function fetchFileSystem(

FILE: packages/proxy/src/actions/fetch-proxy-config.ts
  type NodeFetch (line 5) | type NodeFetch = typeof import('node-fetch').default;
  function fetchProxyConfig (line 14) | function fetchProxyConfig(

FILE: packages/proxy/src/error/alias-not-configured.ts
  class AliasNotConfigured (line 5) | class AliasNotConfigured extends Error {
    method toCloudFrontResponse (line 8) | toCloudFrontResponse(): CloudFrontResultResponse {

FILE: packages/proxy/src/error/missing-config.ts
  class MissingConfigError (line 8) | class MissingConfigError extends Error {
    method toCloudFrontResponse (line 9) | toCloudFrontResponse(): CloudFrontResultResponse {

FILE: packages/proxy/src/error/render-error.ts
  type RenderErrorOptions (line 5) | type RenderErrorOptions = {
  function renderError (line 20) | function renderError({

FILE: packages/proxy/src/handler.ts
  constant CACHE_TTL (line 31) | const CACHE_TTL = 60_000;
  function isRedirect (line 40) | function isRedirect(
  function handler (line 93) | async function handler(

FILE: packages/proxy/src/proxy.ts
  type NodeFetch (line 11) | type NodeFetch = typeof import('node-fetch').default;
  function parseUrl (line 21) | function parseUrl(url: string) {
  function appendURLSearchParams (line 35) | function appendURLSearchParams(
  class Proxy (line 49) | class Proxy {
    method constructor (line 54) | constructor(fetch: NodeFetch) {
    method checkFileSystem (line 70) | async checkFileSystem(
    method route (line 125) | async route(

FILE: packages/proxy/src/types.ts
  type HTTPHeaders (line 5) | type HTTPHeaders = Record<string, string>;
  type ProxyConfig (line 7) | interface ProxyConfig {
  type RouteResult (line 15) | interface RouteResult {
  type FileSystemEntry (line 42) | type FileSystemEntry = {

FILE: packages/proxy/src/util/append-querystring.ts
  function appendQuerystring (line 12) | function appendQuerystring(url: string, searchParams: URLSearchParams): ...

FILE: packages/proxy/src/util/custom-origin.ts
  function createCustomOriginFromUrl (line 13) | function createCustomOriginFromUrl(
  function createCustomOriginFromApiGateway (line 50) | function createCustomOriginFromApiGateway(
  function serveRequestFromCustomOrigin (line 74) | function serveRequestFromCustomOrigin(
  function serveRequestFromS3Origin (line 125) | function serveRequestFromS3Origin(

FILE: packages/proxy/src/util/etag-cache.ts
  class ETagCache (line 5) | class ETagCache<TData> {
    method constructor (line 22) | constructor() {
    method set (line 27) | set(key: string, value: TData, eTag: string) {
    method get (line 42) | get(key: string, eTag: string): TData | undefined {

FILE: packages/proxy/src/util/fetch-timeout.ts
  type NodeFetch (line 4) | type NodeFetch = typeof import('node-fetch').default;
  function fetchTimeout (line 13) | async function fetchTimeout(

FILE: packages/proxy/src/util/generate-cloudfront-headers.ts
  function generateCloudFrontHeaders (line 16) | function generateCloudFrontHeaders(

FILE: packages/proxy/src/util/get-env.ts
  function getEnv (line 8) | function getEnv(request: CloudFrontRequest, key: string) {

FILE: packages/proxy/src/util/is-url.ts
  function isURL (line 1) | function isURL(str: string): boolean {

FILE: packages/proxy/src/util/resolve-route-parameters.ts
  function resolveRouteParameters (line 9) | function resolveRouteParameters(

FILE: packages/proxy/src/util/ttl-cache.ts
  class TTLCache (line 11) | class TTLCache<T> {
    method constructor (line 32) | constructor(minTTL: number) {
    method set (line 39) | set(key: string, value: T, ttl: number = 0) {
    method get (line 60) | get(key: string): {
    method purgeStale (line 86) | purgeStale(time: number) {
    method updateTTL (line 106) | updateTTL(key: string, ttl: number = 0) {

FILE: packages/proxy/test/actions/fetch-cached.test.ts
  type CacheEntry (line 7) | type CacheEntry = {

FILE: packages/proxy/test/handler.test.ts
  class ConfigServer (line 13) | class ConfigServer {
    method start (line 18) | async start() {
    method stop (line 47) | stop() {

FILE: packages/proxy/test/test-utils.ts
  type GenerateCloudFrontRequestEventOptions (line 7) | type GenerateCloudFrontRequestEventOptions = {
  function generateCloudFrontRequestEvent (line 26) | function generateCloudFrontRequestEvent(
  function generateMockedFetchResponse (line 115) | function generateMockedFetchResponse(

FILE: packages/runtime/src/create-serverless-config.ts
  function getCustomData (line 7) | function getCustomData(importName: string, target: string) {
  function getDefaultData (line 39) | function getDefaultData(target: string) {
  function createServerlessConfig (line 43) | async function createServerlessConfig(

FILE: packages/runtime/src/index.ts
  type BuildParamsMeta (line 73) | interface BuildParamsMeta {
  type BuildParamsType (line 79) | interface BuildParamsType extends BuildOptions {
  constant MAX_AGE_ONE_YEAR (line 102) | const MAX_AGE_ONE_YEAR = 31536000;
  function readPackageJson (line 107) | async function readPackageJson(entryPath: string): Promise<PackageJson> {
  function writePackageJson (line 121) | async function writePackageJson(workPath: string, packageJson: PackageJs...
  function writeNpmRc (line 131) | async function writeNpmRc(workPath: string, token: string) {
  function getRealNextVersion (line 141) | function getRealNextVersion(entryPath: string): string | false {
  function getNextVersionRange (line 163) | async function getNextVersionRange(entryPath: string): Promise<string | ...
  function isLegacyNext (line 174) | function isLegacyNext(nextVersion: string) {
  function startDevServer (line 197) | function startDevServer(entryPath: string, runtimeEnv: EnvConfig) {
  function build (line 215) | async function build({

FILE: packages/runtime/src/utils.ts
  type stringMap (line 19) | type stringMap = { [key: string]: string };
  type EnvConfig (line 21) | interface EnvConfig {
  constant TEST_DYNAMIC_ROUTE (line 27) | const TEST_DYNAMIC_ROUTE = /\/\[[^\/]+?\](?=\/|$)/;
  function isDynamicRoute (line 29) | function isDynamicRoute(route: string): boolean {
  function validateEntrypoint (line 37) | function validateEntrypoint(entrypoint: string) {
  function excludeFiles (line 53) | function excludeFiles(
  function excludeLockFiles (line 71) | function excludeLockFiles(files: Files): Files {
  function normalizePackageJson (line 85) | function normalizePackageJson(
  function getNextConfig (line 133) | async function getNextConfig(workPath: string, entryPath: string) {
  function pathIsInside (line 147) | function pathIsInside(firstPath: string, secondPath: string) {
  function getPathsInside (line 151) | function getPathsInside(entryDirectory: string, files: Files) {
  function normalizePage (line 167) | function normalizePage(page: string): string {
  function getRoutes (line 177) | async function getRoutes(
  type Redirect (line 305) | type Redirect = NowRewrite & {
  type RoutesManifestRegex (line 310) | type RoutesManifestRegex = {
  type RoutesManifest (line 315) | type RoutesManifest = {
  function getRoutesManifest (line 347) | async function getRoutesManifest(
  function getDynamicRoutes (line 400) | async function getDynamicRoutes(
  type LoaderKey (line 522) | type LoaderKey = 'imgix' | 'cloudinary' | 'akamai' | 'default';
  type ImagesManifest (line 524) | type ImagesManifest = {
  function getImagesManifest (line 537) | async function getImagesManifest(
  function syncEnvVars (line 561) | function syncEnvVars(base: EnvConfig, removeEnv: EnvConfig, addEnv: EnvC...
  type PseudoLayer (line 577) | type PseudoLayer = {
  type PseudoFile (line 581) | type PseudoFile = {
  type PseudoSymbolicLink (line 589) | type PseudoSymbolicLink = {
  type PseudoLayerResult (line 608) | type PseudoLayerResult = {
  function createPseudoLayer (line 613) | async function createPseudoLayer(files: {
  type CreateLambdaFromPseudoLayersOptions (line 646) | interface CreateLambdaFromPseudoLayersOptions {
  function createLambdaFromPseudoLayers (line 660) | async function createLambdaFromPseudoLayers({
  type NextPrerenderedRoutes (line 741) | type NextPrerenderedRoutes = {
  function getExportIntent (line 774) | async function getExportIntent(
  function getExportStatus (line 808) | async function getExportStatus(
  function getPrerenderManifest (line 841) | async function getPrerenderManifest(
  function usesSrcDirectory (line 1048) | async function usesSrcDirectory(workPath: string): Promise<boolean> {
  function getSourceFilePathFromPage (line 1064) | async function getSourceFilePathFromPage({
  function isDirectory (line 1101) | function isDirectory(path: string) {
  function normalizeLocalePath (line 1105) | function normalizeLocalePath(
  function addLocaleOrDefault (line 1132) | function addLocaleOrDefault(

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/another.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/auto-export/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/dynamic/[slug].js
  function Dynamic (line 3) | function Dynamic(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/gsp/fallback/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/gsp/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/gsp/no-fallback/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/gssp/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/gssp/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/links.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/not-found/fallback/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-locale-detection/pages/not-found/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/another.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/auto-export/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/dynamic/[slug].js
  function Dynamic (line 3) | function Dynamic(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/gsp/fallback/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/gsp/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/gsp/no-fallback/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/gssp/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/gssp/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/links.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/not-found/fallback/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-no-shared-lambdas/pages/not-found/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support-root-catchall/additional.js
  function checkForChange (line 6) | async function checkForChange(url, initialValue, hardError) {

FILE: packages/runtime/test/fixtures/00-i18n-support-root-catchall/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/00-i18n-support/additional.js
  function checkForChange (line 6) | async function checkForChange(url, initialValue, hardError) {

FILE: packages/runtime/test/fixtures/00-i18n-support/next.config.js
  method generateBuildId (line 2) | generateBuildId() {
  method redirects (line 21) | async redirects() {
  method rewrites (line 42) | async rewrites() {
  method headers (line 65) | async headers() {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/another.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/auto-export/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/dynamic/[slug].js
  function Dynamic (line 3) | function Dynamic(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/gsp/fallback/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/gsp/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/gsp/no-fallback/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/gssp/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/gssp/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/links.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/not-found/fallback/[slug].js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-i18n-support/pages/not-found/index.js
  function Page (line 4) | function Page(props) {

FILE: packages/runtime/test/fixtures/00-optional-fallback-revalidate/additional.js
  function checkForChange (line 22) | async function checkForChange(url, initialValue, hardError) {

FILE: packages/runtime/test/fixtures/00-optional-fallback-revalidate/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/00-optional-fallback-revalidate/pages/[[...slug]].js
  function Home (line 1) | function Home(props) {
  function getStaticPaths (line 5) | async function getStaticPaths() {
  function getStaticProps (line 12) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/00-optional-fallback-revalidate/pages/posts/[[...slug]].js
  function Home (line 1) | function Home(props) {
  function getStaticPaths (line 5) | async function getStaticPaths() {
  function getStaticProps (line 12) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/00-public-dir-output-dir/web/pages/dynamic-ssr/[slug].js
  function getServerSideProps (line 1) | function getServerSideProps() {
  function Dynamic (line 10) | function Dynamic() {

FILE: packages/runtime/test/fixtures/00-public-dir-output-dir/web/pages/dynamic/[slug].js
  function Dynamic (line 1) | function Dynamic() {

FILE: packages/runtime/test/fixtures/00-public-dir-output-dir/web/pages/index.js
  function Index (line 1) | function Index() {

FILE: packages/runtime/test/fixtures/00-root-optional-revalidate/pages/[[...slug]].js
  function Home (line 1) | function Home(props) {
  function getStaticPaths (line 5) | async function getStaticPaths() {
  function getStaticProps (line 16) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/00-shared-lambdas/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/00-trailing-slash-add-export/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/00-trailing-slash-add-export/pages/foo.js
  function Page (line 1) | function Page() {

FILE: packages/runtime/test/fixtures/00-trailing-slash-remove/pages/abc/def.js
  function Page (line 1) | function Page() {

FILE: packages/runtime/test/fixtures/00-trailing-slash-remove/pages/foo.js
  function Page (line 1) | function Page() {

FILE: packages/runtime/test/fixtures/01-cache-headers/next.config.js
  method headers (line 2) | async headers() {
  method generateBuildId (line 15) | generateBuildId() {

FILE: packages/runtime/test/fixtures/03-next-8/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/03-next-8/pages/hello1.js
  function A (line 1) | function A({ data }) {

FILE: packages/runtime/test/fixtures/03-next-8/pages/nested/hello2.js
  function B (line 1) | function B({ data }) {

FILE: packages/runtime/test/fixtures/04-firebase-node-10/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/05-spr-support/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/05-spr-support/pages/another.js
  function unstable_getStaticProps (line 4) | async function unstable_getStaticProps() {

FILE: packages/runtime/test/fixtures/05-spr-support/pages/another2.js
  function unstable_getStaticProps (line 4) | async function unstable_getStaticProps() {

FILE: packages/runtime/test/fixtures/05-spr-support/pages/blog/[post]/[comment].js
  function unstable_getStaticPaths (line 4) | async function unstable_getStaticPaths() {
  function unstable_getStaticProps (line 13) | async function unstable_getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/05-spr-support/pages/blog/[post]/index.js
  function unstable_getStaticPaths (line 4) | async function unstable_getStaticPaths() {
  function unstable_getStaticProps (line 9) | async function unstable_getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/05-spr-support/pages/forever.js
  function unstable_getStaticProps (line 4) | async function unstable_getStaticProps() {

FILE: packages/runtime/test/fixtures/07-custom-routes/next.config.js
  method redirects (line 2) | async redirects() {
  method rewrites (line 21) | async rewrites() {
  method headers (line 50) | async headers() {

FILE: packages/runtime/test/fixtures/08-custom-routes-catchall/next.config.js
  method generateBuildId (line 2) | generateBuildId() {
  method rewrites (line 5) | async rewrites() {

FILE: packages/runtime/test/fixtures/09-yarn-workspaces/packages/web/pages/_app.tsx
  class MyApp (line 4) | class MyApp extends App<any> {
    method getInitialProps (line 5) | static async getInitialProps() {
    method render (line 10) | render() {

FILE: packages/runtime/test/fixtures/10-export-cache-headers/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/11-export-clean-urls/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/11-export-clean-urls/pages/about.js
  function About (line 1) | function About() {

FILE: packages/runtime/test/fixtures/11-export-clean-urls/pages/index.js
  function Home (line 1) | function Home() {

FILE: packages/runtime/test/fixtures/12-no-export-auto/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/12-no-export-auto/pages/about.js
  function About (line 1) | function About() {

FILE: packages/runtime/test/fixtures/12-no-export-auto/pages/index.js
  function Home (line 1) | function Home() {

FILE: packages/runtime/test/fixtures/13-export-custom-routes/next.config.js
  method generateBuildId (line 2) | generateBuildId() {
  method rewrites (line 6) | async rewrites() {
  method redirects (line 14) | async redirects() {

FILE: packages/runtime/test/fixtures/13-export-custom-routes/pages/about.js
  function About (line 1) | function About() {

FILE: packages/runtime/test/fixtures/13-export-custom-routes/pages/index.js
  function Home (line 1) | function Home() {

FILE: packages/runtime/test/fixtures/14-next-offline/next.config.js
  method generateBuildId (line 4) | generateBuildId() {

FILE: packages/runtime/test/fixtures/14-next-offline/pages/about.js
  function About (line 1) | function About() {

FILE: packages/runtime/test/fixtures/14-next-offline/pages/index.js
  function Home (line 1) | function Home() {

FILE: packages/runtime/test/fixtures/16-base-path/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/16-base-path/pages/blog-ssg/[post]/comments.js
  function Comment (line 14) | function Comment({ post }) {

FILE: packages/runtime/test/fixtures/16-base-path/pages/blog-ssg/[post]/index.js
  function Post (line 14) | function Post({ post }) {

FILE: packages/runtime/test/fixtures/16-base-path/pages/blog/[post]/comments.js
  function Comment (line 7) | function Comment({ post }) {

FILE: packages/runtime/test/fixtures/16-base-path/pages/blog/[post]/index.js
  function Post (line 7) | function Post({ post }) {

FILE: packages/runtime/test/fixtures/17-static-404/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/18-ssg-fallback-support/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/18-ssg-fallback-support/pages/another.js
  function unstable_getStaticProps (line 4) | async function unstable_getStaticProps() {

FILE: packages/runtime/test/fixtures/18-ssg-fallback-support/pages/another2.js
  function unstable_getStaticProps (line 4) | async function unstable_getStaticProps() {

FILE: packages/runtime/test/fixtures/18-ssg-fallback-support/pages/blog/[post]/[comment].js
  function unstable_getStaticPaths (line 4) | async function unstable_getStaticPaths() {
  function unstable_getStaticProps (line 15) | async function unstable_getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/18-ssg-fallback-support/pages/blog/[post]/index.js
  function unstable_getStaticPaths (line 4) | async function unstable_getStaticPaths() {
  function unstable_getStaticProps (line 11) | async function unstable_getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/18-ssg-fallback-support/pages/forever.js
  function unstable_getStaticProps (line 4) | async function unstable_getStaticProps() {

FILE: packages/runtime/test/fixtures/19-pages-404/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/20-pages-404-lambda/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/21-server-props/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/21-server-props/pages/another.js
  function getServerSideProps (line 4) | async function getServerSideProps() {

FILE: packages/runtime/test/fixtures/21-server-props/pages/another2.js
  function getServerSideProps (line 4) | async function getServerSideProps() {

FILE: packages/runtime/test/fixtures/21-server-props/pages/blog/[post]/[comment].js
  function getServerSideProps (line 4) | async function getServerSideProps({ params }) {

FILE: packages/runtime/test/fixtures/21-server-props/pages/blog/[post]/index.js
  function getServerSideProps (line 4) | async function getServerSideProps({ params }) {

FILE: packages/runtime/test/fixtures/21-server-props/pages/forever.js
  function getServerSideProps (line 4) | async function getServerSideProps() {

FILE: packages/runtime/test/fixtures/22-ssg-v2-catchall/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/22-ssg-v2-catchall/pages/[...path].js
  function loadArticle (line 4) | function loadArticle() {
  function getStaticProps (line 48) | async function getStaticProps({ params }) {
  function getStaticPaths (line 60) | async function getStaticPaths() {

FILE: packages/runtime/test/fixtures/22-ssg-v2/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/22-ssg-v2/pages/another.js
  function getStaticProps (line 4) | async function getStaticProps() {

FILE: packages/runtime/test/fixtures/22-ssg-v2/pages/another2.js
  function getStaticProps (line 4) | async function getStaticProps() {

FILE: packages/runtime/test/fixtures/22-ssg-v2/pages/api-docs/[...slug].js
  function Slug (line 18) | function Slug(props) {

FILE: packages/runtime/test/fixtures/22-ssg-v2/pages/blog/[post]/[comment].js
  function getStaticPaths (line 4) | async function getStaticPaths() {
  function getStaticProps (line 17) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/22-ssg-v2/pages/blog/[post]/index.js
  function getStaticPaths (line 4) | async function getStaticPaths() {
  function getStaticProps (line 12) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/22-ssg-v2/pages/forever.js
  function getStaticProps (line 4) | async function getStaticProps() {

FILE: packages/runtime/test/fixtures/22-ssg-v2/pages/nofallback/[slug].js
  function getStaticPaths (line 4) | async function getStaticPaths() {
  function getStaticProps (line 12) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/23-custom-routes-verbose/next.config.js
  method generateBuildId (line 2) | generateBuildId() {
  method rewrites (line 5) | async rewrites() {
  method redirects (line 93) | async redirects() {
  method headers (line 178) | async headers() {

FILE: packages/runtime/test/fixtures/23-custom-routes-verbose/pages/b/[123].js
  function Page (line 11) | function Page(props) {

FILE: packages/runtime/test/fixtures/23-custom-routes-verbose/pages/c/[alongparamnameshouldbeallowedeventhoughweird].js
  function Page (line 11) | function Page(props) {

FILE: packages/runtime/test/fixtures/24-custom-output-dir/next.config.js
  method generateBuildId (line 3) | generateBuildId() {

FILE: packages/runtime/test/fixtures/24-custom-output-dir/pages/ssg/[slug].js
  function Page (line 19) | function Page(props) {

FILE: packages/runtime/test/fixtures/25-index-routes/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/25-mono-repo-404/packages/webapp/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/26-mono-repo-404-lambda/packages/webapp/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/27-non-word-param/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/27-non-word-param/pages/[...path-segments].js
  function loadArticle (line 4) | function loadArticle() {
  function getStaticProps (line 48) | async function getStaticProps({ params }) {
  function getStaticPaths (line 60) | async function getStaticPaths() {

FILE: packages/runtime/test/fixtures/27-preview-mode/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/27-preview-mode/pages/docs/[...rest].js
  function Docs (line 22) | function Docs(props) {

FILE: packages/runtime/test/fixtures/27-preview-mode/pages/docs/index.js
  function Docs (line 12) | function Docs(props) {

FILE: packages/runtime/test/fixtures/28-nested-public/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/28-nested-public/pages/index.js
  function Page (line 1) | function Page() {

FILE: packages/runtime/test/fixtures/29-ssg-all-static-custom-404/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/29-ssg-all-static-custom-404/pages/404.js
  function Page (line 1) | function Page({ found }) {

FILE: packages/runtime/test/fixtures/29-ssg-all-static-custom-404/pages/another.js
  function getStaticProps (line 4) | async function getStaticProps() {

FILE: packages/runtime/test/fixtures/29-ssg-all-static-custom-404/pages/another2.js
  function getStaticProps (line 4) | async function getStaticProps() {

FILE: packages/runtime/test/fixtures/29-ssg-all-static-custom-404/pages/blog/[post]/[comment].js
  function getStaticPaths (line 4) | async function getStaticPaths() {
  function getStaticProps (line 17) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/29-ssg-all-static-custom-404/pages/blog/[post]/index.js
  function getStaticPaths (line 4) | async function getStaticPaths() {
  function getStaticProps (line 12) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/29-ssg-all-static-custom-404/pages/forever.js
  function getStaticProps (line 4) | async function getStaticProps() {

FILE: packages/runtime/test/fixtures/29-ssg-all-static-custom-404/pages/nofallback/[slug].js
  function getStaticPaths (line 4) | async function getStaticPaths() {
  function getStaticProps (line 12) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/29-ssg-all-static/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/29-ssg-all-static/pages/another.js
  function getStaticProps (line 4) | async function getStaticProps() {

FILE: packages/runtime/test/fixtures/29-ssg-all-static/pages/another2.js
  function getStaticProps (line 4) | async function getStaticProps() {

FILE: packages/runtime/test/fixtures/29-ssg-all-static/pages/blog/[post]/[comment].js
  function getStaticPaths (line 4) | async function getStaticPaths() {
  function getStaticProps (line 17) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/29-ssg-all-static/pages/blog/[post]/index.js
  function getStaticPaths (line 4) | async function getStaticPaths() {
  function getStaticProps (line 12) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/29-ssg-all-static/pages/forever.js
  function getStaticProps (line 4) | async function getStaticProps() {

FILE: packages/runtime/test/fixtures/29-ssg-all-static/pages/nofallback/[slug].js
  function getStaticPaths (line 4) | async function getStaticPaths() {
  function getStaticProps (line 12) | async function getStaticProps({ params }) {

FILE: packages/runtime/test/fixtures/31-blocking-fallback/next.config.js
  method generateBuildId (line 2) | generateBuildId() {

FILE: packages/runtime/test/fixtures/31-blocking-fallback/pages/fixed/[slug].js
  function TestPage (line 1) | function TestPage({ slug, time }) {
  function getStaticProps (line 11) | function getStaticProps({ params }) {
  function getStaticPaths (line 21) | function getStaticPaths() {

FILE: packages/runtime/test/fixtures/31-blocking-fallback/pages/regenerated/[slug].js
  function TestPage (line 1) | function TestPage({ slug, time }) {
  function getStaticProps (line 11) | function getStaticProps({ params }) {
  function getStaticPaths (line 21) | function getStaticPaths() {

FILE: packages/runtime/test/fixtures/32-custom-install-command/.yarn/releases/yarn-berry.cjs
  function t (line 2) | function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code...
    method constructor (line 49) | constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}
    method isCanceled (line 49) | get isCanceled(){return!0}
    method constructor (line 49) | constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`m...
    method _set (line 49) | _set(e,t){if(this.cache.set(e,t),this._size++,this._size>=this.maxSize...
    method get (line 49) | get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache....
    method set (line 49) | set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),t...
    method has (line 49) | has(e){return this.cache.has(e)||this.oldCache.has(e)}
    method peek (line 49) | peek(e){return this.cache.has(e)?this.cache.get(e):this.oldCache.has(e...
    method delete (line 49) | delete(e){const t=this.cache.delete(e);return t&&this._size--,this.old...
    method clear (line 49) | clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}
    method keys (line 49) | *keys(){for(const[e]of this)yield e}
    method values (line 49) | *values(){for(const[,e]of this)yield e}
    method size (line 49) | get size(){let e=0;for(const t of this.oldCache.keys())this.cache.has(...
  class s (line 2) | class s extends n.BaseCommand{constructor(){super(...arguments),this.qui...
    method constructor (line 2) | constructor(){super(...arguments),this.quiet=!1,this.args=[]}
    method execute (line 2) | async execute(){const e=[];this.pkg&&e.push("--package",this.pkg),this...
    method constructor (line 2) | constructor(e,t){super(`This command can only be run from within a wor...
    method constructor (line 2) | constructor(){this.reportedInfos=new Set,this.reportedWarnings=new Set...
    method progressViaCounter (line 2) | static progressViaCounter(e){let t,r=0,A=new Promise(e=>{t=e});const n...
    method reportInfoOnce (line 2) | reportInfoOnce(e,t,r){const A=r&&r.key?r.key:t;this.reportedInfos.has(...
    method reportWarningOnce (line 2) | reportWarningOnce(e,t,r){const A=r&&r.key?r.key:t;this.reportedWarning...
    method reportErrorOnce (line 2) | reportErrorOnce(e,t,r){var A;const n=r&&r.key?r.key:t;this.reportedErr...
    method reportExceptionOnce (line 2) | reportExceptionOnce(e){!function(e){return void 0!==e.reportCode}(e)?t...
    method createStreamReporter (line 2) | createStreamReporter(e=null){const t=new A.PassThrough,r=new n.StringD...
    method supports (line 2) | supports(e){return!!e.reference.startsWith("virtual:")}
    method getLocalPath (line 2) | getLocalPath(e,t){const r=e.reference.indexOf("#");if(-1===r)throw new...
    method fetch (line 2) | async fetch(e,t){const r=e.reference.indexOf("#");if(-1===r)throw new ...
    method getLocatorFilename (line 2) | getLocatorFilename(e){return i.slugifyLocator(e)}
    method ensureVirtualLink (line 2) | async ensureVirtualLink(e,t,r){const i=t.packageFs.getRealPath(),s=r.p...
    method constructor (line 2) | constructor(e,{baseFs:t=new A.S}={}){super(o.y1),this.target=this.path...
    method getRealPath (line 2) | getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),...
    method getTarget (line 2) | getTarget(){return this.target}
    method getBaseFs (line 2) | getBaseFs(){return this.baseFs}
    method mapToBase (line 2) | mapToBase(e){const t=this.pathUtils.normalize(e);if(this.pathUtils.isA...
    method mapFromBase (line 2) | mapFromBase(e){return this.pathUtils.resolve(i,this.pathUtils.relative...
    method constructor (line 17) | constructor(){super(...arguments),this._walkStream=o.walkStream,this._...
    method dynamic (line 17) | dynamic(e,t){return this._walkStream(e,t)}
    method static (line 17) | static(e,t){const r=e.map(this._getFullEntryPath,this),n=new A.PassThr...
    method _getEntry (line 17) | _getEntry(e,t,r){return this._getStat(e).then(e=>this._makeEntry(e,t))...
    method _getStat (line 17) | _getStat(e){return new Promise((t,r)=>{this._stat(e,this._fsStatSettin...
    method constructor (line 23) | constructor(e){super("Promise was canceled",{},e),this.name="CancelErr...
    method isCanceled (line 23) | get isCanceled(){return!0}
    method constructor (line 23) | constructor(e,t){super(`Timeout awaiting '${t}' for ${e}ms`),this.even...
  class h (line 2) | class h extends n.BaseCommand{constructor(){super(...arguments),this.qui...
    method constructor (line 2) | constructor(){super(...arguments),this.quiet=!1,this.args=[]}
    method execute (line 2) | async execute(){return a.VK.telemetry=null,await l.xfs.mktempPromise(a...
    method constructor (line 2) | constructor(e,{project:t}){this.workspacesCwds=new Set,this.dependenci...
    method setup (line 2) | async setup(){this.manifest=A.xfs.existsSync(n.y1.join(this.cwd,c.G.fi...
    method accepts (line 2) | accepts(e){const t=e.indexOf(":"),r=-1!==t?e.slice(0,t+1):null,A=-1!==...
    method computeCandidateName (line 2) | computeCandidateName(){return this.cwd===this.project.cwd?"root-worksp...
    method persistManifest (line 2) | async persistManifest(){const e={};this.manifest.exportTo(e);const t=n...
    method isIntegrity (line 49) | get isIntegrity(){return!0}
    method toJSON (line 49) | toJSON(){return this.toString()}
    method toString (line 49) | toString(e){let t=(e=l(e)).sep||" ";return e.strict&&(t=t.replace(/\S+...
    method concat (line 49) | concat(e,t){t=l(t);const r="string"==typeof e?e:C(e,t);return p(`${thi...
    method hexDigest (line 49) | hexDigest(){return p(this,{single:!0}).hexDigest()}
    method match (line 49) | match(e,t){const r=p(e,t=l(t)),A=r.pickAlgorithm(t);return this[A]&&r[...
    method pickAlgorithm (line 49) | pickAlgorithm(e){const t=(e=l(e)).pickAlgorithm,r=Object.keys(this);if...
  function D (line 2) | function D(e,t){return e.exact?o.EXACT:e.caret?o.CARET:e.tilde?o.TILDE:t...
    method constructor (line 2) | constructor(){super(...arguments),this.all=!1,this.recursive=!1,this.e...
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method isVirtualDescriptor (line 2) | static isVirtualDescriptor(e){return!!e.range.startsWith(D.protocol)}
    method isVirtualLocator (line 2) | static isVirtualLocator(e){return!!e.reference.startsWith(D.protocol)}
    method supportsDescriptor (line 2) | supportsDescriptor(e,t){return D.isVirtualDescriptor(e)}
    method supportsLocator (line 2) | supportsLocator(e,t){return D.isVirtualLocator(e)}
    method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!1}
    method bindDescriptor (line 2) | bindDescriptor(e,t,r){throw new Error('Assertion failed: calling "bind...
    method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){throw new Error('Assertion failed: call...
    method getCandidates (line 2) | async getCandidates(e,t,r){throw new Error('Assertion failed: calling ...
    method getSatisfying (line 2) | async getSatisfying(e,t,r){throw new Error('Assertion failed: calling ...
    method resolve (line 2) | async resolve(e,t){throw new Error('Assertion failed: calling "resolve...
  function v (line 2) | function v(e,{project:t}){const r=e.match(b);return r?r[1]:t.configurati...
    method constructor (line 2) | constructor(e=Buffer.alloc(0)){super(),this.active=!0,this.ifEmpty=e}
    method _transform (line 2) | _transform(e,t,r){if("buffer"!==t||!Buffer.isBuffer(e))throw new Error...
    method _flush (line 2) | _flush(e){this.active&&this.ifEmpty.length>0&&e(null,this.ifEmpty)}
  function S (line 2) | function S(e,t){let{protocol:r,source:A,params:n,selector:o}=d.parseRang...
    method constructor (line 2) | constructor(){this.mode="strict"}
    method supportsPackage (line 2) | supportsPackage(e,t){return"pnp"===t.project.configuration.get("nodeLi...
    method findPackageLocation (line 2) | async findPackageLocation(e,t){const r=T(t.project).main;if(!i.xfs.exi...
    method findPackageLocator (line 2) | async findPackageLocator(e,t){const A=T(t.project).main;if(!i.xfs.exis...
    method makeInstaller (line 2) | makeInstaller(e){return new k(e)}
    method supports (line 2) | supports(e){return!!e.reference.startsWith(v.d.protocol)}
    method getLocalPath (line 2) | getLocalPath(e,t){return this.getWorkspace(e,t).cwd}
    method fetch (line 2) | async fetch(e,t){const r=this.getWorkspace(e,t).cwd;return{packageFs:n...
    method getWorkspace (line 2) | getWorkspace(e,t){return t.project.getWorkspaceByCwd(e.reference.slice...
    method constructor (line 2) | constructor(e){this.stream=e}
    method close (line 2) | close(){}
    method get (line 2) | get(){return this.stream}
  function k (line 2) | async function k(e,{project:t,target:r}){const A=new Map,o=e=>{let t=A.g...
    method constructor (line 2) | constructor(e){this.opts=e,this.mode="strict",this.packageRegistry=new...
    method getCustomDataKey (line 2) | getCustomDataKey(){return JSON.stringify({name:"PnpInstaller",version:...
    method attachCustomData (line 2) | attachCustomData(e){this.customData=e}
    method installPackage (line 2) | async installPackage(e,t){const r=g.requirableIdent(e),A=e.reference,n...
    method attachInternalDependencies (line 2) | async attachInternalDependencies(e,t){const r=this.getPackageInformati...
    method attachExternalDependents (line 2) | async attachExternalDependents(e,t){for(const r of t){this.getDiskInfo...
    method finalizeInstall (line 2) | async finalizeInstall(){const e=new Set;for(const{locator:e,location:t...
    method finalizeInstallWithPnp (line 2) | async finalizeInstallWithPnp(e){if(this.opts.project.configuration.get...
    method locateNodeModules (line 2) | async locateNodeModules(e){const t=[],r=e?new RegExp(e):null;for(const...
    method unplugPackageIfNeeded (line 2) | async unplugPackageIfNeeded(e,t,r,A){return this.shouldBeUnplugged(e,t...
    method shouldBeUnplugged (line 2) | shouldBeUnplugged(e,t,r){return void 0!==r.unplugged?r.unplugged:!!v.h...
    method unplugPackage (line 2) | async unplugPackage(e,t){const r=b(e,{configuration:this.opts.project....
    method getPackageInformation (line 2) | getPackageInformation(e){const t=g.requirableIdent(e),r=e.reference,A=...
    method getDiskInformation (line 2) | getDiskInformation(e){const t=u.getMapWithDefault(this.packageRegistry...
    method constructor (line 2) | constructor(){this.stream=null}
    method close (line 2) | close(){if(null===this.stream)throw new Error("Assertion failed: No st...
    method attach (line 2) | attach(e){this.stream=e}
    method get (line 2) | get(){if(null===this.stream)throw new Error("Assertion failed: No stre...
  function N (line 2) | async function N(e,{cwd:t,workspace:r}){return await async function(e){r...
    method constructor (line 2) | constructor(e,t){this.stdin=null,this.stdout=null,this.stderr=null,thi...
    method start (line 2) | static start(e,{stdin:t,stdout:r,stderr:A}){const n=new N(null,e);retu...
    method pipeTo (line 2) | pipeTo(e,t=w.STDOUT){const r=new N(this,e),A=new k;return r.pipe=A,r.s...
    method exec (line 2) | async exec(){const e=["ignore","ignore","ignore"];if(this.pipe)e[0]="p...
    method run (line 2) | async run(){const e=[];for(let t=this;t;t=t.ancestor)e.push(t.exec());...
  function F (line 2) | async function F(e,{project:t,workspace:r,cache:A,target:o,modifier:s,st...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method constructor (line 2) | constructor(e,t){this.allOptionNames=[],this.arity={leading:[],trailin...
    method addPath (line 2) | addPath(e){this.paths.push(e)}
    method setArity (line 2) | setArity({leading:e=this.arity.leading,trailing:t=this.arity.trailing,...
    method addPositional (line 2) | addPositional({name:e="arg",required:t=!0}={}){if(!t&&this.arity.extra...
    method addRest (line 2) | addRest({name:e="arg",required:t=0}={}){if(this.arity.extra===N)throw ...
    method addProxy (line 2) | addProxy({required:e=0}={}){this.addRest({required:e}),this.arity.prox...
    method addOption (line 2) | addOption({names:e,description:t,arity:r=0,hidden:A=!1,allowBinding:n=...
    method setContext (line 2) | setContext(e){this.context=e}
    method usage (line 2) | usage({detailed:e=!0,inlineOptions:t=!0}={}){const r=[this.cliOpts.bin...
    method compile (line 2) | compile(){if(void 0===this.context)throw new Error("Assertion failed: ...
    method registerOptions (line 2) | registerOptions(e,t){w(e,t,["isOption","--"],t,"inhibateOptions"),w(e,...
  function K (line 2) | async function K(e,t,{project:r,cache:A,workspace:n,preserveModifier:o=!...
    method constructor (line 2) | constructor({binaryName:e="..."}={}){this.builders=[],this.opts={binar...
    method build (line 2) | static build(e,t={}){return new K(t).commands(e).compile()}
    method getBuilderByIndex (line 2) | getBuilderByIndex(e){if(!(e>=0&&e<this.builders.length))throw new Erro...
    method commands (line 2) | commands(e){for(const t of e)t(this.command());return this}
    method command (line 2) | command(){const e=new F(this.builders.length,this.opts);return this.bu...
    method compile (line 2) | compile(){const e=[],t=[];for(const r of this.builders){const{machine:...
  class M (line 2) | class M extends c.BaseCommand{constructor(){super(...arguments),this.pac...
    method constructor (line 2) | constructor(){super(...arguments),this.packages=[],this.json=!1,this.e...
    method execute (line 2) | async execute(){var e;const t=await s.VK.find(this.context.cwd,this.co...
    method constructor (line 2) | constructor(){this.help=!1}
    method getMeta (line 2) | static getMeta(e){const t=e.constructor;return t.meta=Object.prototype...
    method resolveMeta (line 2) | static resolveMeta(e){const t=[],r=[];for(let A=e;A instanceof M;A=A._...
    method registerDefinition (line 2) | static registerDefinition(e,t){this.getMeta(e).definitions.push(t)}
    method registerTransformer (line 2) | static registerTransformer(e,t){this.getMeta(e).transformers.push(t)}
    method addPath (line 2) | static addPath(...e){this.Path(...e)(this.prototype,"execute")}
    method addOption (line 2) | static addOption(e,t){t(this.prototype,e)}
    method Path (line 2) | static Path(...e){return(t,r)=>{this.registerDefinition(t,t=>{t.addPat...
    method Boolean (line 2) | static Boolean(e,{hidden:t=!1,description:r}={}){return(A,n)=>{const o...
    method Counter (line 2) | static Counter(e,{hidden:t=!1,description:r}={}){return(A,n)=>{const o...
    method String (line 2) | static String(e={},{arity:t=1,tolerateBoolean:r=!1,hidden:A=!1,descrip...
    method Array (line 2) | static Array(e,{arity:t=1,hidden:r=!1,description:A}={}){return(n,o)=>...
    method Rest (line 2) | static Rest({required:e=0}={}){return(t,r)=>{this.registerDefinition(t...
    method Proxy (line 2) | static Proxy({required:e=0}={}){return(t,r)=>{this.registerDefinition(...
    method Usage (line 2) | static Usage(e){return e}
    method Schema (line 2) | static Schema(e){return e}
    method catch (line 2) | async catch(e){throw e}
    method validateAndExecute (line 2) | async validateAndExecute(){const e=this.constructor.schema;if(void 0!=...
  class x (line 2) | class x extends c.BaseCommand{constructor(){super(...arguments),this.ver...
    method constructor (line 2) | constructor(){super(...arguments),this.verbose=!1,this.json=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method supports (line 2) | supports(e,t){if(!e.reference.startsWith("npm:"))return!1;const r=new ...
    method getLocalPath (line 2) | getLocalPath(e,t){return null}
    method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[A,n,o]=...
    method fetchFromNetwork (line 2) | async fetchFromNetwork(e,t){let r;try{r=await v(x.getLocatorUrl(e),{co...
    method isConventionalTarballUrl (line 2) | static isConventionalTarballUrl(e,t,{configuration:r}){let A=B(e.scope...
    method getLocatorUrl (line 2) | static getLocatorUrl(e){const t=g().clean(e.reference.slice("npm:".len...
    method execute (line 17) | async execute(){this.context.stdout.write(this.cli.usage(null))}
  class L (line 2) | class L extends c.BaseCommand{constructor(){super(...arguments),this.mir...
    method constructor (line 2) | constructor(){super(...arguments),this.mirror=!1,this.all=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method execute (line 17) | async execute(){var e;this.context.stdout.write((null!==(e=this.cli.bi...
  class j (line 2) | class j extends c.BaseCommand{constructor(){super(...arguments),this.jso...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1,this.unsafe=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method supportsDescriptor (line 2) | supportsDescriptor(e,t){return!!t.project.storedResolutions.get(e.desc...
    method supportsLocator (line 2) | supportsLocator(e,t){return!!t.project.originalPackages.has(e.locatorH...
    method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){throw new Error("The shouldPersistResolut...
    method bindDescriptor (line 2) | bindDescriptor(e,t,r){return e}
    method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return[]}
    method getCandidates (line 2) | async getCandidates(e,t,r){let A=r.project.originalPackages.get(O.conv...
    method getSatisfying (line 2) | async getSatisfying(e,t,r){return null}
    method resolve (line 2) | async resolve(e,t){const r=t.project.originalPackages.get(e.locatorHas...
  class q (line 2) | class q extends c.BaseCommand{constructor(){super(...arguments),this.jso...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1,this.home=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  class z (line 2) | class z extends c.BaseCommand{constructor(){super(...arguments),this.ver...
    method constructor (line 2) | constructor(){super(...arguments),this.verbose=!1,this.why=!1,this.jso...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class te (line 2) | class te extends c.BaseCommand{constructor(){super(...arguments),this.pa...
    method constructor (line 2) | constructor(){super(...arguments),this.patterns=[],this.strategy=W.HIG...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method constructor (line 2) | constructor(){super(...arguments),this.mode="loose"}
    method makeInstaller (line 2) | makeInstaller(e){return new re(e)}
    method execute (line 2) | async execute(){const e=await n.VK.find(this.context.cwd,this.context....
    method constructor (line 23) | constructor(e,t){super(e.message,e,t),this.name="CacheError"}
  class re (line 2) | class re extends C.Command{async execute(){const{plugins:e}=await s.VK.f...
    method execute (line 2) | async execute(){const{plugins:e}=await s.VK.find(this.context.cwd,this...
    method constructor (line 2) | constructor(){super(...arguments),this.mode="loose"}
    method finalizeInstallWithPnp (line 2) | async finalizeInstallWithPnp(e){if(this.opts.project.configuration.get...
    method constructor (line 23) | constructor(e,t){super(e.message,e,t),this.name="UploadError"}
  class Ae (line 2) | class Ae extends C.Command{async execute(){this.context.stdout.write(thi...
    method execute (line 2) | async execute(){this.context.stdout.write(this.cli.usage(null))}
    method constructor (line 23) | constructor(e,t,r){super(e.message,e,r),this.name="TimeoutError",this....
  class ne (line 2) | class ne extends C.Command{constructor(){super(...arguments),this.args=[...
    method constructor (line 2) | constructor(){super(...arguments),this.args=[]}
    method execute (line 2) | async execute(){if(this.leadingArgument.match(/[\\/]/)&&!d.tryParseIde...
    method constructor (line 23) | constructor(e,t){super(e.message,e,t),this.name="ReadError"}
  class ie (line 2) | class ie extends C.Command{async execute(){this.context.stdout.write((oe...
    method execute (line 2) | async execute(){this.context.stdout.write((oe.o||"<unknown>")+"\n")}
    method constructor (line 2) | constructor(e,{configuration:t}){this.resolutionAliases=new Map,this.w...
    method find (line 2) | static async find(e,t){var r,o,i;if(!e.projectCwd)throw new s.UsageErr...
    method generateBuildStateFile (line 2) | static generateBuildStateFile(e,t){let r="# Warning: This file is auto...
    method setupResolutions (line 2) | async setupResolutions(){this.storedResolutions=new Map,this.storedDes...
    method setupWorkspaces (line 2) | async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Ma...
    method addWorkspace (line 2) | async addWorkspace(e){const t=new z.j(e,{project:this});await t.setup(...
    method topLevelWorkspace (line 2) | get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}
    method tryWorkspaceByCwd (line 2) | tryWorkspaceByCwd(e){n.y1.isAbsolute(e)||(e=n.y1.resolve(this.cwd,e)),...
    method getWorkspaceByCwd (line 2) | getWorkspaceByCwd(e){const t=this.tryWorkspaceByCwd(e);if(!t)throw new...
    method tryWorkspaceByFilePath (line 2) | tryWorkspaceByFilePath(e){let t=null;for(const r of this.workspaces){n...
    method getWorkspaceByFilePath (line 2) | getWorkspaceByFilePath(e){const t=this.tryWorkspaceByFilePath(e);if(!t...
    method tryWorkspaceByIdent (line 2) | tryWorkspaceByIdent(e){const t=this.workspacesByIdent.get(e.identHash)...
    method getWorkspaceByIdent (line 2) | getWorkspaceByIdent(e){const t=this.tryWorkspaceByIdent(e);if(!t)throw...
    method tryWorkspaceByDescriptor (line 2) | tryWorkspaceByDescriptor(e){const t=this.tryWorkspaceByIdent(e);return...
    method getWorkspaceByDescriptor (line 2) | getWorkspaceByDescriptor(e){const t=this.tryWorkspaceByDescriptor(e);i...
    method tryWorkspaceByLocator (line 2) | tryWorkspaceByLocator(e){O.isVirtualLocator(e)&&(e=O.devirtualizeLocat...
    method getWorkspaceByLocator (line 2) | getWorkspaceByLocator(e){const t=this.tryWorkspaceByLocator(e);if(!t)t...
    method refreshWorkspaceDependencies (line 2) | refreshWorkspaceDependencies(){for(const e of this.workspaces){const t...
    method forgetResolution (line 2) | forgetResolution(e){const t=e=>{this.storedResolutions.delete(e),this....
    method forgetTransientResolutions (line 2) | forgetTransientResolutions(){const e=this.configuration.makeResolver()...
    method forgetVirtualResolutions (line 2) | forgetVirtualResolutions(){for(const e of this.storedPackages.values()...
    method getDependencyMeta (line 2) | getDependencyMeta(e,t){const r={},A=this.topLevelWorkspace.manifest.de...
    method findLocatorForLocation (line 2) | async findLocatorForLocation(e,{strict:t=!1}={}){const r=new q.$,A=thi...
    method resolveEverything (line 2) | async resolveEverything(e){if(!this.workspacesByCwd||!this.workspacesB...
    method fetchEverything (line 2) | async fetchEverything({cache:e,report:t,fetcher:r}){const A=r||this.co...
    method linkEverything (line 2) | async linkEverything({cache:e,report:t,fetcher:r,skipBuild:o}){var s;c...
    method install (line 2) | async install(e){var t,r;const i=this.configuration.get("nodeLinker");...
    method generateLockfile (line 2) | generateLockfile(){const e=new Map;for(const[t,r]of this.storedResolut...
    method persistLockfile (line 2) | async persistLockfile(){const e=n.y1.join(this.cwd,this.configuration....
    method persistInstallStateFile (line 2) | async persistInstallStateFile(){const e=[];for(const t of Object.value...
    method restoreInstallState (line 2) | async restoreInstallState({restoreInstallersCustomData:e=!0,restoreRes...
    method applyLightResolution (line 2) | async applyLightResolution(){await this.resolveEverything({lockfileOnl...
    method persist (line 2) | async persist(){await this.persistLockfile();for(const e of this.works...
    method cacheCleanup (line 2) | async cacheCleanup({cache:e,report:t}){const r=new Set([".gitignore"])...
  class ae (line 2) | class ae extends c.BaseCommand{constructor(){super(...arguments),this.ar...
    method constructor (line 2) | constructor(){super(...arguments),this.args=[]}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class ge (line 2) | class ge extends c.BaseCommand{async execute(){const e=await s.VK.find(t...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class ue (line 2) | class ue extends c.BaseCommand{constructor(){super(...arguments),this.al...
    method constructor (line 2) | constructor(){super(...arguments),this.all=!1,this.recursive=!1,this.e...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class de (line 2) | class de extends c.BaseCommand{constructor(){super(...arguments),this.js...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1,this.checkCache=!1,this...
    method execute (line 2) | async execute(){var e,t,r;const A=await s.VK.find(this.context.cwd,thi...
  class Ce (line 2) | class Ce extends c.BaseCommand{constructor(){super(...arguments),this.al...
    method constructor (line 2) | constructor(){super(...arguments),this.all=!1,this.private=!1,this.rel...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class fe (line 2) | class fe extends c.BaseCommand{constructor(){super(...arguments),this.ar...
    method constructor (line 2) | constructor(){super(...arguments),this.args=[]}
    method execute (line 2) | async execute(){return this.cli.run(["exec","node",...this.args])}
  class we (line 2) | class we extends c.BaseCommand{constructor(){super(...arguments),this.on...
    method constructor (line 2) | constructor(){super(...arguments),this.onlyIfNeeded=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  function Qe (line 2) | async function Qe(e,t,r,{report:A}){const n=e.projectCwd?e.projectCwd:e....
  function be (line 2) | function be(e){return De.test(e)?`pull/${e}/head`:e}
  class ve (line 2) | class ve extends c.BaseCommand{constructor(){super(...arguments),this.re...
    method constructor (line 2) | constructor(){super(...arguments),this.repository="https://github.com/...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  function Se (line 2) | async function Se(e,{configuration:t,context:r,target:A}){for(const[n,.....
  function ke (line 2) | async function ke(e,{configuration:t,report:r,target:A}){let n=!1;if(!e....
  function Ke (line 2) | async function Ke(e){const t=await me.get("https://raw.githubusercontent...
  class Me (line 2) | class Me extends c.BaseCommand{constructor(){super(...arguments),this.js...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class Re (line 2) | class Re extends c.BaseCommand{async execute(){const e=await s.VK.find(t...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  function xe (line 2) | async function xe(e,t,{project:r,report:A}){const{configuration:n}=r,o={...
  class Le (line 2) | class Le extends c.BaseCommand{constructor(){super(...arguments),this.re...
    method constructor (line 2) | constructor(){super(...arguments),this.repository="https://github.com/...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class Pe (line 2) | class Pe extends c.BaseCommand{async execute(){const e=await s.VK.find(t...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class Oe (line 2) | class Oe extends c.BaseCommand{constructor(){super(...arguments),this.js...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class Ue (line 2) | class Ue extends c.BaseCommand{constructor(){super(...arguments),this.id...
    method constructor (line 2) | constructor(){super(...arguments),this.idents=[]}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class Te (line 2) | class Te extends c.BaseCommand{constructor(){super(...arguments),this.al...
    method constructor (line 2) | constructor(){super(...arguments),this.all=!1,this.patterns=[]}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class je (line 2) | class je extends c.BaseCommand{async execute(){const e=await s.VK.find(t...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class Ye (line 2) | class Ye extends c.BaseCommand{constructor(){super(...arguments),this.in...
    method constructor (line 2) | constructor(){super(...arguments),this.inspect=!1,this.inspectBrk=!1,t...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class Ge (line 2) | class Ge extends c.BaseCommand{constructor(){super(...arguments),this.sa...
    method constructor (line 2) | constructor(){super(...arguments),this.save=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class He (line 2) | class He extends c.BaseCommand{constructor(){super(...arguments),this.pa...
    method constructor (line 2) | constructor(){super(...arguments),this.patterns=[],this.interactive=nu...
    method execute (line 2) | async execute(){var e;const t=await s.VK.find(this.context.cwd,this.co...
  class Je (line 2) | class Je extends c.BaseCommand{constructor(){super(...arguments),this.re...
    method constructor (line 2) | constructor(){super(...arguments),this.recursive=!1,this.json=!1,this....
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class qe (line 2) | class qe extends c.BaseCommand{constructor(){super(...arguments),this.ve...
    method constructor (line 2) | constructor(){super(...arguments),this.verbose=!1,this.json=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  class ze (line 2) | class ze extends C.Command{constructor(){super(...arguments),this.args=[...
    method constructor (line 2) | constructor(){super(...arguments),this.args=[]}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
  function l (line 2) | function l(e){const{params:t,selector:r}=n.parseRange(e),A=o.cS.toPortab...
    method constructor (line 2) | constructor(){this.indent="  ",this.name=null,this.version=null,this.o...
    method tryFind (line 2) | static async tryFind(e,{baseFs:t=new A.S}={}){const r=n.y1.join(e,"pac...
    method find (line 2) | static async find(e,{baseFs:t}={}){const r=await l.tryFind(e,{baseFs:t...
    method fromFile (line 2) | static async fromFile(e,{baseFs:t=new A.S}={}){const r=new l;return aw...
    method fromText (line 2) | static fromText(e){const t=new l;return t.loadFromText(e),t}
    method isManifestFieldCompatible (line 2) | static isManifestFieldCompatible(e,t){if(null===e)return!0;let r=!0,A=...
    method loadFromText (line 2) | loadFromText(e){let t;try{t=JSON.parse(h(e)||"{}")}catch(t){throw t.me...
    method loadFile (line 2) | async loadFile(e,{baseFs:t=new A.S}){const r=await t.readFilePromise(e...
    method load (line 2) | load(e,{yamlCompatibilityMode:t=!1}={}){if("object"!=typeof e||null===...
    method getForScope (line 2) | getForScope(e){switch(e){case"dependencies":return this.dependencies;c...
    method hasConsumerDependency (line 2) | hasConsumerDependency(e){return!!this.dependencies.has(e.identHash)||!...
    method hasHardDependency (line 2) | hasHardDependency(e){return!!this.dependencies.has(e.identHash)||!!thi...
    method hasSoftDependency (line 2) | hasSoftDependency(e){return!!this.peerDependencies.has(e.identHash)}
    method hasDependency (line 2) | hasDependency(e){return!!this.hasHardDependency(e)||!!this.hasSoftDepe...
    method isCompatibleWithOS (line 2) | isCompatibleWithOS(e){return l.isManifestFieldCompatible(this.os,e)}
    method isCompatibleWithCPU (line 2) | isCompatibleWithCPU(e){return l.isManifestFieldCompatible(this.cpu,e)}
    method ensureDependencyMeta (line 2) | ensureDependencyMeta(e){if("unknown"!==e.range&&!s().valid(e.range))th...
    method ensurePeerDependencyMeta (line 2) | ensurePeerDependencyMeta(e){if("unknown"!==e.range)throw new Error(`In...
    method setRawField (line 2) | setRawField(e,t,{after:r=[]}={}){const A=new Set(r.filter(e=>Object.pr...
    method exportTo (line 2) | exportTo(e,{compatibilityMode:t=!0}={}){if(Object.assign(e,this.raw),n...
    method constructor (line 2) | constructor({libzip:e,baseFs:t=new o.S,filter:r=null,maxOpenFiles:A=1/...
    method openPromise (line 2) | static async openPromise(e,t){const r=new l(t);try{return await e(r)}f...
    method getExtractHint (line 2) | getExtractHint(e){return this.baseFs.getExtractHint(e)}
    method getRealPath (line 2) | getRealPath(){return this.baseFs.getRealPath()}
    method saveAndClose (line 2) | saveAndClose(){if((0,s.L)(this),this.zipInstances)for(const[e,{zipFs:t...
    method discardAndClose (line 2) | discardAndClose(){if((0,s.L)(this),this.zipInstances)for(const[e,{zipF...
    method resolve (line 2) | resolve(e){return this.baseFs.resolve(e)}
    method remapFd (line 2) | remapFd(e,t){const r=this.nextFd++|c;return this.fdMap.set(r,[e,t]),r}
    method openPromise (line 2) | async openPromise(e,t,r){return await this.makeCallPromise(e,async()=>...
    method openSync (line 2) | openSync(e,t,r){return this.makeCallSync(e,()=>this.baseFs.openSync(e,...
    method opendirPromise (line 2) | async opendirPromise(e,t){return await this.makeCallPromise(e,async()=...
    method opendirSync (line 2) | opendirSync(e,t){return this.makeCallSync(e,()=>this.baseFs.opendirSyn...
    method readPromise (line 2) | async readPromise(e,t,r,A,n){if(0==(e&c))return await this.baseFs.read...
    method readSync (line 2) | readSync(e,t,r,A,n){if(0==(e&c))return this.baseFs.readSync(e,t,r,A,n)...
    method writePromise (line 2) | async writePromise(e,t,r,A,n){if(0==(e&c))return"string"==typeof t?awa...
    method writeSync (line 2) | writeSync(e,t,r,A,n){if(0==(e&c))return"string"==typeof t?this.baseFs....
    method closePromise (line 2) | async closePromise(e){if(0==(e&c))return await this.baseFs.closePromis...
    method closeSync (line 2) | closeSync(e){if(0==(e&c))return this.baseFs.closeSync(e);const t=this....
    method createReadStream (line 2) | createReadStream(e,t){return null===e?this.baseFs.createReadStream(e,t...
    method createWriteStream (line 2) | createWriteStream(e,t){return null===e?this.baseFs.createWriteStream(e...
    method realpathPromise (line 2) | async realpathPromise(e){return await this.makeCallPromise(e,async()=>...
    method realpathSync (line 2) | realpathSync(e){return this.makeCallSync(e,()=>this.baseFs.realpathSyn...
    method existsPromise (line 2) | async existsPromise(e){return await this.makeCallPromise(e,async()=>aw...
    method existsSync (line 2) | existsSync(e){return this.makeCallSync(e,()=>this.baseFs.existsSync(e)...
    method accessPromise (line 2) | async accessPromise(e,t){return await this.makeCallPromise(e,async()=>...
    method accessSync (line 2) | accessSync(e,t){return this.makeCallSync(e,()=>this.baseFs.accessSync(...
    method statPromise (line 2) | async statPromise(e){return await this.makeCallPromise(e,async()=>awai...
    method statSync (line 2) | statSync(e){return this.makeCallSync(e,()=>this.baseFs.statSync(e),(e,...
    method lstatPromise (line 2) | async lstatPromise(e){return await this.makeCallPromise(e,async()=>awa...
    method lstatSync (line 2) | lstatSync(e){return this.makeCallSync(e,()=>this.baseFs.lstatSync(e),(...
    method chmodPromise (line 2) | async chmodPromise(e,t){return await this.makeCallPromise(e,async()=>a...
    method chmodSync (line 2) | chmodSync(e,t){return this.makeCallSync(e,()=>this.baseFs.chmodSync(e,...
    method chownPromise (line 2) | async chownPromise(e,t,r){return await this.makeCallPromise(e,async()=...
    method chownSync (line 2) | chownSync(e,t,r){return this.makeCallSync(e,()=>this.baseFs.chownSync(...
    method renamePromise (line 2) | async renamePromise(e,t){return await this.makeCallPromise(e,async()=>...
    method renameSync (line 2) | renameSync(e,t){return this.makeCallSync(e,()=>this.makeCallSync(t,()=...
    method copyFilePromise (line 2) | async copyFilePromise(e,t,r=0){const n=async(e,t,n,o)=>{if(0!=(r&A.con...
    method copyFileSync (line 2) | copyFileSync(e,t,r=0){const n=(e,t,n,o)=>{if(0!=(r&A.constants.COPYFIL...
    method appendFilePromise (line 2) | async appendFilePromise(e,t,r){return await this.makeCallPromise(e,asy...
    method appendFileSync (line 2) | appendFileSync(e,t,r){return this.makeCallSync(e,()=>this.baseFs.appen...
    method writeFilePromise (line 2) | async writeFilePromise(e,t,r){return await this.makeCallPromise(e,asyn...
    method writeFileSync (line 2) | writeFileSync(e,t,r){return this.makeCallSync(e,()=>this.baseFs.writeF...
    method unlinkPromise (line 2) | async unlinkPromise(e){return await this.makeCallPromise(e,async()=>aw...
    method unlinkSync (line 2) | unlinkSync(e){return this.makeCallSync(e,()=>this.baseFs.unlinkSync(e)...
    method utimesPromise (line 2) | async utimesPromise(e,t,r){return await this.makeCallPromise(e,async()...
    method utimesSync (line 2) | utimesSync(e,t,r){return this.makeCallSync(e,()=>this.baseFs.utimesSyn...
    method mkdirPromise (line 2) | async mkdirPromise(e,t){return await this.makeCallPromise(e,async()=>a...
    method mkdirSync (line 2) | mkdirSync(e,t){return this.makeCallSync(e,()=>this.baseFs.mkdirSync(e,...
    method rmdirPromise (line 2) | async rmdirPromise(e,t){return await this.makeCallPromise(e,async()=>a...
    method rmdirSync (line 2) | rmdirSync(e,t){return this.makeCallSync(e,()=>this.baseFs.rmdirSync(e,...
    method linkPromise (line 2) | async linkPromise(e,t){return await this.makeCallPromise(t,async()=>aw...
    method linkSync (line 2) | linkSync(e,t){return this.makeCallSync(t,()=>this.baseFs.linkSync(e,t)...
    method symlinkPromise (line 2) | async symlinkPromise(e,t,r){return await this.makeCallPromise(t,async(...
    method symlinkSync (line 2) | symlinkSync(e,t,r){return this.makeCallSync(t,()=>this.baseFs.symlinkS...
    method readFilePromise (line 2) | async readFilePromise(e,t){return this.makeCallPromise(e,async()=>{swi...
    method readFileSync (line 2) | readFileSync(e,t){return this.makeCallSync(e,()=>{switch(t){case"utf8"...
    method readdirPromise (line 2) | async readdirPromise(e,{withFileTypes:t}={}){return await this.makeCal...
    method readdirSync (line 2) | readdirSync(e,{withFileTypes:t}={}){return this.makeCallSync(e,()=>thi...
    method readlinkPromise (line 2) | async readlinkPromise(e){return await this.makeCallPromise(e,async()=>...
    method readlinkSync (line 2) | readlinkSync(e){return this.makeCallSync(e,()=>this.baseFs.readlinkSyn...
    method truncatePromise (line 2) | async truncatePromise(e,t){return await this.makeCallPromise(e,async()...
    method truncateSync (line 2) | truncateSync(e,t){return this.makeCallSync(e,()=>this.baseFs.truncateS...
    method watch (line 2) | watch(e,t,r){return this.makeCallSync(e,()=>this.baseFs.watch(e,t,r),(...
    method watchFile (line 2) | watchFile(e,t,r){return this.makeCallSync(e,()=>this.baseFs.watchFile(...
    method unwatchFile (line 2) | unwatchFile(e,t){return this.makeCallSync(e,()=>this.baseFs.unwatchFil...
    method makeCallPromise (line 2) | async makeCallPromise(e,t,r,{requireSubpath:A=!0}={}){if("string"!=typ...
    method makeCallSync (line 2) | makeCallSync(e,t,r,{requireSubpath:A=!0}={}){if("string"!=typeof e)ret...
    method findZip (line 2) | findZip(e){if(this.filter&&!this.filter.test(e))return null;let t="";f...
    method limitOpenFiles (line 2) | limitOpenFiles(e){if(null===this.zipInstances)return;const t=Date.now(...
    method getZipPromise (line 2) | async getZipPromise(e,t){const r=async()=>({baseFs:this.baseFs,libzip:...
    method getZipSync (line 2) | getZipSync(e,t){const r=()=>({baseFs:this.baseFs,libzip:this.libzip,re...
    method constructor (line 17) | constructor(e={}){super(),this.name=e.name,this.type=e.type,this.optio...
    method keypress (line 17) | async keypress(e,t={}){this.keypressed=!0;let r=o.action(e,o(e,t),this...
    method alert (line 17) | alert(){delete this.state.alert,!1===this.options.show?this.emit("aler...
    method cursorHide (line 17) | cursorHide(){this.stdout.write(g.cursor.hide()),c.onExit(()=>this.curs...
    method cursorShow (line 17) | cursorShow(){this.stdout.write(g.cursor.show())}
    method write (line 17) | write(e){e&&(this.stdout&&!1!==this.state.show&&this.stdout.write(e),t...
    method clear (line 17) | clear(e=0){let t=this.state.buffer;this.state.buffer="",(t||e)&&!1!==t...
    method restore (line 17) | restore(){if(this.state.closed||!1===this.options.show)return;let{prom...
    method sections (line 17) | sections(){let{buffer:e,input:t,prompt:r}=this.state;r=n.unstyle(r);le...
    method submit (line 17) | async submit(){this.state.submitted=!0,this.state.validating=!0,this.o...
    method cancel (line 17) | async cancel(e){this.state.cancelled=this.state.submitted=!0,await thi...
    method close (line 17) | async close(){this.state.closed=!0;try{let e=this.sections(),t=Math.ce...
    method start (line 17) | start(){this.stop||!1===this.options.show||(this.stop=o.listen(this,th...
    method skip (line 17) | async skip(){return this.skipped=!0===this.options.skip,"function"==ty...
    method initialize (line 17) | async initialize(){let{format:e,options:t,result:r}=this;if(this.forma...
    method render (line 17) | render(){throw new Error("expected prompt to have a custom render meth...
    method run (line 17) | run(){return new Promise(async(e,t)=>{if(this.once("submit",e),this.on...
    method element (line 17) | async element(e,t,r){let{options:A,state:n,symbols:o,timers:i}=this,s=...
    method prefix (line 17) | async prefix(){let e=await this.element("prefix")||this.symbols,t=this...
    method message (line 17) | async message(){let e=await this.element("message");return c.hasColor(...
    method separator (line 17) | async separator(){let e=await this.element("separator")||this.symbols,...
    method pointer (line 17) | async pointer(e,t){let r=await this.element("pointer",e,t);if("string"...
    method indicator (line 17) | async indicator(e,t){let r=await this.element("indicator",e,t);if("str...
    method body (line 17) | body(){return null}
    method footer (line 17) | footer(){if("pending"===this.state.status)return this.element("footer")}
    method header (line 17) | header(){if("pending"===this.state.status)return this.element("header")}
    method hint (line 17) | async hint(){if("pending"===this.state.status&&!this.isValue(this.stat...
    method error (line 17) | error(e){return this.state.submitted?"":e||this.state.error}
    method format (line 17) | format(e){return e}
    method result (line 17) | result(e){return e}
    method validate (line 17) | validate(e){return!0!==this.options.required||this.isValue(e)}
    method isValue (line 17) | isValue(e){return null!=e&&""!==e}
    method resolve (line 17) | resolve(e,...t){return c.resolve(this,e,...t)}
    method base (line 17) | get base(){return l.prototype}
    method style (line 17) | get style(){return this.styles[this.state.status]}
    method height (line 17) | get height(){return this.options.rows||c.height(this.stdout,25)}
    method width (line 17) | get width(){return this.options.columns||c.width(this.stdout,80)}
    method size (line 17) | get size(){return{width:this.width,height:this.height}}
    method cursor (line 17) | set cursor(e){this.state.cursor=e}
    method cursor (line 17) | get cursor(){return this.state.cursor}
    method input (line 17) | set input(e){this.state.input=e}
    method input (line 17) | get input(){return this.state.input}
    method value (line 17) | set value(e){this.state.value=e}
    method value (line 17) | get value(){let{input:e,value:t}=this.state,r=[t,e].find(this.isValue....
    method prompt (line 17) | static get prompt(){return e=>new this(e).run()}
  function u (line 2) | function u({parentLocator:e,path:t,folderHash:r,protocol:A}){const o=nul...
    method constructor (line 2) | constructor(e,t){super(`This command can only be run from within a wor...
    method constructor (line 2) | constructor(e){this.data=e}
    method constructor (line 2) | constructor(e,t){if("function"!=typeof e)throw new TypeError("Paramete...
    method createCacheableRequest (line 2) | createCacheableRequest(e){return(t,r)=>{let l;if("string"==typeof t)l=...
    method constructor (line 23) | constructor(e,t,r,A){this.origin=e,this.pattern=t,this.negative=r,this...
    method isHash (line 49) | get isHash(){return!0}
    method constructor (line 49) | constructor(e,t){const r=!!(t=l(t)).strict;this.source=e.trim();const ...
    method hexDigest (line 49) | hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toSt...
    method toJSON (line 49) | toJSON(){return this.toString()}
    method toString (line 49) | toString(e){if((e=l(e)).strict&&!(i.some(e=>e===this.algorithm)&&this....
  function h (line 2) | function h(e,{parentLocator:t,path:r,folderHash:A,protocol:o}){return n....
    method constructor (line 2) | constructor(){super(...arguments),this.quiet=!1,this.args=[]}
    method execute (line 2) | async execute(){return a.VK.telemetry=null,await l.xfs.mktempPromise(a...
    method constructor (line 2) | constructor(e,{project:t}){this.workspacesCwds=new Set,this.dependenci...
    method setup (line 2) | async setup(){this.manifest=A.xfs.existsSync(n.y1.join(this.cwd,c.G.fi...
    method accepts (line 2) | accepts(e){const t=e.indexOf(":"),r=-1!==t?e.slice(0,t+1):null,A=-1!==...
    method computeCandidateName (line 2) | computeCandidateName(){return this.cwd===this.project.cwd?"root-worksp...
    method persistManifest (line 2) | async persistManifest(){const e={};this.manifest.exportTo(e);const t=n...
    method isIntegrity (line 49) | get isIntegrity(){return!0}
    method toJSON (line 49) | toJSON(){return this.toString()}
    method toString (line 49) | toString(e){let t=(e=l(e)).sep||" ";return e.strict&&(t=t.replace(/\S+...
    method concat (line 49) | concat(e,t){t=l(t);const r="string"==typeof e?e:C(e,t);return p(`${thi...
    method hexDigest (line 49) | hexDigest(){return p(this,{single:!0}).hexDigest()}
    method match (line 49) | match(e,t){const r=p(e,t=l(t)),A=r.pickAlgorithm(t);return this[A]&&r[...
    method pickAlgorithm (line 49) | pickAlgorithm(e){const t=(e=l(e)).pickAlgorithm,r=Object.keys(this);if...
  function p (line 2) | async function p(e,{protocol:t,fetchOptions:r,inMemory:A=!1}){const{pare...
    method supports (line 2) | supports(e,t){return!(!(r=e.reference)||!h.some(e=>!!r.match(e)));var r}
    method getLocalPath (line 2) | getLocalPath(e,t){return null}
    method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[n,o,i]=...
    method fetchFromNetwork (line 2) | async fetchFromNetwork(e,t){const r=await n.get(this.getLocatorUrl(e,t...
    method getLocatorUrl (line 2) | getLocatorUrl(e,t){const{auth:r,username:A,reponame:n,treeish:o}=funct...
  function d (line 2) | async function d(e,{protocol:t,fetchOptions:r}){return(await p(e,{protoc...
  method supports (line 2) | supports(e,t){return!!s.test(e.reference)&&!!e.reference.startsWith("fil...
  method getLocalPath (line 2) | getLocalPath(e,t){return null}
  method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[A,o,i]=aw...
  method fetchFromDisk (line 2) | async fetchFromDisk(e,t){const{parentLocator:r,path:A}=n.parseFileStyleR...
  method supports (line 2) | supports(e,t){return!!e.reference.startsWith("file:")}
  method getLocalPath (line 2) | getLocalPath(e,t){const{parentLocator:r,path:A}=n.parseFileStyleRange(e....
  method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[A,o,i]=aw...
  method fetchFromDisk (line 2) | async fetchFromDisk(e,t){return p(e,{protocol:"file:",fetchOptions:t})}
  method supportsDescriptor (line 2) | supportsDescriptor(e,t){return!!s.test(e.range)&&(!!e.range.startsWith("...
  method supportsLocator (line 2) | supportsLocator(e,t){return!!s.test(e.reference)&&!!e.reference.startsWi...
  method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!0}
  method bindDescriptor (line 2) | bindDescriptor(e,t,r){return i.test(e.range)&&(e=n.makeDescriptor(e,"fil...
  method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return[]}
  method getCandidates (line 2) | async getCandidates(e,t,r){let A=e.range;return A.startsWith("file:")&&(...
  method getSatisfying (line 2) | async getSatisfying(e,t,r){return null}
  method resolve (line 2) | async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed:...
  method supportsDescriptor (line 2) | supportsDescriptor(e,t){return!!e.range.match(i)||!!e.range.startsWith("...
  method supportsLocator (line 2) | supportsLocator(e,t){return!!e.reference.startsWith("file:")}
  method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!1}
  method bindDescriptor (line 2) | bindDescriptor(e,t,r){return i.test(e.range)&&(e=n.makeDescriptor(e,"fil...
  method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return[]}
  method getCandidates (line 2) | async getCandidates(e,t,r){if(!r.fetchOptions)throw new Error("Assertion...
  method getSatisfying (line 2) | async getSatisfying(e,t,r){return null}
  method resolve (line 2) | async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed:...
  function E (line 2) | function E(){return{...process.env,GIT_SSH_COMMAND:"ssh -o BatchMode=yes"}}
  function m (line 2) | function m(e){return!!e&&B.some(t=>!!e.match(t))}
  function w (line 2) | function w(e){const t=(e=Q(e)).indexOf("#");if(-1===t)return{repo:e,tree...
  function Q (line 2) | function Q(e,{git:t=!1}={}){var r;if(e=(e=(e=e.replace(/^git\+https:/,"h...
  function D (line 2) | function D(e){return o.makeLocator(e,Q(e.reference))}
    method constructor (line 2) | constructor(){super(...arguments),this.all=!1,this.recursive=!1,this.e...
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method isVirtualDescriptor (line 2) | static isVirtualDescriptor(e){return!!e.range.startsWith(D.protocol)}
    method isVirtualLocator (line 2) | static isVirtualLocator(e){return!!e.reference.startsWith(D.protocol)}
    method supportsDescriptor (line 2) | supportsDescriptor(e,t){return D.isVirtualDescriptor(e)}
    method supportsLocator (line 2) | supportsLocator(e,t){return D.isVirtualLocator(e)}
    method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!1}
    method bindDescriptor (line 2) | bindDescriptor(e,t,r){throw new Error('Assertion failed: calling "bind...
    method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){throw new Error('Assertion failed: call...
    method getCandidates (line 2) | async getCandidates(e,t,r){throw new Error('Assertion failed: calling ...
    method getSatisfying (line 2) | async getSatisfying(e,t,r){throw new Error('Assertion failed: calling ...
    method resolve (line 2) | async resolve(e,t){throw new Error('Assertion failed: calling "resolve...
  function b (line 2) | async function b(e,t){const r=Q(e,{git:!0});if(!l.getNetworkSettings(r,{...
    method constructor (line 2) | constructor(){super(...arguments),this.chunks=[]}
    method _transform (line 2) | _transform(e,t,r){if("buffer"!==t||!Buffer.isBuffer(e))throw new Error...
    method _flush (line 2) | _flush(e){e(null,Buffer.concat(this.chunks))}
  function v (line 2) | async function v(e,t){const{repo:r,treeish:{protocol:A,request:n},extra:...
    method constructor (line 2) | constructor(e=Buffer.alloc(0)){super(),this.active=!0,this.ifEmpty=e}
    method _transform (line 2) | _transform(e,t,r){if("buffer"!==t||!Buffer.isBuffer(e))throw new Error...
    method _flush (line 2) | _flush(e){this.active&&this.ifEmpty.length>0&&e(null,this.ifEmpty)}
  function S (line 2) | async function S(e,t){return await t.getLimit("cloneConcurrency")(async(...
    method constructor (line 2) | constructor(){this.mode="strict"}
    method supportsPackage (line 2) | supportsPackage(e,t){return"pnp"===t.project.configuration.get("nodeLi...
    method findPackageLocation (line 2) | async findPackageLocation(e,t){const r=T(t.project).main;if(!i.xfs.exi...
    method findPackageLocator (line 2) | async findPackageLocator(e,t){const A=T(t.project).main;if(!i.xfs.exis...
    method makeInstaller (line 2) | makeInstaller(e){return new k(e)}
    method supports (line 2) | supports(e){return!!e.reference.startsWith(v.d.protocol)}
    method getLocalPath (line 2) | getLocalPath(e,t){return this.getWorkspace(e,t).cwd}
    method fetch (line 2) | async fetch(e,t){const r=this.getWorkspace(e,t).cwd;return{packageFs:n...
    method getWorkspace (line 2) | getWorkspace(e,t){return t.project.getWorkspaceByCwd(e.reference.slice...
    method constructor (line 2) | constructor(e){this.stream=e}
    method close (line 2) | close(){}
    method get (line 2) | get(){return this.stream}
  method supports (line 2) | supports(e,t){return m(e.reference)}
  method getLocalPath (line 2) | getLocalPath(e,t){return null}
  method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,A=D(e),n=n...
  method downloadHosted (line 2) | async downloadHosted(e,t){return t.project.configuration.reduceHook(e=>e...
  method cloneFromRemote (line 2) | async cloneFromRemote(e,t){const r=await S(e.reference,t.project.configu...
  method supportsDescriptor (line 2) | supportsDescriptor(e,t){return m(e.range)}
  method supportsLocator (line 2) | supportsLocator(e,t){return m(e.reference)}
  method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!0}
  method bindDescriptor (line 2) | bindDescriptor(e,t,r){return e}
  method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return[]}
  method getCandidates (line 2) | async getCandidates(e,t,r){const A=await v(e.range,r.project.configurati...
  method getSatisfying (line 2) | async getSatisfying(e,t,r){return null}
  method resolve (line 2) | async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed:...
  class p (line 2) | class p{supports(e,t){return!(!(r=e.reference)||!h.some(e=>!!r.match(e))...
    method supports (line 2) | supports(e,t){return!(!(r=e.reference)||!h.some(e=>!!r.match(e)));var r}
    method getLocalPath (line 2) | getLocalPath(e,t){return null}
    method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[n,o,i]=...
    method fetchFromNetwork (line 2) | async fetchFromNetwork(e,t){const r=await n.get(this.getLocatorUrl(e,t...
    method getLocatorUrl (line 2) | getLocatorUrl(e,t){const{auth:r,username:A,reponame:n,treeish:o}=funct...
  method fetchHostedRepository (line 2) | async fetchHostedRepository(e,t,r){if(null!==e)return e;const A=new p;if...
  method supports (line 2) | supports(e,t){return!!i.test(e.reference)&&!!s.test(e.reference)}
  method getLocalPath (line 2) | getLocalPath(e,t){return null}
  method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[n,o,i]=aw...
  method fetchFromNetwork (line 2) | async fetchFromNetwork(e,t){const r=await n.get(e.reference,{configurati...
  method supportsDescriptor (line 2) | supportsDescriptor(e,t){return!!i.test(e.range)&&!!s.test(e.range)}
  method supportsLocator (line 2) | supportsLocator(e,t){return!!i.test(e.reference)&&!!s.test(e.reference)}
  method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!0}
  method bindDescriptor (line 2) | bindDescriptor(e,t,r){return e}
  method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return[]}
  method getCandidates (line 2) | async getCandidates(e,t,r){return[A.convertDescriptorToLocator(e)]}
  method getSatisfying (line 2) | async getSatisfying(e,t,r){return null}
  method resolve (line 2) | async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed:...
  class f (line 2) | class f extends o.BaseCommand{constructor(){super(...arguments),this.use...
    method constructor (line 2) | constructor(){super(...arguments),this.usev2=!1,this.assumeFreshProjec...
    method execute (line 2) | async execute(){if(l.xfs.existsSync(u.y1.join(this.context.cwd,i.G.fil...
    method executeProxy (line 2) | async executeProxy(e,t){if(null!==e.get("yarnPath"))throw new h.UsageE...
    method executeRegular (line 2) | async executeRegular(e){let t=null;if(!this.assumeFreshProject)try{t=a...
    method constructor (line 2) | constructor({configuration:e,stdout:t,json:r=!1,includeFooter:A=!0,inc...
    method start (line 2) | static async start(e,t){const r=new this(e),A=process.emitWarning;proc...
    method hasErrors (line 2) | hasErrors(){return this.errorCount>0}
    method exitCode (line 2) | exitCode(){return this.hasErrors()?1:0}
    method reportCacheHit (line 2) | reportCacheHit(e){this.cacheHitCount+=1}
    method reportCacheMiss (line 2) | reportCacheMiss(e,t){this.cacheMissCount+=1,void 0===t||this.configura...
    method startTimerSync (line 2) | startTimerSync(e,t,r){const A="function"==typeof t?t:r,n={committed:!1...
    method startTimerPromise (line 2) | async startTimerPromise(e,t,r){const A="function"==typeof t?t:r,n={com...
    method startCacheReport (line 2) | async startCacheReport(e){const t=this.configuration.get("preferAggreg...
    method reportSeparator (line 2) | reportSeparator(){0===this.indent?this.writeLineWithForgettableReset("...
    method reportInfo (line 2) | reportInfo(e,t){if(!this.includeInfos)return;this.commit();const r=`${...
    method reportWarning (line 2) | reportWarning(e,t){this.warningCount+=1,this.includeWarnings&&(this.co...
    method reportError (line 2) | reportError(e,t){this.errorCount+=1,this.commit(),this.json?this.repor...
    method reportProgress (line 2) | reportProgress(e){let t=!1;const r=Promise.resolve().then(async()=>{co...
    method reportJson (line 2) | reportJson(e){this.json&&this.writeLineWithForgettableReset(""+JSON.st...
    method finalize (line 2) | async finalize(){if(!this.includeFooter)return;let e="";e=this.errorCo...
    method writeLine (line 2) | writeLine(e,{truncate:t}={}){this.clearProgress({clear:!0}),this.stdou...
    method writeLineWithForgettableReset (line 2) | writeLineWithForgettableReset(e,{truncate:t}={}){this.forgettableLines...
    method writeLines (line 2) | writeLines(e,{truncate:t}={}){this.clearProgress({delta:e.length});for...
    method reportCacheChanges (line 2) | reportCacheChanges({cacheHitCount:e,cacheMissCount:t}){const r=this.ca...
    method commit (line 2) | commit(){const e=this.uncommitted;this.uncommitted=new Set;for(const t...
    method clearProgress (line 2) | clearProgress({delta:e=0,clear:t=!1}){this.configuration.get("enablePr...
    method writeProgress (line 2) | writeProgress(){if(!this.configuration.get("enableProgressBars")||this...
    method refreshProgress (line 2) | refreshProgress(e=0){let t=!1;if(0===this.progress.size)t=!0;else for(...
    method truncate (line 2) | truncate(e,{truncate:t}={}){return this.configuration.get("enableProgr...
    method formatName (line 2) | formatName(e){return d(e,{configuration:this.configuration,json:this.j...
    method formatNameWithHyperlink (line 2) | formatNameWithHyperlink(e){return C(e,{configuration:this.configuratio...
    method formatIndent (line 2) | formatIndent(){return"│ ".repeat(this.indent)}
    method constructor (line 2) | constructor(e,t){super(),this.lzSource=null,this.listings=new Map,this...
    method makeLibzipError (line 2) | makeLibzipError(e){const t=this.libzip.struct.errorCodeZip(e),r=this.l...
    method getExtractHint (line 2) | getExtractHint(e){for(const t of this.entries.keys()){const r=this.pat...
    method getAllFiles (line 2) | getAllFiles(){return Array.from(this.entries.keys())}
    method getRealPath (line 2) | getRealPath(){if(!this.path)throw new Error("ZipFS don't have real pat...
    method getBufferAndClose (line 2) | getBufferAndClose(){if(this.prepareClose(),!this.lzSource)throw new Er...
    method prepareClose (line 2) | prepareClose(){if(!this.ready)throw h.Vw("archive closed, close");(0,l...
    method saveAndClose (line 2) | saveAndClose(){if(!this.path||!this.baseFs)throw new Error("ZipFS cann...
    method discardAndClose (line 2) | discardAndClose(){this.prepareClose(),this.libzip.discard(this.zip),th...
    method resolve (line 2) | resolve(e){return p.y1.resolve(p.LZ.root,e)}
    method openPromise (line 2) | async openPromise(e,t,r){return this.openSync(e,t,r)}
    method openSync (line 2) | openSync(e,t,r){const A=this.nextFd++;return this.fds.set(A,{cursor:0,...
    method hasOpenFileHandles (line 2) | hasOpenFileHandles(){return!!this.fds.size}
    method opendirPromise (line 2) | async opendirPromise(e,t){return this.opendirSync(e,t)}
    method opendirSync (line 2) | opendirSync(e,t={}){const r=this.resolveFilename(`opendir '${e}'`,e);i...
    method readPromise (line 2) | async readPromise(e,t,r,A,n){return this.readSync(e,t,r,A,n)}
    method readSync (line 2) | readSync(e,t,r=0,A=0,n=-1){const o=this.fds.get(e);if(void 0===o)throw...
    method writePromise (line 2) | async writePromise(e,t,r,A,n){return"string"==typeof t?this.writeSync(...
    method writeSync (line 2) | writeSync(e,t,r,A,n){if(void 0===this.fds.get(e))throw h.Ch("read");th...
    method closePromise (line 2) | async closePromise(e){return this.closeSync(e)}
    method closeSync (line 2) | closeSync(e){if(void 0===this.fds.get(e))throw h.Ch("read");this.fds.d...
    method createReadStream (line 2) | createReadStream(e,{encoding:t}={}){if(null===e)throw new Error("Unimp...
    method createWriteStream (line 2) | createWriteStream(e,{encoding:t}={}){if(this.readOnly)throw h.YW(`open...
    method realpathPromise (line 2) | async realpathPromise(e){return this.realpathSync(e)}
    method realpathSync (line 2) | realpathSync(e){const t=this.resolveFilename(`lstat '${e}'`,e);if(!thi...
    method existsPromise (line 2) | async existsPromise(e){return this.existsSync(e)}
    method existsSync (line 2) | existsSync(e){if(!this.ready)throw h.Vw(`archive closed, existsSync '$...
    method accessPromise (line 2) | async accessPromise(e,t){return this.accessSync(e,t)}
    method accessSync (line 2) | accessSync(e,t=A.constants.F_OK){const r=this.resolveFilename(`access ...
    method statPromise (line 2) | async statPromise(e){return this.statSync(e)}
    method statSync (line 2) | statSync(e){const t=this.resolveFilename(`stat '${e}'`,e);if(!this.ent...
    method lstatPromise (line 2) | async lstatPromise(e){return this.lstatSync(e)}
    method lstatSync (line 2) | lstatSync(e){const t=this.resolveFilename(`lstat '${e}'`,e,!1);if(!thi...
    method statImpl (line 2) | statImpl(e,t){const r=this.entries.get(t);if(void 0!==r){const e=this....
    method getUnixMode (line 2) | getUnixMode(e,t){if(-1===this.libzip.file.getExternalAttributes(this.z...
    method registerListing (line 2) | registerListing(e){let t=this.listings.get(e);if(t)return t;const r=th...
    method registerEntry (line 2) | registerEntry(e,t){this.registerListing(p.y1.dirname(e)).add(p.y1.base...
    method unregisterListing (line 2) | unregisterListing(e){this.listings.delete(e);const t=this.listings.get...
    method unregisterEntry (line 2) | unregisterEntry(e){this.unregisterListing(e);const t=this.entries.get(...
    method deleteEntry (line 2) | deleteEntry(e,t){this.unregisterEntry(e);if(-1===this.libzip.delete(th...
    method resolveFilename (line 2) | resolveFilename(e,t,r=!0){if(!this.ready)throw h.Vw("archive closed, "...
    method allocateBuffer (line 2) | allocateBuffer(e){Buffer.isBuffer(e)||(e=Buffer.from(e));const t=this....
    method allocateUnattachedSource (line 2) | allocateUnattachedSource(e){const t=this.libzip.struct.errorS(),{buffe...
    method allocateSource (line 2) | allocateSource(e){const{buffer:t,byteLength:r}=this.allocateBuffer(e),...
    method setFileSource (line 2) | setFileSource(e,t){const r=Buffer.isBuffer(t)?t:Buffer.from(t),A=p.y1....
    method isSymbolicLink (line 2) | isSymbolicLink(e){if(0===this.symlinkCount)return!1;if(-1===this.libzi...
    method getFileSource (line 2) | getFileSource(e,t={asyncDecompress:!1}){const r=this.fileSources.get(e...
    method chmodPromise (line 2) | async chmodPromise(e,t){return this.chmodSync(e,t)}
    method chmodSync (line 2) | chmodSync(e,t){if(this.readOnly)throw h.YW(`chmod '${e}'`);t&=493;cons...
    method chownPromise (line 2) | async chownPromise(e,t,r){return this.chownSync(e,t,r)}
    method chownSync (line 2) | chownSync(e,t,r){throw new Error("Unimplemented")}
    method renamePromise (line 2) | async renamePromise(e,t){return this.renameSync(e,t)}
    method renameSync (line 2) | renameSync(e,t){throw new Error("Unimplemented")}
    method copyFilePromise (line 2) | async copyFilePromise(e,t,r){const{indexSource:A,indexDest:n,resolvedD...
    method copyFileSync (line 2) | copyFileSync(e,t,r=0){const{indexSource:A,indexDest:n,resolvedDestP:o}...
    method prepareCopyFile (line 2) | prepareCopyFile(e,t,r=0){if(this.readOnly)throw h.YW(`copyfile '${e} -...
    method appendFilePromise (line 2) | async appendFilePromise(e,t,r){if(this.readOnly)throw h.YW(`open '${e}...
    method appendFileSync (line 2) | appendFileSync(e,t,r={}){if(this.readOnly)throw h.YW(`open '${e}'`);re...
    method writeFilePromise (line 2) | async writeFilePromise(e,t,r){const{encoding:A,index:n,resolvedP:o}=th...
    method writeFileSync (line 2) | writeFileSync(e,t,r){const{encoding:A,index:n,resolvedP:o}=this.prepar...
    method prepareWriteFile (line 2) | prepareWriteFile(e,t){if("string"!=typeof e)throw h.Ch("read");if(this...
    method unlinkPromise (line 2) | async unlinkPromise(e){return this.unlinkSync(e)}
    method unlinkSync (line 2) | unlinkSync(e){if(this.readOnly)throw h.YW(`unlink '${e}'`);const t=thi...
    method utimesPromise (line 2) | async utimesPromise(e,t,r){return this.utimesSync(e,t,r)}
    method utimesSync (line 2) | utimesSync(e,t,r){if(this.readOnly)throw h.YW(`utimes '${e}'`);const A...
    method lutimesPromise (line 2) | async lutimesPromise(e,t,r){return this.lutimesSync(e,t,r)}
    method lutimesSync (line 2) | lutimesSync(e,t,r){if(this.readOnly)throw h.YW(`lutimes '${e}'`);const...
    method utimesImpl (line 2) | utimesImpl(e,t){this.listings.has(e)&&(this.entries.has(e)||this.hydra...
    method mkdirPromise (line 2) | async mkdirPromise(e,t){return this.mkdirSync(e,t)}
    method mkdirSync (line 2) | mkdirSync(e,{mode:t=493,recursive:r=!1}={}){if(r)return void this.mkdi...
    method rmdirPromise (line 2) | async rmdirPromise(e,t){return this.rmdirSync(e,t)}
    method rmdirSync (line 2) | rmdirSync(e,{recursive:t=!1}={}){if(this.readOnly)throw h.YW(`rmdir '$...
    method hydrateDirectory (line 2) | hydrateDirectory(e){const t=this.libzip.dir.add(this.zip,p.y1.relative...
    method linkPromise (line 2) | async linkPromise(e,t){return this.linkSync(e,t)}
    method linkSync (line 2) | linkSync(e,t){throw h.Hs(`link '${e}' -> '${t}'`)}
    method symlinkPromise (line 2) | async symlinkPromise(e,t){return this.symlinkSync(e,t)}
    method symlinkSync (line 2) | symlinkSync(e,t){if(this.readOnly)throw h.YW(`symlink '${e}' -> '${t}'...
    method readFilePromise (line 2) | async readFilePromise(e,t){"object"==typeof t&&(t=t?t.encoding:void 0)...
    method readFileSync (line 2) | readFileSync(e,t){"object"==typeof t&&(t=t?t.encoding:void 0);const r=...
    method readFileBuffer (line 2) | readFileBuffer(e,t={asyncDecompress:!1}){if("string"!=typeof e)throw h...
    method readdirPromise (line 2) | async readdirPromise(e,{withFileTypes:t}={}){return this.readdirSync(e...
    method readdirSync (line 2) | readdirSync(e,{withFileTypes:t}={}){const r=this.resolveFilename(`scan...
    method readlinkPromise (line 2) | async readlinkPromise(e){const t=this.prepareReadlink(e);return(await ...
    method readlinkSync (line 2) | readlinkSync(e){const t=this.prepareReadlink(e);return this.getFileSou...
    method prepareReadlink (line 2) | prepareReadlink(e){const t=this.resolveFilename(`readlink '${e}'`,e,!1...
    method truncatePromise (line 2) | async truncatePromise(e,t=0){const r=this.resolveFilename(`open '${e}'...
    method truncateSync (line 2) | truncateSync(e,t=0){const r=this.resolveFilename(`open '${e}'`,e),A=th...
    method watch (line 2) | watch(e,t,r){let A;switch(typeof t){case"function":case"string":case"u...
    method watchFile (line 2) | watchFile(e,t,r){const A=this.resolveFilename(`open '${e}'`,e);return(...
    method unwatchFile (line 2) | unwatchFile(e,t){const r=this.resolveFilename(`open '${e}'`,e);return(...
    method constructor (line 2) | constructor(){super(s.y1)}
    method getExtractHint (line 2) | getExtractHint(){throw C()}
    method getRealPath (line 2) | getRealPath(){throw C()}
    method resolve (line 2) | resolve(){throw C()}
    method openPromise (line 2) | async openPromise(){throw C()}
    method openSync (line 2) | openSync(){throw C()}
    method opendirPromise (line 2) | async opendirPromise(){throw C()}
    method opendirSync (line 2) | opendirSync(){throw C()}
    method readPromise (line 2) | async readPromise(){throw C()}
    method readSync (line 2) | readSync(){throw C()}
    method writePromise (line 2) | async writePromise(){throw C()}
    method writeSync (line 2) | writeSync(){throw C()}
    method closePromise (line 2) | async closePromise(){throw C()}
    method closeSync (line 2) | closeSync(){throw C()}
    method createWriteStream (line 2) | createWriteStream(){throw C()}
    method createReadStream (line 2) | createReadStream(){throw C()}
    method realpathPromise (line 2) | async realpathPromise(){throw C()}
    method realpathSync (line 2) | realpathSync(){throw C()}
    method readdirPromise (line 2) | async readdirPromise(){throw C()}
    method readdirSync (line 2) | readdirSync(){throw C()}
    method existsPromise (line 2) | async existsPromise(e){throw C()}
    method existsSync (line 2) | existsSync(e){throw C()}
    method accessPromise (line 2) | async accessPromise(){throw C()}
    method accessSync (line 2) | accessSync(){throw C()}
    method statPromise (line 2) | async statPromise(){throw C()}
    method statSync (line 2) | statSync(){throw C()}
    method lstatPromise (line 2) | async lstatPromise(e){throw C()}
    method lstatSync (line 2) | lstatSync(e){throw C()}
    method chmodPromise (line 2) | async chmodPromise(){throw C()}
    method chmodSync (line 2) | chmodSync(){throw C()}
    method chownPromise (line 2) | async chownPromise(){throw C()}
    method chownSync (line 2) | chownSync(){throw C()}
    method mkdirPromise (line 2) | async mkdirPromise(){throw C()}
    method mkdirSync (line 2) | mkdirSync(){throw C()}
    method rmdirPromise (line 2) | async rmdirPromise(){throw C()}
    method rmdirSync (line 2) | rmdirSync(){throw C()}
    method linkPromise (line 2) | async linkPromise(){throw C()}
    method linkSync (line 2) | linkSync(){throw C()}
    method symlinkPromise (line 2) | async symlinkPromise(){throw C()}
    method symlinkSync (line 2) | symlinkSync(){throw C()}
    method renamePromise (line 2) | async renamePromise(){throw C()}
    method renameSync (line 2) | renameSync(){throw C()}
    method copyFilePromise (line 2) | async copyFilePromise(){throw C()}
    method copyFileSync (line 2) | copyFileSync(){throw C()}
    method appendFilePromise (line 2) | async appendFilePromise(){throw C()}
    method appendFileSync (line 2) | appendFileSync(){throw C()}
    method writeFilePromise (line 2) | async writeFilePromise(){throw C()}
    method writeFileSync (line 2) | writeFileSync(){throw C()}
    method unlinkPromise (line 2) | async unlinkPromise(){throw C()}
    method unlinkSync (line 2) | unlinkSync(){throw C()}
    method utimesPromise (line 2) | async utimesPromise(){throw C()}
    method utimesSync (line 2) | utimesSync(){throw C()}
    method readFilePromise (line 2) | async readFilePromise(){throw C()}
    method readFileSync (line 2) | readFileSync(){throw C()}
    method readlinkPromise (line 2) | async readlinkPromise(){throw C()}
    method readlinkSync (line 2) | readlinkSync(){throw C()}
    method truncatePromise (line 2) | async truncatePromise(){throw C()}
    method truncateSync (line 2) | truncateSync(){throw C()}
    method watch (line 2) | watch(){throw C()}
    method watchFile (line 2) | watchFile(){throw C()}
    method unwatchFile (line 2) | unwatchFile(){throw C()}
    method constructor (line 23) | constructor({ignorecase:e=!0}={}){var t,r,A;this._rules=[],this._ignor...
    method _initCache (line 23) | _initCache(){this._ignoreCache=Object.create(null),this._testCache=Obj...
    method _addPattern (line 23) | _addPattern(e){if(e&&e[s])return this._rules=this._rules.concat(e._rul...
    method add (line 23) | add(e){return this._added=!1,t(l(e)?(e=>e.split(o))(e):e).forEach(this...
    method addPattern (line 23) | addPattern(e){return this.add(e)}
    method _testOne (line 23) | _testOne(e,t){let r=!1,A=!1;return this._rules.forEach(n=>{const{negat...
    method _test (line 23) | _test(e,t,r,A){const n=e&&d.convert(e);return d(n,e,p),this._t(n,t,r,A)}
    method _t (line 23) | _t(e,t,r,A){if(e in t)return t[e];if(A||(A=e.split("/")),A.pop(),!A.le...
    method ignores (line 23) | ignores(e){return this._test(e,this._ignoreCache,!1).ignored}
    method createFilter (line 23) | createFilter(){return e=>!this.ignores(e)}
    method filter (line 23) | filter(e){return t(e).filter(this.createFilter())}
    method test (line 23) | test(e){return this._test(e,this._testCache,!0)}
  method supports (line 2) | supports(e,t){return!!e.reference.startsWith("link:")}
  method getLocalPath (line 2) | getLocalPath(e,t){const{parentLocator:r,path:o}=A.parseFileStyleRange(e....
  method fetch (line 2) | async fetch(e,t){const{parentLocator:r,path:s}=A.parseFileStyleRange(e.r...
  method supports (line 2) | supports(e,t){return!!e.reference.startsWith("portal:")}
  method getLocalPath (line 2) | getLocalPath(e,t){const{parentLocator:r,path:o}=A.parseFileStyleRange(e....
  method fetch (line 2) | async fetch(e,t){const{parentLocator:r,path:s}=A.parseFileStyleRange(e.r...
  method supportsDescriptor (line 2) | supportsDescriptor(e,t){return!!e.range.startsWith("link:")}
  method supportsLocator (line 2) | supportsLocator(e,t){return!!e.reference.startsWith("link:")}
  method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!1}
  method bindDescriptor (line 2) | bindDescriptor(e,t,r){return A.bindDescriptor(e,{locator:A.stringifyLoca...
  method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return[]}
  method getCandidates (line 2) | async getCandidates(e,t,r){const o=e.range.slice("link:".length);return[...
  method getSatisfying (line 2) | async getSatisfying(e,t,r){return null}
  method resolve (line 2) | async resolve(e,t){return{...e,version:"0.0.0",languageName:t.project.co...
  method supportsDescriptor (line 2) | supportsDescriptor(e,t){return!!e.range.startsWith("portal:")}
  method supportsLocator (line 2) | supportsLocator(e,t){return!!e.reference.startsWith("portal:")}
  method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!1}
  method bindDescriptor (line 2) | bindDescriptor(e,t,r){return A.bindDescriptor(e,{locator:A.stringifyLoca...
  method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return[]}
  method getCandidates (line 2) | async getCandidates(e,t,r){const o=e.range.slice("portal:".length);retur...
  method getSatisfying (line 2) | async getSatisfying(e,t,r){return null}
  method resolve (line 2) | async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed:...
  class J (line 2) | class J{constructor(e){this.opts=e,this.localStore=new Map,this.customDa...
    method constructor (line 2) | constructor(e){this.opts=e,this.localStore=new Map,this.customData={st...
    method getCustomDataKey (line 2) | getCustomDataKey(){return JSON.stringify({name:"NodeModulesInstaller",...
    method attachCustomData (line 2) | attachCustomData(e){this.customData=e}
    method installPackage (line 2) | async installPackage(e,t){var r;const A=o.y1.resolve(t.packageFs.getRe...
    method attachInternalDependencies (line 2) | async attachInternalDependencies(e,t){const r=this.localStore.get(e.lo...
    method attachExternalDependents (line 2) | async attachExternalDependents(e,t){throw new Error("External dependen...
    method finalizeInstall (line 2) | async finalizeInstall(){if("node-modules"!==this.opts.project.configur...
    method constructor (line 2) | constructor(e){this.resolver=e}
    method supportsDescriptor (line 2) | supportsDescriptor(e,t){return this.resolver.supportsDescriptor(e,t)}
    method supportsLocator (line 2) | supportsLocator(e,t){return this.resolver.supportsLocator(e,t)}
    method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return this.resolver.shouldPersistResolut...
    method bindDescriptor (line 2) | bindDescriptor(e,t,r){return this.resolver.bindDescriptor(e,t,r)}
    method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return this.resolver.getResolutionDepen...
    method getCandidates (line 2) | async getCandidates(e,t,r){throw new H.lk(P.b.MISSING_LOCKFILE_ENTRY,"...
    method getSatisfying (line 2) | async getSatisfying(e,t,r){throw new H.lk(P.b.MISSING_LOCKFILE_ENTRY,"...
    method resolve (line 2) | async resolve(e,t){throw new H.lk(P.b.MISSING_LOCKFILE_ENTRY,"This pac...
  function q (line 2) | async function q(e,{unrollAliases:t=!1}={}){const r=e.cwd,A=o.y1.join(r,...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1,this.home=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  function Z (line 2) | function Z(e){let t=i.parseDescriptor(e);return i.isVirtualDescriptor(t)...
    method constructor (line 23) | constructor(e,t,r){var A;if(super(e),Error.captureStackTrace(this,this...
  class te (line 2) | class te extends O.PnpLinker{constructor(){super(...arguments),this.mode...
    method constructor (line 2) | constructor(){super(...arguments),this.patterns=[],this.strategy=W.HIG...
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method constructor (line 2) | constructor(){super(...arguments),this.mode="loose"}
    method makeInstaller (line 2) | makeInstaller(e){return new re(e)}
    method execute (line 2) | async execute(){const e=await n.VK.find(this.context.cwd,this.context....
    method constructor (line 23) | constructor(e,t){super(e.message,e,t),this.name="CacheError"}
  class re (line 2) | class re extends O.PnpInstaller{constructor(){super(...arguments),this.m...
    method execute (line 2) | async execute(){const{plugins:e}=await s.VK.find(this.context.cwd,this...
    method constructor (line 2) | constructor(){super(...arguments),this.mode="loose"}
    method finalizeInstallWithPnp (line 2) | async finalizeInstallWithPnp(e){if(this.opts.project.configuration.get...
    method constructor (line 23) | constructor(e,t){super(e.message,e,t),this.name="UploadError"}
  method supportsPackage (line 2) | supportsPackage(e,t){return"node-modules"===t.project.configuration.get(...
  method findPackageLocation (line 2) | async findPackageLocation(e,t){const r=t.project.tryWorkspaceByLocator(e...
  method findPackageLocator (line 2) | async findPackageLocator(e,t){const r=await q(t.project,{unrollAliases:!...
  method makeInstaller (line 2) | makeInstaller(e){return new J(e)}
  function B (line 2) | function B(e,t){const r=[],A=new Set,n=e=>{A.has(e)||(A.add(e),r.push(e)...
  function y (line 2) | function y(e,t,{all:r}){const A=r?e.workspaces:[t],n=A.map(e=>e.manifest...
    method constructor (line 2) | constructor(e){this.fetchers=e}
    method supports (line 2) | supports(e,t){return!!this.tryFetcher(e,t)}
    method getLocalPath (line 2) | getLocalPath(e,t){return this.getFetcher(e,t).getLocalPath(e,t)}
    method fetch (line 2) | async fetch(e,t){const r=this.getFetcher(e,t);return await r.fetch(e,t)}
    method tryFetcher (line 2) | tryFetcher(e,t){const r=this.fetchers.find(r=>r.supports(e,t));return ...
    method getFetcher (line 2) | getFetcher(e,t){const r=this.fetchers.find(r=>r.supports(e,t));if(!r)t...
  function m (line 2) | function m(e){const t={};for(const r of e)t[C.stringifyIdent(r)]=C.parse...
  function w (line 2) | function w(e){if(void 0===e)return new Set;const t=E.indexOf(e),r=E.slic...
  function Q (line 2) | function Q(e,t){var r;const A=function(e,t){const r=w(t),A={};for(const ...
  class D (line 2) | class D extends s.BaseCommand{constructor(){super(...arguments),this.all...
    method constructor (line 2) | constructor(){super(...arguments),this.all=!1,this.recursive=!1,this.e...
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method isVirtualDescriptor (line 2) | static isVirtualDescriptor(e){return!!e.range.startsWith(D.protocol)}
    method isVirtualLocator (line 2) | static isVirtualLocator(e){return!!e.reference.startsWith(D.protocol)}
    method supportsDescriptor (line 2) | supportsDescriptor(e,t){return D.isVirtualDescriptor(e)}
    method supportsLocator (line 2) | supportsLocator(e,t){return D.isVirtualLocator(e)}
    method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!1}
    method bindDescriptor (line 2) | bindDescriptor(e,t,r){throw new Error('Assertion failed: calling "bind...
    method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){throw new Error('Assertion failed: call...
    method getCandidates (line 2) | async getCandidates(e,t,r){throw new Error('Assertion failed: calling ...
    method getSatisfying (line 2) | async getSatisfying(e,t,r){throw new Error('Assertion failed: calling ...
    method resolve (line 2) | async resolve(e,t){throw new Error('Assertion failed: calling "resolve...
  class F (line 2) | class F extends s.BaseCommand{constructor(){super(...arguments),this.jso...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method constructor (line 2) | constructor(e,t){this.allOptionNames=[],this.arity={leading:[],trailin...
    method addPath (line 2) | addPath(e){this.paths.push(e)}
    method setArity (line 2) | setArity({leading:e=this.arity.leading,trailing:t=this.arity.trailing,...
    method addPositional (line 2) | addPositional({name:e="arg",required:t=!0}={}){if(!t&&this.arity.extra...
    method addRest (line 2) | addRest({name:e="arg",required:t=0}={}){if(this.arity.extra===N)throw ...
    method addProxy (line 2) | addProxy({required:e=0}={}){this.addRest({required:e}),this.arity.prox...
    method addOption (line 2) | addOption({names:e,description:t,arity:r=0,hidden:A=!1,allowBinding:n=...
    method setContext (line 2) | setContext(e){this.context=e}
    method usage (line 2) | usage({detailed:e=!0,inlineOptions:t=!0}={}){const r=[this.cliOpts.bin...
    method compile (line 2) | compile(){if(void 0===this.context)throw new Error("Assertion failed: ...
    method registerOptions (line 2) | registerOptions(e,t){w(e,t,["isOption","--"],t,"inhibateOptions"),w(e,...
  function K (line 2) | function K(e){if(Array.isArray(e)){const t=[];for(let r of e)r=K(r),r&&t...
    method constructor (line 2) | constructor({binaryName:e="..."}={}){this.builders=[],this.opts={binar...
    method build (line 2) | static build(e,t={}){return new K(t).commands(e).compile()}
    method getBuilderByIndex (line 2) | getBuilderByIndex(e){if(!(e>=0&&e<this.builders.length))throw new Erro...
    method commands (line 2) | commands(e){for(const t of e)t(this.command());return this}
    method command (line 2) | command(){const e=new F(this.builders.length,this.opts);return this.bu...
    method compile (line 2) | compile(){const e=[],t=[];for(const r of this.builders){const{machine:...
  class R (line 2) | class R extends s.BaseCommand{constructor(){super(...arguments),this.pub...
    method constructor (line 2) | constructor(){super(...arguments),this.publish=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  function x (line 2) | async function x({scope:e,publish:t,configuration:r,cwd:A}){return e&&t?...
    method constructor (line 2) | constructor(){super(...arguments),this.verbose=!1,this.json=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method supports (line 2) | supports(e,t){if(!e.reference.startsWith("npm:"))return!1;const r=new ...
    method getLocalPath (line 2) | getLocalPath(e,t){return null}
    method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[A,n,o]=...
    method fetchFromNetwork (line 2) | async fetchFromNetwork(e,t){let r;try{r=await v(x.getLocatorUrl(e),{co...
    method isConventionalTarballUrl (line 2) | static isConventionalTarballUrl(e,t,{configuration:r}){let A=B(e.scope...
    method getLocatorUrl (line 2) | static getLocatorUrl(e){const t=g().clean(e.reference.slice("npm:".len...
    method execute (line 17) | async execute(){this.context.stdout.write(this.cli.usage(null))}
  class P (line 2) | class P extends s.BaseCommand{constructor(){super(...arguments),this.pub...
    method constructor (line 2) | constructor(){super(...arguments),this.publish=!1,this.all=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  function O (line 2) | function O(e,t){const r=e[t];if(!f.isIndexableObject(r))return!1;const A...
    method constructor (line 2) | constructor(){super(...arguments),this.installIfNeeded=!1,this.dryRun=...
    method execute (line 2) | async execute(){const e=await p.VK.find(this.context.cwd,this.context....
  function U (line 2) | async function U(e,t){return await o.VK.updateHomeConfiguration({[e]:e=>...
    method constructor (line 2) | constructor(){super(...arguments),this.patterns=[],this.all=!1,this.re...
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  class Y (line 2) | class Y extends s.BaseCommand{constructor(){super(...arguments),this.tag...
    method constructor (line 2) | constructor(){super(...arguments),this.tag="latest",this.tolerateRepub...
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method constructor (line 17) | constructor({binaryLabel:e,binaryName:t="...",binaryVersion:r,enableCo...
    method from (line 17) | static from(e,t={}){const r=new Y(t);for(const t of e)r.register(t);re...
    method register (line 17) | register(e){const t=this.builder.command();this.registrations.set(e,t....
    method process (line 17) | process(e){const{contexts:t,process:r}=this.builder.compile(),A=r(e);s...
    method run (line 17) | async run(e,t){let r,A;if(Array.isArray(e))try{r=this.process(e)}catch...
    method runExit (line 17) | async runExit(e,t){process.exitCode=await this.run(e,t)}
    method suggest (line 17) | suggest(e,t){const{contexts:r,process:A,suggest:n}=this.builder.compil...
    method definitions (line 17) | definitions({colored:e=!1}={}){const t=[];for(const[r,A]of this.regist...
    method usage (line 17) | usage(e=null,{colored:t,detailed:r=!1,prefix:A="$ "}={}){const n=null!...
    method error (line 17) | error(e,{colored:t,command:r=null}={}){e instanceof Error||(e=new Erro...
    method getUsageByRegistration (line 17) | getUsageByRegistration(e,t){const r=this.registrations.get(e);if(void ...
    method getUsageByIndex (line 17) | getUsageByIndex(e,t){return this.builder.getBuilderByIndex(e).usage(t)}
    method format (line 17) | format(e=this.enableColors){return e?P:O}
  class H (line 2) | class H extends s.BaseCommand{constructor(){super(...arguments),this.jso...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  function J (line 2) | async function J(e,t){const r=`/-/package${p.npmHttpUtils.getIdentUrl(e)...
    method constructor (line 2) | constructor(e){this.opts=e,this.localStore=new Map,this.customData={st...
    method getCustomDataKey (line 2) | getCustomDataKey(){return JSON.stringify({name:"NodeModulesInstaller",...
    method attachCustomData (line 2) | attachCustomData(e){this.customData=e}
    method installPackage (line 2) | async installPackage(e,t){var r;const A=o.y1.resolve(t.packageFs.getRe...
    method attachInternalDependencies (line 2) | async attachInternalDependencies(e,t){const r=this.localStore.get(e.lo...
    method attachExternalDependents (line 2) | async attachExternalDependents(e,t){throw new Error("External dependen...
    method finalizeInstall (line 2) | async finalizeInstall(){if("node-modules"!==this.opts.project.configur...
    method constructor (line 2) | constructor(e){this.resolver=e}
    method supportsDescriptor (line 2) | supportsDescriptor(e,t){return this.resolver.supportsDescriptor(e,t)}
    method supportsLocator (line 2) | supportsLocator(e,t){return this.resolver.supportsLocator(e,t)}
    method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return this.resolver.shouldPersistResolut...
    method bindDescriptor (line 2) | bindDescriptor(e,t,r){return this.resolver.bindDescriptor(e,t,r)}
    method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return this.resolver.getResolutionDepen...
    method getCandidates (line 2) | async getCandidates(e,t,r){throw new H.lk(P.b.MISSING_LOCKFILE_ENTRY,"...
    method getSatisfying (line 2) | async getSatisfying(e,t,r){throw new H.lk(P.b.MISSING_LOCKFILE_ENTRY,"...
    method resolve (line 2) | async resolve(e,t){throw new H.lk(P.b.MISSING_LOCKFILE_ENTRY,"This pac...
  class q (line 2) | class q extends s.BaseCommand{async execute(){const e=await o.VK.find(th...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1,this.home=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  class W (line 2) | class W extends s.BaseCommand{async execute(){const e=await o.VK.find(th...
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method constructor (line 2) | constructor(e){this.projectCwd=null,this.plugins=new Map,this.settings...
    method create (line 2) | static create(e,t,r){const A=new W(e);void 0===t||t instanceof Map||(A...
    method find (line 2) | static async find(e,t,{lookup:r=z.LOCKFILE,strict:o=!0,usePath:i=!1,us...
    method findRcFiles (line 2) | static async findRcFiles(e){const t=q(),r=[];let o=e,s=null;for(;o!==s...
    method findHomeRcFile (line 2) | static async findHomeRcFile(){const e=q(),t=k.getHomeFolder(),r=n.y1.j...
    method findProjectCwd (line 2) | static async findProjectCwd(e,t){let r=null,o=e,i=null;for(;o!==i;){if...
    method updateConfiguration (line 2) | static async updateConfiguration(e,t){const r=q(),o=n.y1.join(e,r),s=A...
    method updateHomeConfiguration (line 2) | static async updateHomeConfiguration(e){const t=k.getHomeFolder();retu...
    method activatePlugin (line 2) | activatePlugin(e,t){this.plugins.set(e,t),void 0!==t.configuration&&th...
    method importSettings (line 2) | importSettings(e){for(const[t,r]of Object.entries(e))if(null!=r){if(th...
    method useWithSource (line 2) | useWithSource(e,t,r,A){try{this.use(e,t,r,A)}catch(t){throw t.message+...
    method use (line 2) | use(e,t,r,{strict:A=!0,overwrite:n=!1}={}){for(const o of Object.keys(...
    method get (line 2) | get(e){if(!this.values.has(e))throw new Error(`Invalid configuration k...
    method getSpecial (line 2) | getSpecial(e,{hideSecrets:t=!1,getNativePaths:r=!1}){const A=this.get(...
    method getSubprocessStreams (line 2) | getSubprocessStreams(e,{header:t,prefix:r,report:n}){let o,i;const s=A...
    method makeResolver (line 2) | makeResolver(){const e=[];for(const t of this.plugins.values())for(con...
    method makeFetcher (line 2) | makeFetcher(){const e=[];for(const t of this.plugins.values())for(cons...
    method getLinkers (line 2) | getLinkers(){const e=[];for(const t of this.plugins.values())for(const...
    method refreshPackageExtensions (line 2) | async refreshPackageExtensions(){this.packageExtensions=new Map;const ...
    method normalizePackage (line 2) | normalizePackage(e){const t=f.copyPackage(e);if(null==this.packageExte...
    method getLimit (line 2) | getLimit(e){return F.getFactoryWithDefault(this.limits,e,()=>u()(this....
    method triggerHook (line 2) | async triggerHook(e,...t){for(const r of this.plugins.values()){const ...
    method triggerMultipleHooks (line 2) | async triggerMultipleHooks(e,t){for(const r of t)await this.triggerHoo...
    method reduceHook (line 2) | async reduceHook(e,t,...r){let A=t;for(const t of this.plugins.values(...
    method firstHook (line 2) | async firstHook(e,...t){for(const r of this.plugins.values()){const A=...
    method format (line 2) | format(e,t){return N.pretty(this,e,t)}
  class X (line 2) | class X extends s.BaseCommand{constructor(){super(...arguments),this.pub...
    method constructor (line 2) | constructor(){super(...arguments),this.publish=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  function I (line 2) | function I(e){return e.replace(/\/$/,"")}
    method constructor (line 2) | constructor(e,t){super("Cannot apply hunk #"+(e+1)),this.hunk=t}
    method constructor (line 2) | constructor(e,{configuration:t,immutable:r=t.get("enableImmutableCache...
    method find (line 2) | static async find(e,{immutable:t,check:r}={}){const A=new I(e.get("cac...
    method mirrorCwd (line 2) | get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null...
    method getVersionFilename (line 2) | getVersionFilename(e){return`${C.slugifyLocator(e)}-${this.cacheKey}.z...
    method getChecksumFilename (line 2) | getChecksumFilename(e,t){const r=function(e){const t=e.indexOf("/");re...
    method getLocatorPath (line 2) | getLocatorPath(e,t){if(null===this.mirrorCwd)return s.y1.resolve(this....
    method getLocatorMirrorPath (line 2) | getLocatorMirrorPath(e){const t=this.mirrorCwd;return null!==t?s.y1.re...
    method setup (line 2) | async setup(){if(!this.configuration.get("enableGlobalCache")){await a...
    method fetchPackageFromCache (line 2) | async fetchPackageFromCache(e,t,{onHit:r,onMiss:g,loader:f,skipIntegri...
    method writeFileWithLock (line 2) | async writeFileWithLock(e,t){return null===e?await t():(await a.xfs.mk...
    method constructor (line 2) | constructor({cache:e=new Map,maxTtl:t=1/0,fallbackDuration:r=3600,erro...
    method servers (line 2) | set servers(e){this.clear(),this._resolver.setServers(e)}
    method servers (line 2) | get servers(){return this._resolver.getServers()}
    method lookup (line 2) | lookup(e,t,r){if("function"==typeof t?(r=t,t={}):"number"==typeof t&&(...
    method lookupAsync (line 2) | async lookupAsync(e,t={}){"number"==typeof t&&(t={family:t});let r=awa...
    method query (line 2) | async query(e){let t=await this._cache.get(e);if(!t){const r=this._pen...
    method _resolve (line 2) | async _resolve(e){const[t,r]=await Promise.all([this._resolve4(e,C),th...
    method _lookup (line 2) | async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),...
    method _set (line 2) | async _set(e,t,r){if(this.maxTtl>0&&r>0){r=1e3*Math.min(r,this.maxTtl)...
    method queryAndCache (line 2) | async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this...
    method _tick (line 2) | _tick(e){const t=this._nextRemovalTime;(!t||e<t)&&(clearTimeout(this._...
    method install (line 2) | install(e){if(p(e),g in e)throw new Error("CacheableLookup has been al...
    method uninstall (line 2) | uninstall(e){if(p(e),e[g]){if(e[l]!==this)throw new Error("The agent i...
    method updateInterfaceInfo (line 2) | updateInterfaceInfo(){const{_iface:e}=this;this._iface=d(),(e.has4&&!t...
    method clear (line 2) | clear(e){e?this._cache.delete(e):this._cache.clear()}
  function E (line 2) | function E(e,{configuration:t}){return e.publishConfig&&e.publishConfig....
  function B (line 2) | function B(e,{configuration:t,type:r=l.FETCH_REGISTRY}){const A=w(e,{con...
  function y (line 2) | function y({configuration:e,type:t=l.FETCH_REGISTRY}){const r=e.get(t);r...
    method constructor (line 2) | constructor(e){this.fetchers=e}
    method supports (line 2) | supports(e,t){return!!this.tryFetcher(e,t)}
    method getLocalPath (line 2) | getLocalPath(e,t){return this.getFetcher(e,t).getLocalPath(e,t)}
    method fetch (line 2) | async fetch(e,t){const r=this.getFetcher(e,t);return await r.fetch(e,t)}
    method tryFetcher (line 2) | tryFetcher(e,t){const r=this.fetchers.find(r=>r.supports(e,t));return ...
    method getFetcher (line 2) | getFetcher(e,t){const r=this.fetchers.find(r=>r.supports(e,t));if(!r)t...
  function m (line 2) | function m(e,{configuration:t}){const r=t.get("npmRegistries"),A=r.get(e...
  function w (line 2) | function w(e,{configuration:t}){if(null===e)return null;const r=t.get("n...
  function Q (line 2) | function Q(e,{configuration:t,ident:r}){const A=r&&w(r.scope,{configurat...
  function D (line 2) | async function D(e,{attemptedAs:t,registry:r,headers:A,configuration:n})...
    method constructor (line 2) | constructor(){super(...arguments),this.all=!1,this.recursive=!1,this.e...
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method isVirtualDescriptor (line 2) | static isVirtualDescriptor(e){return!!e.range.startsWith(D.protocol)}
    method isVirtualLocator (line 2) | static isVirtualLocator(e){return!!e.reference.startsWith(D.protocol)}
    method supportsDescriptor (line 2) | supportsDescriptor(e,t){return D.isVirtualDescriptor(e)}
    method supportsLocator (line 2) | supportsLocator(e,t){return D.isVirtualLocator(e)}
    method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!1}
    method bindDescriptor (line 2) | bindDescriptor(e,t,r){throw new Error('Assertion failed: calling "bind...
    method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){throw new Error('Assertion failed: call...
    method getCandidates (line 2) | async getCandidates(e,t,r){throw new Error('Assertion failed: calling ...
    method getSatisfying (line 2) | async getSatisfying(e,t,r){throw new Error('Assertion failed: calling ...
    method resolve (line 2) | async resolve(e,t){throw new Error('Assertion failed: calling "resolve...
  function b (line 2) | function b(e){return e.scope?`/@${e.scope}%2f${e.name}`:"/"+e.name}
    method constructor (line 2) | constructor(){super(...arguments),this.chunks=[]}
    method _transform (line 2) | _transform(e,t,r){if("buffer"!==t||!Buffer.isBuffer(e))throw new Error...
    method _flush (line 2) | _flush(e){e(null,Buffer.concat(this.chunks))}
  function v (line 2) | async function v(e,{configuration:t,headers:r,ident:A,authType:n,registr...
    method constructor (line 2) | constructor(e=Buffer.alloc(0)){super(),this.active=!0,this.ifEmpty=e}
    method _transform (line 2) | _transform(e,t,r){if("buffer"!==t||!Buffer.isBuffer(e))throw new Error...
    method _flush (line 2) | _flush(e){this.active&&this.ifEmpty.length>0&&e(null,this.ifEmpty)}
  function S (line 2) | async function S(e,t,{attemptedAs:r,configuration:A,headers:n,ident:o,au...
    method constructor (line 2) | constructor(){this.mode="strict"}
    method supportsPackage (line 2) | supportsPackage(e,t){return"pnp"===t.project.configuration.get("nodeLi...
    method findPackageLocation (line 2) | async findPackageLocation(e,t){const r=T(t.project).main;if(!i.xfs.exi...
    method findPackageLocator (line 2) | async findPackageLocator(e,t){const A=T(t.project).main;if(!i.xfs.exis...
    method makeInstaller (line 2) | makeInstaller(e){return new k(e)}
    method supports (line 2) | supports(e){return!!e.reference.startsWith(v.d.protocol)}
    method getLocalPath (line 2) | getLocalPath(e,t){return this.getWorkspace(e,t).cwd}
    method fetch (line 2) | async fetch(e,t){const r=this.getWorkspace(e,t).cwd;return{packageFs:n...
    method getWorkspace (line 2) | getWorkspace(e,t){return t.project.getWorkspaceByCwd(e.reference.slice...
    method constructor (line 2) | constructor(e){this.stream=e}
    method close (line 2) | close(){}
    method get (line 2) | get(){return this.stream}
  function k (line 2) | async function k(e,t,{attemptedAs:r,configuration:A,headers:n,ident:o,au...
    method constructor (line 2) | constructor(e){this.opts=e,this.mode="strict",this.packageRegistry=new...
    method getCustomDataKey (line 2) | getCustomDataKey(){return JSON.stringify({name:"PnpInstaller",version:...
    method attachCustomData (line 2) | attachCustomData(e){this.customData=e}
    method installPackage (line 2) | async installPackage(e,t){const r=g.requirableIdent(e),A=e.reference,n...
    method attachInternalDependencies (line 2) | async attachInternalDependencies(e,t){const r=this.getPackageInformati...
    method attachExternalDependents (line 2) | async attachExternalDependents(e,t){for(const r of t){this.getDiskInfo...
    method finalizeInstall (line 2) | async finalizeInstall(){const e=new Set;for(const{locator:e,location:t...
    method finalizeInstallWithPnp (line 2) | async finalizeInstallWithPnp(e){if(this.opts.project.configuration.get...
    method locateNodeModules (line 2) | async locateNodeModules(e){const t=[],r=e?new RegExp(e):null;for(const...
    method unplugPackageIfNeeded (line 2) | async unplugPackageIfNeeded(e,t,r,A){return this.shouldBeUnplugged(e,t...
    method shouldBeUnplugged (line 2) | shouldBeUnplugged(e,t,r){return void 0!==r.unplugged?r.unplugged:!!v.h...
    method unplugPackage (line 2) | async unplugPackage(e,t){const r=b(e,{configuration:this.opts.project....
    method getPackageInformation (line 2) | getPackageInformation(e){const t=g.requirableIdent(e),r=e.reference,A=...
    method getDiskInformation (line 2) | getDiskInformation(e){const t=u.getMapWithDefault(this.packageRegistry...
    method constructor (line 2) | constructor(){this.stream=null}
    method close (line 2) | close(){if(null===this.stream)throw new Error("Assertion failed: No st...
    method attach (line 2) | attach(e){this.stream=e}
    method get (line 2) | get(){if(null===this.stream)throw new Error("Assertion failed: No stre...
  function N (line 2) | async function N(e,{attemptedAs:t,configuration:r,headers:A,ident:n,auth...
    method constructor (line 2) | constructor(e,t){this.stdin=null,this.stdout=null,this.stderr=null,thi...
    method start (line 2) | static start(e,{stdin:t,stdout:r,stderr:A}){const n=new N(null,e);retu...
    method pipeTo (line 2) | pipeTo(e,t=w.STDOUT){const r=new N(this,e),A=new k;return r.pipe=A,r.s...
    method exec (line 2) | async exec(){const e=["ignore","ignore","ignore"];if(this.pipe)e[0]="p...
    method run (line 2) | async run(){const e=[];for(let t=this;t;t=t.ancestor)e.push(t.exec());...
  function F (line 2) | function F(e,{authType:t=u.CONFIGURATION,configuration:r,ident:A}){const...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method constructor (line 2) | constructor(e,t){this.allOptionNames=[],this.arity={leading:[],trailin...
    method addPath (line 2) | addPath(e){this.paths.push(e)}
    method setArity (line 2) | setArity({leading:e=this.arity.leading,trailing:t=this.arity.trailing,...
    method addPositional (line 2) | addPositional({name:e="arg",required:t=!0}={}){if(!t&&this.arity.extra...
    method addRest (line 2) | addRest({name:e="arg",required:t=0}={}){if(this.arity.extra===N)throw ...
    method addProxy (line 2) | addProxy({required:e=0}={}){this.addRest({required:e}),this.arity.prox...
    method addOption (line 2) | addOption({names:e,description:t,arity:r=0,hidden:A=!1,allowBinding:n=...
    method setContext (line 2) | setContext(e){this.context=e}
    method usage (line 2) | usage({detailed:e=!0,inlineOptions:t=!0}={}){const r=[this.cliOpts.bin...
    method compile (line 2) | compile(){if(void 0===this.context)throw new Error("Assertion failed: ...
    method registerOptions (line 2) | registerOptions(e,t){w(e,t,["isOption","--"],t,"inhibateOptions"),w(e,...
  function K (line 2) | async function K(){if(process.env.TEST_ENV)return process.env.TEST_NPM_2...
    method constructor (line 2) | constructor({binaryName:e="..."}={}){this.builders=[],this.opts={binar...
    method build (line 2) | static build(e,t={}){return new K(t).commands(e).compile()}
    method getBuilderByIndex (line 2) | getBuilderByIndex(e){if(!(e>=0&&e<this.builders.length))throw new Erro...
    method commands (line 2) | commands(e){for(const t of e)t(this.command());return this}
    method command (line 2) | command(){const e=new F(this.builders.length,this.opts);return this.bu...
    method compile (line 2) | compile(){const e=[],t=[];for(const r of this.builders){const{machine:...
  function M (line 2) | function M(e){if("HTTPError"!==e.name)return!1;try{return e.response.hea...
    method constructor (line 2) | constructor(){super(...arguments),this.packages=[],this.json=!1,this.e...
    method execute (line 2) | async execute(){var e;const t=await s.VK.find(this.context.cwd,this.co...
    method constructor (line 2) | constructor(){this.help=!1}
    method getMeta (line 2) | static getMeta(e){const t=e.constructor;return t.meta=Object.prototype...
    method resolveMeta (line 2) | static resolveMeta(e){const t=[],r=[];for(let A=e;A instanceof M;A=A._...
    method registerDefinition (line 2) | static registerDefinition(e,t){this.getMeta(e).definitions.push(t)}
    method registerTransformer (line 2) | static registerTransformer(e,t){this.getMeta(e).transformers.push(t)}
    method addPath (line 2) | static addPath(...e){this.Path(...e)(this.prototype,"execute")}
    method addOption (line 2) | static addOption(e,t){t(this.prototype,e)}
    method Path (line 2) | static Path(...e){return(t,r)=>{this.registerDefinition(t,t=>{t.addPat...
    method Boolean (line 2) | static Boolean(e,{hidden:t=!1,description:r}={}){return(A,n)=>{const o...
    method Counter (line 2) | static Counter(e,{hidden:t=!1,description:r}={}){return(A,n)=>{const o...
    method String (line 2) | static String(e={},{arity:t=1,tolerateBoolean:r=!1,hidden:A=!1,descrip...
    method Array (line 2) | static Array(e,{arity:t=1,hidden:r=!1,description:A}={}){return(n,o)=>...
    method Rest (line 2) | static Rest({required:e=0}={}){return(t,r)=>{this.registerDefinition(t...
    method Proxy (line 2) | static Proxy({required:e=0}={}){return(t,r)=>{this.registerDefinition(...
    method Usage (line 2) | static Usage(e){return e}
    method Schema (line 2) | static Schema(e){return e}
    method catch (line 2) | async catch(e){throw e}
    method validateAndExecute (line 2) | async validateAndExecute(){const e=this.constructor.schema;if(void 0!=...
  function R (line 2) | function R(e){return{"npm-otp":e}}
    method constructor (line 2) | constructor(){super(...arguments),this.publish=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  class x (line 2) | class x{supports(e,t){if(!e.reference.startsWith("npm:"))return!1;const ...
    method constructor (line 2) | constructor(){super(...arguments),this.verbose=!1,this.json=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method supports (line 2) | supports(e,t){if(!e.reference.startsWith("npm:"))return!1;const r=new ...
    method getLocalPath (line 2) | getLocalPath(e,t){return null}
    method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[A,n,o]=...
    method fetchFromNetwork (line 2) | async fetchFromNetwork(e,t){let r;try{r=await v(x.getLocatorUrl(e),{co...
    method isConventionalTarballUrl (line 2) | static isConventionalTarballUrl(e,t,{configuration:r}){let A=B(e.scope...
    method getLocatorUrl (line 2) | static getLocatorUrl(e){const t=g().clean(e.reference.slice("npm:".len...
    method execute (line 17) | async execute(){this.context.stdout.write(this.cli.usage(null))}
  function J (line 2) | async function J(e,t,{access:r,tag:A,registry:n}){const o=e.project.conf...
    method constructor (line 2) | constructor(e){this.opts=e,this.localStore=new Map,this.customData={st...
    method getCustomDataKey (line 2) | getCustomDataKey(){return JSON.stringify({name:"NodeModulesInstaller",...
    method attachCustomData (line 2) | attachCustomData(e){this.customData=e}
    method installPackage (line 2) | async installPackage(e,t){var r;const A=o.y1.resolve(t.packageFs.getRe...
    method attachInternalDependencies (line 2) | async attachInternalDependencies(e,t){const r=this.localStore.get(e.lo...
    method attachExternalDependents (line 2) | async attachExternalDependents(e,t){throw new Error("External dependen...
    method finalizeInstall (line 2) | async finalizeInstall(){if("node-modules"!==this.opts.project.configur...
    method constructor (line 2) | constructor(e){this.resolver=e}
    method supportsDescriptor (line 2) | supportsDescriptor(e,t){return this.resolver.supportsDescriptor(e,t)}
    method supportsLocator (line 2) | supportsLocator(e,t){return this.resolver.supportsLocator(e,t)}
    method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return this.resolver.shouldPersistResolut...
    method bindDescriptor (line 2) | bindDescriptor(e,t,r){return this.resolver.bindDescriptor(e,t,r)}
    method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return this.resolver.getResolutionDepen...
    method getCandidates (line 2) | async getCandidates(e,t,r){throw new H.lk(P.b.MISSING_LOCKFILE_ENTRY,"...
    method getSatisfying (line 2) | async getSatisfying(e,t,r){throw new H.lk(P.b.MISSING_LOCKFILE_ENTRY,"...
    method resolve (line 2) | async resolve(e,t){throw new H.lk(P.b.MISSING_LOCKFILE_ENTRY,"This pac...
  method supports (line 2) | supports(e,t){if(!e.reference.startsWith("npm:"))return!1;const{selector...
  method getLocalPath (line 2) | getLocalPath(e,t){return null}
  method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[A,n,o]=aw...
  method fetchFromNetwork (line 2) | async fetchFromNetwork(e,t){const{params:r}=s.parseRange(e.reference);if...
  method supportsDescriptor (line 2) | supportsDescriptor(e,t){return!!e.range.startsWith("npm:")&&!!s.tryParse...
  method supportsLocator (line 2) | supportsLocator(e,t){return!1}
  method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){throw new Error("Unreachable")}
  method bindDescriptor (line 2) | bindDescriptor(e,t,r){return e}
  method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){const r=s.parseDescriptor(e.range.slice("...
  method getCandidates (line 2) | async getCandidates(e,t,r){const A=s.parseDescriptor(e.range.slice("npm:...
  method getSatisfying (line 2) | async getSatisfying(e,t,r){const A=s.parseDescriptor(e.range.slice("npm:...
  method resolve (line 2) | resolve(e,t){throw new Error("Unreachable")}
  method supportsDescriptor (line 2) | supportsDescriptor(e,t){return!!e.range.startsWith("npm:")&&!!P.validRan...
  method supportsLocator (line 2) | supportsLocator(e,t){if(!e.reference.startsWith("npm:"))return!1;const{s...
  method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!0}
  method bindDescriptor (line 2) | bindDescriptor(e,t,r){return e}
  method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return[]}
  method getCandidates (line 2) | async getCandidates(e,t,r){const A=P.validRange(e.range.slice("npm:".len...
  method getSatisfying (line 2) | async getSatisfying(e,t,r){const A=P.validRange(e.range.slice("npm:".len...
  method resolve (line 2) | async resolve(e,t){const{selector:r}=s.parseRange(e.reference),A=g().cle...
  method supportsDescriptor (line 2) | supportsDescriptor(e,t){return!!e.range.startsWith("npm:")&&!!j.c.test(e...
  method supportsLocator (line 2) | supportsLocator(e,t){return!1}
  method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){throw new Error("Unreachable")}
  method bindDescriptor (line 2) | bindDescriptor(e,t,r){return e}
  method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return[]}
  method getCandidates (line 2) | async getCandidates(e,t,r){const A=e.range.slice("npm:".length),n=await ...
  method getSatisfying (line 2) | async getSatisfying(e,t,r){return null}
  method resolve (line 2) | async resolve(e,t){throw new Error("Unreachable")}
  class c (line 2) | class c extends a.Command{}
    method constructor (line 2) | constructor(e){this.pathUtils=e}
    method genTraversePromise (line 2) | async*genTraversePromise(e,{stableSort:t=!1}={}){const r=[e];for(;r.le...
    method removePromise (line 2) | async removePromise(e,{recursive:t=!0,maxRetries:r=5}={}){let A;try{A=...
    method removeSync (line 2) | removeSync(e,{recursive:t=!0}={}){let r;try{r=this.lstatSync(e)}catch(...
    method mkdirpPromise (line 2) | async mkdirpPromise(e,{chmod:t,utimes:r}={}){if((e=this.resolve(e))===...
    method mkdirpSync (line 2) | mkdirpSync(e,{chmod:t,utimes:r}={}){if((e=this.resolve(e))===this.path...
    method copyPromise (line 2) | async copyPromise(e,t,{baseFs:r=this,overwrite:A=!0,stableSort:n=!1,st...
    method copySync (line 2) | copySync(e,t,{baseFs:r=this,overwrite:A=!0}={}){const n=r.lstatSync(t)...
    method changeFilePromise (line 2) | async changeFilePromise(e,t,r={}){return Buffer.isBuffer(t)?this.chang...
    method changeFileBufferPromise (line 2) | async changeFileBufferPromise(e,t){let r=Buffer.alloc(0);try{r=await t...
    method changeFileTextPromise (line 2) | async changeFileTextPromise(e,t,{automaticNewlines:r}={}){let A="";try...
    method changeFileSync (line 2) | changeFileSync(e,t,r={}){return Buffer.isBuffer(t)?this.changeFileBuff...
    method changeFileBufferSync (line 2) | changeFileBufferSync(e,t){let r=Buffer.alloc(0);try{r=this.readFileSyn...
    method changeFileTextSync (line 2) | changeFileTextSync(e,t,{automaticNewlines:r=!1}={}){let A="";try{A=thi...
    method movePromise (line 2) | async movePromise(e,t){try{await this.renamePromise(e,t)}catch(r){if("...
    method moveSync (line 2) | moveSync(e,t){try{this.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)th...
    method lockPromise (line 2) | async lockPromise(e,t){const r=e+".flock",A=Date.now();let n=null;cons...
    method readJsonPromise (line 2) | async readJsonPromise(e){const t=await this.readFilePromise(e,"utf8");...
    method readJsonSync (line 2) | readJsonSync(e){const t=this.readFileSync(e,"utf8");try{return JSON.pa...
    method writeJsonPromise (line 2) | async writeJsonPromise(e,t){return await this.writeFilePromise(e,JSON....
    method writeJsonSync (line 2) | writeJsonSync(e,t){return this.writeFileSync(e,JSON.stringify(t,null,2...
    method preserveTimePromise (line 2) | async preserveTimePromise(e,t){const r=await this.lstatPromise(e),A=aw...
    method preserveTimeSync (line 2) | async preserveTimeSync(e,t){const r=this.lstatSync(e),A=t();void 0!==A...
    method constructor (line 2) | constructor({baseFs:e=new A.S}={}){super(o.y1),this.baseFs=e}
    method makeVirtualPath (line 2) | static makeVirtualPath(e,t,r){if("$$virtual"!==o.y1.basename(e))throw ...
    method resolveVirtual (line 2) | static resolveVirtual(e){const t=e.match(s);if(!t||!t[3]&&t[5])return ...
    method getExtractHint (line 2) | getExtractHint(e){return this.baseFs.getExtractHint(e)}
    method getRealPath (line 2) | getRealPath(){return this.baseFs.getRealPath()}
    method realpathSync (line 2) | realpathSync(e){const t=e.match(s);if(!t)return this.baseFs.realpathSy...
    method realpathPromise (line 2) | async realpathPromise(e){const t=e.match(s);if(!t)return await this.ba...
    method mapToBase (line 2) | mapToBase(e){return c.resolveVirtual(e)}
    method mapFromBase (line 2) | mapFromBase(e){return e}
    method constructor (line 2) | constructor(e){super(e),this.name="ShellError"}
    method constructor (line 2) | constructor(e,t){if(super(),this.input=e,this.candidates=t,this.clipan...
    method constructor (line 49) | constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerel...
    method format (line 49) | format(){return this.version=`${this.major}.${this.minor}.${this.patch...
    method toString (line 49) | toString(){return this.version}
    method compare (line 49) | compare(e){if(A("SemVer.compare",this.version,this.options,e),!(e inst...
    method compareMain (line 49) | compareMain(e){return e instanceof c||(e=new c(e,this.options)),a(this...
    method comparePre (line 49) | comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerel...
    method compareBuild (line 49) | compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{c...
    method inc (line 49) | inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=...
  class u (line 2) | class u extends a.UsageError{constructor(e,t){super(`This command can on...
    method constructor (line 2) | constructor(e,t){super(`This command can only be run from within a wor...
    method constructor (line 2) | constructor(e){this.data=e}
    method constructor (line 2) | constructor(e,t){if("function"!=typeof e)throw new TypeError("Paramete...
    method createCacheableRequest (line 2) | createCacheableRequest(e){return(t,r)=>{let l;if("string"==typeof t)l=...
    method constructor (line 23) | constructor(e,t,r,A){this.origin=e,this.pattern=t,this.negative=r,this...
    method isHash (line 49) | get isHash(){return!0}
    method constructor (line 49) | constructor(e,t){const r=!!(t=l(t)).strict;this.source=e.trim();const ...
    method hexDigest (line 49) | hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toSt...
    method toJSON (line 49) | toJSON(){return this.toString()}
    method toString (line 49) | toString(e){if((e=l(e)).strict&&!(i.some(e=>e===this.algorithm)&&this....
  method execute (line 2) | async execute(){const e=await p.VK.find(this.context.cwd,this.context.pl...
  function S (line 2) | async function S(e){return!!B.hasWorkspaceScript(e,"prepack")||!!B.hasWo...
    method constructor (line 2) | constructor(){this.mode="strict"}
    method supportsPackage (line 2) | supportsPackage(e,t){return"pnp"===t.project.configuration.get("nodeLi...
    method findPackageLocation (line 2) | async findPackageLocation(e,t){const r=T(t.project).main;if(!i.xfs.exi...
    method findPackageLocator (line 2) | async findPackageLocator(e,t){const A=T(t.project).main;if(!i.xfs.exis...
    method makeInstaller (line 2) | makeInstaller(e){return new k(e)}
    method supports (line 2) | supports(e){return!!e.reference.startsWith(v.d.protocol)}
    method getLocalPath (line 2) | getLocalPath(e,t){return this.getWorkspace(e,t).cwd}
    method fetch (line 2) | async fetch(e,t){const r=this.getWorkspace(e,t).cwd;return{packageFs:n...
    method getWorkspace (line 2) | getWorkspace(e,t){return t.project.getWorkspaceByCwd(e.reference.slice...
    method constructor (line 2) | constructor(e){this.stream=e}
    method close (line 2) | close(){}
    method get (line 2) | get(){return this.stream}
  function k (line 2) | async function k(e,{report:t},r){await B.maybeExecuteWorkspaceLifecycleS...
    method constructor (line 2) | constructor(e){this.opts=e,this.mode="strict",this.packageRegistry=new...
    method getCustomDataKey (line 2) | getCustomDataKey(){return JSON.stringify({name:"PnpInstaller",version:...
    method attachCustomData (line 2) | attachCustomData(e){this.customData=e}
    method installPackage (line 2) | async installPackage(e,t){const r=g.requirableIdent(e),A=e.reference,n...
    method attachInternalDependencies (line 2) | async attachInternalDependencies(e,t){const r=this.getPackageInformati...
    method attachExternalDependents (line 2) | async attachExternalDependents(e,t){for(const r of t){this.getDiskInfo...
    method finalizeInstall (line 2) | async finalizeInstall(){const e=new Set;for(const{locator:e,location:t...
    method finalizeInstallWithPnp (line 2) | async finalizeInstallWithPnp(e){if(this.opts.project.configuration.get...
    method locateNodeModules (line 2) | async locateNodeModules(e){const t=[],r=e?new RegExp(e):null;for(const...
    method unplugPackageIfNeeded (line 2) | async unplugPackageIfNeeded(e,t,r,A){return this.shouldBeUnplugged(e,t...
    method shouldBeUnplugged (line 2) | shouldBeUnplugged(e,t,r){return void 0!==r.unplugged?r.unplugged:!!v.h...
    method unplugPackage (line 2) | async unplugPackage(e,t){const r=b(e,{configuration:this.opts.project....
    method getPackageInformation (line 2) | getPackageInformation(e){const t=g.requirableIdent(e),r=e.reference,A=...
    method getDiskInformation (line 2) | getDiskInformation(e){const t=u.getMapWithDefault(this.packageRegistry...
    method constructor (line 2) | constructor(){this.stream=null}
    method close (line 2) | close(){if(null===this.stream)throw new Error("Assertion failed: No st...
    method attach (line 2) | attach(e){this.stream=e}
    method get (line 2) | get(){if(null===this.stream)throw new Error("Assertion failed: No stre...
  function N (line 2) | async function N(e,t){var r,A;void 0===t&&(t=await K(e));const n=new Set...
    method constructor (line 2) | constructor(e,t){this.stdin=null,this.stdout=null,this.stderr=null,thi...
    method start (line 2) | static start(e,{stdin:t,stdout:r,stderr:A}){const n=new N(null,e);retu...
    method pipeTo (line 2) | pipeTo(e,t=w.STDOUT){const r=new N(this,e),A=new k;return r.pipe=A,r.s...
    method exec (line 2) | async exec(){const e=["ignore","ignore","ignore"];if(this.pipe)e[0]="p...
    method run (line 2) | async run(){const e=[];for(let t=this;t;t=t.ancestor)e.push(t.exec());...
  function F (line 2) | async function F(e){const t=JSON.parse(JSON.stringify(e.manifest.raw));r...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method constructor (line 2) | constructor(e,t){this.allOptionNames=[],this.arity={leading:[],trailin...
    method addPath (line 2) | addPath(e){this.paths.push(e)}
    method setArity (line 2) | setArity({leading:e=this.arity.leading,trailing:t=this.arity.trailing,...
    method addPositional (line 2) | addPositional({name:e="arg",required:t=!0}={}){if(!t&&this.arity.extra...
    method addRest (line 2) | addRest({name:e="arg",required:t=0}={}){if(this.arity.extra===N)throw ...
    method addProxy (line 2) | addProxy({required:e=0}={}){this.addRest({required:e}),this.arity.prox...
    method addOption (line 2) | addOption({names:e,description:t,arity:r=0,hidden:A=!1,allowBinding:n=...
    method setContext (line 2) | setContext(e){this.context=e}
    method usage (line 2) | usage({detailed:e=!0,inlineOptions:t=!0}={}){const r=[this.cliOpts.bin...
    method compile (line 2) | compile(){if(void 0===this.context)throw new Error("Assertion failed: ...
    method registerOptions (line 2) | registerOptions(e,t){w(e,t,["isOption","--"],t,"inhibateOptions"),w(e,...
  function K (line 2) | async function K(e){var t,r,A,n,o,i,s,a;const c=e.project,g=c.configurat...
    method constructor (line 2) | constructor({binaryName:e="..."}={}){this.builders=[],this.opts={binar...
    method build (line 2) | static build(e,t={}){return new K(t).commands(e).compile()}
    method getBuilderByIndex (line 2) | getBuilderByIndex(e){if(!(e>=0&&e<this.builders.length))throw new Erro...
    method commands (line 2) | commands(e){for(const t of e)t(this.command());return this}
    method command (line 2) | command(){const e=new F(this.builders.length,this.opts);return this.bu...
    method compile (line 2) | compile(){const e=[],t=[];for(const r of this.builders){const{machine:...
  function M (line 2) | async function M(e,t,r){const A={accept:[],reject:[]},n=await e.readFile...
    method constructor (line 2) | constructor(){super(...arguments),this.packages=[],this.json=!1,this.e...
    method execute (line 2) | async execute(){var e;const t=await s.VK.find(this.context.cwd,this.co...
    method constructor (line 2) | constructor(){this.help=!1}
    method getMeta (line 2) | static getMeta(e){const t=e.constructor;return t.meta=Object.prototype...
    method resolveMeta (line 2) | static resolveMeta(e){const t=[],r=[];for(let A=e;A instanceof M;A=A._...
    method registerDefinition (line 2) | static registerDefinition(e,t){this.getMeta(e).definitions.push(t)}
    method registerTransformer (line 2) | static registerTransformer(e,t){this.getMeta(e).transformers.push(t)}
    method addPath (line 2) | static addPath(...e){this.Path(...e)(this.prototype,"execute")}
    method addOption (line 2) | static addOption(e,t){t(this.prototype,e)}
    method Path (line 2) | static Path(...e){return(t,r)=>{this.registerDefinition(t,t=>{t.addPat...
    method Boolean (line 2) | static Boolean(e,{hidden:t=!1,description:r}={}){return(A,n)=>{const o...
    method Counter (line 2) | static Counter(e,{hidden:t=!1,description:r}={}){return(A,n)=>{const o...
    method String (line 2) | static String(e={},{arity:t=1,tolerateBoolean:r=!1,hidden:A=!1,descrip...
    method Array (line 2) | static Array(e,{arity:t=1,hidden:r=!1,description:A}={}){return(n,o)=>...
    method Rest (line 2) | static Rest({required:e=0}={}){return(t,r)=>{this.registerDefinition(t...
    method Proxy (line 2) | static Proxy({required:e=0}={}){return(t,r)=>{this.registerDefinition(...
    method Usage (line 2) | static Usage(e){return e}
    method Schema (line 2) | static Schema(e){return e}
    method catch (line 2) | async catch(e){throw e}
    method validateAndExecute (line 2) | async validateAndExecute(){const e=this.constructor.schema;if(void 0!=...
  function R (line 2) | function R(e,t,{cwd:r}){const A=t.trim();""!==A&&"#"!==A[0]&&e.push(func...
    method constructor (line 2) | constructor(){super(...arguments),this.publish=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  function x (line 2) | function x(e,{globalList:t,ignoreLists:r}){if(L(e,t.accept))return!1;if(...
    method constructor (line 2) | constructor(){super(...arguments),this.verbose=!1,this.json=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method supports (line 2) | supports(e,t){if(!e.reference.startsWith("npm:"))return!1;const r=new ...
    method getLocalPath (line 2) | getLocalPath(e,t){return null}
    method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[A,n,o]=...
    method fetchFromNetwork (line 2) | async fetchFromNetwork(e,t){let r;try{r=await v(x.getLocatorUrl(e),{co...
    method isConventionalTarballUrl (line 2) | static isConventionalTarballUrl(e,t,{configuration:r}){let A=B(e.scope...
    method getLocatorUrl (line 2) | static getLocatorUrl(e){const t=g().clean(e.reference.slice("npm:".len...
    method execute (line 17) | async execute(){this.context.stdout.write(this.cli.usage(null))}
  function L (line 2) | function L(e,t){let r=t;const A=[];for(let e=0;e<t.length;++e)"!"!==t[e]...
    method constructor (line 2) | constructor(){super(...arguments),this.mirror=!1,this.all=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method execute (line 17) | async execute(){var e;this.context.stdout.write((null!==(e=this.cli.bi...
  function P (line 2) | function P(e,t){let r=t;const A=[];for(let e=0;e<t.length;++e)t[e].inclu...
    method constructor (line 2) | constructor(){super(...arguments),this.publish=!1,this.all=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  class O (line 2) | class O extends c{constructor(){super(...arguments),this.installIfNeeded...
    method constructor (line 2) | constructor(){super(...arguments),this.installIfNeeded=!1,this.dryRun=...
    method execute (line 2) | async execute(){const e=await p.VK.find(this.context.cwd,this.context....
  class I (line 2) | class I extends Error{constructor(e,t){super("Cannot apply hunk #"+(e+1)...
    method constructor (line 2) | constructor(e,t){super("Cannot apply hunk #"+(e+1)),this.hunk=t}
    method constructor (line 2) | constructor(e,{configuration:t,immutable:r=t.get("enableImmutableCache...
    method find (line 2) | static async find(e,{immutable:t,check:r}={}){const A=new I(e.get("cac...
    method mirrorCwd (line 2) | get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null...
    method getVersionFilename (line 2) | getVersionFilename(e){return`${C.slugifyLocator(e)}-${this.cacheKey}.z...
    method getChecksumFilename (line 2) | getChecksumFilename(e,t){const r=function(e){const t=e.indexOf("/");re...
    method getLocatorPath (line 2) | getLocatorPath(e,t){if(null===this.mirrorCwd)return s.y1.resolve(this....
    method getLocatorMirrorPath (line 2) | getLocatorMirrorPath(e){const t=this.mirrorCwd;return null!==t?s.y1.re...
    method setup (line 2) | async setup(){if(!this.configuration.get("enableGlobalCache")){await a...
    method fetchPackageFromCache (line 2) | async fetchPackageFromCache(e,t,{onHit:r,onMiss:g,loader:f,skipIntegri...
    method writeFileWithLock (line 2) | async writeFileWithLock(e,t){return null===e?await t():(await a.xfs.mk...
    method constructor (line 2) | constructor({cache:e=new Map,maxTtl:t=1/0,fallbackDuration:r=3600,erro...
    method servers (line 2) | set servers(e){this.clear(),this._resolver.setServers(e)}
    method servers (line 2) | get servers(){return this._resolver.getServers()}
    method lookup (line 2) | lookup(e,t,r){if("function"==typeof t?(r=t,t={}):"number"==typeof t&&(...
    method lookupAsync (line 2) | async lookupAsync(e,t={}){"number"==typeof t&&(t={family:t});let r=awa...
    method query (line 2) | async query(e){let t=await this._cache.get(e);if(!t){const r=this._pen...
    method _resolve (line 2) | async _resolve(e){const[t,r]=await Promise.all([this._resolve4(e,C),th...
    method _lookup (line 2) | async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),...
    method _set (line 2) | async _set(e,t,r){if(this.maxTtl>0&&r>0){r=1e3*Math.min(r,this.maxTtl)...
    method queryAndCache (line 2) | async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this...
    method _tick (line 2) | _tick(e){const t=this._nextRemovalTime;(!t||e<t)&&(clearTimeout(this._...
    method install (line 2) | install(e){if(p(e),g in e)throw new Error("CacheableLookup has been al...
    method uninstall (line 2) | uninstall(e){if(p(e),e[g]){if(e[l]!==this)throw new Error("The agent i...
    method updateInterfaceInfo (line 2) | updateInterfaceInfo(){const{_iface:e}=this;this._iface=d(),(e.has4&&!t...
    method clear (line 2) | clear(e){e?this._cache.delete(e):this._cache.clear()}
  function B (line 2) | function B(e){return g.y1.relative(g.LZ.root,g.y1.resolve(g.LZ.root,g.cS...
  function y (line 2) | function y(e){const t=e.trim().match(E);if(!t)throw new Error(`Bad heade...
    method constructor (line 2) | constructor(e){this.fetchers=e}
    method supports (line 2) | supports(e,t){return!!this.tryFetcher(e,t)}
    method getLocalPath (line 2) | getLocalPath(e,t){return this.getFetcher(e,t).getLocalPath(e,t)}
    method fetch (line 2) | async fetch(e,t){const r=this.getFetcher(e,t);return await r.fetch(e,t)}
    method tryFetcher (line 2) | tryFetcher(e,t){const r=this.fetchers.find(r=>r.supports(e,t));return ...
    method getFetcher (line 2) | getFetcher(e,t){const r=this.fetchers.find(r=>r.supports(e,t));if(!r)t...
  function Q (line 2) | function Q(e){const t=511&parseInt(e,8);if(420!==t&&493!==t)throw new Er...
  function D (line 2) | function D(e){const t=e.split(/\n/g);return""===t[t.length-1]&&t.pop(),f...
    method constructor (line 2) | constructor(){super(...arguments),this.all=!1,this.recursive=!1,this.e...
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method isVirtualDescriptor (line 2) | static isVirtualDescriptor(e){return!!e.range.startsWith(D.protocol)}
    method isVirtualLocator (line 2) | static isVirtualLocator(e){return!!e.reference.startsWith(D.protocol)}
    method supportsDescriptor (line 2) | supportsDescriptor(e,t){return D.isVirtualDescriptor(e)}
    method supportsLocator (line 2) | supportsLocator(e,t){return D.isVirtualLocator(e)}
    method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){return!1}
    method bindDescriptor (line 2) | bindDescriptor(e,t,r){throw new Error('Assertion failed: calling "bind...
    method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){throw new Error('Assertion failed: call...
    method getCandidates (line 2) | async getCandidates(e,t,r){throw new Error('Assertion failed: calling ...
    method getSatisfying (line 2) | async getSatisfying(e,t,r){throw new Error('Assertion failed: calling ...
    method resolve (line 2) | async resolve(e,t){throw new Error('Assertion failed: calling "resolve...
  function b (line 2) | function b(e){let t=0,r=0;for(const{type:A,lines:n}of e.parts)switch(A){...
    method constructor (line 2) | constructor(){super(...arguments),this.chunks=[]}
    method _transform (line 2) | _transform(e,t,r){if("buffer"!==t||!Buffer.isBuffer(e))throw new Error...
    method _flush (line 2) | _flush(e){e(null,Buffer.concat(this.chunks))}
  function v (line 2) | async function v(e,t,r){const A=await e.lstatPromise(t),n=await r();if(v...
    method constructor (line 2) | constructor(e=Buffer.alloc(0)){super(),this.active=!0,this.ifEmpty=e}
    method _transform (line 2) | _transform(e,t,r){if("buffer"!==t||!Buffer.isBuffer(e))throw new Error...
    method _flush (line 2) | _flush(e){this.active&&this.ifEmpty.length>0&&e(null,this.ifEmpty)}
  function S (line 2) | async function S(e,{baseFs:t=new f.S,dryRun:r=!1,version:A=null}={}){for...
    method constructor (line 2) | constructor(){this.mode="strict"}
    method supportsPackage (line 2) | supportsPackage(e,t){return"pnp"===t.project.configuration.get("nodeLi...
    method findPackageLocation (line 2) | async findPackageLocation(e,t){const r=T(t.project).main;if(!i.xfs.exi...
    method findPackageLocator (line 2) | async findPackageLocator(e,t){const A=T(t.project).main;if(!i.xfs.exis...
    method makeInstaller (line 2) | makeInstaller(e){return new k(e)}
    method supports (line 2) | supports(e){return!!e.reference.startsWith(v.d.protocol)}
    method getLocalPath (line 2) | getLocalPath(e,t){return this.getWorkspace(e,t).cwd}
    method fetch (line 2) | async fetch(e,t){const r=this.getWorkspace(e,t).cwd;return{packageFs:n...
    method getWorkspace (line 2) | getWorkspace(e,t){return t.project.getWorkspaceByCwd(e.reference.slice...
    method constructor (line 2) | constructor(e){this.stream=e}
    method close (line 2) | close(){}
    method get (line 2) | get(){return this.stream}
  function k (line 2) | function k(e){return(64&e)>0}
    method constructor (line 2) | constructor(e){this.opts=e,this.mode="strict",this.packageRegistry=new...
    method getCustomDataKey (line 2) | getCustomDataKey(){return JSON.stringify({name:"PnpInstaller",version:...
    method attachCustomData (line 2) | attachCustomData(e){this.customData=e}
    method installPackage (line 2) | async installPackage(e,t){const r=g.requirableIdent(e),A=e.reference,n...
    method attachInternalDependencies (line 2) | async attachInternalDependencies(e,t){const r=this.getPackageInformati...
    method attachExternalDependents (line 2) | async attachExternalDependents(e,t){for(const r of t){this.getDiskInfo...
    method finalizeInstall (line 2) | async finalizeInstall(){const e=new Set;for(const{locator:e,location:t...
    method finalizeInstallWithPnp (line 2) | async finalizeInstallWithPnp(e){if(this.opts.project.configuration.get...
    method locateNodeModules (line 2) | async locateNodeModules(e){const t=[],r=e?new RegExp(e):null;for(const...
    method unplugPackageIfNeeded (line 2) | async unplugPackageIfNeeded(e,t,r,A){return this.shouldBeUnplugged(e,t...
    method shouldBeUnplugged (line 2) | shouldBeUnplugged(e,t,r){return void 0!==r.unplugged?r.unplugged:!!v.h...
    method unplugPackage (line 2) | async unplugPackage(e,t){const r=b(e,{configuration:this.opts.project....
    method getPackageInformation (line 2) | getPackageInformation(e){const t=g.requirableIdent(e),r=e.reference,A=...
    method getDiskInformation (line 2) | getDiskInformation(e){const t=u.getMapWithDefault(this.packageRegistry...
    method constructor (line 2) | constructor(){this.stream=null}
    method close (line 2) | close(){if(null===this.stream)throw new Error("Assertion failed: No st...
    method attach (line 2) | attach(e){this.stream=e}
    method get (line 2) | get(){if(null===this.stream)throw new Error("Assertion failed: No stre...
  function N (line 2) | function N(e){return e.replace(/\s+$/,"")}
    method constructor (line 2) | constructor(e,t){this.stdin=null,this.stdout=null,this.stderr=null,thi...
    method start (line 2) | static start(e,{stdin:t,stdout:r,stderr:A}){const n=new N(null,e);retu...
    method pipeTo (line 2) | pipeTo(e,t=w.STDOUT){const r=new N(this,e),A=new k;return r.pipe=A,r.s...
    method exec (line 2) | async exec(){const e=["ignore","ignore","ignore"];if(this.pipe)e[0]="p...
    method run (line 2) | async run(){const e=[];for(let t=this;t;t=t.ancestor)e.push(t.exec());...
  function F (line 2) | async function F({hunks:e,path:t},{baseFs:r,dryRun:A=!1}){const n=await ...
    method constructor (line 2) | constructor(){super(...arguments),this.json=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
    method constructor (line 2) | constructor(e,t){this.allOptionNames=[],this.arity={leading:[],trailin...
    method addPath (line 2) | addPath(e){this.paths.push(e)}
    method setArity (line 2) | setArity({leading:e=this.arity.leading,trailing:t=this.arity.trailing,...
    method addPositional (line 2) | addPositional({name:e="arg",required:t=!0}={}){if(!t&&this.arity.extra...
    method addRest (line 2) | addRest({name:e="arg",required:t=0}={}){if(this.arity.extra===N)throw ...
    method addProxy (line 2) | addProxy({required:e=0}={}){this.addRest({required:e}),this.arity.prox...
    method addOption (line 2) | addOption({names:e,description:t,arity:r=0,hidden:A=!1,allowBinding:n=...
    method setContext (line 2) | setContext(e){this.context=e}
    method usage (line 2) | usage({detailed:e=!0,inlineOptions:t=!0}={}){const r=[this.cliOpts.bin...
    method compile (line 2) | compile(){if(void 0===this.context)throw new Error("Assertion failed: ...
    method registerOptions (line 2) | registerOptions(e,t){w(e,t,["isOption","--"],t,"inhibateOptions"),w(e,...
  function K (line 2) | function K(e,t,r){const A=[];for(const o of e.parts)switch(o.type){case ...
    method constructor (line 2) | constructor({binaryName:e="..."}={}){this.builders=[],this.opts={binar...
    method build (line 2) | static build(e,t={}){return new K(t).commands(e).compile()}
    method getBuilderByIndex (line 2) | getBuilderByIndex(e){if(!(e>=0&&e<this.builders.length))throw new Erro...
    method commands (line 2) | commands(e){for(const t of e)t(this.command());return this}
    method command (line 2) | command(){const e=new F(this.builders.length,this.opts);return this.bu...
    method compile (line 2) | compile(){const e=[],t=[];for(const r of this.builders){const{machine:...
  function R (line 2) | function R(e,t){const{source:r,selector:A,params:n}=s.parseRange(e);if(n...
    method constructor (line 2) | constructor(){super(...arguments),this.publish=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  function x (line 2) | function x(e){const{sourceItem:t,...r}=R(e.range,s.parseDescriptor);retu...
    method constructor (line 2) | constructor(){super(...arguments),this.verbose=!1,this.json=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method supports (line 2) | supports(e,t){if(!e.reference.startsWith("npm:"))return!1;const r=new ...
    method getLocalPath (line 2) | getLocalPath(e,t){return null}
    method fetch (line 2) | async fetch(e,t){const r=t.checksums.get(e.locatorHash)||null,[A,n,o]=...
    method fetchFromNetwork (line 2) | async fetchFromNetwork(e,t){let r;try{r=await v(x.getLocatorUrl(e),{co...
    method isConventionalTarballUrl (line 2) | static isConventionalTarballUrl(e,t,{configuration:r}){let A=B(e.scope...
    method getLocatorUrl (line 2) | static getLocatorUrl(e){const t=g().clean(e.reference.slice("npm:".len...
    method execute (line 17) | async execute(){this.context.stdout.write(this.cli.usage(null))}
  function L (line 2) | function L(e){const{sourceItem:t,...r}=R(e.reference,s.parseLocator);ret...
    method constructor (line 2) | constructor(){super(...arguments),this.mirror=!1,this.all=!1}
    method execute (line 2) | async execute(){const e=await s.VK.find(this.context.cwd,this.context....
    method execute (line 17) | async execute(){var e;this.context.stdout.write((null!==(e=this.cli.bi...
  function P (line 2) | function P({parentLocator:e,sourceItem:t,patchPaths:r,sourceVersion:A,pa...
    method constructor (line 2) | constructor(){super(...arguments),this.publish=!1,this.all=!1}
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  function O (line 2) | function O(e,{parentLocator:t,sourceDescriptor:r,patchPaths:A}){return s...
    method constructor (line 2) | constructor(){super(...arguments),this.installIfNeeded=!1,this.dryRun=...
    method execute (line 2) | async execute(){const e=await p.VK.find(this.context.cwd,this.context....
  function U (line 2) | function U(e,{parentLocator:t,sourcePackage:r,patchPaths:A,patchHash:n})...
    method constructor (line 2) | constructor(){super(...arguments),this.patterns=[],this.all=!1,this.re...
    method execute (line 2) | async execute(){const e=await o.VK.find(this.context.cwd,this.context....
  function T (line 2) | function T({onAbsolute:e,onRelative:t,onBuiltin:r},A){const n=A.match(M)...
    method constructor (line 2) | constructor(){this.resolutions=null}
    method setup (line 2) | async setup(e,{report:t}){const r=n.y1.join(e.cwd,e.configuration.get(...
    method supportsDescriptor (line 2) | supportsDescriptor(e,t){return!!this.resolutions&&this.resolutions.has...
    method supportsLocator (line 2) | supportsLocator(e,t){return!1}
    method shouldPersistResolution (line 2) | shouldPersistResolution(e,t){throw new Error("Assertion failed: This r...
    method bindDescriptor (line 2) | bindDescriptor(e,t,r){return e}
    method getResolutionDependencies (line 2) | getResolutionDependencies(e,t){return[]}
    method getCandidates (line 2) | async getCandidates(e,t,r){if(!this.resolutions)throw new Error("Asser...
    method getSatisfying (line 2) | async getSatisfying(e,t,r){return null}
    method resolve (line 2) | async resolve(e,t){throw new Error("Assertion failed: This resolver do...
    method constructor (line 17) | con
Condensed preview — 842 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,877K chars).
[
  {
    "path": ".editorconfig",
    "chars": 285,
    "preview": "# EditorConfig is awesome: https://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n# Unix-style newlines wit"
  },
  {
    "path": ".github/workflows/CI.yml",
    "chars": 5564,
    "preview": "name: CI\n\non:\n  push:\n    branches:\n      - main\n      - v[0-9]+.[0-9x]+.x\n  pull_request:\n\nenv:\n  NEXT_TELEMETRY_DISABL"
  },
  {
    "path": ".github/workflows/lint.yml",
    "chars": 347,
    "preview": "name: Lint\n\non:\n  push:\n    branches:\n      - main\n      - v[0-9]+.[0-9x]+.x\n  pull_request:\n\njobs:\n  lint-tf:\n    name:"
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 808,
    "preview": "name: Release\n\non:\n  workflow_dispatch:\n    inputs:\n      tag:\n        description: 'Tag'\n        required: true\n      r"
  },
  {
    "path": ".github/workflows/tf-docs.yml",
    "chars": 572,
    "preview": "# GitHub action to make sure that the terraform docs in the README are\n# up-to-date on every push to the main branch\n\nna"
  },
  {
    "path": ".gitignore",
    "chars": 186,
    "preview": "node_modules\n.DS_STORE\n\n# Terraform\n**/.terraform/*\n*.tfstate\n*.tfstate.*\n\n# Build output\n.next\n.next-tf\n\n# Temp files\n*"
  },
  {
    "path": ".prettierrc.js",
    "chars": 67,
    "preview": "module.exports = {\n  trailingComma: 'es5',\n  singleQuote: true,\n};\n"
  },
  {
    "path": ".terraform-docs.yml",
    "chars": 129,
    "preview": "formatter: 'markdown table'\n\nsections:\n  hide:\n    - 'data-sources'\n    - 'modules'\n    - 'resources'\n\nsettings:\n  ancho"
  },
  {
    "path": ".vscode/extensions.json",
    "chars": 72,
    "preview": "{\n  \"recommendations\": [\"Orta.vscode-jest\", \"esbenp.prettier-vscode\"]\n}\n"
  },
  {
    "path": ".vscode/launch.json",
    "chars": 1159,
    "preview": "{\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"name\": \"Debug Jest Tests\",\n      \"type\": \"node\",\n      \"reque"
  },
  {
    "path": ".vscode/settings.json",
    "chars": 72,
    "preview": "{\n  \"files.associations\": {\n    \"**/test/**/probes.json\": \"jsonc\"\n  }\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 23886,
    "preview": "# Changelog\n\n## [Unreleased]\n\n## [1.0.0-canary.5] - 2022-07-12\n\n- Adds alias for profile, improves error message ([#344]"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 5316,
    "preview": "# Contributing\n\nContributions are welcome!\n\nAs a general advice it is always a good idea to raise an [issue](https://git"
  },
  {
    "path": "LICENSE",
    "chars": 11367,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README.md",
    "chars": 17917,
    "preview": "<blockquote>\n  <p align=\"center\">\n    <strong>Note</strong>\n    <br />\n    The main branch currently contains the atomic"
  },
  {
    "path": "docker-compose.yml",
    "chars": 620,
    "preview": "################################################################################\n# This docker-compose file is only mean"
  },
  {
    "path": "docs/development.md",
    "chars": 1446,
    "preview": "# Development\n\nThis is a small guide to get started with development of this module.\nFrom time to time I come back to it"
  },
  {
    "path": "examples/.gitignore",
    "chars": 11,
    "preview": "*.lock.hcl\n"
  },
  {
    "path": "examples/atomic-deployments/.gitignore",
    "chars": 459,
    "preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
  },
  {
    "path": "examples/atomic-deployments/LICENSE",
    "chars": 1103,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2022 Felix Haus (milliVolt infrastructure)\n\nPermission is hereby granted, free of c"
  },
  {
    "path": "examples/atomic-deployments/README.md",
    "chars": 5943,
    "preview": "# Atomic Deployments Example\n\nThis example shows how to use the atomic deployments feature with the [Next.js Terraform m"
  },
  {
    "path": "examples/atomic-deployments/main.tf",
    "chars": 3308,
    "preview": "terraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~> 4.0\"\n    }\n  }\n}\n\n# M"
  },
  {
    "path": "examples/atomic-deployments/package.json",
    "chars": 389,
    "preview": "{\n  \"name\": \"terraform-next-js-example-custom-domain\",\n  \"version\": \"1.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"dev\""
  },
  {
    "path": "examples/atomic-deployments/pages/index.js",
    "chars": 114,
    "preview": "export default function IndexPage() {\n  return (\n    <div>\n      <h1>Custom domain example</h1>\n    </div>\n  );\n}\n"
  },
  {
    "path": "examples/complete/.gitignore",
    "chars": 459,
    "preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
  },
  {
    "path": "examples/complete/LICENSE",
    "chars": 1135,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2020 Felix Haus (milliVolt infrastructure)\nCopyright (c) 2020 Vercel, Inc.\n\nPermiss"
  },
  {
    "path": "examples/complete/README.md",
    "chars": 1806,
    "preview": "# Terraform Next.js complete example\n\n> **Warning:** This example is not fully updated for the upcoming `v1.0.0` release"
  },
  {
    "path": "examples/complete/components/header.js",
    "chars": 661,
    "preview": "import * as React from 'react';\nimport Link from 'next/link';\n\nexport const Header = () => {\n  return (\n    <header>\n   "
  },
  {
    "path": "examples/complete/main.tf",
    "chars": 868,
    "preview": "terraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~> 4.0\"\n    }\n  }\n}\n\n# M"
  },
  {
    "path": "examples/complete/next.config.js",
    "chars": 364,
    "preview": "module.exports = {\n  async rewrites() {\n    return [\n      {\n        source: '/robots.txt',\n        destination: '/api/r"
  },
  {
    "path": "examples/complete/package.json",
    "chars": 384,
    "preview": "{\n  \"name\": \"terraform-next-js-example-complete\",\n  \"version\": \"1.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"dev\": \"ne"
  },
  {
    "path": "examples/complete/pages/about.js",
    "chars": 162,
    "preview": "import { Header } from '../components/header';\n\nexport default function About() {\n  return (\n    <div>\n      <Header />\n"
  },
  {
    "path": "examples/complete/pages/api/robots.js",
    "chars": 274,
    "preview": "const content = `# Example robots.txt\n\nUser-agent: *\nAllow: /\n\nSitemap: http://www.example.com/sitemap.xml`;\n\nconst Robo"
  },
  {
    "path": "examples/complete/pages/index.js",
    "chars": 1000,
    "preview": "import { useRouter } from 'next/router';\nimport { format } from 'url';\n\nimport { Header } from '../components/header';\n\n"
  },
  {
    "path": "examples/complete/pages/test/[...slug].js",
    "chars": 1457,
    "preview": "import { useRouter } from 'next/router';\nimport Link from 'next/link';\nimport { format } from 'url';\n\nimport { Header } "
  },
  {
    "path": "examples/next-image/.gitignore",
    "chars": 459,
    "preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
  },
  {
    "path": "examples/next-image/LICENSE",
    "chars": 1135,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2021 Felix Haus (milliVolt infrastructure)\nCopyright (c) 2021 Vercel, Inc.\n\nPermiss"
  },
  {
    "path": "examples/next-image/README.md",
    "chars": 1837,
    "preview": "# Terraform Next.js Image component example\n\n> **Warning:** This example is not fully updated for the upcoming `v1.0.0` "
  },
  {
    "path": "examples/next-image/app.css",
    "chars": 316,
    "preview": "body {\n  font-family: -apple-system, BlinkMacSystemFont, sans-serif;\n  margin: 0;\n  padding: 0;\n  background: black;\n  c"
  },
  {
    "path": "examples/next-image/components/view-source.js",
    "chars": 851,
    "preview": "import { svg, arm } from './view-source.module.css'\n\nconst ViewSource = ({ pathname }) => (\n  <svg\n    xmlns=\"http://www"
  },
  {
    "path": "examples/next-image/components/view-source.module.css",
    "chars": 571,
    "preview": ".svg {\n  position: absolute;\n  top: 0;\n  right: 0;\n}\n.arm {\n  transform-origin: 130px 106px;\n}\n\n.svg:hover .arm {\n  anim"
  },
  {
    "path": "examples/next-image/main.tf",
    "chars": 865,
    "preview": "terraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~> 4.0\"\n    }\n  }\n}\n\n# M"
  },
  {
    "path": "examples/next-image/next.config.js",
    "chars": 74,
    "preview": "module.exports = {\n  images: {\n    domains: ['assets.vercel.com'],\n  },\n}\n"
  },
  {
    "path": "examples/next-image/package.json",
    "chars": 361,
    "preview": "{\n  \"name\": \"tf-next-example-next-image\",\n  \"version\": \"1.0.0\",\n  \"scripts\": {\n    \"dev\": \"next dev\",\n    \"build\": \"next"
  },
  {
    "path": "examples/next-image/pages/_app.js",
    "chars": 119,
    "preview": "import '../app.css'\n\nexport default function MyApp({ Component, pageProps }) {\n  return <Component {...pageProps} />\n}\n"
  },
  {
    "path": "examples/next-image/pages/background.js",
    "chars": 538,
    "preview": "import Image from 'next/image'\nimport ViewSource from '../components/view-source'\nimport { bgWrap, bgText } from '../sty"
  },
  {
    "path": "examples/next-image/pages/index.js",
    "chars": 3264,
    "preview": "import styles from '../styles.module.css'\nimport Image from 'next/image'\nimport Link from 'next/link'\nimport ViewSource "
  },
  {
    "path": "examples/next-image/pages/layout-fill.js",
    "chars": 894,
    "preview": "import Image from 'next/image'\nimport ViewSource from '../components/view-source'\n\nconst Fill = () => (\n  <div>\n    <Vie"
  },
  {
    "path": "examples/next-image/pages/layout-fixed.js",
    "chars": 370,
    "preview": "import Image from 'next/image'\nimport ViewSource from '../components/view-source'\n\nconst Fixed = () => (\n  <div>\n    <Vi"
  },
  {
    "path": "examples/next-image/pages/layout-intrinsic.js",
    "chars": 390,
    "preview": "import Image from 'next/image'\nimport ViewSource from '../components/view-source'\n\nconst Intrinsic = () => (\n  <div>\n   "
  },
  {
    "path": "examples/next-image/pages/layout-responsive.js",
    "chars": 395,
    "preview": "import Image from 'next/image'\nimport ViewSource from '../components/view-source'\n\nconst Responsive = () => (\n  <div>\n  "
  },
  {
    "path": "examples/next-image/styles.module.css",
    "chars": 702,
    "preview": ".container {\n  padding: 4rem 1rem;\n}\n\n.container p {\n  margin: 1.5rem 0;\n}\n\n.card {\n  max-width: 60rem;\n  box-shadow: -1"
  },
  {
    "path": "examples/static/.gitignore",
    "chars": 459,
    "preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
  },
  {
    "path": "examples/static/LICENSE",
    "chars": 1103,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2020 Felix Haus (milliVolt infrastructure)\n\nPermission is hereby granted, free of c"
  },
  {
    "path": "examples/static/README.md",
    "chars": 1768,
    "preview": "# Terraform Next.js static example\n\n> **Warning:** This example is not fully updated for the upcoming `v1.0.0` release. "
  },
  {
    "path": "examples/static/main.tf",
    "chars": 866,
    "preview": "terraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~> 4.0\"\n    }\n  }\n}\n\n# M"
  },
  {
    "path": "examples/static/package.json",
    "chars": 382,
    "preview": "{\n  \"name\": \"terraform-next-js-example-static\",\n  \"version\": \"1.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"dev\": \"next"
  },
  {
    "path": "examples/static/pages/about.js",
    "chars": 98,
    "preview": "export default function AboutPage() {\n  return (\n    <div>\n      <h1>About</h1>\n    </div>\n  );\n}\n"
  },
  {
    "path": "examples/static/pages/blog/index.js",
    "chars": 96,
    "preview": "export default function BlogPage() {\n  return (\n    <div>\n      <h1>Blog</h1>\n    </div>\n  );\n}\n"
  },
  {
    "path": "examples/static/pages/index.js",
    "chars": 97,
    "preview": "export default function IndexPage() {\n  return (\n    <div>\n      <h1>Home</h1>\n    </div>\n  );\n}\n"
  },
  {
    "path": "examples/with-custom-domain/.gitignore",
    "chars": 459,
    "preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
  },
  {
    "path": "examples/with-custom-domain/LICENSE",
    "chars": 1103,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2020 Felix Haus (milliVolt infrastructure)\n\nPermission is hereby granted, free of c"
  },
  {
    "path": "examples/with-custom-domain/README.md",
    "chars": 2646,
    "preview": "# Terraform Next.js custom domain example\n\n> **Warning:** This example is not fully updated for the upcoming `v1.0.0` re"
  },
  {
    "path": "examples/with-custom-domain/main.tf",
    "chars": 3197,
    "preview": "terraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~> 4.0\"\n    }\n  }\n}\n\n# M"
  },
  {
    "path": "examples/with-custom-domain/package.json",
    "chars": 389,
    "preview": "{\n  \"name\": \"terraform-next-js-example-custom-domain\",\n  \"version\": \"1.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"dev\""
  },
  {
    "path": "examples/with-custom-domain/pages/index.js",
    "chars": 114,
    "preview": "export default function IndexPage() {\n  return (\n    <div>\n      <h1>Custom domain example</h1>\n    </div>\n  );\n}\n"
  },
  {
    "path": "examples/with-existing-cloudfront/.gitignore",
    "chars": 459,
    "preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
  },
  {
    "path": "examples/with-existing-cloudfront/LICENSE",
    "chars": 1103,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2021 Felix Haus (milliVolt infrastructure)\n\nPermission is hereby granted, free of c"
  },
  {
    "path": "examples/with-existing-cloudfront/README.md",
    "chars": 1781,
    "preview": "# Example with existing CloudFront distribution\n\n> **Warning:** This example is not fully updated for the upcoming `v1.0"
  },
  {
    "path": "examples/with-existing-cloudfront/main.tf",
    "chars": 7279,
    "preview": "terraform {\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~> 4.0\"\n    }\n  }\n}\n\n# M"
  },
  {
    "path": "examples/with-existing-cloudfront/package.json",
    "chars": 395,
    "preview": "{\n  \"name\": \"terraform-next-js-example-existing-cloudfront\",\n  \"version\": \"1.0.0\",\n  \"private\": true,\n  \"scripts\": {\n   "
  },
  {
    "path": "examples/with-existing-cloudfront/pages/index.js",
    "chars": 934,
    "preview": "import { useRouter } from 'next/router';\nimport { format } from 'url';\n\nlet counter = 0;\n\nexport async function getServe"
  },
  {
    "path": "jest.config.js",
    "chars": 161,
    "preview": "/** @type {import('ts-jest').InitialOptionsTsJest} */\nmodule.exports = {\n  projects: ['<rootDir>/packages/*'],\n  globalS"
  },
  {
    "path": "main.tf",
    "chars": 15441,
    "preview": "data \"aws_region\" \"current\" {}\n\n##########\n# DynamoDB\n##########\n\n# Please see the documentation in packages/dynamodb-ac"
  },
  {
    "path": "modules/api/main.tf",
    "chars": 3765,
    "preview": "########\n# Lambda\n########\n\n# For changing records in deployment & alias tables\ndata \"aws_iam_policy_document\" \"access_d"
  },
  {
    "path": "modules/api/outputs.tf",
    "chars": 159,
    "preview": "output \"api_endpoint\" {\n  value = aws_apigatewayv2_api.api.api_endpoint\n}\n\noutput \"api_endpoint_access_policy_arn\" {\n  v"
  },
  {
    "path": "modules/api/variables.tf",
    "chars": 909,
    "preview": "variable \"tf_next_module_root\" {\n  type = string\n}\n\nvariable \"api_component_version\" {\n  type    = string\n  default = \"1"
  },
  {
    "path": "modules/cloudfront-main/main.tf",
    "chars": 5266,
    "preview": "resource \"aws_cloudfront_distribution\" \"distribution\" {\n  enabled             = true\n  is_ipv6_enabled     = true\n  comm"
  },
  {
    "path": "modules/cloudfront-main/outputs.tf",
    "chars": 371,
    "preview": "output \"cloudfront_id\" {\n  value = aws_cloudfront_distribution.distribution.id\n}\n\noutput \"cloudfront_hosted_zone_id\" {\n "
  },
  {
    "path": "modules/cloudfront-main/variables.tf",
    "chars": 1040,
    "preview": "############\n# CloudFront\n############\n\nvariable \"cloudfront_price_class\" {\n  type = string\n}\n\nvariable \"cloudfront_alia"
  },
  {
    "path": "modules/cloudfront-main/versions.tf",
    "chars": 151,
    "preview": "terraform {\n  required_version = \">= 0.13\"\n\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      ver"
  },
  {
    "path": "modules/cloudfront-proxy-config/main.tf",
    "chars": 3801,
    "preview": "locals {\n  origin_id = \"Proxy-Config-Edge\"\n}\n\n#############\n# Lambda@Edge\n#############\n\ndata \"aws_iam_policy_document\" "
  },
  {
    "path": "modules/cloudfront-proxy-config/outputs.tf",
    "chars": 92,
    "preview": "output \"config_endpoint\" {\n  value = aws_cloudfront_distribution.distribution.domain_name\n}\n"
  },
  {
    "path": "modules/cloudfront-proxy-config/variables.tf",
    "chars": 1076,
    "preview": "############\n# CloudFront\n############\n\nvariable \"proxy_config_module_version\" {\n  type    = string\n  default = \"1.0.0-c"
  },
  {
    "path": "modules/cloudfront-proxy-config/versions.tf",
    "chars": 226,
    "preview": "terraform {\n  required_version = \">= 0.15\"\n\n  required_providers {\n    aws = {\n      source                = \"hashicorp/"
  },
  {
    "path": "modules/deploy-controller/README.md",
    "chars": 155,
    "preview": "# Deploy Controller\n\nThe deploy controller is responsible for handling updates to the SubStacks and synchronizing the en"
  },
  {
    "path": "modules/deploy-controller/main.tf",
    "chars": 2878,
    "preview": "locals {\n  function_name = \"${var.deployment_name}_tfn-controller\"\n}\n\n###########\n# SNS-Topic\n###########\n\nresource \"aws"
  },
  {
    "path": "modules/deploy-controller/outputs.tf",
    "chars": 78,
    "preview": "output \"sns_topic_arn\" {\n  value = aws_sns_topic.cloudformation_updates.arn\n}\n"
  },
  {
    "path": "modules/deploy-controller/variables.tf",
    "chars": 968,
    "preview": "variable \"tf_next_module_root\" {\n  type = string\n}\n\nvariable \"deploy_controller_component_version\" {\n  type    = string\n"
  },
  {
    "path": "modules/deploy-controller/versions.tf",
    "chars": 148,
    "preview": "terraform {\n  required_version = \">= 0.13\"\n\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      ver"
  },
  {
    "path": "modules/lambda-worker/LICENSE",
    "chars": 10173,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "modules/lambda-worker/iam.tf",
    "chars": 1316,
    "preview": "# This module is based on the terraform-aws-lambda module:\n# https://github.com/terraform-aws-modules/terraform-aws-lamb"
  },
  {
    "path": "modules/lambda-worker/main.tf",
    "chars": 2785,
    "preview": "# This module is based on the terraform-aws-lambda module:\n# https://github.com/terraform-aws-modules/terraform-aws-lamb"
  },
  {
    "path": "modules/lambda-worker/outputs.tf",
    "chars": 600,
    "preview": "# This module is based on the terraform-aws-lambda module:\n# https://github.com/terraform-aws-modules/terraform-aws-lamb"
  },
  {
    "path": "modules/lambda-worker/variables.tf",
    "chars": 3135,
    "preview": "# This module is based on the terraform-aws-lambda module:\n# https://github.com/terraform-aws-modules/terraform-aws-lamb"
  },
  {
    "path": "modules/lambda-worker/versions.tf",
    "chars": 447,
    "preview": "# This module is based on the terraform-aws-lambda module:\n# https://github.com/terraform-aws-modules/terraform-aws-lamb"
  },
  {
    "path": "modules/proxy/main.tf",
    "chars": 959,
    "preview": "module \"proxy_package\" {\n  source  = \"milliHQ/download/npm\"\n  version = \"2.1.0\"\n\n  module_name    = \"@millihq/terraform-"
  },
  {
    "path": "modules/proxy/outputs.tf",
    "chars": 130,
    "preview": "#############\n# Lambda@Edge\n#############\n\noutput \"lambda_edge_arn\" {\n  value = module.edge_proxy.lambda_function_qualif"
  },
  {
    "path": "modules/proxy/variables.tf",
    "chars": 588,
    "preview": "#############\n# Lambda@Edge\n#############\n\nvariable \"proxy_module_version\" {\n  type    = string\n  default = \"1.0.0-canar"
  },
  {
    "path": "modules/proxy/versions.tf",
    "chars": 226,
    "preview": "terraform {\n  required_version = \">= 0.15\"\n\n  required_providers {\n    aws = {\n      source                = \"hashicorp/"
  },
  {
    "path": "modules/statics-deploy/main.tf",
    "chars": 7969,
    "preview": "locals {\n  manifest_key   = \"_tf-next/deployment.json\"\n  lambda_timeout = 60\n}\n\n########################\n# Upload Bucket"
  },
  {
    "path": "modules/statics-deploy/outputs.tf",
    "chars": 732,
    "preview": "output \"static_bucket_access_identity\" {\n  value = aws_cloudfront_origin_access_identity.this.cloudfront_access_identity"
  },
  {
    "path": "modules/statics-deploy/variables.tf",
    "chars": 2026,
    "preview": "variable \"deploy_trigger_module_version\" {\n  type    = string\n  default = \"1.0.0-canary.5\"\n}\n\nvariable \"cloudfront_id\" {"
  },
  {
    "path": "modules/statics-deploy/versions.tf",
    "chars": 148,
    "preview": "terraform {\n  required_version = \">= 0.13\"\n\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      ver"
  },
  {
    "path": "outputs.tf",
    "chars": 1973,
    "preview": "output \"upload_bucket_id\" {\n  value = module.statics_deploy.upload_bucket_id\n}\n\noutput \"api_endpoint\" {\n  description = "
  },
  {
    "path": "package.json",
    "chars": 2598,
    "preview": "{\n  \"name\": \"@dealmore/terraform-aws-nextjs-ws\",\n  \"version\": \"1.0.0-canary.5\",\n  \"private\": true,\n  \"license\": \"Apache-"
  },
  {
    "path": "packages/api/.gitignore",
    "chars": 29,
    "preview": "# Build output\ndist\ndist.zip\n"
  },
  {
    "path": "packages/api/jest.config.js",
    "chars": 141,
    "preview": "/** @type {import('ts-jest').InitialOptionsTsJest} */\nmodule.exports = {\n  preset: 'ts-jest',\n  testEnvironment: 'node',"
  },
  {
    "path": "packages/api/ncc.config.json",
    "chars": 104,
    "preview": "{\n  \"externals\": {\n    \"aws-sdk\": \"aws-sdk\",\n    \"/^aws-sdk(/.*)/\": \"aws-sdk$1\"\n  },\n  \"minify\": true\n}\n"
  },
  {
    "path": "packages/api/package.json",
    "chars": 896,
    "preview": "{\n  \"name\": \"@millihq/terraform-next-api\",\n  \"version\": \"1.0.0-canary.5\",\n  \"scripts\": {\n    \"generate:schema\": \"openapi"
  },
  {
    "path": "packages/api/schema.ts",
    "chars": 4820,
    "preview": "/**\n * This file was auto-generated by openapi-typescript.\n * Do not make direct changes to the file.\n */\n\nexport interf"
  },
  {
    "path": "packages/api/schema.yaml",
    "chars": 7231,
    "preview": "# OpenAPI 3.0 schema for the API endpoints\n\nopenapi: 3.1.0\n\ninfo:\n  title: MilliVolt deployment API\n  version: 1.0.0\n\nco"
  },
  {
    "path": "packages/api/src/actions/alias/alias-utils.ts",
    "chars": 795,
    "preview": "import { reverseHostname } from '@millihq/tfn-dynamodb-actions';\nimport Validator from 'validator';\n\ntype LikeRouteItem "
  },
  {
    "path": "packages/api/src/actions/alias/create-or-update-alias.ts",
    "chars": 5617,
    "preview": "import { URL } from 'url';\n\nimport {\n  getAliasById,\n  getDeploymentById,\n  createAlias,\n  reverseHostname,\n} from '@mil"
  },
  {
    "path": "packages/api/src/actions/alias/delete-alias-by-id.ts",
    "chars": 2841,
    "preview": "import {\n  deleteAliasById as dynamoDeleteAliasById,\n  getAliasById,\n  reverseHostname,\n} from '@millihq/tfn-dynamodb-ac"
  },
  {
    "path": "packages/api/src/actions/alias/list-aliases.ts",
    "chars": 2857,
    "preview": "import {\n  getDeploymentById,\n  listAliasesForDeployment,\n} from '@millihq/tfn-dynamodb-actions';\nimport { Request, Resp"
  },
  {
    "path": "packages/api/src/actions/deployment/create-deployment.ts",
    "chars": 1708,
    "preview": "import { pseudoRandomBytes } from 'crypto';\n\nimport { createDeployment as dynamoDBCreateDeployment } from '@millihq/tfn-"
  },
  {
    "path": "packages/api/src/actions/deployment/delete-deployment-by-id.ts",
    "chars": 6098,
    "preview": "import { Request, Response } from 'lambda-api';\n\nimport {\n  listAliasesForDeployment,\n  getDeploymentById,\n  deleteDeplo"
  },
  {
    "path": "packages/api/src/actions/deployment/get-deployment-by-id.ts",
    "chars": 1355,
    "preview": "import { getDeploymentById as dynamoDBgetDeploymentById } from '@millihq/tfn-dynamodb-actions';\nimport { Request, Respon"
  },
  {
    "path": "packages/api/src/actions/deployment/list-deployments.ts",
    "chars": 1901,
    "preview": "import { listDeployments as dynamoDBlistDeployments } from '@millihq/tfn-dynamodb-actions';\nimport { Request, Response }"
  },
  {
    "path": "packages/api/src/api.ts",
    "chars": 2461,
    "preview": "import LambdaApi, { ErrorHandlingMiddleware } from 'lambda-api';\n\nimport { createOrUpdateAlias } from './actions/alias/c"
  },
  {
    "path": "packages/api/src/declarations.d.ts",
    "chars": 503,
    "preview": "declare namespace NodeJS {\n  export interface ProcessEnv {\n    TABLE_REGION: string;\n    TABLE_NAME_DEPLOYMENTS: string;"
  },
  {
    "path": "packages/api/src/handler.ts",
    "chars": 258,
    "preview": "import { APIGatewayProxyEvent, Context } from 'aws-lambda';\n\nimport { createApi } from './api';\n\nconst api = createApi()"
  },
  {
    "path": "packages/api/src/serializers/deployment.ts",
    "chars": 897,
    "preview": "import { DeploymentItem } from '@millihq/tfn-dynamodb-actions';\n\nimport { components } from '../../schema';\n\ntype Deploy"
  },
  {
    "path": "packages/api/src/services/cloudformation.ts",
    "chars": 565,
    "preview": "import CloudFormation from 'aws-sdk/clients/cloudformation';\n\ntype CloudFormationServiceType = typeof CloudFormationServ"
  },
  {
    "path": "packages/api/src/services/dynamodb.ts",
    "chars": 631,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\ntype DynamoDBServiceType = typeof DynamoDBService;\n\nclass DynamoDBServ"
  },
  {
    "path": "packages/api/src/services/s3.ts",
    "chars": 461,
    "preview": "import S3 from 'aws-sdk/clients/s3';\n\ntype S3ServiceType = typeof S3Service;\n\nclass S3Service {\n  static s3Client: S3;\n\n"
  },
  {
    "path": "packages/api/test/actions/alias/create-or-update-alias.test.ts",
    "chars": 13217,
    "preview": "import { createDeployment, createAlias } from '@millihq/tfn-dynamodb-actions';\nimport { APIGatewayProxyStructuredResultV"
  },
  {
    "path": "packages/api/test/actions/alias/delete-alias-by-id.test.ts",
    "chars": 4978,
    "preview": "import { createAlias } from '@millihq/tfn-dynamodb-actions';\nimport { APIGatewayProxyStructuredResultV2 } from 'aws-lamb"
  },
  {
    "path": "packages/api/test/actions/alias/list-aliases.test.ts",
    "chars": 5137,
    "preview": "import { createAlias, createDeployment } from '@millihq/tfn-dynamodb-actions';\nimport { APIGatewayProxyStructuredResultV"
  },
  {
    "path": "packages/api/test/actions/deployment/create-deployment.test.ts",
    "chars": 1953,
    "preview": "import { APIGatewayProxyStructuredResultV2 } from 'aws-lambda';\nimport { API } from 'lambda-api';\n\nimport { createApi } "
  },
  {
    "path": "packages/api/test/actions/deployment/delete-deployment-by-id.test.ts",
    "chars": 8575,
    "preview": "import {\n  createAlias,\n  createDeployment,\n  getDeploymentById,\n  updateDeploymentStatusCreateInProgress,\n  updateDeplo"
  },
  {
    "path": "packages/api/test/actions/deployment/get-deployment-by-id.test.ts",
    "chars": 2629,
    "preview": "import { createDeployment } from '@millihq/tfn-dynamodb-actions';\nimport { APIGatewayProxyStructuredResultV2 } from 'aws"
  },
  {
    "path": "packages/api/test/actions/deployment/list-deployments.test.ts",
    "chars": 2729,
    "preview": "import { createDeployment } from '@millihq/tfn-dynamodb-actions';\nimport { APIGatewayProxyStructuredResultV2 } from 'aws"
  },
  {
    "path": "packages/api/test/test-utils.ts",
    "chars": 4661,
    "preview": "import { pseudoRandomBytes } from 'crypto';\nimport { URL } from 'url';\n\nimport {\n  createTestDynamoDBClient,\n  createAli"
  },
  {
    "path": "packages/api/tsconfig.json",
    "chars": 266,
    "preview": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"./dist\",\n    \"experimentalDecorators\": true,"
  },
  {
    "path": "packages/deploy-controller/.gitignore",
    "chars": 29,
    "preview": "# Build output\ndist\ndist.zip\n"
  },
  {
    "path": "packages/deploy-controller/README.md",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "packages/deploy-controller/jest.config.js",
    "chars": 141,
    "preview": "/** @type {import('ts-jest').InitialOptionsTsJest} */\nmodule.exports = {\n  preset: 'ts-jest',\n  testEnvironment: 'node',"
  },
  {
    "path": "packages/deploy-controller/package.json",
    "chars": 1039,
    "preview": "{\n  \"name\": \"@millihq/terraform-next-deploy-controller\",\n  \"version\": \"1.0.0-canary.5\",\n  \"description\": \"Deployment con"
  },
  {
    "path": "packages/deploy-controller/src/controller.ts",
    "chars": 6039,
    "preview": "import {\n  createAlias,\n  deleteDeploymentById,\n  reverseHostname,\n  updateDeploymentStatus,\n  updateDeploymentStatusFin"
  },
  {
    "path": "packages/deploy-controller/src/declarations.d.ts",
    "chars": 203,
    "preview": "declare namespace NodeJS {\n  export interface ProcessEnv {\n    TABLE_REGION: string;\n    TABLE_NAME_DEPLOYMENTS: string;"
  },
  {
    "path": "packages/deploy-controller/src/handler.ts",
    "chars": 888,
    "preview": "import { SNSEvent } from 'aws-lambda';\nimport DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { ensureEnv } from './ut"
  },
  {
    "path": "packages/deploy-controller/src/utils/ensure-env.ts",
    "chars": 395,
    "preview": "/**\n * Ensures that the environment variables\n */\nfunction ensureEnv(key: string, defaultValue?: string): string {\n  con"
  },
  {
    "path": "packages/deploy-controller/src/utils/parse-cloudformation-event.ts",
    "chars": 1742,
    "preview": "import { ResourceStatus } from 'aws-sdk/clients/cloudformation';\n\ntype ResourceType = 'AWS::CloudFormation::Stack' | str"
  },
  {
    "path": "packages/deploy-controller/src/utils/parse-lambda-routes.ts",
    "chars": 654,
    "preview": "/**\n * The Lambda routes is basically a string separated by \" \".\n * First value is the route (key), second one is the en"
  },
  {
    "path": "packages/deploy-controller/test/controller.test.ts",
    "chars": 2029,
    "preview": "import {\n  createTestDynamoDBClient,\n  createAliasTestTable,\n  createDeploymentTestTable,\n} from '@millihq/tfn-dynamodb-"
  },
  {
    "path": "packages/deploy-controller/test/test-utils.ts",
    "chars": 2607,
    "preview": "import { SNSEvent } from 'aws-lambda';\n\ntype CreateTestMessageOptions = {\n  StackId?: string | null;\n  Timestamp?: strin"
  },
  {
    "path": "packages/deploy-controller/test/utils/parse-cloudformation-event.test.ts",
    "chars": 1931,
    "preview": "import { parseCloudFormationEvent } from '../../src/utils/parse-cloudformation-event';\n\ntest('Create Complete: IAM Role'"
  },
  {
    "path": "packages/deploy-controller/test/utils/parse-lambda-routes.test.ts",
    "chars": 734,
    "preview": "import { parseLambdaRoutes } from '../../src/utils/parse-lambda-routes';\n\ndescribe('Parse Lambda routes', () => {\n  test"
  },
  {
    "path": "packages/deploy-controller/tsconfig.json",
    "chars": 174,
    "preview": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"./dist\",\n    \"noFallthroughCasesInSwitch\": t"
  },
  {
    "path": "packages/deploy-trigger/.gitignore",
    "chars": 14,
    "preview": "dist\ndist.zip\n"
  },
  {
    "path": "packages/deploy-trigger/README.md",
    "chars": 224,
    "preview": "# Terraform Next.js Deploy trigger component\n\nDeploy trigger component of [Terraform Next.js module for AWS](https://git"
  },
  {
    "path": "packages/deploy-trigger/jest.config.js",
    "chars": 141,
    "preview": "/** @type {import('ts-jest').InitialOptionsTsJest} */\nmodule.exports = {\n  preset: 'ts-jest',\n  testEnvironment: 'node',"
  },
  {
    "path": "packages/deploy-trigger/ncc.config.json",
    "chars": 104,
    "preview": "{\n  \"externals\": {\n    \"aws-sdk\": \"aws-sdk\",\n    \"/^aws-sdk(/.*)/\": \"aws-sdk$1\"\n  },\n  \"minify\": true\n}\n"
  },
  {
    "path": "packages/deploy-trigger/package.json",
    "chars": 1469,
    "preview": "{\n  \"name\": \"@millihq/terraform-next-deploy-trigger\",\n  \"version\": \"1.0.0-canary.5\",\n  \"description\": \"Deploy trigger co"
  },
  {
    "path": "packages/deploy-trigger/src/cdk/aws-construct-function-urls.ts",
    "chars": 3080,
    "preview": "import { Stack, RemovalPolicy, CfnOutput, Duration } from 'aws-cdk-lib';\nimport { Role, ServicePrincipal, PolicyStatemen"
  },
  {
    "path": "packages/deploy-trigger/src/cdk/aws-construct.ts",
    "chars": 3700,
    "preview": "import {\n  HttpApi,\n  HttpMethod,\n  PayloadFormatVersion,\n} from '@aws-cdk/aws-apigatewayv2-alpha';\nimport { HttpLambdaI"
  },
  {
    "path": "packages/deploy-trigger/src/cdk/cdk-utils.ts",
    "chars": 504,
    "preview": "import * as lambda from 'aws-cdk-lib/aws-lambda';\n\nimport { SupportedRuntime } from '../types';\n\nfunction getRuntime(run"
  },
  {
    "path": "packages/deploy-trigger/src/cdk/create-cloudformation-stack.ts",
    "chars": 1598,
    "preview": "import { Stack } from 'aws-cdk-lib';\nimport CloudFormation from 'aws-sdk/clients/cloudformation';\n\nimport { toCloudForma"
  },
  {
    "path": "packages/deploy-trigger/src/cdk/to-cloudformation.ts",
    "chars": 714,
    "preview": "import { Stack } from 'aws-cdk-lib';\nimport { synthesize } from 'aws-cdk-lib/core/lib/private/synthesis';\n\n/**\n * Utilit"
  },
  {
    "path": "packages/deploy-trigger/src/constants.ts",
    "chars": 265,
    "preview": "// Filename of the manifest\nexport const deploymentConfigurationKey = '_tf-next/deployment.json';\nexport const manifestV"
  },
  {
    "path": "packages/deploy-trigger/src/create-invalidation.ts",
    "chars": 4312,
    "preview": "import CloudFront from 'aws-sdk/clients/cloudfront';\n\n// Number of paths a single invalidation can hold\n// A invalidatio"
  },
  {
    "path": "packages/deploy-trigger/src/declarations.d.ts",
    "chars": 358,
    "preview": "declare namespace NodeJS {\n  export interface ProcessEnv {\n    TARGET_BUCKET: string;\n    DISTRIBUTION_ID: string;\n    S"
  },
  {
    "path": "packages/deploy-trigger/src/deploy-trigger.ts",
    "chars": 6250,
    "preview": "import { extname } from 'path';\n\nimport S3 from 'aws-sdk/clients/s3';\nimport unzipper from 'unzipper';\nimport {\n  lookup"
  },
  {
    "path": "packages/deploy-trigger/src/get-or-create-manifest.ts",
    "chars": 2003,
    "preview": "import S3 from 'aws-sdk/clients/s3';\n\nimport { manifestVersion } from './constants';\nimport { FileResult, Manifest, Mani"
  },
  {
    "path": "packages/deploy-trigger/src/handler.ts",
    "chars": 8875,
    "preview": "import {\n  updateDeploymentStatusCreateInProgress,\n  getDeploymentById,\n  updateDeploymentStatusCreateFailed,\n  updateDe"
  },
  {
    "path": "packages/deploy-trigger/src/types.ts",
    "chars": 1341,
    "preview": "import { Route } from '@vercel/routing-utils';\n\n/**\n * Supported runtime values for the Lambdas.\n */\nexport type Support"
  },
  {
    "path": "packages/deploy-trigger/src/update-manifest.ts",
    "chars": 7380,
    "preview": "import S3 from 'aws-sdk/clients/s3';\n\nimport { expireTagKey, expireTagValue } from './constants';\nimport { ExpireValue, "
  },
  {
    "path": "packages/deploy-trigger/src/utils/ensure-env.ts",
    "chars": 395,
    "preview": "/**\n * Ensures that the environment variables\n */\nfunction ensureEnv(key: string, defaultValue?: string): string {\n  con"
  },
  {
    "path": "packages/deploy-trigger/src/utils/random-id.ts",
    "chars": 226,
    "preview": "import { pseudoRandomBytes } from 'crypto';\n\nexport function generateRandomId(length: number) {\n  return pseudoRandomByt"
  },
  {
    "path": "packages/deploy-trigger/test/create-invalidation.test.ts",
    "chars": 3139,
    "preview": "import {\n  createInvalidationChunk,\n  prepareInvalidations,\n} from '../src/create-invalidation';\n\ndescribe('prepareInval"
  },
  {
    "path": "packages/deploy-trigger/test/deploy-trigger.test.ts",
    "chars": 4353,
    "preview": "import * as fs from 'fs';\n\nimport S3 from 'aws-sdk/clients/s3';\n\nimport {\n  BucketHandler,\n  s3CreateBucket as createBuc"
  },
  {
    "path": "packages/deploy-trigger/test/get-or-create-manifest.test.ts",
    "chars": 3427,
    "preview": "import S3 from 'aws-sdk/clients/s3';\n\nimport {\n  BucketHandler,\n  s3CreateBucket as createBucket,\n} from '../../../test/"
  },
  {
    "path": "packages/deploy-trigger/test/test-utils.ts",
    "chars": 1635,
    "preview": "import * as crypto from 'crypto';\nimport * as fs from 'fs';\n\nimport archiver from 'archiver';\nimport S3 from 'aws-sdk/cl"
  },
  {
    "path": "packages/deploy-trigger/test/update-manifest.test.ts",
    "chars": 7998,
    "preview": "import S3 from 'aws-sdk/clients/s3';\n\nimport {\n  BucketHandler,\n  s3CreateBucket as createBucket,\n} from '../../../test/"
  },
  {
    "path": "packages/deploy-trigger/tsconfig.json",
    "chars": 134,
    "preview": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"./dist\"\n  },\n  \"include\": [\"./src/**/*\", \"./"
  },
  {
    "path": "packages/dynamodb-actions/.gitignore",
    "chars": 20,
    "preview": "# Build output\ndist\n"
  },
  {
    "path": "packages/dynamodb-actions/README.md",
    "chars": 4277,
    "preview": "# DynamoDB Actions\n\nThis package describes the actions that can be performed on the DynamoDB data model.\nThe database co"
  },
  {
    "path": "packages/dynamodb-actions/jest.config.js",
    "chars": 141,
    "preview": "/** @type {import('ts-jest').InitialOptionsTsJest} */\nmodule.exports = {\n  preset: 'ts-jest',\n  testEnvironment: 'node',"
  },
  {
    "path": "packages/dynamodb-actions/package.json",
    "chars": 253,
    "preview": "{\n  \"name\": \"@millihq/tfn-dynamodb-actions\",\n  \"version\": \"1.0.0-canary.5\",\n  \"private\": true,\n  \"main\": \"src/index.ts\","
  },
  {
    "path": "packages/dynamodb-actions/src/alias/create-alias.ts",
    "chars": 2653,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { RouteItem } from '../types';\n\nconst { marshall } = DynamoDB.C"
  },
  {
    "path": "packages/dynamodb-actions/src/alias/delete-alias-by-id.ts",
    "chars": 1616,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { getAliasById } from './get-alias-by-id';\n\ninterface DeleteAli"
  },
  {
    "path": "packages/dynamodb-actions/src/alias/get-alias-by-hostname.ts",
    "chars": 1341,
    "preview": "import { DynamoDB } from 'aws-sdk';\n\nimport { RouteItem } from '../types';\n\nconst { unmarshall } = DynamoDB.Converter;\n\n"
  },
  {
    "path": "packages/dynamodb-actions/src/alias/get-alias-by-id.ts",
    "chars": 1422,
    "preview": "import { DynamoDB } from 'aws-sdk';\n\nimport { RouteItem } from '../types';\n\nconst { unmarshall } = DynamoDB.Converter;\n\n"
  },
  {
    "path": "packages/dynamodb-actions/src/alias/list-aliases-for-deployment.ts",
    "chars": 2471,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { RouteItemDeploymentIdIndex } from '../types';\n\nconst { unmars"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/create-deployment.ts",
    "chars": 1765,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { DeploymentItem, DeploymentTemplateType } from '../types';\n\nco"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/delete-deployment-by-id.ts",
    "chars": 1708,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { DeploymentItem } from '../types';\nimport { getDeploymentById "
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/get-deployment-by-id.ts",
    "chars": 1766,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { DeploymentItem } from '../types';\n\nconst { unmarshall } = Dyn"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/list-deployments.ts",
    "chars": 2135,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { DeploymentItemCreateDateIndex } from '../types';\n\nconst { unm"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/update-deployment-status-create-failed.ts",
    "chars": 868,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { updateDeployment } from './update-deployment';\n\ntype UpdateDe"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/update-deployment-status-create-in-progress.ts",
    "chars": 1627,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { updateDeployment } from './update-deployment';\n\ntype UpdateDe"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/update-deployment-status-destroy-failed.ts",
    "chars": 868,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { updateDeployment } from './update-deployment';\n\ntype UpdateDe"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/update-deployment-status-destroy-in-progress.ts",
    "chars": 894,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { updateDeployment } from './update-deployment';\n\ntype UpdateDe"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/update-deployment-status-destroy-requested.ts",
    "chars": 886,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { updateDeployment } from './update-deployment';\n\ntype UpdateDe"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/update-deployment-status-finished.ts",
    "chars": 1574,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { updateDeployment } from './update-deployment';\n\ntype UpdateDe"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/update-deployment-status.ts",
    "chars": 1301,
    "preview": "import { DynamoDB } from 'aws-sdk';\n\nimport { updateItem } from '../utils/dynamodb';\nimport { getDeploymentById } from '"
  },
  {
    "path": "packages/dynamodb-actions/src/deployment/update-deployment.ts",
    "chars": 1554,
    "preview": "import DynamoDB from 'aws-sdk/clients/dynamodb';\n\nimport { DeploymentItem } from '../types';\nimport { updateItem } from "
  },
  {
    "path": "packages/dynamodb-actions/src/index.ts",
    "chars": 1455,
    "preview": "// Alias\nexport { createAlias } from './alias/create-alias';\nexport { getAliasById } from './alias/get-alias-by-id';\nexp"
  },
  {
    "path": "packages/dynamodb-actions/src/types.ts",
    "chars": 3594,
    "preview": "/**\n * CDK Template that is used for a deployment.\n */\nexport type DeploymentTemplateType = 'FUNCTION_URLS' | 'API_GATEW"
  }
]

// ... and 642 more files (download for full content)

About this extraction

This page contains the full source code of the dealmore/terraform-aws-next-js GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 842 files (2.6 MB), approximately 732.6k tokens, and a symbol index with 3319 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!