mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 12:57:46 +00:00
Compare commits
93 Commits
@vercel/py
...
@vercel-in
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b67b97023b | ||
|
|
9146885f80 | ||
|
|
98bc41d49a | ||
|
|
a38c102208 | ||
|
|
211c74a7d2 | ||
|
|
2a40ff564e | ||
|
|
d4cf2b9ae6 | ||
|
|
7695316cd4 | ||
|
|
7ecb146fdb | ||
|
|
ec3d6ad640 | ||
|
|
5d521af586 | ||
|
|
652a312753 | ||
|
|
bd516c505b | ||
|
|
4d63d9e954 | ||
|
|
6a9002f229 | ||
|
|
2829d541b8 | ||
|
|
6880dcb3c3 | ||
|
|
832ba4b69a | ||
|
|
9a250d528c | ||
|
|
382ff2f526 | ||
|
|
f80a59c73f | ||
|
|
d09dd1794b | ||
|
|
ab34a26205 | ||
|
|
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/
|
||||
|
||||
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@@ -76,3 +76,12 @@ jobs:
|
||||
script: |
|
||||
const script = require('./utils/update-latest-release.js')
|
||||
await script({ github, context })
|
||||
summary:
|
||||
name: Summary
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
needs:
|
||||
- release
|
||||
steps:
|
||||
- name: Check All
|
||||
run: echo OK
|
||||
|
||||
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
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
@@ -15,21 +15,21 @@
|
||||
"devDependencies": {
|
||||
"@fontsource/fira-mono": "^4.5.10",
|
||||
"@neoconfetti/svelte": "^1.0.0",
|
||||
"@playwright/test": "^1.28.1",
|
||||
"@sveltejs/adapter-vercel": "^3.0.0",
|
||||
"@sveltejs/kit": "^1.5.0",
|
||||
"@types/cookie": "^0.5.1",
|
||||
"eslint": "^8.28.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-svelte": "^2.26.0",
|
||||
"prettier": "^2.8.0",
|
||||
"prettier-plugin-svelte": "^2.8.1",
|
||||
"svelte": "^3.54.0",
|
||||
"svelte-check": "^3.0.1",
|
||||
"typescript": "^5.0.0",
|
||||
"vite": "^4.3.0",
|
||||
"vitest": "^0.25.3",
|
||||
"web-vitals": "^3.3.1"
|
||||
"@playwright/test": "^1.40.1",
|
||||
"@sveltejs/adapter-vercel": "^3.1.0",
|
||||
"@sveltejs/kit": "^1.30.3",
|
||||
"@types/cookie": "^0.5.4",
|
||||
"eslint": "^8.55.0",
|
||||
"eslint-config-prettier": "^8.10.0",
|
||||
"eslint-plugin-svelte": "^2.35.1",
|
||||
"prettier": "^2.8.8",
|
||||
"prettier-plugin-svelte": "^2.10.1",
|
||||
"svelte": "^3.59.2",
|
||||
"svelte-check": "^3.6.2",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^4.5.1",
|
||||
"vitest": "^0.25.8",
|
||||
"web-vitals": "^3.5.0"
|
||||
},
|
||||
"type": "module"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,40 @@
|
||||
# @vercel-internals/types
|
||||
|
||||
## 1.0.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`4d63d9e95`](https://github.com/vercel/vercel/commit/4d63d9e954549d811063d259250d1865b7de2ba1)]:
|
||||
- @vercel/build-utils@7.4.0
|
||||
|
||||
## 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.18",
|
||||
"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.4.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.11.2",
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,35 @@
|
||||
# @vercel/build-utils
|
||||
|
||||
## 7.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Adds new helper `getPathForPackageManager()` ([#10918](https://github.com/vercel/vercel/pull/10918))
|
||||
|
||||
## 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.4.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(
|
||||
@@ -511,6 +516,10 @@ export async function runNpmInstall(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the input environment based on the used package manager and lockfile
|
||||
* versions.
|
||||
*/
|
||||
export function getEnvForPackageManager({
|
||||
cliType,
|
||||
lockfileVersion,
|
||||
@@ -522,7 +531,90 @@ export function getEnvForPackageManager({
|
||||
nodeVersion: NodeVersion | undefined;
|
||||
env: { [x: string]: string | undefined };
|
||||
}) {
|
||||
const newEnv: { [x: string]: string | undefined } = { ...env };
|
||||
const {
|
||||
detectedLockfile,
|
||||
detectedPackageManager,
|
||||
path: newPath,
|
||||
yarnNodeLinker,
|
||||
} = getPathForPackageManager({
|
||||
cliType,
|
||||
lockfileVersion,
|
||||
nodeVersion,
|
||||
env,
|
||||
});
|
||||
|
||||
const newEnv: { [x: string]: string | undefined } = {
|
||||
...env,
|
||||
};
|
||||
|
||||
if (newPath) {
|
||||
// Ensure that the binaries of the detected package manager are at the
|
||||
// beginning of the `$PATH`.
|
||||
const oldPath = env.PATH + '';
|
||||
newEnv.PATH = `${newPath}${path.delimiter}${oldPath}`;
|
||||
}
|
||||
|
||||
if (yarnNodeLinker) {
|
||||
newEnv.YARN_NODE_LINKER = yarnNodeLinker;
|
||||
}
|
||||
|
||||
if (detectedLockfile && detectedPackageManager) {
|
||||
// For pnpm we also show the version of the lockfile we found
|
||||
const versionString =
|
||||
cliType === 'pnpm' ? `version ${lockfileVersion} ` : '';
|
||||
|
||||
console.log(
|
||||
`Detected \`${detectedLockfile}\` ${versionString}generated by ${detectedPackageManager}`
|
||||
);
|
||||
|
||||
if (cliType === 'bun') {
|
||||
console.warn(
|
||||
'Warning: Bun is used as a package manager at build time only, not at runtime with Functions'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return newEnv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to get the binary paths that link to the used package manager.
|
||||
* Note: Make sure it doesn't contain any `console.log` calls.
|
||||
*/
|
||||
export function getPathForPackageManager({
|
||||
cliType,
|
||||
lockfileVersion,
|
||||
nodeVersion,
|
||||
env,
|
||||
}: {
|
||||
cliType: CliType;
|
||||
lockfileVersion: number | undefined;
|
||||
nodeVersion: NodeVersion | undefined;
|
||||
env: { [x: string]: string | undefined };
|
||||
}): {
|
||||
/**
|
||||
* Which lockfile was detected.
|
||||
*/
|
||||
detectedLockfile: string | undefined;
|
||||
/**
|
||||
* Detected package manager that generated the found lockfile.
|
||||
*/
|
||||
detectedPackageManager: string | undefined;
|
||||
/**
|
||||
* Value of $PATH that includes the binaries for the detected package manager.
|
||||
* Undefined if no $PATH are necessary.
|
||||
*/
|
||||
path: string | undefined;
|
||||
/**
|
||||
* Set if yarn was identified as package manager and `YARN_NODE_LINKER`
|
||||
* environment variable was not found on the input environment.
|
||||
*/
|
||||
yarnNodeLinker: string | undefined;
|
||||
} {
|
||||
let detectedLockfile: string | undefined;
|
||||
let detectedPackageManager: string | undefined;
|
||||
let pathValue: string | undefined;
|
||||
let yarnNodeLinker: string | undefined;
|
||||
const oldPath = env.PATH + '';
|
||||
const npm7 = '/node16/bin-npm7';
|
||||
const pnpm7 = '/pnpm7/node_modules/.bin';
|
||||
@@ -537,9 +629,10 @@ export function getEnvForPackageManager({
|
||||
!oldPath.includes(npm7) &&
|
||||
!corepackEnabled
|
||||
) {
|
||||
// Ensure that npm 7 is at the beginning of the `$PATH`
|
||||
newEnv.PATH = `${npm7}${path.delimiter}${oldPath}`;
|
||||
console.log('Detected `package-lock.json` generated by npm 7+');
|
||||
// npm 7
|
||||
pathValue = npm7;
|
||||
detectedLockfile = 'package-lock.json';
|
||||
detectedPackageManager = 'npm 7+';
|
||||
}
|
||||
} else if (cliType === 'pnpm') {
|
||||
if (
|
||||
@@ -548,39 +641,40 @@ export function getEnvForPackageManager({
|
||||
!oldPath.includes(pnpm7) &&
|
||||
!corepackEnabled
|
||||
) {
|
||||
// Ensure that pnpm 7 is at the beginning of the `$PATH`
|
||||
newEnv.PATH = `${pnpm7}${path.delimiter}${oldPath}`;
|
||||
console.log(
|
||||
`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 7`
|
||||
);
|
||||
// pnpm 7
|
||||
pathValue = pnpm7;
|
||||
detectedLockfile = 'pnpm-lock.yaml';
|
||||
detectedPackageManager = 'pnpm 7';
|
||||
} else if (
|
||||
typeof lockfileVersion === 'number' &&
|
||||
lockfileVersion >= 6 &&
|
||||
!oldPath.includes(pnpm8) &&
|
||||
!corepackEnabled
|
||||
) {
|
||||
// Ensure that pnpm 8 is at the beginning of the `$PATH`
|
||||
newEnv.PATH = `${pnpm8}${path.delimiter}${oldPath}`;
|
||||
console.log(
|
||||
`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 8`
|
||||
);
|
||||
// pnpm 8
|
||||
pathValue = pnpm8;
|
||||
detectedLockfile = 'pnpm-lock.yaml';
|
||||
detectedPackageManager = 'pnpm 8';
|
||||
}
|
||||
} else if (cliType === 'bun') {
|
||||
if (!oldPath.includes(bun1) && !corepackEnabled) {
|
||||
// Ensure that Bun 1 is at the beginning of the `$PATH`
|
||||
newEnv.PATH = `${bun1}${path.delimiter}${oldPath}`;
|
||||
console.log('Detected `bun.lockb` generated by Bun');
|
||||
console.warn(
|
||||
'Warning: Bun is used as a package manager at build time only, not at runtime with Functions'
|
||||
);
|
||||
// Bun 1
|
||||
pathValue = bun1;
|
||||
detectedLockfile = 'bun.lockb';
|
||||
detectedPackageManager = 'Bun';
|
||||
}
|
||||
} else {
|
||||
// Yarn v2 PnP mode may be activated, so force "node-modules" linker style
|
||||
if (!env.YARN_NODE_LINKER) {
|
||||
newEnv.YARN_NODE_LINKER = 'node-modules';
|
||||
yarnNodeLinker = 'node-modules';
|
||||
}
|
||||
}
|
||||
return newEnv;
|
||||
return {
|
||||
detectedLockfile,
|
||||
detectedPackageManager,
|
||||
path: pathValue,
|
||||
yarnNodeLinker,
|
||||
};
|
||||
}
|
||||
|
||||
export async function runCustomInstallCommand({
|
||||
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
runCustomInstallCommand,
|
||||
getEnvForPackageManager,
|
||||
getNodeVersion,
|
||||
getPathForPackageManager,
|
||||
getSpawnOptions,
|
||||
getNodeBinPath,
|
||||
getNodeBinPaths,
|
||||
@@ -78,6 +79,7 @@ export {
|
||||
runCustomInstallCommand,
|
||||
getEnvForPackageManager,
|
||||
getNodeVersion,
|
||||
getPathForPackageManager,
|
||||
getLatestNodeVersion,
|
||||
getDiscontinuedNodeVersions,
|
||||
getSpawnOptions,
|
||||
@@ -104,3 +106,5 @@ export * from './should-serve';
|
||||
export * from './schemas';
|
||||
export * from './types';
|
||||
export * from './errors';
|
||||
|
||||
export { NODE_VERSIONS } from './fs/node-version';
|
||||
|
||||
@@ -1,13 +1,34 @@
|
||||
import assert from 'assert';
|
||||
import { delimiter } from 'path';
|
||||
import { getEnvForPackageManager } from '../src';
|
||||
import { getEnvForPackageManager, getPathForPackageManager } from '../src';
|
||||
|
||||
describe('Test `getEnvForPackageManager()`', () => {
|
||||
const cases: Array<{
|
||||
let consoleLogSpy: jest.SpyInstance;
|
||||
let consoleWarnSpy: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
consoleLogSpy = jest.spyOn(console, 'log');
|
||||
consoleWarnSpy = jest.spyOn(console, 'warn');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
test.each<{
|
||||
name: string;
|
||||
args: Parameters<typeof getEnvForPackageManager>[0];
|
||||
want: unknown;
|
||||
}> = [
|
||||
/**
|
||||
* Expected output on `console.log`. Set to `null` when no output is
|
||||
* expected.
|
||||
*/
|
||||
consoleLogOutput?: string | null;
|
||||
/**
|
||||
* Expected output on `console.warn`. Set to `null` when no output is
|
||||
* expected.
|
||||
*/
|
||||
consoleWarnOutput?: string | null;
|
||||
}>([
|
||||
{
|
||||
name: 'should do nothing to env for npm < 6 and node < 16',
|
||||
args: {
|
||||
@@ -21,6 +42,8 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
want: {
|
||||
FOO: 'bar',
|
||||
},
|
||||
consoleLogOutput: null,
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
{
|
||||
name: 'should set path if npm 7+ is detected and node < 16',
|
||||
@@ -37,6 +60,8 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
FOO: 'bar',
|
||||
PATH: `/node16/bin-npm7${delimiter}foo`,
|
||||
},
|
||||
consoleLogOutput: 'Detected `package-lock.json` generated by npm 7+',
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
{
|
||||
name: 'should not set npm path if corepack enabled',
|
||||
@@ -53,6 +78,8 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
FOO: 'bar',
|
||||
ENABLE_EXPERIMENTAL_COREPACK: '1',
|
||||
},
|
||||
consoleLogOutput: null,
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
{
|
||||
name: 'should not prepend npm path again if already detected',
|
||||
@@ -69,6 +96,8 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
FOO: 'bar',
|
||||
PATH: `/node16/bin-npm7${delimiter}foo`,
|
||||
},
|
||||
consoleLogOutput: null,
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
{
|
||||
name: 'should not set path if node is 16 and npm 7+ is detected',
|
||||
@@ -85,6 +114,8 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
FOO: 'bar',
|
||||
PATH: 'foo',
|
||||
},
|
||||
consoleLogOutput: null,
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
{
|
||||
name: 'should set YARN_NODE_LINKER w/yarn if it is not already defined',
|
||||
@@ -100,6 +131,8 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
FOO: 'bar',
|
||||
YARN_NODE_LINKER: 'node-modules',
|
||||
},
|
||||
consoleLogOutput: null,
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
{
|
||||
name: 'should not set YARN_NODE_LINKER if it already exists',
|
||||
@@ -116,6 +149,8 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
FOO: 'bar',
|
||||
YARN_NODE_LINKER: 'exists',
|
||||
},
|
||||
consoleLogOutput: null,
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
{
|
||||
name: 'should set path if pnpm 7+ is detected',
|
||||
@@ -132,6 +167,9 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
FOO: 'bar',
|
||||
PATH: `/pnpm7/node_modules/.bin${delimiter}foo`,
|
||||
},
|
||||
consoleLogOutput:
|
||||
'Detected `pnpm-lock.yaml` version 5.4 generated by pnpm 7',
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
{
|
||||
name: 'should set path if bun v1 is detected',
|
||||
@@ -148,6 +186,9 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
FOO: 'bar',
|
||||
PATH: `/bun1${delimiter}/usr/local/bin`,
|
||||
},
|
||||
consoleLogOutput: 'Detected `bun.lockb` generated by Bun',
|
||||
consoleWarnOutput:
|
||||
'Warning: Bun is used as a package manager at build time only, not at runtime with Functions',
|
||||
},
|
||||
{
|
||||
name: 'should not set pnpm path if corepack is enabled',
|
||||
@@ -164,6 +205,8 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
FOO: 'bar',
|
||||
ENABLE_EXPERIMENTAL_COREPACK: '1',
|
||||
},
|
||||
consoleLogOutput: null,
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
{
|
||||
name: 'should not prepend pnpm path again if already detected',
|
||||
@@ -180,6 +223,8 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
FOO: 'bar',
|
||||
PATH: `/pnpm7/node_modules/.bin${delimiter}foo`,
|
||||
},
|
||||
consoleLogOutput: null,
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
{
|
||||
name: 'should not set path if pnpm 6 is detected',
|
||||
@@ -194,20 +239,262 @@ describe('Test `getEnvForPackageManager()`', () => {
|
||||
want: {
|
||||
FOO: 'bar',
|
||||
},
|
||||
consoleLogOutput: null,
|
||||
consoleWarnOutput: null,
|
||||
},
|
||||
];
|
||||
])('$name', ({ args, want, consoleLogOutput, consoleWarnOutput }) => {
|
||||
expect(
|
||||
getEnvForPackageManager({
|
||||
cliType: args.cliType,
|
||||
lockfileVersion: args.lockfileVersion,
|
||||
nodeVersion: args.nodeVersion,
|
||||
env: args.env,
|
||||
})
|
||||
).toStrictEqual(want);
|
||||
|
||||
for (const { name, want, args } of cases) {
|
||||
it(name, () => {
|
||||
assert.deepStrictEqual(
|
||||
getEnvForPackageManager({
|
||||
cliType: args.cliType,
|
||||
lockfileVersion: args.lockfileVersion,
|
||||
nodeVersion: args.nodeVersion,
|
||||
env: args.env,
|
||||
}),
|
||||
want
|
||||
);
|
||||
});
|
||||
}
|
||||
// Check console.log output
|
||||
if (typeof consoleLogOutput === 'string') {
|
||||
expect(consoleLogSpy).toHaveBeenCalledWith(consoleLogOutput);
|
||||
} else if (consoleLogOutput === null) {
|
||||
expect(consoleLogSpy).not.toHaveBeenCalled();
|
||||
}
|
||||
|
||||
// Check console.warn output
|
||||
if (typeof consoleWarnOutput === 'string') {
|
||||
expect(consoleWarnSpy).toHaveBeenCalledWith(consoleWarnOutput);
|
||||
} else if (consoleLogOutput === null) {
|
||||
expect(consoleWarnSpy).not.toHaveBeenCalled();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('Test `getPathForPackageManager()`', () => {
|
||||
test.each<{
|
||||
name: string;
|
||||
args: Parameters<typeof getEnvForPackageManager>[0];
|
||||
want: unknown;
|
||||
}>([
|
||||
{
|
||||
name: 'should do nothing to env for npm < 6 and node < 16',
|
||||
args: {
|
||||
cliType: 'npm',
|
||||
nodeVersion: { major: 14, range: '14.x', runtime: 'nodejs14.x' },
|
||||
lockfileVersion: 1,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: undefined,
|
||||
detectedPackageManager: undefined,
|
||||
path: undefined,
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should set path if npm 7+ is detected and node < 16',
|
||||
args: {
|
||||
cliType: 'npm',
|
||||
nodeVersion: { major: 14, range: '14.x', runtime: 'nodejs14.x' },
|
||||
lockfileVersion: 2,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
PATH: 'foo',
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: 'package-lock.json',
|
||||
detectedPackageManager: 'npm 7+',
|
||||
path: '/node16/bin-npm7',
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should not set npm path if corepack enabled',
|
||||
args: {
|
||||
cliType: 'npm',
|
||||
nodeVersion: { major: 14, range: '14.x', runtime: 'nodejs14.x' },
|
||||
lockfileVersion: 2,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
ENABLE_EXPERIMENTAL_COREPACK: '1',
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: undefined,
|
||||
detectedPackageManager: undefined,
|
||||
path: undefined,
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should not prepend npm path again if already detected',
|
||||
args: {
|
||||
cliType: 'npm',
|
||||
nodeVersion: { major: 14, range: '14.x', runtime: 'nodejs14.x' },
|
||||
lockfileVersion: 2,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
PATH: `/node16/bin-npm7${delimiter}foo`,
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: undefined,
|
||||
detectedPackageManager: undefined,
|
||||
path: undefined,
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should not set path if node is 16 and npm 7+ is detected',
|
||||
args: {
|
||||
cliType: 'npm',
|
||||
nodeVersion: { major: 16, range: '16.x', runtime: 'nodejs16.x' },
|
||||
lockfileVersion: 2,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
PATH: 'foo',
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: undefined,
|
||||
detectedPackageManager: undefined,
|
||||
path: undefined,
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should set YARN_NODE_LINKER w/yarn if it is not already defined',
|
||||
args: {
|
||||
cliType: 'yarn',
|
||||
nodeVersion: { major: 16, range: '16.x', runtime: 'nodejs16.x' },
|
||||
lockfileVersion: 2,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: undefined,
|
||||
detectedPackageManager: undefined,
|
||||
path: undefined,
|
||||
yarnNodeLinker: 'node-modules',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should not set YARN_NODE_LINKER if it already exists',
|
||||
args: {
|
||||
cliType: 'yarn',
|
||||
nodeVersion: { major: 16, range: '16.x', runtime: 'nodejs16.x' },
|
||||
lockfileVersion: 2,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
YARN_NODE_LINKER: 'exists',
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: undefined,
|
||||
detectedPackageManager: undefined,
|
||||
path: undefined,
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should set path if pnpm 7+ is detected',
|
||||
args: {
|
||||
cliType: 'pnpm',
|
||||
nodeVersion: { major: 16, range: '16.x', runtime: 'nodejs16.x' },
|
||||
lockfileVersion: 5.4,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
PATH: 'foo',
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: 'pnpm-lock.yaml',
|
||||
detectedPackageManager: 'pnpm 7',
|
||||
path: '/pnpm7/node_modules/.bin',
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should set path if bun v1 is detected',
|
||||
args: {
|
||||
cliType: 'bun',
|
||||
nodeVersion: { major: 18, range: '18.x', runtime: 'nodejs18.x' },
|
||||
lockfileVersion: 0,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
PATH: '/usr/local/bin',
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: 'bun.lockb',
|
||||
detectedPackageManager: 'Bun',
|
||||
path: '/bun1',
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should not set pnpm path if corepack is enabled',
|
||||
args: {
|
||||
cliType: 'pnpm',
|
||||
nodeVersion: { major: 16, range: '16.x', runtime: 'nodejs16.x' },
|
||||
lockfileVersion: 5.4,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
ENABLE_EXPERIMENTAL_COREPACK: '1',
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: undefined,
|
||||
detectedPackageManager: undefined,
|
||||
path: undefined,
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should not prepend pnpm path again if already detected',
|
||||
args: {
|
||||
cliType: 'pnpm',
|
||||
nodeVersion: { major: 16, range: '16.x', runtime: 'nodejs16.x' },
|
||||
lockfileVersion: 5.4,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
PATH: `/pnpm7/node_modules/.bin${delimiter}foo`,
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: undefined,
|
||||
detectedPackageManager: undefined,
|
||||
path: undefined,
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'should not set path if pnpm 6 is detected',
|
||||
args: {
|
||||
cliType: 'pnpm',
|
||||
nodeVersion: { major: 14, range: '14.x', runtime: 'nodejs14.x' },
|
||||
lockfileVersion: 5.3,
|
||||
env: {
|
||||
FOO: 'bar',
|
||||
},
|
||||
},
|
||||
want: {
|
||||
detectedLockfile: undefined,
|
||||
detectedPackageManager: undefined,
|
||||
path: undefined,
|
||||
yarnNodeLinker: undefined,
|
||||
},
|
||||
},
|
||||
])('$name', ({ args, want }) => {
|
||||
expect(
|
||||
getPathForPackageManager({
|
||||
cliType: args.cliType,
|
||||
lockfileVersion: args.lockfileVersion,
|
||||
nodeVersion: args.nodeVersion,
|
||||
env: args.env,
|
||||
})
|
||||
).toStrictEqual(want);
|
||||
});
|
||||
});
|
||||
|
||||
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,132 @@
|
||||
# vercel
|
||||
|
||||
## 33.0.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
- [cli] replace `--deprecated` with `--update-required` in `vc project ls` ([#10965](https://github.com/vercel/vercel/pull/10965))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix `vercel bisect` selecting too many deployments ([#10956](https://github.com/vercel/vercel/pull/10956))
|
||||
|
||||
- Updated dependencies [[`6a9002f22`](https://github.com/vercel/vercel/commit/6a9002f2296c5ccce4522c0fa9a8938c3d7a4849), [`4d63d9e95`](https://github.com/vercel/vercel/commit/4d63d9e954549d811063d259250d1865b7de2ba1)]:
|
||||
- @vercel/remix-builder@2.0.15
|
||||
- @vercel/build-utils@7.4.0
|
||||
- @vercel/static-build@2.0.15
|
||||
- @vercel/node@3.0.13
|
||||
|
||||
## 32.7.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [cli] Use new `deprecated` query param in projects api for `vc project ls --deprecated` ([#10938](https://github.com/vercel/vercel/pull/10938))
|
||||
|
||||
## 32.7.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [cli] double page limit for vc project ls --deprecated ([#10932](https://github.com/vercel/vercel/pull/10932))
|
||||
|
||||
- Updated dependencies [[`d09dd1794`](https://github.com/vercel/vercel/commit/d09dd1794b5ffa28c15d3ad2880b90db2f4c06f0)]:
|
||||
- @vercel/remix-builder@2.0.14
|
||||
|
||||
## 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": "33.0.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.4.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.13",
|
||||
"@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.15",
|
||||
"@vercel/ruby": "2.0.4",
|
||||
"@vercel/static-build": "2.0.15",
|
||||
"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.18",
|
||||
"@vercel/client": "13.0.11",
|
||||
"@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",
|
||||
|
||||
@@ -188,15 +188,18 @@ export default async function bisect(client: Client): Promise<number> {
|
||||
let newDeployments = chunk.deployments;
|
||||
|
||||
// If we have the "good" deployment in this chunk, then we're done
|
||||
let hasGood = false;
|
||||
for (let i = 0; i < newDeployments.length; i++) {
|
||||
if (newDeployments[i].url === good) {
|
||||
// grab all deployments up until the good one
|
||||
newDeployments = newDeployments.slice(0, i);
|
||||
hasGood = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
deployments = deployments.concat(newDeployments);
|
||||
if (hasGood) break;
|
||||
}
|
||||
|
||||
if (!deployments.length) {
|
||||
|
||||
@@ -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: 'update-required',
|
||||
description: 'A list of projects affected by an upcoming deprecation',
|
||||
argument: 'update-required',
|
||||
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',
|
||||
'--update-required': 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,
|
||||
@@ -27,14 +28,19 @@ export default async function list(
|
||||
|
||||
output.spinner(`Fetching projects in ${chalk.bold(contextName)}`);
|
||||
|
||||
let projectsUrl = '/v4/projects/?limit=20';
|
||||
let projectsUrl = `/v4/projects/?limit=20`;
|
||||
|
||||
const deprecated = argv['--update-required'] || false;
|
||||
if (deprecated) {
|
||||
projectsUrl += `&deprecated=${deprecated}`;
|
||||
}
|
||||
|
||||
const next = argv['--next'] || false;
|
||||
if (next) {
|
||||
projectsUrl += `&until=${next}`;
|
||||
}
|
||||
|
||||
const {
|
||||
let {
|
||||
projects: projectList,
|
||||
pagination,
|
||||
}: {
|
||||
@@ -48,10 +54,34 @@ export default async function list(
|
||||
|
||||
const elapsed = ms(Date.now() - start);
|
||||
|
||||
if (deprecated) {
|
||||
const upcomingDeprecationVersionsList = [];
|
||||
|
||||
for (const nodeVersion of NODE_VERSIONS) {
|
||||
if (
|
||||
nodeVersion.discontinueDate &&
|
||||
nodeVersion.discontinueDate.valueOf() > Date.now()
|
||||
) {
|
||||
upcomingDeprecationVersionsList.push(nodeVersion.range);
|
||||
}
|
||||
}
|
||||
|
||||
output.warn(
|
||||
`The following Node.js versions will be deprecated soon: ${upcomingDeprecationVersionsList.join(
|
||||
', '
|
||||
)}. Please 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`,
|
||||
|
||||
@@ -4,12 +4,12 @@ export const defaultGlobalConfig: GlobalConfig = {
|
||||
'// Note':
|
||||
'This is your Vercel config file. For more information see the global configuration documentation.',
|
||||
'// Docs':
|
||||
'https://vercel.com/docs/project-configuration#global-configuration/config-json',
|
||||
'https://vercel.com/docs/projects/project-configuration/global-configuration#config.json',
|
||||
collectMetrics: true,
|
||||
};
|
||||
|
||||
export const defaultAuthConfig: AuthConfig = {
|
||||
'// Note': 'This is your Vercel credentials file. DO NOT SHARE!',
|
||||
'// Docs':
|
||||
'https://vercel.com/docs/project-configuration#global-configuration/auth-json',
|
||||
'https://vercel.com/docs/projects/project-configuration/global-configuration#auth.json',
|
||||
};
|
||||
|
||||
@@ -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
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user