Compare commits

..

11 Commits

Author SHA1 Message Date
Vercel Release Bot
eb40c4c4a0 Version Packages (#10514)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/fs-detectors@5.1.0

### Minor Changes

- Add support for bun detection in monorepo
([#10511](https://github.com/vercel/vercel/pull/10511))

## vercel@32.2.4

### Patch Changes

- Add support for bun detection in monorepo
([#10511](https://github.com/vercel/vercel/pull/10511))

- Updated dependencies
\[[`1b6f3a0f6`](1b6f3a0f65)]:
    -   @vercel/static-build@2.0.6

## @vercel/static-build@2.0.6

### Patch Changes

- Add support for bun detection in monorepo
([#10511](https://github.com/vercel/vercel/pull/10511))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-15 15:13:54 -04:00
Nathan Rajlich
c90ee12b17 Update bun changeset to bump static-build + CLI (#10516)
Also reverts https://github.com/vercel/vercel/pull/10515 since it didn't
work the way we were hoping.
2023-09-15 16:06:32 -03:00
Nathan Rajlich
78be0200b4 Enable changesets experimental updateInternalDependents: 'always' config (#10515)
From the [sounds of
it](https://github.com/changesets/changesets/blob/main/docs/experimental-options.md#updateinternaldependents-type-out-of-range--always),
setting this config value to "always" will make it so that a patch
release will happen for a package that depends on another package which
is being bumped. This would normally happen anyways, but does not happen
when a dependency is a `devDependency` rather than a `dependency` (which
happens for the Builders and CLI, since those packages get bundled and
thus have their deps listed as devDependencies).
2023-09-15 15:54:47 -03:00
Steven
1b6f3a0f65 [fs-detectors] Add support for bun detection in monorepo (#10511)
E2E test looks like:

```sh
bunx create-turbo@canary
cd my-turborepo
gh repo create
vc link --repo
vc deploy
```
2023-09-15 14:13:26 -04:00
Trek Glowacki
eceb15ace9 Revert skipping datadog reports (#10513)
Revert
[.github/workflows/test.yml](https://github.com/vercel/vercel/pull/10513/files#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88)
to an earlier version.
2023-09-15 13:49:24 -04:00
Vercel Release Bot
fa3f701e05 Version Packages (#10505)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-14 16:06:33 -05:00
Trek Glowacki
9953fc765f Complete the error message (#10509) 2023-09-14 11:39:53 -05:00
Trek Glowacki
29ea1af971 Skip DataDog reporting if Turbo cache indicates the uploaded files would be identical (#10501) 2023-09-14 10:47:20 -05:00
Zack Tanner
083aad448e [next] missed a prerender for experimentalBypassFor (#10504)
Missed this in https://github.com/vercel/vercel/pull/10497
2023-09-14 01:19:13 +00:00
Vercel Release Bot
314a105ba1 Version Packages (#10493)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-13 17:15:29 -05:00
Ikko Eltociear Ashimine
1abda9ca87 [cli] Fix typo in corepack.ts (#10499)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-09-13 08:26:51 -05:00
32 changed files with 176 additions and 257 deletions

View File

@@ -1,2 +0,0 @@
---
---

View File

@@ -1,5 +0,0 @@
---
"@vercel/next": patch
---
provide `experimentalBypassFor` to Prerender from manifest

View File

@@ -1,5 +0,0 @@
---
"@vercel/next": patch
---
next.js: move app route handlers in their own lambda grouping, add flag to use bundled runtime

View File

@@ -1,5 +0,0 @@
---
'@vercel/remix-builder': patch
---
Fix usage with `bun install`

View File

@@ -1,5 +0,0 @@
---
"@vercel/frameworks": patch
---
Add `bun install` placeholder

View File

@@ -83,7 +83,7 @@ jobs:
env:
FORCE_COLOR: '1'
- 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
env:
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_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
FORCE_COLOR: '1'
- name: fetch ssl certificate after tests (linux, os x)
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: always()
run: 'npx @datadog/datadog-ci@2.18.1 junit upload --service vercel-cli .junit-reports'

View File

@@ -9,7 +9,7 @@
},
"devDependencies": {
"@types/jest": "27.4.1",
"@vercel/frameworks": "2.0.1"
"@vercel/frameworks": "2.0.2"
},
"version": null
}

View File

@@ -1,5 +1,29 @@
# 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
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "32.2.1",
"version": "32.2.4",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -34,13 +34,13 @@
"@vercel/build-utils": "7.2.0",
"@vercel/go": "3.0.1",
"@vercel/hydrogen": "1.0.1",
"@vercel/next": "4.0.3",
"@vercel/next": "4.0.5",
"@vercel/node": "3.0.5",
"@vercel/python": "4.0.1",
"@vercel/redwood": "2.0.2",
"@vercel/remix-builder": "2.0.4",
"@vercel/remix-builder": "2.0.5",
"@vercel/ruby": "2.0.2",
"@vercel/static-build": "2.0.5"
"@vercel/static-build": "2.0.6"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",
@@ -89,8 +89,8 @@
"@vercel-internals/types": "1.0.10",
"@vercel/client": "13.0.3",
"@vercel/error-utils": "2.0.1",
"@vercel/frameworks": "2.0.1",
"@vercel/fs-detectors": "5.0.2",
"@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",

View File

@@ -41,7 +41,7 @@ export async function initCorepack({
const pkgManagerName = pkg.packageManager.split('@')[0];
// We must explicitly call `corepack enable npm` since `corepack enable`
// 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.
// See https://github.com/nodejs/corepack#known-good-releases
// Finally, we use `--install-directory` so we can cache the result to

View File

@@ -978,7 +978,6 @@ export default class DevServer {
// log address without trailing slash to maintain backwards compatibility
addressFormatted = addressFormatted.replace(/\/$/, '');
}
this.output.ready(`Available at ${link(addressFormatted)}`);
}
@@ -1451,7 +1450,7 @@ export default class DevServer {
);
const middlewareBody = await middlewareRes.buffer();
console.error('Here?');
if (middlewareRes.status === 500 && middlewareBody.byteLength === 0) {
await this.sendError(
req,

View File

@@ -1,5 +1,11 @@
# @vercel/frameworks
## 2.0.2
### Patch Changes
- Add `bun install` placeholder ([#10492](https://github.com/vercel/vercel/pull/10492))
## 2.0.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/frameworks",
"version": "2.0.1",
"version": "2.0.2",
"main": "./dist/frameworks.js",
"types": "./dist/frameworks.d.ts",
"files": [

View File

@@ -1,5 +1,18 @@
# @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
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/fs-detectors",
"version": "5.0.2",
"version": "5.1.0",
"description": "Vercel filesystem detectors",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -21,7 +21,7 @@
},
"dependencies": {
"@vercel/error-utils": "2.0.1",
"@vercel/frameworks": "2.0.1",
"@vercel/frameworks": "2.0.2",
"@vercel/routing-utils": "3.0.0",
"glob": "8.0.3",
"js-yaml": "4.1.0",

View File

@@ -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',
slug: 'yarn',

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1,3 @@
{
"packageManager": "bun@1.0.1"
}

View File

@@ -14,6 +14,8 @@ describe('package-managers', () => {
['54-yarn-with-corepack', 'yarn'],
['55-pnpm-with-lockfile', 'pnpm'],
['56-pnpm-with-corepack', 'pnpm'],
['57-bun-with-lockfile', 'bun'],
['58-bun-with-corepack', 'bun'],
])('with detectFramework', (fixturePath, frameworkSlug) => {
const testName = `should detect package manager '${frameworkSlug}' for ${fixturePath}`;

View File

@@ -1,5 +1,19 @@
# @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
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "4.0.3",
"version": "4.0.5",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",

View File

@@ -865,6 +865,7 @@ export type NextPrerenderedRoutes = {
routeRegex: string;
dataRoute: string | null;
dataRouteRegex: string | null;
experimentalBypassFor?: HasField;
};
};
@@ -874,6 +875,7 @@ export type NextPrerenderedRoutes = {
routeRegex: string;
dataRoute: string | null;
dataRouteRegex: string | null;
experimentalBypassFor?: HasField;
};
};
@@ -882,6 +884,7 @@ export type NextPrerenderedRoutes = {
routeRegex: string;
dataRoute: string | null;
dataRouteRegex: string | null;
experimentalBypassFor?: HasField;
};
};
@@ -1094,6 +1097,7 @@ export async function getPrerenderManifest(
fallback: string | false;
dataRoute: string | null;
dataRouteRegex: string | null;
experimentalBypassFor?: HasField;
};
};
preview: {
@@ -1203,9 +1207,16 @@ export async function getPrerenderManifest(
lazyRoutes.forEach(lazyRoute => {
const { routeRegex, fallback, dataRoute, dataRouteRegex } =
manifest.dynamicRoutes[lazyRoute];
let experimentalBypassFor: undefined | HasField;
if (manifest.version === 4) {
experimentalBypassFor =
manifest.dynamicRoutes[lazyRoute].experimentalBypassFor;
}
if (typeof fallback === 'string') {
ret.fallbackRoutes[lazyRoute] = {
experimentalBypassFor,
routeRegex,
fallback,
dataRoute,
@@ -1213,6 +1224,7 @@ export async function getPrerenderManifest(
};
} else if (fallback === null) {
ret.blockingFallbackRoutes[lazyRoute] = {
experimentalBypassFor,
routeRegex,
dataRoute,
dataRouteRegex,
@@ -1221,6 +1233,7 @@ export async function getPrerenderManifest(
// Fallback behavior is disabled, all routes would've been provided
// in the top-level `routes` key (`staticRoutes`).
ret.omittedRoutes[lazyRoute] = {
experimentalBypassFor,
routeRegex,
dataRoute,
dataRouteRegex,
@@ -1931,10 +1944,13 @@ export const onPrerenderRoute =
}
srcRoute = null;
dataRoute = pr.dataRoute;
experimentalBypassFor = pr.experimentalBypassFor;
} else if (isOmitted) {
initialRevalidate = false;
srcRoute = routeKey;
dataRoute = prerenderManifest.omittedRoutes[routeKey].dataRoute;
experimentalBypassFor =
prerenderManifest.omittedRoutes[routeKey].experimentalBypassFor;
} else {
const pr = prerenderManifest.staticRoutes[routeKey];
({
@@ -2213,6 +2229,7 @@ export const onPrerenderRoute =
fallback: jsonFsRef,
group: prerenderGroup,
bypassToken: prerenderManifest.bypassToken,
experimentalBypassFor,
...(isNotFound
? {

View File

@@ -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.")

View File

@@ -20,7 +20,6 @@
"test-e2e": "pnpm test test/integration-*"
},
"devDependencies": {
"@tootallnate/once": "1.1.2",
"@types/execa": "^0.9.0",
"@types/jest": "27.4.1",
"@types/node": "14.18.33",

View File

@@ -1,37 +1,23 @@
import { join, dirname, basename } from 'path';
import { spawn } from 'child_process';
import execa from 'execa';
import fs from 'fs';
import { tmpdir } from 'os';
import retry from 'async-retry';
import { Readable } from 'stream';
import once from '@tootallnate/once';
import { promisify } from 'util';
const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
import {
GlobOptions,
BuildOptions,
StartDevServerOptions,
StartDevServerResult,
glob,
download,
getWriteableDirectory,
download,
glob,
createLambda,
shouldServe,
debug,
cloneEnv,
NowBuildError,
} 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 { 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) {
debug('Running pipfile2req...');
try {
@@ -218,10 +204,8 @@ export const build = async ({
: 'node_modules/**',
};
const files = await glob('**', globOptions);
console.log(files);
const lambda = await createLambda({
files,
files: await glob('**', globOptions),
handler: `${handlerPyFilename}.vc_handler`,
runtime: pythonVersion.runtime,
environment: {},
@@ -230,146 +214,6 @@ export const build = async ({
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 };
// internal only - expect breaking changes if other packages depend on these exports

View File

@@ -1,5 +1,11 @@
# @vercel/remix-builder
## 2.0.5
### Patch Changes
- Fix usage with `bun install` ([#10489](https://github.com/vercel/vercel/pull/10489))
## 2.0.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix-builder",
"version": "2.0.4",
"version": "2.0.5",
"license": "Apache-2.0",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",

View File

@@ -1,5 +1,11 @@
# @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
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/static-build",
"version": "2.0.5",
"version": "2.0.6",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/build-step",
@@ -34,8 +34,8 @@
"@types/semver": "7.3.13",
"@vercel/build-utils": "7.2.0",
"@vercel/error-utils": "2.0.1",
"@vercel/frameworks": "2.0.1",
"@vercel/fs-detectors": "5.0.2",
"@vercel/frameworks": "2.0.2",
"@vercel/fs-detectors": "5.1.0",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "3.0.0",
"@vercel/static-config": "3.0.0",

21
pnpm-lock.yaml generated
View File

@@ -132,7 +132,7 @@ importers:
specifier: 27.4.1
version: 27.4.1
'@vercel/frameworks':
specifier: 2.0.1
specifier: 2.0.2
version: link:../packages/frameworks
internals/constants:
@@ -322,7 +322,7 @@ importers:
specifier: 1.0.1
version: link:../hydrogen
'@vercel/next':
specifier: 4.0.3
specifier: 4.0.5
version: link:../next
'@vercel/node':
specifier: 3.0.5
@@ -334,13 +334,13 @@ importers:
specifier: 2.0.2
version: link:../redwood
'@vercel/remix-builder':
specifier: 2.0.4
specifier: 2.0.5
version: link:../remix
'@vercel/ruby':
specifier: 2.0.2
version: link:../ruby
'@vercel/static-build':
specifier: 2.0.5
specifier: 2.0.6
version: link:../static-build
devDependencies:
'@alex_neo/jest-expect-message':
@@ -482,10 +482,10 @@ importers:
specifier: 2.0.1
version: link:../error-utils
'@vercel/frameworks':
specifier: 2.0.1
specifier: 2.0.2
version: link:../frameworks
'@vercel/fs-detectors':
specifier: 5.0.2
specifier: 5.1.0
version: link:../fs-detectors
'@vercel/fun':
specifier: 1.1.0
@@ -898,7 +898,7 @@ importers:
specifier: 2.0.1
version: link:../error-utils
'@vercel/frameworks':
specifier: 2.0.1
specifier: 2.0.2
version: link:../frameworks
'@vercel/routing-utils':
specifier: 3.0.0
@@ -1337,9 +1337,6 @@ importers:
packages/python:
devDependencies:
'@tootallnate/once':
specifier: 1.1.2
version: 1.1.2
'@types/execa':
specifier: ^0.9.0
version: 0.9.0
@@ -1526,10 +1523,10 @@ importers:
specifier: 2.0.1
version: link:../error-utils
'@vercel/frameworks':
specifier: 2.0.1
specifier: 2.0.2
version: link:../frameworks
'@vercel/fs-detectors':
specifier: 5.0.2
specifier: 5.1.0
version: link:../fs-detectors
'@vercel/ncc':
specifier: 0.24.0

30
utils/determine-turbo-hit-or-miss.js vendored Normal file
View 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);
});