Compare commits

...

15 Commits

Author SHA1 Message Date
Sean Massa
881e43a0e2 Publish Stable
- @vercel/build-utils@6.2.3
 - vercel@28.15.5
 - @vercel/client@12.3.9
 - @vercel/fs-detectors@3.7.12
 - @vercel/gatsby-plugin-vercel-builder@1.1.5
 - @vercel/go@2.3.5
 - @vercel/hydrogen@0.0.51
 - @vercel/next@3.4.4
 - @vercel/node@2.9.4
 - @vercel/python@3.1.47
 - @vercel/redwood@1.1.3
 - @vercel/remix-entry-server@0.1.0
 - @vercel/remix@1.3.0
 - @vercel/ruby@1.3.63
 - @vercel/static-build@1.3.7
2023-02-14 15:38:34 -06:00
Steven
578a7742fe [next] Improve error message when routes-manifest.json not found (#9441)
The dashboard doesn't handle multiline errors very well because other lines are collapsed.

https://vercel.com/changelog/deployment-logs-filtering-now-available

<img width="1237" alt="image" src="https://user-images.githubusercontent.com/229881/218832497-0bcd9404-b4f5-49fe-9edd-bd6de6d8bb8f.png">


We also show the complete error in the top and it doesn't show newlines properly.

<img width="428" alt="image" src="https://user-images.githubusercontent.com/229881/218832603-065e0d4d-ae6e-4b44-b2db-b2fff063da58.png">

The "Learn More" link already has the relevant information so we can reduce this error message to a single line to improve the call to action.
2023-02-14 20:32:18 +00:00
Nathan Rajlich
2d84a64430 [remix-entry-server] Add initial implementation (#9417)
This adds a new package to the monorepo: `@vercel/remix-entry-server`

The purpose of this package is to provide most of the implementation of
the Remix `app/entry.server.tsx` file with proper support for the Vercel
Serverless and Edge runtimes, specifically in regards to React 18
streaming.

The reason that this package is necessary, as opposed to just updating
our Remix template, is due to the fact that Serverless and Edge runtimes
require a different implementation. This is because the
`react-dom/server` package exports different functions for the Node
(`renderToPipeableStream()`) vs. Edge (`renderToReadableStream()`)
bundles, and thus this package also has two different implementations
(by utilizing the `main` and `browser` fields in `package.json`).

Usage of this package in a Remix application's `app/entry.server.tsx`
file looks like:

```tsx
import handleRequest from "@vercel/remix-entry-server";
import { RemixServer } from "@remix-run/react";
import type { EntryContext } from "@remix-run/server-runtime";

export default function (
  request: Request,
  responseStatusCode: number,
  responseHeaders: Headers,
  remixContext: EntryContext
) {
  const remixServer = <RemixServer context={remixContext} url={request.url} />;
  return handleRequest(request, responseStatusCode, responseHeaders, remixServer)
}
```

Once this package is published then we can update our own Remix template
to utilize it, enabling React 18 streaming for both Vercel runtimes.
2023-02-14 10:09:07 -08:00
Felix Haus
200ac99647 [build-utils][cli] Remove 64 increment limit for serverless functions (#9440)
We no longer require the memory to be provided in steps of 64mb for
serverless functions.
Instead the memory can now be chosen freely from `128mb` to `3008mb` in
`1mb increments`.

Updates the `vercel.json` schema to reflect that change.
2023-02-14 13:08:40 -05:00
Felix Haus
1d3f2b5a62 [build-utils][cli] Update link to project-configuration (#9439)
The link to the documentation has changed.
It is now available under https://vercel.com/docs/concepts/projects/project-configuration

This updates:
- link generation `https://vercel.com/docs/configuration#project/*` -> `https://vercel.com/docs/concepts/projects/project-configuration#*`
-  Updates test files
- Updates static references of https://vercel.com/docs/configuration across the repo
2023-02-14 16:44:24 +00:00
Steven
8f49969585 [tests] Update tests script names (#9433)
### Description 

These script names are currently really long and that makes it difficult
to read.

In particular, the most important part (the package name) is often
truncated.

See before/after below.

## Before

<img width="302" alt="image"
src="https://user-images.githubusercontent.com/229881/218588978-b8ed9a7a-f4da-4d58-af3f-2b1a7087737d.png">

## After

<img width="290" alt="image"
src="https://user-images.githubusercontent.com/229881/218596895-65627ad0-2895-4bd7-8506-f5f545a419d3.png">
2023-02-14 10:31:46 -05:00
Steven
cfbfaa7cd0 [tests] Fix memory limit test (#9438)
This error message was adjusted recently
2023-02-14 09:58:10 -05:00
Nathan Rajlich
25747a7621 [remix] Support per-page Edge functions and replace "@remix-run/vercel" (#9375)
Adds support for server-side rendered Remix using Edge Functions. This runtime can be enabled on a per-page basis, by adding the following to a page within the `app/routes` directory:

```js
export const config = {
  runtime: 'edge'
};
```

Additionally, this PR further supersedes the `@remix-run/vercel` runtime adapter, because we will always inject our own server entrypoint. So the logic to ensure that package exists in the project's `package.json` has been removed (so this closes #9011). The only requirement is that the Remix project has `@remix-run/node` as a dependency, which is the case for the vanilla Remix template so I think that's a fair assumption.

To make Edge Functions work, we need to ensure that `remix build` is executed with a few specific configuration values in place, so this change wraps the existing `remix.config.js` file and adds our own to make sure those values are in place (and then cleans itself up after the build command is executed).

Finally, the reading of the Remix config logic was simplified by using the `readConfig()` function from the `@remix-run/dev` package, which also includes the routes manifest, so the hacky `vm` running logic to retrieve the manifest was able to be removed.

Closes #8784.
Closes #9011.

---

# To test this out:

1. Ensure that Remix dependencies are running _at least version `1.5.0`_ (which is when `writeReadableStreamToWritable()` was added to `@remix-run/node`).

2. Add the following line of code to any page in your Remix application’s `app/routes/*` directory:
    
    ```jsx
    export const config = { runtime: 'edge' };
    ```
    
3. Set an Environment Variable on your Vercel Project:
    - Name: `VERCEL_CLI_VERSION`
    - Value: `https://vercel-git-update-remix-edge.vercel.sh/tarballs/vercel.tgz`
    
4. Make a deployment, either by running `vercel deploy` in the CLI, or by pushing a Git commit to your repository which has a Vercel Git integration enabled.
2023-02-14 01:01:46 +00:00
github-actions[bot]
8d635beed7 [tests] Upgrade Turbo to version 1.7.4 (#9431)
This auto-generated PR updates Turbo to version 1.7.4
2023-02-14 00:01:45 +00:00
JJ Kasper
6225f050fa [next] Fix app-dir tests from new content-type (#9434)
x-ref: https://github.com/vercel/vercel/pull/9408
x-ref:
https://github.com/vercel/vercel/actions/runs/4168082693/jobs/7214887847
2023-02-13 18:22:33 -05:00
Steven
30a899bab1 [tests] Add workflow_dispatch to cron workflows (#9430)
This `workflow_dispatch` prop allows manual runs by clicking a button on
https://github.com/vercel/vercel/actions
2023-02-13 16:39:15 -05:00
Sean Massa
a010d8fe8a [cli] add slash before url for edge function errors (#9428)
Edge Functions and Serverless Functions were both updated to show the path of their entry points, but it turns out Serverless Function paths started with a slash and Edge Function paths did not.

The [related code for Serverless Functions](d628880942/packages/node-bridge/helpers.ts) does not need to be updated.

---

Before:

<img width="996" alt="CleanShot 2023-02-13 at 13 23 42@2x" src="https://user-images.githubusercontent.com/41545/218554154-2b112a68-2d68-4968-bae7-acf6e85a72a2.png">

---

After: 

<img width="921" alt="CleanShot 2023-02-13 at 13 20 22@2x" src="https://user-images.githubusercontent.com/41545/218554029-c3dce6b1-b01f-4a78-aa32-f6891ff16e51.png">
2023-02-13 21:37:16 +00:00
Steven
a9ff23fe22 [test] Switch to turbo main release line (#9429)
Per @tknickman, we don't need to be testing every turbo canary in this
repo, that will happen in the turborepo tests
2023-02-13 16:00:42 -05:00
Steven
b60d3f657a [tests] Update CI to Node.js 16 (#9397)
In an effort to speed up CI, we should update the lowest common
denominator to Node.js 16

Note: In April, Node.js 14 will reach EOL so we can update tsconfig
targets and ship a major semver at that time.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-13 15:59:05 -05:00
Nathan Rajlich
e7947a1b33 [node] Make NFT resolve "worker"/"browser" exports for Edge Functions (#9377)
This makes `react-dom` work as expected from within Edge Functions. Otherwise, NFT will only select the Node.js version of the files which do not work with react-dom within an Edge Function.
2023-02-13 20:27:37 +00:00
141 changed files with 18483 additions and 22221 deletions

View File

@@ -1,6 +1,8 @@
name: Cron Update Next
on:
# Allow manual runs
workflow_dispatch:
# Run every 4 hours https://crontab.guru/every-4-hours
schedule:
- cron: '0 */4 * * *'

View File

@@ -1,6 +1,8 @@
name: Cron Update Turbo
on:
# Allow manual runs
workflow_dispatch:
# Run every week https://crontab.guru/every-week
schedule:
- cron: '0 0 * * 0'

View File

@@ -40,7 +40,7 @@ jobs:
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16
- name: install pnpm@7.24.2
run: npm i -g pnpm@7.24.2
- name: Install

View File

@@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [14]
node: [16]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
@@ -41,7 +41,7 @@ jobs:
run: npm i -g pnpm@7.24.2
- run: pnpm install
- run: pnpm run build
- run: pnpm test-integration-cli
- run: pnpm test-cli
env:
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}

View File

@@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [14]
node: [16]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3

View File

@@ -9,7 +9,7 @@ on:
pull_request:
env:
NODE_VERSION: '14'
NODE_VERSION: '16'
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}

View File

@@ -11,4 +11,4 @@ Remove the `functions` config from your `now.json` or `vercel.json` to take adva
### Useful Links
- [Functions Config Documentation](https://vercel.com/docs/configuration?query=functions#project/functions)
- [Functions Config Documentation](https://vercel.com/docs/concepts/projects/project-configuration#functions)

View File

@@ -11,6 +11,6 @@ Migrate from using legacy `routes` to the new `rewrites`, `redirects`, and `head
### Useful Links
- [Rewrites Documentation](https://vercel.com/docs/configuration?query=rewrites#project/rewrites)
- [Redirects Documentation](https://vercel.com/docs/configuration?query=rewrites#project/redirects)
- [Headers Documentation](https://vercel.com/docs/configuration?query=rewrites#project/headers)
- [Rewrites Documentation](https://vercel.com/docs/concepts/projects/project-configuration#rewrites)
- [Redirects Documentation](https://vercel.com/docs/concepts/projects/project-configuration#redirects)
- [Headers Documentation](https://vercel.com/docs/concepts/projects/project-configuration#headers)

View File

@@ -2,15 +2,15 @@
#### Why This Error Occurred
This could be caused by a misconfigured "Build Command" or "Output Directory" for your Next.js project.
This error is often caused by a misconfigured "Build Command" or "Output Directory" for your Next.js project.
#### Possible Ways to Fix It
In the Vercel dashboard, open your "Project Settings" and draw attention to "Build & Development Settings":
1. Ensure that the "Build Command" setting is not changed, or that it calls `next build`. If this command is not changed but you are seeing this error, double check that your `build` script in `package.json` calls `next build`.
2. Ensure that the "Output Directory" setting is not changed. This value almost never needs to be configured, and is only necessary if you override `distDir` in `next.config.js`.
3. For `next export` users: **do not override the "Output Directory"**. Next.js automatically detects what folder you outputted `next export` to.
1. Ensure that the "Build Command" setting is not overridden, or that it calls `next build`. If this command is not overridden but you are seeing this error, double check that your `build` script in `package.json` calls `next build`. If `buildCommand` exists in `vercel.json`, make sure it calls `next build`.
2. Ensure that the "Output Directory" setting is not overridden. This value almost never needs to be configured, and is only necessary if you override `distDir` in `next.config.js`. If `outputDirectory` exists in `vercel.json`, remove that property.
3. For `next export` users: **do not override the "Output Directory"**, even if you customized the `next export` output directory. It will automatically detects the correct output.
In rare scenarios, this error message can also be caused by a Next.js build failure (if your "Build Command" accidentally returns an exit code that is not 0).
Double check for any error messages above the Routes Manifest error, which may provide additional details.

View File

@@ -4,7 +4,7 @@
"description": "Each subdirectory is an example boilerplate for a framework. This package.json only exists for testing purposes.",
"scripts": {
"test-unit": "pnpm test __tests__/unit/",
"test-integration-once": "pnpm test __tests__/integration/",
"test-e2e": "pnpm test __tests__/integration/",
"test": "jest --env node --verbose --runInBand --bail"
},
"devDependencies": {

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.0"
"turbo": "1.7.4"
},
"scripts": {
"lerna": "lerna",
@@ -47,9 +47,9 @@
"pre-commit": "lint-staged",
"test": "jest --rootDir=\"test\" --testPathPattern=\"\\.test.js\"",
"test-unit": "pnpm test && node utils/gen.js && turbo run test-unit",
"test-integration-cli": "node utils/gen.js && turbo run test-integration-cli",
"test-integration-once": "node utils/gen.js && turbo run test-integration-once",
"test-integration-dev": "node utils/gen.js && turbo run test-integration-dev",
"test-cli": "node utils/gen.js && turbo run test-cli",
"test-e2e": "node utils/gen.js && turbo run test-e2e",
"test-dev": "node utils/gen.js && turbo run test-dev",
"lint": "eslint . --cache --ext .ts,.js",
"prepare": "husky install",
"pack": "cd utils && node -r ts-eager/register ./pack.ts"

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/build-utils",
"version": "6.2.2",
"version": "6.2.3",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
@@ -14,7 +14,7 @@
"build": "node build",
"test": "jest --env node --verbose --runInBand --bail",
"test-unit": "pnpm test test/unit.*test.*",
"test-integration-once": "pnpm test test/integration.test.ts"
"test-e2e": "pnpm test test/integration.test.ts"
},
"devDependencies": {
"@iarna/toml": "2.2.3",

View File

@@ -44,7 +44,8 @@ export function getPrettyError(obj: {
message?: string;
params: any;
}): NowBuildError {
const docsUrl = 'https://vercel.com/docs/configuration';
const docsUrl =
'https://vercel.com/docs/concepts/projects/project-configuration';
try {
const { dataPath, params, message: ajvMessage } = obj;
const prop = getTopLevelPropertyName(dataPath);
@@ -63,7 +64,7 @@ export function getPrettyError(obj: {
return new NowBuildError({
code: 'INVALID_VERCEL_CONFIG',
message: message,
link: prop ? `${docsUrl}#project/${prop.toLowerCase()}` : docsUrl,
link: prop ? `${docsUrl}#${prop.toLowerCase()}` : docsUrl,
action: 'View Documentation',
});
} catch (e) {

View File

@@ -13,10 +13,8 @@ export const functionsSchema = {
maxLength: 256,
},
memory: {
// Number between 128 and 3008 in steps of 64
enum: Object.keys(Array.from({ length: 50 }))
.slice(2, 48)
.map(x => Number(x) * 64),
minimum: 128,
maximum: 3008,
},
maxDuration: {
type: 'number',

View File

@@ -502,6 +502,10 @@ it('should retry npm install when peer deps invalid and npm@8 on node@16', async
console.log(`Skipping test on node@${nodeMajor}`);
return;
}
if (process.platform === 'win32') {
console.log('Skipping test on windows');
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.15.4",
"version": "28.15.5",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -14,8 +14,8 @@
"preinstall": "node ./scripts/preinstall.js",
"test": "jest --env node --verbose --bail",
"test-unit": "pnpm test test/unit/",
"test-integration-cli": "rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose",
"test-integration-dev": "pnpm test test/dev/",
"test-cli": "rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose",
"test-dev": "pnpm test test/dev/",
"coverage": "codecov",
"build": "ts-node ./scripts/build.ts",
"dev": "ts-node ./src/index.ts"
@@ -41,16 +41,16 @@
"node": ">= 14"
},
"dependencies": {
"@vercel/build-utils": "6.2.2",
"@vercel/go": "2.3.4",
"@vercel/hydrogen": "0.0.50",
"@vercel/next": "3.4.3",
"@vercel/node": "2.9.3",
"@vercel/python": "3.1.46",
"@vercel/redwood": "1.1.2",
"@vercel/remix": "1.2.13",
"@vercel/ruby": "1.3.62",
"@vercel/static-build": "1.3.6"
"@vercel/build-utils": "6.2.3",
"@vercel/go": "2.3.5",
"@vercel/hydrogen": "0.0.51",
"@vercel/next": "3.4.4",
"@vercel/node": "2.9.4",
"@vercel/python": "3.1.47",
"@vercel/redwood": "1.1.3",
"@vercel/remix": "1.3.0",
"@vercel/ruby": "1.3.63",
"@vercel/static-build": "1.3.7"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",
@@ -93,10 +93,10 @@
"@types/which": "1.3.2",
"@types/write-json-file": "2.2.1",
"@types/yauzl-promise": "2.1.0",
"@vercel/client": "12.3.8",
"@vercel/client": "12.3.9",
"@vercel/error-utils": "1.0.8",
"@vercel/frameworks": "1.3.0",
"@vercel/fs-detectors": "3.7.11",
"@vercel/fs-detectors": "3.7.12",
"@vercel/fun": "1.0.4",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.1.8",

View File

@@ -701,7 +701,7 @@ function expandBuild(files: string[], build: Builder): Builder[] {
throw new NowBuildError({
code: `invalid_build_specification`,
message: 'Field `use` is missing in build specification',
link: 'https://vercel.com/docs/configuration#project/builds',
link: 'https://vercel.com/docs/concepts/projects/project-configuration#builds',
action: 'View Documentation',
});
}
@@ -711,7 +711,7 @@ function expandBuild(files: string[], build: Builder): Builder[] {
throw new NowBuildError({
code: `invalid_build_specification`,
message: 'A build `src` path resolves to an empty string',
link: 'https://vercel.com/docs/configuration#project/builds',
link: 'https://vercel.com/docs/concepts/projects/project-configuration#builds',
action: 'View Documentation',
});
}

View File

@@ -1,73 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# dotenv environment variables file
.env
.env.build
# gatsby files
.cache/
public
# Mac files
.DS_Store
# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
.now
.vercel

View File

@@ -1,7 +0,0 @@
/**
* Implement Gatsby's Browser APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/browser-apis/
*/
// You can delete this file if you're not using it

View File

@@ -1,16 +0,0 @@
module.exports = {
siteMetadata: {
title: 'Gatsby Default Starter',
},
plugins: [
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `05-gatsby`,
short_name: `starter`,
start_url: `/`,
icon: 'src/images/gatsby-icon.png',
},
},
],
};

View File

@@ -1,7 +0,0 @@
/**
* Implement Gatsby's Node APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/node-apis/
*/
// You can delete this file if you're not using it

View File

@@ -1,7 +0,0 @@
/**
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/ssr-apis/
*/
// You can delete this file if you're not using it

View File

@@ -1,16 +0,0 @@
{
"private": true,
"name": "gatsby",
"version": "1.0.0",
"dependencies": {
"gatsby": "^2.18.14",
"gatsby-image": "^2.0.15",
"gatsby-plugin-manifest": "^2.0.5",
"react": "^16.5.1",
"react-dom": "^16.5.1"
},
"scripts": {
"dev": "gatsby develop",
"build": "gatsby build"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,11 +0,0 @@
import React from 'react';
function Custom404() {
return (
<main>
<h1>Custom Gatsby 404</h1>
</main>
);
}
export default Custom404;

View File

@@ -1,12 +0,0 @@
import React from 'react';
function Index() {
return (
<main>
<h1>Gatsby Default Starter</h1>
<p>Hello World</p>
</main>
);
}
export default Index;

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +0,0 @@
*.log
.cache
.DS_Store
src/.temp
node_modules
dist
.env
.env.*
!yarn.lock
.now
.vercel

View File

@@ -1,2 +0,0 @@
README.md
yarn.lock

View File

@@ -1,19 +0,0 @@
# Gridsome Example
This directory is a brief example of a [Gridsome](https://gridsome.org/) app that can be deployed to Vercel with zero configuration.
## How we created this example
To get started with Gridsome on Vercel, you can use the [Gridsome CLI](https://gridsome.org/docs/gridsome-cli/) to initialize the project:
```shell
$ gridsome create my-website
```
## Deploying this Example
Once initialized, you can deploy the Gridsome example with just a single command:
```shell
$ vercel
```

View File

@@ -1,10 +0,0 @@
// This is where project configuration and plugin options are located.
// Learn more: https://gridsome.org/docs/config
// Changes here require a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`
module.exports = {
siteName: 'Gridsome',
plugins: []
}

View File

@@ -1,16 +0,0 @@
// Server API makes it possible to hook into various parts of Gridsome
// on server-side and add custom data to the GraphQL data layer.
// Learn more: https://gridsome.org/docs/server-api
// Changes here require a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`
module.exports = function (api) {
api.loadSource(({ addContentType }) => {
// Use the Data Store API here: https://gridsome.org/docs/data-store-api
})
api.createPages(({ createPage }) => {
// Use the Pages API here: https://gridsome.org/docs/pages-api
})
}

View File

@@ -1,15 +0,0 @@
{
"name": "gridsomee",
"private": true,
"scripts": {
"build": "gridsome build",
"dev": "gridsome develop -p $PORT",
"explore": "gridsome explore"
},
"dependencies": {
"gridsome": "0.7.23"
},
"engines": {
"node": "14.x"
}
}

View File

@@ -1,4 +0,0 @@
Add components that will be imported to Pages and Layouts to this folder.
Learn more about components here: https://gridsome.org/docs/components
You can delete this file.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -1,50 +0,0 @@
<template>
<div class="layout">
<header class="header">
<strong>
<g-link to="/">{{ $static.metaData.siteName }}</g-link>
</strong>
<nav class="nav">
<g-link class="nav__link" to="/">Home</g-link>
<g-link class="nav__link" to="/about">About</g-link>
</nav>
</header>
<slot/>
</div>
</template>
<static-query>
query {
metaData {
siteName
}
}
</static-query>
<style>
body {
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
margin:0;
padding:0;
line-height: 1.5;
}
.layout {
max-width: 760px;
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
height: 80px;
}
.nav__link {
margin-left: 20px;
}
</style>

View File

@@ -1,5 +0,0 @@
Layout components are used to wrap pages and templates. Layouts should contain components like headers, footers or sidebars that will be used across the site.
Learn more about Layouts: https://gridsome.org/docs/layouts
You can delete this file.

View File

@@ -1,9 +0,0 @@
// This is the main.js file. Import global CSS and scripts here.
// The Client API can be used here. Learn more: gridsome.org/docs/client-api
import DefaultLayout from '~/layouts/Default.vue'
export default function (Vue, { router, head, isClient }) {
// Set default layout as a global component
Vue.component('Layout', DefaultLayout)
}

View File

@@ -1,14 +0,0 @@
<template>
<Layout>
<h1>Not Found</h1>
<p>This is a Custom Gridsome 404.</p>
</Layout>
</template>
<script>
export default {
metaInfo: {
title: 'Not Found'
}
}
</script>

View File

@@ -1,14 +0,0 @@
<template>
<Layout>
<h1>About us</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error doloremque omnis animi, eligendi magni a voluptatum, vitae, consequuntur rerum illum odit fugit assumenda rem dolores inventore iste reprehenderit maxime! Iusto.</p>
</Layout>
</template>
<script>
export default {
metaInfo: {
title: 'About us'
}
}
</script>

View File

@@ -1,33 +0,0 @@
<template>
<Layout>
<!-- Learn how to use images here: https://gridsome.org/docs/images -->
<g-image alt="Example image" src="~/favicon.png" width="135" />
<h1>Gridsome on Vercel</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Pariatur excepturi labore tempore expedita, et iste tenetur suscipit explicabo! Dolores, aperiam non officia eos quod asperiores
</p>
<p class="home-links">
<a href="https://gridsome.org/docs" target="_blank" rel="noopener">Gridsome Docs</a>
<a href="https://github.com/gridsome/gridsome" target="_blank" rel="noopener">GitHub</a>
</p>
</Layout>
</template>
<script>
export default {
metaInfo: {
title: 'Hello, world!'
}
}
</script>
<style>
.home-links a {
margin-right: 1rem;
}
</style>

View File

@@ -1,5 +0,0 @@
Pages are usually used for normal pages or for listing items from a GraphQL collection.
Add .vue files here to create pages. For example **About.vue** will be **site.com/about**.
Learn more about pages: https://gridsome.org/docs/pages
You can delete this file.

View File

@@ -1,7 +0,0 @@
Templates for **GraphQL collections** should be added here.
To create a template for a collection called `WordPressPost`
create a file named `WordPressPost.vue` in this folder.
Learn more: https://gridsome.org/docs/templates
You can delete this file.

View File

@@ -1,3 +0,0 @@
Add static files here. Files in this directory will be copied directly to `dist` folder during build. For example, /static/robots.txt will be located at https://yoursite.com/robots.txt.
This file should be deleted.

View File

@@ -1,3 +0,0 @@
{
"redirects": [{ "source": "/support", "destination": "/about?ref=support" }]
}

File diff suppressed because it is too large Load Diff

View File

@@ -105,7 +105,7 @@ test('[vercel dev] throws an error when an edge function has no response', async
expect(await res.status).toBe(500);
expect(await res.text()).toMatch('FUNCTION_INVOCATION_FAILED');
expect(stdout).toMatch(
/Error from API Route api\/edge-no-response: Edge Function "api\/edge-no-response.js" did not return a response./g
/Error from API Route \/api\/edge-no-response: Edge Function "api\/edge-no-response.js" did not return a response./g
);
} finally {
await dev.kill();
@@ -161,7 +161,7 @@ test('[vercel dev] should handle runtime errors thrown in edge functions', async
/<strong>500<\/strong>: INTERNAL_SERVER_ERROR/g
);
expect(stdout).toMatch(
/Error from API Route api\/edge-error-runtime: intentional runtime error/g
/Error from API Route \/api\/edge-error-runtime: intentional runtime error/g
);
} finally {
await dev.kill();

View File

@@ -70,27 +70,6 @@ test(
await testPath(200, '/', /React App/m);
})
);
/*
test(
'[vercel dev] 05-gatsby',
testFixtureStdio('05-gatsby', async (testPath: any) => {
await testPath(200, '/', /Gatsby Default Starter/m);
})
);
*/
test(
'[vercel dev] 06-gridsome',
testFixtureStdio('06-gridsome', async (testPath: any) => {
await testPath(200, '/');
await testPath(200, '/about');
await testPath(308, '/support', 'Redirecting to /about?ref=support (308)', {
Location: '/about?ref=support',
});
// Bug with gridsome's dev server: https://github.com/gridsome/gridsome/issues/831
// Works in prod only so leave out for now
// await testPath(404, '/nothing');
})
);
test(
'[vercel dev] 07-hexo-node',

View File

@@ -271,7 +271,7 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
},
}),
},
'lambda-with-200-memory': {
'lambda-with-123-memory': {
'api/memory.js': `
module.exports = (req, res) => {
res.json({ memory: parseInt(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE) });
@@ -280,7 +280,7 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
'now.json': JSON.stringify({
functions: {
'api/**/*.js': {
memory: 200,
memory: 123,
},
},
}),

View File

@@ -1967,7 +1967,11 @@ test('try to create a builds deployments with wrong now.json', async t => {
'Error: Invalid now.json - should NOT have additional property `builder`. Did you mean `builds`?'
)
);
t.true(stderr.includes('https://vercel.com/docs/configuration'));
t.true(
stderr.includes(
'https://vercel.com/docs/concepts/projects/project-configuration'
)
);
});
test('try to create a builds deployments with wrong vercel.json', async t => {
@@ -1991,7 +1995,11 @@ test('try to create a builds deployments with wrong vercel.json', async t => {
'Error: Invalid vercel.json - should NOT have additional property `fake`. Please remove it.'
)
);
t.true(stderr.includes('https://vercel.com/docs/configuration'));
t.true(
stderr.includes(
'https://vercel.com/docs/concepts/projects/project-configuration'
)
);
});
test('try to create a builds deployments with wrong `build.env` property', async t => {
@@ -2014,7 +2022,9 @@ test('try to create a builds deployments with wrong `build.env` property', async
formatOutput({ stdout, stderr })
);
t.true(
stderr.includes('https://vercel.com/docs/configuration'),
stderr.includes(
'https://vercel.com/docs/concepts/projects/project-configuration'
),
formatOutput({ stdout, stderr })
);
});
@@ -2719,11 +2729,15 @@ test('deploy a Lambda with 128MB of memory', async t => {
});
test('fail to deploy a Lambda with an incorrect value for of memory', async t => {
const directory = fixture('lambda-with-200-memory');
const directory = fixture('lambda-with-123-memory');
const output = await execute([directory, '--yes']);
t.is(output.exitCode, 1, formatOutput(output));
t.regex(output.stderr, /steps of 64/gm, formatOutput(output));
t.regex(
output.stderr,
/Serverless Functions.+memory/gm,
formatOutput(output)
);
t.regex(output.stderr, /Learn More/gm, formatOutput(output));
});

View File

@@ -1080,7 +1080,7 @@ describe('build', () => {
await expect(client.stderr).toOutput(
'Error: Invalid vercel.json - `rewrites[2]` should NOT have additional property `src`. Did you mean `source`?' +
'\n' +
'View Documentation: https://vercel.com/docs/configuration#project/rewrites'
'View Documentation: https://vercel.com/docs/concepts/projects/project-configuration#rewrites'
);
const builds = await fs.readJSON(join(output, 'builds.json'));
expect(builds.builds).toBeUndefined();
@@ -1091,7 +1091,7 @@ describe('build', () => {
stack: expect.stringContaining('at validateConfig'),
hideStackTrace: true,
code: 'INVALID_VERCEL_CONFIG',
link: 'https://vercel.com/docs/configuration#project/rewrites',
link: 'https://vercel.com/docs/concepts/projects/project-configuration#rewrites',
action: 'View Documentation',
});
const configJson = await fs.readJSON(join(output, 'config.json'));

View File

@@ -41,7 +41,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `rewrites[0]` should NOT have additional property `src`. Did you mean `source`?'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/rewrites'
'https://vercel.com/docs/concepts/projects/project-configuration#rewrites'
);
});
@@ -54,7 +54,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `routes[0]` should NOT have additional property `source`. Did you mean `src`?'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/routes'
'https://vercel.com/docs/concepts/projects/project-configuration#routes'
);
});
@@ -67,7 +67,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `routes` should be array.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/routes'
'https://vercel.com/docs/concepts/projects/project-configuration#routes'
);
});
@@ -84,7 +84,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `redirects[0]` missing required property `source`.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/redirects'
'https://vercel.com/docs/concepts/projects/project-configuration#redirects'
);
});
@@ -97,7 +97,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `redirects[0].permanent` should be boolean.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/redirects'
'https://vercel.com/docs/concepts/projects/project-configuration#redirects'
);
});
@@ -110,7 +110,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `cleanUrls` should be boolean.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/cleanurls'
'https://vercel.com/docs/concepts/projects/project-configuration#cleanurls'
);
});
@@ -123,7 +123,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `trailingSlash` should be boolean.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/trailingslash'
'https://vercel.com/docs/concepts/projects/project-configuration#trailingslash'
);
});
@@ -136,7 +136,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `headers[0]` should NOT have additional property `Content-Type`. Please remove it.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/headers'
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
);
});
@@ -149,7 +149,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `headers[0].source` should be string.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/headers'
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
);
});
@@ -162,7 +162,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `headers[0]` should NOT have additional property `stuff`. Please remove it.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/headers'
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
);
});
@@ -175,7 +175,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `headers[0].headers[0]` should NOT have additional property `Content-Type`. Please remove it.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/headers'
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
);
});
@@ -190,7 +190,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `headers[0].headers[0]` should NOT have additional property `val`. Please remove it.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/headers'
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
);
});
@@ -205,7 +205,7 @@ describe('validateConfig', () => {
'Invalid vercel.json - `redirects` should NOT have more than 1024 items.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/redirects'
'https://vercel.com/docs/concepts/projects/project-configuration#redirects'
);
});
@@ -229,7 +229,39 @@ describe('validateConfig', () => {
'Invalid vercel.json - `headers[1].headers` should NOT have more than 1024 items.'
);
expect(error!.link).toEqual(
'https://vercel.com/docs/configuration#project/headers'
'https://vercel.com/docs/concepts/projects/project-configuration#headers'
);
});
it('should error with too low memory value', async () => {
const error = validateConfig({
functions: {
'api/test.js': {
memory: 127,
},
},
});
expect(error!.message).toEqual(
"Invalid vercel.json - `functions['api/test.js'].memory` should be >= 128."
);
expect(error!.link).toEqual(
'https://vercel.com/docs/concepts/projects/project-configuration#functions'
);
});
it('should error with too high memory value', async () => {
const error = validateConfig({
functions: {
'api/test.js': {
memory: 3009,
},
},
});
expect(error!.message).toEqual(
"Invalid vercel.json - `functions['api/test.js'].memory` should be <= 3008."
);
expect(error!.link).toEqual(
'https://vercel.com/docs/concepts/projects/project-configuration#functions'
);
});

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/client",
"version": "12.3.8",
"version": "12.3.9",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"homepage": "https://vercel.com",
@@ -15,7 +15,7 @@
},
"scripts": {
"build": "tsc",
"test-integration-once": "pnpm test tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts",
"test-e2e": "pnpm test tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts",
"test": "jest --env node --verbose --runInBand --bail",
"test-unit": "pnpm test tests/unit.*test.*"
},
@@ -43,7 +43,7 @@
]
},
"dependencies": {
"@vercel/build-utils": "6.2.2",
"@vercel/build-utils": "6.2.3",
"@vercel/routing-utils": "2.1.8",
"@zeit/fetch": "5.2.0",
"async-retry": "1.2.3",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/fs-detectors",
"version": "3.7.11",
"version": "3.7.12",
"description": "Vercel filesystem detectors",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -35,7 +35,7 @@
"@types/minimatch": "3.0.5",
"@types/node": "14.18.33",
"@types/semver": "7.3.10",
"@vercel/build-utils": "6.2.2",
"@vercel/build-utils": "6.2.3",
"typescript": "4.3.4"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/gatsby-plugin-vercel-builder",
"version": "1.1.4",
"version": "1.1.5",
"main": "dist/index.js",
"files": [
"dist",
@@ -14,8 +14,8 @@
"build:src": "tsc -p tsconfig.src.json"
},
"dependencies": {
"@vercel/build-utils": "6.2.2",
"@vercel/node": "2.9.3",
"@vercel/build-utils": "6.2.3",
"@vercel/node": "2.9.4",
"@vercel/routing-utils": "2.1.8",
"ajv": "8.12.0",
"esbuild": "0.14.47",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/go",
"version": "2.3.4",
"version": "2.3.5",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/go",
@@ -12,7 +12,7 @@
"scripts": {
"build": "node build",
"test": "jest --env node --verbose --runInBand --bail",
"test-integration-once": "pnpm test"
"test-e2e": "pnpm test"
},
"files": [
"dist"
@@ -36,7 +36,7 @@
"@types/node": "14.18.33",
"@types/node-fetch": "^2.3.0",
"@types/tar": "^4.0.0",
"@vercel/build-utils": "6.2.2",
"@vercel/build-utils": "6.2.3",
"@vercel/ncc": "0.24.0",
"async-retry": "1.3.1",
"execa": "^1.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/hydrogen",
"version": "0.0.50",
"version": "0.0.51",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -11,7 +11,7 @@
},
"scripts": {
"build": "node build.js",
"test-integration-once": "pnpm test test/test.js",
"test-e2e": "pnpm test test/test.js",
"test": "jest --env node --verbose --bail --runInBand"
},
"files": [
@@ -21,7 +21,7 @@
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "14.18.33",
"@vercel/build-utils": "6.2.2",
"@vercel/build-utils": "6.2.3",
"@vercel/static-config": "2.0.12",
"execa": "3.2.0",
"fs-extra": "11.1.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "3.4.3",
"version": "3.4.4",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -11,7 +11,7 @@
"test-unit": "pnpm test test/unit/",
"test-next-local": "pnpm test test/integration/*.test.js test/integration/*.test.ts",
"test-next-local:middleware": "pnpm test test/integration/middleware.test.ts",
"test-integration-once": "rm -f test/builder-info.json; pnpm test test/fixtures/**/*.test.js"
"test-e2e": "rm -f test/builder-info.json; pnpm test test/fixtures/**/*.test.js"
},
"repository": {
"type": "git",
@@ -45,7 +45,7 @@
"@types/semver": "6.0.0",
"@types/text-table": "0.2.1",
"@types/webpack-sources": "3.2.0",
"@vercel/build-utils": "6.2.2",
"@vercel/build-utils": "6.2.3",
"@vercel/nft": "0.22.5",
"@vercel/routing-utils": "2.1.8",
"async-sema": "3.0.1",

View File

@@ -269,12 +269,7 @@ export async function getRoutesManifest(
if (shouldHaveManifest && !hasRoutesManifest) {
throw new NowBuildError({
message:
`The file "${pathRoutesManifest}" couldn't be found. This is normally caused by a misconfiguration in your project.\n` +
'Please check the following, and reach out to support if you cannot resolve the problem:\n' +
' 1. If present, be sure your `build` script in "package.json" calls `next build`.' +
' 2. Navigate to your project\'s settings in the Vercel dashboard, and verify that the "Build Command" is not overridden, or that it calls `next build`.' +
' 3. Navigate to your project\'s settings in the Vercel dashboard, and verify that the "Output Directory" is not overridden. Note that `next export` does **not** require you change this setting, even if you customize the `next export` output directory.',
message: `The file "${pathRoutesManifest}" couldn't be found. This is often caused by a misconfiguration in your project.`,
link: 'https://err.sh/vercel/vercel/now-next-routes-manifest',
code: 'NEXT_NO_ROUTES_MANIFEST',
});
@@ -2031,7 +2026,8 @@ export const onPrerenderRoute =
const rscVaryHeader =
routesManifest?.rsc?.varyHeader ||
'__rsc__, __next_router_state_tree__, __next_router_prefetch__';
const rscContentTypeHeader = routesManifest?.rsc?.contentTypeHeader || 'application/octet-stream';
const rscContentTypeHeader =
routesManifest?.rsc?.contentTypeHeader || 'application/octet-stream';
prerenders[outputPathPage] = new Prerender({
expiration: initialRevalidate,

View File

@@ -27,7 +27,7 @@
"RSC": "1"
},
"responseHeaders": {
"content-type": "application/octet-stream"
"content-type": "text/x-component"
}
},
{
@@ -51,7 +51,7 @@
"RSC": "1"
},
"responseHeaders": {
"content-type": "application/octet-stream"
"content-type": "text/x-component"
}
}
]

View File

@@ -30,7 +30,7 @@
"RSC": "1"
},
"responseHeaders": {
"content-type": "application/octet-stream",
"content-type": "text/x-component",
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
}
},

View File

@@ -122,7 +122,7 @@
"RSC": "1"
},
"responseHeaders": {
"content-type": "application/octet-stream",
"content-type": "text/x-component",
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
}
},

View File

@@ -119,7 +119,7 @@
"RSC": "1"
},
"responseHeaders": {
"content-type": "application/octet-stream",
"content-type": "text/x-component",
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
}
},

View File

@@ -4,7 +4,7 @@
"build": "next build"
},
"engines": {
"node": "14.x"
"node": "16.x"
},
"dependencies": {
"chrome-aws-lambda": "8.0.0",

View File

@@ -3,7 +3,7 @@
"name": "25-mono-repo-packages-webapp",
"version": "0.0.1",
"engines": {
"node": "14.x"
"node": "16.x"
},
"dependencies": {
"next": "9.3.4",

View File

@@ -2,5 +2,6 @@
"workspaces": [
"packages/*"
],
"private": true
"private": true,
"packageManager": "yarn@1.22.19"
}

View File

@@ -2,7 +2,7 @@
"name": "26-packages-webapp",
"version": "0.0.1",
"engines": {
"node": "14.x"
"node": "16.x"
},
"dependencies": {
"next": "9.3.4",

View File

@@ -1089,11 +1089,6 @@
resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d"
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==
abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
acorn@^6.2.1:
version "6.4.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474"
@@ -1135,11 +1130,6 @@ ansi-regex@^2.0.0:
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
ansi-regex@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
@@ -1168,19 +1158,11 @@ anymatch@~3.1.1:
normalize-path "^3.0.0"
picomatch "^2.0.4"
aproba@^1.0.3, aproba@^1.1.1:
aproba@^1.1.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==
are-we-there-yet@~1.1.2:
version "1.1.5"
resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21"
integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==
dependencies:
delegates "^1.0.0"
readable-stream "^2.0.6"
arity-n@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/arity-n/-/arity-n-1.0.4.tgz#d9e76b11733e08569c0847ae7b39b2860b30b745"
@@ -1616,11 +1598,6 @@ clone-deep@^4.0.1:
kind-of "^6.0.2"
shallow-clone "^3.0.0"
code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
collection-visit@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
@@ -1683,11 +1660,6 @@ console-browserify@^1.1.0:
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336"
integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==
console-control-strings@^1.0.0, console-control-strings@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=
constants-browserify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75"
@@ -1844,13 +1816,6 @@ debug@^2.2.0, debug@^2.3.3:
dependencies:
ms "2.0.0"
debug@^3.2.6:
version "3.2.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
dependencies:
ms "^2.1.1"
debug@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
@@ -1863,11 +1828,6 @@ decode-uri-component@^0.2.0:
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==
deep-extend@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
define-properties@^1.1.2:
version "1.1.3"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
@@ -1897,11 +1857,6 @@ define-property@^2.0.2:
is-descriptor "^1.0.2"
isobject "^3.0.1"
delegates@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
des.js@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843"
@@ -1910,11 +1865,6 @@ des.js@^1.0.0:
inherits "^2.0.1"
minimalistic-assert "^1.0.0"
detect-libc@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
diffie-hellman@^5.0.0:
version "5.0.3"
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875"
@@ -2244,13 +2194,6 @@ from2@^2.1.0:
inherits "^2.0.1"
readable-stream "^2.0.0"
fs-minipass@^1.2.5:
version "1.2.7"
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7"
integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==
dependencies:
minipass "^2.6.0"
fs-write-stream-atomic@^1.0.8:
version "1.0.10"
resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9"
@@ -2284,20 +2227,6 @@ function-bind@^1.1.1:
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
gauge@~2.7.3:
version "2.7.4"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=
dependencies:
aproba "^1.0.3"
console-control-strings "^1.0.0"
has-unicode "^2.0.0"
object-assign "^4.1.0"
signal-exit "^3.0.0"
string-width "^1.0.1"
strip-ansi "^3.0.1"
wide-align "^1.1.0"
get-value@^2.0.3, get-value@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
@@ -2362,11 +2291,6 @@ has-symbols@^1.0.0:
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8"
integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==
has-unicode@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=
has-value@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f"
@@ -2445,13 +2369,6 @@ https-browserify@^1.0.0:
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=
iconv-lite@^0.4.4:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
dependencies:
safer-buffer ">= 2.1.2 < 3"
icss-utils@^4.0.0, icss-utils@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-4.1.1.tgz#21170b53789ee27447c2f47dd683081403f9a467"
@@ -2469,13 +2386,6 @@ iferr@^0.1.5:
resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"
integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE=
ignore-walk@^3.0.1:
version "3.0.3"
resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37"
integrity sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==
dependencies:
minimatch "^3.0.4"
imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
@@ -2514,11 +2424,6 @@ inherits@2.0.3:
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
ini@~1.3.0:
version "1.3.5"
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
invariant@^2.2.2:
version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
@@ -2608,18 +2513,6 @@ is-extglob@^2.1.0, is-extglob@^2.1.1:
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
is-fullwidth-code-point@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs=
dependencies:
number-is-nan "^1.0.0"
is-fullwidth-code-point@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
is-glob@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a"
@@ -2952,21 +2845,6 @@ minimist@^1.2.0, minimist@^1.2.5:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6"
integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==
dependencies:
safe-buffer "^5.1.2"
yallist "^3.0.0"
minizlib@^1.2.1:
version "1.3.3"
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d"
integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==
dependencies:
minipass "^2.9.0"
mississippi@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022"
@@ -2991,7 +2869,7 @@ mixin-deep@^1.2.0:
for-in "^1.0.2"
is-extendable "^1.0.1"
mkdirp@^0.5.0, mkdirp@^0.5.1:
mkdirp@^0.5.1:
version "0.5.5"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
@@ -3049,15 +2927,6 @@ native-url@0.2.6:
dependencies:
querystring "^0.2.0"
needle@^2.2.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.1.tgz#14af48732463d7475696f937626b1b993247a56a"
integrity sha512-x/gi6ijr4B7fwl6WYL9FwlCvRQKGlUNvnceho8wxkwXqN8jvVmmmATTmZPRRG7b/yC1eode26C2HO9jl78Du9g==
dependencies:
debug "^3.2.6"
iconv-lite "^0.4.4"
sax "^1.2.4"
neo-async@^2.5.0, neo-async@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
@@ -3148,35 +3017,11 @@ node-libs-browser@^2.2.1:
util "^0.11.0"
vm-browserify "^1.0.1"
node-pre-gyp@*:
version "0.14.0"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83"
integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==
dependencies:
detect-libc "^1.0.2"
mkdirp "^0.5.1"
needle "^2.2.1"
nopt "^4.0.1"
npm-packlist "^1.1.6"
npmlog "^4.0.2"
rc "^1.2.7"
rimraf "^2.6.1"
semver "^5.3.0"
tar "^4.4.2"
node-releases@^1.1.44, node-releases@^1.1.53:
version "1.1.53"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.53.tgz#2d821bfa499ed7c5dffc5e2f28c88e78a08ee3f4"
integrity sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ==
nopt@^4.0.1:
version "4.0.3"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48"
integrity sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==
dependencies:
abbrev "1"
osenv "^0.1.4"
normalize-html-whitespace@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/normalize-html-whitespace/-/normalize-html-whitespace-1.0.0.tgz#5e3c8e192f1b06c3b9eee4b7e7f28854c7601e34"
@@ -3204,42 +3049,6 @@ normalize-url@1.9.1:
query-string "^4.1.0"
sort-keys "^1.0.0"
npm-bundled@^1.0.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b"
integrity sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==
dependencies:
npm-normalize-package-bin "^1.0.1"
npm-normalize-package-bin@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2"
integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==
npm-packlist@^1.1.6:
version "1.4.8"
resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.8.tgz#56ee6cc135b9f98ad3d51c1c95da22bbb9b2ef3e"
integrity sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==
dependencies:
ignore-walk "^3.0.1"
npm-bundled "^1.0.1"
npm-normalize-package-bin "^1.0.1"
npmlog@^4.0.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
dependencies:
are-we-there-yet "~1.1.2"
console-control-strings "~1.1.0"
gauge "~2.7.3"
set-blocking "~2.0.0"
number-is-nan@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
@@ -3300,24 +3109,6 @@ os-browserify@^0.3.0:
resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"
integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=
os-homedir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
os-tmpdir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
osenv@^0.1.4:
version "0.1.5"
resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==
dependencies:
os-homedir "^1.0.0"
os-tmpdir "^1.0.0"
p-limit@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
@@ -3657,16 +3448,6 @@ randomfill@^1.0.3:
randombytes "^2.0.5"
safe-buffer "^5.1.0"
rc@^1.2.7:
version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
dependencies:
deep-extend "^0.6.0"
ini "~1.3.0"
minimist "^1.2.0"
strip-json-comments "~2.0.1"
react-dom@^16.8.6:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f"
@@ -3696,7 +3477,7 @@ react@^16.8.6:
object-assign "^4.1.1"
prop-types "^15.6.2"
"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6:
"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6:
version "2.3.7"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
@@ -3853,7 +3634,7 @@ rework@1.0.1:
convert-source-map "^0.3.3"
css "^2.0.0"
rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3:
rimraf@^2.5.4, rimraf@^2.6.3:
version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
@@ -3892,11 +3673,6 @@ safe-regex@^1.1.0:
dependencies:
ret "~0.1.10"
"safer-buffer@>= 2.1.2 < 3":
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
sass-loader@8.0.2:
version "8.0.2"
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-8.0.2.tgz#debecd8c3ce243c76454f2e8290482150380090d"
@@ -3908,11 +3684,6 @@ sass-loader@8.0.2:
schema-utils "^2.6.1"
semver "^6.3.0"
sax@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
scheduler@^0.19.1:
version "0.19.1"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
@@ -3943,7 +3714,7 @@ semver@7.0.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==
semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
@@ -3958,11 +3729,6 @@ serialize-javascript@^2.1.2:
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61"
integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==
set-blocking@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc=
set-value@^2.0.0, set-value@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b"
@@ -3993,11 +3759,6 @@ shallow-clone@^3.0.0:
dependencies:
kind-of "^6.0.2"
signal-exit@^3.0.0:
version "3.0.3"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==
snapdragon-node@^2.0.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
@@ -4143,23 +3904,6 @@ string-hash@1.1.3:
resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b"
integrity sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=
string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=
dependencies:
code-point-at "^1.0.0"
is-fullwidth-code-point "^1.0.0"
strip-ansi "^3.0.0"
"string-width@^1.0.2 || 2":
version "2.1.1"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
dependencies:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"
string_decoder@^1.0.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
@@ -4174,25 +3918,13 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
strip-ansi@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
dependencies:
ansi-regex "^2.0.0"
strip-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
dependencies:
ansi-regex "^3.0.0"
strip-json-comments@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
style-loader@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.0.0.tgz#1d5296f9165e8e2c85d24eee0b7caf9ec8ca1f82"
@@ -4249,19 +3981,6 @@ tapable@^1.0.0, tapable@^1.1.3:
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2"
integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==
tar@^4.4.2:
version "4.4.13"
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525"
integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==
dependencies:
chownr "^1.1.1"
fs-minipass "^1.2.5"
minipass "^2.8.6"
minizlib "^1.2.1"
mkdirp "^0.5.0"
safe-buffer "^5.1.2"
yallist "^3.0.3"
terser-webpack-plugin@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c"
@@ -4565,13 +4284,6 @@ whatwg-fetch@3.0.0:
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==
wide-align@^1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==
dependencies:
string-width "^1.0.2 || 2"
worker-farm@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8"
@@ -4601,7 +4313,7 @@ y18n@^4.0.0:
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3:
yallist@^3.0.2:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==

View File

@@ -41,14 +41,15 @@ if (parseInt(process.versions.node.split('.')[0], 10) >= 16) {
expect(buildResult.output['dashboard.rsc'].fallback.fsPath).toMatch(
/server\/app\/dashboard\.rsc$/
);
expect(buildResult.output['dashboard/index/index'].type).toBe('Prerender');
expect(buildResult.output['dashboard/index/index'].fallback.fsPath).toMatch(
/server\/app\/dashboard\/index\.html$/
);
expect(buildResult.output['dashboard/index.rsc'].type).toBe('Prerender');
expect(buildResult.output['dashboard/index.rsc'].fallback.fsPath).toMatch(
/server\/app\/dashboard\/index\.rsc$/
);
// TODO: re-enable after index/index handling is corrected
// expect(buildResult.output['dashboard/index/index'].type).toBe('Prerender');
// expect(buildResult.output['dashboard/index/index'].fallback.fsPath).toMatch(
// /server\/app\/dashboard\/index\.html$/
// );
// expect(buildResult.output['dashboard/index.rsc'].type).toBe('Prerender');
// expect(buildResult.output['dashboard/index.rsc'].fallback.fsPath).toMatch(
// /server\/app\/dashboard\/index\.rsc$/
// );
});
it('should build with app-dir in edge runtime correctly', async () => {
@@ -366,11 +367,6 @@ it('Should not deploy preview lambdas for static site', async () => {
});
it('Should opt-out of shared lambdas when routes are detected', async () => {
if (__dirname.includes('file-system-api')) {
// Ignore, since `26-mono-repo-404-lambda` is not relevant for the File System API
return;
}
const {
buildResult: { output },
} = await runBuildLambda(
@@ -732,11 +728,6 @@ it('Should not exceed function limit for large dependencies (server build)', asy
});
it('Should not exceed function limit for large dependencies (shared lambda)', async () => {
if (__dirname.includes('file-system-api')) {
// Test is not relevant for the File System API
return;
}
let logs = '';
const origLog = console.log;

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node",
"version": "2.9.3",
"version": "2.9.4",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -13,7 +13,7 @@
"build": "node build",
"test": "jest --env node --verbose --bail --runInBand",
"test-unit": "pnpm test test/prepare-cache.test.ts test/utils.test.ts",
"test-integration-once": "pnpm test test/integration-*.test.js"
"test-e2e": "pnpm test test/integration-*.test.js"
},
"files": [
"dist"
@@ -31,7 +31,7 @@
"dependencies": {
"@edge-runtime/vm": "2.0.0",
"@types/node": "14.18.33",
"@vercel/build-utils": "6.2.2",
"@vercel/build-utils": "6.2.3",
"@vercel/node-bridge": "3.1.11",
"@vercel/static-config": "2.0.12",
"edge-runtime": "2.0.0",

View File

@@ -61,7 +61,8 @@ async function createEventHandler(
return createEdgeEventHandler(
entrypointPath,
entrypoint,
config.middleware || false
config.middleware || false,
config.zeroConfig
);
}

View File

@@ -7,7 +7,7 @@ import type { EdgeContext } from '@edge-runtime/vm';
import esbuild from 'esbuild';
import fetch from 'node-fetch';
import { createEdgeWasmPlugin, WasmAssets } from './edge-wasm-plugin';
import { logError } from '../utils';
import { entrypointToOutputPath, logError } from '../utils';
import { readFileSync } from 'fs';
const NODE_VERSION_MAJOR = process.version.match(/^v(\d+)\.\d+/)?.[1];
@@ -136,7 +136,8 @@ async function createEdgeRuntime(params?: {
export async function createEdgeEventHandler(
entrypointFullPath: string,
entrypointRelativePath: string,
isMiddleware: boolean
isMiddleware: boolean,
isZeroConfig?: boolean
): Promise<(request: IncomingMessage) => Promise<VercelProxyResponse>> {
const userCode = await compileUserCode(
entrypointFullPath,
@@ -167,9 +168,12 @@ export async function createEdgeEventHandler(
// We can't currently get a real stack trace from the Edge Function error,
// but we can fake a basic one that is still usefult to the user.
const fakeStackTrace = ` at (${entrypointRelativePath})`;
const urlPath = extractUrlPath(entrypointRelativePath);
const requestPath = entrypointToRequestPath(
entrypointRelativePath,
isZeroConfig
);
console.log(
`Error from API Route ${urlPath}: ${body}\n${fakeStackTrace}`
`Error from API Route ${requestPath}: ${body}\n${fakeStackTrace}`
);
// this matches the serverless function bridge launcher's behavior when
@@ -186,12 +190,11 @@ export async function createEdgeEventHandler(
};
}
// turns "api/some.func.js" into "api/some.func"
function extractUrlPath(entrypointRelativePath: string) {
const parts = entrypointRelativePath.split('.');
if (parts.length === 1) {
return entrypointRelativePath;
}
parts.pop();
return parts.join('.');
function entrypointToRequestPath(
entrypointRelativePath: string,
isZeroConfig?: boolean
) {
// ensure the path starts with a slash to match conventions used elsewhere,
// notably when rendering serverless function paths in error messages
return '/' + entrypointToOutputPath(entrypointRelativePath, isZeroConfig);
}

View File

@@ -180,6 +180,8 @@ async function compile(
return source;
}
const conditions = isEdgeFunction ? ['worker', 'browser'] : undefined;
const { fileList, esmFileList, warnings } = await nodeFileTrace(
[...inputFiles],
{
@@ -187,6 +189,7 @@ async function compile(
processCwd: workPath,
ts: true,
mixedModules: true,
conditions,
resolve(id, parent, job, cjsResolve) {
const normalizedWasmImports = id.replace(/\.wasm\?module$/i, '.wasm');
return nftResolveDependency(
@@ -197,7 +200,7 @@ async function compile(
);
},
ignore: config.excludeFiles,
async readFile(fsPath: string): Promise<Buffer | string | null> {
async readFile(fsPath) {
const relPath = relative(baseDir, fsPath);
// If this file has already been read then return from the cache

View File

@@ -0,0 +1,16 @@
import React from 'react';
import { renderToString } from 'react-dom/server';
export const config = {
runtime: 'edge'
};
export default async () => {
const el = React.createElement('h1', { children: `RANDOMNESS_PLACEHOLDER:Hello from Edge` });
const str = renderToString(el);
return new Response(str, {
headers: {
'content-type': 'text/html'
}
});
}

View File

@@ -0,0 +1,6 @@
{
"dependencies": {
"react": "18.2.0",
"react-dom": "18.2.0"
}
}

View File

@@ -1,5 +1,5 @@
{
"builds": [{ "src": "api/**/*.js", "use": "@vercel/node" }],
"builds": [{ "src": "api/**/*.{js,mjs}", "use": "@vercel/node" }],
"probes": [
{
"path": "/api/edge.js",
@@ -8,6 +8,10 @@
{
"path": "/api/wasm.js",
"mustContain": "RANDOMNESS_PLACEHOLDER:edge, 11."
},
{
"path": "/api/react-dom.mjs",
"mustContain": "<h1>RANDOMNESS_PLACEHOLDER:Hello from Edge</h1>"
}
]
}

View File

@@ -0,0 +1,100 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ansi-regex@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1"
integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==
cowsay@1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/cowsay/-/cowsay-1.3.1.tgz#56b2a9bde3c865abaa272c6bb68906f68bee9810"
integrity sha512-3PVFe6FePVtPj1HTeLin9v8WyLl+VmM1l1H/5P+BTTDkMAjufp+0F9eLjzRnOHzVAYeIYFF5po5NjRrgefnRMQ==
dependencies:
get-stdin "^5.0.1"
optimist "~0.6.1"
string-width "~2.1.1"
strip-eof "^1.0.0"
get-stdin@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"
integrity sha512-jZV7n6jGE3Gt7fgSTJoz91Ak5MuTLwMwkoYdjxuJ/AmjIsE1UC03y/IWkZCQGEvVNS9qoRNwy5BCqxImv0FVeA==
is-fullwidth-code-point@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==
"js-tokens@^3.0.0 || ^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
loose-envify@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
minimist@~0.0.1:
version "0.0.10"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
integrity sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==
optimist@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
integrity sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==
dependencies:
minimist "~0.0.1"
wordwrap "~0.0.2"
react-dom@18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
dependencies:
loose-envify "^1.1.0"
scheduler "^0.23.0"
react@18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
dependencies:
loose-envify "^1.1.0"
scheduler@^0.23.0:
version "0.23.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"
integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
dependencies:
loose-envify "^1.1.0"
string-width@~2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
dependencies:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"
strip-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==
dependencies:
ansi-regex "^3.0.0"
strip-eof@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==
wordwrap@~0.0.2:
version "0.0.3"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
integrity sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/python",
"version": "3.1.46",
"version": "3.1.47",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -17,13 +17,13 @@
"build": "node build",
"test": "jest --env node --verbose --runInBand --bail",
"test-unit": "pnpm test test/unit.test.ts",
"test-integration-once": "pnpm test test/integration.test.ts"
"test-e2e": "pnpm test test/integration.test.ts"
},
"devDependencies": {
"@types/execa": "^0.9.0",
"@types/jest": "27.4.1",
"@types/node": "14.18.33",
"@vercel/build-utils": "6.2.2",
"@vercel/build-utils": "6.2.3",
"@vercel/ncc": "0.24.0",
"execa": "^1.0.0",
"typescript": "4.3.4"

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/redwood",
"version": "1.1.2",
"version": "1.1.3",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://vercel.com/docs",
@@ -14,7 +14,7 @@
},
"scripts": {
"build": "node build.js",
"test-integration-once": "pnpm test test/test.js",
"test-e2e": "pnpm test test/test.js",
"test": "jest --env node --verbose --bail --runInBand",
"test-unit": "pnpm test test/prepare-cache.test.js"
},
@@ -27,7 +27,7 @@
"@types/aws-lambda": "8.10.19",
"@types/node": "14.18.33",
"@types/semver": "6.0.0",
"@vercel/build-utils": "6.2.2",
"@vercel/build-utils": "6.2.3",
"execa": "3.2.0",
"fs-extra": "11.1.0",
"typescript": "4.3.4"

View File

@@ -0,0 +1,30 @@
# `@vercel/remix-entry-server`
This package is meant for use within Remix applications when deploying to Vercel. It provides implementations for the `app/entry.server.tsx` file for both the Node.js Serverless Runtime and the Edge Runtime. The implementations are configured to [handle streaming responses](https://remix.run/docs/en/v1/guides/streaming).
## Usage
Make sure `@vercel/remix-entry-server` is installed with your package manager of choice, then replace your `app/entry.server.tsx` file with the following:
```tsx
// `app/entry.server.tsx`
import handleRequest from '@vercel/remix-entry-server';
import { RemixServer } from '@remix-run/react';
import type { EntryContext } from '@remix-run/server-runtime';
export default function (
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
) {
const remixServer = <RemixServer context={remixContext} url={request.url} />;
return handleRequest(
request,
responseStatusCode,
responseHeaders,
remixServer
);
}
```

View File

@@ -0,0 +1,12 @@
const execa = require('execa');
const { remove } = require('fs-extra');
async function main() {
await remove('dist');
await execa('tsc', [], { stdio: 'inherit' });
}
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,34 @@
{
"name": "@vercel/remix-entry-server",
"version": "0.1.0",
"description": "Isomorphic `entry.server` implementation for Vercel's Serverless and Edge runtimes",
"homepage": "https://vercel.com/docs",
"repository": {
"type": "git",
"url": "https://github.com/vercel/vercel.git",
"directory": "packages/remix-entry-server"
},
"main": "./dist/entry.server.node.js",
"browser": "./dist/entry.server.edge.js",
"scripts": {
"build": "node build.js"
},
"license": "MIT",
"files": [
"dist"
],
"dependencies": {
"@remix-run/node": "1.12.0",
"isbot": "3.6.5",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/react-dom": "18.0.10",
"execa": "3.2.0",
"fs-extra": "11.1.0",
"typescript": "4.9.4"
},
"peerDependencies": {
"react": "^18.0.0"
}
}

View File

@@ -0,0 +1,27 @@
import isbot from 'isbot';
import { renderToReadableStream } from 'react-dom/server';
export default async function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixServer: JSX.Element
) {
const body = await renderToReadableStream(remixServer, {
signal: request.signal,
onError(error) {
console.error(error);
responseStatusCode = 500;
},
});
if (isbot(request.headers.get('user-agent'))) {
await body.allReady;
}
responseHeaders.set('Content-Type', 'text/html');
return new Response(body, {
headers: responseHeaders,
status: responseStatusCode,
});
}

View File

@@ -0,0 +1,81 @@
import { PassThrough } from 'stream';
import { renderToPipeableStream } from 'react-dom/server';
import { Response } from '@remix-run/node';
import isbot from 'isbot';
const ABORT_DELAY = 5000;
export default function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixServer: JSX.Element
) {
// If the request is from a bot, we want to wait for the full
// response to render before sending it to the client. This
// ensures that bots can see the full page content.
if (isbot(request.headers.get('user-agent'))) {
return serveTheBots(responseStatusCode, responseHeaders, remixServer);
}
return serveBrowsers(responseStatusCode, responseHeaders, remixServer);
}
function serveTheBots(
responseStatusCode: number,
responseHeaders: Headers,
remixServer: any
) {
return new Promise((resolve, reject) => {
const { pipe, abort } = renderToPipeableStream(remixServer, {
// Use onAllReady to wait for the entire document to be ready
onAllReady() {
responseHeaders.set('Content-Type', 'text/html');
const body = new PassThrough();
pipe(body);
resolve(
new Response(body, {
status: responseStatusCode,
headers: responseHeaders,
})
);
},
onShellError(err) {
reject(err);
},
});
setTimeout(abort, ABORT_DELAY);
});
}
function serveBrowsers(
responseStatusCode: number,
responseHeaders: Headers,
remixServer: any
) {
return new Promise((resolve, reject) => {
let didError = false;
const { pipe, abort } = renderToPipeableStream(remixServer, {
// use onShellReady to wait until a suspense boundary is triggered
onShellReady() {
responseHeaders.set('Content-Type', 'text/html');
const body = new PassThrough();
pipe(body);
resolve(
new Response(body, {
status: didError ? 500 : responseStatusCode,
headers: responseHeaders,
})
);
},
onShellError(err) {
reject(err);
},
onError(err) {
didError = true;
console.error(err);
},
});
setTimeout(abort, ABORT_DELAY);
});
}

View File

@@ -0,0 +1,21 @@
{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"lib": ["ES2020", "DOM"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "./dist",
"types": ["node", "jest"],
"strict": true,
"target": "ES2020",
"sourceMap": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

View File

@@ -1,3 +0,0 @@
const { createRequestHandler } = require('@remix-run/vercel');
const build = require('./');
module.exports = createRequestHandler({ build });

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix",
"version": "1.2.13",
"version": "1.3.0",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -11,20 +11,25 @@
},
"scripts": {
"build": "node build.js",
"test-integration-once": "pnpm test test/integration.test.ts",
"test-e2e": "pnpm test test/integration.test.ts",
"test": "jest --env node --verbose --bail --runInBand"
},
"files": [
"dist",
"default-server.js"
"server-node.mjs",
"server-edge.mjs"
],
"dependencies": {
"@vercel/nft": "0.22.5"
"@remix-run/dev": "1.12.0",
"@vercel/nft": "0.22.5",
"@vercel/static-config": "2.0.12",
"path-to-regexp": "6.2.1",
"ts-morph": "12.0.0"
},
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "14.18.33",
"@vercel/build-utils": "6.2.2",
"@vercel/build-utils": "6.2.3",
"typescript": "4.9.4"
}
}

View File

@@ -0,0 +1,3 @@
import { createRequestHandler } from '@remix-run/server-runtime';
import build from './index.js';
export default createRequestHandler(build);

View File

@@ -0,0 +1,70 @@
import {
AbortController as NodeAbortController,
createRequestHandler as createRemixRequestHandler,
Headers as NodeHeaders,
Request as NodeRequest,
writeReadableStreamToWritable,
} from '@remix-run/node';
import build from './index.js';
const handleRequest = createRemixRequestHandler(build, process.env.NODE_ENV);
function createRemixHeaders(requestHeaders) {
const headers = new NodeHeaders();
for (const key in requestHeaders) {
const header = requestHeaders[key];
// set-cookie is an array (maybe others)
if (Array.isArray(header)) {
for (const value of header) {
headers.append(key, value);
}
} else {
headers.append(key, header);
}
}
return headers;
}
function createRemixRequest(req, res) {
const host = req.headers['x-forwarded-host'] || req.headers['host'];
const protocol = req.headers['x-forwarded-proto'] || 'https';
const url = new URL(req.url, `${protocol}://${host}`);
// Abort action/loaders once we can no longer write a response
const controller = new NodeAbortController();
res.on('close', () => controller.abort());
const init = {
method: req.method,
headers: createRemixHeaders(req.headers),
signal: controller.signal,
};
if (req.method !== 'GET' && req.method !== 'HEAD') {
init.body = req;
}
return new NodeRequest(url.href, init);
}
async function sendRemixResponse(res, nodeResponse) {
res.statusCode = nodeResponse.status;
res.statusMessage = nodeResponse.statusText;
for (const [name, value] of nodeResponse.headers.entries()) {
res.setHeader(name, value);
}
if (nodeResponse.body) {
await writeReadableStreamToWritable(nodeResponse.body, res);
} else {
res.end();
}
}
export default async (req, res) => {
const request = createRemixRequest(req, res);
const response = await handleRequest(request);
await sendRemixResponse(res, response);
};

View File

@@ -1,6 +1,7 @@
import { Project } from 'ts-morph';
import { promises as fs } from 'fs';
import { runInContext, createContext } from 'vm';
import { dirname, join, relative } from 'path';
import { basename, dirname, extname, join, relative, sep } from 'path';
import { pathToRegexp, Key } from 'path-to-regexp';
import {
debug,
download,
@@ -10,6 +11,7 @@ import {
getNodeVersion,
getSpawnOptions,
glob,
EdgeFunction,
NodejsLambda,
readConfigFile,
runNpmInstall,
@@ -17,22 +19,20 @@ import {
scanParentDirs,
walkParentDirs,
} from '@vercel/build-utils';
import { getConfig } from '@vercel/static-config';
import { nodeFileTrace } from '@vercel/nft';
import { readConfig, RemixConfig } from '@remix-run/dev/dist/config';
import type {
BuildV2,
Files,
NodeVersion,
PackageJson,
BuildResultV2Typical,
} from '@vercel/build-utils';
import { nodeFileTrace } from '@vercel/nft';
import type { ConfigRoute } from '@remix-run/dev/dist/config/routes';
import { findConfig } from './utils';
import type { AppConfig, RemixBuildManifest } from './types';
import type { BuildResultV2Typical } from '@vercel/build-utils';
// Name of the Remix runtime adapter npm package for Vercel
const REMIX_RUNTIME_ADAPTER_NAME = '@remix-run/vercel';
// Pinned version of the last verified working version of the adapter
const REMIX_RUNTIME_ADAPTER_VERSION = '1.6.1';
const _require: typeof require = eval('require');
export const build: BuildV2 = async ({
entrypoint,
@@ -72,51 +72,6 @@ export const build: BuildV2 = async ({
env: spawnOpts.env || {},
});
// Ensure `@remix-run/vercel` is in the project's `package.json`
const packageJsonPath = await walkParentDirs({
base: repoRootPath,
start: workPath,
filename: 'package.json',
});
if (packageJsonPath) {
const packageJson: PackageJson = JSON.parse(
await fs.readFile(packageJsonPath, 'utf8')
);
const { dependencies = {}, devDependencies = {} } = packageJson;
let modified = false;
if (REMIX_RUNTIME_ADAPTER_NAME in devDependencies) {
dependencies[REMIX_RUNTIME_ADAPTER_NAME] =
devDependencies[REMIX_RUNTIME_ADAPTER_NAME];
delete devDependencies[REMIX_RUNTIME_ADAPTER_NAME];
console.log(
`Warning: Moving "${REMIX_RUNTIME_ADAPTER_NAME}" from \`devDependencies\` to \`dependencies\`. You should commit this change.`
);
modified = true;
} else if (!(REMIX_RUNTIME_ADAPTER_NAME in dependencies)) {
dependencies[REMIX_RUNTIME_ADAPTER_NAME] = REMIX_RUNTIME_ADAPTER_VERSION;
console.log(
`Warning: Adding "${REMIX_RUNTIME_ADAPTER_NAME}" v${REMIX_RUNTIME_ADAPTER_VERSION} to \`dependencies\`. You should commit this change.`
);
modified = true;
}
if (modified) {
const packageJsonString = JSON.stringify(
{
...packageJson,
dependencies,
devDependencies,
},
null,
2
);
await fs.writeFile(packageJsonPath, `${packageJsonString}\n`);
}
} else {
debug(`Failed to find "package.json" file in project`);
}
if (typeof installCommand === 'string') {
if (installCommand.trim()) {
console.log(`Running "install" command: \`${installCommand}\`...`);
@@ -134,116 +89,206 @@ export const build: BuildV2 = async ({
// Make `remix build` output production mode
spawnOpts.env.NODE_ENV = 'production';
// Run "Build Command"
if (buildCommand) {
debug(`Executing build command "${buildCommand}"`);
await execCommand(buildCommand, {
...spawnOpts,
cwd: entrypointFsDirname,
});
} else {
const pkg = await readConfigFile<PackageJson>(
join(entrypointFsDirname, 'package.json')
);
if (hasScript('vercel-build', pkg)) {
debug(`Executing "yarn vercel-build"`);
await runPackageJsonScript(
entrypointFsDirname,
'vercel-build',
spawnOpts
);
} else if (hasScript('build', pkg)) {
debug(`Executing "yarn build"`);
await runPackageJsonScript(entrypointFsDirname, 'build', spawnOpts);
// We need to patch the `remix.config.js` file to force some values necessary
// for a build that works on either Node.js or the Edge runtime
const remixConfigPath = findConfig(entrypointFsDirname, 'remix.config');
const renamedRemixConfigPath = remixConfigPath
? `${remixConfigPath}.original${extname(remixConfigPath)}`
: undefined;
if (remixConfigPath && renamedRemixConfigPath) {
await fs.rename(remixConfigPath, renamedRemixConfigPath);
// Figure out if the `remix.config` file is using ESM syntax
let isESM = false;
try {
_require(renamedRemixConfigPath);
} catch (err: any) {
if (err.code === 'ERR_REQUIRE_ESM') {
isESM = true;
} else {
throw err;
}
}
let patchedConfig: string;
if (isESM) {
patchedConfig = `import config from './${basename(
renamedRemixConfigPath
)}';
config.serverBuildTarget = undefined;
config.server = undefined;
config.serverModuleFormat = 'cjs';
config.serverPlatform = 'node';
config.serverBuildPath = 'build/index.js';
export default config;`;
} else {
await execCommand('remix build', {
patchedConfig = `const config = require('./${basename(
renamedRemixConfigPath
)}');
config.serverBuildTarget = undefined;
config.server = undefined;
config.serverModuleFormat = 'cjs';
config.serverPlatform = 'node';
config.serverBuildPath = 'build/index.js';
module.exports = config;`;
}
await fs.writeFile(remixConfigPath, patchedConfig);
}
// Run "Build Command"
let remixConfig: RemixConfig;
try {
if (buildCommand) {
debug(`Executing build command "${buildCommand}"`);
await execCommand(buildCommand, {
...spawnOpts,
cwd: entrypointFsDirname,
});
} else {
const pkg = await readConfigFile<PackageJson>(
join(entrypointFsDirname, 'package.json')
);
if (hasScript('vercel-build', pkg)) {
debug(`Executing "yarn vercel-build"`);
await runPackageJsonScript(
entrypointFsDirname,
'vercel-build',
spawnOpts
);
} else if (hasScript('build', pkg)) {
debug(`Executing "yarn build"`);
await runPackageJsonScript(entrypointFsDirname, 'build', spawnOpts);
} else {
await execCommand('remix build', {
...spawnOpts,
cwd: entrypointFsDirname,
});
}
}
remixConfig = await readConfig(entrypointFsDirname);
} finally {
// Clean up our patched `remix.config.js` to be polite
if (remixConfigPath && renamedRemixConfigPath) {
await fs.rename(renamedRemixConfigPath, remixConfigPath);
}
}
const { serverBuildPath, routes: remixRoutes } = remixConfig;
// Figure out which pages should be edge functions
const edgePages = new Set<ConfigRoute>();
const project = new Project();
for (const route of Object.values(remixRoutes)) {
const routePath = join(remixConfig.appDirectory, route.file);
const staticConfig = getConfig(project, routePath);
const isEdge =
staticConfig?.runtime === 'edge' ||
staticConfig?.runtime === 'experimental-edge';
if (isEdge) {
edgePages.add(route);
}
}
// This needs to happen before we run NFT to create the Node/Edge functions
await Promise.all([
ensureResolvable(
entrypointFsDirname,
repoRootPath,
'@remix-run/server-runtime'
),
ensureResolvable(entrypointFsDirname, repoRootPath, '@remix-run/node'),
]);
const [staticFiles, nodeFunction, edgeFunction] = await Promise.all([
glob('**', join(entrypointFsDirname, 'public')),
createRenderNodeFunction(
entrypointFsDirname,
repoRootPath,
serverBuildPath,
nodeVersion
),
edgePages.size > 0
? createRenderEdgeFunction(
entrypointFsDirname,
repoRootPath,
serverBuildPath
)
: undefined,
]);
const output: BuildResultV2Typical['output'] = staticFiles;
const routes: any[] = [
{
src: '^/build/(.*)$',
headers: { 'cache-control': 'public, max-age=31536000, immutable' },
continue: true,
},
{
handle: 'filesystem',
},
];
for (const route of Object.values(remixRoutes)) {
// Layout routes don't get a function / route added
const isLayoutRoute = Object.values(remixRoutes).some(
r => r.parentId === route.id
);
if (isLayoutRoute) continue;
// Build up the full request path
let currentRoute: ConfigRoute | undefined = route;
const pathParts: string[] = [];
do {
if (currentRoute.index) pathParts.push('index');
if (currentRoute.path) pathParts.push(currentRoute.path);
if (currentRoute.parentId) {
currentRoute = remixRoutes[currentRoute.parentId];
} else {
currentRoute = undefined;
}
} while (currentRoute);
const path = join(...pathParts.reverse());
const isEdge = edgePages.has(route);
const fn =
isEdge && edgeFunction
? // `EdgeFunction` currently requires the "name" property to be set.
// Ideally this property will be removed, at which point we can
// return the same `edgeFunction` instance instead of creating a
// new one for each page.
new EdgeFunction({
...edgeFunction,
name: path,
})
: nodeFunction;
output[path] = fn;
// If this is a dynamic route then add a Vercel route
const keys: Key[] = [];
// Replace "/*" at the end to handle "splat routes"
const rePath = `/${path.replace(/\/\*$/, '/:params+')}`;
const re = pathToRegexp(rePath, keys);
if (keys.length > 0) {
routes.push({
src: re.source,
dest: path,
});
}
}
let serverBuildPath = 'build/index.js';
let needsHandler = true;
const remixConfigFile = findConfig(entrypointFsDirname, 'remix.config');
try {
if (remixConfigFile) {
const remixConfigModule = await eval('import(remixConfigFile)');
const remixConfig: AppConfig = remixConfigModule?.default || {};
// If `serverBuildTarget === 'vercel'` then Remix will output a handler
// that is already in Vercel (req, res) format, so don't inject the handler
if (remixConfig.serverBuildTarget) {
if (remixConfig.serverBuildTarget !== 'vercel') {
throw new Error(
`\`serverBuildTarget\` in Remix config must be "vercel" (got "${remixConfig.serverBuildTarget}")`
);
}
serverBuildPath = 'api/index.js';
needsHandler = false;
}
if (remixConfig.serverBuildPath) {
// Explicit file path where the server output file will be
serverBuildPath = remixConfig.serverBuildPath;
} else if (remixConfig.serverBuildDirectory) {
// Explicit directory path the server output will be
serverBuildPath = join(remixConfig.serverBuildDirectory, 'index.js');
}
// Also check for whether were in a monorepo.
// If we are, prepend the app root directory from config onto the build path.
// e.g. `/apps/my-remix-app/api/index.js`
const isMonorepo = repoRootPath && repoRootPath !== workPath;
if (isMonorepo) {
const rootDirectory = relative(repoRootPath, workPath);
serverBuildPath = join(rootDirectory, serverBuildPath);
}
}
} catch (err: any) {
// Ignore error if `remix.config.js` does not exist
if (err.code !== 'MODULE_NOT_FOUND') throw err;
// Add a 404 path for not found pages to be server-side rendered by Remix.
// Use the edge function if one was generated, otherwise use Node.js.
if (!output['404']) {
output['404'] = edgeFunction
? new EdgeFunction({ ...edgeFunction, name: '404' })
: nodeFunction;
}
routes.push({
src: '/(.*)',
dest: '/404',
});
const [staticFiles, renderFunction, ssrRoutes] = await Promise.all([
glob('**', join(entrypointFsDirname, 'public')),
createRenderFunction(
entrypointFsDirname,
repoRootPath,
serverBuildPath,
needsHandler,
nodeVersion
),
getSsrRoutes(entrypointFsDirname),
]);
const output: BuildResultV2Typical['output'] = staticFiles;
for (const path of ssrRoutes) {
output[path] = renderFunction;
}
// Add a 404 path for not found pages to be server-side rendered by Remix
output['404'] = renderFunction;
return {
routes: [
{
src: '^/build/(.*)$',
headers: { 'cache-control': 'public, max-age=31536000, immutable' },
continue: true,
},
{
handle: 'filesystem',
},
{
src: '/(.*)',
dest: '/404',
},
],
output,
};
return { routes, output };
};
function hasScript(scriptName: string, pkg: PackageJson | null) {
@@ -251,24 +296,21 @@ function hasScript(scriptName: string, pkg: PackageJson | null) {
return typeof scripts[scriptName] === 'string';
}
async function createRenderFunction(
async function createRenderNodeFunction(
entrypointDir: string,
rootDir: string,
serverBuildPath: string,
needsHandler: boolean,
nodeVersion: NodeVersion
): Promise<NodejsLambda> {
const files: Files = {};
const handler = needsHandler
? join(dirname(serverBuildPath), '__vc_handler.js')
: serverBuildPath;
const relativeServerBuildPath = relative(rootDir, serverBuildPath);
const handler = join(dirname(relativeServerBuildPath), 'server-node.mjs');
const handlerPath = join(rootDir, handler);
if (needsHandler) {
// Copy the `default-server.js` file into the "build" directory
const sourceHandlerPath = join(__dirname, '../default-server.js');
await fs.copyFile(sourceHandlerPath, handlerPath);
}
// Copy the `server-node.mjs` file into the "build" directory
const sourceHandlerPath = join(__dirname, '../server-node.mjs');
await fs.copyFile(sourceHandlerPath, handlerPath);
// Trace the handler with `@vercel/nft`
const trace = await nodeFileTrace([handlerPath], {
@@ -284,41 +326,152 @@ async function createRenderFunction(
files[file] = await FileFsRef.fromFsPath({ fsPath: join(rootDir, file) });
}
const lambda = new NodejsLambda({
const fn = new NodejsLambda({
files,
handler,
runtime: nodeVersion.runtime,
shouldAddHelpers: false,
shouldAddSourcemapSupport: false,
operationType: 'SSR',
experimentalResponseStreaming: true,
});
return lambda;
return fn;
}
async function getSsrRoutes(entrypointDir: string): Promise<string[]> {
// Find the name of the manifest file
const buildDir = join(entrypointDir, 'public/build');
const manifestFileName = (await fs.readdir(buildDir)).find(n =>
n.startsWith('manifest-')
);
async function createRenderEdgeFunction(
entrypointDir: string,
rootDir: string,
serverBuildPath: string
): Promise<EdgeFunction> {
const files: Files = {};
if (!manifestFileName) {
throw new Error(`Failed to find manifest file in "${buildDir}"`);
const relativeServerBuildPath = relative(rootDir, serverBuildPath);
const handler = join(dirname(relativeServerBuildPath), 'server-edge.mjs');
const handlerPath = join(rootDir, handler);
// Copy the `server-edge.mjs` file into the "build" directory
const sourceHandlerPath = join(__dirname, '../server-edge.mjs');
await fs.copyFile(sourceHandlerPath, handlerPath);
// Trace the handler with `@vercel/nft`
const trace = await nodeFileTrace([handlerPath], {
base: rootDir,
processCwd: entrypointDir,
conditions: ['worker', 'browser'],
async readFile(fsPath) {
let source: Buffer | string;
try {
source = await fs.readFile(fsPath);
} catch (err: any) {
if (err.code === 'ENOENT' || err.code === 'EISDIR') {
return null;
}
throw err;
}
if (basename(fsPath) === 'package.json') {
// For Edge Functions, patch "main" field to prefer "browser" or "module"
const pkgJson = JSON.parse(source.toString());
for (const prop of ['browser', 'module']) {
const val = pkgJson[prop];
if (typeof val === 'string') {
pkgJson.main = val;
// Return the modified `package.json` to nft
source = JSON.stringify(pkgJson);
break;
}
}
}
return source;
},
});
for (const warning of trace.warnings) {
debug(`Warning from trace: ${warning.message}`);
}
const context: { window: { __remixManifest?: RemixBuildManifest } } = {
window: {},
};
createContext(context);
for (const file of trace.fileList) {
files[file] = await FileFsRef.fromFsPath({ fsPath: join(rootDir, file) });
}
const code = await fs.readFile(join(buildDir, manifestFileName), 'utf8');
runInContext(code, context);
const fn = new EdgeFunction({
files,
deploymentTarget: 'v8-worker',
name: 'render',
entrypoint: handler,
});
const routes = context.window.__remixManifest?.routes || {};
return Object.keys(routes)
.filter(id => id !== 'root')
.map(id => {
return routes[id].path || 'index';
});
return fn;
}
async function ensureResolvable(start: string, base: string, pkgName: string) {
try {
const resolvedPath = _require.resolve(pkgName, { paths: [start] });
if (!relative(base, resolvedPath).startsWith(`..${sep}`)) {
// Resolved path is within the root of the project, so all good
debug(`"${pkgName}" resolved to '${resolvedPath}'`);
return;
}
} catch (err: any) {
if (err.code !== 'MODULE_NOT_FOUND') {
throw err;
}
}
// If we got to here then `pkgName` was not resolvable up to the root
// of the project. Try a couple symlink tricks, otherwise we'll bail.
// Attempt to find the package in `node_modules/.pnpm` (pnpm)
const pnpmDir = await walkParentDirs({
base,
start,
filename: 'node_modules/.pnpm',
});
if (pnpmDir) {
const prefix = `${pkgName.replace('/', '+')}@`;
const packages = await fs.readdir(pnpmDir);
const match = packages.find(p => p.startsWith(prefix));
if (match) {
const pkgDir = join(pnpmDir, match, 'node_modules', pkgName);
const symlinkPath = join(pnpmDir, '..', pkgName);
const symlinkDir = dirname(symlinkPath);
const symlinkTarget = relative(symlinkDir, pkgDir);
await fs.mkdir(symlinkDir, { recursive: true });
await fs.symlink(symlinkTarget, symlinkPath);
console.warn(
`WARN: Created symlink for "${pkgName}". To silence this warning, add "${pkgName}" to "dependencies" in your \`package.json\` file.`
);
return;
}
}
// Attempt to find the package in `node_modules/.store` (npm 9+ linked mode)
const npmDir = await walkParentDirs({
base,
start,
filename: 'node_modules/.store',
});
if (npmDir) {
const prefix = `${basename(pkgName)}@`;
const prefixDir = join(npmDir, dirname(pkgName));
const packages = await fs.readdir(prefixDir);
const match = packages.find(p => p.startsWith(prefix));
if (match) {
const pkgDir = join(prefixDir, match, 'node_modules', pkgName);
const symlinkPath = join(npmDir, '..', pkgName);
const symlinkDir = dirname(symlinkPath);
const symlinkTarget = relative(symlinkDir, pkgDir);
await fs.mkdir(symlinkDir, { recursive: true });
await fs.symlink(symlinkTarget, symlinkPath);
console.warn(
`WARN: Created symlink for "${pkgName}". To silence this warning, add "${pkgName}" to "dependencies" in your \`package.json\` file.`
);
return;
}
}
throw new Error(
`Failed to resolve "${pkgName}". To fix this error, add "${pkgName}" to "dependencies" in your \`package.json\` file.`
);
}

View File

@@ -1,39 +1,23 @@
import { dirname, join, relative } from 'path';
import { glob } from '@vercel/build-utils';
import { dirname, join, relative } from 'path';
import { readConfig } from '@remix-run/dev/dist/config';
import type { PrepareCache } from '@vercel/build-utils';
import type { AppConfig } from './types';
import { findConfig } from './utils';
export const prepareCache: PrepareCache = async ({
entrypoint,
repoRootPath,
workPath,
}) => {
let cacheDirectory = '.cache';
const root = repoRootPath || workPath;
const mountpoint = dirname(entrypoint);
const entrypointFsDirname = join(workPath, mountpoint);
try {
const remixConfigFile = findConfig(entrypointFsDirname, 'remix.config');
if (remixConfigFile) {
const remixConfigModule = await eval('import(remixConfigFile)');
const remixConfig: AppConfig = remixConfigModule?.default || {};
if (remixConfig.cacheDirectory) {
cacheDirectory = remixConfig.cacheDirectory;
}
}
} catch (err: any) {
// Ignore error if `remix.config.js` does not exist
if (err.code !== 'MODULE_NOT_FOUND') throw err;
}
const root = repoRootPath || workPath;
const remixConfig = await readConfig(entrypointFsDirname);
const [nodeModulesFiles, cacheDirFiles] = await Promise.all([
// Cache `node_modules`
glob('**/node_modules/**', root),
// Cache the Remix "cacheDirectory" (typically `.cache`)
glob(relative(root, join(entrypointFsDirname, cacheDirectory, '**')), root),
glob(relative(root, join(remixConfig.cacheDirectory, '**')), root),
]);
return { ...nodeModulesFiles, ...cacheDirFiles };

View File

@@ -1,15 +0,0 @@
// Stripped down version of `@remix-run/dev` AppConfig
export interface AppConfig {
cacheDirectory?: string;
serverBuildDirectory?: string;
serverBuildPath?: string;
serverBuildTarget?: string;
}
export interface RemixBuildManifest {
routes: {
[id: string]: {
path: string;
};
};
}

View File

@@ -0,0 +1,11 @@
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

@@ -13,8 +13,8 @@
"@remix-run/node": "^1.7.4",
"@remix-run/react": "^1.7.4",
"@remix-run/serve": "^1.7.4",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^1.7.4",

View File

@@ -11,6 +11,7 @@
],
"probes": [
{ "path": "/", "mustContain": "Welcome to Remix" },
{ "path": "/edge", "mustContain": "Welcome to Remix@Edge" },
{ "path": "/b", "mustContain": "B page" },
{ "path": "/nested", "mustContain": "Nested index page" },
{ "path": "/nested/another", "mustContain": "Nested another page" },

View File

@@ -4733,11 +4733,6 @@ normalize-url@^6.0.1:
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a"
integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==
object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
object-copy@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c"
@@ -5125,14 +5120,13 @@ raw-body@2.5.1, raw-body@^2.2.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
react-dom@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
react-dom@18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
scheduler "^0.20.2"
scheduler "^0.23.0"
react-router-dom@6.3.0:
version "6.3.0"
@@ -5149,13 +5143,12 @@ react-router@6.3.0:
dependencies:
history "^5.2.0"
react@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
react@18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
readable-stream@1.1.x:
version "1.1.14"
@@ -5454,13 +5447,12 @@ safe-regex@^1.1.0:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
scheduler@^0.20.2:
version "0.20.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
scheduler@^0.23.0:
version "0.23.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"
integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
semver@^5.6.0:
version "5.7.1"

View File

@@ -0,0 +1,12 @@
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

@@ -13,8 +13,8 @@
"@remix-run/node": "^1.7.4",
"@remix-run/react": "^1.7.4",
"@remix-run/serve": "^1.7.4",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^1.7.4",

View File

@@ -9,5 +9,8 @@
}
}
],
"probes": [{ "path": "/", "mustContain": "Welcome to Remix" }]
"probes": [
{ "path": "/", "mustContain": "Welcome to Remix" },
{ "path": "/edge", "mustContain": "Welcome to Remix@Edge" }
]
}

View File

@@ -4733,11 +4733,6 @@ normalize-url@^6.0.1:
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a"
integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==
object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
object-copy@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c"
@@ -5125,14 +5120,13 @@ raw-body@2.5.1, raw-body@^2.2.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
react-dom@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
react-dom@18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
scheduler "^0.20.2"
scheduler "^0.23.0"
react-router-dom@6.3.0:
version "6.3.0"
@@ -5149,13 +5143,12 @@ react-router@6.3.0:
dependencies:
history "^5.2.0"
react@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
react@18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
readable-stream@1.1.x:
version "1.1.14"
@@ -5454,13 +5447,12 @@ safe-regex@^1.1.0:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
scheduler@^0.20.2:
version "0.20.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
scheduler@^0.23.0:
version "0.23.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"
integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
semver@^5.6.0:
version "5.7.1"

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