mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-23 18:59:59 +00:00
Compare commits
11 Commits
trek/zero-
...
@vercel/fs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb40c4c4a0 | ||
|
|
c90ee12b17 | ||
|
|
78be0200b4 | ||
|
|
1b6f3a0f65 | ||
|
|
eceb15ace9 | ||
|
|
fa3f701e05 | ||
|
|
9953fc765f | ||
|
|
29ea1af971 | ||
|
|
083aad448e | ||
|
|
314a105ba1 | ||
|
|
1abda9ca87 |
@@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
---
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
"@vercel/next": patch
|
|
||||||
---
|
|
||||||
|
|
||||||
provide `experimentalBypassFor` to Prerender from manifest
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
"@vercel/next": patch
|
|
||||||
---
|
|
||||||
|
|
||||||
next.js: move app route handlers in their own lambda grouping, add flag to use bundled runtime
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@vercel/remix-builder': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Fix usage with `bun install`
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
"@vercel/frameworks": patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Add `bun install` placeholder
|
|
||||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -83,7 +83,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
FORCE_COLOR: '1'
|
FORCE_COLOR: '1'
|
||||||
- name: Test ${{matrix.packageName}}
|
- name: Test ${{matrix.packageName}}
|
||||||
run: node utils/gen.js && node_modules/.bin/turbo run test --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
|
run: node utils/gen.js && node_modules/.bin/turbo run test --summarize --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
JEST_JUNIT_OUTPUT_FILE: ${{github.workspace}}/.junit-reports/${{matrix.scriptName}}-${{matrix.packageName}}-${{matrix.chunkNumber}}-${{ matrix.runner }}.xml
|
JEST_JUNIT_OUTPUT_FILE: ${{github.workspace}}/.junit-reports/${{matrix.scriptName}}-${{matrix.packageName}}-${{matrix.chunkNumber}}-${{ matrix.runner }}.xml
|
||||||
@@ -91,11 +91,9 @@ jobs:
|
|||||||
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
|
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
|
||||||
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
|
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
|
||||||
FORCE_COLOR: '1'
|
FORCE_COLOR: '1'
|
||||||
|
|
||||||
- name: fetch ssl certificate after tests (linux, os x)
|
- name: fetch ssl certificate after tests (linux, os x)
|
||||||
if: matrix.runner != 'windows-latest'
|
if: matrix.runner != 'windows-latest'
|
||||||
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
|
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
|
||||||
|
|
||||||
- name: 'Upload Test Report to Datadog'
|
- name: 'Upload Test Report to Datadog'
|
||||||
if: always()
|
if: always()
|
||||||
run: 'npx @datadog/datadog-ci@2.18.1 junit upload --service vercel-cli .junit-reports'
|
run: 'npx @datadog/datadog-ci@2.18.1 junit upload --service vercel-cli .junit-reports'
|
||||||
|
|||||||
2
examples/package.json
vendored
2
examples/package.json
vendored
@@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "27.4.1",
|
"@types/jest": "27.4.1",
|
||||||
"@vercel/frameworks": "2.0.1"
|
"@vercel/frameworks": "2.0.2"
|
||||||
},
|
},
|
||||||
"version": null
|
"version": null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,29 @@
|
|||||||
# vercel
|
# vercel
|
||||||
|
|
||||||
|
## 32.2.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Add support for bun detection in monorepo ([#10511](https://github.com/vercel/vercel/pull/10511))
|
||||||
|
|
||||||
|
- Updated dependencies [[`1b6f3a0f6`](https://github.com/vercel/vercel/commit/1b6f3a0f6534f71c7486a4e33ac199f1da330626)]:
|
||||||
|
- @vercel/static-build@2.0.6
|
||||||
|
|
||||||
|
## 32.2.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`083aad448`](https://github.com/vercel/vercel/commit/083aad448e45edae296da3201eec9f890a01d22d)]:
|
||||||
|
- @vercel/next@4.0.5
|
||||||
|
|
||||||
|
## 32.2.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`7a0fed970`](https://github.com/vercel/vercel/commit/7a0fed970c39cb8f4df70544ded3284d3538b06a), [`2f461a8b0`](https://github.com/vercel/vercel/commit/2f461a8b0bcbdd05da0516395c2905c2d0242682), [`1bab21026`](https://github.com/vercel/vercel/commit/1bab21026ec0bb8a4a8fbeac3d6e4a197f1030fd)]:
|
||||||
|
- @vercel/next@4.0.4
|
||||||
|
- @vercel/remix-builder@2.0.5
|
||||||
|
|
||||||
## 32.2.1
|
## 32.2.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vercel",
|
"name": "vercel",
|
||||||
"version": "32.2.1",
|
"version": "32.2.4",
|
||||||
"preferGlobal": true,
|
"preferGlobal": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"description": "The command-line interface for Vercel",
|
"description": "The command-line interface for Vercel",
|
||||||
@@ -34,13 +34,13 @@
|
|||||||
"@vercel/build-utils": "7.2.0",
|
"@vercel/build-utils": "7.2.0",
|
||||||
"@vercel/go": "3.0.1",
|
"@vercel/go": "3.0.1",
|
||||||
"@vercel/hydrogen": "1.0.1",
|
"@vercel/hydrogen": "1.0.1",
|
||||||
"@vercel/next": "4.0.3",
|
"@vercel/next": "4.0.5",
|
||||||
"@vercel/node": "3.0.5",
|
"@vercel/node": "3.0.5",
|
||||||
"@vercel/python": "4.0.1",
|
"@vercel/python": "4.0.1",
|
||||||
"@vercel/redwood": "2.0.2",
|
"@vercel/redwood": "2.0.2",
|
||||||
"@vercel/remix-builder": "2.0.4",
|
"@vercel/remix-builder": "2.0.5",
|
||||||
"@vercel/ruby": "2.0.2",
|
"@vercel/ruby": "2.0.2",
|
||||||
"@vercel/static-build": "2.0.5"
|
"@vercel/static-build": "2.0.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@alex_neo/jest-expect-message": "1.0.5",
|
"@alex_neo/jest-expect-message": "1.0.5",
|
||||||
@@ -89,8 +89,8 @@
|
|||||||
"@vercel-internals/types": "1.0.10",
|
"@vercel-internals/types": "1.0.10",
|
||||||
"@vercel/client": "13.0.3",
|
"@vercel/client": "13.0.3",
|
||||||
"@vercel/error-utils": "2.0.1",
|
"@vercel/error-utils": "2.0.1",
|
||||||
"@vercel/frameworks": "2.0.1",
|
"@vercel/frameworks": "2.0.2",
|
||||||
"@vercel/fs-detectors": "5.0.2",
|
"@vercel/fs-detectors": "5.1.0",
|
||||||
"@vercel/fun": "1.1.0",
|
"@vercel/fun": "1.1.0",
|
||||||
"@vercel/ncc": "0.24.0",
|
"@vercel/ncc": "0.24.0",
|
||||||
"@vercel/routing-utils": "3.0.0",
|
"@vercel/routing-utils": "3.0.0",
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export async function initCorepack({
|
|||||||
const pkgManagerName = pkg.packageManager.split('@')[0];
|
const pkgManagerName = pkg.packageManager.split('@')[0];
|
||||||
// We must explicitly call `corepack enable npm` since `corepack enable`
|
// We must explicitly call `corepack enable npm` since `corepack enable`
|
||||||
// doesn't work with npm. See https://github.com/nodejs/corepack/pull/24
|
// doesn't work with npm. See https://github.com/nodejs/corepack/pull/24
|
||||||
// Also, `corepack enable` is too broad and will change the verison of
|
// Also, `corepack enable` is too broad and will change the version of
|
||||||
// yarn & pnpm even though those versions are not specified by the user.
|
// yarn & pnpm even though those versions are not specified by the user.
|
||||||
// See https://github.com/nodejs/corepack#known-good-releases
|
// See https://github.com/nodejs/corepack#known-good-releases
|
||||||
// Finally, we use `--install-directory` so we can cache the result to
|
// Finally, we use `--install-directory` so we can cache the result to
|
||||||
|
|||||||
@@ -978,7 +978,6 @@ export default class DevServer {
|
|||||||
// log address without trailing slash to maintain backwards compatibility
|
// log address without trailing slash to maintain backwards compatibility
|
||||||
addressFormatted = addressFormatted.replace(/\/$/, '');
|
addressFormatted = addressFormatted.replace(/\/$/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.output.ready(`Available at ${link(addressFormatted)}`);
|
this.output.ready(`Available at ${link(addressFormatted)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1451,7 +1450,7 @@ export default class DevServer {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const middlewareBody = await middlewareRes.buffer();
|
const middlewareBody = await middlewareRes.buffer();
|
||||||
console.error('Here?');
|
|
||||||
if (middlewareRes.status === 500 && middlewareBody.byteLength === 0) {
|
if (middlewareRes.status === 500 && middlewareBody.byteLength === 0) {
|
||||||
await this.sendError(
|
await this.sendError(
|
||||||
req,
|
req,
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @vercel/frameworks
|
# @vercel/frameworks
|
||||||
|
|
||||||
|
## 2.0.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Add `bun install` placeholder ([#10492](https://github.com/vercel/vercel/pull/10492))
|
||||||
|
|
||||||
## 2.0.1
|
## 2.0.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vercel/frameworks",
|
"name": "@vercel/frameworks",
|
||||||
"version": "2.0.1",
|
"version": "2.0.2",
|
||||||
"main": "./dist/frameworks.js",
|
"main": "./dist/frameworks.js",
|
||||||
"types": "./dist/frameworks.d.ts",
|
"types": "./dist/frameworks.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
# @vercel/fs-detectors
|
# @vercel/fs-detectors
|
||||||
|
|
||||||
|
## 5.1.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- Add support for bun detection in monorepo ([#10511](https://github.com/vercel/vercel/pull/10511))
|
||||||
|
|
||||||
|
## 5.0.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`ec894bdf7`](https://github.com/vercel/vercel/commit/ec894bdf7f167debded37183f11360756f577f14)]:
|
||||||
|
- @vercel/frameworks@2.0.2
|
||||||
|
|
||||||
## 5.0.2
|
## 5.0.2
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vercel/fs-detectors",
|
"name": "@vercel/fs-detectors",
|
||||||
"version": "5.0.2",
|
"version": "5.1.0",
|
||||||
"description": "Vercel filesystem detectors",
|
"description": "Vercel filesystem detectors",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vercel/error-utils": "2.0.1",
|
"@vercel/error-utils": "2.0.1",
|
||||||
"@vercel/frameworks": "2.0.1",
|
"@vercel/frameworks": "2.0.2",
|
||||||
"@vercel/routing-utils": "3.0.0",
|
"@vercel/routing-utils": "3.0.0",
|
||||||
"glob": "8.0.3",
|
"glob": "8.0.3",
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
|
|||||||
@@ -37,6 +37,24 @@ export const packageManagers: Array<
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'bun',
|
||||||
|
slug: 'bun',
|
||||||
|
logo: '',
|
||||||
|
darkModeLogo: '',
|
||||||
|
detectors: {
|
||||||
|
some: [
|
||||||
|
{
|
||||||
|
path: 'bun.lockb',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'package.json',
|
||||||
|
// Depends on https://github.com/nodejs/corepack/pull/307
|
||||||
|
matchContent: '"packageManager":\\s*"bun@.*"',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'yarn',
|
name: 'yarn',
|
||||||
slug: 'yarn',
|
slug: 'yarn',
|
||||||
|
|||||||
0
packages/fs-detectors/test/fixtures/57-bun-with-lockfile/bun.lockb
vendored
Normal file
0
packages/fs-detectors/test/fixtures/57-bun-with-lockfile/bun.lockb
vendored
Normal file
1
packages/fs-detectors/test/fixtures/57-bun-with-lockfile/package.json
vendored
Normal file
1
packages/fs-detectors/test/fixtures/57-bun-with-lockfile/package.json
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
3
packages/fs-detectors/test/fixtures/58-bun-with-corepack/package.json
vendored
Normal file
3
packages/fs-detectors/test/fixtures/58-bun-with-corepack/package.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"packageManager": "bun@1.0.1"
|
||||||
|
}
|
||||||
@@ -14,6 +14,8 @@ describe('package-managers', () => {
|
|||||||
['54-yarn-with-corepack', 'yarn'],
|
['54-yarn-with-corepack', 'yarn'],
|
||||||
['55-pnpm-with-lockfile', 'pnpm'],
|
['55-pnpm-with-lockfile', 'pnpm'],
|
||||||
['56-pnpm-with-corepack', 'pnpm'],
|
['56-pnpm-with-corepack', 'pnpm'],
|
||||||
|
['57-bun-with-lockfile', 'bun'],
|
||||||
|
['58-bun-with-corepack', 'bun'],
|
||||||
])('with detectFramework', (fixturePath, frameworkSlug) => {
|
])('with detectFramework', (fixturePath, frameworkSlug) => {
|
||||||
const testName = `should detect package manager '${frameworkSlug}' for ${fixturePath}`;
|
const testName = `should detect package manager '${frameworkSlug}' for ${fixturePath}`;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
# @vercel/next
|
# @vercel/next
|
||||||
|
|
||||||
|
## 4.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- missed a prerender for experimentalBypassFor ([#10504](https://github.com/vercel/vercel/pull/10504))
|
||||||
|
|
||||||
|
## 4.0.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- provide `experimentalBypassFor` to Prerender from manifest ([#10497](https://github.com/vercel/vercel/pull/10497))
|
||||||
|
|
||||||
|
- next.js: move app route handlers in their own lambda grouping, add flag to use bundled runtime ([#10485](https://github.com/vercel/vercel/pull/10485))
|
||||||
|
|
||||||
## 4.0.3
|
## 4.0.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vercel/next",
|
"name": "@vercel/next",
|
||||||
"version": "4.0.3",
|
"version": "4.0.5",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./dist/index",
|
"main": "./dist/index",
|
||||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
||||||
|
|||||||
@@ -865,6 +865,7 @@ export type NextPrerenderedRoutes = {
|
|||||||
routeRegex: string;
|
routeRegex: string;
|
||||||
dataRoute: string | null;
|
dataRoute: string | null;
|
||||||
dataRouteRegex: string | null;
|
dataRouteRegex: string | null;
|
||||||
|
experimentalBypassFor?: HasField;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -874,6 +875,7 @@ export type NextPrerenderedRoutes = {
|
|||||||
routeRegex: string;
|
routeRegex: string;
|
||||||
dataRoute: string | null;
|
dataRoute: string | null;
|
||||||
dataRouteRegex: string | null;
|
dataRouteRegex: string | null;
|
||||||
|
experimentalBypassFor?: HasField;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -882,6 +884,7 @@ export type NextPrerenderedRoutes = {
|
|||||||
routeRegex: string;
|
routeRegex: string;
|
||||||
dataRoute: string | null;
|
dataRoute: string | null;
|
||||||
dataRouteRegex: string | null;
|
dataRouteRegex: string | null;
|
||||||
|
experimentalBypassFor?: HasField;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1094,6 +1097,7 @@ export async function getPrerenderManifest(
|
|||||||
fallback: string | false;
|
fallback: string | false;
|
||||||
dataRoute: string | null;
|
dataRoute: string | null;
|
||||||
dataRouteRegex: string | null;
|
dataRouteRegex: string | null;
|
||||||
|
experimentalBypassFor?: HasField;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
preview: {
|
preview: {
|
||||||
@@ -1203,9 +1207,16 @@ export async function getPrerenderManifest(
|
|||||||
lazyRoutes.forEach(lazyRoute => {
|
lazyRoutes.forEach(lazyRoute => {
|
||||||
const { routeRegex, fallback, dataRoute, dataRouteRegex } =
|
const { routeRegex, fallback, dataRoute, dataRouteRegex } =
|
||||||
manifest.dynamicRoutes[lazyRoute];
|
manifest.dynamicRoutes[lazyRoute];
|
||||||
|
let experimentalBypassFor: undefined | HasField;
|
||||||
|
|
||||||
|
if (manifest.version === 4) {
|
||||||
|
experimentalBypassFor =
|
||||||
|
manifest.dynamicRoutes[lazyRoute].experimentalBypassFor;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof fallback === 'string') {
|
if (typeof fallback === 'string') {
|
||||||
ret.fallbackRoutes[lazyRoute] = {
|
ret.fallbackRoutes[lazyRoute] = {
|
||||||
|
experimentalBypassFor,
|
||||||
routeRegex,
|
routeRegex,
|
||||||
fallback,
|
fallback,
|
||||||
dataRoute,
|
dataRoute,
|
||||||
@@ -1213,6 +1224,7 @@ export async function getPrerenderManifest(
|
|||||||
};
|
};
|
||||||
} else if (fallback === null) {
|
} else if (fallback === null) {
|
||||||
ret.blockingFallbackRoutes[lazyRoute] = {
|
ret.blockingFallbackRoutes[lazyRoute] = {
|
||||||
|
experimentalBypassFor,
|
||||||
routeRegex,
|
routeRegex,
|
||||||
dataRoute,
|
dataRoute,
|
||||||
dataRouteRegex,
|
dataRouteRegex,
|
||||||
@@ -1221,6 +1233,7 @@ export async function getPrerenderManifest(
|
|||||||
// Fallback behavior is disabled, all routes would've been provided
|
// Fallback behavior is disabled, all routes would've been provided
|
||||||
// in the top-level `routes` key (`staticRoutes`).
|
// in the top-level `routes` key (`staticRoutes`).
|
||||||
ret.omittedRoutes[lazyRoute] = {
|
ret.omittedRoutes[lazyRoute] = {
|
||||||
|
experimentalBypassFor,
|
||||||
routeRegex,
|
routeRegex,
|
||||||
dataRoute,
|
dataRoute,
|
||||||
dataRouteRegex,
|
dataRouteRegex,
|
||||||
@@ -1931,10 +1944,13 @@ export const onPrerenderRoute =
|
|||||||
}
|
}
|
||||||
srcRoute = null;
|
srcRoute = null;
|
||||||
dataRoute = pr.dataRoute;
|
dataRoute = pr.dataRoute;
|
||||||
|
experimentalBypassFor = pr.experimentalBypassFor;
|
||||||
} else if (isOmitted) {
|
} else if (isOmitted) {
|
||||||
initialRevalidate = false;
|
initialRevalidate = false;
|
||||||
srcRoute = routeKey;
|
srcRoute = routeKey;
|
||||||
dataRoute = prerenderManifest.omittedRoutes[routeKey].dataRoute;
|
dataRoute = prerenderManifest.omittedRoutes[routeKey].dataRoute;
|
||||||
|
experimentalBypassFor =
|
||||||
|
prerenderManifest.omittedRoutes[routeKey].experimentalBypassFor;
|
||||||
} else {
|
} else {
|
||||||
const pr = prerenderManifest.staticRoutes[routeKey];
|
const pr = prerenderManifest.staticRoutes[routeKey];
|
||||||
({
|
({
|
||||||
@@ -2213,6 +2229,7 @@ export const onPrerenderRoute =
|
|||||||
fallback: jsonFsRef,
|
fallback: jsonFsRef,
|
||||||
group: prerenderGroup,
|
group: prerenderGroup,
|
||||||
bypassToken: prerenderManifest.bypassToken,
|
bypassToken: prerenderManifest.bypassToken,
|
||||||
|
experimentalBypassFor,
|
||||||
|
|
||||||
...(isNotFound
|
...(isNotFound
|
||||||
? {
|
? {
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
from http.server import HTTPServer
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
__HANDLER_CLASS_TEMPLATE
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
hostName = "localhost"
|
|
||||||
errorMessage = 'Neither `app` nor `handler` defined in serverless function {}. See: https://vercel.com/docs/functions/serverless-functions/runtimes/python'.format(__file__)
|
|
||||||
|
|
||||||
if 'handler' in dir():
|
|
||||||
appOrHandler = handler
|
|
||||||
|
|
||||||
if 'app' in dir():
|
|
||||||
appOrHandler = app
|
|
||||||
|
|
||||||
if not 'appOrHandler' in dir():
|
|
||||||
raise Exception(errorMessage)
|
|
||||||
|
|
||||||
# Port 0 is unix-speak for 'first available port'
|
|
||||||
httpd = HTTPServer((hostName, 0), appOrHandler)
|
|
||||||
serverPort = httpd.socket.getsockname()[1]
|
|
||||||
|
|
||||||
print("Server started http://%s:%s" % (hostName, serverPort))
|
|
||||||
|
|
||||||
fd = os.open("pipe", os.O_RDWR|os.O_CREAT)
|
|
||||||
with os.fdopen(fd, 'w') as fdfile:
|
|
||||||
fdfile.write(str(serverPort))
|
|
||||||
fdfile.close()
|
|
||||||
|
|
||||||
try:
|
|
||||||
httpd.serve_forever()
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
pass
|
|
||||||
|
|
||||||
httpd.server_close()
|
|
||||||
print("Server stopped.")
|
|
||||||
@@ -20,7 +20,6 @@
|
|||||||
"test-e2e": "pnpm test test/integration-*"
|
"test-e2e": "pnpm test test/integration-*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tootallnate/once": "1.1.2",
|
|
||||||
"@types/execa": "^0.9.0",
|
"@types/execa": "^0.9.0",
|
||||||
"@types/jest": "27.4.1",
|
"@types/jest": "27.4.1",
|
||||||
"@types/node": "14.18.33",
|
"@types/node": "14.18.33",
|
||||||
|
|||||||
@@ -1,37 +1,23 @@
|
|||||||
import { join, dirname, basename } from 'path';
|
import { join, dirname, basename } from 'path';
|
||||||
import { spawn } from 'child_process';
|
|
||||||
import execa from 'execa';
|
import execa from 'execa';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { tmpdir } from 'os';
|
import { promisify } from 'util';
|
||||||
import retry from 'async-retry';
|
const readFile = promisify(fs.readFile);
|
||||||
import { Readable } from 'stream';
|
const writeFile = promisify(fs.writeFile);
|
||||||
import once from '@tootallnate/once';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
GlobOptions,
|
||||||
BuildOptions,
|
BuildOptions,
|
||||||
StartDevServerOptions,
|
|
||||||
StartDevServerResult,
|
|
||||||
glob,
|
|
||||||
download,
|
|
||||||
getWriteableDirectory,
|
getWriteableDirectory,
|
||||||
|
download,
|
||||||
|
glob,
|
||||||
|
createLambda,
|
||||||
shouldServe,
|
shouldServe,
|
||||||
debug,
|
debug,
|
||||||
cloneEnv,
|
NowBuildError,
|
||||||
} from '@vercel/build-utils';
|
} from '@vercel/build-utils';
|
||||||
|
|
||||||
import { readFile, writeFile, mkdirp, remove } from 'fs-extra';
|
|
||||||
|
|
||||||
import { GlobOptions, createLambda, NowBuildError } from '@vercel/build-utils';
|
|
||||||
|
|
||||||
import { installRequirement, installRequirementsFile } from './install';
|
import { installRequirement, installRequirementsFile } from './install';
|
||||||
import { getLatestPythonVersion, getSupportedPythonVersion } from './version';
|
import { getLatestPythonVersion, getSupportedPythonVersion } from './version';
|
||||||
|
|
||||||
const TMP = tmpdir();
|
|
||||||
|
|
||||||
function isReadable(v: any): v is Readable {
|
|
||||||
return v && v.readable === true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function pipenvConvert(cmd: string, srcDir: string) {
|
async function pipenvConvert(cmd: string, srcDir: string) {
|
||||||
debug('Running pipfile2req...');
|
debug('Running pipfile2req...');
|
||||||
try {
|
try {
|
||||||
@@ -218,10 +204,8 @@ export const build = async ({
|
|||||||
: 'node_modules/**',
|
: 'node_modules/**',
|
||||||
};
|
};
|
||||||
|
|
||||||
const files = await glob('**', globOptions);
|
|
||||||
console.log(files);
|
|
||||||
const lambda = await createLambda({
|
const lambda = await createLambda({
|
||||||
files,
|
files: await glob('**', globOptions),
|
||||||
handler: `${handlerPyFilename}.vc_handler`,
|
handler: `${handlerPyFilename}.vc_handler`,
|
||||||
runtime: pythonVersion.runtime,
|
runtime: pythonVersion.runtime,
|
||||||
environment: {},
|
environment: {},
|
||||||
@@ -230,146 +214,6 @@ export const build = async ({
|
|||||||
return { output: lambda };
|
return { output: lambda };
|
||||||
};
|
};
|
||||||
|
|
||||||
interface PortInfo {
|
|
||||||
port: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isPortInfo(v: any): v is PortInfo {
|
|
||||||
return v && typeof v.port === 'number';
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CancelablePromise<T> extends Promise<T> {
|
|
||||||
cancel: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
function waitForPortFile(portFile: string) {
|
|
||||||
const opts = { portFile, canceled: false };
|
|
||||||
const promise = waitForPortFile_(opts) as CancelablePromise<PortInfo | void>;
|
|
||||||
promise.cancel = () => {
|
|
||||||
opts.canceled = true;
|
|
||||||
};
|
|
||||||
return promise;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function waitForPortFile_(opts: {
|
|
||||||
portFile: string;
|
|
||||||
canceled: boolean;
|
|
||||||
}): Promise<PortInfo | void> {
|
|
||||||
while (!opts.canceled) {
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 100));
|
|
||||||
try {
|
|
||||||
const port = Number(await readFile(opts.portFile, 'ascii'));
|
|
||||||
retry(() => remove(opts.portFile)).catch((err: Error) => {
|
|
||||||
console.error(`Could not delete port file: ${opts.portFile}: ${err}`);
|
|
||||||
});
|
|
||||||
return { port };
|
|
||||||
} catch (err: any) {
|
|
||||||
if (err.code !== 'ENOENT') {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function copyDevServer(
|
|
||||||
serverlessFunctionString: string,
|
|
||||||
dest: string
|
|
||||||
): Promise<void> {
|
|
||||||
const serverTemplate = await readFile(
|
|
||||||
join(__dirname, '../dev-server.py'),
|
|
||||||
'utf8'
|
|
||||||
);
|
|
||||||
const patched = serverTemplate.replace(
|
|
||||||
'__HANDLER_CLASS_TEMPLATE',
|
|
||||||
serverlessFunctionString
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log('Writing vercel-dev-server-main.py to ', dest);
|
|
||||||
await writeFile(join(dest, 'vercel-dev-server-main.py'), patched);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function startDevServer(
|
|
||||||
opts: StartDevServerOptions
|
|
||||||
): Promise<StartDevServerResult> {
|
|
||||||
opts.config;
|
|
||||||
|
|
||||||
const { entrypoint, workPath, meta = {} } = opts;
|
|
||||||
const { devCacheDir = join(workPath, '.vercel', 'cache') } = meta;
|
|
||||||
const entrypointDir = dirname(entrypoint);
|
|
||||||
entrypointDir;
|
|
||||||
|
|
||||||
const tmp = join(
|
|
||||||
devCacheDir,
|
|
||||||
'python',
|
|
||||||
Math.random().toString(32).substring(2)
|
|
||||||
);
|
|
||||||
const tmpPackage = join(tmp, entrypointDir);
|
|
||||||
await mkdirp(tmpPackage);
|
|
||||||
|
|
||||||
const serverlessFunctionBody = await readFile(join(workPath, entrypoint));
|
|
||||||
await copyDevServer(serverlessFunctionBody, tmpPackage);
|
|
||||||
|
|
||||||
const portFile = join(
|
|
||||||
TMP,
|
|
||||||
`vercel-dev-port-${Math.random().toString(32).substring(2)}`
|
|
||||||
);
|
|
||||||
|
|
||||||
const env = cloneEnv(process.env, meta.env, {
|
|
||||||
VERCEL_DEV_PORT_FILE: portFile,
|
|
||||||
});
|
|
||||||
|
|
||||||
const executable = 'python3';
|
|
||||||
|
|
||||||
// run the dev server
|
|
||||||
debug(`SPAWNING ${executable} CWD=${tmp}`);
|
|
||||||
const child = spawn(executable, ['api/vercel-dev-server-main.py'], {
|
|
||||||
cwd: tmp,
|
|
||||||
env,
|
|
||||||
stdio: ['ignore', 'inherit', 'inherit', 'pipe'],
|
|
||||||
});
|
|
||||||
|
|
||||||
child.on('close', async () => {
|
|
||||||
try {
|
|
||||||
await retry(() => remove(tmp));
|
|
||||||
} catch (err: any) {
|
|
||||||
console.error(`Could not delete tmp directory: ${tmp}: ${err}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const portPipe = child.stdio[3];
|
|
||||||
if (!isReadable(portPipe)) {
|
|
||||||
throw new Error('File descriptor 3 is not readable');
|
|
||||||
}
|
|
||||||
|
|
||||||
// // `dev-server.python` writes the ephemeral port number to FD 3 to be consumed here
|
|
||||||
const onPort = new Promise<PortInfo>(resolve => {
|
|
||||||
portPipe.setEncoding('utf8');
|
|
||||||
portPipe.once('data', d => {
|
|
||||||
resolve({ port: Number(d) });
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const onPortFile = waitForPortFile(portFile);
|
|
||||||
const onExit = once.spread<[number, string | null]>(child, 'exit');
|
|
||||||
const result = await Promise.race([onPort, onPortFile, onExit]);
|
|
||||||
onExit.cancel();
|
|
||||||
onPortFile.cancel();
|
|
||||||
|
|
||||||
console.log(`Hosting on http://127.0.0.1:${result.port}`);
|
|
||||||
if (isPortInfo(result)) {
|
|
||||||
return {
|
|
||||||
port: result.port,
|
|
||||||
pid: child.pid,
|
|
||||||
};
|
|
||||||
} else if (Array.isArray(result)) {
|
|
||||||
// Got "exit" event from child process
|
|
||||||
const [exitCode, signal] = result;
|
|
||||||
const reason = signal ? `"${signal}" signal` : `exit code ${exitCode}`;
|
|
||||||
throw new Error(`\`python3 ${entrypoint}\` failed with ${reason}`);
|
|
||||||
} else {
|
|
||||||
throw new Error(`Unexpected result type: ${typeof result}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export { shouldServe };
|
export { shouldServe };
|
||||||
|
|
||||||
// internal only - expect breaking changes if other packages depend on these exports
|
// internal only - expect breaking changes if other packages depend on these exports
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @vercel/remix-builder
|
# @vercel/remix-builder
|
||||||
|
|
||||||
|
## 2.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Fix usage with `bun install` ([#10489](https://github.com/vercel/vercel/pull/10489))
|
||||||
|
|
||||||
## 2.0.4
|
## 2.0.4
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vercel/remix-builder",
|
"name": "@vercel/remix-builder",
|
||||||
"version": "2.0.4",
|
"version": "2.0.5",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"homepage": "https://vercel.com/docs",
|
"homepage": "https://vercel.com/docs",
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @vercel/static-build
|
# @vercel/static-build
|
||||||
|
|
||||||
|
## 2.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Add support for bun detection in monorepo ([#10511](https://github.com/vercel/vercel/pull/10511))
|
||||||
|
|
||||||
## 2.0.5
|
## 2.0.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vercel/static-build",
|
"name": "@vercel/static-build",
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./dist/index",
|
"main": "./dist/index",
|
||||||
"homepage": "https://vercel.com/docs/build-step",
|
"homepage": "https://vercel.com/docs/build-step",
|
||||||
@@ -34,8 +34,8 @@
|
|||||||
"@types/semver": "7.3.13",
|
"@types/semver": "7.3.13",
|
||||||
"@vercel/build-utils": "7.2.0",
|
"@vercel/build-utils": "7.2.0",
|
||||||
"@vercel/error-utils": "2.0.1",
|
"@vercel/error-utils": "2.0.1",
|
||||||
"@vercel/frameworks": "2.0.1",
|
"@vercel/frameworks": "2.0.2",
|
||||||
"@vercel/fs-detectors": "5.0.2",
|
"@vercel/fs-detectors": "5.1.0",
|
||||||
"@vercel/ncc": "0.24.0",
|
"@vercel/ncc": "0.24.0",
|
||||||
"@vercel/routing-utils": "3.0.0",
|
"@vercel/routing-utils": "3.0.0",
|
||||||
"@vercel/static-config": "3.0.0",
|
"@vercel/static-config": "3.0.0",
|
||||||
|
|||||||
21
pnpm-lock.yaml
generated
21
pnpm-lock.yaml
generated
@@ -132,7 +132,7 @@ importers:
|
|||||||
specifier: 27.4.1
|
specifier: 27.4.1
|
||||||
version: 27.4.1
|
version: 27.4.1
|
||||||
'@vercel/frameworks':
|
'@vercel/frameworks':
|
||||||
specifier: 2.0.1
|
specifier: 2.0.2
|
||||||
version: link:../packages/frameworks
|
version: link:../packages/frameworks
|
||||||
|
|
||||||
internals/constants:
|
internals/constants:
|
||||||
@@ -322,7 +322,7 @@ importers:
|
|||||||
specifier: 1.0.1
|
specifier: 1.0.1
|
||||||
version: link:../hydrogen
|
version: link:../hydrogen
|
||||||
'@vercel/next':
|
'@vercel/next':
|
||||||
specifier: 4.0.3
|
specifier: 4.0.5
|
||||||
version: link:../next
|
version: link:../next
|
||||||
'@vercel/node':
|
'@vercel/node':
|
||||||
specifier: 3.0.5
|
specifier: 3.0.5
|
||||||
@@ -334,13 +334,13 @@ importers:
|
|||||||
specifier: 2.0.2
|
specifier: 2.0.2
|
||||||
version: link:../redwood
|
version: link:../redwood
|
||||||
'@vercel/remix-builder':
|
'@vercel/remix-builder':
|
||||||
specifier: 2.0.4
|
specifier: 2.0.5
|
||||||
version: link:../remix
|
version: link:../remix
|
||||||
'@vercel/ruby':
|
'@vercel/ruby':
|
||||||
specifier: 2.0.2
|
specifier: 2.0.2
|
||||||
version: link:../ruby
|
version: link:../ruby
|
||||||
'@vercel/static-build':
|
'@vercel/static-build':
|
||||||
specifier: 2.0.5
|
specifier: 2.0.6
|
||||||
version: link:../static-build
|
version: link:../static-build
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@alex_neo/jest-expect-message':
|
'@alex_neo/jest-expect-message':
|
||||||
@@ -482,10 +482,10 @@ importers:
|
|||||||
specifier: 2.0.1
|
specifier: 2.0.1
|
||||||
version: link:../error-utils
|
version: link:../error-utils
|
||||||
'@vercel/frameworks':
|
'@vercel/frameworks':
|
||||||
specifier: 2.0.1
|
specifier: 2.0.2
|
||||||
version: link:../frameworks
|
version: link:../frameworks
|
||||||
'@vercel/fs-detectors':
|
'@vercel/fs-detectors':
|
||||||
specifier: 5.0.2
|
specifier: 5.1.0
|
||||||
version: link:../fs-detectors
|
version: link:../fs-detectors
|
||||||
'@vercel/fun':
|
'@vercel/fun':
|
||||||
specifier: 1.1.0
|
specifier: 1.1.0
|
||||||
@@ -898,7 +898,7 @@ importers:
|
|||||||
specifier: 2.0.1
|
specifier: 2.0.1
|
||||||
version: link:../error-utils
|
version: link:../error-utils
|
||||||
'@vercel/frameworks':
|
'@vercel/frameworks':
|
||||||
specifier: 2.0.1
|
specifier: 2.0.2
|
||||||
version: link:../frameworks
|
version: link:../frameworks
|
||||||
'@vercel/routing-utils':
|
'@vercel/routing-utils':
|
||||||
specifier: 3.0.0
|
specifier: 3.0.0
|
||||||
@@ -1337,9 +1337,6 @@ importers:
|
|||||||
|
|
||||||
packages/python:
|
packages/python:
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@tootallnate/once':
|
|
||||||
specifier: 1.1.2
|
|
||||||
version: 1.1.2
|
|
||||||
'@types/execa':
|
'@types/execa':
|
||||||
specifier: ^0.9.0
|
specifier: ^0.9.0
|
||||||
version: 0.9.0
|
version: 0.9.0
|
||||||
@@ -1526,10 +1523,10 @@ importers:
|
|||||||
specifier: 2.0.1
|
specifier: 2.0.1
|
||||||
version: link:../error-utils
|
version: link:../error-utils
|
||||||
'@vercel/frameworks':
|
'@vercel/frameworks':
|
||||||
specifier: 2.0.1
|
specifier: 2.0.2
|
||||||
version: link:../frameworks
|
version: link:../frameworks
|
||||||
'@vercel/fs-detectors':
|
'@vercel/fs-detectors':
|
||||||
specifier: 5.0.2
|
specifier: 5.1.0
|
||||||
version: link:../fs-detectors
|
version: link:../fs-detectors
|
||||||
'@vercel/ncc':
|
'@vercel/ncc':
|
||||||
specifier: 0.24.0
|
specifier: 0.24.0
|
||||||
|
|||||||
30
utils/determine-turbo-hit-or-miss.js
vendored
Normal file
30
utils/determine-turbo-hit-or-miss.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
const fs = require('fs-extra');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const rootDir = path.join(__dirname, '..');
|
||||||
|
const turboRunDir = path.join(rootDir, '.turbo/runs');
|
||||||
|
const turboRunFiles = await fs.readdir(turboRunDir);
|
||||||
|
|
||||||
|
turboRunFiles.forEach(async fileName => {
|
||||||
|
const runFile = path.join(turboRunDir, fileName);
|
||||||
|
const runData = await fs.readJson(runFile);
|
||||||
|
const tasksReports = runData.tasks || [];
|
||||||
|
|
||||||
|
const missCount = tasksReports.reduce((total, taskData) => {
|
||||||
|
if (taskData.cache.status === 'MISS') {
|
||||||
|
return total + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return total;
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
console.log(missCount);
|
||||||
|
return process.exit(missCount);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch(err => {
|
||||||
|
console.log('error determining Turbo HIT or MISS', err);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user