Compare commits

...

101 Commits

Author SHA1 Message Date
Steven
48d925f105 Publish Stable
- @vercel/build-utils@6.3.3
 - vercel@28.16.14
 - @vercel/client@12.4.3
 - @vercel/fs-detectors@3.8.3
 - @vercel/gatsby-plugin-vercel-builder@1.2.0
 - @vercel/go@2.3.10
 - @vercel/hydrogen@0.0.56
 - @vercel/next@3.6.5
 - @vercel/node@2.9.11
 - @vercel/python@3.1.52
 - @vercel/redwood@1.1.8
 - @vercel/remix@1.6.1
 - @vercel/ruby@1.3.69
 - @vercel/static-build@1.3.15
2023-03-07 13:17:14 -05:00
Steven
011f6ff150 Revert "[next] Fix incorrect 404 when i18n and appDir configured" (#9617)
Reverts vercel/vercel#9582

https://github.com/orgs/vercel/discussions/1714
2023-03-07 13:15:28 -05:00
Sean Massa
cd09a38c19 [tests] skip recent flakey tests (#9613)
This test has been flakey on mac for a long time.
2023-03-07 17:21:53 +00:00
Ethan Arrowood
af239b5fa5 [internals] Create @vercel-internals/types (#9608)
Moves the type file out of the cli package and into its own standalone
package. utilizes `@vercel/style-guide` too for typescript config,
eslint, and prettier.
2023-03-07 08:44:25 -07:00
Chris Barber
38244c8ed6 [next] Populate middlewareRawSrc using middleware originalSource (#9602)
Next.js will pass the original middleware matching routes through to the middleware manifest once https://github.com/vercel/next.js/pull/46753 lands. This PR will take those original values and put them in the middleware route `middlewareRawSrc` property.

NOTE: The tests will need to be updated once the Next.js version is updated in the fixtures.
2023-03-07 06:04:41 +00:00
Nathan Rajlich
57e8ec13cf [remix] Support optional static path segments (#9607)
Fixes https://github.com/orgs/vercel/discussions/1707.
2023-03-07 00:50:37 +00:00
Nathan Rajlich
2e8423e24e [gatsby] Remove "gatsby" dependency, use typebox instead of ajv for validation (#9606)
The "gatsby" dependency is large and relies on native packages ("sharp" specifically, which are error prone because it attempts to download a precompiled binary, of which the CDN has been down before causing us to not be able to merge anything).

The package is only used for TypeScript types, and we've decided that including the package only for those types is not worth the trouble. The existing JSON schemas already validate at runtime that the Gatsby redux store provides the values that we depend on.

`ajv` was ditched in favor of TypeBox types, which provide both JSON Schema and validation using a simpler syntax.
2023-03-06 21:44:23 +00:00
Sean Massa
a92c68e0ff Publish Stable
- vercel@28.16.13
 - @vercel/next@3.6.4
 - @vercel/remix@1.6.0
2023-03-06 13:47:36 -06:00
Vercel Release Bot
84f3a5bc1b [tests] Upgrade Turbo to version 1.8.3 (#9604)
This auto-generated PR updates Turbo to version 1.8.3
2023-03-06 16:26:41 +00:00
JJ Kasper
186bd9bb51 [next] Fix api prefixed app routes serverless streaming (#9603)
Fixes: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1677753703572609)
2023-03-04 01:50:54 +00:00
Nathan Rajlich
9ae84ba05f [remix] Add test for escaped route paths (#9516)
In Remix routes, you can [use bracket notation to escape the filesystem routing behavior](https://remix.run/docs/en/1.14.0/file-conventions/routes-files#escaping-special-characters). For example `app/routes/receipt[.]pdf.tsx` would be available at path `/receipt.pdf` (whereas, unescaped, it would be at `/receipt/pdf`).

This adds an e2e test for that behavior.
2023-03-03 21:33:12 +00:00
Jeemin Choi(최지민)
a638755e95 [cli] change patch-inquirer-legacy to patch-inquirer (#8919)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-03-03 14:27:11 -06:00
Nathan Rajlich
15eb018f84 [remix] Clean up dev symlink upon config error (#9595)
Move the try/catch block to immediately after the symlink call, so that if reading the `remix.config.js` file throws an error or if there's an error parsing the `export const config` in a route, the catch block will clean up after itself properly.

I recommend reviewing with [whitespace changes hidden](https://github.com/vercel/vercel/pull/9595/files?w=1).
2023-03-03 20:02:27 +00:00
Ethan Arrowood
7f89aca52c [tests] Add more remix tests (#9600)
Adds some more tests to the remix project. 

- 05-root-only : tests a remix app with only a `root.jsx` route.
  - https://kentcdodds.com/blog/super-simple-start-to-remix
- 06-v2-routing : tests the remix v2 routing works
2023-03-03 18:18:14 +00:00
Nathan Rajlich
dc9ec1bc6d [remix] Return framework.version in build result (#9596) 2023-03-03 04:29:55 +00:00
Nathan Rajlich
df93b01248 [examples] Run prettier on Remix template (#9594) 2023-03-03 01:58:15 +00:00
Nathan Rajlich
fb37ad22ab [remix] Fix support for optional path params (#9590)
Changes the way that routes with optional params are stored on Vercel to not use `?` in the name, because it's not possible to have a route destination with a `?` that's pointing to a function.

So instead of the function with a name such as `:lang?`, it will be stored on Vercel with a name like `(:lang)`, which can be routed to.
2023-03-02 23:28:26 +00:00
Vercel Release Bot
684f69bc5b [remix] Upgrade @remix-run/dev to version 1.14.0 (#9593)
This auto-generated PR updates @remix-run/dev to version 1.14.0
2023-03-02 20:57:25 +00:00
Ethan Arrowood
ddae78458d Fix remix updater workflow when fetching latest version (#9592) 2023-03-02 11:54:29 -08:00
Nathan Rajlich
fc614a7a92 Publish Stable
- vercel@28.16.12
 - @vercel/remix@1.5.1
2023-03-02 09:00:40 -08:00
Nathan Rajlich
6e4ea0774e [remix] Make symlink logic of @remix-run/dev work in monorepos (#9591)
Utilize `require.resolve()` to determine the correct location of
`@remix-run/dev`, instead of assuming it's in
"node_modules/@remix-run/dev" relative to the project work path.

Fixes https://github.com/orgs/vercel/discussions/1671.

Manually tested with yarn and pnpm on this template:
https://github.com/remix-run/examples/tree/main/turborepo-vercel
2023-03-02 08:58:00 -08:00
Nathan Rajlich
cfc1c9e818 Publish Stable
- vercel@28.16.11
 - @vercel/next@3.6.3
 - @vercel/remix@1.5.0
2023-03-01 17:24:34 -08:00
Vercel Release Bot
62a872fc0e [remix] Upgrade @remix-run/dev to version 1.13.0-patch.2 (#9589)
This auto-generated PR updates @remix-run/dev to version 1.13.0-patch.2
2023-03-02 00:10:12 +00:00
Vercel Release Bot
03b5bfbaa2 [examples] Upgrade Next.js to version 13.2.3 (#9586)
This auto-generated PR updates Next.js to version 13.2.3
2023-03-01 23:34:51 +00:00
Nathan Rajlich
aa305e5c66 [remix] Add better error message when server build directory is missing (#9584)
Show a more helpful message instead of showing a cryptic error messsage:

> Error: ENOENT: no such file or directory, copyfile
'/var/task/node_modules/@vercel/remix/server-node.mjs' ->
'/vercel/path0/packages/web/build/server-node.mjs'

This is probably due to a bad user configuration (i.e. with Turbo), but
tell them to contact support anyways in case there is a different cause
that we would need to address.
2023-03-01 15:08:44 -08:00
Ethan Arrowood
2309c43fce add vercel/remix-run-dev updater workflow (#9588)
Adds a github workflow and javascript updater script that will update
the `@remix-run/dev` version to the latest release of
`@vercel/remix-run-dev`
2023-03-01 13:50:23 -08:00
Nathan Rajlich
0bbb06daa7 [remix] Support "regions", "memory" and "maxDuration" in static config (#9442)
Apply the `regions` configuration (for both Edge and Node) and `memory`/`maxDuration` (only for Node) in a page's static config export, i.e.

```js
export const config = { runtime: 'edge', regions: ['iad1'] }

// or for Node
export const config = { runtime: 'nodejs', regions: ['iad1'], maxDuration: 5, memory: 3008 }
```

Similar to `runtime`, these config values can be inherited from a parent layout route to apply to all sub-routes. Routes with common config settings get placed into a common server bundle, meaning that there may now be more than 2 functions created (previously was one Edge, one Node), allowing for more granularity between the server build bundles.
2023-03-01 21:45:10 +00:00
Nathan Rajlich
61de63d285 [remix] Split Edge and Node server builds using serverBundles config (#9504)
Utilize the [`serverBundles`](https://github.com/remix-run/remix/pull/5479) config option to generate two server bundle builds. One contains only the routes that should run in Node.js, and the other contains only the routes that should run in the Edge runtime. In the future we could update this configuration to generate more than two bundles to be more granular and allow for infinite scalability.

Because the `serverBundles` PR is not yet merged, this PR introduces usage of a forked version of `@remix-run/dev` which incorporates our changes. Hopefully usage of a fork is temporary, but it gets us unblocked for now.
2023-03-01 03:10:42 +00:00
Steven
1ca3704297 [next] Fix incorrect 404 when i18n and appDir configured (#9582)
Fix incorrect 404 when visiting the `/` route with `i18n` and `appDir` configured
2023-03-01 02:02:55 +00:00
Nathan Rajlich
ae4180b287 [tests] Use probes.json instead of vercel.json for e2e tests (#9556)
Makes it easier to test fixtures directly via CLI deployments.

Coincidentally, this also revealed that auto-detection of Remix apps wasn't working correctly if there's a `remix.config.mjs` file. So `@vercel/frameworks` is updated to account for that case as well.
2023-03-01 01:02:43 +00:00
Steven
40081cb319 Publish Stable
- vercel@28.16.10
 - @vercel/remix@1.4.3
2023-02-28 19:12:33 -05:00
Steven
9200be61d2 [tests] Publish with npm@9 (#9583)
https://vercel.slack.com/archives/C04DUD7EB1B/p1676488464681929
2023-03-01 00:09:40 +00:00
Nathan Rajlich
1390f6d2ee [remix] Gracefully handle symlink creation when updating Remix packages (#9569)
Fixes an edge-case error when changing the version of Remix and then making a deployment to Vercel when there is already an existing build cache:

> Error: EEXIST: file already exists, symlink '../.pnpm/@remix-run+server-runtime@1.5.0_biqbaboplfbrettd7655fr4n2y/node_modules/@remix-run/server-runtime' -> '/vercel/path0/node_modules/@remix-run/server-runtime'

This would happen because the symlink was created in a previous run, but no longer points to a valid path because it's a different version. To fix we'll delete the previous symlink when the target value does not match.
2023-02-28 22:51:58 +00:00
Nathan Rajlich
b78cfc9ba5 [remix] Set framework property on Lambda / EdgeFunction (#9579) 2023-02-28 22:16:05 +00:00
Chris Barber
803a9363f9 Publish Stable
- vercel@28.16.9
 - @vercel/gatsby-plugin-vercel-analytics@1.0.8
 - @vercel/gatsby-plugin-vercel-builder@1.1.11
 - @vercel/node-bridge@3.1.14
 - @vercel/node@2.9.10
 - @vercel/static-build@1.3.14
2023-02-28 15:32:23 -06:00
Chris Barber
4a0a3b64a2 [node] Added middlewareRawSrc to BOA route config (#9435)
Blocked by https://github.com/vercel/vercel/pull/9564

The build output's route configuration contains a compiled `src` from the list of `matchers` in middleware config, however we need to also save the original inputs so that we can render something meaningful in the web UI. The new prop added to the route is called `middlewareRawSrc` of type `string[]`.

This PR depends on https://github.com/vercel/api/pull/17231.

Linear: https://linear.app/vercel/issue/VCCLI-411/display-uncompressed-edge-middleware-matcher-show-the-list-of-matches
2023-02-28 21:26:26 +00:00
Mehul Kar
347c2de3a2 [tests] Adopt Workspace Configurations from turbo@1.8 (#9573) 2023-02-28 20:49:28 +00:00
Ethan Arrowood
a05cc11719 [tests] Fix gatsby cron job script - git diff operation (#9577)
as titled
2023-02-28 13:13:57 -07:00
Ethan Arrowood
55b999ea9b [tests] add missing -w option for pnpm in gatsby cron job script (#9575)
as titled
2023-02-28 13:05:31 -07:00
Ethan Arrowood
8babc3694f [tests] Fix gatsby cron job (#9574)
Changes logic so its a single npm call instead of multiple
2023-02-28 11:59:58 -08:00
Ethan Arrowood
6dc0321216 [tests] add missing __dirname from gatsby cron job script (#9572)
as titled
2023-02-28 11:40:05 -08:00
Ethan Arrowood
3df8c05792 [tests] Add cron job to update gatsby fixtures (#9510)
PR to add a cron job and script that automatically updates gatsby
fixture versions.
2023-02-28 11:32:00 -08:00
Sean Massa
e0f8bc9820 Publish Stable
- @vercel/build-utils@6.3.2
 - vercel@28.16.8
 - @vercel/client@12.4.2
 - @vercel/edge@0.3.1
 - @vercel/frameworks@1.3.2
 - @vercel/fs-detectors@3.8.2
 - @vercel/gatsby-plugin-vercel-builder@1.1.10
 - @vercel/go@2.3.9
 - @vercel/hydrogen@0.0.55
 - @vercel/next@3.6.2
 - @vercel/node-bridge@3.1.13
 - @vercel/node@2.9.9
 - @vercel/python@3.1.51
 - @vercel/redwood@1.1.7
 - @vercel/remix@1.4.2
 - @vercel/routing-utils@2.1.10
 - @vercel/ruby@1.3.68
 - @vercel/static-build@1.3.13
2023-02-28 10:26:29 -06:00
Chris Barber
ebd2e1822c [routing-utils] Add missing 'middlewareRawSrc' to route schema (#9564)
Need to add `middlewareRawSrc` to route schema so the build container will accept the new property.

This PR blocks https://github.com/vercel/vercel/pull/9435.

Linear: https://linear.app/vercel/issue/VCCLI-411/display-uncompressed-edge-middleware-matcher-show-the-list-of-matches
2023-02-28 03:59:06 +00:00
Steven
31bc2581f3 [cli] Remove unncessary warning when monorepo setting override (#9565)
This warning is not actionable by the user so this PR removes it.
2023-02-27 16:23:49 -05:00
Steven
96759a9fda [hydrogen] Add missing envPrefix (#9551)
- Follow up to #9326
2023-02-27 20:01:05 +00:00
Jimmy Lai
ad2864bca5 [next] add support for the integration hook file tracing (#9562)
Adds support for bundling properly the dependencies used by the experimental instrumentation hook file, `instrumentation.js`, by adding the generated nft file to the list of server deps

fixes NEXT-631
2023-02-27 18:58:12 +00:00
Sean Massa
40fbc993d7 [tests] extract noisey setup to make test clearer (#9509)
Clarify dev server tests with a small function extraction.
2023-02-27 17:05:27 +00:00
Sean Massa
1f30e56a6d [cli][dev] remove link to 404 FAQ (#9508) 2023-02-27 10:37:57 -06:00
Nathan Rajlich
58d6268899 [frameworks] Check for remix.config.mjs for "remix" auto-detection (#9558)
Moving this to a separate PR based on this comment:
https://github.com/vercel/vercel/pull/9556#discussion_r1117939290

This will need to be merged and released before the relevant E2E test in
#9556 will pass.

Co-authored-by: Steven <steven@ceriously.com>
2023-02-27 10:07:32 -05:00
Nathan Rajlich
4e6659ace7 [remix] Fix sending multiple response headers with the same name with Node.js (#9533)
i.e. `Set-Cookie`. Right now only one will be sent and others will be lost. This update matches the code being used in `@remix-run/vercel`.
2023-02-27 07:19:58 +00:00
Nathan Rajlich
769234b6a6 [remix] Inject Edge entrypoint into @remix-run/vercel during Edge Function creation (#9553)
There's [a PR](https://github.com/remix-run/remix/pull/5537) opened on
Remix to add an Edge compatible entrypoint to `@remix-run/vercel`. This
is only really needed specifically for projects that have a custom
server.js entrypoint file, which is not strictly necessary anymore, but
there are some edge cases where a project might still want to have one.
So this PR is necessary for those kinds of projects to be able to use
Edge runtime.

Even when they merge the PR, it would be good to leave this injection
code around for some time to continue support for older
`@remix-run/vercel` versions in existing projects.
2023-02-25 00:53:30 -08:00
JJ Kasper
53cab61e88 [next] Fix deploying with cached build (#9555)
This leverages the relative app dir field in the required files manifest when available so that we don't rely on absolute paths from a cached build since the cache can be restored in a separate context where the value no longer applies.

x-ref: https://github.com/vercel/next.js/pull/45864
x-ref: https://github.com/vercel/next.js/pull/46393
x-ref: https://github.com/vercel/next.js/discussions/39432#discussioncomment-4914549
x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1675821643786319)
2023-02-25 02:46:06 +00:00
Nathan Rajlich
3a65acfb32 [remix] Don't create output for Pathless Layout Routes without any child routes at the root level (#9539)
Fixes https://github.com/vercel/community/discussions/1587.
2023-02-25 01:17:01 +00:00
Nathan Rajlich
48eed7532a [tests] Properly test for multiple headers with same name in probes (#9538)
Updates the `responseHeaders` probe checks to properly test for multiple headers with the same name.

Previously the probes were using `headers.get()` which concats multiple headers into a single string, which results in the test not really checking if there are in fact multiple headers with the same name. Using `headers.raw()` allows us to properly test for that.

A couple of Python tests that were already checking for multiple `set-cookie` headers needed to be updated to match the full value, since the check now properly validates the full string match of each header (before it was basically just doing a `string.includes()` check).

This is a precursor for https://github.com/vercel/vercel/pull/9533.
2023-02-24 22:07:00 +00:00
Cody Olsen
f09d6fce85 [frameworks] add envPrefix to hydrogen framework (#9326)
Hydrogen uses the `PUBLIC_` env prefix, [it also supports
`VITE_`](8168cd2dd8/packages/hydrogen/src/framework/plugins/vite-plugin-hydrogen-config.ts (L127))
but [the docs only talk about
`PUBLIC_`](https://shopify.dev/custom-storefronts/hydrogen/environment-variables#public-variables).
2023-02-24 15:40:55 -05:00
Chris Barber
cc82c499db [cli] Added fetch dist-tags http status validation (#9549)
If for some reason the `get-latest-worker.js` fails to get the dist-tags, it doesn't check the status code and proceeds to `JSON.parse()` the response. If for example npm returns 401 Unauthorized, you get a cryptic JSON parse error message.
2023-02-24 20:14:53 +00:00
Steven
f0bc207717 [build-utils] Handle error during readConfigFile() (#9542)
This fixes a confusing error:

```
$ vercel build
Vercel CLI 28.16.6
Error: duplicated mapping key in "/vercel/path0/pnpm-lock.yaml" at line 1215, column -164:
      /@react-dnd/asap/4.0.1:
      ^
```
2023-02-24 18:02:35 +00:00
Steven
151c7f99ee [tests] Pass token to cron github actions (#9544)
https://github.com/actions/github-script#using-a-separate-github-token
2023-02-24 11:14:17 -05:00
Steven
61c2c494bf Revert "[tests] Update cron with token in git checkout" (#9543)
Reverts vercel/vercel#9541
2023-02-24 11:07:29 -05:00
Steven
7f49816129 [tests] Update cron with token in git checkout (#9541)
Hopefully this will fix the issue where actions do not run against the
automated PR.
2023-02-24 10:51:03 -05:00
Nathan Rajlich
7845bef826 Publish Stable
- vercel@28.16.7
 - @vercel/edge@0.3.0
 - @vercel/gatsby-plugin-vercel-builder@1.1.9
 - @vercel/next@3.6.1
 - @vercel/node-bridge@3.1.12
 - @vercel/node@2.9.8
 - @vercel/static-build@1.3.12
2023-02-24 04:04:16 -08:00
github-actions[bot]
7acb2e4b07 [examples] Upgrade Next.js to version 13.2.1 (#9536)
This auto-generated PR updates Next.js to version 13.2.1
2023-02-24 11:55:18 +00:00
Gal Schlezinger
abea002e93 [edge] Add RequestContext type (#9526)
Co-authored-by: Kiko Beats <josefrancisco.verdu@gmail.com>
2023-02-24 03:07:16 -08:00
Nathan Rajlich
2db9678bd4 [node-bridge] Fix multiple Set-Cookie headers in streaming mode (#9520)
Multiple `Set-Cookie` headers are being concat'd instead of being sent individually when in streaming mode.

**Non-streaming:**

```
$ curl -v https://01-remix-basics-eqztqyq3y.vercel-support.app/set-cookie 2>&1 | grep cookie
* h2h3 [:path: /set-cookie]
> GET /set-cookie HTTP/2
< set-cookie: foo=bar
< set-cookie: sessionId=38afes7a8
```

**Streaming:**

```
$ curl -v https://01-remix-basics-9b18alizh.vercel-support.app/set-cookie 2>&1 | grep cookie
* h2h3 [:path: /set-cookie]
> GET /set-cookie HTTP/2
< set-cookie: foo=bar,sessionId=38afes7a8
```
2023-02-24 04:03:37 +00:00
JJ Kasper
05f942c53f [tests] Update app-dir integration test (#9532)
The cache heuristic changed so there are now two separate serverless functions expected.
2023-02-24 00:29:34 +00:00
Nathan Rajlich
6c5f0b7aa0 Publish Stable
- vercel@28.16.6
 - @vercel/remix@1.4.1
2023-02-23 15:53:45 -08:00
Nathan Rajlich
fea05383b9 [remix] Ignore serverBuildPath from Remix config (#9531)
We are explicitly overriding `serverBuildPath` so there is no need to use the value that `readConfig()` gives to us.

Fixes #9524.
2023-02-23 23:52:27 +00:00
github-actions[bot]
247f49f765 [examples] Upgrade Next.js to version 13.2.0 (#9529)
This auto-generated PR updates Next.js to version 13.2.0

Co-authored-by: vercel-release-bot <infra+release@vercel.com>
2023-02-23 15:28:38 -05:00
Nathan Rajlich
231714c71b [remix] cd to the project directory during readConfig() (#9518)
Sometimes the `cwd` needs to be properly set for some Remix configurations. This is problematic in monorepos because the default `cwd` is the root of the monorepo, and not the project directory.

So `cd` to the project directory when reading the Remix config file to account for that.

Fixes https://github.com/kiliman/remix-flat-routes/issues/42.
Fixes https://github.com/vercel/vercel/discussions/9478.
2023-02-23 19:18:40 +00:00
Nathan Rajlich
73d6f0d0fa [remix] Update @remix-run/dev dep to v1.13.0 (#9519)
There were some fixes to thier new v2 filesystem routing that this will help with.

Related to https://github.com/remix-run/remix/issues/5322 and https://github.com/remix-run/remix/pull/5228.
2023-02-23 03:44:37 +00:00
Steven
34d199bd49 Publish Stable
- @vercel/build-utils@6.3.1
 - vercel@28.16.5
 - @vercel/client@12.4.1
 - @vercel/fs-detectors@3.8.1
 - @vercel/gatsby-plugin-vercel-builder@1.1.8
 - @vercel/go@2.3.8
 - @vercel/hydrogen@0.0.54
 - @vercel/next@3.6.0
 - @vercel/node@2.9.7
 - @vercel/python@3.1.50
 - @vercel/redwood@1.1.6
 - @vercel/remix@1.4.0
 - @vercel/ruby@1.3.67
 - @vercel/static-build@1.3.11
2023-02-22 20:23:55 -05:00
Steven
1dd421e1f6 [build-utils][next] Add images.contentDispositionType (#9513)
- Related to https://github.com/vercel/next.js/pull/46254
- Depends on https://github.com/vercel/api/pull/17434
2023-02-22 20:13:16 -05:00
Nathan Rajlich
a91690fb8a [tests] Remove watchPaths from remix test fixture (#9517)
Follow-up to https://github.com/vercel/vercel/pull/9512 which is a
revert of the test fixture.

The fixture was actually broken in the previous commit
(https://github.com/vercel/vercel/pull/9506) since it now is trying to
read the config file before running the Build Command. Having a setup
like this will not be able to be supported, especially in order to land
https://github.com/vercel/vercel/pull/9504.
2023-02-22 19:07:37 -05:00
Steven
264437c751 [tests] Increase test timeout from 5s to 10s (#9515)
Fixes this error:

```
@vercel/node:test-unit: FAIL test/dev.test.ts (14.891 s)
@vercel/node:test-unit:   × runs a mjs endpoint (5057 ms)
@vercel/node:test-unit:   × runs a esm typescript endpoint (5122 ms)
@vercel/node:test-unit: 
@vercel/node:test-unit:   ● runs a mjs endpoint
@vercel/node:test-unit: 
@vercel/node:test-unit:     thrown: "Exceeded timeout of 5000 ms for a test.
@vercel/node:test-unit:     Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
```


https://github.com/vercel/vercel/actions/runs/4247588973/jobs/7385801227#step:9:1039
2023-02-22 18:50:25 -05:00
Nathan Rajlich
b8cce66eff [remix] Simplify ESM detection of remix.config.js (#9512)
In a Turborepo setup, there was this in the `remix.config.js` file:

```js
  watchPaths: [require.resolve("ui")],
```

Since we attempt to `require()` the `remix.config.js` file in order to
determine whether or not it is using ESM syntax, this would fail since
the require happens before the Build Command is executed.

To fix, treat any non `ERR_REQUIRE_ESM` error as CJS, instead of
re-throwing the error. If there really is an issue with importing the
config, then that'll happen right after when `remix build` is doing it.
2023-02-22 15:22:18 -08:00
Nathan Rajlich
cbad57d14f [remix] Restore support for a custom server.js entrypoint file (#9506)
When the project defines a custom `server.js` file in `remix.config.js`,
then don't override that with the bundled
`server-node.mjs`/`server-edge.mjs` file. This allows for a custom
`getLoadContext()` function to remain supported.

In order for Edge runtime to be supported, a [companion
PR](https://github.com/remix-run/remix/pull/5537) for
`@remix-run/vercel` adapter has been created with a dedicated entrypoint
for when Edge runtime is being used. In order to support Edge on
previous versions of the adapter, we may end up patching the package to
enable support, but that will happen in a follow-up PR.

Related to https://github.com/orgs/vercel/discussions/1596.

---------

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-02-22 14:19:40 -08:00
Nathan Rajlich
4da176d26f [remix] Allow runtime to be defined from a parent route (#9473)
Make it so that the `export const config = { runtime }` value is "inherited" from a parent route, if it is defined.

For example, "edge" can be defined in `app/root.tsx`, and so all routes will use the Edge runtime by default, unless `"runtime": "nodejs"` is used more specifically in a route deeper in the route hierarchy.
2023-02-22 20:35:12 +00:00
Chris Barber
1f51e04387 [cli] Fix 'vc remove --safe <project>' (#9477)
`vc remove --safe <project>` has a unique code path that queries all deployments by project id. This function calls v4 deployments endpoint and returns the legacy deployment structure.

The problem is the `vc remove` command relies on the new `Deployment` structure defined by the v13 get deployment endpoint.

I've updated the `getDeploymentsByProjectId()` function to transform the legacy structure into the current one.

Fixes #9321 

Linear: https://linear.app/vercel/issue/VCCLI-538/vc-rm-project-safe-is-not-working
2023-02-22 18:02:54 +00:00
Sean Massa
756174714f [cli] fix content type determination logic (#9498)
The logic behind `getMimeType` only works for file names, not file paths. This PR fixes the logic to work regardless and adds a couple tests.
2023-02-22 17:23:12 +00:00
Ethan Arrowood
6e32832f94 [tests] Delete monorepo tests (#9499)
Deletes flaky monorepo tests as the logic is well tested within the fs-detectors repo.
2023-02-22 15:48:21 +00:00
Gal Schlezinger
e682e9cd7d [node] fix TypeScript + ESM in Windows (#9487)
ESM on Windows versions of Node.js require `--loader PATH` to be a `file://` protocol.
This PR allows `vc dev` to be used with both TypeScript and ESM
2023-02-22 05:54:39 +00:00
Sean Massa
b30f000d2a Publish Stable
- vercel@28.16.4
 - @vercel/next@3.5.2
2023-02-21 18:51:33 -06:00
JJ Kasper
f78051ada9 [next] Ensure .rsc outputs are not created for route handlers (#9503) 2023-02-21 16:41:54 -08:00
Don Alvarez
10bc74904c [docs] Improve docs for @vercel/next no pages built message (#9494)
After many hours of debugging, I tracked down that having an old Node
version (eg 14.x) listed in your Vercel project settings can result in
the build step failing with a confusing and unhelpful error message
"`@vercel/next` No Serverless Pages Built". Note that this is a case
where it "can" cause it to fail, including with NextJS 13.1.6 and Vercel
CLI 28.16.2, but it is not guaranteed to fail. I have six NextJS
projects. They have identical next.config.js, tsconfig.json,
eslintrc.js, and .gitignore files, and other than a few seemingly
non-critical dependencies they have identical package.json files. Four
of the six consistently built and deployed in the cloud without issue.
Two consistently failed to build in the cloud. All built successfully
locally including using vercel build locally, and all would vercel
deploy --prebuilt successfully. Switching all the vercel cloud project
settings from Node 14.x to Node 18.x enabled all the projects to build
and deploy successfully in the vercel cloud without needing local vercel
build and local vercel deploy --prebuilt steps.

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-02-21 11:32:03 -05:00
Steven
c8f7a9a874 [cli] Fix global detection for fnm (#9496)
Fix `--global` install detection when
[fnm](https://github.com/Schniz/fnm) was used to install node
2023-02-21 10:11:08 -05:00
Sean Massa
2fd3315221 Publish Stable
- vercel@28.16.3
 - @vercel/next@3.5.1
 - @vercel/remix@1.3.5
2023-02-21 08:53:23 -06:00
JJ Kasper
54ef027cbe [next] Fix rsc routes order (#9493)
This ensures we maintain the correct order for our rsc routes with
reference to middleware so that they match correctly. This also adds a
regression test to ensure it's working as expected.

Fixes: https://github.com/vercel/next.js/issues/45331
x-ref: [slack
thread](https://vercel.slack.com/archives/C035J346QQL/p1676926522772859?thread_ts=1676926096.412539&cid=C035J346QQL)
2023-02-20 17:54:17 -08:00
Shu Ding
6620c7f600 [next] Add initial vary header to all prerendered pages when RSC is enabled (#9481)
This PR changes the fallback headers that relate to RSC to the defaults that Next.js currently uses. Also, it sets the initial `vary` header to all prerendered routes when RSC is enabled (`routesManifest?.rsc`), even for the pages directory. 

That's because although the pages directory won't return any RSC payload, it can still be used in a project that contains app routes. When the app route requests a page route for RSC data, it's important for the browser to not accidentally cache that result hence we need the `vary` header to set there as well.

More related discussions can be found [here](https://linear.app/vercel/issue/NEXT-382/add-vary-rsc-etc-header-to-all-responses-to-ensure-browser-caching).
2023-02-20 19:35:06 +00:00
JJ Kasper
38f40f1c15 [next] Handle prerender-manifest v4 (#9489)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-02-20 11:41:24 +01:00
Nathan Rajlich
63211b8b89 [remix] Add unit tests (#9469)
Moves parts of the `@vercel/remix` builder into util functions that have isolated unit tests. No functionality changes.
2023-02-17 18:46:33 +00:00
Ikko Eltociear Ashimine
83ee5ea2b8 [cli] Fix typo in get-latest-worker.js (#9470)
persistance -> persistence

Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-02-17 11:45:44 -05:00
Ethan Arrowood
f063645646 [examples] Update remix template (#9472)
Previous PR was merged automatically but need to fix a dependency
version
2023-02-17 09:42:26 -07:00
Ethan Arrowood
4f8c5e344d [examples] update remix template (#9455)
Updates our remix template so that it works with our new Remix changes
2023-02-17 15:10:17 +00:00
Nathan Rajlich
70a53515bd Publish Stable
- vercel@28.16.2
 - @vercel/fs-detectors@3.8.0
 - @vercel/next@3.5.0
 - @vercel/remix@1.3.4
 - @vercel/ruby@1.3.66
 - @vercel/static-build@1.3.10
2023-02-16 15:12:31 -08:00
Sean Massa
4d4f0fa672 [next] Add Operation Types to Next.js Lambdas (#9196)
In order to have Next.js Lambdas show their operation types more specifically in the build output in the dashboard, the builder needs to return the Lambdas with `operationType` set to the appropriate value.

This PR adds those values. This allows the Richer Deployment Outputs to show the different types of serverless functions:
<img width="228" alt="Screenshot 2023-02-03 at 3 49 42 PM" src="https://user-images.githubusercontent.com/41545/216717479-d02fbd4a-fa62-479d-8b65-bd77fdcdb26c.png">
2023-02-16 22:59:14 +00:00
Felix Haus
46c0fd153a [fs-detectors] Remove increments of 64 limit for function memory (#9465)
Missed this occurrence so it still prevents the upload of serverless
functions that have a mem value that is not dividable by 64.
Should be the last place before we can ship the documentation update.

#### Related PRs
- #9440

Co-authored-by: Steven <steven@ceriously.com>
2023-02-16 16:42:42 -05:00
Marc Greenstock
1c8b4717e3 [ruby] fix: HEAD requests (#9436)
When WEBrick receives `HEAD` requests it discards the body (i.e.
`req.body.nil? => true`), this causes Vercel to throw a
`BODY_NOT_A_STRING_FROM_FUNCTION` since it is expecting the serverless
function to respond with a string in the body.

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Steven <steven@ceriously.com>
2023-02-16 16:41:56 -05:00
Nathan Rajlich
d52d26eaac [remix] Install Node globals (#9467)
Fixes https://github.com/vercel/community/discussions/1547.
Fixes https://github.com/vercel/community/discussions/1549.
2023-02-16 21:25:19 +00:00
Vincent Voyer
db65728fc4 Publish Stable
- vercel@28.16.1
2023-02-16 15:36:16 +01:00
Vincent Voyer
a788d06f85 [cli]: fix merging of vercel.json and build result crons (#9464)
Ensures that existing crons and crons from vercel.json are merged
together correctly.
2023-02-16 15:34:56 +01:00
394 changed files with 74031 additions and 55670 deletions

View File

@@ -0,0 +1,31 @@
name: Cron Update Gatsby Fixtures
on:
# Allow manual runs
workflow_dispatch:
# Run once a week https://crontab.guru/once-a-week
schedule:
- cron: '0 0 * * 0'
jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# 0 means fetch all commits so we can commit and push in the script below
with:
fetch-depth: 0
- name: Enable corepack
run: corepack enable pnpm
- name: Create Pull Request
uses: actions/github-script@v6
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-gatsby-fixtures.js')
await script({ github, context })

View File

@@ -25,6 +25,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-next.js')
await script({ github, context })

View File

@@ -25,6 +25,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-turbo.js')
await script({ github, context })

View File

@@ -16,6 +16,9 @@ jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -41,6 +44,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
- name: install npm@9
run: npm i -g npm@9
- name: install pnpm@7.24.2
run: npm i -g pnpm@7.24.2
- name: Install

View File

@@ -0,0 +1,28 @@
name: Update @remix-run/dev
on:
workflow_dispatch:
inputs:
new-version:
type: string
description: "Optional version to update @remix-run/dev to inside of @vercel/remix"
jobs:
update-remix-run-dev:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
- name: Enable corepack
run: corepack enable pnpm
- name: Update @remix-run/dev
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-remix-run-dev.js')
await script({ github, context }, "${{ inputs.new-version }}")

1
.npmrc
View File

@@ -1,3 +1,4 @@
provenance=true
save-exact=true
hoist-pattern[]=!"**/@types/**"
hoist-pattern[]=!"**/typedoc"

View File

@@ -14,7 +14,9 @@ In order to create the smallest possible lambdas Next.js has to be configured to
npm install next --save
```
2. Add the `now-build` script to your `package.json`
2. Check [Node.js Version](https://vercel.link/node-version) in your Project Settings. Using an old or incompatible version of Node.js can cause the Build Step to fail with this error message.
3. Add the `now-build` script to your `package.json` [deprecated]
```json
{
@@ -24,7 +26,7 @@ npm install next --save
}
```
3. Add `target: 'serverless'` to `next.config.js` [deprecated]
4. Add `target: 'serverless'` to `next.config.js` [deprecated]
```js
module.exports = {
@@ -33,9 +35,9 @@ module.exports = {
};
```
4. Remove `distDir` from `next.config.js` as `@vercel/next` can't parse this file and expects your build output at `/.next`
5. Remove `distDir` from `next.config.js` as `@vercel/next` can't parse this file and expects your build output at `/.next`
5. Optionally make sure the `"src"` in `"builds"` points to your application `package.json`
6. Optionally make sure the `"src"` in `"builds"` points to your application `package.json`
```js
{

View File

@@ -1,6 +1,5 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}

File diff suppressed because it is too large Load Diff

View File

@@ -9,10 +9,9 @@
"lint": "next lint"
},
"dependencies": {
"@next/font": "13.1.6",
"eslint": "8.32.0",
"eslint-config-next": "13.1.6",
"next": "13.1.6",
"eslint": "8.35.0",
"eslint-config-next": "13.2.3",
"next": "13.2.3",
"react": "18.2.0",
"react-dom": "18.2.0"
}

View File

@@ -1,6 +1,6 @@
import Head from 'next/head'
import Image from 'next/image'
import { Inter } from '@next/font/google'
import { Inter } from 'next/font/google'
import styles from '@/styles/Home.module.css'
const inter = Inter({ subsets: ['latin'] })

View File

@@ -13,10 +13,10 @@ function hydrate() {
});
}
if (window.requestIdleCallback) {
window.requestIdleCallback(hydrate);
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
// https://caniuse.com/requestidlecallback
window.setTimeout(hydrate, 1);
setTimeout(hydrate, 1);
}

View File

@@ -1,21 +1,18 @@
import type { EntryContext } from "@remix-run/node";
import handleRequest from "@vercel/remix-entry-server";
import { RemixServer } from "@remix-run/react";
import { renderToString } from "react-dom/server";
import type { EntryContext } from "@remix-run/server-runtime";
export default function handleRequest(
export default function (
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
) {
const markup = renderToString(
<RemixServer context={remixContext} url={request.url} />
const remixServer = <RemixServer context={remixContext} url={request.url} />;
return handleRequest(
request,
responseStatusCode,
responseHeaders,
remixServer
);
responseHeaders.set("Content-Type", "text/html");
return new Response("<!DOCTYPE html>" + markup, {
headers: responseHeaders,
status: responseStatusCode,
});
}

View File

@@ -7,7 +7,7 @@ import {
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import { Analytics } from '@vercel/analytics/react';
import { Analytics } from "@vercel/analytics/react";
export const meta: MetaFunction = () => ({
charset: "utf-8",

View File

@@ -0,0 +1,9 @@
export const config = { runtime: "edge" };
export default function Edge() {
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
<h1>Welcome to Remix@Edge</h1>
</div>
);
}

View File

@@ -6,20 +6,20 @@
"dev": "remix dev"
},
"dependencies": {
"@remix-run/node": "^1.7.6",
"@remix-run/react": "^1.7.6",
"@remix-run/vercel": "^1.7.6",
"@vercel/analytics": "^0.1.5",
"@vercel/node": "^2.7.0",
"@remix-run/node": "^1.13.0",
"@remix-run/react": "^1.13.0",
"@remix-run/serve": "^1.13.0",
"@remix-run/server-runtime": "^1.13.0",
"@vercel/analytics": "^0.1.10",
"@vercel/remix-entry-server": "^0.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^1.7.6",
"@remix-run/eslint-config": "^1.7.6",
"@remix-run/serve": "^1.7.6",
"@remix-run/dev": "^1.13.0",
"@remix-run/eslint-config": "^1.13.0",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.9",
"@types/react-dom": "^18.0.11",
"eslint": "^8.28.0",
"typescript": "^4.9.3"
},

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,10 @@
/** @type {import('@remix-run/dev').AppConfig} */
/**
* @type {import('@remix-run/dev').AppConfig}
*/
module.exports = {
serverBuildTarget: "vercel",
// When running locally in development mode, we use the built in remix
// server. This does not understand the vercel lambda module format,
// so we default back to the standard build output.
server: process.env.NODE_ENV === "development" ? undefined : "./server.js",
ignoredRouteFiles: ["**/.*"],
ignoredRouteFiles: ['**/.*'],
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
// serverBuildPath: "api/index.js",
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
};

View File

@@ -1,4 +0,0 @@
import { createRequestHandler } from "@remix-run/vercel";
import * as build from "@remix-run/dev/server-build";
export default createRequestHandler({ build, mode: process.env.NODE_ENV });

View File

@@ -300,6 +300,7 @@ export interface Secret {
createdAt: number;
}
// TODO (Ethan-Arrowood) - Replace enums
export enum ProjectEnvTarget {
Production = 'production',
Preview = 'preview',

View File

@@ -0,0 +1,17 @@
{
"private": true,
"name": "@vercel-internals/types",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"scripts": {
"build": "tsc -p tsconfig.json"
},
"dependencies": {
"@vercel/build-utils": "6.3.2",
"@vercel/routing-utils": "2.1.10"
},
"devDependencies": {
"@vercel/style-guide": "4.0.2",
"typescript": "4.9.4"
}
}

View File

@@ -0,0 +1,8 @@
{
"extends": "@vercel/style-guide/typescript",
"compilerOptions": {
"outDir": "dist",
"declaration": true
},
"include": ["index.ts"]
}

View File

@@ -32,7 +32,7 @@
"source-map-support": "0.5.12",
"ts-eager": "2.0.2",
"ts-jest": "28.0.5",
"turbo": "1.7.4"
"turbo": "1.8.3"
},
"scripts": {
"lerna": "lerna",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/build-utils",
"version": "6.3.0",
"version": "6.3.3",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.js",

View File

@@ -25,12 +25,16 @@ export async function readConfigFile<T>(
if (data) {
const str = data.toString('utf8');
if (name.endsWith('.json')) {
return JSON.parse(str) as T;
} else if (name.endsWith('.toml')) {
return (toml.parse(str) as unknown) as T;
} else if (name.endsWith('.yaml') || name.endsWith('.yml')) {
return yaml.safeLoad(str, { filename: name }) as T;
try {
if (name.endsWith('.json')) {
return JSON.parse(str) as T;
} else if (name.endsWith('.toml')) {
return toml.parse(str) as unknown as T;
} else if (name.endsWith('.yaml') || name.endsWith('.yml')) {
return yaml.safeLoad(str, { filename: name }) as T;
}
} catch (error: unknown) {
console.log(`Error while parsing config file: "${name}"`);
}
}
}

View File

@@ -355,6 +355,8 @@ export interface BuilderV3 {
type ImageFormat = 'image/avif' | 'image/webp';
type ImageContentDispositionType = 'inline' | 'attachment';
export type RemotePattern = {
/**
* Must be `http` or `https`.
@@ -390,6 +392,7 @@ export interface Images {
formats?: ImageFormat[];
dangerouslyAllowSVG?: boolean;
contentSecurityPolicy?: string;
contentDispositionType?: ImageContentDispositionType;
}
/**

View File

@@ -0,0 +1,77 @@
import { join } from 'path';
import { writeFile, rm } from 'fs/promises';
import { readConfigFile } from '../src';
describe('Test `readConfigFile()`', () => {
let logMessages: string[];
const originalConsoleLog = console.log;
beforeEach(() => {
logMessages = [];
console.log = m => {
logMessages.push(m);
};
});
afterEach(() => {
console.log = originalConsoleLog;
});
const doesnotexist = join(__dirname, 'does-not-exist.json');
const tsconfig = join(__dirname, '../tsconfig.json');
const invalid = join(__dirname, 'invalid.json');
it('should return null when file does not exist', async () => {
expect(await readConfigFile(doesnotexist)).toBeNull();
expect(logMessages).toEqual([]);
});
it('should return parsed object when file exists', async () => {
expect(await readConfigFile(tsconfig)).toMatchObject({
compilerOptions: {
strict: true,
},
});
expect(logMessages).toEqual([]);
});
it('should return parsed object when at least one file exists', async () => {
const files = [doesnotexist, tsconfig];
expect(await readConfigFile(files)).toMatchObject({
compilerOptions: {
strict: true,
},
});
expect(logMessages).toEqual([]);
});
it('should return null when parse fails', async () => {
try {
await writeFile(invalid, 'borked');
expect(await readConfigFile(invalid)).toBeNull();
} finally {
await rm(invalid);
}
expect(logMessages.length).toBe(1);
expect(logMessages[0]).toMatch(
/^Error while parsing config file.+invalid.json/
);
});
it('should return parsed object when at least one file is valid', async () => {
try {
await writeFile(invalid, 'borked');
expect(await readConfigFile([invalid, tsconfig])).toMatchObject({
compilerOptions: {
strict: true,
},
});
} finally {
await rm(invalid);
}
expect(logMessages.length).toBe(1);
expect(logMessages[0]).toMatch(
/^Error while parsing config file.+invalid.json/
);
});
});

View File

@@ -506,6 +506,11 @@ it('should retry npm install when peer deps invalid and npm@8 on node@16', async
console.log('Skipping test on windows');
return;
}
if (process.platform === 'darwin') {
console.log('Skipping test on mac');
return;
}
const fixture = path.join(__dirname, 'fixtures', '15-npm-8-legacy-peer-deps');
const nodeVersion = { major: nodeMajor } as any;
await runNpmInstall(fixture, [], {}, {}, nodeVersion);

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "28.16.0",
"version": "28.16.14",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -41,16 +41,16 @@
"node": ">= 14"
},
"dependencies": {
"@vercel/build-utils": "6.3.0",
"@vercel/go": "2.3.7",
"@vercel/hydrogen": "0.0.53",
"@vercel/next": "3.4.7",
"@vercel/node": "2.9.6",
"@vercel/python": "3.1.49",
"@vercel/redwood": "1.1.5",
"@vercel/remix": "1.3.3",
"@vercel/ruby": "1.3.65",
"@vercel/static-build": "1.3.9"
"@vercel/build-utils": "6.3.3",
"@vercel/go": "2.3.10",
"@vercel/hydrogen": "0.0.56",
"@vercel/next": "3.6.5",
"@vercel/node": "2.9.11",
"@vercel/python": "3.1.52",
"@vercel/redwood": "1.1.8",
"@vercel/remix": "1.6.1",
"@vercel/ruby": "1.3.69",
"@vercel/static-build": "1.3.15"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",
@@ -93,13 +93,14 @@
"@types/which": "1.3.2",
"@types/write-json-file": "2.2.1",
"@types/yauzl-promise": "2.1.0",
"@vercel/client": "12.4.0",
"@vercel-internals/types": "*",
"@vercel/client": "12.4.3",
"@vercel/error-utils": "1.0.8",
"@vercel/frameworks": "1.3.1",
"@vercel/fs-detectors": "3.7.14",
"@vercel/frameworks": "1.3.2",
"@vercel/fs-detectors": "3.8.3",
"@vercel/fun": "1.0.4",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.1.9",
"@vercel/routing-utils": "2.1.10",
"@zeit/source-map-support": "0.6.2",
"ajv": "6.12.2",
"alpha-sort": "2.0.1",
@@ -140,7 +141,6 @@
"is-url": "1.2.2",
"jaro-winkler": "0.2.8",
"jest-matcher-utils": "29.3.1",
"json5": "2.2.1",
"jsonlines": "0.1.1",
"line-async-iterator": "3.0.0",
"load-json-file": "3.0.0",

View File

@@ -12,7 +12,7 @@ import stamp from '../../util/output/stamp';
import strlen from '../../util/strlen';
import getCommandFlags from '../../util/get-command-flags';
import { getCommandName } from '../../util/pkg-name';
import { Alias } from '../../types';
import { Alias } from '@vercel-internals/types';
export default async function ls(
client: Client,

View File

@@ -9,7 +9,7 @@ import strlen from '../../util/strlen';
import confirm from '../../util/input/confirm';
import findAliasByAliasOrId from '../../util/alias/find-alias-by-alias-or-id';
import { Alias } from '../../types';
import { Alias } from '@vercel-internals/types';
import { isValidName } from '../../util/is-valid-name';
import { getCommandName } from '../../util/pkg-name';

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import { SetDifference } from 'utility-types';
import { AliasRecord } from '../../util/alias/create-alias';
import { Domain } from '../../types';
import { Domain } from '@vercel-internals/types';
import { Output } from '../../util/output';
import * as ERRORS from '../../util/errors-ts';
import assignAlias from '../../util/alias/assign-alias';

View File

@@ -13,7 +13,7 @@ import logo from '../../util/output/logo';
import getArgs from '../../util/get-args';
import Client from '../../util/client';
import { getPkgName } from '../../util/pkg-name';
import { Deployment, PaginationOptions } from '../../types';
import { Deployment, PaginationOptions } from '@vercel-internals/types';
import { normalizeURL } from '../../util/bisect/normalize-url';
import getScope from '../../util/get-scope';
import getDeployment from '../../util/get-deployment';

View File

@@ -751,12 +751,12 @@ function mergeImages(
}
function mergeCrons(
crons: BuildOutputConfig['crons'],
crons: BuildOutputConfig['crons'] = [],
buildResults: Iterable<BuildResult | BuildOutputConfig>
): BuildOutputConfig['crons'] {
for (const result of buildResults) {
if ('crons' in result && result.crons) {
crons = Object.assign({}, crons, result.crons);
crons = crons.concat(result.crons);
}
}
return crons;

View File

@@ -5,7 +5,7 @@ import stamp from '../../util/output/stamp';
import createCertFromFile from '../../util/certs/create-cert-from-file';
import createCertForCns from '../../util/certs/create-cert-for-cns';
import { getCommandName } from '../../util/pkg-name';
import { Cert } from '../../types';
import { Cert } from '@vercel-internals/types';
interface Options {
'--overwrite'?: boolean;

View File

@@ -10,7 +10,7 @@ import {
import stamp from '../../util/output/stamp';
import getCerts from '../../util/certs/get-certs';
import strlen from '../../util/strlen';
import { Cert } from '../../types';
import { Cert } from '@vercel-internals/types';
import getCommandFlags from '../../util/get-command-flags';
import { getCommandName } from '../../util/pkg-name';

View File

@@ -2,7 +2,7 @@ import chalk from 'chalk';
import ms from 'ms';
import plural from 'pluralize';
import table from 'text-table';
import { Cert } from '../../types';
import { Cert } from '@vercel-internals/types';
import * as ERRORS from '../../util/errors-ts';
import { Output } from '../../util/output';
import deleteCertById from '../../util/certs/delete-cert-by-id';

View File

@@ -5,7 +5,7 @@ import DevServer from '../../util/dev/server';
import { parseListen } from '../../util/dev/parse-listen';
import Client from '../../util/client';
import { getLinkedProject } from '../../util/projects/link';
import { ProjectSettings } from '../../types';
import { ProjectSettings } from '@vercel-internals/types';
import setupAndLink from '../../util/link/setup-and-link';
import { getCommandName } from '../../util/pkg-name';
import param from '../../util/output/param';

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import ms from 'ms';
import { DomainNotFound } from '../../util/errors-ts';
import { DNSRecord } from '../../types';
import { DNSRecord } from '@vercel-internals/types';
import Client from '../../util/client';
import formatTable from '../../util/format-table';
import getDNSRecords, {

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import ms from 'ms';
import table from 'text-table';
import { DNSRecord } from '../../types';
import { DNSRecord } from '@vercel-internals/types';
import { Output } from '../../util/output';
import Client from '../../util/client';
import deleteDNSRecordById from '../../util/dns/delete-dns-record-by-id';

View File

@@ -8,7 +8,7 @@ import getScope from '../../util/get-scope';
import stamp from '../../util/output/stamp';
import formatTable from '../../util/format-table';
import { formatDateWithoutTime } from '../../util/format-date';
import { Domain } from '../../types';
import { Domain } from '@vercel-internals/types';
import getCommandFlags from '../../util/get-command-flags';
import {
PaginationOptions,

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import plural from 'pluralize';
import { User, Team } from '../../types';
import { User, Team } from '@vercel-internals/types';
import * as ERRORS from '../../util/errors-ts';
import Client from '../../util/client';
import getScope from '../../util/get-scope';

View File

@@ -2,7 +2,7 @@ import chalk from 'chalk';
import plural from 'pluralize';
import { DomainNotFound, DomainPermissionDenied } from '../../util/errors-ts';
import { Domain } from '../../types';
import { Domain } from '@vercel-internals/types';
import { Output } from '../../util/output';
import Client from '../../util/client';
import deleteCertById from '../../util/certs/delete-cert-by-id';

View File

@@ -1,5 +1,5 @@
import chalk from 'chalk';
import { ProjectEnvTarget, Project, ProjectEnvType } from '../../types';
import { ProjectEnvTarget, Project, ProjectEnvType } from '@vercel-internals/types';
import { Output } from '../../util/output';
import Client from '../../util/client';
import stamp from '../../util/output/stamp';

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import ms from 'ms';
import { Output } from '../../util/output';
import { Project, ProjectEnvVariable, ProjectEnvType } from '../../types';
import { Project, ProjectEnvVariable, ProjectEnvType } from '@vercel-internals/types';
import Client from '../../util/client';
import formatTable from '../../util/format-table';
import getEnvRecords from '../../util/env/get-env-records';

View File

@@ -2,7 +2,7 @@ import chalk from 'chalk';
import { outputFile } from 'fs-extra';
import { closeSync, openSync, readSync } from 'fs';
import { resolve } from 'path';
import { Project, ProjectEnvTarget } from '../../types';
import { Project, ProjectEnvTarget } from '@vercel-internals/types';
import Client from '../../util/client';
import { emoji, prependEmoji } from '../../util/emoji';
import confirm from '../../util/input/confirm';

View File

@@ -1,5 +1,5 @@
import chalk from 'chalk';
import { Project } from '../../types';
import { Project } from '@vercel-internals/types';
import { Output } from '../../util/output';
import confirm from '../../util/input/confirm';
import removeEnvRecord from '../../util/env/remove-env-record';

View File

@@ -1,7 +1,7 @@
import { Dictionary } from '@vercel/client';
import chalk from 'chalk';
import { join } from 'path';
import { Org, Project, ProjectLinkData } from '../../types';
import { Org, Project, ProjectLinkData } from '@vercel-internals/types';
import Client from '../../util/client';
import { parseGitConfig, pluckRemoteUrls } from '../../util/create-git-meta';
import confirm from '../../util/input/confirm';

View File

@@ -1,5 +1,5 @@
import chalk from 'chalk';
import { Org, Project } from '../../types';
import { Org, Project } from '@vercel-internals/types';
import Client from '../../util/client';
import confirm from '../../util/input/confirm';
import { getCommandName } from '../../util/pkg-name';

View File

@@ -10,7 +10,7 @@ import getScope from '../util/get-scope';
import { getPkgName, getCommandName } from '../util/pkg-name';
import Client from '../util/client';
import getDeployment from '../util/get-deployment';
import { Build, Deployment } from '../types';
import { Build, Deployment } from '@vercel-internals/types';
import title from 'title';
import { isErrnoException } from '@vercel/error-utils';
import { URL } from 'url';

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import ms from 'ms';
import table from 'text-table';
import { Project } from '../../types';
import { Project } from '@vercel-internals/types';
import Client from '../../util/client';
import getCommandFlags from '../../util/get-command-flags';
import { getCommandName } from '../../util/pkg-name';

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import { join } from 'path';
import Client from '../util/client';
import { ProjectEnvTarget } from '../types';
import type { Project, ProjectEnvTarget } from '@vercel-internals/types';
import { emoji, prependEmoji } from '../util/emoji';
import getArgs from '../util/get-args';
import logo from '../util/output/logo';
@@ -10,7 +10,6 @@ import { getPkgName } from '../util/pkg-name';
import { VERCEL_DIR, VERCEL_DIR_PROJECT } from '../util/projects/link';
import { writeProjectSettings } from '../util/projects/project-settings';
import envPull from './env/pull';
import type { Project } from '../types';
import {
isValidEnvTarget,
getEnvTargetPlaceholder,

View File

@@ -12,17 +12,19 @@ import { isValidName } from '../util/is-valid-name';
import removeProject from '../util/projects/remove-project';
import getProjectByIdOrName from '../util/projects/get-project-by-id-or-name';
import getDeployment from '../util/get-deployment';
import getDeploymentsByProjectId, {
DeploymentPartial,
} from '../util/deploy/get-deployments-by-project-id';
import getDeploymentsByProjectId from '../util/deploy/get-deployments-by-project-id';
import { getPkgName, getCommandName } from '../util/pkg-name';
import getArgs from '../util/get-args';
import handleError from '../util/handle-error';
import type Client from '../util/client';
import { Output } from '../util/output';
import { Alias, Project } from '../types';
import { Alias, Deployment, Project } from '@vercel-internals/types';
import { NowError } from '../util/now-error';
type DeploymentWithAliases = Deployment & {
aliases: Alias[];
};
const help = () => {
console.log(`
${chalk.bold(
@@ -125,11 +127,11 @@ export default async function main(client: Client) {
let aliases: Alias[][];
let projects: Project[];
let deployments: DeploymentPartial[];
let deployments: DeploymentWithAliases[];
const findStart = Date.now();
try {
const searchFilter = (d: DeploymentPartial) =>
const searchFilter = (d: Deployment) =>
ids.some(
id =>
d &&
@@ -167,9 +169,15 @@ export default async function main(client: Client) {
})
);
projectDeployments
.slice(0, 201)
.map(pDeployments => deployments.push(...pDeployments));
// only process the first 201 projects
const to = Math.min(projectDeployments.length, 201);
for (let i = 0; i < to; i++) {
for (const pDepl of projectDeployments[i]) {
const depl = pDepl as DeploymentWithAliases;
depl.aliases = [];
deployments.push(depl);
}
}
projects = [];
} else {
@@ -260,7 +268,7 @@ export default async function main(client: Client) {
}
function readConfirmation(
deployments: DeploymentPartial[],
deployments: DeploymentWithAliases[],
projects: Project[],
output: Output
): Promise<string> {
@@ -325,7 +333,7 @@ function readConfirmation(
}
function deploymentsAndProjects(
deployments: DeploymentPartial[],
deployments: DeploymentWithAliases[],
projects: Project[],
conjunction = 'and'
) {

View File

@@ -7,7 +7,7 @@ import { emoji } from '../../util/emoji';
import getUser from '../../util/get-user';
import getTeams from '../../util/teams/get-teams';
import listInput from '../../util/input/list';
import { Team, GlobalConfig } from '../../types';
import { Team, GlobalConfig } from '@vercel-internals/types';
import { writeToConfigFile } from '../../util/config/files';
const updateCurrentTeam = (config: GlobalConfig, team?: Team) => {

View File

@@ -50,7 +50,7 @@ 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 './types';
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
import { VercelConfig } from '@vercel/client';
import box from './util/output/box';

View File

@@ -1,4 +1,4 @@
import type { Deployment } from '../../types';
import type { Deployment } from '@vercel-internals/types';
import { Output } from '../output';
import Client from '../client';
import createAlias from './create-alias';

View File

@@ -1,4 +1,4 @@
import type { Deployment } from '../../types';
import type { Deployment } from '@vercel-internals/types';
import { Output } from '../output';
import * as ERRORS from '../errors-ts';
import Client from '../client';

View File

@@ -1,5 +1,5 @@
import { Output } from '../output';
import { Alias } from '../../types';
import { Alias } from '@vercel-internals/types';
import Client from '../client';

View File

@@ -1,4 +1,4 @@
import { Alias, PaginationOptions } from '../../types';
import { Alias, PaginationOptions } from '@vercel-internals/types';
import Client from '../client';
type Response = {

View File

@@ -2,7 +2,7 @@ import path from 'path';
import chalk from 'chalk';
import Client from '../client';
import { Output } from '../output';
import { User } from '../../types';
import { User } from '@vercel-internals/types';
import { VercelConfig } from '../dev/types';
import getDeploymentsByAppName from '../deploy/get-deployments-by-appname';
import getDeployment from '../get-deployment';

View File

@@ -1,6 +1,6 @@
import Client from '../client';
import getAliases from './get-aliases';
import { Alias } from '../../types';
import { Alias } from '@vercel-internals/types';
export default async function getDomainAliases(client: Client, domain: string) {
const { aliases } = await getAliases(client);

View File

@@ -1,4 +1,4 @@
import { Build } from '../types';
import { Build } from '@vercel-internals/types';
export const isReady = ({ readyState }: Pick<Build, 'readyState'>) =>
readyState === 'READY';

View File

@@ -9,6 +9,7 @@ import { ProjectLinkAndSettings } from '../projects/project-settings';
import { Output } from '../output';
import title from 'title';
import { PartialProjectSettings } from '../input/edit-project-settings';
import { debug } from '@vercel/build-utils';
export async function setMonorepoDefaultSettings(
cwd: string,
@@ -26,8 +27,8 @@ export async function setMonorepoDefaultSettings(
value: string
) => {
if (projectSettings[command]) {
output.warn(
`Cannot automatically assign ${command} as it is already set via project settings or configuration overrides.`
debug(
`Skipping auto-assignment of ${command} as it is already set via project settings or configuration overrides.`
);
} else {
projectSettings[command] = value;

View File

@@ -1,7 +1,7 @@
import { readFileSync } from 'fs';
import { resolve } from 'path';
import Client from '../client';
import { Cert } from '../../types';
import { Cert } from '@vercel-internals/types';
import { isErrnoException } from '@vercel/error-utils';
import { isAPIError } from '../errors-ts';

View File

@@ -1,6 +1,6 @@
import chalk from 'chalk';
import { Cert } from '../../types';
import { Cert } from '@vercel-internals/types';
import * as ERRORS from '../errors-ts';
import Client from '../client';
import mapCertError from './map-cert-error';

View File

@@ -1,4 +1,4 @@
import { Cert } from '../../types';
import { Cert } from '@vercel-internals/types';
import Client from '../client';
import * as ERRORS from '../errors-ts';

View File

@@ -1,5 +1,5 @@
import { stringify } from 'querystring';
import { Cert } from '../../types';
import { Cert } from '@vercel-internals/types';
import Client from '../client';
/**

View File

@@ -1,5 +1,5 @@
import Client from '../client';
import { Cert, PaginationOptions } from '../../types';
import { Cert, PaginationOptions } from '@vercel-internals/types';
type Response = {
certs: Cert[];

View File

@@ -1,5 +1,5 @@
import { stringify } from 'querystring';
import { Cert } from '../../types';
import { Cert } from '@vercel-internals/types';
import * as ERRORS from '../errors-ts';
import Client from '../client';

View File

@@ -1,5 +1,5 @@
import retry from 'async-retry';
import { Cert } from '../../types';
import { Cert } from '@vercel-internals/types';
import Client from '../client';
import { isAPIError } from '../errors-ts';
import { isError } from '@vercel/error-utils';

View File

@@ -19,7 +19,7 @@ import type {
Stdio,
ReadableTTY,
WritableTTY,
} from '../types';
} from '@vercel-internals/types';
import { sharedPromise } from './promise';
import { APIError } from './errors-ts';
import { normalizeError } from '@vercel/error-utils';

View File

@@ -9,7 +9,7 @@ import { NowError } from '../now-error';
import error from '../output/error';
import highlight from '../output/highlight';
import { VercelConfig } from '../dev/types';
import { AuthConfig, GlobalConfig } from '../../types';
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
import { isErrnoException, isError } from '@vercel/error-utils';
const VERCEL_DIR = getGlobalPathConfig();

View File

@@ -1,4 +1,4 @@
import { AuthConfig, GlobalConfig } from '../../types';
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
export const defaultGlobalConfig: GlobalConfig = {
'// Note':

View File

@@ -3,7 +3,7 @@ import { join } from 'path';
import ini from 'ini';
import git from 'git-last-commit';
import { exec } from 'child_process';
import { GitMetadata, Project } from '../types';
import { GitMetadata, Project } from '@vercel-internals/types';
import { Output } from './output';
import { errorToString, normalizeError } from '@vercel/error-utils';

View File

@@ -3,7 +3,7 @@ import * as ERRORS_TS from '../errors-ts';
import * as ERRORS from '../errors';
import { NowError } from '../now-error';
import mapCertError from '../certs/map-cert-error';
import { Org } from '../../types';
import { Org } from '@vercel-internals/types';
import Now, { CreateOptions } from '..';
import Client from '../client';
import { ArchiveFormat, DeploymentError } from '@vercel/client';

View File

@@ -1,17 +1,31 @@
import { URLSearchParams } from 'url';
import { Alias } from '../../types';
import { Deployment } from '@vercel-internals/types';
import Client from '../client';
type Response = {
deployments: DeploymentPartial[];
};
export interface DeploymentPartial {
id: string;
name: string;
url: string;
type LegacyDeployment = {
aliasAssigned?: number | boolean | null;
aliasError?: {
code: string;
message: string;
} | null;
buildingAt: number;
checksConclusion?: 'succeeded' | 'failed' | 'skipped' | 'canceled';
checksState?: 'registered' | 'running' | 'completed';
created: number;
createdAt: number;
aliases: Alias[];
createdAt?: number;
creator: {
uid: string;
email?: string;
username?: string;
githubLogin?: string;
gitlabLogin?: string;
};
inspectorUrl: string | null;
isRollbackCandidate?: boolean | null;
meta?: { [key: string]: string | undefined };
name: string;
ready?: number;
source?: 'cli' | 'git' | 'import' | 'import/repo' | 'clone/repo';
state:
| 'BUILDING'
| 'ERROR'
@@ -19,8 +33,15 @@ export interface DeploymentPartial {
| 'QUEUED'
| 'READY'
| 'CANCELED';
creator: { uid: string };
}
target?: 'production' | 'staging' | null;
type: 'LAMBDAS';
uid: string;
url: string;
};
type Response = {
deployments: LegacyDeployment[];
};
interface Options {
from?: number | null;
@@ -34,7 +55,7 @@ export default async function getDeploymentsByProjectId(
projectId: string,
options: Options = { from: null, limit: 100, continue: false },
total: number = 0
): Promise<DeploymentPartial[]> {
): Promise<Deployment[]> {
const limit = options.limit || 100;
const query = new URLSearchParams();
@@ -45,9 +66,40 @@ export default async function getDeploymentsByProjectId(
query.set('from', options.from.toString());
}
const { deployments } = await client.fetch<Response>(
`/v4/now/deployments?${query}`
const { deployments: legacyDeployments } = await client.fetch<Response>(
`/v6/deployments?${query}`
);
// we need to transform the old deployment shape to the new shape
const deployments: Deployment[] = legacyDeployments.map(depl => {
return {
aliasAssigned: depl.aliasAssigned,
aliasError: depl.aliasError,
buildingAt: depl.buildingAt,
checksConclusion: depl.checksConclusion,
checksState: depl.checksState,
createdAt: depl.created,
creator: {
uid: depl.creator.uid,
username: depl.creator.username,
},
id: depl.uid,
inspectorUrl: depl.inspectorUrl,
meta: depl.meta,
name: depl.name,
public: true,
ready: depl.ready,
readyState: depl.state,
regions: [],
source: depl.source,
status: depl.state,
target: depl.target,
type: depl.type,
url: depl.url,
version: 2,
};
});
total += deployments.length;
if (options.max && total >= options.max) {
@@ -55,7 +107,7 @@ export default async function getDeploymentsByProjectId(
}
if (options.continue && deployments.length === limit) {
const nextFrom = deployments[deployments.length - 1].created;
const nextFrom = deployments[deployments.length - 1].createdAt;
const nextOptions = Object.assign({}, options, { from: nextFrom });
deployments.push(
...(await getDeploymentsByProjectId(

View File

@@ -9,7 +9,7 @@ import {
import { Output } from '../output';
import { progress } from '../output/progress';
import Now from '../../util';
import { Org } from '../../types';
import { Org } from '@vercel-internals/types';
import ua from '../ua';
import { linkFolderToProject } from '../projects/link';
import { prependEmoji, emoji } from '../emoji';

View File

@@ -1,5 +1,7 @@
import { contentType } from 'mime-types';
import path from 'path';
export default function getMimeType(fileName: string) {
return contentType(fileName) || 'application/octet-stream';
const extension = path.extname(fileName);
return contentType(extension) || 'application/octet-stream';
}

View File

@@ -85,7 +85,7 @@ import {
HttpHeadersConfig,
EnvConfigs,
} from './types';
import { ProjectSettings } from '../../types';
import { ProjectSettings } from '@vercel-internals/types';
import { treeKill } from '../tree-kill';
import { applyOverriddenHeaders, nodeHeadersToFetchHeaders } from './headers';
import { formatQueryString, parseQueryString } from './parse-query-string';

View File

@@ -6,6 +6,4 @@
{{?}}
<span class="devinfo-line">ID: <code>{{! it.request_id }}</code>
</p>
<a href="https://vercel.link/404"><div class="note">Click here to learn more about this error.</div></a>
</main>

View File

@@ -16,7 +16,7 @@ import {
import { VercelConfig } from '@vercel/client';
import { HandleValue, Route } from '@vercel/routing-utils';
import { Output } from '../output';
import { ProjectSettings } from '../../types';
import { ProjectSettings } from '@vercel-internals/types';
import { BuilderWithPkg } from '../build/import-builders';
export { VercelConfig };

View File

@@ -7,7 +7,7 @@ import {
DNSConflictingRecord,
isAPIError,
} from '../errors-ts';
import { DNSRecordData } from '../../types';
import { DNSRecordData } from '@vercel-internals/types';
type Response = {
uid: string;

View File

@@ -1,5 +1,5 @@
import chalk from 'chalk';
import { DNSRecordData } from '../../types';
import { DNSRecordData } from '@vercel-internals/types';
import textInput from '../input/text';
import promptBool from '../input/prompt-bool';
import Client from '../client';

View File

@@ -1,4 +1,4 @@
import { DNSRecord } from '../../types';
import { DNSRecord } from '@vercel-internals/types';
import Client from '../client';
export default async function getDNSRecordById(

View File

@@ -1,4 +1,4 @@
import { DNSRecord } from '../../types';
import { DNSRecord } from '@vercel-internals/types';
import { DomainNotFound } from '../errors-ts';
import { Output } from '../output';
import Client from '../client';

View File

@@ -1,4 +1,4 @@
import { DNSRecord, PaginationOptions } from '../../types';
import { DNSRecord, PaginationOptions } from '@vercel-internals/types';
import { DomainNotFound, isAPIError } from '../errors-ts';
import { Output } from '../output';
import Client from '../client';

View File

@@ -1,4 +1,4 @@
import { DNSRecordData } from '../../types';
import { DNSRecordData } from '@vercel-internals/types';
export default function parseAddArgs(
args: string[]

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import retry from 'async-retry';
import { DomainAlreadyExists, InvalidDomain, isAPIError } from '../errors-ts';
import { Domain } from '../../types';
import { Domain } from '@vercel-internals/types';
import Client from '../client';
type Response = {

View File

@@ -1,6 +1,6 @@
import chalk from 'chalk';
import Client from '../client';
import { Domain } from '../../types';
import { Domain } from '@vercel-internals/types';
import {
DomainPermissionDenied,
DomainNotFound,

View File

@@ -1,5 +1,5 @@
import Client from '../client';
import { DomainConfig } from '../../types';
import { DomainConfig } from '@vercel-internals/types';
import { isAPIError } from '../errors-ts';
export async function getDomainConfig(client: Client, domainName: string) {

View File

@@ -1,4 +1,4 @@
import { Domain } from '../../types';
import { Domain } from '@vercel-internals/types';
export type DomainRegistrar = 'Vercel' | 'Purchase in Process' | 'Third Party';

View File

@@ -1,6 +1,6 @@
import chalk from 'chalk';
import Client from '../client';
import { Domain } from '../../types';
import { Domain } from '@vercel-internals/types';
import { isAPIError } from '../errors-ts';
type Response = {

View File

@@ -1,4 +1,4 @@
import { Domain, PaginationOptions } from '../../types';
import { Domain, PaginationOptions } from '@vercel-internals/types';
import Client from '../client';
type Response = {

View File

@@ -1,4 +1,4 @@
import { Domain } from '../../types';
import { Domain } from '@vercel-internals/types';
export default function isDomainExternal(domain: Domain) {
return domain.serviceType !== 'zeit.world';

View File

@@ -1,6 +1,6 @@
import psl from 'psl';
import { NowError } from '../now-error';
import { Domain } from '../../types';
import { Domain } from '@vercel-internals/types';
import { Output } from '../output';
import * as ERRORS from '../errors-ts';
import addDomain from './add-domain';

View File

@@ -1,6 +1,6 @@
import * as ERRORS from '../errors-ts';
import Client from '../client';
import { Domain } from '../../types';
import { Domain } from '@vercel-internals/types';
type Response = {
domain: Domain;

View File

@@ -4,7 +4,7 @@ import {
ProjectEnvTarget,
ProjectEnvVariable,
ProjectEnvType,
} from '../../types';
} from '@vercel-internals/types';
export default async function addEnvRecord(
output: Output,

View File

@@ -1,4 +1,4 @@
import { ProjectEnvTarget } from '../../types';
import { ProjectEnvTarget } from '@vercel-internals/types';
function envTargets(): string[] {
return Object.values(ProjectEnvTarget);

View File

@@ -1,5 +1,5 @@
import title from 'title';
import { ProjectEnvVariable } from '../../types';
import { ProjectEnvVariable } from '@vercel-internals/types';
export default function formatEnvTarget(env: ProjectEnvVariable): string {
const target = (Array.isArray(env.target) ? env.target : [env.target || ''])

View File

@@ -1,6 +1,6 @@
import { Output } from '../output';
import Client from '../client';
import { ProjectEnvVariable, ProjectEnvTarget } from '../../types';
import { ProjectEnvVariable, ProjectEnvTarget } from '@vercel-internals/types';
import { URLSearchParams } from 'url';
/** The CLI command that was used that needs the environment variables. */

Some files were not shown because too many files have changed in this diff Show More