mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-22 17:43:59 +00:00
Compare commits
91 Commits
@vercel/no
...
@vercel-in
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96117d3f17 | ||
|
|
20237d4f7b | ||
|
|
293770a2f6 | ||
|
|
c9c0a203cc | ||
|
|
5064dd404d | ||
|
|
1a45731c92 | ||
|
|
168f9578cf | ||
|
|
c2728ef9c0 | ||
|
|
c5fe7c2bea | ||
|
|
b1d8b83abb | ||
|
|
24ec5c5aca | ||
|
|
37b193c845 | ||
|
|
f8fab639bf | ||
|
|
6ed0fe6fb1 | ||
|
|
de2738ba06 | ||
|
|
1333071a3a | ||
|
|
c2d99855ea | ||
|
|
0d112c848a | ||
|
|
d17abf463a | ||
|
|
440ef3ba98 | ||
|
|
38c5e93625 | ||
|
|
4d51d777fe | ||
|
|
1fee87e76f | ||
|
|
ea0e9aeaec | ||
|
|
7910f2f307 | ||
|
|
670441620f | ||
|
|
bfc01fd98f | ||
|
|
6d74b9b61a | ||
|
|
9483d49f72 | ||
|
|
6740f9b155 | ||
|
|
b663f813e1 | ||
|
|
e318a0eea5 | ||
|
|
644721a90d | ||
|
|
e109e3325a | ||
|
|
92b2fbe372 | ||
|
|
e50fe2b37c | ||
|
|
678ebbe525 | ||
|
|
10e200e0bf | ||
|
|
24c3dd282d | ||
|
|
142a397d8e | ||
|
|
0dd9a27859 | ||
|
|
b6ed28b9b1 | ||
|
|
0d034b6820 | ||
|
|
05c8be1a6d | ||
|
|
d21bb9f87e | ||
|
|
ab24444660 | ||
|
|
20080d4ae7 | ||
|
|
c32a909afc | ||
|
|
abaa700cea | ||
|
|
8ba0ce9324 | ||
|
|
4027a18337 | ||
|
|
3bad73401b | ||
|
|
50e135ea47 | ||
|
|
d05e41eeaf | ||
|
|
de63e35622 | ||
|
|
4d1ab422d3 | ||
|
|
a03cfa1040 | ||
|
|
eaae86d776 | ||
|
|
77bc00f92e | ||
|
|
19a373288f | ||
|
|
322c88536d | ||
|
|
1f259d5eb9 | ||
|
|
3759da57ab | ||
|
|
30ba68edf9 | ||
|
|
62ca2efa73 | ||
|
|
2b71ee6b42 | ||
|
|
acb2acf953 | ||
|
|
2601257846 | ||
|
|
30b0925218 | ||
|
|
eddd432e06 | ||
|
|
b185a7e207 | ||
|
|
5c910bf937 | ||
|
|
cdddb33ad4 | ||
|
|
0da7ea7b78 | ||
|
|
7de754398e | ||
|
|
d4cc520814 | ||
|
|
03d07dd163 | ||
|
|
b6b151f391 | ||
|
|
8c4b732d41 | ||
|
|
d4335f0b56 | ||
|
|
90d0455e1f | ||
|
|
0716130e58 | ||
|
|
8b7479fb6e | ||
|
|
72d8604c9d | ||
|
|
5fe7b57b8d | ||
|
|
ab826eb83d | ||
|
|
98040ec24e | ||
|
|
21c700aa93 | ||
|
|
50ed13b6ed | ||
|
|
597508ffa6 | ||
|
|
57ee3e1fd5 |
@@ -38,7 +38,7 @@ packages/static-build/test/cache-fixtures
|
||||
packages/redwood/test/fixtures
|
||||
|
||||
# remix
|
||||
packages/remix/test/fixtures
|
||||
packages/remix/test/fixtures-*
|
||||
|
||||
# gatsby-plugin-vercel-analytics
|
||||
packages/gatsby-plugin-vercel-analytics
|
||||
|
||||
16
.github/CODEOWNERS
vendored
16
.github/CODEOWNERS
vendored
@@ -2,17 +2,17 @@
|
||||
# https://help.github.com/en/articles/about-code-owners
|
||||
|
||||
# Restricted Paths
|
||||
* @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek
|
||||
/.github/workflows @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @ijjk
|
||||
/packages/fs-detectors @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @agadzik @chloetedder
|
||||
/packages/next @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @ijjk @ztanner
|
||||
/packages/routing-utils @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @ijjk
|
||||
/packages/static-build @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek
|
||||
/packages/edge @vercel/compute @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek
|
||||
* @TooTallNate @EndangeredMassa @trek
|
||||
/.github/workflows @TooTallNate @EndangeredMassa @trek @ijjk
|
||||
/packages/fs-detectors @TooTallNate @EndangeredMassa @trek @agadzik @chloetedder
|
||||
/packages/next @TooTallNate @EndangeredMassa @Ethan-Arrowood @trek @ijjk @ztanner
|
||||
/packages/routing-utils @TooTallNate @EndangeredMassa @trek @ijjk
|
||||
/packages/static-build @TooTallNate @EndangeredMassa @trek
|
||||
/packages/edge @vercel/compute @TooTallNate @EndangeredMassa @trek
|
||||
/examples @leerob
|
||||
/examples/create-react-app @Timer
|
||||
/examples/nextjs @timneutkens @ijjk @ztanner @huozhi
|
||||
/packages/node @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @Kikobeats
|
||||
/packages/node @TooTallNate @EndangeredMassa @trek @Kikobeats
|
||||
|
||||
# Unrestricted Paths
|
||||
.changeset/
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +1,8 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Bug Report
|
||||
url: https://vercel.com/support/request
|
||||
about: Report a bug using the Vercel support form
|
||||
url: https://vercel.com/help
|
||||
about: Reach out to our support team
|
||||
- name: Feature Request
|
||||
url: https://github.com/orgs/vercel/discussions/new?category=ideas
|
||||
about: Share ideas for new features
|
||||
|
||||
79
.github/dependabot.yml
vendored
Normal file
79
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
version: 2
|
||||
|
||||
updates:
|
||||
- schedule:
|
||||
interval: 'daily'
|
||||
open-pull-requests-limit: 1
|
||||
reviewers:
|
||||
- 'trek'
|
||||
- 'TooTallNate'
|
||||
- 'EndangeredMassa'
|
||||
commit-message:
|
||||
prefix: '[framework-fixtures]'
|
||||
package-ecosystem: 'npm'
|
||||
directory: /packages/static-build/test/fixtures/angular-v17
|
||||
allow:
|
||||
- dependency-name: '@angular*'
|
||||
ignore:
|
||||
- dependency-name: '@angular*'
|
||||
update-types:
|
||||
['version-update:semver-major', 'version-update:semver-patch']
|
||||
groups:
|
||||
core:
|
||||
patterns:
|
||||
- '@angular*'
|
||||
update-types:
|
||||
- 'minor'
|
||||
|
||||
- schedule:
|
||||
interval: 'daily'
|
||||
open-pull-requests-limit: 1
|
||||
reviewers:
|
||||
- 'trek'
|
||||
- 'TooTallNate'
|
||||
- 'EndangeredMassa'
|
||||
commit-message:
|
||||
prefix: '[framework-fixtures]'
|
||||
package-ecosystem: 'npm'
|
||||
directory: /packages/static-build/test/fixtures/astro-v4
|
||||
allow:
|
||||
- dependency-name: 'astro*'
|
||||
ignore:
|
||||
- dependency-name: 'astro*'
|
||||
update-types:
|
||||
['version-update:semver-major', 'version-update:semver-patch']
|
||||
groups:
|
||||
core:
|
||||
patterns:
|
||||
- 'astro*'
|
||||
update-types:
|
||||
- 'minor'
|
||||
|
||||
- schedule:
|
||||
interval: 'daily'
|
||||
open-pull-requests-limit: 1
|
||||
reviewers:
|
||||
- 'trek'
|
||||
- 'TooTallNate'
|
||||
- 'EndangeredMassa'
|
||||
commit-message:
|
||||
prefix: '[framework-fixtures]'
|
||||
package-ecosystem: 'npm'
|
||||
directory: /packages/static-build/test/fixtures/hydrogen-v2023
|
||||
allow:
|
||||
- dependency-name: '@remix-run*'
|
||||
- dependency-name: '@shopify*'
|
||||
ignore:
|
||||
- dependency-name: '@remix-run*'
|
||||
update-types:
|
||||
['version-update:semver-major', 'version-update:semver-patch']
|
||||
- dependency-name: '@shopify*'
|
||||
update-types:
|
||||
['version-update:semver-major', 'version-update:semver-patch']
|
||||
groups:
|
||||
core:
|
||||
patterns:
|
||||
- '@remix-run*'
|
||||
- '@shopify*'
|
||||
update-types:
|
||||
- 'minor'
|
||||
@@ -29,6 +29,7 @@ turbo-cache-key.json
|
||||
packages/*/dist
|
||||
packages/*/node_modules
|
||||
packages/**/test/fixtures
|
||||
packages/**/test/fixtures-*
|
||||
packages/**/test/dev/fixtures
|
||||
packages/**/test/build-fixtures
|
||||
packages/**/test/cache-fixtures
|
||||
|
||||
@@ -27,3 +27,6 @@ end
|
||||
|
||||
# Performance-booster for watching directories on Windows
|
||||
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
|
||||
|
||||
# Webrick not installed by default in Ruby 3.0+
|
||||
gem "webrick"
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.7.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
addressable (2.8.6)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
colorator (1.1.0)
|
||||
concurrent-ruby (1.1.8)
|
||||
em-websocket (0.5.2)
|
||||
concurrent-ruby (1.2.3)
|
||||
em-websocket (0.5.3)
|
||||
eventmachine (>= 0.12.9)
|
||||
http_parser.rb (~> 0.6.0)
|
||||
http_parser.rb (~> 0)
|
||||
eventmachine (1.2.7)
|
||||
ffi (1.14.2)
|
||||
ffi (1.16.3)
|
||||
forwardable-extended (2.6.0)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (1.8.9)
|
||||
http_parser.rb (0.8.0)
|
||||
i18n (1.14.1)
|
||||
concurrent-ruby (~> 1.0)
|
||||
jekyll (4.2.0)
|
||||
jekyll (4.2.2)
|
||||
addressable (~> 2.4)
|
||||
colorator (~> 1.0)
|
||||
em-websocket (~> 0.5)
|
||||
@@ -29,20 +29,20 @@ GEM
|
||||
rouge (~> 3.0)
|
||||
safe_yaml (~> 1.0)
|
||||
terminal-table (~> 2.0)
|
||||
jekyll-feed (0.15.1)
|
||||
jekyll-feed (0.17.0)
|
||||
jekyll (>= 3.7, < 5.0)
|
||||
jekyll-sass-converter (2.1.0)
|
||||
jekyll-sass-converter (2.2.0)
|
||||
sassc (> 2.0.1, < 3.0)
|
||||
jekyll-seo-tag (2.7.1)
|
||||
jekyll-seo-tag (2.8.0)
|
||||
jekyll (>= 3.8, < 5.0)
|
||||
jekyll-watch (2.2.1)
|
||||
listen (~> 3.0)
|
||||
kramdown (2.3.0)
|
||||
kramdown (2.4.0)
|
||||
rexml
|
||||
kramdown-parser-gfm (1.1.0)
|
||||
kramdown (~> 2.0)
|
||||
liquid (4.0.3)
|
||||
listen (3.4.1)
|
||||
liquid (4.0.4)
|
||||
listen (3.9.0)
|
||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||
rb-inotify (~> 0.9, >= 0.9.10)
|
||||
mercenary (0.4.0)
|
||||
@@ -52,21 +52,22 @@ GEM
|
||||
jekyll-seo-tag (~> 2.1)
|
||||
pathutil (0.16.2)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (4.0.6)
|
||||
rb-fsevent (0.10.4)
|
||||
public_suffix (5.0.4)
|
||||
rb-fsevent (0.11.2)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
rexml (3.2.4)
|
||||
rouge (3.26.0)
|
||||
rexml (3.2.6)
|
||||
rouge (3.30.0)
|
||||
safe_yaml (1.0.5)
|
||||
sassc (2.4.0)
|
||||
ffi (~> 1.9)
|
||||
terminal-table (2.0.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
unicode-display_width (1.7.0)
|
||||
unicode-display_width (1.8.0)
|
||||
webrick (1.8.1)
|
||||
|
||||
PLATFORMS
|
||||
x86_64-linux
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
jekyll (~> 4.2.0)
|
||||
@@ -75,6 +76,7 @@ DEPENDENCIES
|
||||
tzinfo (~> 1.2)
|
||||
tzinfo-data
|
||||
wdm (~> 0.1.1)
|
||||
webrick
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.4
|
||||
2.5.6
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'middleman', '~> 4.2'
|
||||
gem 'middleman-autoprefixer', '~> 2.7'
|
||||
gem 'middleman', '~> 4.5'
|
||||
gem 'middleman-autoprefixer', '~> 3.0'
|
||||
gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby, :x64_mingw]
|
||||
gem 'wdm', '~> 0.1', platforms: [:mswin, :mingw, :x64_mingw]
|
||||
|
||||
@@ -1,59 +1,60 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activesupport (5.2.4.5)
|
||||
activesupport (7.0.8.1)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 0.7, < 2)
|
||||
minitest (~> 5.1)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.7.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
autoprefixer-rails (9.8.6.5)
|
||||
execjs
|
||||
backports (3.20.2)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
tzinfo (~> 2.0)
|
||||
addressable (2.8.6)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
autoprefixer-rails (10.4.16.0)
|
||||
execjs (~> 2)
|
||||
backports (3.24.1)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.12.2)
|
||||
concurrent-ruby (1.1.8)
|
||||
contracts (0.13.0)
|
||||
dotenv (2.7.6)
|
||||
concurrent-ruby (1.2.3)
|
||||
contracts (0.16.1)
|
||||
dotenv (3.1.0)
|
||||
erubis (2.7.0)
|
||||
execjs (2.7.0)
|
||||
fast_blank (1.0.0)
|
||||
fastimage (2.2.2)
|
||||
ffi (1.14.2)
|
||||
haml (5.2.1)
|
||||
temple (>= 0.8.0)
|
||||
execjs (2.9.1)
|
||||
fast_blank (1.0.1)
|
||||
fastimage (2.3.0)
|
||||
ffi (1.16.3)
|
||||
haml (6.3.0)
|
||||
temple (>= 0.8.2)
|
||||
thor
|
||||
tilt
|
||||
hamster (3.0.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
hashie (3.6.0)
|
||||
i18n (0.9.5)
|
||||
i18n (1.6.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
kramdown (2.3.0)
|
||||
kramdown (2.4.0)
|
||||
rexml
|
||||
listen (3.0.8)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
listen (3.9.0)
|
||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||
rb-inotify (~> 0.9, >= 0.9.10)
|
||||
memoist (0.16.2)
|
||||
middleman (4.3.11)
|
||||
middleman (4.5.1)
|
||||
coffee-script (~> 2.2)
|
||||
haml (>= 4.0.5)
|
||||
kramdown (>= 2.3.0)
|
||||
middleman-cli (= 4.3.11)
|
||||
middleman-core (= 4.3.11)
|
||||
middleman-autoprefixer (2.10.1)
|
||||
autoprefixer-rails (~> 9.1)
|
||||
middleman-core (>= 3.3.3)
|
||||
middleman-cli (4.3.11)
|
||||
thor (>= 0.17.0, < 2.0)
|
||||
middleman-core (4.3.11)
|
||||
activesupport (>= 4.2, < 6.0)
|
||||
addressable (~> 2.3)
|
||||
middleman-cli (= 4.5.1)
|
||||
middleman-core (= 4.5.1)
|
||||
middleman-autoprefixer (3.0.0)
|
||||
autoprefixer-rails (~> 10.0)
|
||||
middleman-core (>= 4.0.0)
|
||||
middleman-cli (4.5.1)
|
||||
thor (>= 0.17.0, < 1.3.0)
|
||||
middleman-core (4.5.1)
|
||||
activesupport (>= 6.1, < 7.1)
|
||||
addressable (~> 2.4)
|
||||
backports (~> 3.6)
|
||||
bundler
|
||||
contracts (~> 0.13.0)
|
||||
bundler (~> 2.0)
|
||||
contracts (~> 0.13, < 0.17)
|
||||
dotenv
|
||||
erubis
|
||||
execjs (~> 2.0)
|
||||
@@ -61,48 +62,52 @@ GEM
|
||||
fastimage (~> 2.0)
|
||||
hamster (~> 3.0)
|
||||
hashie (~> 3.4)
|
||||
i18n (~> 0.9.0)
|
||||
listen (~> 3.0.0)
|
||||
i18n (~> 1.6.0)
|
||||
listen (~> 3.0)
|
||||
memoist (~> 0.14)
|
||||
padrino-helpers (~> 0.13.0)
|
||||
padrino-helpers (~> 0.15.0)
|
||||
parallel
|
||||
rack (>= 1.4.5, < 3)
|
||||
sassc (~> 2.0)
|
||||
servolux
|
||||
tilt (~> 2.0.9)
|
||||
toml
|
||||
uglifier (~> 3.0)
|
||||
minitest (5.14.3)
|
||||
padrino-helpers (0.13.3.4)
|
||||
i18n (~> 0.6, >= 0.6.7)
|
||||
padrino-support (= 0.13.3.4)
|
||||
webrick
|
||||
minitest (5.22.2)
|
||||
padrino-helpers (0.15.3)
|
||||
i18n (>= 0.6.7, < 2)
|
||||
padrino-support (= 0.15.3)
|
||||
tilt (>= 1.4.1, < 3)
|
||||
padrino-support (0.13.3.4)
|
||||
activesupport (>= 3.1)
|
||||
parallel (1.20.1)
|
||||
public_suffix (4.0.6)
|
||||
rack (2.2.3)
|
||||
rb-fsevent (0.10.4)
|
||||
padrino-support (0.15.3)
|
||||
parallel (1.24.0)
|
||||
parslet (2.0.0)
|
||||
public_suffix (5.0.4)
|
||||
rack (2.2.8.1)
|
||||
rb-fsevent (0.11.2)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
rexml (3.2.4)
|
||||
rexml (3.2.6)
|
||||
sassc (2.4.0)
|
||||
ffi (~> 1.9)
|
||||
servolux (0.13.0)
|
||||
temple (0.8.2)
|
||||
thor (1.1.0)
|
||||
thread_safe (0.3.6)
|
||||
tilt (2.0.10)
|
||||
tzinfo (1.2.9)
|
||||
thread_safe (~> 0.1)
|
||||
temple (0.10.3)
|
||||
thor (1.2.2)
|
||||
tilt (2.0.11)
|
||||
toml (0.3.0)
|
||||
parslet (>= 1.8.0, < 3.0.0)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
uglifier (3.2.0)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
webrick (1.8.1)
|
||||
|
||||
PLATFORMS
|
||||
x86_64-linux
|
||||
|
||||
DEPENDENCIES
|
||||
middleman (~> 4.2)
|
||||
middleman-autoprefixer (~> 2.7)
|
||||
middleman (~> 4.5)
|
||||
middleman-autoprefixer (~> 3.0)
|
||||
tzinfo-data
|
||||
wdm (~> 0.1)
|
||||
|
||||
|
||||
@@ -25,3 +25,9 @@ body {
|
||||
)
|
||||
rgb(var(--background-start-rgb));
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
.text-balance {
|
||||
text-wrap: balance;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import type { Metadata } from 'next'
|
||||
import { Inter } from 'next/font/google'
|
||||
import './globals.css'
|
||||
import type { Metadata } from "next";
|
||||
import { Inter } from "next/font/google";
|
||||
import "./globals.css";
|
||||
|
||||
const inter = Inter({ subsets: ['latin'] })
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Create Next App',
|
||||
description: 'Generated by create next app',
|
||||
}
|
||||
title: "Create Next App",
|
||||
description: "Generated by create next app",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className={inter.className}>{children}</body>
|
||||
</html>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Image from 'next/image'
|
||||
import Image from "next/image";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
@@ -15,7 +15,7 @@ export default function Home() {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
By{' '}
|
||||
By{" "}
|
||||
<Image
|
||||
src="/vercel.svg"
|
||||
alt="Vercel Logo"
|
||||
@@ -28,7 +28,7 @@ export default function Home() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="relative flex place-items-center before:absolute before:h-[300px] before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
|
||||
<div className="relative flex place-items-center before:absolute before:h-[300px] before:w-full sm:before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-full sm:after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
|
||||
<Image
|
||||
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
|
||||
src="/next.svg"
|
||||
@@ -47,7 +47,7 @@ export default function Home() {
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Docs{' '}
|
||||
Docs{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
@@ -64,7 +64,7 @@ export default function Home() {
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Learn{' '}
|
||||
Learn{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
@@ -81,7 +81,7 @@ export default function Home() {
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Templates{' '}
|
||||
Templates{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
@@ -98,16 +98,16 @@ export default function Home() {
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Deploy{' '}
|
||||
Deploy{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50 text-balance`}>
|
||||
Instantly deploy your Next.js site to a shareable URL with Vercel.
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
</main>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {}
|
||||
|
||||
module.exports = nextConfig
|
||||
4
examples/nextjs/next.config.mjs
Normal file
4
examples/nextjs/next.config.mjs
Normal file
@@ -0,0 +1,4 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {};
|
||||
|
||||
export default nextConfig;
|
||||
1463
examples/nextjs/package-lock.json
generated
1463
examples/nextjs/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@
|
||||
"dependencies": {
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
"next": "14.0.4"
|
||||
"next": "14.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5",
|
||||
@@ -22,6 +22,6 @@
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.3.0",
|
||||
"eslint": "^8",
|
||||
"eslint-config-next": "14.0.4"
|
||||
"eslint-config-next": "14.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@ module.exports = {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import type { Config } from 'tailwindcss'
|
||||
import type { Config } from "tailwindcss";
|
||||
|
||||
const config: Config = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./components/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./app/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
backgroundImage: {
|
||||
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
|
||||
'gradient-conic':
|
||||
'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
|
||||
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
|
||||
"gradient-conic":
|
||||
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
export default config
|
||||
};
|
||||
export default config;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
|
||||
2
examples/package.json
vendored
2
examples/package.json
vendored
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.4.1",
|
||||
"@vercel/frameworks": "2.0.6"
|
||||
"@vercel/frameworks": "3.0.0"
|
||||
},
|
||||
"version": null
|
||||
}
|
||||
|
||||
2
examples/remix/.gitignore
vendored
2
examples/remix/.gitignore
vendored
@@ -1,7 +1,5 @@
|
||||
node_modules
|
||||
|
||||
/.cache
|
||||
/build
|
||||
/public/build
|
||||
.env
|
||||
.vercel
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
import { cssBundleHref } from "@remix-run/css-bundle";
|
||||
import {
|
||||
Links,
|
||||
LiveReload,
|
||||
Meta,
|
||||
Outlet,
|
||||
Scripts,
|
||||
ScrollRestoration,
|
||||
} from "@remix-run/react";
|
||||
import { Analytics } from "@vercel/analytics/react";
|
||||
import type { LinksFunction } from "@vercel/remix";
|
||||
|
||||
export const links: LinksFunction = () => [
|
||||
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
|
||||
];
|
||||
|
||||
export default function App() {
|
||||
export function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -24,12 +17,15 @@ export default function App() {
|
||||
<Links />
|
||||
</head>
|
||||
<body>
|
||||
<Outlet />
|
||||
{children}
|
||||
<ScrollRestoration />
|
||||
<Scripts />
|
||||
<LiveReload />
|
||||
<Analytics />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return <Outlet />;
|
||||
}
|
||||
|
||||
@@ -4,29 +4,29 @@
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "remix build",
|
||||
"dev": "remix dev --manual",
|
||||
"start": "remix-serve ./build/index.js",
|
||||
"build": "remix vite:build",
|
||||
"dev": "remix vite:dev",
|
||||
"typecheck": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@remix-run/css-bundle": "^2.0.0",
|
||||
"@remix-run/node": "^2.0.0",
|
||||
"@remix-run/react": "^2.0.0",
|
||||
"@remix-run/serve": "^2.0.0",
|
||||
"@vercel/analytics": "^1.0.2",
|
||||
"@vercel/remix": "^2.0.0",
|
||||
"isbot": "^3.6.8",
|
||||
"@remix-run/node": "^2.8.0",
|
||||
"@remix-run/react": "^2.8.0",
|
||||
"@remix-run/server-runtime": "^2.8.0",
|
||||
"@vercel/analytics": "^1.2.2",
|
||||
"@vercel/remix": "^2.8.0",
|
||||
"isbot": "^4",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@remix-run/dev": "^2.0.0",
|
||||
"@remix-run/eslint-config": "^2.0.0",
|
||||
"@remix-run/dev": "^2.8.0",
|
||||
"@remix-run/eslint-config": "^2.8.0",
|
||||
"@types/react": "^18.2.20",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"eslint": "^8.38.0",
|
||||
"typescript": "^5.1.6"
|
||||
"typescript": "^5.1.6",
|
||||
"vite": "^5.1.0",
|
||||
"vite-tsconfig-paths": "^4.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
|
||||
@@ -1,22 +1,25 @@
|
||||
{
|
||||
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"include": ["**/*.ts", "**/*.tsx"],
|
||||
"compilerOptions": {
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2022"],
|
||||
"types": ["@vercel/remix", "node", "vite/client"],
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"jsx": "react-jsx",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"resolveJsonModule": true,
|
||||
"target": "ES2022",
|
||||
"strict": true,
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"~/*": ["./app/*"]
|
||||
},
|
||||
|
||||
// Remix takes care of building everything in `remix build`.
|
||||
// Vite takes care of building everything, not tsc.
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
||||
|
||||
11
examples/remix/vite.config.ts
Normal file
11
examples/remix/vite.config.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { vitePlugin as remix } from "@remix-run/dev";
|
||||
import { installGlobals } from "@remix-run/node";
|
||||
import { defineConfig } from "vite";
|
||||
import { vercelPreset } from '@vercel/remix/vite';
|
||||
import tsconfigPaths from "vite-tsconfig-paths";
|
||||
|
||||
installGlobals();
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [remix({ presets: [vercelPreset()] }), tsconfigPaths()],
|
||||
});
|
||||
@@ -1,5 +1,40 @@
|
||||
# @vercel-internals/types
|
||||
|
||||
## 1.0.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`37b193c84`](https://github.com/vercel/vercel/commit/37b193c845d8b63d93bb0017fbc1a6a35306ef1f)]:
|
||||
- @vercel/build-utils@7.7.1
|
||||
|
||||
## 1.0.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`24c3dd282`](https://github.com/vercel/vercel/commit/24c3dd282d7714cd63d2b94fb94745c45fdc79ab)]:
|
||||
- @vercel/build-utils@7.7.0
|
||||
|
||||
## 1.0.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`b6ed28b9b`](https://github.com/vercel/vercel/commit/b6ed28b9b1712f882c93fe053b70d3eb1df21819), [`8ba0ce932`](https://github.com/vercel/vercel/commit/8ba0ce932434c6295fedb5307bee59a804b7e6a8), [`0d034b682`](https://github.com/vercel/vercel/commit/0d034b6820c0f3252949c0ffc483048c5aac7f04), [`abaa700ce`](https://github.com/vercel/vercel/commit/abaa700cea44c723cfc851baa2dfe9e1ae2e8a5c)]:
|
||||
- @vercel/build-utils@7.6.0
|
||||
|
||||
## 1.0.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`cdddb33ad`](https://github.com/vercel/vercel/commit/cdddb33ad49f6080c49f4fff3767e6111acd0bbe)]:
|
||||
- @vercel/build-utils@7.5.1
|
||||
|
||||
## 1.0.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`98040ec24`](https://github.com/vercel/vercel/commit/98040ec24e1ee585865d11eb216b6525d39d209e)]:
|
||||
- @vercel/build-utils@7.5.0
|
||||
|
||||
## 1.0.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
7
internals/types/index.d.ts
vendored
7
internals/types/index.d.ts
vendored
@@ -5,7 +5,12 @@ import type { Route } from '@vercel/routing-utils';
|
||||
import { PROJECT_ENV_TARGET } from '@vercel-internals/constants';
|
||||
|
||||
export type ProjectEnvTarget = typeof PROJECT_ENV_TARGET[number];
|
||||
export type ProjectEnvType = 'plain' | 'secret' | 'encrypted' | 'system';
|
||||
export type ProjectEnvType =
|
||||
| 'plain'
|
||||
| 'secret'
|
||||
| 'encrypted'
|
||||
| 'system'
|
||||
| 'sensitive';
|
||||
|
||||
export type ProjectSettings = import('@vercel/build-utils').ProjectSettings;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/types",
|
||||
"version": "1.0.19",
|
||||
"version": "1.0.24",
|
||||
"types": "index.d.ts",
|
||||
"main": "index.d.ts",
|
||||
"files": [
|
||||
@@ -10,7 +10,7 @@
|
||||
"dependencies": {
|
||||
"@types/node": "14.14.31",
|
||||
"@vercel-internals/constants": "1.0.4",
|
||||
"@vercel/build-utils": "7.4.1",
|
||||
"@vercel/build-utils": "7.7.1",
|
||||
"@vercel/routing-utils": "3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"source-map-support": "0.5.12",
|
||||
"ts-eager": "2.0.2",
|
||||
"ts-jest": "29.1.0",
|
||||
"turbo": "1.11.2",
|
||||
"turbo": "1.12.4",
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,43 @@
|
||||
# @vercel/build-utils
|
||||
|
||||
## 7.7.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [build-utils] increase max memory limit ([#11209](https://github.com/vercel/vercel/pull/11209))
|
||||
|
||||
## 7.7.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Revert "Revert "Default ruby to only currently supported version (3.2.0)"" ([#11137](https://github.com/vercel/vercel/pull/11137))
|
||||
|
||||
## 7.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Revert "Default ruby to only currently supported version (3.2.0)" ([#11135](https://github.com/vercel/vercel/pull/11135))
|
||||
|
||||
- Mark `flags` as deprecated and replace them with `variants` ([#11098](https://github.com/vercel/vercel/pull/11098))
|
||||
|
||||
- [build-utils] change default package manager when no lockfile detected from `yarn` to `npm` (gated behind feature flag) ([#11131](https://github.com/vercel/vercel/pull/11131))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Update internal type for variants ([#11111](https://github.com/vercel/vercel/pull/11111))
|
||||
|
||||
## 7.5.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Add experimental field to Lambda and size to FileFsRef output ([#11059](https://github.com/vercel/vercel/pull/11059))
|
||||
|
||||
## 7.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Deprecate `EdgeFunction#name` property ([#11010](https://github.com/vercel/vercel/pull/11010))
|
||||
|
||||
## 7.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "7.4.1",
|
||||
"version": "7.7.1",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
|
||||
@@ -8,12 +8,13 @@ export class EdgeFunction {
|
||||
|
||||
/**
|
||||
* A display name for the edge function.
|
||||
* @deprecated This property should no longer be used. The name is inferred from the URL path of the function.
|
||||
*/
|
||||
name: string;
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* The deployment target.
|
||||
* Only v8-worker is currently supported.
|
||||
* Only `v8-worker` is currently supported.
|
||||
*/
|
||||
deploymentTarget: 'v8-worker';
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ interface FileFsRefOptions {
|
||||
mode?: number;
|
||||
contentType?: string;
|
||||
fsPath: string;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
interface FromStreamOptions {
|
||||
@@ -24,28 +25,38 @@ class FileFsRef implements FileBase {
|
||||
public type: 'FileFsRef';
|
||||
public mode: number;
|
||||
public fsPath: string;
|
||||
public size?: number;
|
||||
public contentType: string | undefined;
|
||||
|
||||
constructor({ mode = 0o100644, contentType, fsPath }: FileFsRefOptions) {
|
||||
constructor({
|
||||
mode = 0o100644,
|
||||
contentType,
|
||||
fsPath,
|
||||
size,
|
||||
}: FileFsRefOptions) {
|
||||
assert(typeof mode === 'number');
|
||||
assert(typeof fsPath === 'string');
|
||||
this.type = 'FileFsRef';
|
||||
this.mode = mode;
|
||||
this.contentType = contentType;
|
||||
this.fsPath = fsPath;
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
static async fromFsPath({
|
||||
mode,
|
||||
contentType,
|
||||
fsPath,
|
||||
size,
|
||||
}: FileFsRefOptions): Promise<FileFsRef> {
|
||||
let m = mode;
|
||||
if (!m) {
|
||||
let s = size;
|
||||
if (!m || typeof s === 'undefined') {
|
||||
const stat = await fs.lstat(fsPath);
|
||||
m = stat.mode;
|
||||
s = stat.size;
|
||||
}
|
||||
return new FileFsRef({ mode: m, contentType, fsPath });
|
||||
return new FileFsRef({ mode: m, contentType, fsPath, size: s });
|
||||
}
|
||||
|
||||
static async fromStream({
|
||||
@@ -69,7 +80,7 @@ class FileFsRef implements FileBase {
|
||||
dest.on('error', reject);
|
||||
});
|
||||
|
||||
return new FileFsRef({ mode, contentType, fsPath });
|
||||
return FileFsRef.fromFsPath({ mode, contentType, fsPath });
|
||||
}
|
||||
|
||||
async toStreamAsync(): Promise<NodeJS.ReadableStream> {
|
||||
|
||||
@@ -302,7 +302,7 @@ export async function scanParentDirs(
|
||||
});
|
||||
let lockfilePath: string | undefined;
|
||||
let lockfileVersion: number | undefined;
|
||||
let cliType: CliType = 'yarn';
|
||||
let cliType: CliType;
|
||||
|
||||
const [hasYarnLock, packageLockJson, pnpmLockYaml, bunLockBin] =
|
||||
await Promise.all([
|
||||
@@ -338,6 +338,12 @@ export async function scanParentDirs(
|
||||
lockfilePath = bunLockPath;
|
||||
// TODO: read "bun-lockfile-format-v0"
|
||||
lockfileVersion = 0;
|
||||
} else {
|
||||
if (process.env.VERCEL_ENABLE_NPM_DEFAULT === '1') {
|
||||
cliType = 'npm';
|
||||
} else {
|
||||
cliType = 'yarn';
|
||||
}
|
||||
}
|
||||
|
||||
const packageJsonPath = pkgJsonPath || undefined;
|
||||
@@ -414,6 +420,14 @@ export async function runNpmInstall(
|
||||
destPath
|
||||
);
|
||||
|
||||
if (!packageJsonPath) {
|
||||
debug(
|
||||
`Skipping dependency installation because no package.json was found for ${destPath}`
|
||||
);
|
||||
runNpmInstallSema.release();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only allow `runNpmInstall()` to run once per `package.json`
|
||||
// when doing a default install (no additional args)
|
||||
if (meta && packageJsonPath && args.length === 0) {
|
||||
|
||||
@@ -37,6 +37,7 @@ export interface LambdaOptionsBase {
|
||||
|
||||
export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
|
||||
files: Files;
|
||||
experimentalAllowBundling?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,6 +80,7 @@ export class Lambda {
|
||||
supportsWrapper?: boolean;
|
||||
supportsResponseStreaming?: boolean;
|
||||
framework?: FunctionFramework;
|
||||
experimentalAllowBundling?: boolean;
|
||||
|
||||
constructor(opts: LambdaOptions) {
|
||||
const {
|
||||
@@ -114,6 +116,16 @@ export class Lambda {
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
'experimentalAllowBundling' in opts &&
|
||||
opts.experimentalAllowBundling !== undefined
|
||||
) {
|
||||
assert(
|
||||
typeof opts.experimentalAllowBundling === 'boolean',
|
||||
'"experimentalAllowBundling" is not a boolean'
|
||||
);
|
||||
}
|
||||
|
||||
if (memory !== undefined) {
|
||||
assert(typeof memory === 'number', '"memory" is not a number');
|
||||
}
|
||||
@@ -183,6 +195,10 @@ export class Lambda {
|
||||
this.supportsResponseStreaming =
|
||||
supportsResponseStreaming ?? experimentalResponseStreaming;
|
||||
this.framework = framework;
|
||||
this.experimentalAllowBundling =
|
||||
'experimentalAllowBundling' in opts
|
||||
? opts.experimentalAllowBundling
|
||||
: undefined;
|
||||
}
|
||||
|
||||
async createZip(): Promise<Buffer> {
|
||||
|
||||
@@ -14,7 +14,7 @@ export const functionsSchema = {
|
||||
},
|
||||
memory: {
|
||||
minimum: 128,
|
||||
maximum: 3008,
|
||||
maximum: 3009,
|
||||
},
|
||||
maxDuration: {
|
||||
type: 'number',
|
||||
|
||||
@@ -440,7 +440,9 @@ export interface Cron {
|
||||
schedule: string;
|
||||
}
|
||||
|
||||
// TODO: Proper description once complete
|
||||
/**
|
||||
* @deprecated Replaced by Variants. Remove once fully replaced.
|
||||
*/
|
||||
export interface Flag {
|
||||
key: string;
|
||||
defaultValue?: unknown;
|
||||
@@ -471,7 +473,9 @@ export interface BuildResultV2Typical {
|
||||
framework?: {
|
||||
version: string;
|
||||
};
|
||||
/** @deprecated Replaced by Variants. Remove once fully replaced. */
|
||||
flags?: Flag[];
|
||||
variants?: Record<string, VariantDefinition>;
|
||||
}
|
||||
|
||||
export type BuildResultV2 = BuildResultV2Typical | BuildResultBuildOutput;
|
||||
@@ -491,3 +495,28 @@ export type ShouldServe = (
|
||||
export type StartDevServer = (
|
||||
options: StartDevServerOptions
|
||||
) => Promise<StartDevServerResult>;
|
||||
|
||||
/**
|
||||
* TODO: The following types will eventually be exported by a more
|
||||
* relevant package.
|
||||
*/
|
||||
type VariantJSONArray = ReadonlyArray<VariantJSONValue>;
|
||||
|
||||
type VariantJSONValue =
|
||||
| string
|
||||
| boolean
|
||||
| number
|
||||
| null
|
||||
| VariantJSONArray
|
||||
| { [key: string]: VariantJSONValue };
|
||||
|
||||
type VariantOption = {
|
||||
value: VariantJSONValue;
|
||||
label?: string;
|
||||
};
|
||||
|
||||
export interface VariantDefinition {
|
||||
options?: VariantOption[];
|
||||
origin?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
4
packages/build-utils/test/fixtures/07-cross-install/api/yarn.lock
vendored
Normal file
4
packages/build-utils/test/fixtures/07-cross-install/api/yarn.lock
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
4
packages/build-utils/test/fixtures/07-cross-install/lib/yarn.lock
vendored
Normal file
4
packages/build-utils/test/fixtures/07-cross-install/lib/yarn.lock
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
4
packages/build-utils/test/fixtures/08-yarn-npm/with-yarn/yarn.lock
vendored
Normal file
4
packages/build-utils/test/fixtures/08-yarn-npm/with-yarn/yarn.lock
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
9
packages/build-utils/test/fixtures/40-no-lockfile/package.json
vendored
Normal file
9
packages/build-utils/test/fixtures/40-no-lockfile/package.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "mkdir -p public && (printf \"npm version: \" && npm -v) > public/index.txt"
|
||||
},
|
||||
"dependencies": {
|
||||
"sharp": "0.33.2"
|
||||
}
|
||||
}
|
||||
3
packages/build-utils/test/fixtures/40-no-lockfile/probes.json
vendored
Normal file
3
packages/build-utils/test/fixtures/40-no-lockfile/probes.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"probes": [{ "path": "/", "mustContain": "npm version: 8" }]
|
||||
}
|
||||
7
packages/build-utils/test/fixtures/40-no-lockfile/vercel.json
vendored
Normal file
7
packages/build-utils/test/fixtures/40-no-lockfile/vercel.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"build": {
|
||||
"env": {
|
||||
"VERCEL_ENABLE_NPM_DEFAULT": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
46
packages/build-utils/test/unit.test.ts
vendored
46
packages/build-utils/test/unit.test.ts
vendored
@@ -576,6 +576,52 @@ it(
|
||||
ms('1m')
|
||||
);
|
||||
|
||||
it('should return cliType npm when no lockfile is present and VERCEL_ENABLE_NPM_DEFAULT is set', async () => {
|
||||
const originalRepoLockfilePath = path.join(
|
||||
__dirname,
|
||||
'..',
|
||||
'..',
|
||||
'..',
|
||||
'pnpm-lock.yaml'
|
||||
);
|
||||
const originalRepoLockfileData = await fs.readFile(originalRepoLockfilePath);
|
||||
await fs.remove(originalRepoLockfilePath);
|
||||
try {
|
||||
process.env.VERCEL_ENABLE_NPM_DEFAULT = '1';
|
||||
const fixture = path.join(__dirname, 'fixtures', '40-no-lockfile');
|
||||
const result = await scanParentDirs(fixture);
|
||||
expect(result.cliType).toEqual('npm');
|
||||
expect(result.lockfileVersion).toEqual(undefined);
|
||||
expect(result.lockfilePath).toEqual(undefined);
|
||||
expect(result.packageJsonPath).toEqual(path.join(fixture, 'package.json'));
|
||||
} finally {
|
||||
delete process.env.VERCEL_ENABLE_NPM_DEFAULT;
|
||||
await fs.writeFile(originalRepoLockfilePath, originalRepoLockfileData);
|
||||
}
|
||||
});
|
||||
|
||||
it('should return cliType yarn when no lockfile is present and VERCEL_ENABLE_NPM_DEFAULT is not set', async () => {
|
||||
const originalRepoLockfilePath = path.join(
|
||||
__dirname,
|
||||
'..',
|
||||
'..',
|
||||
'..',
|
||||
'pnpm-lock.yaml'
|
||||
);
|
||||
const originalRepoLockfileData = await fs.readFile(originalRepoLockfilePath);
|
||||
await fs.remove(originalRepoLockfilePath);
|
||||
try {
|
||||
const fixture = path.join(__dirname, 'fixtures', '40-no-lockfile');
|
||||
const result = await scanParentDirs(fixture);
|
||||
expect(result.cliType).toEqual('yarn');
|
||||
expect(result.lockfileVersion).toEqual(undefined);
|
||||
expect(result.lockfilePath).toEqual(undefined);
|
||||
expect(result.packageJsonPath).toEqual(path.join(fixture, 'package.json'));
|
||||
} finally {
|
||||
await fs.writeFile(originalRepoLockfilePath, originalRepoLockfileData);
|
||||
}
|
||||
});
|
||||
|
||||
it('should return cliType bun and correct lock file for bun v1', async () => {
|
||||
const fixture = path.join(__dirname, 'fixtures', '31-bun-v1-with-yarn-lock');
|
||||
const result = await scanParentDirs(fixture);
|
||||
|
||||
@@ -1,5 +1,128 @@
|
||||
# vercel
|
||||
|
||||
## 33.5.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [build-utils] increase max memory limit ([#11209](https://github.com/vercel/vercel/pull/11209))
|
||||
|
||||
- Updated dependencies [[`b1d8b83ab`](https://github.com/vercel/vercel/commit/b1d8b83abbf23a3485aedb490992d0a3bf44573f), [`37b193c84`](https://github.com/vercel/vercel/commit/37b193c845d8b63d93bb0017fbc1a6a35306ef1f), [`20237d4f7`](https://github.com/vercel/vercel/commit/20237d4f7b55b0697b57db15636c11204cb0dc39), [`f8fab639b`](https://github.com/vercel/vercel/commit/f8fab639bf49a60389b8d0b7b265a737c17b4ae1), [`6ed0fe6fb`](https://github.com/vercel/vercel/commit/6ed0fe6fb1e487545a790ff5b9fc691cf625f005)]:
|
||||
- @vercel/next@4.1.4
|
||||
- @vercel/build-utils@7.7.1
|
||||
- @vercel/remix-builder@2.1.1
|
||||
- @vercel/static-build@2.4.1
|
||||
- @vercel/node@3.0.21
|
||||
|
||||
## 33.5.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`c2d99855e`](https://github.com/vercel/vercel/commit/c2d99855ea6132380434ed29643120680f95fad7), [`1333071a3`](https://github.com/vercel/vercel/commit/1333071a3a2d324679327bfdd4e872f8fd3521c6)]:
|
||||
- @vercel/next@4.1.3
|
||||
- @vercel/remix-builder@2.1.0
|
||||
|
||||
## 33.5.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`e109e3325`](https://github.com/vercel/vercel/commit/e109e3325ab5299da0903034175fabe72d486a4e), [`d17abf463`](https://github.com/vercel/vercel/commit/d17abf463acabf9e1e43b91200f18efd34e91f62), [`644721a90`](https://github.com/vercel/vercel/commit/644721a90da8cf98414d272be9da0a821a2ce217), [`ea0e9aeae`](https://github.com/vercel/vercel/commit/ea0e9aeaec8ddddb5a726be0d252df9cdbd84808), [`e318a0eea`](https://github.com/vercel/vercel/commit/e318a0eea55c9b8536b0874f66cfd03aca6f0adf), [`1fee87e76`](https://github.com/vercel/vercel/commit/1fee87e76f18d2f5e5524247cfce615fa1832e49), [`bfc01fd98`](https://github.com/vercel/vercel/commit/bfc01fd98f760a008d0d2e6c52b5216503b44b75), [`7910f2f30`](https://github.com/vercel/vercel/commit/7910f2f3070ff69742e845e795d4db77d598c181), [`440ef3ba9`](https://github.com/vercel/vercel/commit/440ef3ba98af8f05e7714c86c67c36dbda11e85c)]:
|
||||
- @vercel/remix-builder@2.0.20
|
||||
- @vercel/next@4.1.2
|
||||
- @vercel/node@3.0.20
|
||||
- @vercel/redwood@2.0.8
|
||||
|
||||
## 33.5.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- build: upgrade edge-runtime ([#11148](https://github.com/vercel/vercel/pull/11148))
|
||||
|
||||
- Updated dependencies [[`24c3dd282`](https://github.com/vercel/vercel/commit/24c3dd282d7714cd63d2b94fb94745c45fdc79ab), [`10e200e0b`](https://github.com/vercel/vercel/commit/10e200e0bf8f692b6740e098e0572b4e7de83850), [`678ebbe52`](https://github.com/vercel/vercel/commit/678ebbe5255766656bf2dddc574e86b2999f11c8)]:
|
||||
- @vercel/build-utils@7.7.0
|
||||
- @vercel/static-build@2.4.0
|
||||
- @vercel/node@3.0.19
|
||||
|
||||
## 33.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Mark `flags` as deprecated and replace them with `variants` ([#11098](https://github.com/vercel/vercel/pull/11098))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`c32a909af`](https://github.com/vercel/vercel/commit/c32a909afcedf0ee55777d5dcaecc0c8383dd8c8), [`b6ed28b9b`](https://github.com/vercel/vercel/commit/b6ed28b9b1712f882c93fe053b70d3eb1df21819), [`d21bb9f87`](https://github.com/vercel/vercel/commit/d21bb9f87e1d837666fe8104d4e199b2590725d6), [`4027a1833`](https://github.com/vercel/vercel/commit/4027a1833718a92be74b2b3c5a4df23745d19a36), [`8ba0ce932`](https://github.com/vercel/vercel/commit/8ba0ce932434c6295fedb5307bee59a804b7e6a8), [`0d034b682`](https://github.com/vercel/vercel/commit/0d034b6820c0f3252949c0ffc483048c5aac7f04), [`abaa700ce`](https://github.com/vercel/vercel/commit/abaa700cea44c723cfc851baa2dfe9e1ae2e8a5c), [`3bad73401`](https://github.com/vercel/vercel/commit/3bad73401b4ec1f61e515965732cde8dcc052b17)]:
|
||||
- @vercel/next@4.1.1
|
||||
- @vercel/node@3.0.18
|
||||
- @vercel/redwood@2.0.7
|
||||
- @vercel/remix-builder@2.0.19
|
||||
- @vercel/build-utils@7.6.0
|
||||
- @vercel/static-build@2.3.0
|
||||
|
||||
## 33.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`d05e41eea`](https://github.com/vercel/vercel/commit/d05e41eeaf97a024157d2bd843782c95c39389be), [`de63e3562`](https://github.com/vercel/vercel/commit/de63e356223467447cda539ddc435a892303afc7)]:
|
||||
- @vercel/static-build@2.2.0
|
||||
|
||||
## 33.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Added a new option to add a sensitive environment variable ([#11033](https://github.com/vercel/vercel/pull/11033))
|
||||
|
||||
## 33.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Emit "filePathMap" in `vc-config.json` for `FileFsRef` instances ([#11060](https://github.com/vercel/vercel/pull/11060))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Update `vc dev` to support `Lambda` instances without `zipBuffer` ([#11080](https://github.com/vercel/vercel/pull/11080))
|
||||
|
||||
- Updated dependencies [[`322c88536`](https://github.com/vercel/vercel/commit/322c88536dfa0ba3892eb580858ee54f6b04ed3f), [`62ca2efa7`](https://github.com/vercel/vercel/commit/62ca2efa731c4df46d586b94078b2dcb1c0bb934)]:
|
||||
- @vercel/ruby@2.0.5
|
||||
- @vercel/python@4.1.1
|
||||
|
||||
## 33.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- chore: deprecate next/nuxt/gastby Speed Insights injection in favor of @vercel/speed-insights ([#11048](https://github.com/vercel/vercel/pull/11048))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- fix error when @vercel/analytics is a transitive dependency of the deployed application ([#10892](https://github.com/vercel/vercel/pull/10892))
|
||||
|
||||
- [cli] Add documentation string for `skip-domain` option ([#11051](https://github.com/vercel/vercel/pull/11051))
|
||||
|
||||
- Updated dependencies [[`260125784`](https://github.com/vercel/vercel/commit/2601257846fa201fc9efde021a906c706f6191aa), [`cdddb33ad`](https://github.com/vercel/vercel/commit/cdddb33ad49f6080c49f4fff3767e6111acd0bbe), [`72d8604c9`](https://github.com/vercel/vercel/commit/72d8604c9dba108ccca41d6288b765a7ba727295), [`90d0455e1`](https://github.com/vercel/vercel/commit/90d0455e1ff7b5892ff4960226535f57f704ef6f), [`0716130e5`](https://github.com/vercel/vercel/commit/0716130e580a920d92d249d029ed37f92f2ca847), [`b6b151f39`](https://github.com/vercel/vercel/commit/b6b151f3917c5cb47226951446b9dbb96c7d872b), [`b185a7e20`](https://github.com/vercel/vercel/commit/b185a7e207b153c378bd3db2618eece3a3b6a93e)]:
|
||||
- @vercel/static-build@2.1.0
|
||||
- @vercel/build-utils@7.5.1
|
||||
- @vercel/next@4.1.0
|
||||
- @vercel/remix-builder@2.0.18
|
||||
- @vercel/node@3.0.17
|
||||
|
||||
## 33.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Serialize duplicate `EdgeFunction` references as symlinks in `vc build` ([#11027](https://github.com/vercel/vercel/pull/11027))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Handle rate limit response when fetching /teams ([#11013](https://github.com/vercel/vercel/pull/11013))
|
||||
|
||||
- Display actual deployment's 'target' ([#11025](https://github.com/vercel/vercel/pull/11025))
|
||||
|
||||
- Updated dependencies [[`98040ec24`](https://github.com/vercel/vercel/commit/98040ec24e1ee585865d11eb216b6525d39d209e)]:
|
||||
- @vercel/build-utils@7.5.0
|
||||
- @vercel/static-build@2.0.17
|
||||
- @vercel/hydrogen@1.0.2
|
||||
- @vercel/remix-builder@2.0.17
|
||||
- @vercel/node@3.0.16
|
||||
|
||||
## 33.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "33.0.2",
|
||||
"version": "33.5.4",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -31,22 +31,22 @@
|
||||
"node": ">= 16"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "7.4.1",
|
||||
"@vercel/build-utils": "7.7.1",
|
||||
"@vercel/fun": "1.1.0",
|
||||
"@vercel/go": "3.0.5",
|
||||
"@vercel/hydrogen": "1.0.1",
|
||||
"@vercel/next": "4.0.17",
|
||||
"@vercel/node": "3.0.15",
|
||||
"@vercel/python": "4.1.0",
|
||||
"@vercel/redwood": "2.0.6",
|
||||
"@vercel/remix-builder": "2.0.16",
|
||||
"@vercel/ruby": "2.0.4",
|
||||
"@vercel/static-build": "2.0.16",
|
||||
"@vercel/hydrogen": "1.0.2",
|
||||
"@vercel/next": "4.1.4",
|
||||
"@vercel/node": "3.0.21",
|
||||
"@vercel/python": "4.1.1",
|
||||
"@vercel/redwood": "2.0.8",
|
||||
"@vercel/remix-builder": "2.1.1",
|
||||
"@vercel/ruby": "2.0.5",
|
||||
"@vercel/static-build": "2.4.1",
|
||||
"chokidar": "3.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
"@edge-runtime/node-utils": "2.2.2",
|
||||
"@edge-runtime/node-utils": "2.3.0",
|
||||
"@next/env": "11.1.2",
|
||||
"@sentry/node": "5.5.0",
|
||||
"@sindresorhus/slugify": "0.11.0",
|
||||
@@ -88,11 +88,11 @@
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel-internals/constants": "1.0.4",
|
||||
"@vercel-internals/get-package-json": "1.0.0",
|
||||
"@vercel-internals/types": "1.0.19",
|
||||
"@vercel/client": "13.0.12",
|
||||
"@vercel-internals/types": "1.0.24",
|
||||
"@vercel/client": "13.1.4",
|
||||
"@vercel/error-utils": "2.0.2",
|
||||
"@vercel/frameworks": "2.0.6",
|
||||
"@vercel/fs-detectors": "5.1.6",
|
||||
"@vercel/frameworks": "3.0.0",
|
||||
"@vercel/fs-detectors": "5.2.1",
|
||||
"@vercel/routing-utils": "3.1.0",
|
||||
"ajv": "6.12.2",
|
||||
"alpha-sort": "2.0.1",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import fs from 'fs-extra';
|
||||
import fs, { readJSON } from 'fs-extra';
|
||||
import chalk from 'chalk';
|
||||
import dotenv from 'dotenv';
|
||||
import semver from 'semver';
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
Cron,
|
||||
validateNpmrc,
|
||||
Flag,
|
||||
VariantDefinition,
|
||||
} from '@vercel/build-utils';
|
||||
import {
|
||||
detectBuilders,
|
||||
@@ -71,6 +72,7 @@ import { setMonorepoDefaultSettings } from '../../util/build/monorepo';
|
||||
import { help } from '../help';
|
||||
import { buildCommand } from './command';
|
||||
import { scrubArgv } from '../../util/build/scrub-argv';
|
||||
import { cwd } from 'process';
|
||||
|
||||
type BuildResult = BuildResultV2 | BuildResultV3;
|
||||
|
||||
@@ -94,7 +96,9 @@ interface BuildOutputConfig {
|
||||
version: string;
|
||||
};
|
||||
crons?: Cron[];
|
||||
/** @deprecated Replaced by Variants. Remove once fully replaced. */
|
||||
flags?: Flag[];
|
||||
variants?: Record<string, VariantDefinition>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -257,6 +261,9 @@ export default async function main(client: Client): Promise<number> {
|
||||
if (project.settings.analyticsId) {
|
||||
envToUnset.add('VERCEL_ANALYTICS_ID');
|
||||
process.env.VERCEL_ANALYTICS_ID = project.settings.analyticsId;
|
||||
output.warn(
|
||||
'Vercel Speed Insights auto-injection is deprecated in favor of @vercel/speed-insights package. Learn more: https://vercel.link/upgrate-to-speed-insights-package'
|
||||
);
|
||||
}
|
||||
|
||||
// Some build processes use these env vars to platform detect Vercel
|
||||
@@ -432,29 +439,6 @@ async function doBuild(
|
||||
|
||||
const ops: Promise<Error | void>[] = [];
|
||||
|
||||
const dependencyMap = makeDepencyMap(pkg);
|
||||
const speedInsighsVersion = dependencyMap.get('@vercel/speed-insights');
|
||||
if (speedInsighsVersion) {
|
||||
if (process.env.VERCEL_ANALYTICS_ID) {
|
||||
output.warn(
|
||||
`The \`VERCEL_ANALYTICS_ID\` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables`
|
||||
);
|
||||
|
||||
delete process.env.VERCEL_ANALYTICS_ID;
|
||||
}
|
||||
buildsJson.features = {
|
||||
...(buildsJson.features ?? {}),
|
||||
speedInsightsVersion: speedInsighsVersion,
|
||||
};
|
||||
}
|
||||
const webAnalyticsVersion = dependencyMap.get('@vercel/analytics');
|
||||
if (webAnalyticsVersion) {
|
||||
buildsJson.features = {
|
||||
...(buildsJson.features ?? {}),
|
||||
webAnalyticsVersion: webAnalyticsVersion,
|
||||
};
|
||||
}
|
||||
|
||||
// Write the `detectedBuilders` result to output dir
|
||||
const buildsJsonBuilds = new Map<Builder, SerializedBuilder>(
|
||||
builds.map(build => {
|
||||
@@ -474,10 +458,9 @@ async function doBuild(
|
||||
];
|
||||
})
|
||||
);
|
||||
|
||||
buildsJson.builds = Array.from(buildsJsonBuilds.values());
|
||||
await fs.writeJSON(join(outputDir, 'builds.json'), buildsJson, {
|
||||
spaces: 2,
|
||||
});
|
||||
await writeBuildJson(buildsJson, outputDir);
|
||||
|
||||
// The `meta` config property is re-used for each Builder
|
||||
// invocation so that Builders can share state between
|
||||
@@ -573,6 +556,7 @@ async function doBuild(
|
||||
// Start flushing the file outputs to the filesystem asynchronously
|
||||
ops.push(
|
||||
writeBuildResult(
|
||||
repoRootPath,
|
||||
outputDir,
|
||||
buildResult,
|
||||
build,
|
||||
@@ -608,6 +592,33 @@ async function doBuild(
|
||||
}
|
||||
}
|
||||
|
||||
let needBuildsJsonOverride = false;
|
||||
const speedInsightsVersion = await readInstalledVersion(
|
||||
client,
|
||||
'@vercel/speed-insights'
|
||||
);
|
||||
if (speedInsightsVersion) {
|
||||
buildsJson.features = {
|
||||
...(buildsJson.features ?? {}),
|
||||
speedInsightsVersion,
|
||||
};
|
||||
needBuildsJsonOverride = true;
|
||||
}
|
||||
const webAnalyticsVersion = await readInstalledVersion(
|
||||
client,
|
||||
'@vercel/analytics'
|
||||
);
|
||||
if (webAnalyticsVersion) {
|
||||
buildsJson.features = {
|
||||
...(buildsJson.features ?? {}),
|
||||
webAnalyticsVersion,
|
||||
};
|
||||
needBuildsJsonOverride = true;
|
||||
}
|
||||
if (needBuildsJsonOverride) {
|
||||
await writeBuildJson(buildsJson, outputDir);
|
||||
}
|
||||
|
||||
// Merge existing `config.json` file into the one that will be produced
|
||||
const configPath = join(outputDir, 'config.json');
|
||||
const existingConfig = await readJSONFile<BuildOutputConfig>(configPath);
|
||||
@@ -670,10 +681,13 @@ async function doBuild(
|
||||
overrides: mergedOverrides,
|
||||
framework,
|
||||
crons: mergedCrons,
|
||||
/** @deprecated Replaced by Variants. Remove once fully replaced. */
|
||||
flags: mergedFlags,
|
||||
};
|
||||
await fs.writeJSON(join(outputDir, 'config.json'), config, { spaces: 2 });
|
||||
|
||||
await writeVariantsJson(client, buildResults.values(), outputDir);
|
||||
|
||||
const relOutputDir = relative(cwd, outputDir);
|
||||
output.print(
|
||||
`${prependEmoji(
|
||||
@@ -818,9 +832,69 @@ function mergeFlags(
|
||||
});
|
||||
}
|
||||
|
||||
function makeDepencyMap(pkg: PackageJson | null): Map<string, string> {
|
||||
return new Map([
|
||||
...Object.entries(pkg?.devDependencies ?? {}),
|
||||
...Object.entries(pkg?.dependencies ?? {}),
|
||||
]);
|
||||
/**
|
||||
* Takes the build output and writes all the variants into the `variants.json`
|
||||
* file. It'll skip variants that already exist.
|
||||
*/
|
||||
async function writeVariantsJson(
|
||||
{ output }: Client,
|
||||
buildResults: Iterable<BuildResult | BuildOutputConfig>,
|
||||
outputDir: string
|
||||
): Promise<void> {
|
||||
const variantsFilePath = join(outputDir, 'variants.json');
|
||||
|
||||
let hasVariants = true;
|
||||
|
||||
const variants = (await fs.readJSON(variantsFilePath).catch(error => {
|
||||
if (error.code === 'ENOENT') {
|
||||
hasVariants = false;
|
||||
return { definitions: {} };
|
||||
}
|
||||
|
||||
throw error;
|
||||
})) as { definitions: Record<string, VariantDefinition> };
|
||||
|
||||
for (const result of buildResults) {
|
||||
if (!('variants' in result) || !result.variants) continue;
|
||||
|
||||
for (const [key, defintion] of Object.entries(result.variants)) {
|
||||
if (result.variants[key]) {
|
||||
output.warn(
|
||||
`The variant "${key}" was found multiple times. Only its first occurrence will be considered.`
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
hasVariants = true;
|
||||
variants.definitions[key] = defintion;
|
||||
}
|
||||
}
|
||||
|
||||
// Only create the file when there are variants to write,
|
||||
// or when the file already exists.
|
||||
if (hasVariants) {
|
||||
await fs.writeJSON(variantsFilePath, variants, { spaces: 2 });
|
||||
}
|
||||
}
|
||||
|
||||
async function writeBuildJson(buildsJson: BuildsManifest, outputDir: string) {
|
||||
await fs.writeJSON(join(outputDir, 'builds.json'), buildsJson, { spaces: 2 });
|
||||
}
|
||||
|
||||
export async function readInstalledVersion(
|
||||
{ output }: Client,
|
||||
pkgName: string
|
||||
): Promise<string | undefined> {
|
||||
try {
|
||||
const descriptorPath = require.resolve(`${pkgName}/package.json`, {
|
||||
paths: [cwd()],
|
||||
});
|
||||
const descriptor = await readJSON(descriptorPath);
|
||||
return descriptor?.version;
|
||||
} catch (err) {
|
||||
output.debug(
|
||||
`Package ${pkgName} is not installed (failed to read its package.json: ${err})`
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,8 @@ export const deployCommand: Command = {
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: undefined,
|
||||
description:
|
||||
'Disable the automatic promotion (aliasing) of the relevant domains to a new production deployment. You can use `vc promote` to complete the domain-assignment process later',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
|
||||
5
packages/cli/src/commands/env/add.ts
vendored
5
packages/cli/src/commands/env/add.ts
vendored
@@ -19,6 +19,7 @@ import { isAPIError } from '../../util/errors-ts';
|
||||
|
||||
type Options = {
|
||||
'--debug': boolean;
|
||||
'--sensitive': boolean;
|
||||
};
|
||||
|
||||
export default async function add(
|
||||
@@ -144,6 +145,8 @@ export default async function add(
|
||||
envGitBranch = inputValue || '';
|
||||
}
|
||||
|
||||
const type = opts['--sensitive'] ? 'sensitive' : 'encrypted';
|
||||
|
||||
const addStamp = stamp();
|
||||
try {
|
||||
output.spinner('Saving');
|
||||
@@ -151,7 +154,7 @@ export default async function add(
|
||||
output,
|
||||
client,
|
||||
project.id,
|
||||
'encrypted',
|
||||
type,
|
||||
envName,
|
||||
envValue,
|
||||
envTargets,
|
||||
|
||||
15
packages/cli/src/commands/env/command.ts
vendored
15
packages/cli/src/commands/env/command.ts
vendored
@@ -34,7 +34,16 @@ export const envCommand: Command = {
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
options: [],
|
||||
options: [
|
||||
{
|
||||
name: 'sensitive',
|
||||
description: 'Add a sensitive Environment Variable',
|
||||
shorthand: null,
|
||||
type: 'string',
|
||||
deprecated: false,
|
||||
multi: false,
|
||||
},
|
||||
],
|
||||
examples: [],
|
||||
},
|
||||
{
|
||||
@@ -117,6 +126,10 @@ export const envCommand: Command = {
|
||||
`${packageName} env add DB_PASS production`,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Add a sensitive Environment Variable',
|
||||
value: `${packageName} env add API_TOKEN --sensitive`,
|
||||
},
|
||||
{
|
||||
name: 'Add a new variable for a specific Environment and Git Branch',
|
||||
value: [
|
||||
|
||||
1
packages/cli/src/commands/env/index.ts
vendored
1
packages/cli/src/commands/env/index.ts
vendored
@@ -34,6 +34,7 @@ export default async function main(client: Client) {
|
||||
'-y': '--yes',
|
||||
'--environment': String,
|
||||
'--git-branch': String,
|
||||
'--sensitive': Boolean,
|
||||
});
|
||||
} catch (error) {
|
||||
handleError(error);
|
||||
|
||||
@@ -465,6 +465,15 @@ const main = async () => {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (isErrnoException(err) && err.code === 'rate_limited') {
|
||||
output.prettyError({
|
||||
message:
|
||||
'Rate limited. Too many requests to the same endpoint: /teams',
|
||||
});
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
console.error(error('Not able to load teams'));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
BuildResultV2,
|
||||
BuildResultV3,
|
||||
File,
|
||||
Files,
|
||||
FileFsRef,
|
||||
BuilderV2,
|
||||
BuilderV3,
|
||||
@@ -45,6 +46,7 @@ interface FunctionConfiguration {
|
||||
}
|
||||
|
||||
export async function writeBuildResult(
|
||||
repoRootPath: string,
|
||||
outputDir: string,
|
||||
buildResult: BuildResultV2 | BuildResultV3,
|
||||
build: Builder,
|
||||
@@ -55,6 +57,7 @@ export async function writeBuildResult(
|
||||
const { version } = builder;
|
||||
if (typeof version !== 'number' || version === 2) {
|
||||
return writeBuildResultV2(
|
||||
repoRootPath,
|
||||
outputDir,
|
||||
buildResult as BuildResultV2,
|
||||
build,
|
||||
@@ -62,6 +65,7 @@ export async function writeBuildResult(
|
||||
);
|
||||
} else if (version === 3) {
|
||||
return writeBuildResultV3(
|
||||
repoRootPath,
|
||||
outputDir,
|
||||
buildResult as BuildResultV3,
|
||||
build,
|
||||
@@ -107,6 +111,7 @@ function stripDuplicateSlashes(path: string): string {
|
||||
* the filesystem.
|
||||
*/
|
||||
async function writeBuildResultV2(
|
||||
repoRootPath: string,
|
||||
outputDir: string,
|
||||
buildResult: BuildResultV2,
|
||||
build: Builder,
|
||||
@@ -129,13 +134,20 @@ async function writeBuildResultV2(
|
||||
);
|
||||
}
|
||||
|
||||
const lambdas = new Map<Lambda, string>();
|
||||
const existingFunctions = new Map<Lambda | EdgeFunction, string>();
|
||||
const overrides: Record<string, PathOverride> = {};
|
||||
|
||||
for (const [path, output] of Object.entries(buildResult.output)) {
|
||||
const normalizedPath = stripDuplicateSlashes(path);
|
||||
if (isLambda(output)) {
|
||||
await writeLambda(outputDir, output, normalizedPath, undefined, lambdas);
|
||||
await writeLambda(
|
||||
repoRootPath,
|
||||
outputDir,
|
||||
output,
|
||||
normalizedPath,
|
||||
undefined,
|
||||
existingFunctions
|
||||
);
|
||||
} else if (isPrerender(output)) {
|
||||
if (!output.lambda) {
|
||||
throw new Error(
|
||||
@@ -144,11 +156,12 @@ async function writeBuildResultV2(
|
||||
}
|
||||
|
||||
await writeLambda(
|
||||
repoRootPath,
|
||||
outputDir,
|
||||
output.lambda,
|
||||
normalizedPath,
|
||||
undefined,
|
||||
lambdas
|
||||
existingFunctions
|
||||
);
|
||||
|
||||
// Write the fallback file alongside the Lambda directory
|
||||
@@ -203,7 +216,13 @@ async function writeBuildResultV2(
|
||||
vercelConfig?.cleanUrls
|
||||
);
|
||||
} else if (isEdgeFunction(output)) {
|
||||
await writeEdgeFunction(outputDir, output, normalizedPath);
|
||||
await writeEdgeFunction(
|
||||
repoRootPath,
|
||||
outputDir,
|
||||
output,
|
||||
normalizedPath,
|
||||
existingFunctions
|
||||
);
|
||||
} else {
|
||||
throw new Error(
|
||||
`Unsupported output type: "${
|
||||
@@ -220,6 +239,7 @@ async function writeBuildResultV2(
|
||||
* the filesystem.
|
||||
*/
|
||||
async function writeBuildResultV3(
|
||||
repoRootPath: string,
|
||||
outputDir: string,
|
||||
buildResult: BuildResultV3,
|
||||
build: Builder,
|
||||
@@ -243,9 +263,15 @@ async function writeBuildResultV3(
|
||||
build.config?.zeroConfig ? src.substring(0, src.length - ext.length) : src
|
||||
);
|
||||
if (isLambda(output)) {
|
||||
await writeLambda(outputDir, output, path, functionConfiguration);
|
||||
await writeLambda(
|
||||
repoRootPath,
|
||||
outputDir,
|
||||
output,
|
||||
path,
|
||||
functionConfiguration
|
||||
);
|
||||
} else if (isEdgeFunction(output)) {
|
||||
await writeEdgeFunction(outputDir, output, path);
|
||||
await writeEdgeFunction(repoRootPath, outputDir, output, path);
|
||||
} else {
|
||||
throw new Error(
|
||||
`Unsupported output type: "${(output as any).type}" for ${build.src}`
|
||||
@@ -315,27 +341,79 @@ async function writeStaticFile(
|
||||
await downloadFile(file, dest);
|
||||
}
|
||||
|
||||
/**
|
||||
* If the `fn` Lambda or Edge function has already been written to
|
||||
* the filesystem at a different location, then create a symlink
|
||||
* to the previous location instead of copying the files again.
|
||||
*
|
||||
* @param outputPath The path of the `.vercel/output` directory
|
||||
* @param dest The path of destination function's `.func` directory
|
||||
* @param fn The Lambda or EdgeFunction instance to create the symlink for
|
||||
* @param existingFunctions Map of `Lambda`/`EdgeFunction` instances that have previously been written
|
||||
*/
|
||||
async function writeFunctionSymlink(
|
||||
outputDir: string,
|
||||
dest: string,
|
||||
fn: Lambda | EdgeFunction,
|
||||
existingFunctions: Map<Lambda | EdgeFunction, string>
|
||||
) {
|
||||
const existingPath = existingFunctions.get(fn);
|
||||
|
||||
// Function has not been written to the filesystem, so bail
|
||||
if (!existingPath) return false;
|
||||
|
||||
const destDir = dirname(dest);
|
||||
const targetDest = join(outputDir, 'functions', `${existingPath}.func`);
|
||||
const target = relative(destDir, targetDest);
|
||||
await fs.mkdirp(destDir);
|
||||
await fs.symlink(target, dest);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the `EdgeFunction` instance to the file system.
|
||||
*
|
||||
* @param outputPath The path of the `.vercel/output` directory
|
||||
* @param edgeFunction The `EdgeFunction` instance
|
||||
* @param path The URL path where the `EdgeFunction` can be accessed from
|
||||
* @param existingFunctions (optional) Map of `Lambda`/`EdgeFunction` instances that have previously been written
|
||||
*/
|
||||
async function writeEdgeFunction(
|
||||
repoRootPath: string,
|
||||
outputDir: string,
|
||||
edgeFunction: EdgeFunction,
|
||||
path: string
|
||||
path: string,
|
||||
existingFunctions?: Map<Lambda | EdgeFunction, string>
|
||||
) {
|
||||
const dest = join(outputDir, 'functions', `${path}.func`);
|
||||
|
||||
if (existingFunctions) {
|
||||
if (
|
||||
await writeFunctionSymlink(
|
||||
outputDir,
|
||||
dest,
|
||||
edgeFunction,
|
||||
existingFunctions
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
existingFunctions.set(edgeFunction, path);
|
||||
}
|
||||
|
||||
await fs.mkdirp(dest);
|
||||
const ops: Promise<any>[] = [];
|
||||
ops.push(download(edgeFunction.files, dest));
|
||||
const { files, filePathMap } = filesWithoutFsRefs(
|
||||
edgeFunction.files,
|
||||
repoRootPath
|
||||
);
|
||||
ops.push(download(files, dest));
|
||||
|
||||
const config = {
|
||||
runtime: 'edge',
|
||||
...edgeFunction,
|
||||
entrypoint: normalizePath(edgeFunction.entrypoint),
|
||||
filePathMap,
|
||||
files: undefined,
|
||||
type: undefined,
|
||||
};
|
||||
@@ -351,42 +429,39 @@ async function writeEdgeFunction(
|
||||
/**
|
||||
* Writes the file references from the `Lambda` instance to the file system.
|
||||
*
|
||||
* @param outputPath The path of the `.vercel/output` directory
|
||||
* @param lambda The `Lambda` instance
|
||||
* @param path The URL path where the `Lambda` can be accessed from
|
||||
* @param lambdas (optional) Map of `Lambda` instances that have previously been written
|
||||
* @param functionConfiguration (optional) Extra configuration to apply to the function's `.vc-config.json` file
|
||||
* @param existingFunctions (optional) Map of `Lambda`/`EdgeFunction` instances that have previously been written
|
||||
*/
|
||||
async function writeLambda(
|
||||
repoRootPath: string,
|
||||
outputDir: string,
|
||||
lambda: Lambda,
|
||||
path: string,
|
||||
functionConfiguration?: FunctionConfiguration,
|
||||
lambdas?: Map<Lambda, string>
|
||||
existingFunctions?: Map<Lambda | EdgeFunction, string>
|
||||
) {
|
||||
const dest = join(outputDir, 'functions', `${path}.func`);
|
||||
|
||||
// If the `lambda` has already been written to the filesystem at a different
|
||||
// location then create a symlink to the previous location instead of copying
|
||||
// the files again.
|
||||
const existingLambdaPath = lambdas?.get(lambda);
|
||||
if (existingLambdaPath) {
|
||||
const destDir = dirname(dest);
|
||||
const targetDest = join(
|
||||
outputDir,
|
||||
'functions',
|
||||
`${existingLambdaPath}.func`
|
||||
);
|
||||
const target = relative(destDir, targetDest);
|
||||
await fs.mkdirp(destDir);
|
||||
await fs.symlink(target, dest);
|
||||
return;
|
||||
if (existingFunctions) {
|
||||
if (
|
||||
await writeFunctionSymlink(outputDir, dest, lambda, existingFunctions)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
existingFunctions.set(lambda, path);
|
||||
}
|
||||
lambdas?.set(lambda, path);
|
||||
|
||||
await fs.mkdirp(dest);
|
||||
const ops: Promise<any>[] = [];
|
||||
let filePathMap: Record<string, string> | undefined;
|
||||
if (lambda.files) {
|
||||
// `files` is defined
|
||||
ops.push(download(lambda.files, dest));
|
||||
const f = filesWithoutFsRefs(lambda.files, repoRootPath);
|
||||
filePathMap = f.filePathMap;
|
||||
ops.push(download(f.files, dest));
|
||||
} else if (lambda.zipBuffer) {
|
||||
// Builders that use the deprecated `createLambda()` might only have `zipBuffer`
|
||||
ops.push(unzip(lambda.zipBuffer, dest));
|
||||
@@ -402,6 +477,7 @@ async function writeLambda(
|
||||
handler: normalizePath(lambda.handler),
|
||||
memory,
|
||||
maxDuration,
|
||||
filePathMap,
|
||||
type: undefined,
|
||||
files: undefined,
|
||||
zipBuffer: undefined,
|
||||
@@ -509,3 +585,25 @@ export async function* findDirs(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the `FileFsRef` instances from the `Files` object
|
||||
* and returns them in a JSON serializable map of repo root
|
||||
* relative paths to Lambda destination paths.
|
||||
*/
|
||||
function filesWithoutFsRefs(
|
||||
files: Files,
|
||||
repoRootPath: string
|
||||
): { files: Files; filePathMap?: Record<string, string> } {
|
||||
let filePathMap: Record<string, string> | undefined;
|
||||
const out: Files = {};
|
||||
for (const [path, file] of Object.entries(files)) {
|
||||
if (file.type === 'FileFsRef') {
|
||||
if (!filePathMap) filePathMap = {};
|
||||
filePathMap[path] = relative(repoRootPath, file.fsPath);
|
||||
} else {
|
||||
out[path] = file;
|
||||
}
|
||||
}
|
||||
return { files: out, filePathMap };
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ export default async function processDeployment({
|
||||
|
||||
printInspectUrl(output, deployment.inspectorUrl, deployStamp);
|
||||
|
||||
const isProdDeployment = requestBody.target === 'production';
|
||||
const isProdDeployment = deployment.target === 'production';
|
||||
const previewUrl = `https://${deployment.url}`;
|
||||
|
||||
output.print(
|
||||
|
||||
@@ -42,6 +42,18 @@ async function processMessage(message) {
|
||||
// structure to JSON" errors, so delete the property...
|
||||
delete result.childProcesses;
|
||||
|
||||
if (builder.version === 3) {
|
||||
if (result.output.type === 'Lambda') {
|
||||
result.output.zipBuffer = await result.output.createZip();
|
||||
}
|
||||
} else {
|
||||
for (const output of Object.values(result.output)) {
|
||||
if (output.type === 'Lambda') {
|
||||
output.zipBuffer = await output.createZip();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
process.send({ type: 'buildResult', result });
|
||||
}
|
||||
|
||||
|
||||
@@ -361,11 +361,13 @@ export async function executeBuild(
|
||||
await oldAsset.fn.destroy();
|
||||
}
|
||||
|
||||
const ZipFile = asset.zipBuffer || (await asset.createZip());
|
||||
|
||||
asset.fn = await createFunction({
|
||||
Code: { ZipFile: asset.zipBuffer },
|
||||
Code: { ZipFile },
|
||||
Handler: asset.handler,
|
||||
Runtime: asset.runtime,
|
||||
MemorySize: asset.memory || 3008,
|
||||
MemorySize: asset.memory || 3009,
|
||||
Environment: {
|
||||
Variables: {
|
||||
...vercelConfig.env,
|
||||
|
||||
21
packages/cli/test/fixtures/unit/commands/build/functions-symlink/.vercel/builders/node_modules/functions-symlink/main.js
generated
vendored
Normal file
21
packages/cli/test/fixtures/unit/commands/build/functions-symlink/.vercel/builders/node_modules/functions-symlink/main.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
const { Lambda, EdgeFunction } = require('@vercel/build-utils');
|
||||
|
||||
exports.build = async () => {
|
||||
const lambda = new Lambda({
|
||||
files: {},
|
||||
runtime: 'provided',
|
||||
handler: 'example.js'
|
||||
});
|
||||
const edge = new EdgeFunction({
|
||||
files: {},
|
||||
deploymentTarget: 'v8-worker',
|
||||
entrypoint: 'example.js'
|
||||
});
|
||||
const output = {
|
||||
lambda,
|
||||
lambda2: lambda,
|
||||
edge,
|
||||
edge2: edge
|
||||
};
|
||||
return { output };
|
||||
};
|
||||
6
packages/cli/test/fixtures/unit/commands/build/functions-symlink/.vercel/builders/node_modules/functions-symlink/package.json
generated
vendored
Normal file
6
packages/cli/test/fixtures/unit/commands/build/functions-symlink/.vercel/builders/node_modules/functions-symlink/package.json
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "functions-symlink",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"main": "main.js"
|
||||
}
|
||||
7
packages/cli/test/fixtures/unit/commands/build/functions-symlink/.vercel/project.json
vendored
Normal file
7
packages/cli/test/fixtures/unit/commands/build/functions-symlink/.vercel/project.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"orgId": ".",
|
||||
"projectId": ".",
|
||||
"settings": {
|
||||
"framework": null
|
||||
}
|
||||
}
|
||||
4
packages/cli/test/fixtures/unit/commands/build/functions-symlink/package.json
vendored
Normal file
4
packages/cli/test/fixtures/unit/commands/build/functions-symlink/package.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "functions-symlink-test",
|
||||
"private": true
|
||||
}
|
||||
3
packages/cli/test/fixtures/unit/commands/build/functions-symlink/vercel.json
vendored
Normal file
3
packages/cli/test/fixtures/unit/commands/build/functions-symlink/vercel.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"builds": [{ "src": "package.json", "use": "functions-symlink@0.0.0" }]
|
||||
}
|
||||
@@ -382,6 +382,9 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
|
||||
'index.html': 'Hello',
|
||||
'vercel.json': '{"builds":[{"src":"*.html","use":"@vercel/static"}]}',
|
||||
},
|
||||
'project-sensitive-env-vars': {
|
||||
'package.json': '{}',
|
||||
},
|
||||
'dev-proxy-headers-and-env': {
|
||||
'package.json': JSON.stringify({}),
|
||||
'server.js': `require('http').createServer((req, res) => {
|
||||
@@ -421,7 +424,6 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
|
||||
projectId: '.',
|
||||
settings: {
|
||||
framework: null,
|
||||
installCommand: 'echo "skipping install"',
|
||||
},
|
||||
}),
|
||||
'package.json': JSON.stringify({
|
||||
@@ -429,7 +431,22 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
|
||||
build: 'mkdir -p public && echo hi > public/index.txt',
|
||||
},
|
||||
dependencies: {
|
||||
'@vercel/speed-insights': '0.0.1',
|
||||
'@vercel/speed-insights': '0.0.4',
|
||||
},
|
||||
}),
|
||||
},
|
||||
'vc-build-indirect-web-analytics': {
|
||||
'.vercel/project.json': JSON.stringify({
|
||||
orgId: '.',
|
||||
projectId: '.',
|
||||
settings: {
|
||||
framework: null,
|
||||
installCommand: 'yarn add @vercel/analytics@1.1.1',
|
||||
},
|
||||
}),
|
||||
'package.json': JSON.stringify({
|
||||
scripts: {
|
||||
build: 'mkdir -p public && echo hi > public/index.txt',
|
||||
},
|
||||
}),
|
||||
},
|
||||
@@ -439,7 +456,6 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
|
||||
projectId: '.',
|
||||
settings: {
|
||||
framework: null,
|
||||
installCommand: 'echo "skipping install"',
|
||||
},
|
||||
}),
|
||||
'package.json': JSON.stringify({
|
||||
|
||||
85
packages/cli/test/integration-2.test.ts
vendored
85
packages/cli/test/integration-2.test.ts
vendored
@@ -681,6 +681,53 @@ test('vercel env with unknown `VERCEL_ORG_ID` or `VERCEL_PROJECT_ID` should erro
|
||||
expect(output.stderr).toContain('Project not found');
|
||||
});
|
||||
|
||||
test('add a sensitive env var', async () => {
|
||||
const dir = await setupE2EFixture('project-sensitive-env-vars');
|
||||
const projectName = `project-sensitive-env-vars-${
|
||||
Math.random().toString(36).split('.')[1]
|
||||
}`;
|
||||
|
||||
// remove previously linked project if it exists
|
||||
await remove(path.join(dir, '.vercel'));
|
||||
|
||||
const vc = execCli(binaryPath, ['link'], {
|
||||
cwd: dir,
|
||||
env: {
|
||||
FORCE_TTY: '1',
|
||||
},
|
||||
});
|
||||
|
||||
await setupProject(vc, projectName, {
|
||||
buildCommand: `mkdir -p o && echo '<h1>custom hello</h1>' > o/index.html`,
|
||||
outputDirectory: 'o',
|
||||
});
|
||||
|
||||
await vc;
|
||||
|
||||
const link = require(path.join(dir, '.vercel/project.json'));
|
||||
|
||||
const addEnvCommand = execCli(
|
||||
binaryPath,
|
||||
['env', 'add', 'envVarName', 'production', '--sensitive'],
|
||||
{
|
||||
env: {
|
||||
VERCEL_ORG_ID: link.orgId,
|
||||
VERCEL_PROJECT_ID: link.projectId,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
await waitForPrompt(addEnvCommand, /What’s the value of [^?]+\?/);
|
||||
addEnvCommand.stdin?.write('test\n');
|
||||
|
||||
const output = await addEnvCommand;
|
||||
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
expect(output.stderr).toContain(
|
||||
'Added Environment Variable envVarName to Project'
|
||||
);
|
||||
});
|
||||
|
||||
test('whoami with `VERCEL_ORG_ID` should favor `--scope` and should error', async () => {
|
||||
if (!token) {
|
||||
throw new Error('Shared state "token" not set.');
|
||||
@@ -750,7 +797,7 @@ test('deploys with only vercel.json and README.md', async () => {
|
||||
|
||||
// assert timing order of showing URLs vs status updates
|
||||
expect(stderr).toMatch(
|
||||
/Inspect.*\nPreview.*\nQueued.*\nBuilding.*\nCompleting/
|
||||
/Inspect.*\nProduction.*\nQueued.*\nBuilding.*\nCompleting/
|
||||
);
|
||||
|
||||
const { host } = new URL(stdout);
|
||||
@@ -857,7 +904,7 @@ test('deploy pnpm twice using pnp and symlink=false', async () => {
|
||||
page = await fetch(stdout);
|
||||
text = await page.text();
|
||||
|
||||
expect(text).toBe('cache exists\n');
|
||||
expect(text).toContain('cache exists\n');
|
||||
});
|
||||
|
||||
test('reject deploying with wrong team .vercel config', async () => {
|
||||
@@ -1168,23 +1215,25 @@ test('[vc build] should build project with `@vercel/static-build`', async () =>
|
||||
});
|
||||
|
||||
test('[vc build] should build project with `@vercel/speed-insights`', async () => {
|
||||
try {
|
||||
process.env.VERCEL_ANALYTICS_ID = '123';
|
||||
const directory = await setupE2EFixture('vc-build-speed-insights');
|
||||
const output = await execCli(binaryPath, ['build'], { cwd: directory });
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
expect(output.stderr).toContain('Build Completed in .vercel/output');
|
||||
const builds = await fs.readJSON(
|
||||
path.join(directory, '.vercel/output/builds.json')
|
||||
);
|
||||
expect(builds?.features?.speedInsightsVersion).toEqual('0.0.4');
|
||||
});
|
||||
|
||||
const directory = await setupE2EFixture('vc-build-speed-insights');
|
||||
const output = await execCli(binaryPath, ['build'], { cwd: directory });
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
expect(output.stderr).toContain('Build Completed in .vercel/output');
|
||||
expect(output.stderr).toContain(
|
||||
'The `VERCEL_ANALYTICS_ID` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables'
|
||||
);
|
||||
const builds = await fs.readJSON(
|
||||
path.join(directory, '.vercel/output/builds.json')
|
||||
);
|
||||
expect(builds?.features?.speedInsightsVersion).toEqual('0.0.1');
|
||||
} finally {
|
||||
delete process.env.VERCEL_ANALYTICS_ID;
|
||||
}
|
||||
test('[vc build] should build project with an indirect dependency to `@vercel/analytics`', async () => {
|
||||
const directory = await setupE2EFixture('vc-build-indirect-web-analytics');
|
||||
const output = await execCli(binaryPath, ['build'], { cwd: directory });
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
expect(output.stderr).toContain('Build Completed in .vercel/output');
|
||||
const builds = await fs.readJSON(
|
||||
path.join(directory, '.vercel/output/builds.json')
|
||||
);
|
||||
expect(builds?.features?.webAnalyticsVersion).toEqual('1.1.1');
|
||||
});
|
||||
|
||||
test('[vc build] should build project with `@vercel/analytics`', async () => {
|
||||
|
||||
2
packages/cli/test/integration-3.test.ts
vendored
2
packages/cli/test/integration-3.test.ts
vendored
@@ -1175,7 +1175,7 @@ test('render build errors', async () => {
|
||||
const output = await execCli(binaryPath, [deploymentPath, '--yes']);
|
||||
|
||||
expect(output.exitCode, formatOutput(output)).toBe(1);
|
||||
expect(output.stderr).toMatch(/Command "yarn run build" exited with 1/gm);
|
||||
expect(output.stderr).toMatch(/Command "npm run build" exited with 1/gm);
|
||||
});
|
||||
|
||||
test('invalid deployment, projects and alias names', async () => {
|
||||
|
||||
@@ -88,6 +88,26 @@ exports[`help command help output snapshots column width 40 1`] = `
|
||||
the
|
||||
deploym…
|
||||
on
|
||||
--skip-domain Disable
|
||||
the
|
||||
automat…
|
||||
promoti…
|
||||
(aliasi…
|
||||
of the
|
||||
relevant
|
||||
domains
|
||||
to a new
|
||||
product…
|
||||
deploym…
|
||||
You can
|
||||
use \`vc
|
||||
promote\`
|
||||
to
|
||||
complete
|
||||
the
|
||||
domain-…
|
||||
process
|
||||
later
|
||||
--with-cache Retain
|
||||
build
|
||||
cache
|
||||
@@ -192,6 +212,10 @@ exports[`help command help output snapshots column width 80 1`] = `
|
||||
--prod Create a production deployment
|
||||
-p, --public Deployment is public (\`/_src\`) is exposed)
|
||||
--regions Set default regions to enable the deployment on
|
||||
--skip-domain Disable the automatic promotion (aliasing) of
|
||||
the relevant domains to a new production
|
||||
deployment. You can use \`vc promote\` to complete
|
||||
the domain-assignment process later
|
||||
--with-cache Retain build cache when using "--force"
|
||||
-y, --yes Use default options to skip all prompts
|
||||
|
||||
@@ -255,6 +279,8 @@ exports[`help command help output snapshots column width 120 1`] = `
|
||||
--prod Create a production deployment
|
||||
-p, --public Deployment is public (\`/_src\`) is exposed)
|
||||
--regions Set default regions to enable the deployment on
|
||||
--skip-domain Disable the automatic promotion (aliasing) of the relevant domains to a new production
|
||||
deployment. You can use \`vc promote\` to complete the domain-assignment process later
|
||||
--with-cache Retain build cache when using "--force"
|
||||
-y, --yes Use default options to skip all prompts
|
||||
|
||||
|
||||
@@ -785,7 +785,7 @@ describe('build', () => {
|
||||
expect(files.sort()).toEqual(['index.html', 'package.json']);
|
||||
});
|
||||
|
||||
it('should set `VERCEL_ANALYTICS_ID` environment variable', async () => {
|
||||
it('should set `VERCEL_ANALYTICS_ID` environment variable and warn users', async () => {
|
||||
const cwd = fixture('vercel-analytics');
|
||||
const output = join(cwd, '.vercel/output');
|
||||
client.cwd = cwd;
|
||||
@@ -794,6 +794,9 @@ describe('build', () => {
|
||||
|
||||
const env = await fs.readJSON(join(output, 'static', 'env.json'));
|
||||
expect(Object.keys(env).includes('VERCEL_ANALYTICS_ID')).toEqual(true);
|
||||
await expect(client.stderr).toOutput(
|
||||
'Vercel Speed Insights auto-injection is deprecated in favor of @vercel/speed-insights package. Learn more: https://vercel.link/upgrate-to-speed-insights-package'
|
||||
);
|
||||
});
|
||||
|
||||
it('should load environment variables from `.vercel/.env.preview.local`', async () => {
|
||||
@@ -1248,3 +1251,42 @@ describe('build', () => {
|
||||
).toEqual('marketing');
|
||||
});
|
||||
});
|
||||
|
||||
it('should create symlinks for duplicate references to Lambda / EdgeFunction instances', async () => {
|
||||
if (process.platform === 'win32') {
|
||||
console.log('Skipping test on Windows');
|
||||
return;
|
||||
}
|
||||
const cwd = fixture('functions-symlink');
|
||||
const output = join(cwd, '.vercel/output');
|
||||
client.cwd = cwd;
|
||||
const exitCode = await build(client);
|
||||
expect(exitCode).toEqual(0);
|
||||
|
||||
// "functions" directory has output Functions
|
||||
const functions = await fs.readdir(join(output, 'functions'));
|
||||
expect(functions.sort()).toEqual([
|
||||
'edge.func',
|
||||
'edge2.func',
|
||||
'lambda.func',
|
||||
'lambda2.func',
|
||||
]);
|
||||
expect(
|
||||
fs.lstatSync(join(output, 'functions/lambda.func')).isDirectory()
|
||||
).toEqual(true);
|
||||
expect(
|
||||
fs.lstatSync(join(output, 'functions/edge.func')).isDirectory()
|
||||
).toEqual(true);
|
||||
expect(
|
||||
fs.lstatSync(join(output, 'functions/lambda2.func')).isSymbolicLink()
|
||||
).toEqual(true);
|
||||
expect(
|
||||
fs.lstatSync(join(output, 'functions/edge2.func')).isSymbolicLink()
|
||||
).toEqual(true);
|
||||
expect(fs.readlinkSync(join(output, 'functions/lambda2.func'))).toEqual(
|
||||
'lambda.func'
|
||||
);
|
||||
expect(fs.readlinkSync(join(output, 'functions/edge2.func'))).toEqual(
|
||||
'edge.func'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -253,12 +253,12 @@ describe('validateConfig', () => {
|
||||
const error = validateConfig({
|
||||
functions: {
|
||||
'api/test.js': {
|
||||
memory: 3009,
|
||||
memory: 3010,
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(error!.message).toEqual(
|
||||
"Invalid vercel.json - `functions['api/test.js'].memory` should be <= 3008."
|
||||
"Invalid vercel.json - `functions['api/test.js'].memory` should be <= 3009."
|
||||
);
|
||||
expect(error!.link).toEqual(
|
||||
'https://vercel.com/docs/concepts/projects/project-configuration#functions'
|
||||
|
||||
@@ -1,5 +1,52 @@
|
||||
# @vercel/client
|
||||
|
||||
## 13.1.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`37b193c84`](https://github.com/vercel/vercel/commit/37b193c845d8b63d93bb0017fbc1a6a35306ef1f)]:
|
||||
- @vercel/build-utils@7.7.1
|
||||
|
||||
## 13.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`24c3dd282`](https://github.com/vercel/vercel/commit/24c3dd282d7714cd63d2b94fb94745c45fdc79ab)]:
|
||||
- @vercel/build-utils@7.7.0
|
||||
|
||||
## 13.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`b6ed28b9b`](https://github.com/vercel/vercel/commit/b6ed28b9b1712f882c93fe053b70d3eb1df21819), [`8ba0ce932`](https://github.com/vercel/vercel/commit/8ba0ce932434c6295fedb5307bee59a804b7e6a8), [`0d034b682`](https://github.com/vercel/vercel/commit/0d034b6820c0f3252949c0ffc483048c5aac7f04), [`abaa700ce`](https://github.com/vercel/vercel/commit/abaa700cea44c723cfc851baa2dfe9e1ae2e8a5c)]:
|
||||
- @vercel/build-utils@7.6.0
|
||||
|
||||
## 13.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- More helpful error message when `vc deploy --prebuilt` has missing files ([#11105](https://github.com/vercel/vercel/pull/11105))
|
||||
|
||||
## 13.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Upload files referenced by "filePathMap" during `vc deploy --prebuilt` ([#11077](https://github.com/vercel/vercel/pull/11077))
|
||||
|
||||
## 13.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`cdddb33ad`](https://github.com/vercel/vercel/commit/cdddb33ad49f6080c49f4fff3767e6111acd0bbe)]:
|
||||
- @vercel/build-utils@7.5.1
|
||||
|
||||
## 13.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`98040ec24`](https://github.com/vercel/vercel/commit/98040ec24e1ee585865d11eb216b6525d39d209e)]:
|
||||
- @vercel/build-utils@7.5.0
|
||||
|
||||
## 13.0.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/client",
|
||||
"version": "13.0.12",
|
||||
"version": "13.1.4",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"homepage": "https://vercel.com",
|
||||
@@ -37,7 +37,8 @@
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "7.4.1",
|
||||
"@vercel/build-utils": "7.7.1",
|
||||
"@vercel/error-utils": "2.0.2",
|
||||
"@vercel/routing-utils": "3.1.0",
|
||||
"@zeit/fetch": "5.2.0",
|
||||
"async-retry": "1.2.3",
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { lstatSync } from 'fs-extra';
|
||||
import { isAbsolute, join, relative } from 'path';
|
||||
import { isAbsolute, join, relative, sep } from 'path';
|
||||
import { hash, hashes, mapToObject } from './utils/hashes';
|
||||
import { upload } from './upload';
|
||||
import { buildFileTree, createDebug } from './utils';
|
||||
import { DeploymentError } from './errors';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
import {
|
||||
VercelClientOptions,
|
||||
DeploymentOptions,
|
||||
@@ -90,27 +91,43 @@ export default function buildCreateDeployment() {
|
||||
|
||||
let files;
|
||||
|
||||
if (clientOptions.archive === 'tgz') {
|
||||
debug('Packing tarball');
|
||||
const tarStream = tar
|
||||
.pack(workPath, {
|
||||
entries: fileList.map(file => relative(workPath, file)),
|
||||
})
|
||||
.pipe(createGzip());
|
||||
const tarBuffer = await streamToBuffer(tarStream);
|
||||
debug('Packed tarball');
|
||||
files = new Map([
|
||||
[
|
||||
hash(tarBuffer),
|
||||
{
|
||||
names: [join(workPath, '.vercel/source.tgz')],
|
||||
data: tarBuffer,
|
||||
mode: 0o666,
|
||||
},
|
||||
],
|
||||
]);
|
||||
} else {
|
||||
files = await hashes(fileList);
|
||||
try {
|
||||
if (clientOptions.archive === 'tgz') {
|
||||
debug('Packing tarball');
|
||||
const tarStream = tar
|
||||
.pack(workPath, {
|
||||
entries: fileList.map(file => relative(workPath, file)),
|
||||
})
|
||||
.pipe(createGzip());
|
||||
const tarBuffer = await streamToBuffer(tarStream);
|
||||
debug('Packed tarball');
|
||||
files = new Map([
|
||||
[
|
||||
hash(tarBuffer),
|
||||
{
|
||||
names: [join(workPath, '.vercel/source.tgz')],
|
||||
data: tarBuffer,
|
||||
mode: 0o666,
|
||||
},
|
||||
],
|
||||
]);
|
||||
} else {
|
||||
files = await hashes(fileList);
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
if (
|
||||
clientOptions.prebuilt &&
|
||||
isErrnoException(err) &&
|
||||
err.code === 'ENOENT' &&
|
||||
err.path
|
||||
) {
|
||||
const errPath = relative(workPath, err.path);
|
||||
err.message = `File does not exist: "${relative(workPath, errPath)}"`;
|
||||
if (errPath.split(sep).includes('node_modules')) {
|
||||
err.message = `Please ensure project dependencies have been installed:\n${err.message}`;
|
||||
}
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
||||
debug(`Yielding a 'hashes-calculated' event with ${files.size} hashes`);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { FilesMap } from './hashes';
|
||||
import { FetchOptions } from '@zeit/fetch';
|
||||
import { nodeFetch, zeitFetch } from './fetch';
|
||||
import { join, sep, relative } from 'path';
|
||||
import { join, sep, relative, basename } from 'path';
|
||||
import { URL } from 'url';
|
||||
import ignore from 'ignore';
|
||||
import { pkgVersion } from '../pkg';
|
||||
@@ -109,6 +109,29 @@ export async function buildFileTree(
|
||||
return ignored;
|
||||
};
|
||||
fileList = await readdir(path, [ignores]);
|
||||
|
||||
if (prebuilt) {
|
||||
// Traverse over the `.vc-config.json` files and include
|
||||
// the files referenced by the "filePathMap" properties
|
||||
const refs = new Set<string>();
|
||||
const vcConfigFilePaths = fileList.filter(
|
||||
file => basename(file) === '.vc-config.json'
|
||||
);
|
||||
await Promise.all(
|
||||
vcConfigFilePaths.map(async p => {
|
||||
const configJson = await readFile(p, 'utf8');
|
||||
const config = JSON.parse(configJson);
|
||||
if (!config.filePathMap) return;
|
||||
for (const v of Object.values(config.filePathMap) as string[]) {
|
||||
refs.add(join(path, v));
|
||||
}
|
||||
})
|
||||
);
|
||||
if (refs.size > 0) {
|
||||
fileList = fileList.concat(Array.from(refs));
|
||||
}
|
||||
}
|
||||
|
||||
debug(`Found ${fileList.length} files in the specified directory`);
|
||||
} else if (Array.isArray(path)) {
|
||||
// Array of file paths
|
||||
|
||||
1
packages/client/tests/fixtures/file-system-api/.gitignore
vendored
Normal file
1
packages/client/tests/fixtures/file-system-api/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!/.vercel
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"filePathMap": {
|
||||
"node_modules/another/index.js": "node_modules/another/index.js"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"filePathMap": {
|
||||
"node_modules/example/index.js": "node_modules/example/index.js"
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ describe('buildFileTree()', () => {
|
||||
normalizeWindowsPaths(fileList).sort()
|
||||
);
|
||||
|
||||
const expectedIgnoreList = ['.vercel'];
|
||||
const expectedIgnoreList = ['.gitignore', '.vercel'];
|
||||
expect(normalizeWindowsPaths(expectedIgnoreList).sort()).toEqual(
|
||||
normalizeWindowsPaths(ignoreList).sort()
|
||||
);
|
||||
@@ -124,14 +124,18 @@ describe('buildFileTree()', () => {
|
||||
);
|
||||
|
||||
const expectedFileList = toAbsolutePaths(cwd, [
|
||||
'.vercel/output/functions/api/another.func/.vc-config.json',
|
||||
'.vercel/output/functions/api/example.func/.vc-config.json',
|
||||
'.vercel/output/static/baz.txt',
|
||||
'.vercel/output/static/sub/qux.txt',
|
||||
'node_modules/another/index.js',
|
||||
'node_modules/example/index.js',
|
||||
]);
|
||||
expect(normalizeWindowsPaths(expectedFileList).sort()).toEqual(
|
||||
normalizeWindowsPaths(fileList).sort()
|
||||
);
|
||||
|
||||
const expectedIgnoreList = ['foo.txt', 'sub'];
|
||||
const expectedIgnoreList = ['.gitignore', 'foo.txt', 'sub'];
|
||||
expect(normalizeWindowsPaths(expectedIgnoreList).sort()).toEqual(
|
||||
normalizeWindowsPaths(ignoreList).sort()
|
||||
);
|
||||
|
||||
@@ -70,7 +70,7 @@ Unicode characters for emoji flags start at this number, and run up to 127469.
|
||||
|
||||
• `Const` **IP_HEADER_NAME**: `"x-real-ip"`
|
||||
|
||||
Client IP as calcualted by Vercel Proxy.
|
||||
Client IP as calculated by Vercel Proxy.
|
||||
|
||||
#### Defined in
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export const CITY_HEADER_NAME = 'x-vercel-ip-city';
|
||||
*/
|
||||
export const COUNTRY_HEADER_NAME = 'x-vercel-ip-country';
|
||||
/**
|
||||
* Client IP as calcualted by Vercel Proxy.
|
||||
* Client IP as calculated by Vercel Proxy.
|
||||
*/
|
||||
export const IP_HEADER_NAME = 'x-real-ip';
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @vercel/frameworks
|
||||
|
||||
## 3.0.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
- Make "remix" framework preset supersede "vite" ([#11031](https://github.com/vercel/vercel/pull/11031))
|
||||
|
||||
## 2.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/frameworks",
|
||||
"version": "2.0.6",
|
||||
"version": "3.0.0",
|
||||
"main": "./dist/frameworks.js",
|
||||
"types": "./dist/frameworks.d.ts",
|
||||
"files": [
|
||||
|
||||
@@ -202,11 +202,14 @@ export const frameworks = [
|
||||
description: 'A new Remix app — the result of running `npx create-remix`.',
|
||||
website: 'https://remix.run',
|
||||
sort: 6,
|
||||
supersedes: 'hydrogen',
|
||||
supersedes: ['hydrogen', 'vite'],
|
||||
useRuntime: { src: 'package.json', use: '@vercel/remix-builder' },
|
||||
ignoreRuntimes: ['@vercel/node'],
|
||||
detectors: {
|
||||
some: [
|
||||
{
|
||||
matchPackage: '@remix-run/dev',
|
||||
},
|
||||
{
|
||||
path: 'remix.config.js',
|
||||
},
|
||||
@@ -1734,7 +1737,7 @@ export const frameworks = [
|
||||
tagline: 'React framework for headless commerce',
|
||||
description: 'React framework for headless commerce',
|
||||
website: 'https://hydrogen.shopify.dev',
|
||||
supersedes: 'vite',
|
||||
supersedes: ['vite'],
|
||||
useRuntime: { src: 'package.json', use: '@vercel/hydrogen' },
|
||||
envPrefix: 'PUBLIC_',
|
||||
detectors: {
|
||||
|
||||
@@ -220,7 +220,7 @@ export interface Framework {
|
||||
*/
|
||||
defaultVersion?: string;
|
||||
/**
|
||||
* Slug of another framework preset in which this framework supersedes.
|
||||
* Array of slugs for other framework presets which this framework supersedes.
|
||||
*/
|
||||
supersedes?: string;
|
||||
supersedes?: string[];
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ const Schema = {
|
||||
dependency: { type: 'string' },
|
||||
cachePattern: { type: 'string' },
|
||||
defaultVersion: { type: 'string' },
|
||||
supersedes: { type: 'string' },
|
||||
supersedes: { type: 'array', items: { type: 'string' } },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
# @vercel/fs-detectors
|
||||
|
||||
## 5.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [build-utils] increase max memory limit ([#11209](https://github.com/vercel/vercel/pull/11209))
|
||||
|
||||
## 5.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Make "remix" framework preset supersede "vite" ([#11031](https://github.com/vercel/vercel/pull/11031))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`1333071a3`](https://github.com/vercel/vercel/commit/1333071a3a2d324679327bfdd4e872f8fd3521c6)]:
|
||||
- @vercel/frameworks@3.0.0
|
||||
|
||||
## 5.1.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/fs-detectors",
|
||||
"version": "5.1.6",
|
||||
"version": "5.2.1",
|
||||
"description": "Vercel filesystem detectors",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/error-utils": "2.0.2",
|
||||
"@vercel/frameworks": "2.0.6",
|
||||
"@vercel/frameworks": "3.0.0",
|
||||
"@vercel/routing-utils": "3.1.0",
|
||||
"glob": "8.0.3",
|
||||
"js-yaml": "4.1.0",
|
||||
@@ -37,7 +37,7 @@
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/semver": "7.3.10",
|
||||
"@vercel/build-utils": "7.4.1",
|
||||
"@vercel/build-utils": "7.7.1",
|
||||
"jest-junit": "16.0.0",
|
||||
"typescript": "4.9.5"
|
||||
}
|
||||
|
||||
@@ -612,11 +612,11 @@ function validateFunctions({ functions = {} }: Options) {
|
||||
|
||||
if (
|
||||
func.memory !== undefined &&
|
||||
(func.memory < 128 || func.memory > 3008)
|
||||
(func.memory < 128 || func.memory > 3009)
|
||||
) {
|
||||
return {
|
||||
code: 'invalid_function_memory',
|
||||
message: 'Functions must have a memory value between 128 and 3008',
|
||||
message: 'Functions must have a memory value between 128 and 3009',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,9 @@ function removeSupersededFramework(
|
||||
const framework = matches[index];
|
||||
if (framework) {
|
||||
if (framework.supersedes) {
|
||||
removeSupersededFramework(matches, framework.supersedes);
|
||||
for (const slug of framework.supersedes) {
|
||||
removeSupersededFramework(matches, slug);
|
||||
}
|
||||
}
|
||||
matches.splice(index, 1);
|
||||
}
|
||||
@@ -154,7 +156,9 @@ export function removeSupersededFrameworks(
|
||||
) {
|
||||
for (const match of matches.slice()) {
|
||||
if (match?.supersedes) {
|
||||
removeSupersededFramework(matches, match.supersedes);
|
||||
for (const slug of match.supersedes) {
|
||||
removeSupersededFramework(matches, slug);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,12 +166,12 @@ describe('removeSupersededFrameworks()', () => {
|
||||
const matches = [
|
||||
{ slug: 'storybook' },
|
||||
{ slug: 'vite' },
|
||||
{ slug: 'hydrogen', supersedes: 'vite' },
|
||||
{ slug: 'hydrogen', supersedes: ['vite'] },
|
||||
];
|
||||
removeSupersededFrameworks(matches);
|
||||
expect(matches).toEqual([
|
||||
{ slug: 'storybook' },
|
||||
{ slug: 'hydrogen', supersedes: 'vite' },
|
||||
{ slug: 'hydrogen', supersedes: ['vite'] },
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -179,13 +179,13 @@ describe('removeSupersededFrameworks()', () => {
|
||||
const matches = [
|
||||
{ slug: 'storybook' },
|
||||
{ slug: 'vite' },
|
||||
{ slug: 'hydrogen', supersedes: 'vite' },
|
||||
{ slug: 'remix', supersedes: 'hydrogen' },
|
||||
{ slug: 'hydrogen', supersedes: ['vite'] },
|
||||
{ slug: 'remix', supersedes: ['hydrogen'] },
|
||||
];
|
||||
removeSupersededFrameworks(matches);
|
||||
expect(matches).toEqual([
|
||||
{ slug: 'storybook' },
|
||||
{ slug: 'remix', supersedes: 'hydrogen' },
|
||||
{ slug: 'remix', supersedes: ['hydrogen'] },
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -442,6 +442,20 @@ describe('detectFramework()', () => {
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('storybook');
|
||||
});
|
||||
|
||||
it('Should detect Remix + Vite as `remix`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'vite.config.ts': '',
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'@remix-run/dev': 'latest',
|
||||
vite: 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
expect(await detectFramework({ fs, frameworkList })).toBe('remix');
|
||||
});
|
||||
});
|
||||
|
||||
describe('detectFrameworks()', () => {
|
||||
@@ -497,6 +511,23 @@ describe('detectFrameworks()', () => {
|
||||
expect(slugs).toEqual(['nextjs', 'storybook']);
|
||||
});
|
||||
|
||||
it('Should detect Remix + Vite as `remix`', async () => {
|
||||
const fs = new VirtualFilesystem({
|
||||
'vite.config.ts': '',
|
||||
'package.json': JSON.stringify({
|
||||
dependencies: {
|
||||
'@remix-run/dev': 'latest',
|
||||
vite: 'latest',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
const slugs = (await detectFrameworks({ fs, frameworkList })).map(
|
||||
f => f.slug
|
||||
);
|
||||
expect(slugs).toEqual(['remix']);
|
||||
});
|
||||
|
||||
it('Should detect "hydrogen" template as `hydrogen`', async () => {
|
||||
const fs = new LocalFileSystemDetector(join(EXAMPLES_DIR, 'hydrogen'));
|
||||
|
||||
|
||||
@@ -1,5 +1,42 @@
|
||||
# @vercel/gatsby-plugin-vercel-builder
|
||||
|
||||
## 2.0.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`37b193c84`](https://github.com/vercel/vercel/commit/37b193c845d8b63d93bb0017fbc1a6a35306ef1f)]:
|
||||
- @vercel/build-utils@7.7.1
|
||||
|
||||
## 2.0.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`24c3dd282`](https://github.com/vercel/vercel/commit/24c3dd282d7714cd63d2b94fb94745c45fdc79ab)]:
|
||||
- @vercel/build-utils@7.7.0
|
||||
|
||||
## 2.0.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [gatsby-plugin-vercel-builder] use --keep-names esbuild flag ([#11117](https://github.com/vercel/vercel/pull/11117))
|
||||
|
||||
- Updated dependencies [[`b6ed28b9b`](https://github.com/vercel/vercel/commit/b6ed28b9b1712f882c93fe053b70d3eb1df21819), [`8ba0ce932`](https://github.com/vercel/vercel/commit/8ba0ce932434c6295fedb5307bee59a804b7e6a8), [`0d034b682`](https://github.com/vercel/vercel/commit/0d034b6820c0f3252949c0ffc483048c5aac7f04), [`abaa700ce`](https://github.com/vercel/vercel/commit/abaa700cea44c723cfc851baa2dfe9e1ae2e8a5c)]:
|
||||
- @vercel/build-utils@7.6.0
|
||||
|
||||
## 2.0.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`cdddb33ad`](https://github.com/vercel/vercel/commit/cdddb33ad49f6080c49f4fff3767e6111acd0bbe)]:
|
||||
- @vercel/build-utils@7.5.1
|
||||
|
||||
## 2.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`98040ec24`](https://github.com/vercel/vercel/commit/98040ec24e1ee585865d11eb216b6525d39d209e)]:
|
||||
- @vercel/build-utils@7.5.0
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/gatsby-plugin-vercel-builder",
|
||||
"version": "2.0.14",
|
||||
"version": "2.0.19",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@sinclair/typebox": "0.25.24",
|
||||
"@vercel/build-utils": "7.4.1",
|
||||
"@vercel/build-utils": "7.7.1",
|
||||
"@vercel/routing-utils": "3.1.0",
|
||||
"esbuild": "0.14.47",
|
||||
"etag": "1.8.1",
|
||||
|
||||
@@ -35,6 +35,9 @@ export const writeHandler = async ({
|
||||
platform: 'node',
|
||||
bundle: true,
|
||||
minify: true,
|
||||
// prevents renaming edge cases from causing failures like:
|
||||
// https://github.com/node-fetch/node-fetch/issues/784
|
||||
keepNames: true,
|
||||
define: {
|
||||
'process.env.NODE_ENV': "'production'",
|
||||
vercel_pathPrefix: JSON.stringify(prefix),
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"@types/node-fetch": "^2.3.0",
|
||||
"@types/tar": "6.1.5",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel/build-utils": "7.4.1",
|
||||
"@vercel/build-utils": "7.7.1",
|
||||
"async-retry": "1.3.3",
|
||||
"execa": "^1.0.0",
|
||||
"fs-extra": "^7.0.0",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @vercel/hydrogen
|
||||
|
||||
## 1.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Deprecate `EdgeFunction#name` property ([#11010](https://github.com/vercel/vercel/pull/11010))
|
||||
|
||||
## 1.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/hydrogen",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index.js",
|
||||
"homepage": "https://vercel.com/docs",
|
||||
@@ -26,7 +26,7 @@
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.5.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "7.4.1",
|
||||
"@vercel/build-utils": "7.7.1",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"jest-junit": "16.0.0"
|
||||
|
||||
@@ -126,7 +126,6 @@ export const build: BuildV2 = async ({
|
||||
]);
|
||||
|
||||
const edgeFunction = new EdgeFunction({
|
||||
name: 'hydrogen',
|
||||
deploymentTarget: 'v8-worker',
|
||||
entrypoint: 'index.js',
|
||||
files: edgeFunctionFiles,
|
||||
|
||||
@@ -1,5 +1,53 @@
|
||||
# @vercel/next
|
||||
|
||||
## 4.1.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Enable partial prerendering support for pre-generated pages ([#11183](https://github.com/vercel/vercel/pull/11183))
|
||||
|
||||
## 4.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix manifest with experimental flag ([#11192](https://github.com/vercel/vercel/pull/11192))
|
||||
|
||||
## 4.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Update experimental bundle flag ([#11187](https://github.com/vercel/vercel/pull/11187))
|
||||
|
||||
- [next] Add flag for experimental grouping ([#11177](https://github.com/vercel/vercel/pull/11177))
|
||||
|
||||
- bump `@vercel/nft@0.26.4` ([#11155](https://github.com/vercel/vercel/pull/11155))
|
||||
|
||||
- fix: missing experimental field ([#11184](https://github.com/vercel/vercel/pull/11184))
|
||||
|
||||
## 4.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [node][next][redwood][remix] bump `@vercel/nft@0.26.3` ([#11115](https://github.com/vercel/vercel/pull/11115))
|
||||
|
||||
- Load common chunks on module initialization ([#11126](https://github.com/vercel/vercel/pull/11126))
|
||||
|
||||
- Fix index normalizing for app outputs ([#11099](https://github.com/vercel/vercel/pull/11099))
|
||||
|
||||
- Mark `flags` as deprecated and replace them with `variants` ([#11098](https://github.com/vercel/vercel/pull/11098))
|
||||
|
||||
- Fix rewrite RSC handling with trailingSlash ([#11107](https://github.com/vercel/vercel/pull/11107))
|
||||
|
||||
## 4.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- fix error when @vercel/analytics is a transitive dependency of the deployed application ([#10892](https://github.com/vercel/vercel/pull/10892))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Use `worker.name` instead of edge function name to fix type error in `@vercel/next` ([#11050](https://github.com/vercel/vercel/pull/11050))
|
||||
|
||||
## 4.0.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/next",
|
||||
"version": "4.0.17",
|
||||
"version": "4.1.4",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
||||
@@ -23,7 +23,7 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@vercel/nft": "0.26.2"
|
||||
"@vercel/nft": "0.26.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/aws-lambda": "8.10.19",
|
||||
@@ -40,7 +40,7 @@
|
||||
"@types/semver": "6.0.0",
|
||||
"@types/text-table": "0.2.1",
|
||||
"@types/webpack-sources": "3.2.0",
|
||||
"@vercel/build-utils": "7.4.1",
|
||||
"@vercel/build-utils": "7.7.1",
|
||||
"@vercel/routing-utils": "3.1.0",
|
||||
"async-sema": "3.0.1",
|
||||
"buffer-crc32": "0.2.13",
|
||||
|
||||
@@ -511,7 +511,7 @@ export const build: BuildV2 = async ({
|
||||
entryPath,
|
||||
outputDirectory
|
||||
);
|
||||
const omittedPrerenderRoutes = new Set(
|
||||
const omittedPrerenderRoutes: ReadonlySet<string> = new Set(
|
||||
Object.keys(prerenderManifest.omittedRoutes)
|
||||
);
|
||||
|
||||
@@ -1142,6 +1142,10 @@ export const build: BuildV2 = async ({
|
||||
appPathRoutesManifest,
|
||||
});
|
||||
|
||||
/**
|
||||
* This is a detection for preview mode that's required for the pages
|
||||
* router.
|
||||
*/
|
||||
const canUsePreviewMode = Object.keys(pages).some(page =>
|
||||
isApiPage(pages[page].fsPath)
|
||||
);
|
||||
@@ -1316,6 +1320,22 @@ export const build: BuildV2 = async ({
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* All of the routes that have `experimentalPPR` enabled.
|
||||
*/
|
||||
const experimentalPPRRoutes = new Set<string>();
|
||||
|
||||
for (const [route, { experimentalPPR }] of [
|
||||
...Object.entries(prerenderManifest.staticRoutes),
|
||||
...Object.entries(prerenderManifest.blockingFallbackRoutes),
|
||||
...Object.entries(prerenderManifest.fallbackRoutes),
|
||||
...Object.entries(prerenderManifest.omittedRoutes),
|
||||
]) {
|
||||
if (!experimentalPPR) continue;
|
||||
|
||||
experimentalPPRRoutes.add(route);
|
||||
}
|
||||
|
||||
if (requiredServerFilesManifest) {
|
||||
if (!routesManifest) {
|
||||
throw new Error(
|
||||
@@ -1371,6 +1391,7 @@ export const build: BuildV2 = async ({
|
||||
hasIsr404Page,
|
||||
hasIsr500Page,
|
||||
variantsManifest,
|
||||
experimentalPPRRoutes,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1883,17 +1904,18 @@ export const build: BuildV2 = async ({
|
||||
);
|
||||
}
|
||||
|
||||
dynamicRoutes = await getDynamicRoutes(
|
||||
dynamicRoutes = await getDynamicRoutes({
|
||||
entryPath,
|
||||
entryDirectory,
|
||||
dynamicPages,
|
||||
false,
|
||||
isDev: false,
|
||||
routesManifest,
|
||||
omittedPrerenderRoutes,
|
||||
omittedRoutes: omittedPrerenderRoutes,
|
||||
canUsePreviewMode,
|
||||
prerenderManifest.bypassToken || '',
|
||||
isServerMode
|
||||
).then(arr =>
|
||||
bypassToken: prerenderManifest.bypassToken || '',
|
||||
isServerMode,
|
||||
experimentalPPRRoutes,
|
||||
}).then(arr =>
|
||||
localizeDynamicRoutes(
|
||||
arr,
|
||||
dynamicPrefix,
|
||||
@@ -1912,17 +1934,18 @@ export const build: BuildV2 = async ({
|
||||
|
||||
// we need to include the prerenderManifest.omittedRoutes here
|
||||
// for the page to be able to be matched in the lambda for preview mode
|
||||
const completeDynamicRoutes = await getDynamicRoutes(
|
||||
const completeDynamicRoutes = await getDynamicRoutes({
|
||||
entryPath,
|
||||
entryDirectory,
|
||||
dynamicPages,
|
||||
false,
|
||||
isDev: false,
|
||||
routesManifest,
|
||||
undefined,
|
||||
omittedRoutes: undefined,
|
||||
canUsePreviewMode,
|
||||
prerenderManifest.bypassToken || '',
|
||||
isServerMode
|
||||
).then(arr =>
|
||||
bypassToken: prerenderManifest.bypassToken || '',
|
||||
isServerMode,
|
||||
experimentalPPRRoutes,
|
||||
}).then(arr =>
|
||||
arr.map(route => {
|
||||
route.src = route.src.replace('^', `^${dynamicPrefix}`);
|
||||
return route;
|
||||
@@ -2119,22 +2142,33 @@ export const build: BuildV2 = async ({
|
||||
appPathRoutesManifest,
|
||||
isSharedLambdas,
|
||||
canUsePreviewMode,
|
||||
omittedPrerenderRoutes,
|
||||
});
|
||||
|
||||
Object.keys(prerenderManifest.staticRoutes).forEach(route =>
|
||||
prerenderRoute(route, { isBlocking: false, isFallback: false })
|
||||
await Promise.all(
|
||||
Object.keys(prerenderManifest.staticRoutes).map(route =>
|
||||
prerenderRoute(route, {})
|
||||
)
|
||||
);
|
||||
Object.keys(prerenderManifest.fallbackRoutes).forEach(route =>
|
||||
prerenderRoute(route, { isBlocking: false, isFallback: true })
|
||||
|
||||
await Promise.all(
|
||||
Object.keys(prerenderManifest.fallbackRoutes).map(route =>
|
||||
prerenderRoute(route, { isFallback: true })
|
||||
)
|
||||
);
|
||||
Object.keys(prerenderManifest.blockingFallbackRoutes).forEach(route =>
|
||||
prerenderRoute(route, { isBlocking: true, isFallback: false })
|
||||
|
||||
await Promise.all(
|
||||
Object.keys(prerenderManifest.blockingFallbackRoutes).map(route =>
|
||||
prerenderRoute(route, { isBlocking: true })
|
||||
)
|
||||
);
|
||||
|
||||
if (static404Page && canUsePreviewMode) {
|
||||
omittedPrerenderRoutes.forEach(route => {
|
||||
prerenderRoute(route, { isOmitted: true });
|
||||
});
|
||||
await Promise.all(
|
||||
Array.from(omittedPrerenderRoutes).map(route =>
|
||||
prerenderRoute(route, { isOmitted: true })
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// We still need to use lazyRoutes if the dataRoutes field
|
||||
|
||||
@@ -47,11 +47,12 @@ import {
|
||||
UnwrapPromise,
|
||||
getOperationType,
|
||||
FunctionsConfigManifestV1,
|
||||
VariantsManifest,
|
||||
VariantsManifestLegacy,
|
||||
RSC_CONTENT_TYPE,
|
||||
RSC_PREFETCH_SUFFIX,
|
||||
normalizePrefetches,
|
||||
CreateLambdaFromPseudoLayersOptions,
|
||||
getPostponeResumePathname,
|
||||
} from './utils';
|
||||
import {
|
||||
nodeFileTrace,
|
||||
@@ -70,6 +71,30 @@ const NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION = 'v12.1.7-canary.33';
|
||||
const EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION = 'v12.2.0';
|
||||
const CORRECTED_MANIFESTS_VERSION = 'v12.2.0';
|
||||
|
||||
// Ideally this should be in a Next.js manifest so we can change it in
|
||||
// the future but this also allows us to improve existing versions
|
||||
const PRELOAD_CHUNKS = {
|
||||
APP_ROUTER_PAGES: [
|
||||
'.next/server/webpack-runtime.js',
|
||||
'next/dist/client/components/action-async-storage.external.js',
|
||||
'next/dist/client/components/request-async-storage.external.js',
|
||||
'next/dist/client/components/static-generation-async-storage.external.js',
|
||||
'next/dist/compiled/next-server/app-page.runtime.prod.js',
|
||||
],
|
||||
APP_ROUTER_HANDLER: [
|
||||
'.next/server/webpack-runtime.js',
|
||||
'next/dist/compiled/next-server/app-route.runtime.prod.js',
|
||||
],
|
||||
PAGES_ROUTER_PAGES: [
|
||||
'.next/server/webpack-runtime.js',
|
||||
'next/dist/compiled/next-server/pages.runtime.prod.js',
|
||||
],
|
||||
PAGES_ROUTER_API: [
|
||||
'.next/server/webpack-api-runtime.js',
|
||||
'next/dist/compiled/next-server/pages-api.runtime.prod.js',
|
||||
],
|
||||
};
|
||||
|
||||
// related PR: https://github.com/vercel/next.js/pull/52997
|
||||
// and https://github.com/vercel/next.js/pull/56318
|
||||
const BUNDLED_SERVER_NEXT_VERSION = 'v13.5.4';
|
||||
@@ -118,6 +143,7 @@ export async function serverBuild({
|
||||
lambdaCompressedByteLimit,
|
||||
requiredServerFilesManifest,
|
||||
variantsManifest,
|
||||
experimentalPPRRoutes,
|
||||
}: {
|
||||
appPathRoutesManifest?: Record<string, string>;
|
||||
dynamicPages: string[];
|
||||
@@ -127,7 +153,7 @@ export async function serverBuild({
|
||||
pagesDir: string;
|
||||
baseDir: string;
|
||||
canUsePreviewMode: boolean;
|
||||
omittedPrerenderRoutes: Set<string>;
|
||||
omittedPrerenderRoutes: ReadonlySet<string>;
|
||||
localePrefixed404: boolean;
|
||||
staticPages: { [key: string]: FileFsRef };
|
||||
lambdaAppPaths: { [key: string]: FileFsRef };
|
||||
@@ -158,10 +184,15 @@ export async function serverBuild({
|
||||
imagesManifest?: NextImagesManifest;
|
||||
prerenderManifest: NextPrerenderedRoutes;
|
||||
requiredServerFilesManifest: NextRequiredServerFilesManifest;
|
||||
variantsManifest: VariantsManifest | null;
|
||||
variantsManifest: VariantsManifestLegacy | null;
|
||||
experimentalPPRRoutes: ReadonlySet<string>;
|
||||
}): Promise<BuildResult> {
|
||||
lambdaPages = Object.assign({}, lambdaPages, lambdaAppPaths);
|
||||
|
||||
const experimentalAllowBundling = Boolean(
|
||||
process.env.NEXT_EXPERIMENTAL_FUNCTION_BUNDLING
|
||||
);
|
||||
|
||||
const lambdas: { [key: string]: Lambda } = {};
|
||||
const prerenders: { [key: string]: Prerender } = {};
|
||||
const lambdaPageKeys = Object.keys(lambdaPages);
|
||||
@@ -217,7 +248,7 @@ export async function serverBuild({
|
||||
for (const rewrite of afterFilesRewrites) {
|
||||
if (rewrite.src && rewrite.dest) {
|
||||
rewrite.src = rewrite.src.replace(
|
||||
'(?:/)?',
|
||||
/\/?\(\?:\/\)\?/,
|
||||
'(?<rscsuff>(\\.prefetch)?\\.rsc)?(?:/)?'
|
||||
);
|
||||
let destQueryIndex = rewrite.dest.indexOf('?');
|
||||
@@ -242,10 +273,11 @@ export async function serverBuild({
|
||||
nextVersion,
|
||||
CORRECT_MIDDLEWARE_ORDER_VERSION
|
||||
);
|
||||
const isCorrectManifests = semver.gte(
|
||||
nextVersion,
|
||||
CORRECTED_MANIFESTS_VERSION
|
||||
);
|
||||
// experimental bundling prevents filtering manifests
|
||||
// as we don't know what to filter by at this stage
|
||||
const isCorrectManifests =
|
||||
!experimentalAllowBundling &&
|
||||
semver.gte(nextVersion, CORRECTED_MANIFESTS_VERSION);
|
||||
|
||||
let hasStatic500 = !!staticPages[path.posix.join(entryDirectory, '500')];
|
||||
|
||||
@@ -324,19 +356,7 @@ export async function serverBuild({
|
||||
internalPages.push('404.js');
|
||||
}
|
||||
|
||||
const experimentalPPRRoutes = new Set<string>();
|
||||
|
||||
for (const [route, { experimentalPPR }] of [
|
||||
...Object.entries(prerenderManifest.staticRoutes),
|
||||
...Object.entries(prerenderManifest.blockingFallbackRoutes),
|
||||
...Object.entries(prerenderManifest.fallbackRoutes),
|
||||
]) {
|
||||
if (!experimentalPPR) continue;
|
||||
|
||||
experimentalPPRRoutes.add(route);
|
||||
}
|
||||
|
||||
const prerenderRoutes = new Set<string>([
|
||||
const prerenderRoutes: ReadonlySet<string> = new Set<string>([
|
||||
...(canUsePreviewMode ? omittedPrerenderRoutes : []),
|
||||
...Object.keys(prerenderManifest.blockingFallbackRoutes),
|
||||
...Object.keys(prerenderManifest.fallbackRoutes),
|
||||
@@ -744,7 +764,7 @@ export async function serverBuild({
|
||||
.filter(Boolean) as string[];
|
||||
|
||||
let traceResult: NodeFileTraceResult | undefined;
|
||||
let parentFilesMap: Map<string, Set<string>> | undefined;
|
||||
let parentFilesMap: ReadonlyMap<string, Set<string>> | undefined;
|
||||
|
||||
if (pathsToTrace.length > 0) {
|
||||
traceResult = await nodeFileTrace(pathsToTrace, {
|
||||
@@ -859,6 +879,7 @@ export async function serverBuild({
|
||||
const pageExtensions = requiredServerFilesManifest.config?.pageExtensions;
|
||||
|
||||
const pageLambdaGroups = await getPageLambdaGroups({
|
||||
experimentalAllowBundling,
|
||||
entryPath: projectDir,
|
||||
config,
|
||||
functionsConfigManifest,
|
||||
@@ -880,6 +901,7 @@ export async function serverBuild({
|
||||
}
|
||||
|
||||
const appRouterLambdaGroups = await getPageLambdaGroups({
|
||||
experimentalAllowBundling,
|
||||
entryPath: projectDir,
|
||||
config,
|
||||
functionsConfigManifest,
|
||||
@@ -898,6 +920,7 @@ export async function serverBuild({
|
||||
});
|
||||
|
||||
const appRouteHandlersLambdaGroups = await getPageLambdaGroups({
|
||||
experimentalAllowBundling,
|
||||
entryPath: projectDir,
|
||||
config,
|
||||
functionsConfigManifest,
|
||||
@@ -1068,9 +1091,58 @@ export async function serverBuild({
|
||||
}
|
||||
}
|
||||
|
||||
let launcherData = group.isAppRouter ? appLauncher : launcher;
|
||||
let preloadChunks: string[] = [];
|
||||
|
||||
if (process.env.VERCEL_NEXT_PRELOAD_COMMON === '1') {
|
||||
const nextPackageDir = path.dirname(
|
||||
resolveFrom(projectDir, 'next/package.json')
|
||||
);
|
||||
|
||||
if (group.isPages) {
|
||||
preloadChunks = PRELOAD_CHUNKS.PAGES_ROUTER_PAGES;
|
||||
} else if (group.isApiLambda) {
|
||||
preloadChunks = PRELOAD_CHUNKS.PAGES_ROUTER_API;
|
||||
} else if (group.isAppRouter && !group.isAppRouteHandler) {
|
||||
preloadChunks = PRELOAD_CHUNKS.APP_ROUTER_PAGES;
|
||||
} else if (group.isAppRouteHandler) {
|
||||
preloadChunks = PRELOAD_CHUNKS.APP_ROUTER_HANDLER;
|
||||
}
|
||||
const normalizedPreloadChunks: string[] = [];
|
||||
|
||||
for (const preloadChunk of preloadChunks) {
|
||||
const absoluteChunk = preloadChunk.startsWith('.next')
|
||||
? path.join(projectDir, preloadChunk)
|
||||
: path.join(nextPackageDir, '..', preloadChunk);
|
||||
|
||||
// ensure the chunks are actually in this layer
|
||||
if (
|
||||
group.pseudoLayer[
|
||||
path.join('.', path.relative(baseDir, absoluteChunk))
|
||||
]
|
||||
) {
|
||||
normalizedPreloadChunks.push(
|
||||
// relative files need to be prefixed with ./ for require
|
||||
preloadChunk.startsWith('.next')
|
||||
? `./${preloadChunk}`
|
||||
: preloadChunk
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (normalizedPreloadChunks.length > 0) {
|
||||
launcherData = launcherData.replace(
|
||||
'// @preserve next-server-preload-target',
|
||||
normalizedPreloadChunks
|
||||
.map(name => `require('${name}');`)
|
||||
.join('\n')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const launcherFiles: { [name: string]: FileFsRef | FileBlob } = {
|
||||
[path.join(path.relative(baseDir, projectDir), '___next_launcher.cjs')]:
|
||||
new FileBlob({ data: group.isAppRouter ? appLauncher : launcher }),
|
||||
new FileBlob({ data: launcherData }),
|
||||
};
|
||||
const operationType = getOperationType({ group, prerenderManifest });
|
||||
|
||||
@@ -1090,6 +1162,7 @@ export async function serverBuild({
|
||||
maxDuration: group.maxDuration,
|
||||
isStreaming: group.isStreaming,
|
||||
nextVersion,
|
||||
experimentalAllowBundling,
|
||||
};
|
||||
|
||||
const lambda = await createLambdaFromPseudoLayers(options);
|
||||
@@ -1103,7 +1176,7 @@ export async function serverBuild({
|
||||
// lambda for the page for revalidation.
|
||||
let revalidate: NodejsLambda | undefined;
|
||||
if (isPPR) {
|
||||
if (isPPR && !options.isStreaming) {
|
||||
if (!options.isStreaming) {
|
||||
throw new Error("Invariant: PPR lambda isn't streaming");
|
||||
}
|
||||
|
||||
@@ -1115,24 +1188,28 @@ export async function serverBuild({
|
||||
});
|
||||
}
|
||||
|
||||
for (const page of group.pages) {
|
||||
const pageNoExt = page.replace(/\.js$/, '');
|
||||
let isPrerender = prerenderRoutes.has(
|
||||
path.join('/', pageNoExt === 'index' ? '' : pageNoExt)
|
||||
);
|
||||
for (const pageFilename of group.pages) {
|
||||
// This is the name of the page, where the root is `index`.
|
||||
const pageName = pageFilename.replace(/\.js$/, '');
|
||||
|
||||
// This is the name of the page prefixed with a `/`, where the root is
|
||||
// `/index`.
|
||||
const pagePath = path.posix.join('/', pageName);
|
||||
|
||||
// This is the routable pathname for the page, where the root is `/`.
|
||||
const pagePathname = pagePath === '/index' ? '/' : pagePath;
|
||||
|
||||
let isPrerender = prerenderRoutes.has(pagePathname);
|
||||
|
||||
if (!isPrerender && routesManifest?.i18n) {
|
||||
isPrerender = routesManifest.i18n.locales.some(locale => {
|
||||
return prerenderRoutes.has(
|
||||
path.join('/', locale, pageNoExt === 'index' ? '' : pageNoExt)
|
||||
path.join('/', locale, pageName === 'index' ? '' : pageName)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
let outputName = normalizeIndexOutput(
|
||||
path.posix.join(entryDirectory, pageNoExt),
|
||||
true
|
||||
);
|
||||
let outputName = path.posix.join(entryDirectory, pageName);
|
||||
|
||||
// If this is a PPR page, then we should prefix the output name.
|
||||
if (isPPR) {
|
||||
@@ -1140,24 +1217,56 @@ export async function serverBuild({
|
||||
throw new Error("Invariant: PPR lambda isn't set");
|
||||
}
|
||||
|
||||
// Get the get the base path prefixed route, without the index
|
||||
// normalization.
|
||||
outputName = path.posix.join(entryDirectory, pageNoExt);
|
||||
// Assign the revalidate lambda to the output name. That's used to
|
||||
// perform the initial static shell render.
|
||||
lambdas[outputName] = revalidate;
|
||||
|
||||
const pprOutputName = path.posix.join(
|
||||
entryDirectory,
|
||||
'/_next/postponed/resume',
|
||||
pageNoExt
|
||||
);
|
||||
lambdas[pprOutputName] = lambda;
|
||||
// If this isn't an omitted page, then we should add the link from the
|
||||
// page to the postpone resume lambda.
|
||||
if (!omittedPrerenderRoutes.has(pagePathname)) {
|
||||
const key = getPostponeResumePathname(entryDirectory, pageName);
|
||||
lambdas[key] = lambda;
|
||||
|
||||
// We want to add the `experimentalStreamingLambdaPath` to this
|
||||
// output.
|
||||
experimentalStreamingLambdaPaths.set(outputName, key);
|
||||
} else {
|
||||
// As this is an omitted page, we should generate the experimental
|
||||
// partial prerendering resume route for each of these routes that
|
||||
// support partial prerendering. This is because the routes that
|
||||
// haven't been omitted will have rewrite rules in place to rewrite
|
||||
// the original request `/blog/my-slug` to the dynamic path
|
||||
// `/blog/[slug]?nxtPslug=my-slug`.
|
||||
for (const [
|
||||
routePathname,
|
||||
{ srcRoute, experimentalPPR },
|
||||
] of Object.entries(prerenderManifest.staticRoutes)) {
|
||||
// If the srcRoute doesn't match or this doesn't support
|
||||
// experimental partial prerendering, then we can skip this route.
|
||||
if (srcRoute !== pagePathname || !experimentalPPR) continue;
|
||||
|
||||
// If this route is the same as the page route, then we can skip
|
||||
// it, because we've already added the lambda to the output.
|
||||
if (routePathname === pagePathname) continue;
|
||||
|
||||
const key = getPostponeResumePathname(
|
||||
entryDirectory,
|
||||
routePathname
|
||||
);
|
||||
lambdas[key] = lambda;
|
||||
|
||||
outputName = path.posix.join(entryDirectory, routePathname);
|
||||
experimentalStreamingLambdaPaths.set(outputName, key);
|
||||
}
|
||||
}
|
||||
|
||||
// We want to add the `experimentalStreamingLambdaPath` to this
|
||||
// output.
|
||||
experimentalStreamingLambdaPaths.set(outputName, pprOutputName);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!group.isAppRouter && !group.isAppRouteHandler) {
|
||||
outputName = normalizeIndexOutput(outputName, true);
|
||||
}
|
||||
|
||||
// we add locale prefixed outputs for SSR pages,
|
||||
// this is handled in onPrerenderRoute for SSG pages
|
||||
if (
|
||||
@@ -1165,7 +1274,7 @@ export async function serverBuild({
|
||||
!isPrerender &&
|
||||
!group.isAppRouter &&
|
||||
(!isCorrectLocaleAPIRoutes ||
|
||||
!(pageNoExt === 'api' || pageNoExt.startsWith('api/')))
|
||||
!(pageName === 'api' || pageName.startsWith('api/')))
|
||||
) {
|
||||
for (const locale of i18n.locales) {
|
||||
lambdas[
|
||||
@@ -1173,7 +1282,7 @@ export async function serverBuild({
|
||||
path.posix.join(
|
||||
entryDirectory,
|
||||
locale,
|
||||
pageNoExt === 'index' ? '' : pageNoExt
|
||||
pageName === 'index' ? '' : pageName
|
||||
),
|
||||
true
|
||||
)
|
||||
@@ -1206,6 +1315,7 @@ export async function serverBuild({
|
||||
hasPages404: routesManifest.pages404,
|
||||
isCorrectNotFoundRoutes,
|
||||
isEmptyAllowQueryForPrendered,
|
||||
omittedPrerenderRoutes,
|
||||
});
|
||||
|
||||
await Promise.all(
|
||||
@@ -1213,11 +1323,13 @@ export async function serverBuild({
|
||||
prerenderRoute(route, {})
|
||||
)
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
Object.keys(prerenderManifest.fallbackRoutes).map(route =>
|
||||
prerenderRoute(route, { isFallback: true })
|
||||
)
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
Object.keys(prerenderManifest.blockingFallbackRoutes).map(route =>
|
||||
prerenderRoute(route, { isBlocking: true })
|
||||
@@ -1226,9 +1338,9 @@ export async function serverBuild({
|
||||
|
||||
if (static404Page && canUsePreviewMode) {
|
||||
await Promise.all(
|
||||
[...omittedPrerenderRoutes].map(route => {
|
||||
return prerenderRoute(route, { isOmitted: true });
|
||||
})
|
||||
Array.from(omittedPrerenderRoutes).map(route =>
|
||||
prerenderRoute(route, { isOmitted: true })
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1237,6 +1349,7 @@ export async function serverBuild({
|
||||
if (routesManifest?.i18n) {
|
||||
route = normalizeLocalePath(route, routesManifest.i18n.locales).pathname;
|
||||
}
|
||||
|
||||
delete lambdas[
|
||||
normalizeIndexOutput(
|
||||
path.posix.join('./', entryDirectory, route === '/' ? '/index' : route),
|
||||
@@ -1260,19 +1373,19 @@ export async function serverBuild({
|
||||
middleware.staticRoutes.length > 0 &&
|
||||
semver.gte(nextVersion, NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION);
|
||||
|
||||
const dynamicRoutes = await getDynamicRoutes(
|
||||
const dynamicRoutes = await getDynamicRoutes({
|
||||
entryPath,
|
||||
entryDirectory,
|
||||
dynamicPages,
|
||||
false,
|
||||
isDev: false,
|
||||
routesManifest,
|
||||
omittedPrerenderRoutes,
|
||||
omittedRoutes: omittedPrerenderRoutes,
|
||||
canUsePreviewMode,
|
||||
prerenderManifest.bypassToken || '',
|
||||
true,
|
||||
middleware.dynamicRouteMap,
|
||||
experimental.ppr
|
||||
).then(arr =>
|
||||
bypassToken: prerenderManifest.bypassToken || '',
|
||||
isServerMode: true,
|
||||
dynamicMiddlewareRouteMap: middleware.dynamicRouteMap,
|
||||
experimentalPPRRoutes,
|
||||
}).then(arr =>
|
||||
localizeDynamicRoutes(
|
||||
arr,
|
||||
dynamicPrefix,
|
||||
@@ -1443,9 +1556,10 @@ export async function serverBuild({
|
||||
continue;
|
||||
}
|
||||
|
||||
const pathname = normalizeIndexOutput(
|
||||
path.posix.join('./', entryDirectory, route === '/' ? '/index' : route),
|
||||
true
|
||||
const pathname = path.posix.join(
|
||||
'./',
|
||||
entryDirectory,
|
||||
route === '/' ? '/index' : route
|
||||
);
|
||||
|
||||
if (lambdas[pathname]) {
|
||||
@@ -1477,6 +1591,46 @@ export async function serverBuild({
|
||||
throw new Error("Invariant: cannot use PPR without 'rsc.prefetchHeader'");
|
||||
}
|
||||
|
||||
// If we're using the Experimental Partial Prerendering, we should ensure that
|
||||
// all the routes that support it (and are listed) have configured lambdas.
|
||||
// This only applies to routes that do not have fallbacks enabled (these are
|
||||
// routes that have `dynamicParams = false` defined.
|
||||
if (experimental.ppr) {
|
||||
for (const { srcRoute, dataRoute, experimentalPPR } of Object.values(
|
||||
prerenderManifest.staticRoutes
|
||||
)) {
|
||||
// Only apply this to the routes that support experimental PPR and
|
||||
// that also have their `dataRoute` and `srcRoute` defined.
|
||||
if (!experimentalPPR || !dataRoute || !srcRoute) continue;
|
||||
|
||||
// If the srcRoute is not omitted, then we don't need to do anything. This
|
||||
// is the indicator that a route should only have it's prerender defined
|
||||
// and not a lambda.
|
||||
if (!omittedPrerenderRoutes.has(srcRoute)) continue;
|
||||
|
||||
// The lambda paths have their leading `/` stripped.
|
||||
const srcPathname = srcRoute.substring(1);
|
||||
const dataPathname = dataRoute.substring(1);
|
||||
|
||||
// If we already have an associated lambda for the `.rsc` route, then
|
||||
// we can skip this.
|
||||
const dataPathnameExists = dataPathname in lambdas;
|
||||
if (dataPathnameExists) continue;
|
||||
|
||||
// We require that the source route has a lambda associated with it. If
|
||||
// it doesn't this is an error.
|
||||
const srcPathnameExists = srcPathname in lambdas;
|
||||
if (!srcPathnameExists) {
|
||||
throw new Error(
|
||||
`Invariant: Expected to have a lambda for the source route: ${srcPathname}`
|
||||
);
|
||||
}
|
||||
|
||||
// Associate the data pathname with the source pathname's lambda.
|
||||
lambdas[dataPathname] = lambdas[srcPathname];
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
wildcard: wildcardConfig,
|
||||
images: getImagesConfig(imagesManifest),
|
||||
|
||||
@@ -23,6 +23,8 @@ if (process.env.NODE_ENV !== 'production' && region !== 'dev1') {
|
||||
// eslint-disable-next-line
|
||||
const NextServer = require('__NEXT_SERVER_PATH__').default;
|
||||
|
||||
// @preserve next-server-preload-target
|
||||
|
||||
// __NEXT_CONFIG__ value is injected
|
||||
declare const __NEXT_CONFIG__: any;
|
||||
const conf = __NEXT_CONFIG__;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user