Compare commits

..

15 Commits

Author SHA1 Message Date
Nathan Rajlich
0fc114ee16 [cli] Enable TS path alias 2023-04-14 00:46:58 -07:00
Sean Massa
2aeddde7d5 [tests] split python e2e tests into chunks (#9771)
Split python tests into two chunks. They take <10m each.
2023-04-13 22:19:14 +00:00
Dan Stowell
a8eab6beb7 [tests] fetch vercel.com cert before builds and after tests (#9803)
To debug intermittent connection errors when the tests make requests to [api.vercel.com], fetch the SSL certificate before builds and after tests.
2023-04-13 20:47:13 +00:00
Nathan Rajlich
031c182896 [examples] Update Remix template to use v1.15.0 (#9788) 2023-04-13 11:36:59 -07:00
Chris Barber
38eb0bca04 [go] Support 'go.work' file and resolve shared deps relative to work path (#9708)
This PR fixes a few issues related to `vc dev`.

1. Create a default `go.work` file in the cache dir when building the `vercel-dev-server-go` executable
2. Copy the existing `go.mod` file into the cache dir and update any "replace" relative paths
3. Split the "build" logic into separate functions for the legacy "main" package build and the `go.mod` build

Additionally, it fixes:

1. `vc build`: pass in `build.env` from `vercel.json`
2. Fix several tests to work with `vc dev` and `vc build`

Linear: https://linear.app/vercel/issue/VCCLI-638/vc-dev-go-builder-cant-resolve-workspace-dependencies

The user that reported the issue has tested this build and seems to fix their use case: https://github.com/vercel/vercel/issues/9393#issuecomment-1490726785.
2023-04-13 17:59:47 +00:00
Chris Barber
732ac2072c [tests] Update Typescript, Jest, and ts-jest (#9782)
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Swarnava Sengupta <swarnavasengupta@gmail.com>
2023-04-12 08:38:03 -05:00
Nathan Rajlich
64d9cef963 [publish] Trigger update workflow on "api" repo after Publish (#9791)
So that we don't need to trigger it manually and/or wait for the cronjob.
2023-04-12 06:53:46 +00:00
Nathan Rajlich
6b9e274bc7 [cli] Simplify parseRepoUrl() and fix edge case (#9796)
Fixes an edge case in `parseRepoUrl()` when there is a `.com` in the repo name. The code was hard to refactor in its previous form so I refactored it to be simpler as well.
2023-04-12 04:29:29 +00:00
Sean Massa
a2da071755 [tests] re-chunk example tests (#9792)
It turns out that these do take a long time to run when not cached. We do want these chunks.
2023-04-12 00:57:07 +00:00
Dan Stowell
14ece4111a Publish Stable
- vercel@28.18.5
 - @vercel/fs-detectors@3.8.10
 - @vercel/gatsby-plugin-vercel-builder@1.2.8
 - @vercel/static-build@1.3.23
2023-04-11 16:25:20 -05:00
Sean Massa
e302631ded [fs-detectors] check turbo versions to allow for tags like "latest" (#9790)
When a project depends on `turbo` at version `latest`, this code was breaking because `latest` is not a valid range for `semver.intersects`.
2023-04-11 21:22:41 +00:00
Nathan Rajlich
43a57a3a60 [gatsby-plugin-vercel-builder] Ignore assetPrefix completely (#9787)
Before, we were stripping off only the hostname portion of `assetPrefix`, so any pathname was still being "handled" by the plugin.

Instead, we should be ignoring the `assetPrefix` entirely, so that these two configurations are treated differently:

 * `{ assetPrefix: 'http://example.com', pathPrefix: '/foo' }` - Gatsby project is served from `/foo`
 * `{ assetPrefix: 'http://example.com/foo', pathPrefix: undefined }` - Gatsby project is served from the root `/`

Currently, both configuration behave as the first version listed above. This change makes it so they can behave differently, specifically for some proxy configurations.

In both cases, the generated HTML contains the full URL `http://example.com/foo/*` for JS/CSS/etc. assets
2023-04-11 19:52:38 +00:00
Ethan Arrowood
136077ab6f [scripts] Create internal-dependency-trace script package (#9783)
Adds a new package under `scripts/internal-dependency-trace` that can be used to generate a rendering of any internal file dependency graph.

Default configured to generate the directed dependency graph of `packages/cli/src/index.ts`
2023-04-10 21:01:17 +00:00
Lee Robinson
8634f9cd7e [examples] Update Astro example. (#9778)
This demo now showcases:

- `/` - A static page (pre-rendered)
- `/ssr` - A page that uses server-side rendering (through Vercel Edge Functions)
- `/ssr-with-swr-caching` - Similar to the previous page, but also caches the response on the Vercel Edge Network using `cache-control` headers
- `/edge.json` - An Astro API Endpoint that returns JSON data using Vercel Edge Functions

The new example has been deployed to https://astro.vercel.app.
2023-04-10 08:35:00 +00:00
Sean Massa
dc8523998c [tests] combine examples e2e into one chunk (#9772)
We don't need 5 chunks of the very fast examples tests. We spend more time in setup for each one. We are also more likely to hit the [usage limit](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits) with these.

This PR combines them into one test suite.
2023-04-07 23:47:27 +00:00
99 changed files with 3513 additions and 5311 deletions

View File

@@ -11,8 +11,6 @@ packages/cli/@types
packages/cli/download
packages/cli/dist
packages/cli/test/dev/fixtures
packages/cli/bin
packages/cli/link
packages/cli/src/util/dev/templates/*.ts
# client

55
.eslintrc.json Normal file
View File

@@ -0,0 +1,55 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"modules": true
},
"plugins": ["jest"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": {
"node": true,
"jest": true,
"es6": true
},
"rules": {
"no-restricted-syntax": [
"warn",
"WithStatement",
{
"message": "substr() is deprecated, use slice() or substring() instead",
"selector": "MemberExpression > Identifier[name='substr']"
}
],
"no-dupe-keys": 2,
"require-atomic-updates": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unused-vars": 2,
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/no-var-requires": 0,
"jest/no-disabled-tests": 2,
"jest/no-focused-tests": 2
},
"overrides": [
{
"files": ["packages/client/**/*"],
"rules": {
"prefer-const": 0,
"require-atomic-updates": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/no-explicit-any": 0
}
}
]
}

View File

@@ -65,3 +65,11 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Trigger Update
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/trigger-update-workflow.js')
await script({ github, context })

View File

@@ -76,6 +76,10 @@ jobs:
- run: pnpm install
- name: fetch ssl certificate before build (linux, os x)
if: matrix.runner != 'windows-latest'
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
- name: Build ${{matrix.packageName}} and all its dependencies
run: node utils/gen.js && node_modules/.bin/turbo run build --cache-dir=".turbo" --scope=${{matrix.packageName}} --include-dependencies --no-deps
env:
@@ -89,6 +93,10 @@ jobs:
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
FORCE_COLOR: '1'
- name: fetch ssl certificate after tests (linux, os x)
if: matrix.runner != 'windows-latest'
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
conclusion:
needs:
- test

View File

@@ -1,6 +1,13 @@
# Astro
This directory is a brief example of an [Astro](https://astro.build/) site that can be deployed to Vercel with zero configuration.
This directory is a brief example of an [Astro](https://astro.build/) site that can be deployed to Vercel with zero configuration. This demo showcases:
- `/` - A static page (pre-rendered)
- `/ssr` - A page that uses server-side rendering (through Vercel Edge Functions)
- `/ssr-with-swr-caching` - Similar to the previous page, but also caches the response on the Vercel Edge Network using `cache-control` headers
- `/edge.json` - An Astro API Endpoint that returns JSON data using Vercel Edge Functions
Learn more about [Astro on Vercel](https://vercel.com/docs/frameworks/astro).
## Deploy Your Own
@@ -12,21 +19,7 @@ _Live Example: https://astro-template.vercel.app_
## Project Structure
Inside of your Astro project, you'll see the following folders and files:
```
/
├── public/
│ └── favicon.ico
├── src/
│ ├── components/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
```
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
Astro looks for `.astro`, `.md`, or `.js` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components or layouts.
@@ -42,5 +35,6 @@ All commands are run from the root of the project, from a terminal:
| `pnpm run dev` | Starts local dev server at `localhost:3000` |
| `pnpm run build` | Build your production site to `./dist/` |
| `pnpm run preview` | Preview your build locally, before deploying |
| `pnpm run start` | Starts a production dev server at `localhost:3000` |
| `pnpm run astro ...` | Run CLI commands like `astro add`, `astro preview` |
| `pnpm run astro --help` | Get help using the Astro CLI |

View File

@@ -1,4 +1,7 @@
import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/edge';
// https://astro.build/config
export default defineConfig({});
export default defineConfig({
output: 'server',
adapter: vercel(),
});

View File

@@ -7,8 +7,10 @@
"preview": "astro preview",
"astro": "astro"
},
"devDependencies": {
"astro": "^2.0.6",
"web-vitals": "^3.1.1"
"dependencies": {
"@astrojs/vercel": "3.2.2",
"astro": "^2.2.1",
"react": "18.2.0",
"web-vitals": "^3.3.1"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
export async function get() {
return new Response(JSON.stringify({ time: new Date() }), {
status: 200,
headers: {
'Content-Type': 'application/json',
'Cache-Control': 's-maxage=10, stale-while-revalidate',
},
});
}

View File

@@ -1,6 +1,8 @@
---
import Layout from '../layouts/Layout.astro';
import Card from '../components/Card.astro';
export const prerender = true;
---
<Layout title="Welcome to Astro.">

View File

@@ -0,0 +1,7 @@
---
Astro.response.headers.set('Cache-Control', 's-maxage=10, stale-while-revalidate');
const time = new Date().toLocaleTimeString();
---
<h1>{time}</h1>

View File

@@ -0,0 +1,5 @@
---
const time = new Date().toLocaleTimeString();
---
<h1>{time}</h1>

View File

@@ -6,17 +6,17 @@
"dev": "remix dev"
},
"dependencies": {
"@remix-run/node": "^1.14.3",
"@remix-run/react": "^1.14.3",
"@remix-run/serve": "^1.14.3",
"@remix-run/node": "^1.15.0",
"@remix-run/react": "^1.15.0",
"@remix-run/serve": "^1.15.0",
"@vercel/analytics": "^0.1.11",
"@vercel/remix": "1.14.3-patch.1",
"@vercel/remix": "^1.15.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^1.14.3",
"@remix-run/eslint-config": "^1.14.3",
"@remix-run/dev": "^1.15.0",
"@remix-run/eslint-config": "^1.15.0",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.11",
"eslint": "^8.28.0",

View File

@@ -4,30 +4,30 @@ importers:
.:
specifiers:
'@remix-run/dev': ^1.14.3
'@remix-run/eslint-config': ^1.14.3
'@remix-run/node': ^1.14.3
'@remix-run/react': ^1.14.3
'@remix-run/serve': ^1.14.3
'@remix-run/dev': ^1.15.0
'@remix-run/eslint-config': ^1.15.0
'@remix-run/node': ^1.15.0
'@remix-run/react': ^1.15.0
'@remix-run/serve': ^1.15.0
'@types/react': ^18.0.25
'@types/react-dom': ^18.0.11
'@vercel/analytics': ^0.1.11
'@vercel/remix': 1.14.3-patch.1
'@vercel/remix': ^1.15.0
eslint: ^8.28.0
react: ^18.2.0
react-dom: ^18.2.0
typescript: ^4.9.3
dependencies:
'@remix-run/node': 1.14.3
'@remix-run/react': 1.14.3_biqbaboplfbrettd7655fr4n2y
'@remix-run/serve': 1.14.3
'@remix-run/node': 1.15.0
'@remix-run/react': 1.15.0_biqbaboplfbrettd7655fr4n2y
'@remix-run/serve': 1.15.0
'@vercel/analytics': 0.1.11_react@18.2.0
'@vercel/remix': 1.14.3-patch.1_biqbaboplfbrettd7655fr4n2y
'@vercel/remix': 1.15.0_biqbaboplfbrettd7655fr4n2y
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
devDependencies:
'@remix-run/dev': 1.14.3_@remix-run+serve@1.14.3
'@remix-run/eslint-config': 1.14.3_km5ddj7uwb23cqeymeyvzjsfb4
'@remix-run/dev': 1.15.0_@remix-run+serve@1.15.0
'@remix-run/eslint-config': 1.15.0_km5ddj7uwb23cqeymeyvzjsfb4
'@types/react': 18.0.28
'@types/react-dom': 18.0.11
eslint: 8.34.0
@@ -1333,6 +1333,15 @@ packages:
dev: true
optional: true
/@esbuild/android-arm/0.17.6:
resolution: {integrity: sha512-bSC9YVUjADDy1gae8RrioINU6e1lCkg3VGVwm0QQ2E1CWcC4gnMce9+B6RpxuSsrsXsk1yojn7sp1fnG8erE2g==}
engines: {node: '>=12'}
cpu: [arm]
os: [android]
requiresBuild: true
dev: true
optional: true
/@esbuild/android-arm64/0.16.3:
resolution: {integrity: sha512-RolFVeinkeraDvN/OoRf1F/lP0KUfGNb5jxy/vkIMeRRChkrX/HTYN6TYZosRJs3a1+8wqpxAo5PI5hFmxyPRg==}
engines: {node: '>=12'}
@@ -1342,6 +1351,15 @@ packages:
dev: true
optional: true
/@esbuild/android-arm64/0.17.6:
resolution: {integrity: sha512-YnYSCceN/dUzUr5kdtUzB+wZprCafuD89Hs0Aqv9QSdwhYQybhXTaSTcrl6X/aWThn1a/j0eEpUBGOE7269REg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [android]
requiresBuild: true
dev: true
optional: true
/@esbuild/android-x64/0.16.3:
resolution: {integrity: sha512-SFpTUcIT1bIJuCCBMCQWq1bL2gPTjWoLZdjmIhjdcQHaUfV41OQfho6Ici5uvvkMmZRXIUGpM3GxysP/EU7ifQ==}
engines: {node: '>=12'}
@@ -1351,6 +1369,15 @@ packages:
dev: true
optional: true
/@esbuild/android-x64/0.17.6:
resolution: {integrity: sha512-MVcYcgSO7pfu/x34uX9u2QIZHmXAB7dEiLQC5bBl5Ryqtpj9lT2sg3gNDEsrPEmimSJW2FXIaxqSQ501YLDsZQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [android]
requiresBuild: true
dev: true
optional: true
/@esbuild/darwin-arm64/0.16.3:
resolution: {integrity: sha512-DO8WykMyB+N9mIDfI/Hug70Dk1KipavlGAecxS3jDUwAbTpDXj0Lcwzw9svkhxfpCagDmpaTMgxWK8/C/XcXvw==}
engines: {node: '>=12'}
@@ -1360,6 +1387,15 @@ packages:
dev: true
optional: true
/@esbuild/darwin-arm64/0.17.6:
resolution: {integrity: sha512-bsDRvlbKMQMt6Wl08nHtFz++yoZHsyTOxnjfB2Q95gato+Yi4WnRl13oC2/PJJA9yLCoRv9gqT/EYX0/zDsyMA==}
engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@esbuild/darwin-x64/0.16.3:
resolution: {integrity: sha512-uEqZQ2omc6BvWqdCiyZ5+XmxuHEi1SPzpVxXCSSV2+Sh7sbXbpeNhHIeFrIpRjAs0lI1FmA1iIOxFozKBhKgRQ==}
engines: {node: '>=12'}
@@ -1369,6 +1405,15 @@ packages:
dev: true
optional: true
/@esbuild/darwin-x64/0.17.6:
resolution: {integrity: sha512-xh2A5oPrYRfMFz74QXIQTQo8uA+hYzGWJFoeTE8EvoZGHb+idyV4ATaukaUvnnxJiauhs/fPx3vYhU4wiGfosg==}
engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@esbuild/freebsd-arm64/0.16.3:
resolution: {integrity: sha512-nJansp3sSXakNkOD5i5mIz2Is/HjzIhFs49b1tjrPrpCmwgBmH9SSzhC/Z1UqlkivqMYkhfPwMw1dGFUuwmXhw==}
engines: {node: '>=12'}
@@ -1378,6 +1423,15 @@ packages:
dev: true
optional: true
/@esbuild/freebsd-arm64/0.17.6:
resolution: {integrity: sha512-EnUwjRc1inT4ccZh4pB3v1cIhohE2S4YXlt1OvI7sw/+pD+dIE4smwekZlEPIwY6PhU6oDWwITrQQm5S2/iZgg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/@esbuild/freebsd-x64/0.16.3:
resolution: {integrity: sha512-TfoDzLw+QHfc4a8aKtGSQ96Wa+6eimljjkq9HKR0rHlU83vw8aldMOUSJTUDxbcUdcgnJzPaX8/vGWm7vyV7ug==}
engines: {node: '>=12'}
@@ -1387,6 +1441,15 @@ packages:
dev: true
optional: true
/@esbuild/freebsd-x64/0.17.6:
resolution: {integrity: sha512-Uh3HLWGzH6FwpviUcLMKPCbZUAFzv67Wj5MTwK6jn89b576SR2IbEp+tqUHTr8DIl0iDmBAf51MVaP7pw6PY5Q==}
engines: {node: '>=12'}
cpu: [x64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-arm/0.16.3:
resolution: {integrity: sha512-VwswmSYwVAAq6LysV59Fyqk3UIjbhuc6wb3vEcJ7HEJUtFuLK9uXWuFoH1lulEbE4+5GjtHi3MHX+w1gNHdOWQ==}
engines: {node: '>=12'}
@@ -1396,6 +1459,15 @@ packages:
dev: true
optional: true
/@esbuild/linux-arm/0.17.6:
resolution: {integrity: sha512-7YdGiurNt7lqO0Bf/U9/arrPWPqdPqcV6JCZda4LZgEn+PTQ5SMEI4MGR52Bfn3+d6bNEGcWFzlIxiQdS48YUw==}
engines: {node: '>=12'}
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-arm64/0.16.3:
resolution: {integrity: sha512-7I3RlsnxEFCHVZNBLb2w7unamgZ5sVwO0/ikE2GaYvYuUQs9Qte/w7TqWcXHtCwxvZx/2+F97ndiUQAWs47ZfQ==}
engines: {node: '>=12'}
@@ -1405,6 +1477,15 @@ packages:
dev: true
optional: true
/@esbuild/linux-arm64/0.17.6:
resolution: {integrity: sha512-bUR58IFOMJX523aDVozswnlp5yry7+0cRLCXDsxnUeQYJik1DukMY+apBsLOZJblpH+K7ox7YrKrHmJoWqVR9w==}
engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-ia32/0.16.3:
resolution: {integrity: sha512-X8FDDxM9cqda2rJE+iblQhIMYY49LfvW4kaEjoFbTTQ4Go8G96Smj2w3BRTwA8IHGoi9dPOPGAX63dhuv19UqA==}
engines: {node: '>=12'}
@@ -1414,6 +1495,15 @@ packages:
dev: true
optional: true
/@esbuild/linux-ia32/0.17.6:
resolution: {integrity: sha512-ujp8uoQCM9FRcbDfkqECoARsLnLfCUhKARTP56TFPog8ie9JG83D5GVKjQ6yVrEVdMie1djH86fm98eY3quQkQ==}
engines: {node: '>=12'}
cpu: [ia32]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-loong64/0.16.3:
resolution: {integrity: sha512-hIbeejCOyO0X9ujfIIOKjBjNAs9XD/YdJ9JXAy1lHA+8UXuOqbFe4ErMCqMr8dhlMGBuvcQYGF7+kO7waj2KHw==}
engines: {node: '>=12'}
@@ -1423,6 +1513,15 @@ packages:
dev: true
optional: true
/@esbuild/linux-loong64/0.17.6:
resolution: {integrity: sha512-y2NX1+X/Nt+izj9bLoiaYB9YXT/LoaQFYvCkVD77G/4F+/yuVXYCWz4SE9yr5CBMbOxOfBcy/xFL4LlOeNlzYQ==}
engines: {node: '>=12'}
cpu: [loong64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-mips64el/0.16.3:
resolution: {integrity: sha512-znFRzICT/V8VZQMt6rjb21MtAVJv/3dmKRMlohlShrbVXdBuOdDrGb+C2cZGQAR8RFyRe7HS6klmHq103WpmVw==}
engines: {node: '>=12'}
@@ -1432,6 +1531,15 @@ packages:
dev: true
optional: true
/@esbuild/linux-mips64el/0.17.6:
resolution: {integrity: sha512-09AXKB1HDOzXD+j3FdXCiL/MWmZP0Ex9eR8DLMBVcHorrWJxWmY8Nms2Nm41iRM64WVx7bA/JVHMv081iP2kUA==}
engines: {node: '>=12'}
cpu: [mips64el]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-ppc64/0.16.3:
resolution: {integrity: sha512-EV7LuEybxhXrVTDpbqWF2yehYRNz5e5p+u3oQUS2+ZFpknyi1NXxr8URk4ykR8Efm7iu04//4sBg249yNOwy5Q==}
engines: {node: '>=12'}
@@ -1441,6 +1549,15 @@ packages:
dev: true
optional: true
/@esbuild/linux-ppc64/0.17.6:
resolution: {integrity: sha512-AmLhMzkM8JuqTIOhxnX4ubh0XWJIznEynRnZAVdA2mMKE6FAfwT2TWKTwdqMG+qEaeyDPtfNoZRpJbD4ZBv0Tg==}
engines: {node: '>=12'}
cpu: [ppc64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-riscv64/0.16.3:
resolution: {integrity: sha512-uDxqFOcLzFIJ+r/pkTTSE9lsCEaV/Y6rMlQjUI9BkzASEChYL/aSQjZjchtEmdnVxDKETnUAmsaZ4pqK1eE5BQ==}
engines: {node: '>=12'}
@@ -1450,6 +1567,15 @@ packages:
dev: true
optional: true
/@esbuild/linux-riscv64/0.17.6:
resolution: {integrity: sha512-Y4Ri62PfavhLQhFbqucysHOmRamlTVK10zPWlqjNbj2XMea+BOs4w6ASKwQwAiqf9ZqcY9Ab7NOU4wIgpxwoSQ==}
engines: {node: '>=12'}
cpu: [riscv64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-s390x/0.16.3:
resolution: {integrity: sha512-NbeREhzSxYwFhnCAQOQZmajsPYtX71Ufej3IQ8W2Gxskfz9DK58ENEju4SbpIj48VenktRASC52N5Fhyf/aliQ==}
engines: {node: '>=12'}
@@ -1459,6 +1585,15 @@ packages:
dev: true
optional: true
/@esbuild/linux-s390x/0.17.6:
resolution: {integrity: sha512-SPUiz4fDbnNEm3JSdUW8pBJ/vkop3M1YwZAVwvdwlFLoJwKEZ9L98l3tzeyMzq27CyepDQ3Qgoba44StgbiN5Q==}
engines: {node: '>=12'}
cpu: [s390x]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/linux-x64/0.16.3:
resolution: {integrity: sha512-SDiG0nCixYO9JgpehoKgScwic7vXXndfasjnD5DLbp1xltANzqZ425l7LSdHynt19UWOcDjG9wJJzSElsPvk0w==}
engines: {node: '>=12'}
@@ -1468,6 +1603,15 @@ packages:
dev: true
optional: true
/@esbuild/linux-x64/0.17.6:
resolution: {integrity: sha512-a3yHLmOodHrzuNgdpB7peFGPx1iJ2x6m+uDvhP2CKdr2CwOaqEFMeSqYAHU7hG+RjCq8r2NFujcd/YsEsFgTGw==}
engines: {node: '>=12'}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@esbuild/netbsd-x64/0.16.3:
resolution: {integrity: sha512-AzbsJqiHEq1I/tUvOfAzCY15h4/7Ivp3ff/o1GpP16n48JMNAtbW0qui2WCgoIZArEHD0SUQ95gvR0oSO7ZbdA==}
engines: {node: '>=12'}
@@ -1477,6 +1621,15 @@ packages:
dev: true
optional: true
/@esbuild/netbsd-x64/0.17.6:
resolution: {integrity: sha512-EanJqcU/4uZIBreTrnbnre2DXgXSa+Gjap7ifRfllpmyAU7YMvaXmljdArptTHmjrkkKm9BK6GH5D5Yo+p6y5A==}
engines: {node: '>=12'}
cpu: [x64]
os: [netbsd]
requiresBuild: true
dev: true
optional: true
/@esbuild/openbsd-x64/0.16.3:
resolution: {integrity: sha512-gSABi8qHl8k3Cbi/4toAzHiykuBuWLZs43JomTcXkjMZVkp0gj3gg9mO+9HJW/8GB5H89RX/V0QP4JGL7YEEVg==}
engines: {node: '>=12'}
@@ -1486,6 +1639,15 @@ packages:
dev: true
optional: true
/@esbuild/openbsd-x64/0.17.6:
resolution: {integrity: sha512-xaxeSunhQRsTNGFanoOkkLtnmMn5QbA0qBhNet/XLVsc+OVkpIWPHcr3zTW2gxVU5YOHFbIHR9ODuaUdNza2Vw==}
engines: {node: '>=12'}
cpu: [x64]
os: [openbsd]
requiresBuild: true
dev: true
optional: true
/@esbuild/sunos-x64/0.16.3:
resolution: {integrity: sha512-SF9Kch5Ete4reovvRO6yNjMxrvlfT0F0Flm+NPoUw5Z4Q3r1d23LFTgaLwm3Cp0iGbrU/MoUI+ZqwCv5XJijCw==}
engines: {node: '>=12'}
@@ -1495,6 +1657,15 @@ packages:
dev: true
optional: true
/@esbuild/sunos-x64/0.17.6:
resolution: {integrity: sha512-gnMnMPg5pfMkZvhHee21KbKdc6W3GR8/JuE0Da1kjwpK6oiFU3nqfHuVPgUX2rsOx9N2SadSQTIYV1CIjYG+xw==}
engines: {node: '>=12'}
cpu: [x64]
os: [sunos]
requiresBuild: true
dev: true
optional: true
/@esbuild/win32-arm64/0.16.3:
resolution: {integrity: sha512-u5aBonZIyGopAZyOnoPAA6fGsDeHByZ9CnEzyML9NqntK6D/xl5jteZUKm/p6nD09+v3pTM6TuUIqSPcChk5gg==}
engines: {node: '>=12'}
@@ -1504,6 +1675,15 @@ packages:
dev: true
optional: true
/@esbuild/win32-arm64/0.17.6:
resolution: {integrity: sha512-G95n7vP1UnGJPsVdKXllAJPtqjMvFYbN20e8RK8LVLhlTiSOH1sd7+Gt7rm70xiG+I5tM58nYgwWrLs6I1jHqg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@esbuild/win32-ia32/0.16.3:
resolution: {integrity: sha512-GlgVq1WpvOEhNioh74TKelwla9KDuAaLZrdxuuUgsP2vayxeLgVc+rbpIv0IYF4+tlIzq2vRhofV+KGLD+37EQ==}
engines: {node: '>=12'}
@@ -1513,6 +1693,15 @@ packages:
dev: true
optional: true
/@esbuild/win32-ia32/0.17.6:
resolution: {integrity: sha512-96yEFzLhq5bv9jJo5JhTs1gI+1cKQ83cUpyxHuGqXVwQtY5Eq54ZEsKs8veKtiKwlrNimtckHEkj4mRh4pPjsg==}
engines: {node: '>=12'}
cpu: [ia32]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@esbuild/win32-x64/0.16.3:
resolution: {integrity: sha512-5/JuTd8OWW8UzEtyf19fbrtMJENza+C9JoPIkvItgTBQ1FO2ZLvjbPO6Xs54vk0s5JB5QsfieUEshRQfu7ZHow==}
engines: {node: '>=12'}
@@ -1522,6 +1711,15 @@ packages:
dev: true
optional: true
/@esbuild/win32-x64/0.17.6:
resolution: {integrity: sha512-n6d8MOyUrNp6G4VSpRcgjs5xj4A91svJSaiwLIDWVWEsZtpN5FA9NlBbZHDmAJc2e8e6SF4tkBD3HAvPF+7igA==}
engines: {node: '>=12'}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@eslint/eslintrc/1.4.1:
resolution: {integrity: sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -1663,12 +1861,12 @@ packages:
tslib: 2.5.0
dev: true
/@remix-run/dev/1.14.3_@remix-run+serve@1.14.3:
resolution: {integrity: sha512-46mmwiA/k9YDkg0UrP90UB3azVVWRXw16NLHRSbZiaaYe8XgUkddEtBnH/nBp/IrVCtzUL3LObplUe5sFk5Z9Q==}
/@remix-run/dev/1.15.0_@remix-run+serve@1.15.0:
resolution: {integrity: sha512-BsE1GN6WM9PhN+agZi4TqUIuYzoHYZrufEdXLg3ZEYxWXqvtRKUNfhsYSDlEhrW+D5fyVQhJrs61wQ83sEXHLQ==}
engines: {node: '>=14'}
hasBin: true
peerDependencies:
'@remix-run/serve': ^1.14.3
'@remix-run/serve': ^1.15.0
peerDependenciesMeta:
'@remix-run/serve':
optional: true
@@ -1684,9 +1882,9 @@ packages:
'@babel/types': 7.20.7
'@esbuild-plugins/node-modules-polyfill': 0.1.4_esbuild@0.16.3
'@npmcli/package-json': 2.0.0
'@remix-run/serve': 1.14.3
'@remix-run/server-runtime': 1.14.3
'@vanilla-extract/integration': 6.1.0
'@remix-run/serve': 1.15.0
'@remix-run/server-runtime': 1.15.0
'@vanilla-extract/integration': 6.2.1
arg: 5.0.2
cacache: 15.3.0
chalk: 4.1.2
@@ -1699,6 +1897,7 @@ packages:
fast-glob: 3.2.11
fs-extra: 10.1.0
get-port: 5.1.1
glob-to-regexp: 0.4.1
gunzip-maybe: 1.4.2
inquirer: 8.2.5
jsesc: 3.0.2
@@ -1727,21 +1926,27 @@ packages:
ws: 7.5.9
xdm: 2.1.0
transitivePeerDependencies:
- '@types/node'
- bluebird
- bufferutil
- encoding
- less
- sass
- stylus
- sugarss
- supports-color
- terser
- ts-node
- utf-8-validate
dev: true
/@remix-run/eslint-config/1.14.3_km5ddj7uwb23cqeymeyvzjsfb4:
resolution: {integrity: sha512-Yy4PYSvAehj31LmkDA+lS5yCPL1lR9O04gMIo0xwHT2o59pF4QU54lEAvJJH+9MI0byZUI/v9DoGz1oGIb44IA==}
/@remix-run/eslint-config/1.15.0_km5ddj7uwb23cqeymeyvzjsfb4:
resolution: {integrity: sha512-nwCPK/4anLMDWJnBsrWL9Wfcy2eRDlKjGWZeYeozDpJnH9iG1vA5aow0OmcpblwgvAwcgSC8Gdb7P5uK4Xy5/Q==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^8.0.0
react: ^17.0.0 || ^18.0.0
typescript: ^4.0.0
typescript: ^4.0.0 || ^5.0.0
peerDependenciesMeta:
typescript:
optional: true
@@ -1771,20 +1976,20 @@ packages:
- supports-color
dev: true
/@remix-run/express/1.14.3_express@4.18.2:
resolution: {integrity: sha512-v3TT+zBFSnOiVTHNiLp5A783UVYyZYbePxmPhvoe9JwHCmzVDA9mfyxYgDl/8NPDtYS+dAPU7mQ+aE1M5MXc7g==}
/@remix-run/express/1.15.0_express@4.18.2:
resolution: {integrity: sha512-mvDZB03W6NqbtyVpeiJfmGQY1L7CX+KEfSIV/kNgyK+gAMAWhsioC/Vjlo4IFY3NvOD0rh9mxuC+/IPT6Al3uw==}
engines: {node: '>=14'}
peerDependencies:
express: ^4.17.1
dependencies:
'@remix-run/node': 1.14.3
'@remix-run/node': 1.15.0
express: 4.18.2
/@remix-run/node/1.14.3:
resolution: {integrity: sha512-Mq0wUtgJtGwMQEBr/8p9XpdPBm7N+lby5CEbW6IKV59UC9N3VMGY3snfrsphBCq3sNZfbhIpaDdu2W+8EoqfnQ==}
/@remix-run/node/1.15.0:
resolution: {integrity: sha512-CS0p8T6A2KvMoAW5zzLA/BtNNCsv34A5RJoouJvXK9/o6MriAQ/YSugg6ldS5mec49neSep+CGeL1RS6tL+3NQ==}
engines: {node: '>=14'}
dependencies:
'@remix-run/server-runtime': 1.14.3
'@remix-run/server-runtime': 1.15.0
'@remix-run/web-fetch': 4.3.2
'@remix-run/web-file': 3.0.2
'@remix-run/web-stream': 1.0.3
@@ -1794,41 +1999,41 @@ packages:
source-map-support: 0.5.21
stream-slice: 0.1.2
/@remix-run/react/1.14.3_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-dvwIx+9ZdE/9LHe8Rjos9gEOdQFLvC0dojCnKlsUIwfGhyjKE4wOHfqS9mZcmKFCvOFDakcZDallLNGaj0mEYg==}
/@remix-run/react/1.15.0_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-S0RuIeHvQTqryCZ3KVl8EsIWCqL6/ky1/kmDpN2n5Pdjew2BLC6DX7OdrY1ZQjbzOMHAROsZlyaSSVXCItunag==}
engines: {node: '>=14'}
peerDependencies:
react: '>=16.8'
react-dom: '>=16.8'
dependencies:
'@remix-run/router': 1.3.3
'@remix-run/router': 1.5.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
react-router-dom: 6.8.2_biqbaboplfbrettd7655fr4n2y
react-router-dom: 6.10.0_biqbaboplfbrettd7655fr4n2y
use-sync-external-store: 1.2.0_react@18.2.0
dev: false
/@remix-run/router/1.3.3:
resolution: {integrity: sha512-YRHie1yQEj0kqqCTCJEfHqYSSNlZQ696QJG+MMiW4mxSl9I0ojz/eRhJS4fs88Z5i6D1SmoF9d3K99/QOhI8/w==}
/@remix-run/router/1.5.0:
resolution: {integrity: sha512-bkUDCp8o1MvFO+qxkODcbhSqRa6P2GXgrGZVpt0dCXNW2HCSCqYI0ZoAqEOSAjRWmmlKcYgFvN4B4S+zo/f8kg==}
engines: {node: '>=14'}
/@remix-run/serve/1.14.3:
resolution: {integrity: sha512-5So5+PtAaYZq3hc45snkCKIOh51Z45WvhHpRgB0ZsOuhUf6p9UAY9LQk7GRNvkcqL9LChE3LQ9O4gPqnUiZgpA==}
/@remix-run/serve/1.15.0:
resolution: {integrity: sha512-j06vKhxtLSR3JpkcoBMPb1EeM6QrbbuTdDh4m0eY/D4QgUzba4ws6r3OzEGc5FMe5xSULO0YVd2QWlyqBlMIWQ==}
engines: {node: '>=14'}
hasBin: true
dependencies:
'@remix-run/express': 1.14.3_express@4.18.2
'@remix-run/express': 1.15.0_express@4.18.2
compression: 1.7.4
express: 4.18.2
morgan: 1.10.0
transitivePeerDependencies:
- supports-color
/@remix-run/server-runtime/1.14.3:
resolution: {integrity: sha512-qh8sxfLj/XW1u6rluN7yIgbvMCoKrVacYGUiPM7g0VHk8h8MlZGAIUfsWM45Poxo3X0uLhNuqqxMaPWldKawIQ==}
/@remix-run/server-runtime/1.15.0:
resolution: {integrity: sha512-DL9xjHfYYrEcOq5VbhYtrjJUWo/nFQAT7Y+Np/oC55HokyU6cb2jGhl52nx96aAxKwaFCse5N90GeodFsRzX7w==}
engines: {node: '>=14'}
dependencies:
'@remix-run/router': 1.3.3
'@remix-run/router': 1.5.0
'@types/cookie': 0.4.1
'@types/react': 18.0.28
'@web3-storage/multipart-parser': 1.0.0
@@ -2172,16 +2377,16 @@ packages:
eslint-visitor-keys: 3.3.0
dev: true
/@vanilla-extract/babel-plugin-debug-ids/1.0.1:
resolution: {integrity: sha512-ynyKqsJiMzM1/yiIJ6QdqpWKlK4IMJJWREpPtaemZrE1xG1B4E/Nfa6YazuDWjDkCJC1tRIpEGnVs+pMIjUxyw==}
/@vanilla-extract/babel-plugin-debug-ids/1.0.2:
resolution: {integrity: sha512-LjnbQWGeMwaydmovx8jWUR8BxLtLiPyq0xz5C8G5OvFhsuJxvavLdrBHNNizvr1dq7/3qZGlPv0znsvU4P44YA==}
dependencies:
'@babel/core': 7.20.12
transitivePeerDependencies:
- supports-color
dev: true
/@vanilla-extract/css/1.9.5:
resolution: {integrity: sha512-aVSv6q24zelKRtWx/l9yshU3gD1uCDMZ2ZGcIiYnAcPfyLryrG/1X5DxtyiPKcyI/hZWoteHofsN//2q9MvzOA==}
/@vanilla-extract/css/1.11.0:
resolution: {integrity: sha512-uohj+8cGWbnrVzTfrjlJeXqdGjH3d3TcscdQxKe3h5bb5QQXTpPSq+c+SeWADIGiZybzcW0CBvZV8jsy1ywY9w==}
dependencies:
'@emotion/hash': 0.9.0
'@vanilla-extract/private': 1.0.3
@@ -2196,22 +2401,30 @@ packages:
outdent: 0.8.0
dev: true
/@vanilla-extract/integration/6.1.0:
resolution: {integrity: sha512-7gDkOibk/DraG35ZpiAYqWd33wLA6YRnieC5vw7ItoFEzCv9bUaS9c+ZyktyWW3nRnL+e7Pc6FS6l7MKgEsX1w==}
/@vanilla-extract/integration/6.2.1:
resolution: {integrity: sha512-+xYJz07G7TFAMZGrOqArOsURG+xcYvqctujEkANjw2McCBvGEK505RxQqOuNiA9Mi9hgGdNp2JedSa94f3eoLg==}
dependencies:
'@babel/core': 7.20.12
'@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.20.12
'@vanilla-extract/babel-plugin-debug-ids': 1.0.1
'@vanilla-extract/css': 1.9.5
esbuild: 0.16.3
'@vanilla-extract/babel-plugin-debug-ids': 1.0.2
'@vanilla-extract/css': 1.11.0
esbuild: 0.17.6
eval: 0.1.6
find-up: 5.0.0
javascript-stringify: 2.1.0
lodash: 4.17.21
mlly: 1.1.0
outdent: 0.8.0
vite: 4.2.1
vite-node: 0.28.5
transitivePeerDependencies:
- '@types/node'
- less
- sass
- stylus
- sugarss
- supports-color
- terser
dev: true
/@vanilla-extract/private/1.0.3:
@@ -2226,16 +2439,16 @@ packages:
react: 18.2.0
dev: false
/@vercel/remix/1.14.3-patch.1_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-TBI/FS77HYZqjbgeABi7Rbg7RVQ1YLHcXm4/zroV4zl0nVbcXM2jVR3SXm0EuQKze+NZ0p3VBUz4I/xocTvq0w==}
/@vercel/remix/1.15.0_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-IS4K9u6M8oCc9VKxnS308+B0l+PHWxmBS6/o0aI2yBRQiG+yxxXn/UfPPvNDNJsfGsdcTmW/VR9dbN5EskY32g==}
engines: {node: '>=14'}
peerDependencies:
react: '*'
react-dom: '*'
dependencies:
'@remix-run/node': 1.14.3
'@remix-run/server-runtime': 1.14.3
isbot: 3.6.6
'@remix-run/node': 1.15.0
'@remix-run/server-runtime': 1.15.0
isbot: 3.6.7
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
dev: false
@@ -2596,6 +2809,11 @@ packages:
resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==}
engines: {node: '>= 0.8'}
/cac/6.7.14:
resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
engines: {node: '>=8'}
dev: true
/cacache/15.3.0:
resolution: {integrity: sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==}
engines: {node: '>= 10'}
@@ -3205,6 +3423,36 @@ packages:
'@esbuild/win32-x64': 0.16.3
dev: true
/esbuild/0.17.6:
resolution: {integrity: sha512-TKFRp9TxrJDdRWfSsSERKEovm6v30iHnrjlcGhLBOtReE28Yp1VSBRfO3GTaOFMoxsNerx4TjrhzSuma9ha83Q==}
engines: {node: '>=12'}
hasBin: true
requiresBuild: true
optionalDependencies:
'@esbuild/android-arm': 0.17.6
'@esbuild/android-arm64': 0.17.6
'@esbuild/android-x64': 0.17.6
'@esbuild/darwin-arm64': 0.17.6
'@esbuild/darwin-x64': 0.17.6
'@esbuild/freebsd-arm64': 0.17.6
'@esbuild/freebsd-x64': 0.17.6
'@esbuild/linux-arm': 0.17.6
'@esbuild/linux-arm64': 0.17.6
'@esbuild/linux-ia32': 0.17.6
'@esbuild/linux-loong64': 0.17.6
'@esbuild/linux-mips64el': 0.17.6
'@esbuild/linux-ppc64': 0.17.6
'@esbuild/linux-riscv64': 0.17.6
'@esbuild/linux-s390x': 0.17.6
'@esbuild/linux-x64': 0.17.6
'@esbuild/netbsd-x64': 0.17.6
'@esbuild/openbsd-x64': 0.17.6
'@esbuild/sunos-x64': 0.17.6
'@esbuild/win32-arm64': 0.17.6
'@esbuild/win32-ia32': 0.17.6
'@esbuild/win32-x64': 0.17.6
dev: true
/escalade/3.1.1:
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
engines: {node: '>=6'}
@@ -4018,6 +4266,10 @@ packages:
is-glob: 4.0.3
dev: true
/glob-to-regexp/0.4.1:
resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==}
dev: true
/glob/7.2.3:
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
dependencies:
@@ -4607,8 +4859,8 @@ packages:
resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==}
dev: true
/isbot/3.6.6:
resolution: {integrity: sha512-98aGl1Spbx1led422YFrusDJ4ZutSNOymb2avZ2V4BCCjF3MqAF2k+J2zoaLYahubaFkb+3UyvbVDVlk/Ngrew==}
/isbot/3.6.7:
resolution: {integrity: sha512-SXNUQaNZlj/+9jdrGnAp6WW0YoHe3MIwwc6oRIYuhhERBUt7/L6I7JkMiA2sX9fcvS7gZ2C7GWgmDZfOOU4I5g==}
engines: {node: '>=12'}
dev: false
@@ -6031,26 +6283,26 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/react-router-dom/6.8.2_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-N/oAF1Shd7g4tWy+75IIufCGsHBqT74tnzHQhbiUTYILYF0Blk65cg+HPZqwC+6SqEyx033nKqU7by38v3lBZg==}
/react-router-dom/6.10.0_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-E5dfxRPuXKJqzwSe/qGcqdwa18QiWC6f3H3cWXM24qj4N0/beCIf/CWTipop2xm7mR0RCS99NnaqPNjHtrAzCg==}
engines: {node: '>=14'}
peerDependencies:
react: '>=16.8'
react-dom: '>=16.8'
dependencies:
'@remix-run/router': 1.3.3
'@remix-run/router': 1.5.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
react-router: 6.8.2_react@18.2.0
react-router: 6.10.0_react@18.2.0
dev: false
/react-router/6.8.2_react@18.2.0:
resolution: {integrity: sha512-lF7S0UmXI5Pd8bmHvMdPKI4u4S5McxmHnzJhrYi9ZQ6wE+DA8JN5BzVC5EEBuduWWDaiJ8u6YhVOCmThBli+rw==}
/react-router/6.10.0_react@18.2.0:
resolution: {integrity: sha512-Nrg0BWpQqrC3ZFFkyewrflCud9dio9ME3ojHCF/WLsprJVzkq3q3UeEhMCAW1dobjeGbWgjNn/PVF6m46ANxXQ==}
engines: {node: '>=14'}
peerDependencies:
react: '>=16.8'
dependencies:
'@remix-run/router': 1.3.3
'@remix-run/router': 1.5.0
react: 18.2.0
dev: false
@@ -6282,6 +6534,14 @@ packages:
estree-walker: 0.6.1
dev: true
/rollup/3.20.2:
resolution: {integrity: sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg==}
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
hasBin: true
optionalDependencies:
fsevents: 2.3.2
dev: true
/run-async/2.4.1:
resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==}
engines: {node: '>=0.12.0'}
@@ -7008,6 +7268,62 @@ packages:
vfile-message: 3.1.4
dev: true
/vite-node/0.28.5:
resolution: {integrity: sha512-LmXb9saMGlrMZbXTvOveJKwMTBTNUH66c8rJnQ0ZPNX+myPEol64+szRzXtV5ORb0Hb/91yq+/D3oERoyAt6LA==}
engines: {node: '>=v14.16.0'}
hasBin: true
dependencies:
cac: 6.7.14
debug: 4.3.4
mlly: 1.1.0
pathe: 1.1.0
picocolors: 1.0.0
source-map: 0.6.1
source-map-support: 0.5.21
vite: 4.2.1
transitivePeerDependencies:
- '@types/node'
- less
- sass
- stylus
- sugarss
- supports-color
- terser
dev: true
/vite/4.2.1:
resolution: {integrity: sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
peerDependencies:
'@types/node': '>= 14'
less: '*'
sass: '*'
stylus: '*'
sugarss: '*'
terser: ^5.4.0
peerDependenciesMeta:
'@types/node':
optional: true
less:
optional: true
sass:
optional: true
stylus:
optional: true
sugarss:
optional: true
terser:
optional: true
dependencies:
esbuild: 0.17.6
postcss: 8.4.21
resolve: 1.22.1
rollup: 3.20.2
optionalDependencies:
fsevents: 2.3.2
dev: true
/vm2/3.9.14:
resolution: {integrity: sha512-HgvPHYHeQy8+QhzlFryvSteA4uQLBCOub02mgqdR+0bN/akRZ48TGB1v0aCv7ksyc0HXx16AZtMHKS38alc6TA==}
engines: {node: '>=6.0'}

View File

@@ -8,6 +8,7 @@
"lerna": "5.6.2"
},
"devDependencies": {
"@limegrass/eslint-plugin-import-alias": "1.0.6",
"@types/node": "14.18.33",
"@typescript-eslint/eslint-plugin": "5.21.0",
"@typescript-eslint/parser": "5.21.0",
@@ -23,7 +24,7 @@
"execa": "3.2.0",
"fs-extra": "11.1.0",
"husky": "7.0.4",
"jest": "28.0.2",
"jest": "29.5.0",
"json5": "2.1.1",
"lint-staged": "9.2.5",
"node-fetch": "2.6.7",
@@ -31,7 +32,7 @@
"prettier": "2.6.2",
"source-map-support": "0.5.12",
"ts-eager": "2.0.2",
"ts-jest": "28.0.5",
"ts-jest": "29.1.0",
"turbo": "1.8.5"
},
"scripts": {
@@ -70,83 +71,5 @@
"trailingComma": "es5",
"singleQuote": true,
"arrowParens": "avoid"
},
"eslintConfig": {
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"modules": true
},
"plugins": [
"jest"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": {
"node": true,
"jest": true,
"es6": true
},
"rules": {
"no-restricted-syntax": [
"warn",
"WithStatement",
{
"message": "substr() is deprecated, use slice() or substring() instead",
"selector": "MemberExpression > Identifier[name='substr']"
}
],
"no-dupe-keys": 2,
"require-atomic-updates": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unused-vars": 2,
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/no-var-requires": 0,
"jest/no-disabled-tests": 2,
"jest/no-focused-tests": 2
},
"overrides": [
{
"files": [
"packages/cli/**/*"
],
"rules": {
"lines-between-class-members": 0,
"no-async-promise-executor": 0,
"no-control-regex": 0,
"no-empty": 0,
"prefer-const": 0,
"prefer-destructuring": 0,
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/consistent-type-assertions": 0,
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-inferrable-types": 0
}
},
{
"files": [
"packages/client/**/*"
],
"rules": {
"prefer-const": 0,
"require-atomic-updates": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/no-explicit-any": 0
}
}
]
}
}

View File

@@ -0,0 +1,5 @@
@types
download
dist
test/dev/fixtures
src/util/dev/templates/*.ts

View File

@@ -0,0 +1,24 @@
{
"extends": ["../../.eslintrc.json"],
"plugins": ["@limegrass/import-alias"],
"rules": {
"@limegrass/import-alias/import-alias": [
"warn",
{
"aliasConfigPath": "./packages/cli/tsconfig.json"
}
],
"lines-between-class-members": 0,
"no-async-promise-executor": 0,
"no-control-regex": 0,
"no-empty": 0,
"prefer-const": 0,
"prefer-destructuring": 0,
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/consistent-type-assertions": 0,
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-inferrable-types": 0
}
}

View File

@@ -0,0 +1,14 @@
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
globals: {
'ts-jest': {
diagnostics: false,
isolatedModules: true,
},
},
setupFilesAfterEnv: ['@alex_neo/jest-expect-message'],
verbose: false,
testEnvironment: 'node',
testMatch: ['<rootDir>/test/**/*.test.ts'],
};

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "28.18.4",
"version": "28.18.5",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -41,7 +41,7 @@
"@vercel/redwood": "1.1.14",
"@vercel/remix-builder": "1.8.4",
"@vercel/ruby": "1.3.75",
"@vercel/static-build": "1.3.22"
"@vercel/static-build": "1.3.23"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",
@@ -89,7 +89,7 @@
"@vercel/client": "12.4.9",
"@vercel/error-utils": "1.0.9",
"@vercel/frameworks": "1.3.4",
"@vercel/fs-detectors": "3.8.9",
"@vercel/fs-detectors": "3.8.10",
"@vercel/fun": "1.0.4",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.2.0",
@@ -168,22 +168,5 @@
"write-json-file": "2.2.0",
"xdg-app-paths": "5.1.0",
"yauzl-promise": "2.1.3"
},
"jest": {
"preset": "ts-jest",
"globals": {
"ts-jest": {
"diagnostics": false,
"isolatedModules": true
}
},
"setupFilesAfterEnv": [
"@alex_neo/jest-expect-message"
],
"verbose": false,
"testEnvironment": "node",
"testMatch": [
"<rootDir>/test/**/*.test.ts"
]
}
}

View File

@@ -178,6 +178,7 @@ export default async function connect(
gitOrg,
repo,
});
if (typeof checkAndConnect === 'number') {
return checkAndConnect;
}

View File

@@ -18,41 +18,41 @@ import sourceMap from '@zeit/source-map-support';
import { mkdirp } from 'fs-extra';
import chalk from 'chalk';
import epipebomb from 'epipebomb';
import getLatestVersion from './util/get-latest-version';
import getLatestVersion from '~/util/get-latest-version';
import { URL } from 'url';
import * as Sentry from '@sentry/node';
import hp from './util/humanize-path';
import commands from './commands';
import pkg from './util/pkg';
import { Output } from './util/output';
import cmd from './util/output/cmd';
import info from './util/output/info';
import error from './util/output/error';
import param from './util/output/param';
import highlight from './util/output/highlight';
import getArgs from './util/get-args';
import getUser from './util/get-user';
import getTeams from './util/teams/get-teams';
import Client from './util/client';
import { handleError } from './util/error';
import reportError from './util/report-error';
import getConfig from './util/get-config';
import * as configFiles from './util/config/files';
import getGlobalPathConfig from './util/config/global-path';
import hp from '~/util/humanize-path';
import commands from '~/commands';
import pkg from '~/util/pkg';
import { Output } from '~/util/output';
import cmd from '~/util/output/cmd';
import info from '~/util/output/info';
import error from '~/util/output/error';
import param from '~/util/output/param';
import highlight from '~/util/output/highlight';
import getArgs from '~/util/get-args';
import getUser from '~/util/get-user';
import getTeams from '~/util/teams/get-teams';
import Client from '~/util/client';
import { handleError } from '~/util/error';
import reportError from '~/util/report-error';
import getConfig from '~/util/get-config';
import * as configFiles from '~/util/config/files';
import getGlobalPathConfig from '~/util/config/global-path';
import {
defaultAuthConfig,
defaultGlobalConfig,
} from './util/config/get-default';
import * as ERRORS from './util/errors-ts';
import { APIError } from './util/errors-ts';
import { SENTRY_DSN } from './util/constants';
import getUpdateCommand from './util/get-update-command';
import { metrics, shouldCollectMetrics } from './util/metrics';
import { getCommandName, getTitleName } from './util/pkg-name';
import doLoginPrompt from './util/login/prompt';
} from '~/util/config/get-default';
import * as ERRORS from '~/util/errors-ts';
import { APIError } from '~/util/errors-ts';
import { SENTRY_DSN } from '~/util/constants';
import getUpdateCommand from '~/util/get-update-command';
import { metrics, shouldCollectMetrics } from '~/util/metrics';
import { getCommandName, getTitleName } from '~/util/pkg-name';
import doLoginPrompt from '~/util/login/prompt';
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
import { VercelConfig } from '@vercel/client';
import box from './util/output/box';
import box from '~/util/output/box';
const isCanary = pkg.version.includes('canary');
@@ -483,76 +483,76 @@ const main = async () => {
let func: any;
switch (targetCommand) {
case 'alias':
func = require('./commands/alias').default;
func = require('~/commands/alias').default;
break;
case 'bisect':
func = require('./commands/bisect').default;
func = require('~/commands/bisect').default;
break;
case 'build':
func = require('./commands/build').default;
func = require('~/commands/build').default;
break;
case 'certs':
func = require('./commands/certs').default;
func = require('~/commands/certs').default;
break;
case 'deploy':
func = require('./commands/deploy').default;
func = require('~/commands/deploy').default;
break;
case 'dev':
func = require('./commands/dev').default;
func = require('~/commands/dev').default;
break;
case 'dns':
func = require('./commands/dns').default;
func = require('~/commands/dns').default;
break;
case 'domains':
func = require('./commands/domains').default;
func = require('~/commands/domains').default;
break;
case 'env':
func = require('./commands/env').default;
func = require('~/commands/env').default;
break;
case 'git':
func = require('./commands/git').default;
func = require('~/commands/git').default;
break;
case 'init':
func = require('./commands/init').default;
func = require('~/commands/init').default;
break;
case 'inspect':
func = require('./commands/inspect').default;
func = require('~/commands/inspect').default;
break;
case 'link':
func = require('./commands/link').default;
func = require('~/commands/link').default;
break;
case 'list':
func = require('./commands/list').default;
func = require('~/commands/list').default;
break;
case 'logs':
func = require('./commands/logs').default;
func = require('~/commands/logs').default;
break;
case 'login':
func = require('./commands/login').default;
func = require('~/commands/login').default;
break;
case 'logout':
func = require('./commands/logout').default;
func = require('~/commands/logout').default;
break;
case 'project':
func = require('./commands/project').default;
func = require('~/commands/project').default;
break;
case 'pull':
func = require('./commands/pull').default;
func = require('~/commands/pull').default;
break;
case 'remove':
func = require('./commands/remove').default;
func = require('~/commands/remove').default;
break;
case 'rollback':
func = require('./commands/rollback').default;
func = require('~/commands/rollback').default;
break;
case 'secrets':
func = require('./commands/secrets').default;
func = require('~/commands/secrets').default;
break;
case 'teams':
func = require('./commands/teams').default;
func = require('~/commands/teams').default;
break;
case 'whoami':
func = require('./commands/whoami').default;
func = require('~/commands/whoami').default;
break;
default:
func = null;

View File

@@ -5,13 +5,13 @@ import { URL } from 'url';
import { VercelConfig } from '@vercel/client';
import retry, { RetryFunction, Options as RetryOptions } from 'async-retry';
import fetch, { BodyInit, Headers, RequestInit, Response } from 'node-fetch';
import ua from './ua';
import { Output } from './output/create-output';
import responseError from './response-error';
import printIndications from './print-indications';
import reauthenticate from './login/reauthenticate';
import { SAMLError } from './login/types';
import { writeToAuthConfigFile } from './config/files';
import ua from '~/util/ua';
import { Output } from '~/util/output/create-output';
import responseError from '~/util/response-error';
import printIndications from '~/util/print-indications';
import reauthenticate from '~/util/login/reauthenticate';
import { SAMLError } from '~/util/login/types';
import { writeToAuthConfigFile } from '~/util/config/files';
import type {
AuthConfig,
GlobalConfig,
@@ -20,8 +20,8 @@ import type {
ReadableTTY,
WritableTTY,
} from '@vercel-internals/types';
import { sharedPromise } from './promise';
import { APIError } from './errors-ts';
import { sharedPromise } from '~/util/promise';
import { APIError } from '~/util/errors-ts';
import { normalizeError } from '@vercel/error-utils';
const isSAMLError = (v: any): v is SAMLError => {

View File

@@ -1,10 +1,11 @@
import { URL } from 'url';
import Client from '../client';
import { Org } from '@vercel-internals/types';
import chalk from 'chalk';
import link from '../output/link';
import { isAPIError } from '../errors-ts';
import { Output } from '../output';
import { Dictionary } from '@vercel/client';
import type { Org } from '@vercel-internals/types';
export interface RepoInfo {
url: string;
@@ -86,40 +87,39 @@ export function formatProvider(type: string): string {
}
}
export function parseRepoUrl(originUrl: string): RepoInfo | null {
const isSSH = originUrl.startsWith('git@');
// Matches all characters between (// or @) and (.com or .org)
// eslint-disable-next-line prefer-named-capture-group
const provider =
/(?<=(\/\/|@)).*(?=(\.com|\.org))/.exec(originUrl)?.[0] ||
originUrl.replace('www.', '').split('.')[0];
if (!provider) {
return null;
function getURL(input: string) {
let url: URL | null = null;
try {
url = new URL(input);
} catch {}
if (!url) {
// Probably an SSH url, so mangle it into a
// format that the URL constructor works with.
try {
url = new URL(`ssh://${input.replace(':', '/')}`);
} catch {}
}
let org;
let repo;
if (isSSH) {
org = originUrl.split(':')[1].split('/')[0];
repo = originUrl.split('/')[1]?.replace('.git', '');
} else {
// Assume https:// or git://
org = originUrl.replace('//', '').split('/')[1];
repo = originUrl.replace('//', '').split('/')[2]?.replace('.git', '');
}
if (!org || !repo) {
return null;
}
return {
url: originUrl,
provider,
org,
repo,
};
return url;
}
export function parseRepoUrl(originUrl: string): RepoInfo | null {
const url = getURL(originUrl);
if (!url) return null;
const hostParts = url.hostname.split('.');
if (hostParts.length < 2) return null;
const provider = hostParts[hostParts.length - 2];
const pathParts = url.pathname.split('/').filter(Boolean);
if (pathParts.length !== 2) return null;
const org = pathParts[0];
const repo = pathParts[1].replace(/\.git$/, '');
return { url: originUrl, provider, org, repo };
}
export function printRemoteUrls(
output: Output,
remoteUrls: Dictionary<string>

View File

@@ -0,0 +1,3 @@
module go-work-with-shared/api
go 1.20

View File

@@ -0,0 +1,12 @@
package handler
import (
"fmt"
"net/http"
"go-work-with-shared/mylib"
)
// Handler function
func Handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, mylib.Say("hello"))
}

View File

@@ -0,0 +1,6 @@
go 1.20
use (
./api/
./mylib/
)

View File

@@ -0,0 +1,3 @@
module go-work-with-shared/mylib
go 1.20

View File

@@ -0,0 +1,9 @@
package mylib
import (
"runtime"
)
func Say(text string) string {
return text + ":" + runtime.Version()
}

View File

@@ -182,6 +182,13 @@ test(
})
);
test(
'[vercel dev] Should support `*.go` API serverless functions with `go.work` and lib',
testFixtureStdio('go-work-with-shared', async (testPath: any) => {
await testPath(200, `/api`, 'hello:go1.20.2');
})
);
test(
'[vercel dev] Should set the `ts-node` "target" to match Node.js version',
testFixtureStdio('node-ts-node-target', async (testPath: any) => {

View File

@@ -98,10 +98,10 @@ describe('pull', () => {
const config = await fs.readJSON(path.join(cwd, '.vercel/project.json'));
expect(config).toMatchInlineSnapshot(`
Object {
{
"orgId": "team_dummy",
"projectId": "vercel-pull-next",
"settings": Object {
"settings": {
"createdAt": 1555413045188,
},
}

View File

@@ -67,44 +67,59 @@ describe('parseRepoUrl', () => {
const repoInfo = parseRepoUrl('https://github.com/borked');
expect(repoInfo).toBeNull();
});
it('should parse url with `.com` in the repo name', () => {
const repoInfo = parseRepoUrl('https://github.com/vercel/vercel.com.git');
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('github');
expect(repoInfo?.org).toEqual('vercel');
expect(repoInfo?.repo).toEqual('vercel.com');
});
it('should parse url with a period in the repo name', () => {
const repoInfo = parseRepoUrl('https://github.com/vercel/next.js');
expect(repoInfo).toBeDefined();
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('github');
expect(repoInfo?.org).toEqual('vercel');
expect(repoInfo?.repo).toEqual('next.js');
});
it('should parse url that ends with .git', () => {
const repoInfo = parseRepoUrl('https://github.com/vercel/next.js.git');
expect(repoInfo).toBeDefined();
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('github');
expect(repoInfo?.org).toEqual('vercel');
expect(repoInfo?.repo).toEqual('next.js');
});
it('should parse github https url', () => {
const repoInfo = parseRepoUrl('https://github.com/vercel/vercel.git');
expect(repoInfo).toBeDefined();
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('github');
expect(repoInfo?.org).toEqual('vercel');
expect(repoInfo?.repo).toEqual('vercel');
});
it('should parse github https url without the .git suffix', () => {
const repoInfo = parseRepoUrl('https://github.com/vercel/vercel');
expect(repoInfo).toBeDefined();
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('github');
expect(repoInfo?.org).toEqual('vercel');
expect(repoInfo?.repo).toEqual('vercel');
});
it('should parse github git url', () => {
const repoInfo = parseRepoUrl('git://github.com/vercel/vercel.git');
expect(repoInfo).toBeDefined();
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('github');
expect(repoInfo?.org).toEqual('vercel');
expect(repoInfo?.repo).toEqual('vercel');
});
it('should parse github git url with trailing slash', () => {
const repoInfo = parseRepoUrl('git://github.com/vercel/vercel.git/');
expect(repoInfo).toBeTruthy();
console.log(repoInfo);
expect(repoInfo?.provider).toEqual('github');
expect(repoInfo?.org).toEqual('vercel');
expect(repoInfo?.repo).toEqual('vercel');
});
it('should parse github ssh url', () => {
const repoInfo = parseRepoUrl('git@github.com:vercel/vercel.git');
expect(repoInfo).toBeDefined();
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('github');
expect(repoInfo?.org).toEqual('vercel');
expect(repoInfo?.repo).toEqual('vercel');
@@ -114,7 +129,7 @@ describe('parseRepoUrl', () => {
const repoInfo = parseRepoUrl(
'https://gitlab.com/gitlab-examples/knative-kotlin-app.git'
);
expect(repoInfo).toBeDefined();
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('gitlab');
expect(repoInfo?.org).toEqual('gitlab-examples');
expect(repoInfo?.repo).toEqual('knative-kotlin-app');
@@ -123,7 +138,7 @@ describe('parseRepoUrl', () => {
const repoInfo = parseRepoUrl(
'git@gitlab.com:gitlab-examples/knative-kotlin-app.git'
);
expect(repoInfo).toBeDefined();
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('gitlab');
expect(repoInfo?.org).toEqual('gitlab-examples');
expect(repoInfo?.repo).toEqual('knative-kotlin-app');
@@ -133,7 +148,7 @@ describe('parseRepoUrl', () => {
const repoInfo = parseRepoUrl(
'https://bitbucket.org/atlassianlabs/maven-project-example.git'
);
expect(repoInfo).toBeDefined();
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('bitbucket');
expect(repoInfo?.org).toEqual('atlassianlabs');
expect(repoInfo?.repo).toEqual('maven-project-example');
@@ -142,7 +157,7 @@ describe('parseRepoUrl', () => {
const repoInfo = parseRepoUrl(
'git@bitbucket.org:atlassianlabs/maven-project-example.git'
);
expect(repoInfo).toBeDefined();
expect(repoInfo).toBeTruthy();
expect(repoInfo?.provider).toEqual('bitbucket');
expect(repoInfo?.org).toEqual('atlassianlabs');
expect(repoInfo?.repo).toEqual('maven-project-example');

View File

@@ -1,5 +1,5 @@
import { basename, join } from 'path';
import { getVercelDirectory } from '../../../../src/util/projects/link';
import { getVercelDirectory } from '~/util/projects/link';
const fixture = (name: string) =>
join(__dirname, '../../../fixtures/unit', name);

View File

@@ -12,7 +12,11 @@
"resolveJsonModule": true,
"sourceMap": true,
"outDir": "./dist",
"typeRoots": ["./types", "./node_modules/@types"]
"typeRoots": ["./types", "./node_modules/@types"],
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
}
},
"include": ["./types", "src/**/*"],
"ts-node": {

View File

@@ -0,0 +1,7 @@
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
verbose: false,
setupFilesAfterEnv: ['<rootDir>/tests/setup/index.ts'],
};

View File

@@ -34,14 +34,6 @@
"@types/tar-fs": "1.16.1",
"typescript": "4.3.4"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"verbose": false,
"setupFilesAfterEnv": [
"<rootDir>/tests/setup/index.ts"
]
},
"dependencies": {
"@vercel/build-utils": "6.7.1",
"@vercel/routing-utils": "2.2.0",

View File

@@ -0,0 +1,14 @@
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
diagnostics: true,
isolatedModules: true,
},
],
},
};

View File

@@ -29,15 +29,5 @@
"typedoc-plugin-markdown": "3.13.4",
"typedoc-plugin-mdn-links": "2.0.0",
"typescript": "4.7.4"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"globals": {
"ts-jest": {
"diagnostics": true,
"isolatedModules": true
}
}
}
}

View File

@@ -18,8 +18,6 @@
"devDependencies": {
"@types/jest": "29.2.1",
"@types/node": "14.18.33",
"jest": "29.2.2",
"ts-jest": "29.0.3",
"typescript": "^4.8.4"
"typescript": "4.9.5"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/fs-detectors",
"version": "3.8.9",
"version": "3.8.10",
"description": "Vercel filesystem detectors",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",

View File

@@ -22,6 +22,18 @@ export class MissingBuildTarget extends Error {
}
}
function supportsRootCommand(turboSemVer: string | undefined) {
if (!turboSemVer) {
return false;
}
if (!semver.validRange(turboSemVer)) {
return false;
}
return !semver.intersects(turboSemVer, '<1.8.0');
}
type MonorepoDefaultSettings = {
buildCommand?: string | null;
installCommand?: string | null;
@@ -91,7 +103,7 @@ export async function getMonorepoDefaultSettings(
let buildCommand = null;
if (projectPath) {
if (turboSemVer && !semver.intersects(turboSemVer, '<1.8.0')) {
if (supportsRootCommand(turboSemVer)) {
buildCommand = `turbo run build`;
} else {
// We don't know for sure if the local `turbo` supports inference.

View File

@@ -0,0 +1,9 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"turbo": "latest"
}
}

View File

@@ -0,0 +1,5 @@
{
"name": "app-14",
"version": "0.0.1",
"main": "index.js"
}

View File

@@ -0,0 +1,2 @@
// TEST COMMENT TO VERIFY JSON5 SUPPORT
{ "pipeline": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] } } }

View File

@@ -31,6 +31,7 @@ describe('getMonorepoDefaultSettings', () => {
['turbo-package-config', 'turbo', false, 'app-13', false, false],
['turbo-npm', 'turbo', true, 'app-15', false, false],
['turbo-npm-root-proj', 'turbo', true, 'app-root-proj', true, false],
['turbo-latest', 'turbo', false, 'app-14', false, false],
['nx', 'nx', false, 'app-12', false, false],
['nx-package-config', 'nx', false, 'app-11', false, false],
['nx-project-and-package-config-1', 'nx', false, 'app-10', false, false],

View File

@@ -1,15 +1,8 @@
// this gets built separately, so import from "dist" instead of "src"
import { generateVercelBuildOutputAPI3Output } from './dist';
export const onPostBuild = async ({
pathPrefix,
store,
}: {
pathPrefix: string;
store: any;
}) => {
export const onPostBuild = async ({ store }: { store: any }) => {
await generateVercelBuildOutputAPI3Output({
pathPrefix,
// validated by `pluginOptionSchema`
gatsbyStoreState: store.getState(),
});

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/gatsby-plugin-vercel-builder",
"version": "1.2.7",
"version": "1.2.8",
"main": "dist/index.js",
"files": [
"dist",

View File

@@ -1,4 +1,3 @@
import url from 'url';
import { getTransformedRoutes } from '@vercel/routing-utils';
import { writeJson } from 'fs-extra';
import { validateGatsbyState } from './schemas';
@@ -10,7 +9,6 @@ import { createStaticDir } from './helpers/static';
import type { Config } from './types';
export interface GenerateVercelBuildOutputAPI3OutputOptions {
pathPrefix: string;
gatsbyStoreState: {
pages: Map<string, unknown>;
redirects: unknown;
@@ -20,7 +18,6 @@ export interface GenerateVercelBuildOutputAPI3OutputOptions {
}
export async function generateVercelBuildOutputAPI3Output({
pathPrefix: _pathPrefix,
gatsbyStoreState,
}: GenerateVercelBuildOutputAPI3OutputOptions) {
const state = {
@@ -33,11 +30,8 @@ export async function generateVercelBuildOutputAPI3Output({
if (validateGatsbyState.Check(state)) {
console.log('▲ Creating Vercel build output');
// `_pathPrefix` contains `assetPrefix` + `pathPrefix`,
// so strip off the `assetPrefix` portion
const pathPrefix = url.parse(_pathPrefix).pathname ?? '';
const { pages, redirects, functions, config: gatsbyConfig } = state;
const { pathPrefix = '' } = gatsbyConfig;
const ssrRoutes = pages
.map(p => p[1])

View File

@@ -38,6 +38,7 @@ const GatsbyConfigSchema = Type.Object({
trailingSlash: Type.Optional(
StringEnum(['always', 'never', 'ignore', 'legacy'])
),
pathPrefix: Type.Optional(Type.String()),
});
export type GatsbyConfig = Static<typeof GatsbyConfigSchema>;

View File

@@ -1,4 +1,5 @@
import type { Images } from '@vercel/build-utils';
export type Config = {
version: 3;
routes?: Route[];

View File

@@ -9,7 +9,7 @@ import {
remove,
symlink,
} from 'fs-extra';
import { join, delimiter, dirname } from 'path';
import { delimiter, dirname, join } from 'path';
import stringArgv from 'string-argv';
import { cloneEnv, debug } from '@vercel/build-utils';
import { pipeline } from 'stream';
@@ -22,7 +22,7 @@ import type { Env } from '@vercel/build-utils';
const streamPipeline = promisify(pipeline);
const versionMap = new Map([
['1.20', '1.20.1'],
['1.20', '1.20.2'],
['1.19', '1.19.6'],
['1.18', '1.18.10'],
['1.17', '1.17.13'],
@@ -36,17 +36,32 @@ const archMap = new Map([
['x86', '386'],
]);
const platformMap = new Map([['win32', 'windows']]);
export const cacheDir = join('.vercel', 'cache', 'golang');
export const localCacheDir = join('.vercel', 'cache', 'golang');
const GO_FLAGS = process.platform === 'win32' ? [] : ['-ldflags', '-s -w'];
const GO_MIN_VERSION = 13;
const getPlatform = (p: string) => platformMap.get(p) || p;
const getArch = (a: string) => archMap.get(a) || a;
/**
* Determines the URL to download the Golang SDK.
* @param version The desireed Go version
* @returns The Go download URL
*/
function getGoUrl(version: string) {
const { arch, platform } = process;
const goArch = getArch(arch);
const goPlatform = getPlatform(platform);
const ext = platform === 'win32' ? 'zip' : 'tar.gz';
const goPlatform = platformMap.get(platform) || platform;
let goArch = archMap.get(arch) || arch;
// Go 1.16 was the first version to support arm64, so if the version is older
// we need to download the amd64 version
if (
platform === 'darwin' &&
goArch === 'arm64' &&
parseInt(version.split('.')[1], 10) < 16
) {
goArch = 'amd64';
}
const filename = `go${version}.${goPlatform}-${goArch}.${ext}`;
return {
filename,
@@ -61,32 +76,91 @@ export const goGlobalCachePath = join(
export const OUT_EXTENSION = process.platform === 'win32' ? '.exe' : '';
export async function getAnalyzedEntrypoint(
workPath: string,
filePath: string,
modulePath: string
) {
const bin = join(__dirname, `analyze${OUT_EXTENSION}`);
const isAnalyzeExist = await pathExists(bin);
if (!isAnalyzeExist) {
debug(`Building analyze bin: ${bin}`);
const src = join(__dirname, 'util', 'analyze.go');
const go = await createGo({
modulePath,
workPath,
});
await go.build(src, bin);
}
debug(`Analyzing entrypoint ${filePath} with modulePath ${modulePath}`);
const args = [`-modpath=${modulePath}`, filePath];
const analyzed = await execa.stdout(bin, args);
debug(`Analyzed entrypoint ${analyzed}`);
return analyzed;
interface Analyzed {
functionName: string;
packageName: string;
watch?: boolean;
}
class GoWrapper {
/**
* Parses the AST of the specified entrypoint Go file.
* @param workPath The work path (e.g. `/path/to/project`)
* @param entrypoint The path to the entrypoint file (e.g.
* `/path/to/project/api/index.go`)
* @param modulePath The path to the directory containing the `go.mod` (e.g.
* `/path/to/project/api`)
* @returns The results from the AST parsing
*/
export async function getAnalyzedEntrypoint({
entrypoint,
modulePath,
workPath,
}: {
entrypoint: string;
modulePath?: string;
workPath: string;
}): Promise<Analyzed> {
const bin = join(__dirname, `analyze${OUT_EXTENSION}`);
let analyzed: string;
try {
// build the `analyze` binary if not found in the `dist` directory
const isAnalyzeExist = await pathExists(bin);
if (!isAnalyzeExist) {
debug(`Building analyze bin: ${bin}`);
const src = join(__dirname, 'util', 'analyze.go');
let go;
const createOpts = {
modulePath,
opts: { cwd: __dirname },
workPath,
};
try {
go = await createGo(createOpts);
} catch (err) {
// if the version in the `go.mod` is too old, then download the latest
if (
err instanceof GoError &&
err.code === 'ERR_UNSUPPORTED_GO_VERSION'
) {
delete createOpts.modulePath;
go = await createGo(createOpts);
} else {
throw err;
}
}
await go.build(src, bin);
}
} catch (err) {
console.error('Failed to build the Go AST analyzer');
throw err;
}
try {
debug(`Analyzing entrypoint ${entrypoint} with modulePath ${modulePath}`);
const args = [`-modpath=${modulePath}`, join(workPath, entrypoint)];
analyzed = await execa.stdout(bin, args);
} catch (err) {
console.error(`Failed to parse AST for "${entrypoint}"`);
throw err;
}
debug(`Analyzed entrypoint ${analyzed}`);
if (!analyzed) {
const err = new Error(
`Could not find an exported function in "${entrypoint}"
Learn more: https://vercel.com/docs/runtimes#official-runtimes/go
`
);
console.error(err.message);
throw err;
}
return JSON.parse(analyzed) as Analyzed;
}
export class GoWrapper {
private env: Env;
private opts: execa.Options;
@@ -101,10 +175,11 @@ class GoWrapper {
private execute(...args: string[]) {
const { opts, env } = this;
debug(
`Exec: go ${args
.map(a => (a.includes(' ') ? `"${a}"` : a))
.join(' ')} CWD=${opts.cwd}`
`Exec: go ${args.map(a => (a.includes(' ') ? `"${a}"` : a)).join(' ')}`
);
debug(` CWD=${opts.cwd}`);
debug(` GOROOT=${(env || opts.env).GOROOT}`);
debug(` GO_BUILD_FLAGS=${(env || opts.env).GO_BUILD_FLAGS}`);
return execa('go', args, { stdio: 'inherit', ...opts, env });
}
@@ -127,9 +202,8 @@ class GoWrapper {
debug(`Building optimized 'go' binary ${src} -> ${dest}`);
const sources = Array.isArray(src) ? src : [src];
const flags = process.env.GO_BUILD_FLAGS
? stringArgv(process.env.GO_BUILD_FLAGS)
: GO_FLAGS;
const envGoBuildFlags = (this.env || this.opts.env).GO_BUILD_FLAGS;
const flags = envGoBuildFlags ? stringArgv(envGoBuildFlags) : GO_FLAGS;
return this.execute('build', ...flags, '-o', dest, ...sources);
}
@@ -186,7 +260,7 @@ export async function createGo({
goGlobalCachePath,
`${goSelectedVersion}_${platform}_${process.arch}`
);
const goCacheDir = join(workPath, cacheDir);
const goCacheDir = join(workPath, localCacheDir);
if (goPreferredVersion) {
debug(`Preferred go version ${goPreferredVersion} (from go.mod)`);
@@ -234,7 +308,7 @@ export async function createGo({
debug(`Found go ${version} in ${label}, but version is unsupported`);
}
if (version === goSelectedVersion || short === goSelectedVersion) {
console.log(`Selected go ${version} (from ${label})`);
debug(`Selected go ${version} (from ${label})`);
await setGoEnv(goDir);
return new GoWrapper(env, opts);
@@ -339,6 +413,10 @@ function parseGoVersionString(goVersionOutput: string) {
};
}
class GoError extends Error {
code: string | undefined;
}
/**
* Attempts to parse the preferred Go version from the `go.mod` file.
*
@@ -359,6 +437,12 @@ async function parseGoModVersion(
const full = versionMap.get(`${major}.${minor}`);
if (major === 1 && minor >= GO_MIN_VERSION && full) {
version = full;
} else if (!isNaN(minor)) {
const err = new GoError(
`Unsupported Go version ${major}.${minor} in ${file}`
);
err.code = 'ERR_UNSUPPORTED_GO_VERSION';
throw err;
} else {
console.log(`Warning: Unknown Go version in ${file}`);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
diagnostics: true,
isolatedModules: true,
},
],
},
};

View File

@@ -17,16 +17,6 @@
"files": [
"dist"
],
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"globals": {
"ts-jest": {
"diagnostics": true,
"isolatedModules": true
}
}
},
"devDependencies": {
"@tootallnate/once": "1.1.2",
"@types/async-retry": "1.4.2",

View File

@@ -5,10 +5,10 @@
{ "src": "subdirectory/index.go", "use": "@vercel/go" }
],
"probes": [
{ "path": "/", "mustContain": "cow:go1.20.1:RANDOMNESS_PLACEHOLDER" },
{ "path": "/", "mustContain": "cow:go1.20.2:RANDOMNESS_PLACEHOLDER" },
{
"path": "/subdirectory",
"mustContain": "subcow:go1.20.1:RANDOMNESS_PLACEHOLDER"
"mustContain": "subcow:go1.20.2:RANDOMNESS_PLACEHOLDER"
}
]
}

View File

@@ -1,3 +1,3 @@
module go-example
go 1.12
go 1.20

View File

@@ -1,3 +1,3 @@
module sub-1
go 1.12
go 1.20

View File

@@ -1,3 +1,3 @@
module sub-2
go 1.12
go 1.20

View File

@@ -1,3 +1,3 @@
module other-folder
go 1.12
go 1.20

View File

@@ -0,0 +1,8 @@
{
"probes": [
{
"path": "/",
"mustContain": "version:go1.14.15:first:RANDOMNESS_PLACEHOLDER"
}
]
}

View File

@@ -1,11 +1,5 @@
{
"version": 2,
"builds": [{ "src": "index.go", "use": "@vercel/go" }],
"build": { "env": { "GO_BUILD_FLAGS": "-tags first -ldflags '-s -w'" } },
"probes": [
{
"path": "/",
"mustContain": "version:go1.14.15:first:RANDOMNESS_PLACEHOLDER"
}
]
"build": { "env": { "GO_BUILD_FLAGS": "-tags first -ldflags '-s -w'" } }
}

View File

@@ -2,4 +2,10 @@ module github.com/vercel/does-not-exist
go 1.13
require github.com/dhruvbird/go-cowsay v0.0.0-20131019225157-6fd7bd0281c0 // indirect
require (
github.com/dhruvbird/go-cowsay v0.0.0-20131019225157-6fd7bd0281c0 // indirect
github.com/vercel/does-not-exist/api v0.0.0-unpublished
)
replace github.com/vercel/does-not-exist/api => ./

View File

@@ -1,5 +1,4 @@
{
"version": 2,
"probes": [
{
"path": "/api/v1/routes/someroute",

View File

@@ -0,0 +1,3 @@
module go-work-with-shared/api
go 1.20

View File

@@ -0,0 +1,12 @@
package handler
import (
"fmt"
"net/http"
"go-work-with-shared/mylib"
)
// Handler function
func Handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, mylib.Say("hello"))
}

View File

@@ -0,0 +1,6 @@
go 1.20
use (
./api
./mylib
)

View File

@@ -0,0 +1,3 @@
module go-work-with-shared/mylib
go 1.20

View File

@@ -0,0 +1,9 @@
package mylib
import (
"runtime"
)
func Say(text string) string {
return text + ":" + runtime.Version()
}

View File

@@ -0,0 +1,8 @@
{
"probes": [
{
"path": "/api/index.go",
"mustContain": "hello:go1.20.2"
}
]
}

View File

@@ -0,0 +1,14 @@
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
diagnostics: true,
isolatedModules: true,
},
],
},
};

View File

@@ -21,16 +21,6 @@
"files": [
"dist"
],
"jest": {
"preset": "ts-jest/presets/default",
"testEnvironment": "node",
"globals": {
"ts-jest": {
"diagnostics": true,
"isolatedModules": true
}
}
},
"devDependencies": {
"@types/aws-lambda": "8.10.19",
"@types/buffer-crc32": "0.2.0",

View File

@@ -0,0 +1,14 @@
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
diagnostics: true,
isolatedModules: true,
},
],
},
};

View File

@@ -18,16 +18,6 @@
"files": [
"dist"
],
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"globals": {
"ts-jest": {
"diagnostics": true,
"isolatedModules": true
}
}
},
"dependencies": {
"@edge-runtime/vm": "2.0.0",
"@types/node": "14.18.33",

View File

@@ -5,6 +5,6 @@
"main": "index.js",
"devDependencies": {
"@vercel/node": "*",
"typescript": "3.5.3"
"typescript": "3.7.7"
}
}

View File

@@ -0,0 +1,17 @@
{
"probes": [
{
"path": "/",
"mustContain": "`",
"logMustContain": "Using TypeScript 3.7.7 (local user-provided)"
},
{
"path": "/functions/es5.ts",
"mustContain": "+"
},
{
"path": "/pricing/",
"mustContain": "trailing-redirect:RANDOMNESS_PLACEHOLDER"
}
]
}

View File

@@ -20,20 +20,5 @@
{
"handle": "filesystem"
}
],
"probes": [
{
"path": "/",
"mustContain": "`",
"logMustContain": "Using TypeScript 3.5.3 (local user-provided)"
},
{
"path": "/functions/es5.ts",
"mustContain": "+"
},
{
"path": "/pricing/",
"mustContain": "trailing-redirect:RANDOMNESS_PLACEHOLDER"
}
]
}

View File

@@ -17,7 +17,7 @@
"build": "node build",
"test": "jest --env node --verbose --runInBand --bail",
"test-unit": "pnpm test test/unit.test.ts",
"test-e2e": "pnpm test test/integration.test.ts"
"test-e2e": "pnpm test test/integration-*"
},
"devDependencies": {
"@types/execa": "^0.9.0",

View File

@@ -1,15 +1,12 @@
const fs = require('fs');
const path = require('path');
require('./integration-setup')(1);
// NOTE: The fixture `00-request-path` has special case handling for local dev support below
const assert = require('assert');
const fetch = require('node-fetch');
const execa = require('execa');
const { spawn } = require('child_process');
const {
testDeployment,
} = require('../../../test/lib/deployment/test-deployment.js');
jest.setTimeout(4 * 60 * 1000);
const path = require('path');
const fixturesPath = path.resolve(__dirname, 'fixtures');
@@ -70,35 +67,3 @@ it('should match the probes against Python dev servers', async () => {
process.kill(asgiServer.pid);
}
});
const testsThatFailToBuild = new Map([
['30-fail-build-invalid-pipfile', 'Unable to parse Pipfile.lock'],
[
'31-fail-build-invalid-python36',
'Python version "3.6" detected in Pipfile.lock is discontinued and must be upgraded.',
],
]);
// eslint-disable-next-line no-restricted-syntax
for (const fixture of fs.readdirSync(fixturesPath)) {
const errMsg = testsThatFailToBuild.get(fixture);
if (errMsg) {
// eslint-disable-next-line no-loop-func
it(`should fail to build ${fixture}`, async () => {
try {
await testDeployment(path.join(fixturesPath, fixture));
} catch (err) {
expect(err).toBeTruthy();
expect(err.deployment).toBeTruthy();
expect(err.deployment.errorMessage).toBe(errMsg);
}
});
continue; //eslint-disable-line
}
// eslint-disable-next-line no-loop-func
it(`should build ${fixture}`, async () => {
await expect(
testDeployment(path.join(fixturesPath, fixture))
).resolves.toBeDefined();
});
}

View File

@@ -0,0 +1 @@
require('./integration-setup')(2);

View File

@@ -0,0 +1,52 @@
const fs = require('fs');
const path = require('path');
const { intoChunks } = require('../../../utils/chunk-tests');
const {
testDeployment,
} = require('../../../test/lib/deployment/test-deployment.js');
jest.setTimeout(4 * 60 * 1000);
module.exports = function setupTests(groupIndex) {
const fixturesPath = path.resolve(__dirname, 'fixtures');
const testsThatFailToBuild = new Map([
['30-fail-build-invalid-pipfile', 'Unable to parse Pipfile.lock'],
[
'31-fail-build-invalid-python36',
'Python version "3.6" detected in Pipfile.lock is discontinued and must be upgraded.',
],
]);
const allFixtures = fs.readdirSync(fixturesPath);
let chunkedFixtures = allFixtures;
if (typeof groupIndex !== 'undefined') {
chunkedFixtures = intoChunks(1, 2, allFixtures)[groupIndex - 1];
console.log('testing group', groupIndex, chunkedFixtures);
}
// eslint-disable-next-line no-restricted-syntax
for (const fixture of chunkedFixtures) {
const errMsg = testsThatFailToBuild.get(fixture);
if (errMsg) {
// eslint-disable-next-line no-loop-func
it(`should fail to build ${fixture}`, async () => {
try {
await testDeployment(path.join(fixturesPath, fixture));
} catch (err) {
expect(err).toBeTruthy();
expect(err.deployment).toBeTruthy();
expect(err.deployment.errorMessage).toBe(errMsg);
}
});
continue; //eslint-disable-line
}
// eslint-disable-next-line no-loop-func
it(`should build ${fixture}`, async () => {
await expect(
testDeployment(path.join(fixturesPath, fixture))
).resolves.toBeDefined();
});
}
};

View File

@@ -0,0 +1,14 @@
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
diagnostics: true,
isolatedModules: true,
},
],
},
};

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/static-build",
"version": "1.3.22",
"version": "1.3.23",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/build-step",
@@ -18,19 +18,9 @@
"test-unit": "pnpm test test/build.test.ts test/gatsby.test.ts test/prepare-cache.test.ts",
"test-e2e": "pnpm test test/integration-*.test.js"
},
"jest": {
"preset": "ts-jest/presets/default",
"testEnvironment": "node",
"globals": {
"ts-jest": {
"diagnostics": true,
"isolatedModules": true
}
}
},
"dependencies": {
"@vercel/gatsby-plugin-vercel-analytics": "1.0.9",
"@vercel/gatsby-plugin-vercel-builder": "1.2.7"
"@vercel/gatsby-plugin-vercel-builder": "1.2.8"
},
"devDependencies": {
"@types/aws-lambda": "8.10.64",
@@ -44,7 +34,7 @@
"@types/semver": "7.3.13",
"@vercel/build-utils": "6.7.1",
"@vercel/frameworks": "1.3.4",
"@vercel/fs-detectors": "3.8.9",
"@vercel/fs-detectors": "3.8.10",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.2.0",
"@vercel/static-config": "2.0.15",

View File

@@ -65,7 +65,7 @@ describe('gatsby utilities', () => {
]);
expect(gatsbyConfig).toMatchInlineSnapshot(`
"// This file was generated by @vercel/static-build
module.exports = {\\"plugins\\":[\\"@vercel/gatsby-plugin-vercel-analytics\\"]}"
module.exports = {"plugins":["@vercel/gatsby-plugin-vercel-analytics"]}"
`);
});
@@ -84,7 +84,7 @@ describe('gatsby utilities', () => {
`);
expect(gatsbyConfig).toMatchInlineSnapshot(`
"// This file was generated by @vercel/static-build
module.exports = {\\"plugins\\":[\\"@vercel/gatsby-plugin-vercel-analytics\\"]}"
module.exports = {"plugins":["@vercel/gatsby-plugin-vercel-analytics"]}"
`);
});
@@ -131,7 +131,7 @@ describe('gatsby utilities', () => {
`);
expect(gatsbyConfig).toMatchInlineSnapshot(`
"// This file was generated by @vercel/static-build
const userConfig = require(\\"./gatsby-config.js.__vercel_builder_backup__.js\\");
const userConfig = require("./gatsby-config.js.__vercel_builder_backup__.js");
const preferDefault = m => (m && m.default) || m;
@@ -144,7 +144,7 @@ describe('gatsby utilities', () => {
vercelConfig.plugins = [];
}
for (const plugin of [\\"@vercel/gatsby-plugin-vercel-analytics\\"]) {
for (const plugin of ["@vercel/gatsby-plugin-vercel-analytics"]) {
const hasPlugin = vercelConfig.plugins.find(
(p) => p && (p === plugin || p.resolve === plugin)
);
@@ -205,8 +205,8 @@ describe('gatsby utilities', () => {
`);
expect(gatsbyConfig).toMatchInlineSnapshot(`
"// This file was generated by @vercel/static-build
import userConfig from \\"./gatsby-config.ts.__vercel_builder_backup__.ts\\";
import type { PluginRef } from \\"gatsby\\";
import userConfig from "./gatsby-config.ts.__vercel_builder_backup__.ts";
import type { PluginRef } from "gatsby";
const preferDefault = (m: any) => (m && m.default) || m;
@@ -219,7 +219,7 @@ describe('gatsby utilities', () => {
vercelConfig.plugins = [];
}
for (const plugin of [\\"@vercel/gatsby-plugin-vercel-analytics\\"]) {
for (const plugin of ["@vercel/gatsby-plugin-vercel-analytics"]) {
const hasPlugin = vercelConfig.plugins.find(
(p: PluginRef) =>
p && (p === plugin || p.resolve === plugin)
@@ -281,7 +281,7 @@ describe('gatsby utilities', () => {
`);
expect(gatsbyConfig).toMatchInlineSnapshot(`
"// This file was generated by @vercel/static-build
import userConfig from \\"./gatsby-config.mjs.__vercel_builder_backup__.mjs\\";
import userConfig from "./gatsby-config.mjs.__vercel_builder_backup__.mjs";
const preferDefault = (m) => (m && m.default) || m;
@@ -294,7 +294,7 @@ describe('gatsby utilities', () => {
vercelConfig.plugins = [];
}
for (const plugin of [\\"@vercel/gatsby-plugin-vercel-analytics\\"]) {
for (const plugin of ["@vercel/gatsby-plugin-vercel-analytics"]) {
const hasPlugin = vercelConfig.plugins.find(
(p) => p && (p === plugin || p.resolve === plugin)
);

View File

@@ -0,0 +1,16 @@
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
diagnostics: true,
isolatedModules: true,
},
],
},
verbose: false,
testMatch: ['<rootDir>/test/**/*.test.ts'],
};

View File

@@ -26,19 +26,5 @@
"@types/jest": "27.4.1",
"@types/node": "14.18.33",
"typescript": "4.3.4"
},
"jest": {
"preset": "ts-jest",
"globals": {
"ts-jest": {
"diagnostics": false,
"isolatedModules": true
}
},
"verbose": false,
"testEnvironment": "node",
"testMatch": [
"<rootDir>/test/**/*.test.ts"
]
}
}

View File

@@ -8,7 +8,7 @@ describe('getConfig()', () => {
const sourcePath = join(__dirname, 'fixtures/node.js');
const config = getConfig(project, sourcePath);
expect(config).toMatchInlineSnapshot(`
Object {
{
"memory": 1024,
"runtime": "nodejs",
}
@@ -25,7 +25,7 @@ describe('getConfig()', () => {
},
} as const);
expect(config).toMatchInlineSnapshot(`
Object {
{
"location": "https://example.com/page",
"runtime": "deno",
}

View File

@@ -55,7 +55,7 @@ describe('getConfig for swc', () => {
const ast = parseFixture('fixtures/node.js');
const config = getConfig(ast, BaseFunctionConfigSchema);
expect(config).toMatchInlineSnapshot(`
Object {
{
"memory": 1024,
"runtime": "nodejs",
}
@@ -71,7 +71,7 @@ describe('getConfig for swc', () => {
},
} as const);
expect(config).toMatchInlineSnapshot(`
Object {
{
"location": "https://example.com/page",
"runtime": "deno",
}

2533
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
output

View File

@@ -0,0 +1,3 @@
{
"maxTextSize": 1000000
}

View File

@@ -0,0 +1,12 @@
{
"private": true,
"name": "internal-dependency-trace",
"description": "A utility for generating a directed graph of local file dependencies.",
"main": "index.js",
"scripts": {
"generate": "node src/index.js && mmdc --input output/trace.mmd --output output/trace.svg --configFile mermaid-config.json"
},
"dependencies": {
"@mermaid-js/mermaid-cli": "10.0.2"
}
}

View File

@@ -0,0 +1,635 @@
lockfileVersion: 5.4
importers:
.:
specifiers:
'@mermaid-js/mermaid-cli': 10.0.2
dependencies:
'@mermaid-js/mermaid-cli': 10.0.2
packages:
/@babel/code-frame/7.21.4:
resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/highlight': 7.18.6
dev: false
/@babel/helper-validator-identifier/7.19.1:
resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==}
engines: {node: '>=6.9.0'}
dev: false
/@babel/highlight/7.18.6:
resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/helper-validator-identifier': 7.19.1
chalk: 2.4.2
js-tokens: 4.0.0
dev: false
/@mermaid-js/mermaid-cli/10.0.2:
resolution: {integrity: sha512-dz5ye9wWJjL3jtWtL6pYeKwo74CeCbn8SpvxKEH4Wuc0esDvSpxC+J/Wlsbd6BKvMzLN2J+5voy03kto0J7mOg==}
engines: {node: ^14.13 || >=16.0}
hasBin: true
dependencies:
chalk: 5.2.0
commander: 10.0.0
puppeteer: 19.8.5
transitivePeerDependencies:
- bufferutil
- encoding
- supports-color
- typescript
- utf-8-validate
dev: false
/@puppeteer/browsers/0.4.0:
resolution: {integrity: sha512-3iB5pWn9Sr55PKKwqFWSWjLsTKCOEhKNI+uV3BZesgXuA3IhsX8I3hW0HI+3ksMIPkh2mVYzKSpvgq3oicjG2Q==}
engines: {node: '>=14.1.0'}
hasBin: true
peerDependencies:
typescript: '>= 4.7.4'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
debug: 4.3.4
extract-zip: 2.0.1
https-proxy-agent: 5.0.1
progress: 2.0.3
proxy-from-env: 1.1.0
tar-fs: 2.1.1
unbzip2-stream: 1.4.3
yargs: 17.7.1
transitivePeerDependencies:
- supports-color
dev: false
/@types/node/18.15.11:
resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==}
dev: false
optional: true
/@types/yauzl/2.10.0:
resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==}
requiresBuild: true
dependencies:
'@types/node': 18.15.11
dev: false
optional: true
/agent-base/6.0.2:
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
engines: {node: '>= 6.0.0'}
dependencies:
debug: 4.3.4
transitivePeerDependencies:
- supports-color
dev: false
/ansi-regex/5.0.1:
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
engines: {node: '>=8'}
dev: false
/ansi-styles/3.2.1:
resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
engines: {node: '>=4'}
dependencies:
color-convert: 1.9.3
dev: false
/ansi-styles/4.3.0:
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
engines: {node: '>=8'}
dependencies:
color-convert: 2.0.1
dev: false
/argparse/2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
dev: false
/base64-js/1.5.1:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
dev: false
/bl/4.1.0:
resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
dependencies:
buffer: 5.7.1
inherits: 2.0.4
readable-stream: 3.6.2
dev: false
/buffer-crc32/0.2.13:
resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==}
dev: false
/buffer/5.7.1:
resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
dependencies:
base64-js: 1.5.1
ieee754: 1.2.1
dev: false
/callsites/3.1.0:
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
engines: {node: '>=6'}
dev: false
/chalk/2.4.2:
resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
engines: {node: '>=4'}
dependencies:
ansi-styles: 3.2.1
escape-string-regexp: 1.0.5
supports-color: 5.5.0
dev: false
/chalk/5.2.0:
resolution: {integrity: sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==}
engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
dev: false
/chownr/1.1.4:
resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}
dev: false
/chromium-bidi/0.4.6_7yd6ibrwer4fxzjxd6md3toxiy:
resolution: {integrity: sha512-TQOkWRaLI/IWvoP8XC+7jO4uHTIiAUiklXU1T0qszlUFEai9LgKXIBXy3pOS3EnQZ3bQtMbKUPkug0fTAEHCSw==}
peerDependencies:
devtools-protocol: '*'
dependencies:
devtools-protocol: 0.0.1107588
mitt: 3.0.0
dev: false
/cliui/8.0.1:
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
engines: {node: '>=12'}
dependencies:
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi: 7.0.0
dev: false
/color-convert/1.9.3:
resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
dependencies:
color-name: 1.1.3
dev: false
/color-convert/2.0.1:
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
engines: {node: '>=7.0.0'}
dependencies:
color-name: 1.1.4
dev: false
/color-name/1.1.3:
resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==}
dev: false
/color-name/1.1.4:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
dev: false
/commander/10.0.0:
resolution: {integrity: sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==}
engines: {node: '>=14'}
dev: false
/cosmiconfig/8.1.3:
resolution: {integrity: sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw==}
engines: {node: '>=14'}
dependencies:
import-fresh: 3.3.0
js-yaml: 4.1.0
parse-json: 5.2.0
path-type: 4.0.0
dev: false
/cross-fetch/3.1.5:
resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==}
dependencies:
node-fetch: 2.6.7
transitivePeerDependencies:
- encoding
dev: false
/debug/4.3.4:
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
ms: 2.1.2
dev: false
/devtools-protocol/0.0.1107588:
resolution: {integrity: sha512-yIR+pG9x65Xko7bErCUSQaDLrO/P1p3JUzEk7JCU4DowPcGHkTGUGQapcfcLc4qj0UaALwZ+cr0riFgiqpixcg==}
dev: false
/emoji-regex/8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
dev: false
/end-of-stream/1.4.4:
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
dependencies:
once: 1.4.0
dev: false
/error-ex/1.3.2:
resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
dependencies:
is-arrayish: 0.2.1
dev: false
/escalade/3.1.1:
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
engines: {node: '>=6'}
dev: false
/escape-string-regexp/1.0.5:
resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}
engines: {node: '>=0.8.0'}
dev: false
/extract-zip/2.0.1:
resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==}
engines: {node: '>= 10.17.0'}
hasBin: true
dependencies:
debug: 4.3.4
get-stream: 5.2.0
yauzl: 2.10.0
optionalDependencies:
'@types/yauzl': 2.10.0
transitivePeerDependencies:
- supports-color
dev: false
/fd-slicer/1.1.0:
resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==}
dependencies:
pend: 1.2.0
dev: false
/fs-constants/1.0.0:
resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
dev: false
/get-caller-file/2.0.5:
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
engines: {node: 6.* || 8.* || >= 10.*}
dev: false
/get-stream/5.2.0:
resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==}
engines: {node: '>=8'}
dependencies:
pump: 3.0.0
dev: false
/has-flag/3.0.0:
resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
engines: {node: '>=4'}
dev: false
/https-proxy-agent/5.0.1:
resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
engines: {node: '>= 6'}
dependencies:
agent-base: 6.0.2
debug: 4.3.4
transitivePeerDependencies:
- supports-color
dev: false
/ieee754/1.2.1:
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
dev: false
/import-fresh/3.3.0:
resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
engines: {node: '>=6'}
dependencies:
parent-module: 1.0.1
resolve-from: 4.0.0
dev: false
/inherits/2.0.4:
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
dev: false
/is-arrayish/0.2.1:
resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==}
dev: false
/is-fullwidth-code-point/3.0.0:
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
engines: {node: '>=8'}
dev: false
/js-tokens/4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
dev: false
/js-yaml/4.1.0:
resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
hasBin: true
dependencies:
argparse: 2.0.1
dev: false
/json-parse-even-better-errors/2.3.1:
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
dev: false
/lines-and-columns/1.2.4:
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
dev: false
/mitt/3.0.0:
resolution: {integrity: sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==}
dev: false
/mkdirp-classic/0.5.3:
resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}
dev: false
/ms/2.1.2:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
dev: false
/node-fetch/2.6.7:
resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}
engines: {node: 4.x || >=6.0.0}
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
encoding:
optional: true
dependencies:
whatwg-url: 5.0.0
dev: false
/once/1.4.0:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
dependencies:
wrappy: 1.0.2
dev: false
/parent-module/1.0.1:
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
engines: {node: '>=6'}
dependencies:
callsites: 3.1.0
dev: false
/parse-json/5.2.0:
resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
engines: {node: '>=8'}
dependencies:
'@babel/code-frame': 7.21.4
error-ex: 1.3.2
json-parse-even-better-errors: 2.3.1
lines-and-columns: 1.2.4
dev: false
/path-type/4.0.0:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
dev: false
/pend/1.2.0:
resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==}
dev: false
/progress/2.0.3:
resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
engines: {node: '>=0.4.0'}
dev: false
/proxy-from-env/1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
dev: false
/pump/3.0.0:
resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
dependencies:
end-of-stream: 1.4.4
once: 1.4.0
dev: false
/puppeteer-core/19.8.5:
resolution: {integrity: sha512-zoGhim/oBQbkND6h4Xz4X7l5DkWVH9wH7z0mVty5qa/c0P1Yad47t/npVtt2xS10BiQwzztWKx7Pa2nJ5yykdw==}
engines: {node: '>=14.14.0'}
peerDependencies:
typescript: '>= 4.7.4'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@puppeteer/browsers': 0.4.0
chromium-bidi: 0.4.6_7yd6ibrwer4fxzjxd6md3toxiy
cross-fetch: 3.1.5
debug: 4.3.4
devtools-protocol: 0.0.1107588
extract-zip: 2.0.1
https-proxy-agent: 5.0.1
proxy-from-env: 1.1.0
tar-fs: 2.1.1
unbzip2-stream: 1.4.3
ws: 8.13.0
transitivePeerDependencies:
- bufferutil
- encoding
- supports-color
- utf-8-validate
dev: false
/puppeteer/19.8.5:
resolution: {integrity: sha512-WSjouU7eux6cwBMEz4A7mDRVZWTQQTDXrb1R6AhKDdeEgpiBBkAzcAusPhILxiJOKj60rULZpWuCZ7HZIO6GTA==}
requiresBuild: true
dependencies:
'@puppeteer/browsers': 0.4.0
cosmiconfig: 8.1.3
https-proxy-agent: 5.0.1
progress: 2.0.3
proxy-from-env: 1.1.0
puppeteer-core: 19.8.5
transitivePeerDependencies:
- bufferutil
- encoding
- supports-color
- typescript
- utf-8-validate
dev: false
/readable-stream/3.6.2:
resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
engines: {node: '>= 6'}
dependencies:
inherits: 2.0.4
string_decoder: 1.3.0
util-deprecate: 1.0.2
dev: false
/require-directory/2.1.1:
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'}
dev: false
/resolve-from/4.0.0:
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'}
dev: false
/safe-buffer/5.2.1:
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
dev: false
/string-width/4.2.3:
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
engines: {node: '>=8'}
dependencies:
emoji-regex: 8.0.0
is-fullwidth-code-point: 3.0.0
strip-ansi: 6.0.1
dev: false
/string_decoder/1.3.0:
resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
dependencies:
safe-buffer: 5.2.1
dev: false
/strip-ansi/6.0.1:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'}
dependencies:
ansi-regex: 5.0.1
dev: false
/supports-color/5.5.0:
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
engines: {node: '>=4'}
dependencies:
has-flag: 3.0.0
dev: false
/tar-fs/2.1.1:
resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==}
dependencies:
chownr: 1.1.4
mkdirp-classic: 0.5.3
pump: 3.0.0
tar-stream: 2.2.0
dev: false
/tar-stream/2.2.0:
resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}
engines: {node: '>=6'}
dependencies:
bl: 4.1.0
end-of-stream: 1.4.4
fs-constants: 1.0.0
inherits: 2.0.4
readable-stream: 3.6.2
dev: false
/through/2.3.8:
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
dev: false
/tr46/0.0.3:
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
dev: false
/unbzip2-stream/1.4.3:
resolution: {integrity: sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==}
dependencies:
buffer: 5.7.1
through: 2.3.8
dev: false
/util-deprecate/1.0.2:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
dev: false
/webidl-conversions/3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
dev: false
/whatwg-url/5.0.0:
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
dependencies:
tr46: 0.0.3
webidl-conversions: 3.0.1
dev: false
/wrap-ansi/7.0.0:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
dependencies:
ansi-styles: 4.3.0
string-width: 4.2.3
strip-ansi: 6.0.1
dev: false
/wrappy/1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
dev: false
/ws/8.13.0:
resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: '>=5.0.2'
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
dev: false
/y18n/5.0.8:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
dev: false
/yargs-parser/21.1.1:
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
engines: {node: '>=12'}
dev: false
/yargs/17.7.1:
resolution: {integrity: sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==}
engines: {node: '>=12'}
dependencies:
cliui: 8.0.1
escalade: 3.1.1
get-caller-file: 2.0.5
require-directory: 2.1.1
string-width: 4.2.3
y18n: 5.0.8
yargs-parser: 21.1.1
dev: false
/yauzl/2.10.0:
resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==}
dependencies:
buffer-crc32: 0.2.13
fd-slicer: 1.1.0
dev: false

View File

@@ -0,0 +1 @@
# Empty so its treated as standalone from monorepo

View File

@@ -0,0 +1,8 @@
# Internal Dependency Trace
This script will generate a [Mermaid](https://mermaid.js.org/intro/) directed graph as an SVG image showing the dependency connections between files starting with the input file as an entrypoint.
1. Set input file in `src/index.js`
1. `pnpm i`
1. `pnpm generate`
1. Open `output/trace.svg` in a browser

View File

@@ -0,0 +1,35 @@
const { readFileSync } = require('fs');
const { createHash } = require('crypto');
const { stripRootDirectory } = require('./root-directory');
const hash = p => {
const h = createHash('sha1');
h.update(p);
return h.digest('hex');
};
const line = (p1, p2) =>
` ${hash(p1)}(${stripRootDirectory(p1)}) --> ${hash(p2)}(${stripRootDirectory(
p2
)})\n`;
function generateMermaidOutput(filePath, traceDataPath) {
const traceData = JSON.parse(readFileSync(traceDataPath, 'utf-8'));
const visited = new Set();
let output = 'graph LR\n';
function _generateMermaidOutput(_filePath) {
if (!traceData[_filePath]) return;
if (visited.has(hash(_filePath))) return;
else visited.add(hash(_filePath));
for (const dependency of traceData[_filePath].dependsOn) {
output += line(_filePath, dependency);
_generateMermaidOutput(dependency);
}
}
_generateMermaidOutput(filePath);
return output;
}
module.exports = {
generateMermaidOutput,
};

View File

@@ -0,0 +1,22 @@
const { writeFileSync, rmSync } = require('fs');
const { join } = require('path');
const { trace } = require('./trace');
const { generateMermaidOutput } = require('./generate-mermaid-output');
const { rootDirectory } = require('./root-directory');
const { mkdirSync } = require('fs');
const outputPath = join(__dirname, '..', 'output');
rmSync(outputPath, { recursive: true, force: true });
mkdirSync(outputPath);
const inputFile = 'packages/cli/src/index.ts';
const traceOutput = trace(join(rootDirectory, inputFile));
const traceOutputPath = join(outputPath, 'trace.json');
writeFileSync(traceOutputPath, JSON.stringify(traceOutput, null, 2));
const mermaid = generateMermaidOutput(inputFile, traceOutputPath);
const traceMermaidOutputPath = join(outputPath, 'trace.mmd');
writeFileSync(traceMermaidOutputPath, mermaid);

View File

@@ -0,0 +1,9 @@
const { resolve } = require('path');
const rootDirectory = resolve(__dirname, '..', '..', '..');
function stripRootDirectory(filePath) {
return filePath.replace(`${rootDirectory}/`, '');
}
module.exports = {
rootDirectory,
stripRootDirectory,
};

View File

@@ -0,0 +1,58 @@
const path = require('path');
const fs = require('fs');
const { stripRootDirectory } = require('./root-directory');
const addExtension = filePath => {
if (filePath.endsWith('.json')) {
return filePath;
}
if (!filePath.endsWith('.ts')) {
try {
fs.statSync(filePath);
filePath += '/index.ts';
} catch (e) {
try {
fs.statSync(filePath + '.ts');
filePath += '.ts';
} catch (e2) {
fs.statSync(filePath + '.js');
filePath += '.js';
}
}
}
return filePath;
};
function trace(filePath) {
const files = {};
function _trace(_filePath) {
if (_filePath.endsWith('.json') || files[stripRootDirectory(_filePath)]) {
return;
}
const source = fs.readFileSync(_filePath, 'utf-8');
const matches = source.matchAll(/(require|from).+["'].*\n/g);
let localDepPaths = [...matches]
.map(a => a[0])
.map(b => /["'](\..*)["']/.exec(b))
.filter(c => c != null)
.map(d => addExtension(path.resolve(path.dirname(_filePath), d[1])));
// de-duplicate
localDepPaths = new Set(localDepPaths);
localDepPaths = [...localDepPaths];
files[stripRootDirectory(_filePath)] = {
dependsOn: localDepPaths.map(stripRootDirectory),
};
for (const localDepPath of localDepPaths) {
_trace(localDepPath);
}
}
_trace(filePath);
return files;
}
module.exports = { trace };

31
utils/chunk-tests.js vendored
View File

@@ -16,6 +16,28 @@ const runnersMap = new Map([
['test-dev', { min: 1, max: 5, runners: ['ubuntu-latest', 'macos-latest'] }],
]);
const packageOptionsOverrides = {
// 'some-package': { min: 1, max: 1 },
};
function getRunnerOptions(scriptName, packageName) {
let runnerOptions = runnersMap.get(scriptName);
if (packageOptionsOverrides[packageName]) {
runnerOptions = Object.assign(
{},
runnerOptions,
packageOptionsOverrides[packageName]
);
}
return (
runnerOptions || {
min: 1,
max: 1,
runners: ['ubuntu-latest'],
}
);
}
async function getChunkedTests() {
const scripts = [...runnersMap.keys()];
const rootPath = path.resolve(__dirname, '..');
@@ -67,11 +89,9 @@ async function getChunkedTests() {
([packagePathAndName, scriptNames]) => {
const [packagePath, packageName] = packagePathAndName.split(',');
return Object.entries(scriptNames).flatMap(([scriptName, testPaths]) => {
const {
runners = ['ubuntu-latest'],
min = 1,
max = 1,
} = runnersMap.get(scriptName) || {};
const runnerOptions = getRunnerOptions(scriptName, packageName);
const { runners, min, max } = runnerOptions;
const sortedTestPaths = testPaths.sort((a, b) => a.localeCompare(b));
return intoChunks(min, max, sortedTestPaths).flatMap(
(chunk, chunkNumber, allChunks) => {
@@ -163,6 +183,7 @@ async function main() {
}
}
// @ts-ignore
if (module === require.main || !module.parent) {
main();
}

8
utils/trigger-update-workflow.js vendored Normal file
View File

@@ -0,0 +1,8 @@
module.exports = async ({ github, context }) => {
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'api',
workflow_id: 'cron-update-build-container.yml',
ref: 'main',
});
};