Compare commits

..

10 Commits

Author SHA1 Message Date
Steven
fc0e6872e5 Publish Stable
- vercel@28.10.3
 - @vercel/frameworks@1.1.17
 - @vercel/fs-detectors@3.6.0
 - @vercel/next@3.3.7
 - @vercel/node-bridge@3.1.3
 - @vercel/node@2.8.4
 - @vercel/redwood@1.0.43
 - @vercel/remix@1.1.5
 - @vercel/static-build@1.0.46
2023-01-05 16:27:06 -05:00
Ethan Arrowood
d800d9cd68 [fs-detectors][cli] move monorepo default setting code to fs-detectors (#9101)
Makes the monorepo default setting logic reusable by API and includes a `commandForIgnoringBuildStep` setting for Turbo projects.
2023-01-05 21:16:03 +00:00
Steven
9c8f6aa70f [tests] Replace ::set-output with >> $GITHUB_OUTPUT in gh actions (#9170)
This PR fixes a deprecation warning we have been seeing in GitHub Actions for a few months. See [example](https://github.com/vercel/vercel/actions/runs/3849500423/jobs/6558559310#step:7:453).

> Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-01-05 20:37:57 +00:00
Steven
feceeef7b7 [node] Fix ESM output from TS source (#7954)
- Depends on https://github.com/vercel/nft/pull/297
- Fixes #7908 
- Fixes #6194 

This PR bumps `@vercel/nft` (for production) and `ts-node` (for
development) to fix ESM behavior.

Because Node.js cannot dynamically set [loader
hooks](https://nodejs.org/docs/latest-v18.x/api/esm.html#loaders) once a
process is started, I had to change the way `ts-node` is registered by
using environment variables such as `NODE_OPTIONS`. Most of the logic
for TS and ESM was pulled out of the child process and into the parent.

Co-authored-by: Ethan Arrowood <ethan.arrowood@vercel.com>
2023-01-05 15:25:32 -05:00
Steven
6215c516e7 [tests] Turbo should use full logs when listing tests (#9172)
In PR #9168, the output mode was changed so it doesnt print logs when the result is cached. However, we need the output for the dry run where we list all relevant tests. So the flag was added to that one script only to avoid this skipped problem:

![skipped](https://user-images.githubusercontent.com/229881/210870102-a597d1b9-f007-41ba-8e1d-f53aa765b740.png)
2023-01-05 15:12:59 -05:00
Steven
ada1ad3840 [tests] Bump turbo and update turbo.json (#9168)
This PR does a few things
- Revert https://github.com/vercel/vercel/pull/8264 because it was causing some tests not to run (for example, modifying `@vercel/build-utils` should run tests for all packages)
- Bump `turbo` to version 1.6.3
- Update [`outputMode`](https://turbo.build/repo/docs/reference/configuration#outputmode) to new-only
- Update [`dependsOn`](https://turbo.build/repo/docs/reference/configuration#dependson) to `^` to ensure all dependencies are considered
2023-01-05 18:02:05 +00:00
Sean Massa
fe184618f4 [frameworks] fix blitzjs detection (#9166)
The framework detectors do not support this syntax:

```
path: 'blitz.config.(js|ts)',
```

This PR fixes framework detection for "Blitz.js (Legacy)".
2023-01-05 16:29:39 +00:00
Kiko Beats
c9c5e148f7 [tests] use assert.strictEqual (#9162)
assert.equal is deprecated
2023-01-04 13:23:01 +00:00
Andy McKay
8115582e25 [frameworks] Fix vitepress screenshot (#9158)
When you are on this page, creating a project the image here is the screenshot of an example project in the `Vercel Examples` enterprise. However that was not working:

<img width="1060" alt="Screen Shot 2023-01-03 at 2 26 58 PM" src="https://user-images.githubusercontent.com/74699/210451850-8208f42b-de43-4ac4-a1fe-b90d88fe86d8.png">

It does this by hitting the API. In this case the problem is that there is a trailing slash on the domain name, causing the API to fail:

<img width="477" alt="Screen Shot 2023-01-03 at 2 29 48 PM" src="https://user-images.githubusercontent.com/74699/210452032-2e32ae61-df29-48b4-b79f-93f5bcf299d3.png">

So this removes that trailing, but I'll see if I can tighten this up as well so in the future it doesn't matter if there is a `/` there.

FYI: this passes unit tests in framework, because it passes the URL in demo through to `URL` and grabs the hostname, which strips out the `protocol` and trailing `/`. Perhaps we should do the same on front.
2023-01-04 04:11:08 +00:00
JJ Kasper
3e3f92e6d3 [next] Lock test fixture dependency (#9159)
This locks the test dependency down for this fixture since the version of Next.js doesn't support the `node:` prefixed imports added in the latest version of `isomorphic-unfetch`. 

Fixes: https://github.com/vercel/vercel/actions/runs/3833489157/jobs/6525280122#step:9:6013
2023-01-04 01:26:50 +00:00
57 changed files with 746 additions and 413 deletions

View File

@@ -27,9 +27,9 @@ jobs:
tag="$(git describe --tags --exact-match 2> /dev/null || :)"
if [[ -z "$tag" ]];
then
echo "::set-output name=IS_RELEASE::false"
echo "IS_RELEASE=false" >> $GITHUB_OUTPUT
else
echo "::set-output name=IS_RELEASE::true"
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
fi
- name: Setup Go
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}

View File

@@ -47,7 +47,7 @@ jobs:
TESTS_ARRAY=$(node utils/chunk-tests.js $SCRIPT_NAME)
echo "Files to test:"
echo "$TESTS_ARRAY"
echo "::set-output name=tests::$TESTS_ARRAY"
echo "tests=$TESTS_ARRAY" >> $GITHUB_OUTPUT
- uses: patrickedqvist/wait-for-vercel-preview@ae34b392ef30297f2b672f9afb3c329bde9bd487
id: waitForTarball
with:

View File

@@ -36,7 +36,7 @@
"prettier": "2.6.2",
"ts-eager": "2.0.2",
"ts-jest": "28.0.5",
"turbo": "1.4.7"
"turbo": "1.6.3"
},
"scripts": {
"lerna": "lerna",

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "28.10.2",
"version": "28.10.3",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -44,13 +44,13 @@
"@vercel/build-utils": "5.7.3",
"@vercel/go": "2.2.22",
"@vercel/hydrogen": "0.0.36",
"@vercel/next": "3.3.6",
"@vercel/node": "2.8.3",
"@vercel/next": "3.3.7",
"@vercel/node": "2.8.4",
"@vercel/python": "3.1.32",
"@vercel/redwood": "1.0.42",
"@vercel/remix": "1.1.4",
"@vercel/redwood": "1.0.43",
"@vercel/remix": "1.1.5",
"@vercel/ruby": "1.3.48",
"@vercel/static-build": "1.0.45",
"@vercel/static-build": "1.0.46",
"update-notifier": "5.1.0"
},
"devDependencies": {
@@ -95,8 +95,8 @@
"@types/yauzl-promise": "2.1.0",
"@vercel/client": "12.2.24",
"@vercel/error-utils": "1.0.3",
"@vercel/frameworks": "1.1.16",
"@vercel/fs-detectors": "3.5.7",
"@vercel/frameworks": "1.1.17",
"@vercel/fs-detectors": "3.6.0",
"@vercel/fun": "1.0.4",
"@vercel/ncc": "0.24.0",
"@zeit/source-map-support": "0.6.2",

View File

@@ -1,40 +1,28 @@
import fs from 'fs-extra';
import { join, relative, basename } from 'path';
import { relative, basename } from 'path';
import {
detectFramework,
monorepoManagers,
LocalFileSystemDetector,
packageManagers,
getMonorepoDefaultSettings,
MissingBuildPipeline,
MissingBuildTarget,
} from '@vercel/fs-detectors';
import { ProjectLinkAndSettings } from '../projects/project-settings';
import { Output } from '../output';
import title from 'title';
import JSON5 from 'json5';
import { PartialProjectSettings } from '../input/edit-project-settings';
export async function setMonorepoDefaultSettings(
cwd: string,
workPath: string,
projectSettings: ProjectLinkAndSettings['settings'],
projectSettings: ProjectLinkAndSettings['settings'] & PartialProjectSettings,
output: Output
) {
const localFileSystem = new LocalFileSystemDetector(cwd);
const [monorepoManager, packageManager] = await Promise.all([
detectFramework({
fs: localFileSystem,
frameworkList: monorepoManagers,
}),
detectFramework({
fs: localFileSystem,
frameworkList: packageManagers,
}),
]);
const projectName = basename(workPath);
const relativeToRoot = relative(workPath, cwd);
const setCommand = (
command: 'buildCommand' | 'installCommand',
command: 'buildCommand' | 'installCommand' | 'commandForIgnoringBuildStep',
value: string
) => {
if (projectSettings[command]) {
@@ -46,114 +34,43 @@ export async function setMonorepoDefaultSettings(
}
};
if (monorepoManager) {
output.log(
`Automatically detected ${title(
monorepoManager
)} monorepo manager. Attempting to assign default \`buildCommand\` and \`installCommand\` settings.`
try {
const result = await getMonorepoDefaultSettings(
projectName,
relative(cwd, workPath),
relativeToRoot,
localFileSystem
);
}
if (monorepoManager === 'turbo') {
const [turboJSONBuf, packageJSONBuf] = await Promise.all([
fs.readFile(join(cwd, 'turbo.json')).catch(() => null),
fs.readFile(join(cwd, 'package.json')).catch(() => null),
]);
let hasBuildPipeline = false;
if (turboJSONBuf !== null) {
const turboJSON = JSON5.parse(turboJSONBuf.toString('utf-8'));
if (turboJSON?.pipeline?.build) {
hasBuildPipeline = true;
}
} else if (packageJSONBuf !== null) {
const packageJSON = JSON.parse(packageJSONBuf.toString('utf-8'));
if (packageJSON?.turbo?.pipeline?.build) {
hasBuildPipeline = true;
}
}
if (!hasBuildPipeline) {
output.warn(
'Missing required `build` pipeline in turbo.json or package.json Turbo configuration. Skipping automatic setting assignment.'
);
if (result === null) {
return;
}
setCommand(
'buildCommand',
`cd ${relativeToRoot} && npx turbo run build --filter={./${relative(
cwd,
workPath
)}}...`
);
setCommand(
'installCommand',
`cd ${relativeToRoot} && ${packageManager} install`
);
} else if (monorepoManager === 'nx') {
// No ENOENT handling required here since conditional wouldn't be `true` unless `nx.json` was found.
const nxJSON = JSON5.parse(fs.readFileSync(join(cwd, 'nx.json'), 'utf-8'));
const { monorepoManager, ...commands } = result;
if (!nxJSON?.targetDefaults?.build) {
output.log(
'Missing default `build` target in nx.json. Checking for project level Nx configuration...'
output.log(
`Automatically detected ${title(
monorepoManager
)} monorepo manager. Attempting to assign default settings.`
);
setCommand('buildCommand', commands.buildCommand);
setCommand('installCommand', commands.installCommand);
if (commands.commandForIgnoringBuildStep) {
setCommand(
'commandForIgnoringBuildStep',
commands.commandForIgnoringBuildStep
);
const [projectJSONBuf, packageJSONBuf] = await Promise.all([
fs.readFile(join(workPath, 'project.json')).catch(() => null),
fs.readFile(join(workPath, 'package.json')).catch(() => null),
]);
let hasBuildTarget = false;
if (projectJSONBuf) {
output.log('Found project.json Nx configuration.');
const projectJSON = JSON5.parse(projectJSONBuf.toString('utf-8'));
if (projectJSON?.targets?.build) {
hasBuildTarget = true;
}
}
if (packageJSONBuf) {
const packageJSON = JSON5.parse(packageJSONBuf.toString('utf-8'));
if (packageJSON?.nx) {
output.log('Found package.json Nx configuration.');
if (packageJSON.nx.targets?.build) {
hasBuildTarget = true;
}
}
}
if (!hasBuildTarget) {
output.warn(
'Missing required `build` target in either project.json or package.json Nx configuration. Skipping automatic setting assignment.'
);
return;
}
}
} catch (error) {
if (
error instanceof MissingBuildPipeline ||
error instanceof MissingBuildTarget
) {
output.warn(`${error.message} Skipping automatic setting assignment.`);
return;
}
setCommand(
'buildCommand',
`cd ${relativeToRoot} && npx nx build ${projectName}`
);
setCommand(
'installCommand',
`cd ${relativeToRoot} && ${packageManager} install`
);
throw error;
}
// TODO (@Ethan-Arrowood) - Revisit rush support when we can test it better
/* else if (monorepoManager === 'rush') {
setCommand(
'buildCommand',
`node ${relativeToRoot}/common/scripts/install-run-rush.js build --to ${projectName}`
);
setCommand(
'installCommand',
`node ${relativeToRoot}/common/scripts/install-run-rush.js install`
);
} */
}

View File

@@ -2,6 +2,7 @@
"name": "vite-template-solid",
"version": "0.0.0",
"description": "",
"type": "module",
"scripts": {
"start": "vite",
"dev": "vite",

View File

@@ -10,7 +10,7 @@
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"module": "CommonJS",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,

View File

@@ -1172,6 +1172,7 @@ describe('build', () => {
afterAll(() => {
delete process.env.VERCEL_BUILD_MONOREPO_SUPPORT;
});
const setupMonorepoDetectionFixture = (fixture: string) => {
const cwd = setupFixture(`commands/build/monorepo-detection/${fixture}`);
process.chdir(cwd);
@@ -1188,14 +1189,12 @@ describe('build', () => {
'turbo',
'turbo-package-config',
])('fixture: %s', fixture => {
const monorepoManagerMap: Record<
string,
{ name: string; buildCommand: string; installCommand: string }
> = {
const monorepoManagerMap: Record<string, Record<string, string>> = {
turbo: {
name: 'Turbo',
buildCommand: 'cd ../.. && npx turbo run build --filter=app-1...',
installCommand: 'cd ../.. && yarn install',
ignoreCommand: 'cd ../.. && npx turbo-ignore',
},
nx: {
name: 'Nx',
@@ -1211,8 +1210,8 @@ describe('build', () => {
// },
};
const { name, buildCommand, installCommand } =
monorepoManagerMap[fixture.split('-')[0]];
const { name, ...commands } = monorepoManagerMap[fixture.split('-')[0]];
test(
'should detect and use correct defaults',
async () => {
@@ -1229,7 +1228,7 @@ describe('build', () => {
const exitCode = await build(client);
expect(exitCode).toBe(0);
await expect(client.stderr).toOutput(
`Automatically detected ${name} monorepo manager. Attempting to assign default \`buildCommand\` and \`installCommand\` settings.`
`Automatically detected ${name} monorepo manager. Attempting to assign default settings.`
);
const result = await fs.readFile(
join(cwd, '.vercel/output/static/index.txt'),
@@ -1262,14 +1261,23 @@ describe('build', () => {
await fs.readFile(projectJSONPath, 'utf-8')
);
const projectJSONCommands = {
...commands,
};
if (projectJSONCommands.ignoreCommand) {
projectJSONCommands.commandForIgnoringBuildStep =
projectJSONCommands.ignoreCommand;
delete projectJSONCommands.ignoreCommand;
}
await fs.writeFile(
projectJSONPath,
JSON.stringify({
...projectJSON,
settings: {
...projectJSON.settings,
buildCommand,
installCommand,
...projectJSONCommands,
},
})
);
@@ -1282,6 +1290,11 @@ describe('build', () => {
await expect(client.stderr).toOutput(
'Cannot automatically assign installCommand as it is already set via project settings or configuration overrides.'
);
if (name === 'Turbo') {
await expect(client.stderr).toOutput(
'Cannot automatically assign commandForIgnoringBuildStep as it is already set via project settings or configuration overrides.'
);
}
} finally {
process.chdir(originalCwd);
delete process.env.__VERCEL_BUILD_RUNNING;
@@ -1306,8 +1319,7 @@ describe('build', () => {
await fs.writeFile(
join(cwd, 'packages/app-1/vercel.json'),
JSON.stringify({
buildCommand,
installCommand,
...commands,
})
);
@@ -1319,6 +1331,11 @@ describe('build', () => {
await expect(client.stderr).toOutput(
'Cannot automatically assign installCommand as it is already set via project settings or configuration overrides.'
);
if (name === 'Turbo') {
await expect(client.stderr).toOutput(
'Cannot automatically assign commandForIgnoringBuildStep as it is already set via project settings or configuration overrides.'
);
}
} finally {
process.chdir(originalCwd);
delete process.env.__VERCEL_BUILD_RUNNING;
@@ -1463,8 +1480,7 @@ describe('build', () => {
'nx.json',
'targetDefaults.build',
[
'Missing default `build` target in nx.json. Checking for project level Nx configuration...',
'Missing required `build` target in either project.json or package.json Nx configuration. Skipping automatic setting assignment.',
'Missing required `build` target in either nx.json, project.json, or package.json Nx configuration. Skipping automatic setting assignment.',
],
],
[
@@ -1472,9 +1488,7 @@ describe('build', () => {
'packages/app-1/project.json',
'targets.build',
[
'Missing default `build` target in nx.json. Checking for project level Nx configuration...',
'Found project.json Nx configuration.',
'Missing required `build` target in either project.json or package.json Nx configuration. Skipping automatic setting assignment.',
'Missing required `build` target in either nx.json, project.json, or package.json Nx configuration. Skipping automatic setting assignment.',
],
],
[
@@ -1482,9 +1496,7 @@ describe('build', () => {
'packages/app-1/package.json',
'nx.targets.build',
[
'Missing default `build` target in nx.json. Checking for project level Nx configuration...',
'Found package.json Nx configuration.',
'Missing required `build` target in either project.json or package.json Nx configuration. Skipping automatic setting assignment.',
'Missing required `build` target in either nx.json, project.json, or package.json Nx configuration. Skipping automatic setting assignment.',
],
],
[

View File

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

View File

@@ -29,9 +29,12 @@ export const frameworks = [
envPrefix: 'NEXT_PUBLIC_',
useRuntime: { src: 'package.json', use: '@vercel/next' },
detectors: {
every: [
some: [
{
path: 'blitz.config.(js|ts)',
path: 'blitz.config.js',
},
{
path: 'blitz.config.ts',
},
],
},
@@ -1761,7 +1764,7 @@ export const frameworks = [
{
name: 'VitePress',
slug: 'vitepress',
demo: 'https://vitepress-starter-template.vercel.app/',
demo: 'https://vitepress-starter-template.vercel.app',
logo: 'https://api-frameworks.vercel.sh/framework-logos/vite.svg',
tagline: "VitePress is VuePress' little brother, built on top of Vite.",
description: 'VuePress on top of Vite',

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/fs-detectors",
"version": "3.5.7",
"version": "3.6.0",
"description": "Vercel filesystem detectors",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -20,11 +20,11 @@
},
"dependencies": {
"@vercel/error-utils": "1.0.3",
"@vercel/frameworks": "1.1.16",
"@vercel/frameworks": "1.1.17",
"@vercel/routing-utils": "2.1.3",
"glob": "8.0.3",
"js-yaml": "4.1.0",
"json5": "2.2.1",
"json5": "2.2.2",
"minimatch": "3.0.4",
"semver": "6.1.1"
},

View File

@@ -23,3 +23,4 @@ export {
export { monorepoManagers } from './monorepos/monorepo-managers';
export { isOfficialRuntime, isStaticRuntime } from './is-official-runtime';
export { packageManagers } from './package-managers/package-managers';
export * from './monorepos/get-monorepo-default-settings';

View File

@@ -0,0 +1,130 @@
import { join } from 'path';
import { monorepoManagers } from './monorepo-managers';
import { packageManagers } from '../package-managers/package-managers';
import { DetectorFilesystem } from '../detectors/filesystem';
import { detectFramework } from '../detect-framework';
import JSON5 from 'json5';
export class MissingBuildPipeline extends Error {
constructor() {
super(
'Missing required `build` pipeline in turbo.json or package.json Turbo configuration.'
);
}
}
export class MissingBuildTarget extends Error {
constructor() {
super(
'Missing required `build` target in either nx.json, project.json, or package.json Nx configuration.'
);
}
}
export async function getMonorepoDefaultSettings(
projectName: string,
projectPath: string,
relativeToRoot: string,
detectorFilesystem: DetectorFilesystem
) {
const [monorepoManager, packageManager] = await Promise.all([
detectFramework({
fs: detectorFilesystem,
frameworkList: monorepoManagers,
}),
detectFramework({
fs: detectorFilesystem,
frameworkList: packageManagers,
}),
]);
if (monorepoManager === 'turbo') {
const [turboJSONBuf, packageJSONBuf] = await Promise.all([
detectorFilesystem.readFile('turbo.json').catch(() => null),
detectorFilesystem.readFile('package.json').catch(() => null),
]);
let hasBuildPipeline = false;
if (turboJSONBuf !== null) {
const turboJSON = JSON5.parse(turboJSONBuf.toString('utf-8'));
if (turboJSON?.pipeline?.build) {
hasBuildPipeline = true;
}
} else if (packageJSONBuf !== null) {
const packageJSON = JSON.parse(packageJSONBuf.toString('utf-8'));
if (packageJSON?.turbo?.pipeline?.build) {
hasBuildPipeline = true;
}
}
if (!hasBuildPipeline) {
throw new MissingBuildPipeline();
}
return {
monorepoManager: 'turbo',
buildCommand: `cd ${relativeToRoot} && npx turbo run build --filter=${projectName}...`,
installCommand: `cd ${relativeToRoot} && ${packageManager} install`,
commandForIgnoringBuildStep: `cd ${relativeToRoot} && npx turbo-ignore`,
};
} else if (monorepoManager === 'nx') {
// No ENOENT handling required here since conditional wouldn't be `true` unless `nx.json` was found.
const nxJSONBuf = await detectorFilesystem.readFile('nx.json');
const nxJSON = JSON5.parse(nxJSONBuf.toString('utf-8'));
if (!nxJSON?.targetDefaults?.build) {
const [projectJSONBuf, packageJSONBuf] = await Promise.all([
detectorFilesystem
.readFile(join(projectPath, 'project.json'))
.catch(() => null),
detectorFilesystem
.readFile(join(projectPath, 'package.json'))
.catch(() => null),
]);
let hasBuildTarget = false;
if (projectJSONBuf) {
const projectJSON = JSON5.parse(projectJSONBuf.toString('utf-8'));
if (projectJSON?.targets?.build) {
hasBuildTarget = true;
}
}
if (packageJSONBuf) {
const packageJSON = JSON5.parse(packageJSONBuf.toString('utf-8'));
if (packageJSON?.nx) {
if (packageJSON.nx.targets?.build) {
hasBuildTarget = true;
}
}
}
if (!hasBuildTarget) {
throw new MissingBuildTarget();
}
}
return {
monorepoManager: 'nx',
buildCommand: `cd ${relativeToRoot} && npx nx build ${projectName}`,
installCommand: `cd ${relativeToRoot} && ${packageManager} install`,
};
}
// TODO (@Ethan-Arrowood) - Revisit rush support when we can test it better
/* else if (monorepoManager === 'rush') {
setCommand(
'buildCommand',
`node ${relativeToRoot}/common/scripts/install-run-rush.js build --to ${projectName}`
);
setCommand(
'installCommand',
`node ${relativeToRoot}/common/scripts/install-run-rush.js install`
);
} */
return null;
}

View File

@@ -0,0 +1,4 @@
{
"extends": "nx/presets/npm.json",
"tasksRunnerOptions": { "default": { "runner": "nx/tasks-runners/default" } }
}

View File

@@ -0,0 +1,9 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"nx": "15.0.1"
}
}

View File

@@ -0,0 +1,17 @@
{
"name": "app-1",
"version": "0.0.1",
"nx": {
"targets": {
"build": {
"executor": "nx:run-script",
"options": {
"script": "build"
},
"dependsOn": [
"^build"
]
}
}
}
}

View File

@@ -0,0 +1,4 @@
{
"extends": "nx/presets/npm.json",
"tasksRunnerOptions": { "default": { "runner": "nx/tasks-runners/default" } }
}

View File

@@ -0,0 +1,9 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"nx": "15.0.1"
}
}

View File

@@ -0,0 +1,7 @@
{
"name": "app-1",
"version": "0.0.1",
"nx": {
"targets": {}
}
}

View File

@@ -0,0 +1,9 @@
{
"targets": {
"build": {
"executor": "nx:run-script",
"options": { "script": "build" },
"dependsOn": ["^build"]
}
}
}

View File

@@ -0,0 +1,4 @@
{
"extends": "nx/presets/npm.json",
"tasksRunnerOptions": { "default": { "runner": "nx/tasks-runners/default" } }
}

View File

@@ -0,0 +1,9 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"nx": "15.0.1"
}
}

View File

@@ -0,0 +1,17 @@
{
"name": "app-1",
"version": "0.0.1",
"nx": {
"targets": {
"build": {
"executor": "nx:run-script",
"options": {
"script": "build"
},
"dependsOn": [
"^build"
]
}
}
}
}

View File

@@ -0,0 +1,4 @@
{
"extends": "nx/presets/npm.json",
"tasksRunnerOptions": { "default": { "runner": "nx/tasks-runners/default" } }
}

View File

@@ -0,0 +1,9 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"nx": "15.0.1"
}
}

View File

@@ -0,0 +1,4 @@
{
"name": "app-1",
"version": "0.0.1"
}

View File

@@ -0,0 +1,9 @@
{
"targets": {
"build": {
"executor": "nx:run-script",
"options": { "script": "build" },
"dependsOn": ["^build"]
}
}
}

View File

@@ -0,0 +1,5 @@
{
"extends": "nx/presets/npm.json",
"tasksRunnerOptions": { "default": { "runner": "nx/tasks-runners/default" } },
"targetDefaults": { "build": { "dependsOn": ["^build"] } }
}

View File

@@ -0,0 +1,9 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"nx": "15.0.1"
}
}

View File

@@ -0,0 +1,4 @@
{
"name": "app-1",
"version": "0.0.1"
}

View File

@@ -0,0 +1,21 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"turbo": "1.6.3"
},
"turbo": {
"pipeline": {
"build": {
"dependsOn": [
"^build"
],
"outputs": [
"dist/**"
]
}
}
}
}

View File

@@ -0,0 +1,4 @@
{
"name": "app-1",
"version": "0.0.1"
}

View File

@@ -0,0 +1,9 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"turbo": "1.6.3"
}
}

View File

@@ -0,0 +1,4 @@
{
"name": "app-1",
"version": "0.0.1"
}

View File

@@ -0,0 +1,2 @@
// TEST COMMENT TO VERIFY JSON5 SUPPORT
{ "pipeline": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] } } }

View File

@@ -420,5 +420,13 @@ describe('DetectorFilesystem', () => {
expect(await detectFramework({ fs, frameworkList })).toBe('zola');
});
it('Detect Blitz.js (Legacy)', async () => {
const fs = new VirtualFilesystem({
'blitz.config.js': '// some config',
});
expect(await detectFramework({ fs, frameworkList })).toBe('blitzjs');
});
});
});

View File

@@ -0,0 +1,69 @@
import {
getMonorepoDefaultSettings,
LocalFileSystemDetector,
MissingBuildPipeline,
MissingBuildTarget,
} from '../src';
import path from 'path';
import fs from 'fs';
import os from 'os';
import { FixtureFilesystem } from './utils/fixture-filesystem';
describe('getMonorepoDefaultSettings', () => {
test('MissingBuildTarget is an error', () => {
const missingBuildTarget = new MissingBuildTarget();
expect(missingBuildTarget).toBeInstanceOf(Error);
expect(missingBuildTarget.message).toBe(
'Missing required `build` target in either nx.json, project.json, or package.json Nx configuration.'
);
});
test('MissingBuildPipeline is an error', () => {
const missingBuildPipeline = new MissingBuildPipeline();
expect(missingBuildPipeline).toBeInstanceOf(Error);
expect(missingBuildPipeline.message).toBe(
'Missing required `build` pipeline in turbo.json or package.json Turbo configuration.'
);
});
test.each([
['turbo', 'turbo'],
['turbo-package-config', 'turbo'],
['nx', 'nx'],
['nx-package-config', 'nx'],
['nx-project-and-package-config-1', 'nx'],
['nx-project-and-package-config-2', 'nx'],
['nx-project-config', 'nx'],
])('fixture %s', async (fixture, expectedResultKey) => {
const expectedResultMap: Record<string, Record<string, string>> = {
turbo: {
monorepoManager: 'turbo',
buildCommand: 'cd ../.. && npx turbo run build --filter=app-1...',
installCommand: 'cd ../.. && yarn install',
commandForIgnoringBuildStep: 'cd ../.. && npx turbo-ignore',
},
nx: {
monorepoManager: 'nx',
buildCommand: 'cd ../.. && npx nx build app-1',
installCommand: 'cd ../.. && yarn install',
},
};
const ffs = new FixtureFilesystem(
path.join(__dirname, 'fixtures', 'get-monorepo-default-settings', fixture)
);
const result = await getMonorepoDefaultSettings(
'app-1',
'packages/app-1',
'../..',
ffs
);
expect(result).toStrictEqual(expectedResultMap[expectedResultKey]);
});
test('returns null when neither nx nor turbo is detected', async () => {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'monorepo-test-'));
const lfs = new LocalFileSystemDetector(dir);
const result = await getMonorepoDefaultSettings('', '', '', lfs);
expect(result).toBe(null);
});
});

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "3.3.6",
"version": "3.3.7",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -46,7 +46,7 @@
"@types/text-table": "0.2.1",
"@types/webpack-sources": "3.2.0",
"@vercel/build-utils": "5.7.3",
"@vercel/nft": "0.22.1",
"@vercel/nft": "0.22.5",
"@vercel/routing-utils": "2.1.3",
"async-sema": "3.0.1",
"buffer-crc32": "0.2.13",

View File

@@ -1,6 +1,6 @@
{
"dependencies": {
"isomorphic-unfetch": "latest",
"isomorphic-unfetch": "3.1.0",
"next": "7.0.0"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node-bridge",
"version": "3.1.2",
"version": "3.1.3",
"license": "MIT",
"main": "./index.js",
"repository": {

View File

@@ -13,8 +13,8 @@ test('port binding', async () => {
// Test port binding
const info = await bridge.listening;
assert.equal(info.address, '127.0.0.1');
assert.equal(typeof info.port, 'number');
assert.strictEqual(info.address, '127.0.0.1');
assert.strictEqual(typeof info.port, 'number');
server.close();
});
@@ -41,13 +41,13 @@ test('`APIGatewayProxyEvent` normalizing', async () => {
},
context
);
assert.equal(result.encoding, 'base64');
assert.equal(result.statusCode, 200);
assert.strictEqual(result.encoding, 'base64');
assert.strictEqual(result.statusCode, 200);
const body = JSON.parse(Buffer.from(result.body, 'base64').toString());
assert.equal(body.method, 'GET');
assert.equal(body.path, '/apigateway');
assert.equal(body.headers.foo, 'bar');
assert.equal(context.callbackWaitsForEmptyEventLoop, false);
assert.strictEqual(body.method, 'GET');
assert.strictEqual(body.path, '/apigateway');
assert.strictEqual(body.headers.foo, 'bar');
assert.strictEqual(context.callbackWaitsForEmptyEventLoop, false);
server.close();
});
@@ -77,13 +77,13 @@ test('`NowProxyEvent` normalizing', async () => {
},
context
);
assert.equal(result.encoding, 'base64');
assert.equal(result.statusCode, 200);
assert.strictEqual(result.encoding, 'base64');
assert.strictEqual(result.statusCode, 200);
const body = JSON.parse(Buffer.from(result.body, 'base64').toString());
assert.equal(body.method, 'POST');
assert.equal(body.path, '/nowproxy');
assert.equal(body.headers.foo, 'baz');
assert.equal(context.callbackWaitsForEmptyEventLoop, false);
assert.strictEqual(body.method, 'POST');
assert.strictEqual(body.path, '/nowproxy');
assert.strictEqual(body.headers.foo, 'baz');
assert.strictEqual(context.callbackWaitsForEmptyEventLoop, false);
server.close();
});
@@ -137,9 +137,9 @@ test('multi-payload handling', async () => {
},
context
);
assert.equal(result.encoding, 'base64');
assert.equal(result.statusCode, 200);
assert.equal(
assert.strictEqual(result.encoding, 'base64');
assert.strictEqual(result.statusCode, 200);
assert.strictEqual(
result.headers['content-type'],
'multipart/mixed; boundary="payload-separator"'
);
@@ -164,25 +164,34 @@ test('multi-payload handling', async () => {
// proper parsing of the multipart body
assert(payloadParts.some(part => part.includes('content-type: text/plain')));
assert.equal(bodies[0].method, 'GET');
assert.equal(bodies[0].path, '/nowproxy');
assert.equal(bodies[0].headers.foo, 'baz');
assert.equal(bodies[1].method, 'GET');
assert.equal(bodies[1].path, '/_next/data/build-id/nowproxy.json');
assert.equal(bodies[1].headers.foo, 'baz');
assert.equal(bodies[2], '/somewhere');
assert.equal(result.headers['x-vercel-payload-3-status'], '307');
assert.equal(result.headers['x-vercel-payload-2-status'], undefined);
assert.equal(result.headers['x-vercel-payload-1-status'], undefined);
assert.equal(result.headers['x-vercel-payload-1-content-type'], 'text/html');
assert.equal(
assert.strictEqual(bodies[0].method, 'GET');
assert.strictEqual(bodies[0].path, '/nowproxy');
assert.strictEqual(bodies[0].headers.foo, 'baz');
assert.strictEqual(bodies[1].method, 'GET');
assert.strictEqual(bodies[1].path, '/_next/data/build-id/nowproxy.json');
assert.strictEqual(bodies[1].headers.foo, 'baz');
assert.strictEqual(bodies[2], '/somewhere');
assert.strictEqual(result.headers['x-vercel-payload-3-status'], '307');
assert.strictEqual(result.headers['x-vercel-payload-2-status'], undefined);
assert.strictEqual(result.headers['x-vercel-payload-1-status'], undefined);
assert.strictEqual(
result.headers['x-vercel-payload-1-content-type'],
'text/html'
);
assert.strictEqual(
result.headers['x-vercel-payload-2-content-type'],
'application/json'
);
assert.equal(result.headers['x-vercel-payload-3-content-type'], undefined);
assert.equal(result.headers['x-vercel-payload-3-location'], '/somewhere');
assert.equal(result.headers['x-vercel-payload-2-location'], undefined);
assert.equal(context.callbackWaitsForEmptyEventLoop, false);
assert.strictEqual(
result.headers['x-vercel-payload-3-content-type'],
undefined
);
assert.strictEqual(
result.headers['x-vercel-payload-3-location'],
'/somewhere'
);
assert.strictEqual(result.headers['x-vercel-payload-2-location'], undefined);
assert.strictEqual(context.callbackWaitsForEmptyEventLoop, false);
server.close();
});
@@ -288,14 +297,14 @@ test('invalid request headers', async () => {
},
context
);
assert.equal(result.encoding, 'base64');
assert.equal(result.statusCode, 200);
assert.strictEqual(result.encoding, 'base64');
assert.strictEqual(result.statusCode, 200);
const body = JSON.parse(Buffer.from(result.body, 'base64').toString());
assert.equal(body.method, 'GET');
assert.equal(body.path, '/nowproxy');
assert.equal(body.headers.ok, 'true');
assert.strictEqual(body.method, 'GET');
assert.strictEqual(body.path, '/nowproxy');
assert.strictEqual(body.headers.ok, 'true');
assert(!body.headers.foo);
assert.equal(context.callbackWaitsForEmptyEventLoop, false);
assert.strictEqual(context.callbackWaitsForEmptyEventLoop, false);
server.close();
});

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node",
"version": "2.8.3",
"version": "2.8.4",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -32,13 +32,13 @@
"@edge-runtime/vm": "2.0.0",
"@types/node": "14.18.33",
"@vercel/build-utils": "5.7.3",
"@vercel/node-bridge": "3.1.2",
"@vercel/node-bridge": "3.1.3",
"@vercel/static-config": "2.0.6",
"edge-runtime": "2.0.0",
"esbuild": "0.14.47",
"exit-hook": "2.2.1",
"node-fetch": "2.6.7",
"ts-node": "8.9.1",
"ts-node": "10.9.1",
"typescript": "4.3.4"
},
"devDependencies": {
@@ -53,7 +53,7 @@
"@types/node-fetch": "^2.6.1",
"@types/test-listen": "1.1.0",
"@vercel/ncc": "0.24.0",
"@vercel/nft": "0.22.1",
"@vercel/nft": "0.22.5",
"content-type": "1.0.4",
"cookie": "0.4.0",
"etag": "1.8.1",

View File

@@ -1,73 +1,15 @@
const entrypoint = process.env.VERCEL_DEV_ENTRYPOINT;
delete process.env.VERCEL_DEV_ENTRYPOINT;
const tsconfig = process.env.VERCEL_DEV_TSCONFIG;
delete process.env.VERCEL_DEV_TSCONFIG;
if (!entrypoint) {
throw new Error('`VERCEL_DEV_ENTRYPOINT` must be defined');
}
delete process.env.TS_NODE_TRANSPILE_ONLY;
delete process.env.TS_NODE_COMPILER_OPTIONS;
import { join } from 'path';
import { register } from 'ts-node';
import { fixConfig } from './typescript';
type TypescriptModule = typeof import('typescript');
let useRequire = false;
if (!process.env.VERCEL_DEV_IS_ESM) {
const resolveTypescript = (p: string): string => {
try {
return require.resolve('typescript', {
paths: [p],
});
} catch (_) {
return '';
}
};
const requireTypescript = (p: string): TypescriptModule => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
return require(p) as TypescriptModule;
};
let ts: TypescriptModule | null = null;
// Use the project's version of Typescript if available and supports `target`
let compiler = resolveTypescript(process.cwd());
if (compiler) {
ts = requireTypescript(compiler);
}
// Otherwise fall back to using the copy that `@vercel/node` uses
if (!ts) {
compiler = resolveTypescript(join(__dirname, '..'));
ts = requireTypescript(compiler);
}
let config: any = {};
if (tsconfig) {
try {
config = ts.readConfigFile(tsconfig, ts.sys.readFile).config;
} catch (err) {
if (err.code !== 'ENOENT') {
console.error(`Error while parsing "${tsconfig}"`);
throw err;
}
}
}
fixConfigDev(config);
register({
compiler,
compilerOptions: config.compilerOptions,
transpileOnly: true,
});
useRequire = true;
}
const useRequire = process.env.VERCEL_DEV_IS_ESM !== '1';
import { createServer, Server, IncomingMessage, ServerResponse } from 'http';
import { VercelProxyResponse } from '@vercel/node-bridge/types';
@@ -195,21 +137,6 @@ export async function onDevRequest(
}
}
export function fixConfigDev(config: { compilerOptions: any }): void {
const nodeVersionMajor = Number(process.versions.node.split('.')[0]);
fixConfig(config, nodeVersionMajor);
// In prod, `.ts` inputs use TypeScript and
// `.js` inputs use Babel to convert ESM to CJS.
// In dev, both `.ts` and `.js` inputs use ts-node
// without Babel so we must enable `allowJs`.
config.compilerOptions.allowJs = true;
// In prod, we emit outputs to the filesystem.
// In dev, we don't emit because we use ts-node.
config.compilerOptions.noEmit = true;
}
main().catch(err => {
logError(err);
process.exit(1);

View File

@@ -52,7 +52,7 @@ import type {
} from '@vercel/build-utils';
import { getConfig } from '@vercel/static-config';
import { Register, register } from './typescript';
import { fixConfig, Register, register } from './typescript';
import {
EdgeRuntimes,
entrypointToOutputPath,
@@ -62,6 +62,8 @@ import {
export { shouldServe };
type TypescriptModule = typeof import('typescript');
interface DownloadOptions {
files: Files;
entrypoint: string;
@@ -516,8 +518,9 @@ export const startDevServer: StartDevServer = async opts => {
}
const entryDir = dirname(entrypointPath);
const ext = extname(entrypoint);
const projectTsConfig = await walkParentDirs({
const pathToTsConfig = await walkParentDirs({
base: workPath,
start: entryDir,
filename: 'tsconfig.json',
@@ -528,20 +531,99 @@ export const startDevServer: StartDevServer = async opts => {
filename: 'package.json',
});
const pkg = pathToPkg ? require_(pathToPkg) : {};
const tsNodePath = require_.resolve('ts-node');
const esmLoader = join(tsNodePath, '..', '..', 'esm.mjs');
const cjsLoader = join(tsNodePath, '..', '..', 'register', 'index.js');
const isTypescript = ['.ts', '.tsx', '.mts', '.cts'].includes(ext);
const maybeTranspile = isTypescript || !['.cjs', '.mjs'].includes(ext);
const isEsm =
entrypoint.endsWith('.mjs') ||
(pkg.type === 'module' && entrypoint.endsWith('.js'));
ext === '.mjs' ||
ext === '.mts' ||
(pkg.type === 'module' && ['.js', '.ts', '.tsx'].includes(ext));
const devServerPath = join(__dirname, 'dev-server.js');
let nodeOptions = process.env.NODE_OPTIONS;
let tsConfig: any = {};
if (maybeTranspile) {
const resolveTypescript = (p: string): string => {
try {
return require_.resolve('typescript', {
paths: [p],
});
} catch (_) {
return '';
}
};
const requireTypescript = (p: string): TypescriptModule => require_(p);
let ts: TypescriptModule | null = null;
// Use the project's version of Typescript if available and supports `target`
let compiler = resolveTypescript(process.cwd());
if (compiler) {
ts = requireTypescript(compiler);
}
// Otherwise fall back to using the copy that `@vercel/node` uses
if (!ts) {
compiler = resolveTypescript(join(__dirname, '..'));
ts = requireTypescript(compiler);
}
if (pathToTsConfig) {
try {
tsConfig = ts.readConfigFile(pathToTsConfig, ts.sys.readFile).config;
} catch (err) {
if (err.code !== 'ENOENT') {
console.error(`Error while parsing "${pathToTsConfig}"`);
throw err;
}
}
}
const nodeVersionMajor = Number(process.versions.node.split('.')[0]);
fixConfig(tsConfig, nodeVersionMajor);
// In prod, `.ts` inputs use TypeScript and
// `.js` inputs use Babel to convert ESM to CJS.
// In dev, both `.ts` and `.js` inputs use ts-node
// without Babel so we must enable `allowJs`.
tsConfig.compilerOptions.allowJs = true;
// In prod, we emit outputs to the filesystem.
// In dev, we don't emit because we use ts-node.
tsConfig.compilerOptions.noEmit = true;
if (isTypescript) {
if (isEsm) {
nodeOptions = `--loader ${esmLoader} ${nodeOptions || ''}`;
} else {
nodeOptions = `--require ${cjsLoader} ${nodeOptions || ''}`;
}
} else {
if (isEsm) {
// no transform needed because Node.js supports ESM natively
} else {
nodeOptions = `--require ${cjsLoader} ${nodeOptions || ''}`;
}
}
}
const child = fork(devServerPath, [], {
cwd: workPath,
execArgv: [],
env: cloneEnv(process.env, meta.env, {
VERCEL_DEV_ENTRYPOINT: entrypoint,
VERCEL_DEV_TSCONFIG: projectTsConfig || '',
VERCEL_DEV_IS_ESM: isEsm ? '1' : undefined,
VERCEL_DEV_CONFIG: JSON.stringify(config),
VERCEL_DEV_BUILD_ENV: JSON.stringify(meta.buildEnv || {}),
TS_NODE_TRANSPILE_ONLY: '1',
TS_NODE_COMPILER_OPTIONS: tsConfig?.compilerOptions
? JSON.stringify(tsConfig.compilerOptions)
: undefined,
NODE_OPTIONS: nodeOptions,
}),
});
@@ -560,11 +642,10 @@ export const startDevServer: StartDevServer = async opts => {
if (isPortInfo(result)) {
// "message" event
const ext = extname(entrypoint);
if (ext === '.ts' || ext === '.tsx') {
if (isTypescript) {
// Invoke `tsc --noEmit` asynchronously in the background, so
// that the HTTP request is not blocked by the type checking.
doTypeCheck(opts, projectTsConfig).catch((err: Error) => {
doTypeCheck(opts, pathToTsConfig).catch((err: Error) => {
console.error('Type check for %j failed:', entrypoint, err);
});
}

View File

@@ -490,8 +490,10 @@ export function fixConfig(
config.compilerOptions.esModuleInterop = true;
}
// Target CommonJS, always!
config.compilerOptions.module = 'CommonJS';
// If not specified, the default Node.js module is CommonJS.
if (config.compilerOptions.module === undefined) {
config.compilerOptions.module = 'CommonJS';
}
return config;
}

View File

@@ -0,0 +1,11 @@
import fetch from 'node-fetch';
import type { IncomingMessage, ServerResponse } from 'http';
export default async function handler(
_request: IncomingMessage,
response: ServerResponse
) {
const res = await fetch('https://example.vercel.sh');
const text = await res.text();
return response.end(text);
}

View File

@@ -0,0 +1,12 @@
{
"private": true,
"type": "module",
"dependencies": {
"node-fetch": "3.2.6"
},
"devDependencies": {
"@types/node": "17.0.42",
"@types/node-fetch": "2.6.1",
"typescript": "4.7.3"
}
}

View File

@@ -0,0 +1,3 @@
{
"probes": [{ "path": "/api/proxy", "mustContain": "Example Domain" }]
}

View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"lib": ["esnext"],
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true
}
}

View File

@@ -4,7 +4,7 @@
"allowJs": true,
"jsx": "preserve",
"target": "esnext",
"module": "esnext",
"module": "commonjs",
"lib": ["dom", "es2017"],
"noEmitOnError": true,
"moduleResolution": "node",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/redwood",
"version": "1.0.42",
"version": "1.0.43",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://vercel.com/docs",
@@ -19,7 +19,7 @@
"test-unit": "yarn test test/prepare-cache.test.js"
},
"dependencies": {
"@vercel/nft": "0.22.1",
"@vercel/nft": "0.22.5",
"@vercel/routing-utils": "2.1.3",
"semver": "6.1.1"
},

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix",
"version": "1.1.4",
"version": "1.1.5",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -20,7 +20,7 @@
"default-server.js"
],
"dependencies": {
"@vercel/nft": "0.22.1"
"@vercel/nft": "0.22.5"
},
"devDependencies": {
"@types/jest": "27.5.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/static-build",
"version": "1.0.45",
"version": "1.0.46",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/build-step",
@@ -37,7 +37,7 @@
"@types/node-fetch": "2.5.4",
"@types/promise-timeout": "1.3.0",
"@vercel/build-utils": "5.7.3",
"@vercel/frameworks": "1.1.16",
"@vercel/frameworks": "1.1.17",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.1.3",
"@vercel/static-config": "2.0.6",

View File

@@ -1,18 +1,20 @@
{
"$schema": "https://turborepo.org/schema.json",
"baseBranch": "origin/main",
"globalDependencies": ["turbo-cache-key.json", "test/lib/**"],
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": ["dist/**"]
},
"@vercel/node-bridge#build": {
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": ["helpers.js", "source-map-support.js"]
},
"vercel#build": {
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": [
"dist/**",
"src/util/constants.ts",
@@ -20,27 +22,33 @@
]
},
"test-unit": {
"dependsOn": [],
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": []
},
"test-integration-dev": {
"dependsOn": [],
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": []
},
"test-integration-cli": {
"dependsOn": [],
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": []
},
"test-integration-once": {
"dependsOn": [],
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": []
},
"test-next-local": {
"dependsOn": [],
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": []
},
"test": {
"dependsOn": [],
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": []
}
}

View File

@@ -14,7 +14,14 @@ async function getChunkedTests() {
const rootPath = path.resolve(__dirname, '..');
const dryRunText = (
await turbo([`run`, ...scripts, `--cache-dir=.turbo`, '--', '--listTests'])
await turbo([
`run`,
...scripts,
`--cache-dir=.turbo`,
'--output-logs=full',
'--',
'--listTests',
])
).toString('utf8');
/**

160
yarn.lock
View File

@@ -2209,6 +2209,14 @@
dependencies:
"@types/node" ">= 8"
"@rollup/pluginutils@^4.0.0":
version "4.2.1"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d"
integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==
dependencies:
estree-walker "^2.0.1"
picomatch "^2.2.2"
"@samverschueren/stream-to-observable@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f"
@@ -3403,12 +3411,13 @@
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.24.0.tgz#a2e8783a185caa99b5d8961a57dfc9665de16296"
integrity sha512-crqItMcIwCkvdXY/V3/TzrHJQx6nbIaRqE1cOopJhgGX6izvNov40SmD//nS5flfEvdK54YGjwVVq+zG6crjOg==
"@vercel/nft@0.22.1":
version "0.22.1"
resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.22.1.tgz#0d91d2a21e3a7f0b23ce1550da9870eac4942828"
integrity sha512-lYYZIoxRurqDOSoVIdBicGnpUIpfyaS5qVjdPq+EfI285WqtZK3NK/dyCkiyBul+X2U2OEhRyeMdXPCHGJbohw==
"@vercel/nft@0.22.5":
version "0.22.5"
resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.22.5.tgz#951bd7589ceebdd3e280afcf3a13bdacf83f6b7e"
integrity sha512-mug57Wd1BL7GMj9gXMgMeKUjdqO0e4u+0QLPYMFE1rwdJ+55oPy6lp3nIBCS8gOvigT62UI4QKUL2sGqcoW4Hw==
dependencies:
"@mapbox/node-pre-gyp" "^1.0.5"
"@rollup/pluginutils" "^4.0.0"
acorn "^8.6.0"
async-sema "^3.1.1"
bindings "^1.4.0"
@@ -3418,7 +3427,6 @@
micromatch "^4.0.2"
node-gyp-build "^4.2.2"
resolve-from "^5.0.0"
rollup-pluginutils "^2.8.2"
"@zeit/dns-cached-resolve@2.1.0":
version "2.1.0"
@@ -6208,16 +6216,11 @@ estraverse@^5.2.0:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880"
integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==
estree-walker@2.0.2:
estree-walker@2.0.2, estree-walker@^2.0.1:
version "2.0.2"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
estree-walker@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362"
integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==
esutils@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
@@ -9086,6 +9089,11 @@ json5@2.2.1, json5@^2.2.1:
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c"
integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==
json5@2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab"
integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ==
json5@^2.1.0, json5@^2.1.2:
version "2.1.3"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43"
@@ -10955,12 +10963,7 @@ picocolors@1.0.0, picocolors@^1.0.0:
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.0.7, picomatch@^2.2.1:
version "2.2.2"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
picomatch@^2.2.3:
picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.0.7, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3:
version "2.3.0"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
@@ -11785,13 +11788,6 @@ rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3:
dependencies:
glob "^7.1.3"
rollup-pluginutils@^2.8.2:
version "2.8.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==
dependencies:
estree-walker "^0.6.1"
rollup@^2.74.1:
version "2.75.7"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.75.7.tgz#221ff11887ae271e37dcc649ba32ce1590aaa0b9"
@@ -13106,95 +13102,47 @@ tunnel-agent@^0.6.0:
dependencies:
safe-buffer "^5.0.1"
turbo-android-arm64@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-android-arm64/-/turbo-android-arm64-1.4.7.tgz#553f68a1f475495549fb8a260461239c90f40410"
integrity sha512-BtWtH8e8w1GhtYpGQmkcDS/AUzVZhQ4ZZN+qtUFei1wZD7VAdtJ9Wcsfi3WD+mXA6vtpIpRJVfQMcShr8l8ErA==
turbo-darwin-64@1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-1.6.3.tgz#fad7e078784b0fafc0b1f75ce9378828918595f5"
integrity sha512-QmDIX0Yh1wYQl0bUS0gGWwNxpJwrzZU2GIAYt3aOKoirWA2ecnyb3R6ludcS1znfNV2MfunP+l8E3ncxUHwtjA==
turbo-darwin-64@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-1.4.7.tgz#c23e2452a01115136e631dc06aa6a9bb379d2d32"
integrity sha512-bMvZaAz5diec9feZ0XpQosYI8U0kiOQM2tj2sv0Y2WZbe227wodVMCQMyUowmcotO8nr6NF76Xo5E+H+dnY6LQ==
turbo-darwin-arm64@1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-1.6.3.tgz#f0a32cae39e3fcd3da5e3129a94c18bb2e3ed6aa"
integrity sha512-75DXhFpwE7CinBbtxTxH08EcWrxYSPFow3NaeFwsG8aymkWXF+U2aukYHJA6I12n9/dGqf7yRXzkF0S/9UtdyQ==
turbo-darwin-arm64@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-1.4.7.tgz#4212917f4892159033cfa88bafa662f6e865fe49"
integrity sha512-AyfxYfKgh1EigQKjypbnDoMLuy4e/n/go+KYiWKKIpOaWXWLBokrBWzYN/aI3NMDRUJWK5ExdlWI9Nleelq8uQ==
turbo-linux-64@1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-1.6.3.tgz#8ddc6ac55ef84641182fe5ff50647f1b355826b0"
integrity sha512-O9uc6J0yoRPWdPg9THRQi69K6E2iZ98cRHNvus05lZbcPzZTxJYkYGb5iagCmCW/pq6fL4T4oLWAd6evg2LGQA==
turbo-freebsd-64@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-freebsd-64/-/turbo-freebsd-64-1.4.7.tgz#7d60d44a623bd000f53673a0db0205a16d8815e6"
integrity sha512-T5/osfbCh0rL53MFS5byFFfsR3vPMHIKIJ4fMMCNkoHsmFj2R0Pv53nqhEItogt0FJwCDHPyt7oBqO83H/AWQQ==
turbo-linux-arm64@1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-1.6.3.tgz#846c1dc84d8dc741651906613c16acccba30428c"
integrity sha512-dCy667qqEtZIhulsRTe8hhWQNCJO0i20uHXv7KjLHuFZGCeMbWxB8rsneRoY+blf8+QNqGuXQJxak7ayjHLxiA==
turbo-freebsd-arm64@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-freebsd-arm64/-/turbo-freebsd-arm64-1.4.7.tgz#35e5b23313d42aab074e69c1d1c44cab17f438ac"
integrity sha512-PL+SaO78AUCas+YKj01UiS2rpmGcxz8XPmLdFWmq6PYjPX6GL5UBAc3pkBphIm0aTLZtsikoEul+JrwAuAy6UA==
turbo-windows-64@1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.6.3.tgz#89ac819fa76ad31d12fbfdeb3045bcebd0d308eb"
integrity sha512-lKRqwL3mrVF09b9KySSaOwetehmGknV9EcQTF7d2dxngGYYX1WXoQLjFP9YYH8ZV07oPm+RUOAKSCQuDuMNhiA==
turbo-linux-32@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-linux-32/-/turbo-linux-32-1.4.7.tgz#2861539d767cdfca058224f284991d918d7b1965"
integrity sha512-dK94UwDzySMALoQtjBVVPbWJZP6xw3yHGuytM3q5p4kfMZPSA+rgNBn5T5Af2Rc7jxlLAsu5ODJ0SgIbWSF5Hg==
turbo-windows-arm64@1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/turbo-windows-arm64/-/turbo-windows-arm64-1.6.3.tgz#977607c9a51f0b76076c8b158bafce06ce813070"
integrity sha512-BXY1sDPEA1DgPwuENvDCD8B7Hb0toscjus941WpL8CVd10hg9pk/MWn9CNgwDO5Q9ks0mw+liDv2EMnleEjeNA==
turbo-linux-64@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-1.4.7.tgz#5ff0e648a1d0b0053ad2f3c6a4fc735744cadc16"
integrity sha512-F6IM23zgTYo9gYJaNp17gVvQBt0hMIvz52OF91DpPYSLpV2h9OSlzPJ3j5TGaWueS/bc/YCV23+VojXX/MauGQ==
turbo-linux-arm64@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-1.4.7.tgz#c5cb63db0ab59dd2ea37be4e44efef119a289ad1"
integrity sha512-kFe5jzj3FoY6jAEwyNEswndj1t/fPl0qyxfcQv6aNPz7Nb2Lh7mY/EEse+CG3ydIo5RZKba7ppQoBSDmHx7JsA==
turbo-linux-arm@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-linux-arm/-/turbo-linux-arm-1.4.7.tgz#93ed9e43a95760e660a42dbf65cbfd430e558e89"
integrity sha512-FTh4itdMNZ7IxGKknFnQ6iPO9vGGKqyySkCYLR01lnw6BTnKL9KuM9XUCBRyn7dNmHhAnqu1ZtVsBkH7CE7DEw==
turbo-linux-mips64le@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-linux-mips64le/-/turbo-linux-mips64le-1.4.7.tgz#77357165c3ae0102fd5924dd85229676938dd717"
integrity sha512-756nG8dnPQVcnl9s70S4NQ43aJjpsnc2h0toktPO+9u2ayv9XTbIPvZLFsS55bDeYhodDGvxoB96W6Xnx01hyQ==
turbo-linux-ppc64le@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-linux-ppc64le/-/turbo-linux-ppc64le-1.4.7.tgz#2a7399d6ee31d894d48aea393ed1f9addc4a310c"
integrity sha512-VS2ofGN/XsafNGJdZ21UguURHb7KRG879yWLj59hO1d+0xXXQbx7ljsmEPOhiE4UjEdx4Ur6P44BhztTgDx9Og==
turbo-windows-32@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-windows-32/-/turbo-windows-32-1.4.7.tgz#e93233d8681886dc0b609c897447991afa378340"
integrity sha512-M5GkZdA0CbJAOcR8SScM63CBV+NtX7qjhoNNOl0F99nGJ+rO3dH71CcM/rbhlz9SQzKQoX8rcuwZHe4r2HZAug==
turbo-windows-64@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.4.7.tgz#da9fe6b6bf2b6fd1f85ecdc186fc7a49b8411d22"
integrity sha512-ftZUtZ1BX1vi8MbxKr+a7riIkhwvGnNTtWGprVu+aDJ8PnV+lNqbkrLJGvKP7Cn22hGTfzcjNNPcJ5PBZpQEQw==
turbo-windows-arm64@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo-windows-arm64/-/turbo-windows-arm64-1.4.7.tgz#c60a772aab36c45ce461e3305e35d1c22a00e516"
integrity sha512-mZ79XeJFfaeVKdBV3w0eoGaqAxFnwxrme0jZtSWemAbeDSCF/13wcbLGwtq0+Lu0LxEGweeQ5AqsCIc9t9i6sA==
turbo@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.4.7.tgz#859989a5dce2a7b1fa51f17ac4fb1e34dbfd455d"
integrity sha512-oIk7PAISPidDOkTM5M+ydEe5GDQ/+TahDgIbaYKeAAy2Qpmur4s0HybSDWHIdxLqI96OPD/mOKymRLrjh3Mdhg==
turbo@1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.6.3.tgz#ec26cc8907c38a9fd6eb072fb10dad254733543e"
integrity sha512-FtfhJLmEEtHveGxW4Ye/QuY85AnZ2ZNVgkTBswoap7UMHB1+oI4diHPNyqrQLG4K1UFtCkjOlVoLsllUh/9QRw==
optionalDependencies:
turbo-android-arm64 "1.4.7"
turbo-darwin-64 "1.4.7"
turbo-darwin-arm64 "1.4.7"
turbo-freebsd-64 "1.4.7"
turbo-freebsd-arm64 "1.4.7"
turbo-linux-32 "1.4.7"
turbo-linux-64 "1.4.7"
turbo-linux-arm "1.4.7"
turbo-linux-arm64 "1.4.7"
turbo-linux-mips64le "1.4.7"
turbo-linux-ppc64le "1.4.7"
turbo-windows-32 "1.4.7"
turbo-windows-64 "1.4.7"
turbo-windows-arm64 "1.4.7"
turbo-darwin-64 "1.6.3"
turbo-darwin-arm64 "1.6.3"
turbo-linux-64 "1.6.3"
turbo-linux-arm64 "1.6.3"
turbo-windows-64 "1.6.3"
turbo-windows-arm64 "1.6.3"
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"