mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 12:57:46 +00:00
Compare commits
133 Commits
@vercel/py
...
@vercel/ru
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
7504bfbe26 | ||
|
|
7fa08088ea | ||
|
|
5d40da17ba | ||
|
|
de84743e10 | ||
|
|
39ce9166ba | ||
|
|
ce54ca631b | ||
|
|
d6ca05d975 | ||
|
|
f8c893bb15 | ||
|
|
5e6ef3d569 | ||
|
|
88715ad598 | ||
|
|
ed19b26603 | ||
|
|
9c4589ed28 | ||
|
|
da300030c9 | ||
|
|
90b14b689d | ||
|
|
e0ed2d1e76 | ||
|
|
e7516f8002 | ||
|
|
9e9fac0191 | ||
|
|
00f26b3571 | ||
|
|
68b4516722 | ||
|
|
7bf7591dd3 | ||
|
|
a012a1e749 | ||
|
|
6dbeb5c3ee | ||
|
|
853a570384 | ||
|
|
353a7ddfcd | ||
|
|
6fcbdb90c7 | ||
|
|
80a6960dc9 | ||
|
|
b52741b1bb | ||
|
|
1d4c86d0f8 | ||
|
|
913608de4d | ||
|
|
d595db6294 | ||
|
|
ae489687d2 | ||
|
|
6fc2872794 | ||
|
|
6697a0e846 | ||
|
|
ed9ef486a8 | ||
|
|
213ec69db3 | ||
|
|
7512bf64b1 | ||
|
|
00e12792d8 | ||
|
|
469d38aad8 | ||
|
|
0e84a6775d | ||
|
|
3029af5a2b | ||
|
|
4422eee5c4 | ||
|
|
222710f612 | ||
|
|
d8179032e2 | ||
|
|
f2d7f3f444 | ||
|
|
60929bb1af | ||
|
|
4ef0b19508 | ||
|
|
6041a3f6c8 | ||
|
|
5ee94e0dce | ||
|
|
9bc5bb4afc | ||
|
|
cf6152d16b | ||
|
|
0f5ec80cc6 | ||
|
|
c523a755f8 | ||
|
|
fa8e313222 | ||
|
|
0c1603f41b | ||
|
|
18b04b3589 | ||
|
|
58215906f9 | ||
|
|
1feb4d797e | ||
|
|
45ae16e371 | ||
|
|
ce7e82fa7a | ||
|
|
e9026c7a69 | ||
|
|
a18ed98f2d | ||
|
|
09f1bbfa41 | ||
|
|
13efc4f04f | ||
|
|
08c5a9b0fc | ||
|
|
5349fb9181 | ||
|
|
2f51171a17 | ||
|
|
63c010a7f4 | ||
|
|
7128a65ccd | ||
|
|
d402c4350a | ||
|
|
f88afba733 | ||
|
|
ea5bc88062 | ||
|
|
eb06bd262b | ||
|
|
cb37ff2c89 | ||
|
|
2f5b0aeeb1 | ||
|
|
ab01608785 | ||
|
|
905c7b6ad4 | ||
|
|
717dd82c51 | ||
|
|
a4996e1c5a | ||
|
|
c147ead1bc | ||
|
|
2ab5ce5d90 | ||
|
|
33e43e103a | ||
|
|
3dbc75580d | ||
|
|
f6e863d4bb | ||
|
|
9f63ca60ad | ||
|
|
873327e9bd | ||
|
|
e3f9faf513 | ||
|
|
1a5bd6c5b9 |
20
.github/CODEOWNERS
vendored
20
.github/CODEOWNERS
vendored
@@ -2,19 +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
|
||||
/packages/edge @vercel/compute
|
||||
* @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
|
||||
/examples/hugo @styfle
|
||||
/examples/jekyll @styfle
|
||||
/examples/zola @styfle
|
||||
/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/
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
- name: Enable corepack
|
||||
run: corepack enable pnpm
|
||||
- name: Update Gatsby Fixtures
|
||||
|
||||
2
.github/workflows/test-lint.yml
vendored
2
.github/workflows/test-lint.yml
vendored
@@ -49,3 +49,5 @@ jobs:
|
||||
- run: pnpm install
|
||||
- run: pnpm run lint
|
||||
- run: pnpm run prettier-check
|
||||
- run: pnpm run build
|
||||
- run: pnpm run type-check
|
||||
|
||||
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@@ -64,12 +64,17 @@ jobs:
|
||||
fetch-depth: 2
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
node-version: ${{ matrix.nodeVersion || env.NODE_VERSION }}
|
||||
|
||||
- name: Install Hugo
|
||||
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
|
||||
|
||||
@@ -91,7 +96,8 @@ jobs:
|
||||
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
|
||||
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
|
||||
FORCE_COLOR: '1'
|
||||
- name: 'Determing Turbo HIT or MISS'
|
||||
- name: 'Determine Turbo HIT or MISS'
|
||||
if: ${{ !cancelled() }}
|
||||
id: turbo-summary
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -102,7 +108,7 @@ jobs:
|
||||
if: matrix.runner != 'windows-latest'
|
||||
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
|
||||
- name: 'Upload Test Report to Datadog'
|
||||
if: ${{ steps['turbo-summary'].outputs.misses != '0' }}
|
||||
if: ${{ steps['turbo-summary'].outputs.misses != '0' && !cancelled() }}
|
||||
run: 'npx @datadog/datadog-ci@2.18.1 junit upload --service vercel-cli .junit-reports'
|
||||
env:
|
||||
DATADOG_API_KEY: ${{secrets.DATADOG_API_KEY_CLI}}
|
||||
|
||||
2
.github/workflows/update-remix-run-dev.yml
vendored
2
.github/workflows/update-remix-run-dev.yml
vendored
@@ -17,6 +17,8 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Enable corepack
|
||||
run: corepack enable pnpm
|
||||
- name: Update @remix-run/dev
|
||||
|
||||
1
.node_version
Normal file
1
.node_version
Normal file
@@ -0,0 +1 @@
|
||||
v16.20.2
|
||||
@@ -385,6 +385,7 @@ 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`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import './globals.css'
|
||||
import type { Metadata } from 'next'
|
||||
import { Inter } from 'next/font/google'
|
||||
import './globals.css'
|
||||
|
||||
const inter = Inter({ subsets: ['latin'] })
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
1100
examples/nextjs/package-lock.json
generated
1100
examples/nextjs/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,17 +9,19 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "20.6.3",
|
||||
"@types/react": "18.2.22",
|
||||
"@types/react-dom": "18.2.7",
|
||||
"autoprefixer": "10.4.15",
|
||||
"eslint": "8.49.0",
|
||||
"eslint-config-next": "13.5.2",
|
||||
"next": "13.5.2",
|
||||
"postcss": "8.4.30",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"tailwindcss": "3.3.3",
|
||||
"typescript": "5.2.2"
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
"next": "14.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"autoprefixer": "^10.0.1",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.3.0",
|
||||
"eslint": "^8",
|
||||
"eslint-config-next": "14.0.3"
|
||||
}
|
||||
}
|
||||
|
||||
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.3"
|
||||
},
|
||||
"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,40 @@
|
||||
# @vercel-internals/types
|
||||
|
||||
## 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
|
||||
|
||||
- Updated dependencies [[`9e9fac019`](https://github.com/vercel/vercel/commit/9e9fac0191cb1428ac9e5479c3d5c8afd7b7d357)]:
|
||||
- @vercel/routing-utils@3.1.0
|
||||
|
||||
## 1.0.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`2f5b0aeeb`](https://github.com/vercel/vercel/commit/2f5b0aeeb183ed3ea8cbc68cb3bc3c949c486ada)]:
|
||||
- @vercel/build-utils@7.2.2
|
||||
|
||||
## 1.0.11
|
||||
|
||||
### 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.11",
|
||||
"version": "1.0.16",
|
||||
"types": "index.d.ts",
|
||||
"main": "index.d.ts",
|
||||
"files": [
|
||||
@@ -10,8 +10,8 @@
|
||||
"dependencies": {
|
||||
"@types/node": "14.14.31",
|
||||
"@vercel-internals/constants": "1.0.4",
|
||||
"@vercel/build-utils": "7.2.1",
|
||||
"@vercel/routing-utils": "3.0.0"
|
||||
"@vercel/build-utils": "7.2.5",
|
||||
"@vercel/routing-utils": "3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel-internals/tsconfig": "1.0.0",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "5.21.0",
|
||||
"@typescript-eslint/parser": "5.21.0",
|
||||
"@vercel/build-utils": "*",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/style-guide": "4.0.2",
|
||||
"async-retry": "1.2.3",
|
||||
"buffer-replace": "1.0.0",
|
||||
"create-svelte": "2.0.1",
|
||||
@@ -33,7 +33,7 @@
|
||||
"source-map-support": "0.5.12",
|
||||
"ts-eager": "2.0.2",
|
||||
"ts-jest": "29.1.0",
|
||||
"turbo": "1.10.14",
|
||||
"turbo": "1.10.16",
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -50,7 +50,8 @@
|
||||
"prepare": "husky install",
|
||||
"pack": "cd utils && node -r ts-eager/register ./pack.ts",
|
||||
"ci:version": "changeset version && pnpm install --no-frozen-lockfile",
|
||||
"ci:publish": "pnpm publish -r && node utils/update-canary-tags.mjs && changeset tag"
|
||||
"ci:publish": "pnpm publish -r && node utils/update-canary-tags.mjs && changeset tag",
|
||||
"type-check": "turbo type-check --concurrency=12 --output-logs=errors-only --summarize --continue"
|
||||
},
|
||||
"lint-staged": {
|
||||
"./{*,{api,packages,test,utils}/**/*}.{js,ts}": [
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# @vercel/build-utils
|
||||
|
||||
## 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
|
||||
|
||||
- [cli] Update bun detection and add tests for projects with both bunlock binary and yarn.lock text files ([#10583](https://github.com/vercel/vercel/pull/10583))
|
||||
|
||||
## 7.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "7.2.1",
|
||||
"version": "7.2.5",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
@@ -14,7 +14,8 @@
|
||||
"build": "node build.mjs",
|
||||
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
|
||||
"test-unit": "pnpm test test/unit.*test.*",
|
||||
"test-e2e": "pnpm test test/integration.test.ts"
|
||||
"test-e2e": "pnpm test test/integration.test.ts",
|
||||
"type-check": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iarna/toml": "2.2.3",
|
||||
@@ -32,8 +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/ncc": "0.24.0",
|
||||
"@vercel/error-utils": "2.0.2",
|
||||
"aggregate-error": "3.0.1",
|
||||
"async-retry": "1.2.3",
|
||||
"async-sema": "2.1.4",
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
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'];
|
||||
|
||||
function getOptions() {
|
||||
const options = [
|
||||
{ major: 20, range: '20.x', runtime: 'nodejs20.x' },
|
||||
{ major: 18, range: '18.x', runtime: 'nodejs18.x' },
|
||||
{
|
||||
major: 16,
|
||||
@@ -40,15 +44,44 @@ function getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
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 +90,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 +102,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(
|
||||
@@ -311,8 +316,13 @@ export async function scanParentDirs(
|
||||
bunLockPath ? fs.readFile(bunLockPath, 'utf8') : null,
|
||||
]);
|
||||
|
||||
// Priority order is Yarn > pnpm > npm > bun
|
||||
if (hasYarnLock) {
|
||||
// Priority order is bun with yarn lock > yarn > pnpm > npm > bun
|
||||
if (bunLockBin && hasYarnLock) {
|
||||
cliType = 'bun';
|
||||
lockfilePath = bunLockPath;
|
||||
// TODO: read "bun-lockfile-format-v0"
|
||||
lockfileVersion = 0;
|
||||
} else if (hasYarnLock) {
|
||||
cliType = 'yarn';
|
||||
lockfilePath = yarnLockPath;
|
||||
} else if (pnpmLockYaml) {
|
||||
|
||||
2
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/.gitignore
vendored
Normal file
2
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.vercel
|
||||
public
|
||||
8
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/build.js
vendored
Normal file
8
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/build.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { mkdir, rm, writeFile } from 'node:fs/promises'
|
||||
import { say } from 'cowsay'
|
||||
|
||||
const text = say({ text: `bun version: ${process.versions.bun}` })
|
||||
const content = say({ text })
|
||||
await rm('./public', { recursive: true, force: true })
|
||||
await mkdir('./public', { recursive: true })
|
||||
await writeFile('./public/index.txt', content)
|
||||
BIN
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/bun.lockb
vendored
Executable file
BIN
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/bun.lockb
vendored
Executable file
Binary file not shown.
9
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/package.json
vendored
Normal file
9
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/package.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "bun build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"cowsay": "1.5.0"
|
||||
}
|
||||
}
|
||||
8
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/probes.json
vendored
Normal file
8
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/probes.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"probes": [
|
||||
{
|
||||
"path": "/",
|
||||
"mustContain": "bun version: 1"
|
||||
}
|
||||
]
|
||||
}
|
||||
221
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/yarn.lock
vendored
Normal file
221
packages/build-utils/test/fixtures/31-bun-v1-with-yarn-lock/yarn.lock
vendored
Normal file
@@ -0,0 +1,221 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
# bun ./bun.lockb --hash: CD5862D9DB80873E-24483eaa80ed0cc4-641E4430BAAAECB3-abebd38edad3b1b9
|
||||
|
||||
|
||||
ansi-regex@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz"
|
||||
integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==
|
||||
|
||||
ansi-regex@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz"
|
||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||
|
||||
ansi-styles@^4.0.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz"
|
||||
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
||||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
camelcase@^5.0.0:
|
||||
version "5.3.1"
|
||||
resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz"
|
||||
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
|
||||
|
||||
cliui@^6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz"
|
||||
integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==
|
||||
dependencies:
|
||||
string-width "^4.2.0"
|
||||
strip-ansi "^6.0.0"
|
||||
wrap-ansi "^6.2.0"
|
||||
|
||||
color-convert@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
|
||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
||||
dependencies:
|
||||
color-name "~1.1.4"
|
||||
|
||||
color-name@~1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
cowsay@1.5.0:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.npmjs.org/cowsay/-/cowsay-1.5.0.tgz"
|
||||
integrity sha512-8Ipzr54Z8zROr/62C8f0PdhQcDusS05gKTS87xxdji8VbWefWly0k8BwGK7+VqamOrkv3eGsCkPtvlHzrhWsCA==
|
||||
dependencies:
|
||||
get-stdin "8.0.0"
|
||||
string-width "~2.1.1"
|
||||
strip-final-newline "2.0.0"
|
||||
yargs "15.4.1"
|
||||
|
||||
decamelize@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz"
|
||||
integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==
|
||||
|
||||
emoji-regex@^8.0.0:
|
||||
version "8.0.0"
|
||||
resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz"
|
||||
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
|
||||
|
||||
find-up@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz"
|
||||
integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==
|
||||
dependencies:
|
||||
locate-path "^5.0.0"
|
||||
path-exists "^4.0.0"
|
||||
|
||||
get-caller-file@^2.0.1:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz"
|
||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||
|
||||
get-stdin@8.0.0:
|
||||
version "8.0.0"
|
||||
resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz"
|
||||
integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==
|
||||
|
||||
is-fullwidth-code-point@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz"
|
||||
integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==
|
||||
|
||||
is-fullwidth-code-point@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz"
|
||||
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
|
||||
|
||||
locate-path@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz"
|
||||
integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==
|
||||
dependencies:
|
||||
p-locate "^4.1.0"
|
||||
|
||||
p-limit@^2.2.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz"
|
||||
integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==
|
||||
dependencies:
|
||||
p-try "^2.0.0"
|
||||
|
||||
p-locate@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz"
|
||||
integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==
|
||||
dependencies:
|
||||
p-limit "^2.2.0"
|
||||
|
||||
p-try@^2.0.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz"
|
||||
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
|
||||
|
||||
path-exists@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz"
|
||||
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
|
||||
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz"
|
||||
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
|
||||
|
||||
require-main-filename@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz"
|
||||
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
|
||||
|
||||
set-blocking@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz"
|
||||
integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==
|
||||
|
||||
string-width@~2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz"
|
||||
integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
|
||||
dependencies:
|
||||
is-fullwidth-code-point "^2.0.0"
|
||||
strip-ansi "^4.0.0"
|
||||
|
||||
string-width@^4.1.0, string-width@^4.2.0:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
strip-ansi@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz"
|
||||
integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==
|
||||
dependencies:
|
||||
ansi-regex "^3.0.0"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
strip-final-newline@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz"
|
||||
integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==
|
||||
|
||||
which-module@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz"
|
||||
integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==
|
||||
|
||||
wrap-ansi@^6.2.0:
|
||||
version "6.2.0"
|
||||
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz"
|
||||
integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
y18n@^4.0.0:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz"
|
||||
integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==
|
||||
|
||||
yargs@15.4.1:
|
||||
version "15.4.1"
|
||||
resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz"
|
||||
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
|
||||
dependencies:
|
||||
cliui "^6.0.0"
|
||||
decamelize "^1.2.0"
|
||||
find-up "^4.1.0"
|
||||
get-caller-file "^2.0.1"
|
||||
require-directory "^2.1.1"
|
||||
require-main-filename "^2.0.0"
|
||||
set-blocking "^2.0.0"
|
||||
string-width "^4.2.0"
|
||||
which-module "^2.0.0"
|
||||
y18n "^4.0.0"
|
||||
yargs-parser "^18.1.2"
|
||||
|
||||
yargs-parser@^18.1.2:
|
||||
version "18.1.3"
|
||||
resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz"
|
||||
integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==
|
||||
dependencies:
|
||||
camelcase "^5.0.0"
|
||||
decamelize "^1.2.0"
|
||||
3
packages/build-utils/test/tsconfig.json
vendored
3
packages/build-utils/test/tsconfig.json
vendored
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"sourceMap": true
|
||||
},
|
||||
"extends": "../tsconfig.json",
|
||||
"include": ["*.test.ts"]
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('Test `readConfigFile()`', () => {
|
||||
it('should return parsed object when file exists', async () => {
|
||||
expect(await readConfigFile(tsconfig)).toMatchObject({
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
outDir: './dist',
|
||||
},
|
||||
});
|
||||
expect(logMessages).toEqual([]);
|
||||
@@ -39,7 +39,7 @@ describe('Test `readConfigFile()`', () => {
|
||||
const files = [doesnotexist, tsconfig];
|
||||
expect(await readConfigFile(files)).toMatchObject({
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
outDir: './dist',
|
||||
},
|
||||
});
|
||||
expect(logMessages).toEqual([]);
|
||||
@@ -63,7 +63,7 @@ describe('Test `readConfigFile()`', () => {
|
||||
await writeFile(invalid, 'borked');
|
||||
expect(await readConfigFile([invalid, tsconfig])).toMatchObject({
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
outDir: './dist',
|
||||
},
|
||||
});
|
||||
} finally {
|
||||
|
||||
73
packages/build-utils/test/unit.test.ts
vendored
73
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;
|
||||
@@ -541,6 +573,15 @@ it(
|
||||
);
|
||||
|
||||
it('should return cliType bun and correct lock file for bun v1', async () => {
|
||||
const fixture = path.join(__dirname, 'fixtures', '31-bun-v1-with-yarn-lock');
|
||||
const result = await scanParentDirs(fixture);
|
||||
expect(result.cliType).toEqual('bun');
|
||||
expect(result.lockfileVersion).toEqual(0);
|
||||
expect(result.lockfilePath).toEqual(path.join(fixture, 'bun.lockb'));
|
||||
expect(result.packageJsonPath).toEqual(path.join(fixture, 'package.json'));
|
||||
});
|
||||
|
||||
it('should return cliType bun and correct lock file for bun v1 with yarn.lock file', async () => {
|
||||
const fixture = path.join(__dirname, 'fixtures', '30-bun-v1');
|
||||
const result = await scanParentDirs(fixture);
|
||||
expect(result.cliType).toEqual('bun');
|
||||
|
||||
@@ -1,21 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"esModuleInterop": true,
|
||||
"lib": ["ES2021"],
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"noEmitOnError": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"outDir": "./dist",
|
||||
"types": ["node", "jest"],
|
||||
"strict": true,
|
||||
"target": "ES2021"
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,120 @@
|
||||
# vercel
|
||||
|
||||
## 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
|
||||
|
||||
- Indicates whether @vercel/speed-insights or @vercel/analytics are used ([#10623](https://github.com/vercel/vercel/pull/10623))
|
||||
|
||||
- [cli] update env var validation rule to allow name start with underscore ([#10697](https://github.com/vercel/vercel/pull/10697))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`da300030c`](https://github.com/vercel/vercel/commit/da300030c999b3555c608a321c9d0a4d36923a5a), [`de84743e1`](https://github.com/vercel/vercel/commit/de84743e10d4c9701d409355c0fe057f35e6e435), [`913608de4`](https://github.com/vercel/vercel/commit/913608de4dd4e37557533d732ca8449a5737d4a6), [`7fa08088e`](https://github.com/vercel/vercel/commit/7fa08088ea0d5df6955ea4af7f08513cf4027bb3)]:
|
||||
- @vercel/next@4.0.11
|
||||
- @vercel/python@4.1.0
|
||||
- @vercel/remix-builder@2.0.10
|
||||
- @vercel/redwood@2.0.5
|
||||
- @vercel/static-build@2.0.9
|
||||
|
||||
## 32.4.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`c523a755f`](https://github.com/vercel/vercel/commit/c523a755f8e4bc41f7c353ebc0b939c21703df00), [`58215906f`](https://github.com/vercel/vercel/commit/58215906f9ee28da3a7f2f3f4aeb862ab53bf55e)]:
|
||||
- @vercel/next@4.0.10
|
||||
|
||||
## 32.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Restore unsetting teamId for non-team accounts ([#10612](https://github.com/vercel/vercel/pull/10612))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- remove unused source map pkg ([#10577](https://github.com/vercel/vercel/pull/10577))
|
||||
|
||||
- disable source map for prod build ([#10575](https://github.com/vercel/vercel/pull/10575))
|
||||
|
||||
- Better rendering upon authentication error in `vc cert ls` ([#10551](https://github.com/vercel/vercel/pull/10551))
|
||||
|
||||
- Updated dependencies [[`e9026c7a6`](https://github.com/vercel/vercel/commit/e9026c7a692937122e60e73b91100cf7009e022d), [`ea5bc8806`](https://github.com/vercel/vercel/commit/ea5bc8806276abf5ba14bdb4a966267497e5d14d), [`a4996e1c5`](https://github.com/vercel/vercel/commit/a4996e1c5a7e6986d5410b662014dc584c0f7c54), [`a18ed98f2`](https://github.com/vercel/vercel/commit/a18ed98f2df78fe1256410ea8676686564ed9b35), [`2f5b0aeeb`](https://github.com/vercel/vercel/commit/2f5b0aeeb183ed3ea8cbc68cb3bc3c949c486ada), [`09f1bbfa4`](https://github.com/vercel/vercel/commit/09f1bbfa41a87cf0063a3fb3022b7531d03862b5), [`ce7e82fa7`](https://github.com/vercel/vercel/commit/ce7e82fa7aa6cec5f5d7b4953353b297b7ad1694)]:
|
||||
- @vercel/next@4.0.9
|
||||
- @vercel/go@3.0.3
|
||||
- @vercel/build-utils@7.2.2
|
||||
- @vercel/node@3.0.7
|
||||
- @vercel/redwood@2.0.4
|
||||
- @vercel/remix-builder@2.0.9
|
||||
- @vercel/static-build@2.0.8
|
||||
|
||||
## 32.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Use "esbuild" to build CLI ([#10555](https://github.com/vercel/vercel/pull/10555))
|
||||
|
||||
- Updated dependencies [[`9f63ca60a`](https://github.com/vercel/vercel/commit/9f63ca60ad914af0f7ba18c9bbe1656eeea68a0a), [`e3f9faf51`](https://github.com/vercel/vercel/commit/e3f9faf513bd97900d8966f2f1116fc3ca07221b)]:
|
||||
- @vercel/next@4.0.8
|
||||
- @vercel/remix-builder@2.0.8
|
||||
|
||||
## 32.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "32.3.0",
|
||||
"version": "32.5.6",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -16,35 +16,37 @@
|
||||
"test-e2e": "rimraf test/fixtures/integration && pnpm test test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts",
|
||||
"test-dev": "pnpm test test/dev/",
|
||||
"coverage": "codecov",
|
||||
"build": "ts-node ./scripts/build.ts",
|
||||
"dev": "ts-node ./src/index.ts"
|
||||
"build": "node scripts/build.mjs",
|
||||
"dev": "ts-node ./src/index.ts",
|
||||
"type-check": "tsc --noEmit"
|
||||
},
|
||||
"bin": {
|
||||
"vc": "./dist/index.js",
|
||||
"vercel": "./dist/index.js"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"scripts/preinstall.js"
|
||||
"dist"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "7.2.1",
|
||||
"@vercel/go": "3.0.2",
|
||||
"@vercel/build-utils": "7.2.5",
|
||||
"@vercel/fun": "1.1.0",
|
||||
"@vercel/go": "3.0.3",
|
||||
"@vercel/hydrogen": "1.0.1",
|
||||
"@vercel/next": "4.0.7",
|
||||
"@vercel/node": "3.0.6",
|
||||
"@vercel/python": "4.0.2",
|
||||
"@vercel/redwood": "2.0.3",
|
||||
"@vercel/remix-builder": "2.0.7",
|
||||
"@vercel/ruby": "2.0.2",
|
||||
"@vercel/static-build": "2.0.7"
|
||||
"@vercel/next": "4.0.15",
|
||||
"@vercel/node": "3.0.11",
|
||||
"@vercel/python": "4.1.0",
|
||||
"@vercel/redwood": "2.0.5",
|
||||
"@vercel/remix-builder": "2.0.11",
|
||||
"@vercel/ruby": "2.0.3",
|
||||
"@vercel/static-build": "2.0.12",
|
||||
"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",
|
||||
@@ -86,15 +88,12 @@
|
||||
"@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.11",
|
||||
"@vercel/client": "13.0.4",
|
||||
"@vercel/error-utils": "2.0.1",
|
||||
"@vercel/frameworks": "2.0.2",
|
||||
"@vercel/fs-detectors": "5.1.0",
|
||||
"@vercel/fun": "1.1.0",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "3.0.0",
|
||||
"@zeit/source-map-support": "0.6.2",
|
||||
"@vercel-internals/types": "1.0.16",
|
||||
"@vercel/client": "13.0.9",
|
||||
"@vercel/error-utils": "2.0.2",
|
||||
"@vercel/frameworks": "2.0.3",
|
||||
"@vercel/fs-detectors": "5.1.3",
|
||||
"@vercel/routing-utils": "3.1.0",
|
||||
"ajv": "6.12.2",
|
||||
"alpha-sort": "2.0.1",
|
||||
"ansi-escapes": "4.3.2",
|
||||
@@ -106,10 +105,8 @@
|
||||
"bytes": "3.0.0",
|
||||
"chalk": "4.1.0",
|
||||
"chance": "1.1.7",
|
||||
"chokidar": "3.3.1",
|
||||
"cli-table3": "0.6.3",
|
||||
"codecov": "3.8.2",
|
||||
"cpy": "7.2.0",
|
||||
"date-fns": "1.29.0",
|
||||
"debug": "3.1.0",
|
||||
"dot": "1.1.3",
|
||||
@@ -161,7 +158,6 @@
|
||||
"strip-ansi": "6.0.1",
|
||||
"supports-hyperlinks": "3.0.0",
|
||||
"tar-fs": "1.16.3",
|
||||
"test-listen": "1.1.0",
|
||||
"text-table": "0.2.0",
|
||||
"title": "3.4.1",
|
||||
"tmp-promise": "1.0.3",
|
||||
|
||||
54
packages/cli/scripts/build.mjs
Normal file
54
packages/cli/scripts/build.mjs
Normal file
@@ -0,0 +1,54 @@
|
||||
import { join } from 'node:path';
|
||||
import { copyFileSync, readFileSync, writeFileSync } from 'node:fs';
|
||||
import { esbuild } from '../../../utils/build.mjs';
|
||||
import { compileDevTemplates } from './compile-templates.mjs';
|
||||
|
||||
const repoRoot = new URL('../', import.meta.url);
|
||||
|
||||
function createConstants() {
|
||||
const filename = new URL('src/util/constants.ts', repoRoot);
|
||||
const contents = `// This file is auto-generated
|
||||
export const GA_TRACKING_ID: string | undefined = ${envToString(
|
||||
'GA_TRACKING_ID'
|
||||
)};
|
||||
export const SENTRY_DSN: string | undefined = ${envToString('SENTRY_DSN')};
|
||||
`;
|
||||
writeFileSync(filename, contents, 'utf8');
|
||||
}
|
||||
|
||||
function envToString(key) {
|
||||
const value = process.env[key];
|
||||
if (value) {
|
||||
return JSON.stringify(value);
|
||||
}
|
||||
}
|
||||
|
||||
// Read the secrets from GitHub Actions and generate a file.
|
||||
// During local development, these secrets will be empty.
|
||||
createConstants();
|
||||
|
||||
// Compile the `doT.js` template files for `vercel dev`
|
||||
await compileDevTemplates();
|
||||
|
||||
const pkgPath = join(process.cwd(), 'package.json');
|
||||
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
||||
const externals = Object.keys(pkg.dependencies || {});
|
||||
await esbuild({
|
||||
bundle: true,
|
||||
external: externals,
|
||||
});
|
||||
|
||||
// Copy a few static files into `dist`
|
||||
const distRoot = new URL('dist/', repoRoot);
|
||||
copyFileSync(
|
||||
new URL('src/util/projects/VERCEL_DIR_README.txt', repoRoot),
|
||||
new URL('VERCEL_DIR_README.txt', distRoot)
|
||||
);
|
||||
copyFileSync(
|
||||
new URL('src/util/dev/builder-worker.js', repoRoot),
|
||||
new URL('builder-worker.js', distRoot)
|
||||
);
|
||||
copyFileSync(
|
||||
new URL('src/util/get-latest-version/get-latest-worker.js', repoRoot),
|
||||
new URL('get-latest-worker.js', distRoot)
|
||||
);
|
||||
@@ -1,100 +0,0 @@
|
||||
import cpy from 'cpy';
|
||||
import execa from 'execa';
|
||||
import { join } from 'path';
|
||||
import { remove, readJSON, writeFile } from 'fs-extra';
|
||||
|
||||
const dirRoot = join(__dirname, '..');
|
||||
const distRoot = join(dirRoot, 'dist');
|
||||
|
||||
async function createConstants() {
|
||||
console.log('Creating constants.ts');
|
||||
const filename = join(dirRoot, 'src/util/constants.ts');
|
||||
const contents = `// This file is auto-generated
|
||||
export const GA_TRACKING_ID: string | undefined = ${envToString(
|
||||
'GA_TRACKING_ID'
|
||||
)};
|
||||
export const SENTRY_DSN: string | undefined = ${envToString('SENTRY_DSN')};
|
||||
`;
|
||||
await writeFile(filename, contents, 'utf8');
|
||||
}
|
||||
|
||||
function envToString(key: string) {
|
||||
const value = process.env[key];
|
||||
if (!value) {
|
||||
console.log(`- Constant ${key} is not assigned`);
|
||||
}
|
||||
return JSON.stringify(value);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// Read the secrets from GitHub Actions and generate a file.
|
||||
// During local development, these secrets will be empty.
|
||||
await createConstants();
|
||||
|
||||
// `vercel dev` uses chokidar to watch the filesystem, but opts-out of the
|
||||
// `fsevents` feature using `useFsEvents: false`, so delete the module here so
|
||||
// that it is not compiled by ncc, which makes the npm package size larger
|
||||
// than necessary.
|
||||
await remove(join(dirRoot, '../../node_modules/fsevents'));
|
||||
|
||||
// Compile the `doT.js` template files for `vercel dev`
|
||||
console.log();
|
||||
await execa(process.execPath, [join(__dirname, 'compile-templates.js')], {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
|
||||
const pkg = await readJSON(join(dirRoot, 'package.json'));
|
||||
const dependencies = Object.keys(pkg?.dependencies ?? {});
|
||||
// Do the initial `ncc` build
|
||||
console.log('Dependencies:', dependencies);
|
||||
const externs: Array<string> = [];
|
||||
for (const dep of dependencies) {
|
||||
externs.push('--external', dep);
|
||||
}
|
||||
const args = ['ncc', 'build', 'src/index.ts', ...externs];
|
||||
await execa('pnpm', args, { stdio: 'inherit', cwd: dirRoot });
|
||||
|
||||
// `ncc` has some issues with `@vercel/fun`'s runtime files:
|
||||
// - Executable bits on the `bootstrap` files appear to be lost:
|
||||
// https://github.com/vercel/ncc/pull/182
|
||||
// - The `bootstrap.js` asset does not get copied into the output dir:
|
||||
// https://github.com/vercel/ncc/issues/278
|
||||
//
|
||||
// Aside from those issues, all the same files from the `runtimes` directory
|
||||
// should be copied into the output runtimes dir, specifically the `index.js`
|
||||
// files (correctly) do not get copied into the output bundle because they
|
||||
// get compiled into the final ncc bundle file, however, we want them to be
|
||||
// present in the npm package because the contents of those files are involved
|
||||
// with `fun`'s cache invalidation mechanism and they need to be shasum'd.
|
||||
const runtimes = join(dirRoot, 'node_modules/@vercel/fun/dist/src/runtimes');
|
||||
await cpy('**/*', join(distRoot, 'runtimes'), {
|
||||
parents: true,
|
||||
cwd: runtimes,
|
||||
});
|
||||
|
||||
// Band-aid to bundle stuff that `ncc` neglects to bundle
|
||||
await cpy(join(dirRoot, 'src/util/projects/VERCEL_DIR_README.txt'), distRoot);
|
||||
await cpy(join(dirRoot, 'src/util/dev/builder-worker.js'), distRoot);
|
||||
await cpy(
|
||||
join(dirRoot, 'src/util/get-latest-version/get-latest-worker.js'),
|
||||
distRoot
|
||||
);
|
||||
|
||||
console.log('Finished building Vercel CLI');
|
||||
}
|
||||
|
||||
process.on('unhandledRejection', (reason: any, promise: Promise<any>) => {
|
||||
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', err => {
|
||||
console.error('Uncaught Exception:');
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
main().catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -1,88 +0,0 @@
|
||||
const execa = require('execa');
|
||||
const { join } = require('path');
|
||||
const { readFile, writeFile, readdir, remove } = require('fs-extra');
|
||||
|
||||
async function main() {
|
||||
const dirRoot = join(__dirname, '..');
|
||||
|
||||
// Compile the `doT.js` template files for `vercel dev`
|
||||
const templatesDir = join(dirRoot, 'src/util/dev/templates');
|
||||
const dotPacker = join(dirRoot, '../../node_modules/dot/bin/dot-packer');
|
||||
await execa(process.execPath, [dotPacker], {
|
||||
cwd: templatesDir,
|
||||
stdio: 'inherit',
|
||||
});
|
||||
|
||||
const files = await readdir(templatesDir);
|
||||
const compiledFiles = files.filter(f => f.endsWith('.js'));
|
||||
|
||||
// Prettier
|
||||
console.log('\nMaking the compiled template functions prettier...');
|
||||
const prettier = join(dirRoot, '../../node_modules/prettier/bin-prettier.js');
|
||||
await execa(
|
||||
process.execPath,
|
||||
[prettier, '--write', '--single-quote', ...compiledFiles],
|
||||
{
|
||||
cwd: templatesDir,
|
||||
stdio: 'inherit',
|
||||
}
|
||||
);
|
||||
|
||||
console.log('\nConverting template functions to TypeScript');
|
||||
for (const file of compiledFiles) {
|
||||
const start = Date.now();
|
||||
const fnPath = join(templatesDir, file);
|
||||
const tsPath = fnPath.replace(/\.js$/, '.ts');
|
||||
const def = await readFile(fnPath.replace(/\.js$/, '.tsdef'), 'utf8');
|
||||
const interfaceName = def.match(/interface (\w+)/)[1];
|
||||
|
||||
const lines = require(fnPath).toString().split('\n');
|
||||
let errorHtmlStart = -1;
|
||||
let errorHtmlEnd = -1;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
if (errorHtmlStart === -1 && line.includes('encodeHTML')) {
|
||||
errorHtmlStart = i;
|
||||
} else if (errorHtmlEnd === -1 && line.includes(')();')) {
|
||||
errorHtmlEnd = i;
|
||||
}
|
||||
if (/\bvar\b/.test(line)) {
|
||||
lines[i] = line.replace(/\bvar\b/g, 'let');
|
||||
}
|
||||
}
|
||||
lines.splice(errorHtmlStart, errorHtmlEnd);
|
||||
|
||||
lines[0] = `export default ${lines[0].replace(
|
||||
'(it)',
|
||||
`(it: ${interfaceName}): string`
|
||||
)}`;
|
||||
|
||||
lines.unshift(
|
||||
"import encodeHTML from 'escape-html';",
|
||||
'',
|
||||
...def.split('\n')
|
||||
);
|
||||
|
||||
await Promise.all([writeFile(tsPath, lines.join('\n')), remove(fnPath)]);
|
||||
console.log(
|
||||
`${file} -> ${file.replace(/\.js$/, '.ts')} (${Date.now() - start}ms)`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
process.on('unhandledRejection', err => {
|
||||
console.error('Unhandled Rejection:');
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', err => {
|
||||
console.error('Uncaught Exception:');
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
main().catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
43
packages/cli/scripts/compile-templates.mjs
Normal file
43
packages/cli/scripts/compile-templates.mjs
Normal file
@@ -0,0 +1,43 @@
|
||||
import execa from 'execa';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { readFile, writeFile, readdir, unlink } from 'node:fs/promises';
|
||||
|
||||
export async function compileDevTemplates() {
|
||||
const dirRoot = new URL('../', import.meta.url);
|
||||
|
||||
// Compile the `doT.js` template files for `vercel dev`
|
||||
const templatesDir = new URL('src/util/dev/templates/', dirRoot);
|
||||
const dotPacker = fileURLToPath(
|
||||
new URL('../../node_modules/dot/bin/dot-packer', dirRoot)
|
||||
);
|
||||
await execa(process.execPath, [dotPacker], {
|
||||
cwd: templatesDir,
|
||||
stdio: ['ignore', 'ignore', 'inherit'],
|
||||
});
|
||||
|
||||
const files = await readdir(templatesDir);
|
||||
const compiledFiles = files.filter(f => f.endsWith('.js'));
|
||||
|
||||
for (const file of compiledFiles) {
|
||||
const fnPath = new URL(file, templatesDir);
|
||||
const tsPath = fnPath.href.replace(/\.js$/, '.ts');
|
||||
const def = await readFile(
|
||||
new URL(fnPath.href.replace(/\.js$/, '.tsdef')),
|
||||
'utf8'
|
||||
);
|
||||
const interfaceName = def.match(/interface (\w+)/)[1];
|
||||
|
||||
const { default: fn } = await import(fnPath);
|
||||
|
||||
const contents = `import encodeHTML from 'escape-html';
|
||||
|
||||
${def}
|
||||
export default ${fn
|
||||
.toString()
|
||||
.replace(/var encodeHTML.+\(\)\);/s, '')
|
||||
.replace(/\bvar\b/g, 'let')
|
||||
.replace(/\(it\s*\)/s, `(it: ${interfaceName}): string`)}`;
|
||||
|
||||
await Promise.all([writeFile(new URL(tsPath), contents), unlink(fnPath)]);
|
||||
}
|
||||
}
|
||||
@@ -106,6 +106,10 @@ export interface BuildsManifest {
|
||||
argv: string[];
|
||||
error?: any;
|
||||
builds?: SerializedBuilder[];
|
||||
features?: {
|
||||
speedInsightsVersion?: string | undefined;
|
||||
webAnalyticsVersion?: string | undefined;
|
||||
};
|
||||
}
|
||||
|
||||
export default async function main(client: Client): Promise<number> {
|
||||
@@ -249,7 +253,7 @@ export default async function main(client: Client): Promise<number> {
|
||||
output.debug(`Loaded environment variables from "${envPath}"`);
|
||||
}
|
||||
|
||||
// For Vercel Speed Insights support
|
||||
// For Vercel Legacy speed Insights support
|
||||
if (project.settings.analyticsId) {
|
||||
envToUnset.add('VERCEL_ANALYTICS_ID');
|
||||
process.env.VERCEL_ANALYTICS_ID = project.settings.analyticsId;
|
||||
@@ -428,21 +432,27 @@ async function doBuild(
|
||||
|
||||
const ops: Promise<Error | void>[] = [];
|
||||
|
||||
const dependencies = [
|
||||
...Object.keys(pkg?.dependencies ?? {}),
|
||||
...Object.keys(pkg?.devDependencies ?? {}),
|
||||
];
|
||||
const dependencyMap = makeDepencyMap(pkg);
|
||||
const speedInsighsVersion = dependencyMap.get('@vercel/speed-insights');
|
||||
if (speedInsighsVersion) {
|
||||
if (process.env.VERCEL_ANALYTICS_ID) {
|
||||
output.warn(
|
||||
`The \`VERCEL_ANALYTICS_ID\` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables`
|
||||
);
|
||||
|
||||
const isUsingSpeedInsights = dependencies.some(
|
||||
d => d === '@vercel/speed-insights'
|
||||
);
|
||||
|
||||
if (isUsingSpeedInsights && process.env.VERCEL_ANALYTICS_ID) {
|
||||
output.warn(
|
||||
`The \`VERCEL_ANALYTICS_ID\` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables`
|
||||
);
|
||||
|
||||
delete process.env.VERCEL_ANALYTICS_ID;
|
||||
delete process.env.VERCEL_ANALYTICS_ID;
|
||||
}
|
||||
buildsJson.features = {
|
||||
...(buildsJson.features ?? {}),
|
||||
speedInsightsVersion: speedInsighsVersion,
|
||||
};
|
||||
}
|
||||
const webAnalyticsVersion = dependencyMap.get('@vercel/analytics');
|
||||
if (webAnalyticsVersion) {
|
||||
buildsJson.features = {
|
||||
...(buildsJson.features ?? {}),
|
||||
webAnalyticsVersion: webAnalyticsVersion,
|
||||
};
|
||||
}
|
||||
|
||||
// Write the `detectedBuilders` result to output dir
|
||||
@@ -807,3 +817,10 @@ function mergeFlags(
|
||||
return [];
|
||||
});
|
||||
}
|
||||
|
||||
function makeDepencyMap(pkg: PackageJson | null): Map<string, string> {
|
||||
return new Map([
|
||||
...Object.entries(pkg?.devDependencies ?? {}),
|
||||
...Object.entries(pkg?.dependencies ?? {}),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -43,10 +43,7 @@ async function ls(
|
||||
}
|
||||
|
||||
// Get the list of certificates
|
||||
const { certs, pagination } = await getCerts(
|
||||
client,
|
||||
...paginationOptions
|
||||
).catch(err => err);
|
||||
const { certs, pagination } = await getCerts(client, ...paginationOptions);
|
||||
|
||||
output.log(
|
||||
`${
|
||||
|
||||
@@ -17,12 +17,14 @@ type Options = {};
|
||||
|
||||
export default async function buy(
|
||||
client: Client,
|
||||
opts: Options,
|
||||
opts: Partial<Options>,
|
||||
args: string[]
|
||||
) {
|
||||
const { output } = client;
|
||||
const { contextName } = await getScope(client);
|
||||
|
||||
const skipConfirmation = !!process.env.CI;
|
||||
|
||||
const [domainName] = args;
|
||||
if (!domainName) {
|
||||
output.error(
|
||||
@@ -78,25 +80,31 @@ export default async function buy(
|
||||
'available'
|
||||
)} to buy under ${chalk.bold(contextName)}! ${availableStamp()}`
|
||||
);
|
||||
if (
|
||||
!(await promptBool(
|
||||
`Buy now for ${chalk.bold(`$${price}`)} (${`${period}yr${
|
||||
period > 1 ? 's' : ''
|
||||
}`})?`,
|
||||
client
|
||||
))
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const autoRenew = await promptBool(
|
||||
renewalPrice.period === 1
|
||||
? `Auto renew yearly for ${chalk.bold(`$${price}`)}?`
|
||||
: `Auto renew every ${renewalPrice.period} years for ${chalk.bold(
|
||||
`$${price}`
|
||||
)}?`,
|
||||
{ ...client, defaultValue: true }
|
||||
);
|
||||
let autoRenew;
|
||||
if (skipConfirmation) {
|
||||
autoRenew = true;
|
||||
} else {
|
||||
if (
|
||||
!(await promptBool(
|
||||
`Buy now for ${chalk.bold(`$${price}`)} (${`${period}yr${
|
||||
period > 1 ? 's' : ''
|
||||
}`})?`,
|
||||
client
|
||||
))
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
autoRenew = await promptBool(
|
||||
renewalPrice.period === 1
|
||||
? `Auto renew yearly for ${chalk.bold(`$${price}`)}?`
|
||||
: `Auto renew every ${renewalPrice.period} years for ${chalk.bold(
|
||||
`$${price}`
|
||||
)}?`,
|
||||
{ ...client, defaultValue: true }
|
||||
);
|
||||
}
|
||||
|
||||
let buyResult;
|
||||
const purchaseStamp = stamp();
|
||||
|
||||
@@ -24,6 +24,9 @@ import { updateCurrentTeamAfterLogin } from '../../util/login/update-current-tea
|
||||
export default async function login(client: Client): Promise<number> {
|
||||
const { output } = client;
|
||||
|
||||
// user is not currently authenticated on this machine
|
||||
const isInitialLogin = !client.authConfig.token;
|
||||
|
||||
const argv = getArgs(client.argv.slice(2), {
|
||||
'--oob': Boolean,
|
||||
'--github': Boolean,
|
||||
@@ -68,14 +71,22 @@ export default async function login(client: Client): Promise<number> {
|
||||
return result;
|
||||
}
|
||||
|
||||
const isNewLogin = !client.authConfig.token;
|
||||
|
||||
// Save the user's authentication token to the configuration file.
|
||||
client.authConfig.token = result.token;
|
||||
|
||||
// If we have a new login, update `currentTeam`
|
||||
if (isNewLogin) {
|
||||
await updateCurrentTeamAfterLogin(client, output, result.teamId);
|
||||
if (result.teamId) {
|
||||
client.config.currentTeam = result.teamId;
|
||||
} else {
|
||||
delete client.config.currentTeam;
|
||||
}
|
||||
|
||||
// If we have a brand new login, update `currentTeam`
|
||||
if (isInitialLogin) {
|
||||
await updateCurrentTeamAfterLogin(
|
||||
client,
|
||||
output,
|
||||
client.config.currentTeam
|
||||
);
|
||||
}
|
||||
|
||||
writeToAuthConfigFile(client.authConfig);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,7 +14,6 @@ try {
|
||||
|
||||
import { join } from 'path';
|
||||
import { existsSync } from 'fs';
|
||||
import sourceMap from '@zeit/source-map-support';
|
||||
import { mkdirp } from 'fs-extra';
|
||||
import chalk from 'chalk';
|
||||
import epipebomb from 'epipebomb';
|
||||
@@ -66,8 +65,6 @@ const GLOBAL_COMMANDS = new Set(['help']);
|
||||
|
||||
epipebomb();
|
||||
|
||||
sourceMap.install();
|
||||
|
||||
// Configure the error reporting system
|
||||
Sentry.init({
|
||||
dsn: SENTRY_DSN,
|
||||
@@ -429,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`,
|
||||
|
||||
@@ -3,6 +3,7 @@ import plural from 'pluralize';
|
||||
import npa from 'npm-package-arg';
|
||||
import { satisfies } from 'semver';
|
||||
import { dirname, join } from 'path';
|
||||
import { createRequire } from 'module';
|
||||
import { mkdirp, outputJSON, readJSON, symlink } from 'fs-extra';
|
||||
import { isStaticRuntime } from '@vercel/fs-detectors';
|
||||
import { BuilderV2, BuilderV3, PackageJson } from '@vercel/build-utils';
|
||||
@@ -28,6 +29,9 @@ type ResolveBuildersResult =
|
||||
| { buildersToAdd: Set<string> }
|
||||
| { builders: Map<string, BuilderWithPkg> };
|
||||
|
||||
// Get a real `require()` reference that esbuild won't mutate
|
||||
const require_ = createRequire(__filename);
|
||||
|
||||
/**
|
||||
* Imports the specified Vercel Builders, installing any missing ones
|
||||
* into `.vercel/builders` if necessary.
|
||||
@@ -115,10 +119,9 @@ export async function resolveBuilders(
|
||||
// If `pkgPath` wasn't found in `.vercel/builders` then try as a CLI local
|
||||
// dependency. `require.resolve()` will throw if the Builder is not a CLI
|
||||
// dep, in which case we'll install it into `.vercel/builders`.
|
||||
// NOTE: `eval('require')` is necessary to avoid bad transpilation to `__webpack_require__`
|
||||
pkgPath = eval('require').resolve(`${name}/package.json`, {
|
||||
pkgPath = require_.resolve(`${name}/package.json`, {
|
||||
paths: [__dirname],
|
||||
}) as string;
|
||||
});
|
||||
builderPkg = await readJSON(pkgPath);
|
||||
}
|
||||
|
||||
@@ -159,8 +162,7 @@ export async function resolveBuilders(
|
||||
|
||||
const path = join(dirname(pkgPath), builderPkg.main || 'index.js');
|
||||
|
||||
// NOTE: `eval('require')` is necessary to avoid bad transpilation to `__webpack_require__`
|
||||
const builder = eval('require')(path);
|
||||
const builder = require_(path);
|
||||
|
||||
builders.set(spec, {
|
||||
builder,
|
||||
|
||||
@@ -790,11 +790,10 @@ export default class DevServer {
|
||||
|
||||
const merged: Env = { ...env, ...localEnv };
|
||||
|
||||
// Validate that the env var name matches what AWS Lambda allows:
|
||||
// - https://docs.aws.amazon.com/lambda/latest/dg/env_variables.html
|
||||
// Validate that the env var name satisfies what Vercel's platform accepts.
|
||||
let hasInvalidName = false;
|
||||
for (const key of Object.keys(merged)) {
|
||||
if (!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(key)) {
|
||||
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)) {
|
||||
this.output.warn(
|
||||
`Ignoring ${type
|
||||
.split('.')
|
||||
@@ -808,7 +807,7 @@ export default class DevServer {
|
||||
}
|
||||
if (hasInvalidName) {
|
||||
this.output.log(
|
||||
'Env var names must start with letters, and can only contain alphanumeric characters and underscores'
|
||||
'The name contains invalid characters. Only letters, digits, and underscores are allowed. Furthermore, the name should not start with a digit'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1319,6 +1318,11 @@ export default class DevServer {
|
||||
}
|
||||
|
||||
if (!match && status && phase !== 'miss') {
|
||||
if (routeResult.userDest) {
|
||||
// If it's a user defined route then we continue routing
|
||||
return false;
|
||||
}
|
||||
|
||||
this.output.debug(`Route found with with status code ${status}`);
|
||||
await this.sendError(req, res, requestId, '', status, headers);
|
||||
return true;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
* the world, but something to be aware of.
|
||||
*
|
||||
* IMPORTANT! This file must NOT depend on any 3rd party dependencies. This
|
||||
* file is NOT bundled by `ncc` and thus any 3rd party dependencies will never
|
||||
* be available.
|
||||
* file is NOT bundled by `esbuild` and thus any 3rd party dependencies will
|
||||
* never be available.
|
||||
*/
|
||||
|
||||
const https = require('https');
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user