mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 12:57:46 +00:00
Compare commits
70 Commits
@vercel/py
...
@vercel/st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7582571d94 | ||
|
|
e6aaf79d04 | ||
|
|
a1df25a197 | ||
|
|
dfe47f6e6c | ||
|
|
3a58431695 | ||
|
|
204c3592c7 | ||
|
|
3cede43ca7 | ||
|
|
1dbb22bb6d | ||
|
|
f124779b35 | ||
|
|
371c7a08f2 | ||
|
|
447c20fb99 | ||
|
|
0fe8c07194 | ||
|
|
78d1d548d9 | ||
|
|
c41ff450c0 | ||
|
|
ca2cbf06fb | ||
|
|
2d86a2d4ba | ||
|
|
4edfcd74b6 | ||
|
|
c52bdf7758 | ||
|
|
bc5ac1ec50 | ||
|
|
aa0f3d712b | ||
|
|
e02212ae80 | ||
|
|
a8934da623 | ||
|
|
0e9bb30fd2 | ||
|
|
6afdd7fb0b | ||
|
|
fdef0339f2 | ||
|
|
4636ae54c6 | ||
|
|
61a23f1382 | ||
|
|
4b8b4992c4 | ||
|
|
611fbdd5ac | ||
|
|
ffd2f34c6c | ||
|
|
8feaa9c3b3 | ||
|
|
31daff66af | ||
|
|
48c6b2dcc3 | ||
|
|
6f3ae1a0ed | ||
|
|
88da7463ce | ||
|
|
142aa55a5d | ||
|
|
7bc8b65d13 | ||
|
|
65dec5b7e7 | ||
|
|
f3b62d8ea2 | ||
|
|
9472c22bf7 | ||
|
|
493185709a | ||
|
|
89c1e03233 | ||
|
|
ebd7e3ac39 | ||
|
|
fd29b966d3 | ||
|
|
2bd9216403 | ||
|
|
c94a082f6b | ||
|
|
66cd626d1c | ||
|
|
0861dc8fbc | ||
|
|
7b553c7032 | ||
|
|
644b8a52cb | ||
|
|
33cc8e0acf | ||
|
|
c0efce29ad | ||
|
|
b4d115b24a | ||
|
|
34dd9c0918 | ||
|
|
f5296c3c06 | ||
|
|
d9065c2102 | ||
|
|
0ad37829da | ||
|
|
67748b5207 | ||
|
|
306f653da9 | ||
|
|
9e2120a325 | ||
|
|
a6463d2636 | ||
|
|
429a111b50 | ||
|
|
431dde5fa8 | ||
|
|
1f09979c6f | ||
|
|
fc90a3dc0b | ||
|
|
57541e230d | ||
|
|
efd3cc05dc | ||
|
|
a732b64c02 | ||
|
|
f8320417a8 | ||
|
|
50791803b6 |
14
.github/CODEOWNERS
vendored
14
.github/CODEOWNERS
vendored
@@ -2,17 +2,17 @@
|
||||
# https://help.github.com/en/articles/about-code-owners
|
||||
|
||||
# Restricted Paths
|
||||
* @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek
|
||||
/.github/workflows @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek @ijjk
|
||||
/packages/fs-detectors @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek @agadzik @chloetedder
|
||||
/packages/next @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek @ijjk @ztanner
|
||||
/packages/routing-utils @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek @ijjk
|
||||
* @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
|
||||
/examples @leerob
|
||||
/examples/create-react-app @Timer
|
||||
/examples/nextjs @timneutkens @ijjk @styfle @ztanner @huozhi
|
||||
/packages/node @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek @Kikobeats
|
||||
/examples/nextjs @timneutkens @ijjk @ztanner @huozhi
|
||||
/packages/node @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @Kikobeats
|
||||
|
||||
# Unrestricted Paths
|
||||
.changeset/
|
||||
|
||||
3
.github/workflows/test-lint.yml
vendored
3
.github/workflows/test-lint.yml
vendored
@@ -28,7 +28,8 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: main
|
||||
- run: git checkout ${{ github.event.pull_request.head.ref }}
|
||||
- run: git fetch origin ${{ github.event.pull_request.head.sha }}:pr-${{ github.event.pull_request.number }}
|
||||
- run: git checkout pr-${{ github.event.pull_request.number }}
|
||||
- name: install pnpm@8.3.1
|
||||
run: npm i -g pnpm@8.3.1
|
||||
- run: pnpm install
|
||||
|
||||
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@@ -70,6 +70,11 @@ jobs:
|
||||
if: matrix.runner == 'macos-latest'
|
||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/cli/test/dev/fixtures/08-hugo/
|
||||
|
||||
# yarn 1.22.21 introduced a Corepack bug when running tests.
|
||||
# this can be removed once https://github.com/yarnpkg/yarn/issues/9015 is resolved
|
||||
- name: install yarn@1.22.19
|
||||
run: npm i -g yarn@1.22.19
|
||||
|
||||
- name: install pnpm@8.3.1
|
||||
run: npm i -g pnpm@8.3.1
|
||||
|
||||
|
||||
1
.node_version
Normal file
1
.node_version
Normal file
@@ -0,0 +1 @@
|
||||
v16.20.2
|
||||
@@ -385,15 +385,16 @@ This is a [class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere
|
||||
|
||||
This is an abstract enumeration type that is implemented by one of the following possible `String` values:
|
||||
|
||||
- `nodejs20.x`
|
||||
- `nodejs18.x`
|
||||
- `nodejs16.x`
|
||||
- `go1.x`
|
||||
- `java11`
|
||||
- `python3.9`
|
||||
- `dotnet6`
|
||||
- `dotnetcore3.1`
|
||||
- `ruby2.7`
|
||||
- `provided.al2`
|
||||
- `provided.al2023`
|
||||
|
||||
## `@vercel/build-utils` Helper Functions
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
## Vercel
|
||||
|
||||
Vercel's frontend cloud gives developers frameworks, workflows, and infrastructure to build a faster, more personalized web.
|
||||
Vercel’s Frontend Cloud provides the developer experience and infrastructure to build, scale, and secure a faster, more personalized Web.
|
||||
|
||||
## Deploy
|
||||
|
||||
|
||||
6
examples/CHANGELOG.md
vendored
6
examples/CHANGELOG.md
vendored
@@ -4,4 +4,10 @@
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- chore: update Nuxt example ([#10869](https://github.com/vercel/vercel/pull/10869))
|
||||
|
||||
## null
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- update examples to use at least node@16 ([#10395](https://github.com/vercel/vercel/pull/10395))
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy angular', async () => {
|
||||
await deployExample('angular');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy astro', async () => {
|
||||
await deployExample('astro');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy blitzjs', async () => {
|
||||
await deployExample('blitzjs');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy brunch', async () => {
|
||||
await deployExample('brunch');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy create-react-app', async () => {
|
||||
await deployExample('create-react-app');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy docusaurus-2', async () => {
|
||||
await deployExample('docusaurus-2');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy docusaurus', async () => {
|
||||
await deployExample('docusaurus');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy dojo', async () => {
|
||||
await deployExample('dojo');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy eleventy', async () => {
|
||||
await deployExample('eleventy');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy ember', async () => {
|
||||
await deployExample('ember');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy gatsby', async () => {
|
||||
await deployExample('gatsby');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy gridsome', async () => {
|
||||
await deployExample('gridsome');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy hexo', async () => {
|
||||
await deployExample('hexo');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy hugo', async () => {
|
||||
await deployExample('hugo');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy hydrogen-2', async () => {
|
||||
await deployExample('hydrogen-2');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy hydrogen', async () => {
|
||||
await deployExample('hydrogen');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy ionic-angular', async () => {
|
||||
await deployExample('ionic-angular');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy ionic-react', async () => {
|
||||
await deployExample('ionic-react');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy jekyll', async () => {
|
||||
await deployExample('jekyll');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy middleman', async () => {
|
||||
await deployExample('middleman');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy nextjs', async () => {
|
||||
await deployExample('nextjs');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy node_modules', async () => {
|
||||
await deployExample('node_modules');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy nuxtjs', async () => {
|
||||
await deployExample('nuxtjs');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy parcel', async () => {
|
||||
await deployExample('parcel');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy polymer', async () => {
|
||||
await deployExample('polymer');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy preact', async () => {
|
||||
await deployExample('preact');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy redwoodjs', async () => {
|
||||
await deployExample('redwoodjs');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy remix', async () => {
|
||||
await deployExample('remix');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy saber', async () => {
|
||||
await deployExample('saber');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy sanity', async () => {
|
||||
await deployExample('sanity');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy sapper', async () => {
|
||||
await deployExample('sapper');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy scully', async () => {
|
||||
await deployExample('scully');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy solidstart', async () => {
|
||||
await deployExample('solidstart');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy stencil', async () => {
|
||||
await deployExample('stencil');
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy storybook', async () => {
|
||||
await deployExample('storybook');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy svelte', async () => {
|
||||
await deployExample('svelte');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy sveltekit-1', async () => {
|
||||
await deployExample('sveltekit-1');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy sveltekit', async () => {
|
||||
await deployExample('sveltekit');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy umijs', async () => {
|
||||
await deployExample('umijs');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy vite', async () => {
|
||||
await deployExample('vite');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy vitepress', async () => {
|
||||
await deployExample('vitepress');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy vue', async () => {
|
||||
await deployExample('vue');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy vuepress', async () => {
|
||||
await deployExample('vuepress');
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { deployExample } from '../test-utils';
|
||||
it('should deploy', async () => {
|
||||
await deployExample(__filename);
|
||||
it('[examples] should deploy zola', async () => {
|
||||
await deployExample('zola');
|
||||
});
|
||||
|
||||
7992
examples/hydrogen/package-lock.json
generated
Normal file
7992
examples/hydrogen/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1
examples/nextjs/.gitignore
vendored
1
examples/nextjs/.gitignore
vendored
@@ -4,6 +4,7 @@
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
.yarn/install-state.gz
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
@@ -87,7 +87,7 @@ export default function Home() {
|
||||
</span>
|
||||
</h2>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
||||
Explore the Next.js 13 playground.
|
||||
Explore starter templates for Next.js.
|
||||
</p>
|
||||
</a>
|
||||
|
||||
|
||||
666
examples/nextjs/package-lock.json
generated
666
examples/nextjs/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -11,17 +11,17 @@
|
||||
"dependencies": {
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
"next": "13.5.6"
|
||||
"next": "14.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"autoprefixer": "^10",
|
||||
"autoprefixer": "^10.0.1",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3",
|
||||
"tailwindcss": "^3.3.0",
|
||||
"eslint": "^8",
|
||||
"eslint-config-next": "13.5.6"
|
||||
"eslint-config-next": "14.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
<div>
|
||||
<NuxtWelcome />
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
export default {
|
||||
nitro: {
|
||||
preset: 'vercel-edge',
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
devtools: { enabled: true },
|
||||
routeRules: {
|
||||
// prerender index route by default
|
||||
'/': { prerender: true },
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
@@ -8,6 +9,9 @@
|
||||
"postinstall": "nuxt prepare"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nuxt": "^3.0.0"
|
||||
"@nuxt/devtools": "^1.0.3",
|
||||
"nuxt": "^3.8.2",
|
||||
"vue": "^3.3.8",
|
||||
"vue-router": "^4.2.5"
|
||||
}
|
||||
}
|
||||
|
||||
6100
examples/nuxtjs/pnpm-lock.yaml
generated
Normal file
6100
examples/nuxtjs/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
BIN
examples/nuxtjs/public/favicon.ico
Normal file
BIN
examples/nuxtjs/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
3
examples/nuxtjs/server/tsconfig.json
Normal file
3
examples/nuxtjs/server/tsconfig.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "../.nuxt/tsconfig.server.json"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
// https://v3.nuxtjs.org/concepts/typescript
|
||||
// https://nuxt.com/docs/guide/concepts/typescript
|
||||
"extends": "./.nuxt/tsconfig.json"
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
2
examples/package.json
vendored
2
examples/package.json
vendored
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.4.1",
|
||||
"@vercel/frameworks": "2.0.2"
|
||||
"@vercel/frameworks": "2.0.5"
|
||||
},
|
||||
"version": null
|
||||
}
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
This directory is a brief example of a [Remix](https://remix.run/docs) site that can be deployed to Vercel with zero configuration.
|
||||
|
||||
To get started, run the Remix cli with this template
|
||||
|
||||
```sh
|
||||
npx create-remix@latest --template vercel/vercel/examples/remix
|
||||
```
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/remix&template=remix)
|
||||
|
||||
7906
examples/saber/package-lock.json
generated
Normal file
7906
examples/saber/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
31785
examples/sanity/package-lock.json
generated
Normal file
31785
examples/sanity/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,33 @@
|
||||
# @vercel-internals/types
|
||||
|
||||
## 1.0.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`dfe47f6e6`](https://github.com/vercel/vercel/commit/dfe47f6e6c1d395ae24d802f4b7c98e39b9f90f4)]:
|
||||
- @vercel/build-utils@7.3.0
|
||||
|
||||
## 1.0.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`88da7463c`](https://github.com/vercel/vercel/commit/88da7463ce12df91d49fbde85cb617030d55f558)]:
|
||||
- @vercel/build-utils@7.2.5
|
||||
|
||||
## 1.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`65dec5b7e`](https://github.com/vercel/vercel/commit/65dec5b7e752f4da8fe0ffdb25215170453f6f8b)]:
|
||||
- @vercel/build-utils@7.2.4
|
||||
|
||||
## 1.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`0861dc8fb`](https://github.com/vercel/vercel/commit/0861dc8fbcea1037626b00664a4b6c22f1b0a7ed)]:
|
||||
- @vercel/build-utils@7.2.3
|
||||
|
||||
## 1.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
3
internals/types/index.d.ts
vendored
3
internals/types/index.d.ts
vendored
@@ -428,7 +428,8 @@ export type ProjectLinkedError = {
|
||||
| 'TEAM_DELETED'
|
||||
| 'PATH_IS_FILE'
|
||||
| 'INVALID_ROOT_DIRECTORY'
|
||||
| 'MISSING_PROJECT_SETTINGS';
|
||||
| 'MISSING_PROJECT_SETTINGS'
|
||||
| 'TOO_MANY_PROJECTS';
|
||||
};
|
||||
|
||||
export type ProjectLinkResult =
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/types",
|
||||
"version": "1.0.13",
|
||||
"version": "1.0.17",
|
||||
"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.2.2",
|
||||
"@vercel/build-utils": "7.3.0",
|
||||
"@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.10.15",
|
||||
"turbo": "1.10.16",
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# @vercel/build-utils
|
||||
|
||||
## 7.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [cli] add `--deprecated` option to `vc project ls` command ([#10919](https://github.com/vercel/vercel/pull/10919))
|
||||
|
||||
## 7.2.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove Node.js v20 env var check ([#10834](https://github.com/vercel/vercel/pull/10834))
|
||||
|
||||
## 7.2.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Select Node.js version based on what's available in build-container ([#10822](https://github.com/vercel/vercel/pull/10822))
|
||||
|
||||
## 7.2.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Add experimental flag to allow Node.js v20 ([#10802](https://github.com/vercel/vercel/pull/10802))
|
||||
|
||||
## 7.2.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "7.2.2",
|
||||
"version": "7.3.0",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
@@ -33,7 +33,7 @@
|
||||
"@types/node-fetch": "^2.1.6",
|
||||
"@types/semver": "6.0.0",
|
||||
"@types/yazl": "2.4.2",
|
||||
"@vercel/error-utils": "2.0.1",
|
||||
"@vercel/error-utils": "2.0.2",
|
||||
"aggregate-error": "3.0.1",
|
||||
"async-retry": "1.2.3",
|
||||
"async-sema": "2.1.4",
|
||||
|
||||
@@ -1,54 +1,88 @@
|
||||
import { statSync } from 'fs';
|
||||
import { intersects, validRange } from 'semver';
|
||||
import { NodeVersion } from '../types';
|
||||
import { NowBuildError } from '../errors';
|
||||
import debug from '../debug';
|
||||
|
||||
export type NodeVersionMajor = ReturnType<typeof getOptions>[number]['major'];
|
||||
|
||||
export const NODE_VERSIONS: NodeVersion[] = [
|
||||
{ major: 20, range: '20.x', runtime: 'nodejs20.x' },
|
||||
{ major: 18, range: '18.x', runtime: 'nodejs18.x' },
|
||||
{
|
||||
major: 16,
|
||||
range: '16.x',
|
||||
runtime: 'nodejs16.x',
|
||||
discontinueDate: new Date('2024-02-06'),
|
||||
},
|
||||
{
|
||||
major: 14,
|
||||
range: '14.x',
|
||||
runtime: 'nodejs14.x',
|
||||
discontinueDate: new Date('2023-08-15'),
|
||||
},
|
||||
{
|
||||
major: 12,
|
||||
range: '12.x',
|
||||
runtime: 'nodejs12.x',
|
||||
discontinueDate: new Date('2022-10-03'),
|
||||
},
|
||||
{
|
||||
major: 10,
|
||||
range: '10.x',
|
||||
runtime: 'nodejs10.x',
|
||||
discontinueDate: new Date('2021-04-20'),
|
||||
},
|
||||
{
|
||||
major: 8,
|
||||
range: '8.10.x',
|
||||
runtime: 'nodejs8.10',
|
||||
discontinueDate: new Date('2020-01-06'),
|
||||
},
|
||||
];
|
||||
|
||||
function getOptions() {
|
||||
const options = [
|
||||
{ major: 18, range: '18.x', runtime: 'nodejs18.x' },
|
||||
{
|
||||
major: 16,
|
||||
range: '16.x',
|
||||
runtime: 'nodejs16.x',
|
||||
discontinueDate: new Date('2024-02-06'),
|
||||
},
|
||||
{
|
||||
major: 14,
|
||||
range: '14.x',
|
||||
runtime: 'nodejs14.x',
|
||||
discontinueDate: new Date('2023-08-15'),
|
||||
},
|
||||
{
|
||||
major: 12,
|
||||
range: '12.x',
|
||||
runtime: 'nodejs12.x',
|
||||
discontinueDate: new Date('2022-10-03'),
|
||||
},
|
||||
{
|
||||
major: 10,
|
||||
range: '10.x',
|
||||
runtime: 'nodejs10.x',
|
||||
discontinueDate: new Date('2021-04-20'),
|
||||
},
|
||||
{
|
||||
major: 8,
|
||||
range: '8.10.x',
|
||||
runtime: 'nodejs8.10',
|
||||
discontinueDate: new Date('2020-01-06'),
|
||||
},
|
||||
] as const;
|
||||
return options;
|
||||
return NODE_VERSIONS;
|
||||
}
|
||||
|
||||
function getHint(isAuto = false) {
|
||||
const { major, range } = getLatestNodeVersion();
|
||||
function isNodeVersionAvailable(version: NodeVersion): boolean {
|
||||
try {
|
||||
return statSync(`/node${version.major}`).isDirectory();
|
||||
} catch {
|
||||
// ENOENT, or any other error, we don't care about
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function getAvailableNodeVersions(): NodeVersionMajor[] {
|
||||
return getOptions()
|
||||
.filter(isNodeVersionAvailable)
|
||||
.map(n => n.major);
|
||||
}
|
||||
|
||||
function getHint(isAuto = false, availableVersions?: NodeVersionMajor[]) {
|
||||
const { major, range } = getLatestNodeVersion(availableVersions);
|
||||
return isAuto
|
||||
? `Please set Node.js Version to ${range} in your Project Settings to use Node.js ${major}.`
|
||||
: `Please set "engines": { "node": "${range}" } in your \`package.json\` file to use Node.js ${major}.`;
|
||||
}
|
||||
|
||||
export function getLatestNodeVersion() {
|
||||
return getOptions()[0];
|
||||
export function getLatestNodeVersion(availableVersions?: NodeVersionMajor[]) {
|
||||
const all = getOptions();
|
||||
if (availableVersions) {
|
||||
// Return the first node version that is definitely
|
||||
// available in the build-container.
|
||||
for (const version of all) {
|
||||
for (const major of availableVersions) {
|
||||
if (version.major === major) {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// As a fallback for local `vc build` and the tests,
|
||||
// return the first node version if none is found.
|
||||
return all[0];
|
||||
}
|
||||
|
||||
export function getDiscontinuedNodeVersions(): NodeVersion[] {
|
||||
@@ -57,9 +91,10 @@ export function getDiscontinuedNodeVersions(): NodeVersion[] {
|
||||
|
||||
export async function getSupportedNodeVersion(
|
||||
engineRange: string | undefined,
|
||||
isAuto = false
|
||||
isAuto = false,
|
||||
availableVersions?: NodeVersionMajor[]
|
||||
): Promise<NodeVersion> {
|
||||
let selection: NodeVersion = getLatestNodeVersion();
|
||||
let selection: NodeVersion | undefined;
|
||||
|
||||
if (engineRange) {
|
||||
const found =
|
||||
@@ -68,19 +103,29 @@ export async function getSupportedNodeVersion(
|
||||
// the array is already in order so return the first
|
||||
// match which will be the newest version of node
|
||||
selection = o;
|
||||
return intersects(o.range, engineRange);
|
||||
return (
|
||||
intersects(o.range, engineRange) &&
|
||||
(availableVersions?.length
|
||||
? availableVersions.includes(o.major)
|
||||
: true)
|
||||
);
|
||||
});
|
||||
if (!found) {
|
||||
throw new NowBuildError({
|
||||
code: 'BUILD_UTILS_NODE_VERSION_INVALID',
|
||||
link: 'http://vercel.link/node-version',
|
||||
message: `Found invalid Node.js Version: "${engineRange}". ${getHint(
|
||||
isAuto
|
||||
isAuto,
|
||||
availableVersions
|
||||
)}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!selection) {
|
||||
selection = getLatestNodeVersion(availableVersions);
|
||||
}
|
||||
|
||||
if (isDiscontinued(selection)) {
|
||||
const intro = `Node.js Version "${selection.range}" is discontinued and must be upgraded.`;
|
||||
throw new NowBuildError({
|
||||
|
||||
@@ -9,7 +9,11 @@ import { deprecate } from 'util';
|
||||
import debug from '../debug';
|
||||
import { NowBuildError } from '../errors';
|
||||
import { Meta, PackageJson, NodeVersion, Config } from '../types';
|
||||
import { getSupportedNodeVersion, getLatestNodeVersion } from './node-version';
|
||||
import {
|
||||
getSupportedNodeVersion,
|
||||
getLatestNodeVersion,
|
||||
getAvailableNodeVersions,
|
||||
} from './node-version';
|
||||
import { readConfigFile } from './read-config-file';
|
||||
import { cloneEnv } from '../clone-env';
|
||||
|
||||
@@ -238,9 +242,10 @@ export async function getNodeVersion(
|
||||
destPath: string,
|
||||
nodeVersionFallback = process.env.VERCEL_PROJECT_SETTINGS_NODE_VERSION,
|
||||
config: Config = {},
|
||||
meta: Meta = {}
|
||||
meta: Meta = {},
|
||||
availableVersions = getAvailableNodeVersions()
|
||||
): Promise<NodeVersion> {
|
||||
const latest = getLatestNodeVersion();
|
||||
const latest = getLatestNodeVersion(availableVersions);
|
||||
if (meta.isDev) {
|
||||
// Use the system-installed version of `node` in PATH for `vercel dev`
|
||||
return { ...latest, runtime: 'nodejs' };
|
||||
@@ -266,7 +271,7 @@ export async function getNodeVersion(
|
||||
nodeVersion = node;
|
||||
isAuto = false;
|
||||
}
|
||||
return getSupportedNodeVersion(nodeVersion, isAuto);
|
||||
return getSupportedNodeVersion(nodeVersion, isAuto, availableVersions);
|
||||
}
|
||||
|
||||
export async function scanParentDirs(
|
||||
|
||||
@@ -104,3 +104,5 @@ export * from './should-serve';
|
||||
export * from './schemas';
|
||||
export * from './types';
|
||||
export * from './errors';
|
||||
|
||||
export { NODE_VERSIONS } from './fs/node-version';
|
||||
|
||||
64
packages/build-utils/test/unit.test.ts
vendored
64
packages/build-utils/test/unit.test.ts
vendored
@@ -60,7 +60,7 @@ it('should only match supported node versions, otherwise throw an error', async
|
||||
);
|
||||
|
||||
const autoMessage =
|
||||
'Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.';
|
||||
'Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.';
|
||||
await expectBuilderError(
|
||||
getSupportedNodeVersion('8.11.x', true),
|
||||
autoMessage
|
||||
@@ -80,7 +80,7 @@ it('should only match supported node versions, otherwise throw an error', async
|
||||
);
|
||||
|
||||
const foundMessage =
|
||||
'Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.';
|
||||
'Please set "engines": { "node": "20.x" } in your `package.json` file to use Node.js 20.';
|
||||
await expectBuilderError(
|
||||
getSupportedNodeVersion('8.11.x', false),
|
||||
foundMessage
|
||||
@@ -101,8 +101,8 @@ it('should match all semver ranges', async () => {
|
||||
// See https://docs.npmjs.com/files/package.json#engines
|
||||
expect(await getSupportedNodeVersion('16.0.0')).toHaveProperty('major', 16);
|
||||
expect(await getSupportedNodeVersion('16.x')).toHaveProperty('major', 16);
|
||||
expect(await getSupportedNodeVersion('>=10')).toHaveProperty('major', 18);
|
||||
expect(await getSupportedNodeVersion('>=10.3.0')).toHaveProperty('major', 18);
|
||||
expect(await getSupportedNodeVersion('>=10')).toHaveProperty('major', 20);
|
||||
expect(await getSupportedNodeVersion('>=10.3.0')).toHaveProperty('major', 20);
|
||||
expect(await getSupportedNodeVersion('16.5.0 - 16.9.0')).toHaveProperty(
|
||||
'major',
|
||||
16
|
||||
@@ -120,11 +120,33 @@ it('should match all semver ranges', async () => {
|
||||
});
|
||||
|
||||
it('should allow nodejs18.x', async () => {
|
||||
expect(getLatestNodeVersion()).toHaveProperty('major', 18);
|
||||
expect(await getSupportedNodeVersion('18.x')).toHaveProperty('major', 18);
|
||||
expect(await getSupportedNodeVersion('18')).toHaveProperty('major', 18);
|
||||
expect(await getSupportedNodeVersion('18.1.0')).toHaveProperty('major', 18);
|
||||
expect(await getSupportedNodeVersion('>=16')).toHaveProperty('major', 18);
|
||||
});
|
||||
|
||||
it('should allow nodejs20.x', async () => {
|
||||
expect(getLatestNodeVersion()).toHaveProperty('major', 20);
|
||||
expect(await getSupportedNodeVersion('20.x')).toHaveProperty('major', 20);
|
||||
expect(await getSupportedNodeVersion('20')).toHaveProperty('major', 20);
|
||||
expect(await getSupportedNodeVersion('20.1.0')).toHaveProperty('major', 20);
|
||||
expect(await getSupportedNodeVersion('>=18')).toHaveProperty('major', 20);
|
||||
});
|
||||
|
||||
it('should not allow nodejs20.x when not available', async () => {
|
||||
// Simulates AL2 build-container
|
||||
await expect(
|
||||
getSupportedNodeVersion('20.x', true, [14, 16, 18])
|
||||
).rejects.toThrow(
|
||||
'Found invalid Node.js Version: "20.x". Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.'
|
||||
);
|
||||
});
|
||||
|
||||
it('should not allow nodejs18.x when not available', async () => {
|
||||
// Simulates AL2023 build-container
|
||||
await expect(getSupportedNodeVersion('18.x', true, [20])).rejects.toThrow(
|
||||
'Found invalid Node.js Version: "18.x". Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.'
|
||||
);
|
||||
});
|
||||
|
||||
it('should ignore node version in vercel dev getNodeVersion()', async () => {
|
||||
@@ -193,7 +215,7 @@ it('should warn when package.json engines is greater than', async () => {
|
||||
{},
|
||||
{}
|
||||
)
|
||||
).toHaveProperty('range', '18.x');
|
||||
).toHaveProperty('range', '20.x');
|
||||
expect(warningMessages).toStrictEqual([
|
||||
'Warning: Detected "engines": { "node": ">=16" } in your `package.json` that will automatically upgrade when a new major Node.js Version is released. Learn More: http://vercel.link/node-version',
|
||||
]);
|
||||
@@ -232,7 +254,17 @@ it('should not warn when package.json engines matches project setting from confi
|
||||
});
|
||||
|
||||
it('should get latest node version', async () => {
|
||||
expect(getLatestNodeVersion()).toHaveProperty('major', 18);
|
||||
expect(getLatestNodeVersion()).toHaveProperty('major', 20);
|
||||
});
|
||||
|
||||
it('should get latest node version with Node 18.x in build-container', async () => {
|
||||
// Simulates AL2 build-container
|
||||
expect(getLatestNodeVersion([14, 16, 18])).toHaveProperty('major', 18);
|
||||
});
|
||||
|
||||
it('should get latest node version with Node 20.x in build-container', async () => {
|
||||
// Simulates AL2023 build-container
|
||||
expect(getLatestNodeVersion([20])).toHaveProperty('major', 20);
|
||||
});
|
||||
|
||||
it('should throw for discontinued versions', async () => {
|
||||
@@ -300,14 +332,14 @@ it('should warn for deprecated versions, soon to be discontinued', async () => {
|
||||
16
|
||||
);
|
||||
expect(warningMessages).toStrictEqual([
|
||||
'Error: Node.js version 10.x has reached End-of-Life. Deployments created on or after 2021-04-20 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 10.x has reached End-of-Life. Deployments created on or after 2021-04-20 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
'Error: Node.js version 12.x has reached End-of-Life. Deployments created on or after 2022-10-03 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 12.x has reached End-of-Life. Deployments created on or after 2022-10-03 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
'Error: Node.js version 14.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 14.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2024-02-06 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2024-02-06 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
'Error: Node.js version 10.x has reached End-of-Life. Deployments created on or after 2021-04-20 will fail to build. Please set "engines": { "node": "20.x" } in your `package.json` file to use Node.js 20.',
|
||||
'Error: Node.js version 10.x has reached End-of-Life. Deployments created on or after 2021-04-20 will fail to build. Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.',
|
||||
'Error: Node.js version 12.x has reached End-of-Life. Deployments created on or after 2022-10-03 will fail to build. Please set "engines": { "node": "20.x" } in your `package.json` file to use Node.js 20.',
|
||||
'Error: Node.js version 12.x has reached End-of-Life. Deployments created on or after 2022-10-03 will fail to build. Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.',
|
||||
'Error: Node.js version 14.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set "engines": { "node": "20.x" } in your `package.json` file to use Node.js 20.',
|
||||
'Error: Node.js version 14.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.',
|
||||
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2024-02-06 will fail to build. Please set "engines": { "node": "20.x" } in your `package.json` file to use Node.js 20.',
|
||||
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2024-02-06 will fail to build. Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.',
|
||||
]);
|
||||
|
||||
global.Date.now = realDateNow;
|
||||
|
||||
@@ -1,5 +1,101 @@
|
||||
# vercel
|
||||
|
||||
## 32.7.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [cli] add `--deprecated` option to `vc project ls` command ([#10919](https://github.com/vercel/vercel/pull/10919))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove some debug statements and make log into warning ([#10926](https://github.com/vercel/vercel/pull/10926))
|
||||
|
||||
- Updated dependencies [[`3cede43ca`](https://github.com/vercel/vercel/commit/3cede43ca7ea3aec3ff33864b7d33da57891ddb2), [`dfe47f6e6`](https://github.com/vercel/vercel/commit/dfe47f6e6c1d395ae24d802f4b7c98e39b9f90f4), [`1dbb22bb6`](https://github.com/vercel/vercel/commit/1dbb22bb6d33657faa78376f527fe350188c5257), [`204c3592c`](https://github.com/vercel/vercel/commit/204c3592c78fc544e62f0210b0e7e1e4cd382a0c)]:
|
||||
- @vercel/ruby@2.0.4
|
||||
- @vercel/build-utils@7.3.0
|
||||
- @vercel/remix-builder@2.0.13
|
||||
- @vercel/node@3.0.12
|
||||
- @vercel/static-build@2.0.14
|
||||
|
||||
## 32.6.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Revert "forbids globally installed @vercel/speed-insights and @vercel/analytics (#10848)" ([#10895](https://github.com/vercel/vercel/pull/10895))
|
||||
|
||||
## 32.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- forbids globally installed @vercel/speed-insights and @vercel/analytics ([#10848](https://github.com/vercel/vercel/pull/10848))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [cli] Fix behavior for combination of northstar user + team scope provided to cli as an argument. ([#10884](https://github.com/vercel/vercel/pull/10884))
|
||||
|
||||
- Updated dependencies [[`4edfcd74b`](https://github.com/vercel/vercel/commit/4edfcd74b6dfd8e9cbc05a71d47578051a2a7d63), [`0e9bb30fd`](https://github.com/vercel/vercel/commit/0e9bb30fd285492beadc365bece2ab1df67b387b), [`ca2cbf06f`](https://github.com/vercel/vercel/commit/ca2cbf06fbf252e23aff6e007d0df5ffc243b56e), [`c52bdf775`](https://github.com/vercel/vercel/commit/c52bdf77585dfa41b25cabe2f9403827d0964169)]:
|
||||
- @vercel/remix-builder@2.0.12
|
||||
- @vercel/static-build@2.0.13
|
||||
- @vercel/go@3.0.4
|
||||
|
||||
## 32.5.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`ffd2f34c6`](https://github.com/vercel/vercel/commit/ffd2f34c6c3d53bbb673aa3241845abc50e67c5e), [`4636ae54c`](https://github.com/vercel/vercel/commit/4636ae54c6c17709c1a058169cdca19c3df73ddb)]:
|
||||
- @vercel/next@4.0.15
|
||||
- @vercel/ruby@2.0.3
|
||||
|
||||
## 32.5.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`88da7463c`](https://github.com/vercel/vercel/commit/88da7463ce12df91d49fbde85cb617030d55f558)]:
|
||||
- @vercel/build-utils@7.2.5
|
||||
- @vercel/node@3.0.11
|
||||
- @vercel/static-build@2.0.12
|
||||
|
||||
## 32.5.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`65dec5b7e`](https://github.com/vercel/vercel/commit/65dec5b7e752f4da8fe0ffdb25215170453f6f8b)]:
|
||||
- @vercel/build-utils@7.2.4
|
||||
- @vercel/node@3.0.10
|
||||
- @vercel/static-build@2.0.11
|
||||
|
||||
## 32.5.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Handle `TooManyProjects` error in places where projects are created ([#10807](https://github.com/vercel/vercel/pull/10807))
|
||||
|
||||
- Updated dependencies [[`89c1e0323`](https://github.com/vercel/vercel/commit/89c1e032335d9ec0fcfc84fe499cf004fe73fafc), [`fd29b966d`](https://github.com/vercel/vercel/commit/fd29b966d39776318b0e11a53909edb43d1fc5f2)]:
|
||||
- @vercel/node@3.0.9
|
||||
- @vercel/next@4.0.14
|
||||
|
||||
## 32.5.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`c94a082f6`](https://github.com/vercel/vercel/commit/c94a082f6bb1b84eaf420ac47ea83640dc83668e)]:
|
||||
- @vercel/next@4.0.13
|
||||
|
||||
## 32.5.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Debug log load user exceptions ([#10773](https://github.com/vercel/vercel/pull/10773))
|
||||
|
||||
- bump: edge-runtime ([#10712](https://github.com/vercel/vercel/pull/10712))
|
||||
|
||||
- Updated dependencies [[`fc90a3dc0`](https://github.com/vercel/vercel/commit/fc90a3dc0bd998453f6527c03d211c35bb0d5770), [`644b8a52c`](https://github.com/vercel/vercel/commit/644b8a52cb2cc8f05e215e2230f95f902cdf8ae8), [`0861dc8fb`](https://github.com/vercel/vercel/commit/0861dc8fbcea1037626b00664a4b6c22f1b0a7ed), [`33cc8e0ac`](https://github.com/vercel/vercel/commit/33cc8e0acf1b3466d50d45b2e5bbe66b89a87c14), [`f5296c3c0`](https://github.com/vercel/vercel/commit/f5296c3c06e620a39c5f88287ac94e58703bdaac), [`d9065c210`](https://github.com/vercel/vercel/commit/d9065c2102223e9cdb5b22df14db41c363cf7828)]:
|
||||
- @vercel/next@4.0.12
|
||||
- @vercel/node@3.0.8
|
||||
- @vercel/build-utils@7.2.3
|
||||
- @vercel/remix-builder@2.0.11
|
||||
- @vercel/static-build@2.0.10
|
||||
|
||||
## 32.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "32.5.0",
|
||||
"version": "32.7.0",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -31,22 +31,22 @@
|
||||
"node": ">= 16"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "7.2.2",
|
||||
"@vercel/build-utils": "7.3.0",
|
||||
"@vercel/fun": "1.1.0",
|
||||
"@vercel/go": "3.0.3",
|
||||
"@vercel/go": "3.0.4",
|
||||
"@vercel/hydrogen": "1.0.1",
|
||||
"@vercel/next": "4.0.11",
|
||||
"@vercel/node": "3.0.7",
|
||||
"@vercel/next": "4.0.15",
|
||||
"@vercel/node": "3.0.12",
|
||||
"@vercel/python": "4.1.0",
|
||||
"@vercel/redwood": "2.0.5",
|
||||
"@vercel/remix-builder": "2.0.10",
|
||||
"@vercel/ruby": "2.0.2",
|
||||
"@vercel/static-build": "2.0.9",
|
||||
"@vercel/remix-builder": "2.0.13",
|
||||
"@vercel/ruby": "2.0.4",
|
||||
"@vercel/static-build": "2.0.14",
|
||||
"chokidar": "3.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
"@edge-runtime/node-utils": "2.2.1",
|
||||
"@edge-runtime/node-utils": "2.2.2",
|
||||
"@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.13",
|
||||
"@vercel/client": "13.0.6",
|
||||
"@vercel/error-utils": "2.0.1",
|
||||
"@vercel/frameworks": "2.0.2",
|
||||
"@vercel/fs-detectors": "5.1.2",
|
||||
"@vercel-internals/types": "1.0.17",
|
||||
"@vercel/client": "13.0.10",
|
||||
"@vercel/error-utils": "2.0.2",
|
||||
"@vercel/frameworks": "2.0.5",
|
||||
"@vercel/fs-detectors": "5.1.5",
|
||||
"@vercel/routing-utils": "3.1.0",
|
||||
"ajv": "6.12.2",
|
||||
"alpha-sort": "2.0.1",
|
||||
|
||||
@@ -3,6 +3,7 @@ import ms from 'ms';
|
||||
import Client from '../../util/client';
|
||||
import { isAPIError } from '../../util/errors-ts';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import createProject from '../../util/projects/create-project';
|
||||
|
||||
export default async function add(
|
||||
client: Client,
|
||||
@@ -32,12 +33,14 @@ export default async function add(
|
||||
const start = Date.now();
|
||||
|
||||
const [name] = args;
|
||||
|
||||
try {
|
||||
await client.fetch('/projects', {
|
||||
method: 'POST',
|
||||
body: { name },
|
||||
});
|
||||
await createProject(client, { name });
|
||||
} catch (err: unknown) {
|
||||
if (isAPIError(err) && err.code === 'too_many_projects') {
|
||||
output.prettyError(err);
|
||||
return 1;
|
||||
}
|
||||
if (isAPIError(err) && err.status === 409) {
|
||||
// project already exists, so we can
|
||||
// show a success message
|
||||
|
||||
@@ -15,7 +15,17 @@ export const projectCommand: Command = {
|
||||
name: 'ls',
|
||||
description: 'Show all projects in the selected scope',
|
||||
arguments: [],
|
||||
options: [],
|
||||
options: [
|
||||
{
|
||||
name: 'deprecated',
|
||||
description: 'A list of projects affected by a deprecation',
|
||||
argument: 'deprecated',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
multi: false,
|
||||
},
|
||||
],
|
||||
examples: [],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ export default async function main(client: Client) {
|
||||
argv = getArgs(client.argv.slice(2), {
|
||||
'--next': Number,
|
||||
'-N': '--next',
|
||||
'--deprecated': Boolean,
|
||||
});
|
||||
} catch (error) {
|
||||
handleError(error);
|
||||
|
||||
@@ -6,6 +6,7 @@ import Client from '../../util/client';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import strlen from '../../util/strlen';
|
||||
import { NODE_VERSIONS } from '@vercel/build-utils';
|
||||
|
||||
export default async function list(
|
||||
client: Client,
|
||||
@@ -34,7 +35,9 @@ export default async function list(
|
||||
projectsUrl += `&until=${next}`;
|
||||
}
|
||||
|
||||
const {
|
||||
const deprecated = argv['--deprecated'] || false;
|
||||
|
||||
let {
|
||||
projects: projectList,
|
||||
pagination,
|
||||
}: {
|
||||
@@ -48,10 +51,37 @@ export default async function list(
|
||||
|
||||
const elapsed = ms(Date.now() - start);
|
||||
|
||||
if (deprecated) {
|
||||
const upcomingDeprecationVersions = NODE_VERSIONS.filter(
|
||||
nodeVersion =>
|
||||
nodeVersion.discontinueDate &&
|
||||
nodeVersion.discontinueDate.valueOf() > Date.now()
|
||||
);
|
||||
const upcomingDeprecationVersionsList = upcomingDeprecationVersions.map(
|
||||
nodeVersion => nodeVersion.range
|
||||
);
|
||||
projectList = projectList.filter(
|
||||
project =>
|
||||
project.nodeVersion &&
|
||||
upcomingDeprecationVersionsList.includes(project.nodeVersion)
|
||||
);
|
||||
|
||||
output.warn(
|
||||
`The following Node.js versions will be deprecated soon: ${upcomingDeprecationVersionsList.join(
|
||||
', '
|
||||
)}. Upgrade your projects immediately.`
|
||||
);
|
||||
output.log(
|
||||
`For more information visit: https://vercel.com/docs/functions/serverless-functions/runtimes/node-js#node.js-version`
|
||||
);
|
||||
}
|
||||
|
||||
output.log(
|
||||
`${
|
||||
projectList.length > 0 ? 'Projects' : 'No projects'
|
||||
} found under ${chalk.bold(contextName)} ${chalk.gray(`[${elapsed}]`)}`
|
||||
} found under ${chalk.bold(contextName)} ${
|
||||
deprecated ? 'that are using a deprecated Node.js version' : '\b'
|
||||
} ${chalk.gray(`[${elapsed}]`)}`
|
||||
);
|
||||
|
||||
if (projectList.length > 0) {
|
||||
|
||||
@@ -426,6 +426,10 @@ const main = async () => {
|
||||
try {
|
||||
user = await getUser(client);
|
||||
} catch (err: unknown) {
|
||||
if (err instanceof Error) {
|
||||
output.debug(err.stack || err.toString());
|
||||
}
|
||||
|
||||
if (isErrnoException(err) && err.code === 'NOT_AUTHORIZED') {
|
||||
output.prettyError({
|
||||
message: `You do not have access to the specified account`,
|
||||
|
||||
@@ -24,11 +24,7 @@ export function createProxy(client: Client): Server {
|
||||
json: false,
|
||||
});
|
||||
res.statusCode = fetchRes.status;
|
||||
mergeIntoServerResponse(
|
||||
// @ts-expect-error - `node-fetch` Headers is missing `getAll()`
|
||||
toOutgoingHeaders(fetchRes.headers),
|
||||
res
|
||||
);
|
||||
mergeIntoServerResponse(toOutgoingHeaders(fetchRes.headers), res);
|
||||
fetchRes.body.pipe(res);
|
||||
} catch (err: unknown) {
|
||||
client.output.prettyError(err);
|
||||
|
||||
@@ -43,10 +43,13 @@ export default async function selectOrg(
|
||||
})),
|
||||
];
|
||||
|
||||
const defaultOrgIndex = teams.findIndex(team => team.id === currentTeam) + 1;
|
||||
const defaultChoiceIndex = Math.max(
|
||||
choices.findIndex(choice => choice.value.id === currentTeam),
|
||||
0
|
||||
);
|
||||
|
||||
if (autoConfirm) {
|
||||
return choices[defaultOrgIndex].value;
|
||||
return choices[defaultChoiceIndex].value;
|
||||
}
|
||||
|
||||
const answers = await client.prompt({
|
||||
@@ -54,7 +57,7 @@ export default async function selectOrg(
|
||||
name: 'org',
|
||||
message: question,
|
||||
choices,
|
||||
default: defaultOrgIndex,
|
||||
default: defaultChoiceIndex,
|
||||
});
|
||||
|
||||
const org = answers.org;
|
||||
|
||||
@@ -21,6 +21,7 @@ import createProject from '../projects/create-project';
|
||||
import { detectProjects } from '../projects/detect-projects';
|
||||
import { repoInfoToUrl } from '../git/repo-info-to-url';
|
||||
import { connectGitProvider, parseRepoUrl } from '../git/connect-git-provider';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
|
||||
const home = homedir();
|
||||
|
||||
@@ -283,24 +284,31 @@ export async function ensureRepoLink(
|
||||
output.spinner(`Creating new Project: ${orgAndName}`);
|
||||
delete selection.newProject;
|
||||
if (!selection.rootDirectory) delete selection.rootDirectory;
|
||||
const project = (selected[i] = await createProject(client, {
|
||||
...selection,
|
||||
framework: selection.framework.slug,
|
||||
}));
|
||||
await connectGitProvider(
|
||||
client,
|
||||
org,
|
||||
project.id,
|
||||
parsedRepoUrl.provider,
|
||||
`${parsedRepoUrl.org}/${parsedRepoUrl.repo}`
|
||||
);
|
||||
output.log(
|
||||
`Created new Project: ${output.link(
|
||||
orgAndName,
|
||||
`https://vercel.com/${orgAndName}`,
|
||||
{ fallback: false }
|
||||
)}`
|
||||
);
|
||||
try {
|
||||
const project = (selected[i] = await createProject(client, {
|
||||
...selection,
|
||||
framework: selection.framework.slug,
|
||||
}));
|
||||
await connectGitProvider(
|
||||
client,
|
||||
org,
|
||||
project.id,
|
||||
parsedRepoUrl.provider,
|
||||
`${parsedRepoUrl.org}/${parsedRepoUrl.repo}`
|
||||
);
|
||||
output.log(
|
||||
`Created new Project: ${output.link(
|
||||
orgAndName,
|
||||
`https://vercel.com/${orgAndName}`,
|
||||
{ fallback: false }
|
||||
)}`
|
||||
);
|
||||
} catch (err) {
|
||||
if (isAPIError(err) && err.code === 'too_many_projects') {
|
||||
output.prettyError(err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repoConfig = {
|
||||
|
||||
@@ -263,6 +263,10 @@ export default async function setupAndLink(
|
||||
|
||||
return { status: 'linked', org, project };
|
||||
} catch (err) {
|
||||
if (isAPIError(err) && err.code === 'too_many_projects') {
|
||||
output.prettyError(err);
|
||||
return { status: 'error', exitCode: 1, reason: 'TOO_MANY_PROJECTS' };
|
||||
}
|
||||
handleError(err);
|
||||
|
||||
return { status: 'error', exitCode: 1 };
|
||||
|
||||
12424
packages/cli/test/dev/fixtures/23-docusaurus/package-lock.json
generated
Normal file
12424
packages/cli/test/dev/fixtures/23-docusaurus/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
12400
packages/cli/test/dev/fixtures/dev-server-and-routes/package-lock.json
generated
Normal file
12400
packages/cli/test/dev/fixtures/dev-server-and-routes/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,7 @@ const { satisfies } = require('semver');
|
||||
const stripAnsi = require('strip-ansi');
|
||||
const {
|
||||
fetchCachedToken,
|
||||
disableSSO,
|
||||
} = require('../../../../test/lib/deployment/now-deploy');
|
||||
const { spawnSync, execFileSync } = require('child_process');
|
||||
|
||||
@@ -398,6 +399,9 @@ function testFixtureStdio(
|
||||
// Expect the deploy succeeded with exit of 0;
|
||||
expect(deployResult.exitCode).toBe(0);
|
||||
deploymentUrl = new URL(deployResult.stdout).host;
|
||||
|
||||
// Disable the Project SSO Protection
|
||||
await disableSSO(deployResult.stdout, true);
|
||||
} finally {
|
||||
if (!hasGitignore) {
|
||||
await fs.remove(gitignore);
|
||||
|
||||
107
packages/cli/test/integration-1.test.ts
vendored
107
packages/cli/test/integration-1.test.ts
vendored
@@ -5,7 +5,10 @@ import fetch, { RequestInit } from 'node-fetch';
|
||||
import retry from 'async-retry';
|
||||
import fs from 'fs-extra';
|
||||
import sleep from '../src/util/sleep';
|
||||
import { fetchTokenWithRetry } from '../../../test/lib/deployment/now-deploy';
|
||||
import {
|
||||
disableSSO,
|
||||
fetchTokenWithRetry,
|
||||
} from '../../../test/lib/deployment/now-deploy';
|
||||
import waitForPrompt from './helpers/wait-for-prompt';
|
||||
import { listTmpDirs } from './helpers/get-tmp-dir';
|
||||
import getGlobalDir from './helpers/get-global-dir';
|
||||
@@ -235,51 +238,59 @@ test('[vc build] should build project with corepack and select npm@8.1.0', async
|
||||
});
|
||||
|
||||
test('[vc build] should build project with corepack and select pnpm@7.1.0', async () => {
|
||||
process.env.ENABLE_EXPERIMENTAL_COREPACK = '1';
|
||||
const directory = await setupE2EFixture('vc-build-corepack-pnpm');
|
||||
const before = await exec(directory, 'pnpm', ['--version']);
|
||||
const output = await execCli(binaryPath, ['build'], { cwd: directory });
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
expect(output.stderr).toMatch(/Build Completed/gm);
|
||||
const after = await exec(directory, 'pnpm', ['--version']);
|
||||
// Ensure global pnpm didn't change
|
||||
expect(before.stdout).toBe(after.stdout);
|
||||
// Ensure version is correct
|
||||
expect(
|
||||
await fs.readFile(
|
||||
path.join(directory, '.vercel/output/static/index.txt'),
|
||||
'utf8'
|
||||
)
|
||||
).toBe('7.1.0\n');
|
||||
// Ensure corepack will be cached
|
||||
const contents = fs.readdirSync(
|
||||
path.join(directory, '.vercel/cache/corepack')
|
||||
);
|
||||
expect(contents).toEqual(['home', 'shim']);
|
||||
try {
|
||||
process.env.ENABLE_EXPERIMENTAL_COREPACK = '1';
|
||||
const directory = await setupE2EFixture('vc-build-corepack-pnpm');
|
||||
const before = await exec(directory, 'pnpm', ['--version']);
|
||||
const output = await execCli(binaryPath, ['build'], { cwd: directory });
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
expect(output.stderr).toMatch(/Build Completed/gm);
|
||||
const after = await exec(directory, 'pnpm', ['--version']);
|
||||
// Ensure global pnpm didn't change
|
||||
expect(before.stdout).toBe(after.stdout);
|
||||
// Ensure version is correct
|
||||
expect(
|
||||
await fs.readFile(
|
||||
path.join(directory, '.vercel/output/static/index.txt'),
|
||||
'utf8'
|
||||
)
|
||||
).toBe('7.1.0\n');
|
||||
// Ensure corepack will be cached
|
||||
const contents = fs.readdirSync(
|
||||
path.join(directory, '.vercel/cache/corepack')
|
||||
);
|
||||
expect(contents).toEqual(['home', 'shim']);
|
||||
} finally {
|
||||
delete process.env.ENABLE_EXPERIMENTAL_COREPACK;
|
||||
}
|
||||
});
|
||||
|
||||
test('[vc build] should build project with corepack and select yarn@2.4.3', async () => {
|
||||
process.env.ENABLE_EXPERIMENTAL_COREPACK = '1';
|
||||
const directory = await setupE2EFixture('vc-build-corepack-yarn');
|
||||
const before = await exec(directory, 'yarn', ['--version']);
|
||||
const output = await execCli(binaryPath, ['build'], { cwd: directory });
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
expect(output.stderr).toMatch(/Build Completed/gm);
|
||||
const after = await exec(directory, 'yarn', ['--version']);
|
||||
// Ensure global yarn didn't change
|
||||
expect(before.stdout).toBe(after.stdout);
|
||||
// Ensure version is correct
|
||||
expect(
|
||||
await fs.readFile(
|
||||
path.join(directory, '.vercel/output/static/index.txt'),
|
||||
'utf8'
|
||||
)
|
||||
).toBe('2.4.3\n');
|
||||
// Ensure corepack will be cached
|
||||
const contents = fs.readdirSync(
|
||||
path.join(directory, '.vercel/cache/corepack')
|
||||
);
|
||||
expect(contents).toEqual(['home', 'shim']);
|
||||
try {
|
||||
process.env.ENABLE_EXPERIMENTAL_COREPACK = '1';
|
||||
const directory = await setupE2EFixture('vc-build-corepack-yarn');
|
||||
const before = await exec(directory, 'yarn', ['--version']);
|
||||
const output = await execCli(binaryPath, ['build'], { cwd: directory });
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
expect(output.stderr).toMatch(/Build Completed/gm);
|
||||
const after = await exec(directory, 'yarn', ['--version']);
|
||||
// Ensure global yarn didn't change
|
||||
expect(before.stdout).toBe(after.stdout);
|
||||
// Ensure version is correct
|
||||
expect(
|
||||
await fs.readFile(
|
||||
path.join(directory, '.vercel/output/static/index.txt'),
|
||||
'utf8'
|
||||
)
|
||||
).toBe('2.4.3\n');
|
||||
// Ensure corepack will be cached
|
||||
const contents = fs.readdirSync(
|
||||
path.join(directory, '.vercel/cache/corepack')
|
||||
);
|
||||
expect(contents).toEqual(['home', 'shim']);
|
||||
} finally {
|
||||
delete process.env.ENABLE_EXPERIMENTAL_COREPACK;
|
||||
}
|
||||
});
|
||||
|
||||
test('[vc dev] should print help from `vc develop --help`', async () => {
|
||||
@@ -393,6 +404,8 @@ test('default command should work with --cwd option', async () => {
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
|
||||
const url = stdout;
|
||||
await disableSSO(url, false);
|
||||
|
||||
const deploymentResult = await fetch(`${url}/README.md`);
|
||||
const body = await deploymentResult.text();
|
||||
expect(body).toEqual(
|
||||
@@ -421,6 +434,8 @@ test('should allow deploying a directory that was built with a target environmen
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
|
||||
const url = stdout;
|
||||
await disableSSO(url, false);
|
||||
|
||||
const deploymentResult = await fetch(`${url}/README.md`);
|
||||
const body = await deploymentResult.text();
|
||||
expect(body).toEqual(
|
||||
@@ -447,6 +462,8 @@ test('should allow deploying a directory that was prebuilt, but has no builds.js
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
|
||||
const url = stdout;
|
||||
await disableSSO(url, false);
|
||||
|
||||
const deploymentResult = await fetch(`${url}/README.md`);
|
||||
const body = await deploymentResult.text();
|
||||
expect(body).toEqual('readme contents for build-output-api-raw');
|
||||
@@ -509,6 +526,7 @@ test('deploy using only now.json with `redirects` defined', async () => {
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
|
||||
const url = stdout;
|
||||
await disableSSO(url, false);
|
||||
const res = await fetch(`${url}/foo/bar`, { redirect: 'manual' });
|
||||
const location = res.headers.get('location');
|
||||
expect(location).toBe('https://example.com/foo/bar');
|
||||
@@ -530,6 +548,7 @@ test('deploy using --local-config flag v2', async () => {
|
||||
|
||||
const { host } = new URL(stdout);
|
||||
expect(host).toMatch(/secondary/gm);
|
||||
await disableSSO(host, false);
|
||||
|
||||
const testRes = await fetch(`https://${host}/test-${contextName}.html`);
|
||||
const testText = await testRes.text();
|
||||
@@ -580,6 +599,7 @@ test('deploy using --local-config flag above target', async () => {
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
|
||||
const { host } = new URL(stdout);
|
||||
await disableSSO(host, false);
|
||||
|
||||
const testRes = await fetch(`https://${host}/index.html`);
|
||||
const testText = await testRes.text();
|
||||
@@ -801,6 +821,7 @@ test('Deploy `api-env` fixture and test `vercel env` command', async () => {
|
||||
});
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
const { host } = new URL(stdout);
|
||||
await disableSSO(host, false);
|
||||
|
||||
const apiUrl = `https://${host}/api/get-env`;
|
||||
const apiRes = await fetch(apiUrl);
|
||||
|
||||
29
packages/cli/test/integration-2.test.ts
vendored
29
packages/cli/test/integration-2.test.ts
vendored
@@ -11,7 +11,10 @@ import fs, {
|
||||
mkdir,
|
||||
} from 'fs-extra';
|
||||
import sleep from '../src/util/sleep';
|
||||
import { fetchTokenWithRetry } from '../../../test/lib/deployment/now-deploy';
|
||||
import {
|
||||
disableSSO,
|
||||
fetchTokenWithRetry,
|
||||
} from '../../../test/lib/deployment/now-deploy';
|
||||
import waitForPrompt from './helpers/wait-for-prompt';
|
||||
import { execCli } from './helpers/exec';
|
||||
import getGlobalDir from './helpers/get-global-dir';
|
||||
@@ -327,8 +330,11 @@ test('should show prompts to set up project during first deploy', async () => {
|
||||
'README.txt'
|
||||
).toBe(true);
|
||||
|
||||
const { host, href } = new URL(output.stdout);
|
||||
await disableSSO(host, false);
|
||||
|
||||
// Send a test request to the deployment
|
||||
const response = await fetch(new URL(output.stdout));
|
||||
const response = await fetch(href);
|
||||
const text = await response.text();
|
||||
expect(text).toContain('<h1>custom hello</h1>');
|
||||
|
||||
@@ -640,7 +646,10 @@ test('use `rootDirectory` from project when deploying', async () => {
|
||||
const secondResult = await execCli(binaryPath, [directory, '--public']);
|
||||
expect(secondResult.exitCode, formatOutput(secondResult)).toBe(0);
|
||||
|
||||
const pageResponse1 = await fetch(secondResult.stdout);
|
||||
const { host, href } = new URL(secondResult.stdout);
|
||||
await disableSSO(host, false);
|
||||
|
||||
const pageResponse1 = await fetch(href);
|
||||
expect(pageResponse1.status).toBe(200);
|
||||
expect(await pageResponse1.text()).toMatch(/I am a website/gm);
|
||||
|
||||
@@ -722,6 +731,7 @@ test('deploys with only now.json and README.md', async () => {
|
||||
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
const { host } = new URL(stdout);
|
||||
await disableSSO(host, false);
|
||||
const res = await fetch(`https://${host}/README.md`);
|
||||
const text = await res.text();
|
||||
expect(text).toMatch(/readme contents/);
|
||||
@@ -744,6 +754,7 @@ test('deploys with only vercel.json and README.md', async () => {
|
||||
);
|
||||
|
||||
const { host } = new URL(stdout);
|
||||
await disableSSO(host, false);
|
||||
const res = await fetch(`https://${host}/README.md`);
|
||||
const text = await res.text();
|
||||
expect(text).toMatch(/readme contents/);
|
||||
@@ -821,14 +832,16 @@ test('deploy pnpm twice using pnp and symlink=false', async () => {
|
||||
|
||||
await remove(path.join(directory, '.vercel'));
|
||||
|
||||
function deploy() {
|
||||
return execCli(binaryPath, [
|
||||
async function deploy() {
|
||||
const res = await execCli(binaryPath, [
|
||||
directory,
|
||||
'--name',
|
||||
session,
|
||||
'--public',
|
||||
'--yes',
|
||||
]);
|
||||
await disableSSO(res.stdout, false);
|
||||
return res;
|
||||
}
|
||||
|
||||
let { exitCode, stdout, stderr } = await deploy();
|
||||
@@ -1243,6 +1256,8 @@ test('vercel.json configuration overrides in a new project prompt user and merge
|
||||
const deployment = await vc;
|
||||
expect(deployment.exitCode, formatOutput(deployment)).toBe(0);
|
||||
// assert the command were executed
|
||||
await disableSSO(deployment.stdout, false);
|
||||
|
||||
let page = await fetch(deployment.stdout);
|
||||
let text = await page.text();
|
||||
expect(text).toBe('1\n');
|
||||
@@ -1273,7 +1288,9 @@ test('vercel.json configuration overrides in an existing project do not prompt u
|
||||
// auto-confirm this deployment
|
||||
let deployment = await deploy(true);
|
||||
|
||||
let page = await fetch(deployment.stdout);
|
||||
const { host, href } = new URL(deployment.stdout);
|
||||
await disableSSO(host, false);
|
||||
let page = await fetch(href);
|
||||
let text = await page.text();
|
||||
expect(text).toBe('0');
|
||||
|
||||
|
||||
16
packages/cli/test/integration-3.test.ts
vendored
16
packages/cli/test/integration-3.test.ts
vendored
@@ -14,7 +14,10 @@ import { logo } from '../src/util/pkg-name';
|
||||
import sleep from '../src/util/sleep';
|
||||
import humanizePath from '../src/util/humanize-path';
|
||||
import pkg from '../package.json';
|
||||
import { fetchTokenWithRetry } from '../../../test/lib/deployment/now-deploy';
|
||||
import {
|
||||
disableSSO,
|
||||
fetchTokenWithRetry,
|
||||
} from '../../../test/lib/deployment/now-deploy';
|
||||
import waitForPrompt from './helpers/wait-for-prompt';
|
||||
import { getNewTmpDir, listTmpDirs } from './helpers/get-tmp-dir';
|
||||
import getGlobalDir from './helpers/get-global-dir';
|
||||
@@ -311,6 +314,7 @@ test('should add secret with hyphen prefix', async () => {
|
||||
|
||||
expect(targetCall.exitCode, formatOutput(targetCall)).toBe(0);
|
||||
const { host } = new URL(targetCall.stdout);
|
||||
await disableSSO(host, false);
|
||||
const response = await fetch(`https://${host}`);
|
||||
expect(response.status).toBe(200);
|
||||
expect(await response.text()).toBe(`${value}\n`);
|
||||
@@ -339,6 +343,7 @@ test('ignore files specified in .nowignore', async () => {
|
||||
});
|
||||
|
||||
const { host } = new URL(targetCall.stdout);
|
||||
await disableSSO(host, false);
|
||||
const ignoredFile = await fetch(`https://${host}/ignored.txt`);
|
||||
expect(ignoredFile.status).toBe(404);
|
||||
|
||||
@@ -355,6 +360,7 @@ test('ignore files specified in .nowignore via allowlist', async () => {
|
||||
});
|
||||
|
||||
const { host } = new URL(targetCall.stdout);
|
||||
await disableSSO(host, false);
|
||||
const ignoredFile = await fetch(`https://${host}/ignored.txt`);
|
||||
expect(ignoredFile.status).toBe(404);
|
||||
|
||||
@@ -551,6 +557,7 @@ test('ensure we render a warning for deployments with no files', async () => {
|
||||
|
||||
// Ensure the exit code is right
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
await disableSSO(host, false);
|
||||
|
||||
// Send a test request to the deployment
|
||||
const res = await fetch(href);
|
||||
@@ -1014,6 +1021,7 @@ test('try to revert a deployment and assign the automatic aliases', async () =>
|
||||
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
|
||||
await disableSSO(deploymentUrl, false);
|
||||
await waitForDeployment(deploymentUrl);
|
||||
await sleep(20000);
|
||||
|
||||
@@ -1028,6 +1036,7 @@ test('try to revert a deployment and assign the automatic aliases', async () =>
|
||||
'--yes',
|
||||
]);
|
||||
const deploymentUrl = stdout;
|
||||
await disableSSO(deploymentUrl, false);
|
||||
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
|
||||
@@ -1047,6 +1056,7 @@ test('try to revert a deployment and assign the automatic aliases', async () =>
|
||||
'--yes',
|
||||
]);
|
||||
const deploymentUrl = stdout;
|
||||
await disableSSO(deploymentUrl, false);
|
||||
|
||||
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
|
||||
|
||||
@@ -1318,6 +1328,7 @@ test('deploy a Lambda with 128MB of memory', async () => {
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
|
||||
const { host: url } = new URL(output.stdout);
|
||||
await disableSSO(url, false);
|
||||
const response = await fetch('https://' + url + '/api/memory');
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
@@ -1344,6 +1355,7 @@ test('deploy a Lambda with 3 seconds of maxDuration', async () => {
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
|
||||
const url = new URL(output.stdout);
|
||||
await disableSSO(url.host, false);
|
||||
|
||||
// Should time out
|
||||
url.pathname = '/api/wait-for/5';
|
||||
@@ -1382,6 +1394,7 @@ test('deploy a Lambda with a specific runtime', async () => {
|
||||
expect(output.exitCode, formatOutput(output)).toBe(0);
|
||||
|
||||
const url = new URL(output.stdout);
|
||||
await disableSSO(url.host, false);
|
||||
const res = await fetch(`${url}/api/test`);
|
||||
const text = await res.text();
|
||||
expect(text).toBe('Hello from PHP');
|
||||
@@ -1412,6 +1425,7 @@ test('use build-env', async () => {
|
||||
// Test if the output is really a URL
|
||||
const deploymentUrl = pickUrl(stdout);
|
||||
const { href } = new URL(deploymentUrl);
|
||||
await disableSSO(deploymentUrl, false);
|
||||
|
||||
await waitForDeployment(href);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user