mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-24 03:39:11 +00:00
Compare commits
2 Commits
ai-error-h
...
@vercel/no
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bc8b65d13 | ||
|
|
65dec5b7e7 |
@@ -1,2 +0,0 @@
|
||||
---
|
||||
---
|
||||
@@ -1,5 +1,12 @@
|
||||
# @vercel-internals/types
|
||||
|
||||
## 1.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`65dec5b7e`](https://github.com/vercel/vercel/commit/65dec5b7e752f4da8fe0ffdb25215170453f6f8b)]:
|
||||
- @vercel/build-utils@7.2.4
|
||||
|
||||
## 1.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/types",
|
||||
"version": "1.0.14",
|
||||
"version": "1.0.15",
|
||||
"types": "index.d.ts",
|
||||
"main": "index.d.ts",
|
||||
"files": [
|
||||
@@ -10,7 +10,7 @@
|
||||
"dependencies": {
|
||||
"@types/node": "14.14.31",
|
||||
"@vercel-internals/constants": "1.0.4",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"@vercel/routing-utils": "3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @vercel/build-utils
|
||||
|
||||
## 7.2.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Select Node.js version based on what's available in build-container ([#10822](https://github.com/vercel/vercel/pull/10822))
|
||||
|
||||
## 7.2.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "7.2.3",
|
||||
"version": "7.2.4",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { statSync } from 'fs';
|
||||
import { intersects, validRange } from 'semver';
|
||||
import { NodeVersion } from '../types';
|
||||
import { NowBuildError } from '../errors';
|
||||
import debug from '../debug';
|
||||
|
||||
export type NodeVersionMajor = ReturnType<typeof getOptions>[number]['major'];
|
||||
|
||||
function getOptions() {
|
||||
const options = [
|
||||
{ major: 18, range: '18.x', runtime: 'nodejs18.x' },
|
||||
@@ -46,6 +49,21 @@ function getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
function isNodeVersionAvailable(version: NodeVersion): boolean {
|
||||
try {
|
||||
return statSync(`/node${version.major}`).isDirectory();
|
||||
} catch {
|
||||
// ENOENT, or any other error, we don't care about
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function getAvailableNodeVersions(): NodeVersionMajor[] {
|
||||
return getOptions()
|
||||
.filter(isNodeVersionAvailable)
|
||||
.map(n => n.major);
|
||||
}
|
||||
|
||||
function getHint(isAuto = false) {
|
||||
const { major, range } = getLatestNodeVersion();
|
||||
return isAuto
|
||||
@@ -53,8 +71,22 @@ function getHint(isAuto = false) {
|
||||
: `Please set "engines": { "node": "${range}" } in your \`package.json\` file to use Node.js ${major}.`;
|
||||
}
|
||||
|
||||
export function getLatestNodeVersion() {
|
||||
return getOptions()[0];
|
||||
export function getLatestNodeVersion(availableVersions?: NodeVersionMajor[]) {
|
||||
const all = getOptions();
|
||||
if (availableVersions) {
|
||||
// Return the first node version that is definitely
|
||||
// available in the build-container.
|
||||
for (const version of all) {
|
||||
for (const major of availableVersions) {
|
||||
if (version.major === major) {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// As a fallback for local `vc build` and the tests,
|
||||
// return the first node version if none is found.
|
||||
return all[0];
|
||||
}
|
||||
|
||||
export function getDiscontinuedNodeVersions(): NodeVersion[] {
|
||||
@@ -63,9 +95,10 @@ export function getDiscontinuedNodeVersions(): NodeVersion[] {
|
||||
|
||||
export async function getSupportedNodeVersion(
|
||||
engineRange: string | undefined,
|
||||
isAuto = false
|
||||
isAuto = false,
|
||||
availableVersions?: NodeVersionMajor[]
|
||||
): Promise<NodeVersion> {
|
||||
let selection: NodeVersion = getLatestNodeVersion();
|
||||
let selection: NodeVersion | undefined;
|
||||
|
||||
if (engineRange) {
|
||||
const found =
|
||||
@@ -74,7 +107,12 @@ export async function getSupportedNodeVersion(
|
||||
// the array is already in order so return the first
|
||||
// match which will be the newest version of node
|
||||
selection = o;
|
||||
return intersects(o.range, engineRange);
|
||||
return (
|
||||
intersects(o.range, engineRange) &&
|
||||
(availableVersions?.length
|
||||
? availableVersions.includes(o.major)
|
||||
: true)
|
||||
);
|
||||
});
|
||||
if (!found) {
|
||||
throw new NowBuildError({
|
||||
@@ -87,6 +125,10 @@ export async function getSupportedNodeVersion(
|
||||
}
|
||||
}
|
||||
|
||||
if (!selection) {
|
||||
selection = getLatestNodeVersion(availableVersions);
|
||||
}
|
||||
|
||||
if (isDiscontinued(selection)) {
|
||||
const intro = `Node.js Version "${selection.range}" is discontinued and must be upgraded.`;
|
||||
throw new NowBuildError({
|
||||
|
||||
@@ -9,7 +9,11 @@ import { deprecate } from 'util';
|
||||
import debug from '../debug';
|
||||
import { NowBuildError } from '../errors';
|
||||
import { Meta, PackageJson, NodeVersion, Config } from '../types';
|
||||
import { getSupportedNodeVersion, getLatestNodeVersion } from './node-version';
|
||||
import {
|
||||
getSupportedNodeVersion,
|
||||
getLatestNodeVersion,
|
||||
getAvailableNodeVersions,
|
||||
} from './node-version';
|
||||
import { readConfigFile } from './read-config-file';
|
||||
import { cloneEnv } from '../clone-env';
|
||||
|
||||
@@ -238,9 +242,10 @@ export async function getNodeVersion(
|
||||
destPath: string,
|
||||
nodeVersionFallback = process.env.VERCEL_PROJECT_SETTINGS_NODE_VERSION,
|
||||
config: Config = {},
|
||||
meta: Meta = {}
|
||||
meta: Meta = {},
|
||||
availableVersions = getAvailableNodeVersions()
|
||||
): Promise<NodeVersion> {
|
||||
const latest = getLatestNodeVersion();
|
||||
const latest = getLatestNodeVersion(availableVersions);
|
||||
if (meta.isDev) {
|
||||
// Use the system-installed version of `node` in PATH for `vercel dev`
|
||||
return { ...latest, runtime: 'nodejs' };
|
||||
@@ -266,7 +271,7 @@ export async function getNodeVersion(
|
||||
nodeVersion = node;
|
||||
isAuto = false;
|
||||
}
|
||||
return getSupportedNodeVersion(nodeVersion, isAuto);
|
||||
return getSupportedNodeVersion(nodeVersion, isAuto, availableVersions);
|
||||
}
|
||||
|
||||
export async function scanParentDirs(
|
||||
|
||||
36
packages/build-utils/test/unit.test.ts
vendored
36
packages/build-utils/test/unit.test.ts
vendored
@@ -127,6 +127,27 @@ it('should allow nodejs18.x', async () => {
|
||||
expect(await getSupportedNodeVersion('>=16')).toHaveProperty('major', 18);
|
||||
});
|
||||
|
||||
it('should not allow nodejs20.x when not available', async () => {
|
||||
// Simulates AL2 build-container
|
||||
await expect(
|
||||
getSupportedNodeVersion('20.x', true, [14, 16, 18])
|
||||
).rejects.toThrow(
|
||||
'Found invalid Node.js Version: "20.x". Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.'
|
||||
);
|
||||
});
|
||||
|
||||
it('should not allow nodejs18.x when not available', async () => {
|
||||
// Simulates AL2023 build-container
|
||||
try {
|
||||
process.env.VERCEL_ALLOW_NODEJS20 = '1';
|
||||
await expect(getSupportedNodeVersion('18.x', true, [20])).rejects.toThrow(
|
||||
'Found invalid Node.js Version: "18.x". Please set Node.js Version to 20.x in your Project Settings to use Node.js 20.'
|
||||
);
|
||||
} finally {
|
||||
delete process.env.VERCEL_ALLOW_NODEJS20;
|
||||
}
|
||||
});
|
||||
|
||||
it('should ignore node version in vercel dev getNodeVersion()', async () => {
|
||||
expect(
|
||||
await getNodeVersion(
|
||||
@@ -235,6 +256,21 @@ it('should get latest node version', async () => {
|
||||
expect(getLatestNodeVersion()).toHaveProperty('major', 18);
|
||||
});
|
||||
|
||||
it('should get latest node version with Node 18.x in build-container', async () => {
|
||||
// Simulates AL2 build-container
|
||||
expect(getLatestNodeVersion([14, 16, 18])).toHaveProperty('major', 18);
|
||||
});
|
||||
|
||||
it('should get latest node version with Node 20.x in build-container', async () => {
|
||||
// Simulates AL2023 build-container
|
||||
try {
|
||||
process.env.VERCEL_ALLOW_NODEJS20 = '1';
|
||||
expect(getLatestNodeVersion([20])).toHaveProperty('major', 20);
|
||||
} finally {
|
||||
delete process.env.VERCEL_ALLOW_NODEJS20;
|
||||
}
|
||||
});
|
||||
|
||||
it('should throw for discontinued versions', async () => {
|
||||
// Mock a future date so that Node 8 and 10 become discontinued
|
||||
const realDateNow = Date.now.bind(global.Date);
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# vercel
|
||||
|
||||
## 32.5.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`65dec5b7e`](https://github.com/vercel/vercel/commit/65dec5b7e752f4da8fe0ffdb25215170453f6f8b)]:
|
||||
- @vercel/build-utils@7.2.4
|
||||
- @vercel/node@3.0.10
|
||||
- @vercel/static-build@2.0.11
|
||||
|
||||
## 32.5.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "32.5.3-better-error-ai",
|
||||
"version": "32.5.4",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -31,20 +31,18 @@
|
||||
"node": ">= 16"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"@vercel/fun": "1.1.0",
|
||||
"@vercel/go": "3.0.3",
|
||||
"@vercel/hydrogen": "1.0.1",
|
||||
"@vercel/next": "4.0.14",
|
||||
"@vercel/node": "3.0.9",
|
||||
"@vercel/node": "3.0.10",
|
||||
"@vercel/python": "4.1.0",
|
||||
"@vercel/redwood": "2.0.5",
|
||||
"@vercel/remix-builder": "2.0.11",
|
||||
"@vercel/ruby": "2.0.2",
|
||||
"@vercel/static-build": "2.0.10",
|
||||
"chokidar": "3.3.1",
|
||||
"dirty-json": "0.9.2",
|
||||
"openai": "4.17.5"
|
||||
"@vercel/static-build": "2.0.11",
|
||||
"chokidar": "3.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
@@ -90,8 +88,8 @@
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel-internals/constants": "1.0.4",
|
||||
"@vercel-internals/get-package-json": "1.0.0",
|
||||
"@vercel-internals/types": "1.0.14",
|
||||
"@vercel/client": "13.0.7",
|
||||
"@vercel-internals/types": "1.0.15",
|
||||
"@vercel/client": "13.0.8",
|
||||
"@vercel/error-utils": "2.0.2",
|
||||
"@vercel/frameworks": "2.0.3",
|
||||
"@vercel/fs-detectors": "5.1.3",
|
||||
|
||||
@@ -155,14 +155,6 @@ export const deployCommand: Command = {
|
||||
description: 'Use default options to skip all prompts',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'ai',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Super-powered AI Deployments',
|
||||
multi: false,
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
{
|
||||
|
||||
@@ -2,9 +2,7 @@ import ms from 'ms';
|
||||
import fs from 'fs-extra';
|
||||
import bytes from 'bytes';
|
||||
import chalk from 'chalk';
|
||||
import path, { join, resolve } from 'path';
|
||||
import util from 'util';
|
||||
import sleep from '../../util/sleep';
|
||||
import { join, resolve } from 'path';
|
||||
import {
|
||||
fileNameSymbol,
|
||||
VALID_ARCHIVE_FORMATS,
|
||||
@@ -67,18 +65,11 @@ import getPrebuiltJson from '../../util/deploy/get-prebuilt-json';
|
||||
import { createGitMeta } from '../../util/create-git-meta';
|
||||
import { isValidArchive } from '../../util/deploy/validate-archive-format';
|
||||
import { parseEnv } from '../../util/parse-env';
|
||||
import { errorToString, isErrnoException } from '@vercel/error-utils';
|
||||
import { errorToString, isErrnoException, isError } from '@vercel/error-utils';
|
||||
import { pickOverrides } from '../../util/projects/project-settings';
|
||||
import { printDeploymentStatus } from '../../util/deploy/print-deployment-status';
|
||||
import { help } from '../help';
|
||||
import { deployCommand } from './command';
|
||||
import OpenAI from 'openai';
|
||||
import printEvents from '../../util/events';
|
||||
import execa from 'execa';
|
||||
// @ts-ignore
|
||||
import dJSON from 'dirty-json';
|
||||
|
||||
const openai = new OpenAI({});
|
||||
|
||||
export default async (client: Client): Promise<number> => {
|
||||
const { output } = client;
|
||||
@@ -176,10 +167,6 @@ export default async (client: Client): Promise<number> => {
|
||||
let { path: cwd } = pathValidation;
|
||||
const autoConfirm = argv['--yes'];
|
||||
|
||||
if (argv['--ai']) {
|
||||
output.log(`🔮 This deployment is powered by AI\n`);
|
||||
}
|
||||
|
||||
// deprecate --name
|
||||
if (argv['--name']) {
|
||||
output.print(
|
||||
@@ -659,290 +646,8 @@ export default async (client: Client): Promise<number> => {
|
||||
return 1;
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
if (util.types.isNativeError(err)) {
|
||||
if (isError(err)) {
|
||||
debug(`Error: ${err}\n${err.stack}`);
|
||||
|
||||
if (err instanceof BuildError) {
|
||||
output.error('🔮 A build error occurred');
|
||||
|
||||
let s = '';
|
||||
await sleep(2000);
|
||||
await printEvents(client, now.url as string, {
|
||||
mode: 'logs',
|
||||
// @ts-ignore
|
||||
onEvent: event => {
|
||||
s += `${event.date} ${event.text}\n`;
|
||||
},
|
||||
quiet: false,
|
||||
findOpts: {
|
||||
direction: 'forward',
|
||||
limit: 100,
|
||||
since: 0,
|
||||
until: 0,
|
||||
},
|
||||
});
|
||||
|
||||
// console.log('sourcePath', sourcePath);
|
||||
|
||||
if (s) {
|
||||
// console.log('error logs', s);
|
||||
|
||||
output.spinner('🔮 Working on a solution now');
|
||||
|
||||
const packageJSON = fs.readFileSync(
|
||||
path.join(sourcePath, 'package.json'),
|
||||
'utf-8'
|
||||
);
|
||||
|
||||
const response = await openai.chat.completions.create({
|
||||
messages: [
|
||||
{
|
||||
role: 'system',
|
||||
content: `
|
||||
You are a Vercel help bot tasked with providing solutions for a user's deployment build error.
|
||||
|
||||
You will receive error logs and the project's package.json contents from the user.
|
||||
|
||||
You will analyze the error logs and determine the file path from where the error comes from. Call the error_file_path function with that path.
|
||||
`,
|
||||
},
|
||||
{
|
||||
role: 'user',
|
||||
content: `
|
||||
Error Logs:
|
||||
\`\`\`
|
||||
${s}
|
||||
\`\`\`
|
||||
|
||||
package.json contents:
|
||||
\`\`\`json
|
||||
${packageJSON}
|
||||
\`\`\`
|
||||
`,
|
||||
},
|
||||
],
|
||||
model: 'gpt-4-1106-preview',
|
||||
tools: [
|
||||
{
|
||||
type: 'function',
|
||||
function: {
|
||||
name: 'error_file_path',
|
||||
description: 'the file path for the error',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
file_path: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
required: ['file_path'],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// console.log('response 1: ', JSON.stringify(response, undefined, 2));
|
||||
|
||||
const toolCalls = response.choices[0].message.tool_calls;
|
||||
if (!toolCalls) {
|
||||
throw new Error('Problem with response from AI');
|
||||
}
|
||||
|
||||
let errorFilePath;
|
||||
try {
|
||||
errorFilePath = JSON.parse(toolCalls[0].function.arguments);
|
||||
} catch (e) {
|
||||
errorFilePath = dJSON.parse(toolCalls[0].function.arguments);
|
||||
}
|
||||
|
||||
const filePath = errorFilePath.file_path.replace(
|
||||
'/vercel/path0/',
|
||||
''
|
||||
);
|
||||
|
||||
const fileContents = fs.readFileSync(
|
||||
path.join(sourcePath, filePath),
|
||||
'utf-8'
|
||||
);
|
||||
|
||||
const r2 = await openai.chat.completions.create({
|
||||
messages: [
|
||||
{
|
||||
role: 'system',
|
||||
content: `
|
||||
You are a Vercel help bot tasked with providing solutions for a user's deployment build error.
|
||||
|
||||
You will receive error logs, the project's package.json contents, and the errored file contents from the user.
|
||||
|
||||
You will recommend them one solution for their error, and return that solution using the recommended_solution function.
|
||||
|
||||
The solution should either be a command or a code change. A code change should be written as a git diff for the errored file. The solution should be succinct and based off the context of the error logs.
|
||||
|
||||
If the error is similar to "Cannot find module", compare the missing module to those listed as dependencies or devDependencies in the package.json. If the missing module is similar to one listed in package.json, recommend the code change solution to import the existing dependency. If the missing module is unlike any listed in package.json, recommend the user installs that dependency by executing a command.
|
||||
`,
|
||||
},
|
||||
{
|
||||
role: 'user',
|
||||
content: `
|
||||
Error Logs:
|
||||
\`\`\`
|
||||
${s}
|
||||
\`\`\`
|
||||
|
||||
package.json contents:
|
||||
\`\`\`json
|
||||
${packageJSON}
|
||||
\`\`\`
|
||||
|
||||
${filePath} contents:
|
||||
\`\`\`
|
||||
${fileContents}
|
||||
\`\`\`
|
||||
`,
|
||||
},
|
||||
],
|
||||
model: 'gpt-4-1106-preview',
|
||||
tools: [
|
||||
{
|
||||
type: 'function',
|
||||
function: {
|
||||
name: 'recommended_solution',
|
||||
description:
|
||||
'The recommended solution for the detected error.',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
solution_description: {
|
||||
type: 'string',
|
||||
description:
|
||||
'A generalized description for the recommended solution.',
|
||||
},
|
||||
solution: {
|
||||
type: 'string',
|
||||
description:
|
||||
'The command to execute or code diff to change.',
|
||||
},
|
||||
solution_type: {
|
||||
type: 'string',
|
||||
enum: ['command', 'diff'],
|
||||
},
|
||||
},
|
||||
required: [
|
||||
'solution_description',
|
||||
'solution',
|
||||
'solution_type',
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
output.stopSpinner();
|
||||
|
||||
// console.log('response 2: ', JSON.stringify(r2, undefined, 2));
|
||||
|
||||
const toolCalls2 = r2.choices[0].message.tool_calls;
|
||||
if (!toolCalls2) {
|
||||
throw new Error('Problem with response from AI');
|
||||
}
|
||||
|
||||
let recommendedSolution;
|
||||
|
||||
try {
|
||||
recommendedSolution = JSON.parse(toolCalls2[0].function.arguments);
|
||||
} catch (e) {
|
||||
recommendedSolution = dJSON.parse(toolCalls2[0].function.arguments);
|
||||
}
|
||||
|
||||
// let args = toolCalls2[0].function.arguments;
|
||||
|
||||
// const i1 = args.indexOf('"solution"');
|
||||
// const i2 = args.indexOf('"solution_type"');
|
||||
|
||||
// args = args.slice(0, i1) + args.slice(i1, i2-4).replaceAll('\n', '\\n') + args.slice(i2-4);
|
||||
|
||||
// console.log(args);
|
||||
|
||||
// console.log('recsol', recommendedSolution);
|
||||
|
||||
output.log(recommendedSolution.solution_description);
|
||||
|
||||
if (recommendedSolution.solution_type === 'diff') {
|
||||
const solutionDiff = path.join(sourcePath, 'solution.diff');
|
||||
let sol = recommendedSolution.solution;
|
||||
if (!sol.endsWith('\n')) sol += '\n';
|
||||
fs.writeFileSync(solutionDiff, recommendedSolution.solution);
|
||||
output.log(`solution.diff:
|
||||
|
||||
${recommendedSolution.solution}`);
|
||||
const answer = await client.prompt({
|
||||
name: 'diff_apply',
|
||||
type: 'confirm',
|
||||
message: `Do you want me to execute \`git apply solution.diff\` in ${sourcePath}?`,
|
||||
});
|
||||
if (answer.diff_apply) {
|
||||
try {
|
||||
const { stdout, stderr } = await execa(
|
||||
'git',
|
||||
['apply', 'solution.diff'],
|
||||
{ cwd: sourcePath }
|
||||
);
|
||||
if (stdout) {
|
||||
output.log(stdout);
|
||||
}
|
||||
|
||||
if (stderr) {
|
||||
output.error(stderr);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
fs.rmSync(solutionDiff);
|
||||
output.log('🔮 Solution Applied! Try redeploying.');
|
||||
return 1;
|
||||
}
|
||||
} else if (recommendedSolution.solution_type === 'command') {
|
||||
const answer = await client.prompt({
|
||||
name: 'command_exec',
|
||||
type: 'confirm',
|
||||
message: `Do you want me to execute \`${recommendedSolution.solution}\` in ${sourcePath}?`,
|
||||
});
|
||||
if (answer.command_exec) {
|
||||
try {
|
||||
const cmnd = recommendedSolution.solution.split(' ');
|
||||
const { stdout, stderr } = await execa(cmnd[0], cmnd.slice(1), {
|
||||
cwd: sourcePath,
|
||||
});
|
||||
if (stdout) {
|
||||
output.log(stdout);
|
||||
}
|
||||
|
||||
if (stderr) {
|
||||
output.error(stderr);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
output.log('🔮 Solution Applied! Try redeploying.');
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
throw new Error('Ai returned unknown solution type');
|
||||
}
|
||||
|
||||
// output.stopSpinner();
|
||||
|
||||
// output.log('🔮 Better Error\n');
|
||||
|
||||
// for await (const chunk of response) {
|
||||
// output.stream.write(chunk.choices[0]?.delta?.content || '');
|
||||
// }
|
||||
|
||||
// output.stream.write('\n\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (err instanceof NotDomainOwner) {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @vercel/client
|
||||
|
||||
## 13.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`65dec5b7e`](https://github.com/vercel/vercel/commit/65dec5b7e752f4da8fe0ffdb25215170453f6f8b)]:
|
||||
- @vercel/build-utils@7.2.4
|
||||
|
||||
## 13.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/client",
|
||||
"version": "13.0.7",
|
||||
"version": "13.0.8",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"homepage": "https://vercel.com",
|
||||
@@ -37,7 +37,7 @@
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"@vercel/routing-utils": "3.1.0",
|
||||
"@zeit/fetch": "5.2.0",
|
||||
"async-retry": "1.2.3",
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/semver": "7.3.10",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"jest-junit": "16.0.0",
|
||||
"typescript": "4.9.5"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @vercel/gatsby-plugin-vercel-builder
|
||||
|
||||
## 2.0.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`65dec5b7e`](https://github.com/vercel/vercel/commit/65dec5b7e752f4da8fe0ffdb25215170453f6f8b)]:
|
||||
- @vercel/build-utils@7.2.4
|
||||
|
||||
## 2.0.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/gatsby-plugin-vercel-builder",
|
||||
"version": "2.0.9",
|
||||
"version": "2.0.10",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@sinclair/typebox": "0.25.24",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"@vercel/routing-utils": "3.1.0",
|
||||
"esbuild": "0.14.47",
|
||||
"etag": "1.8.1",
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"@types/node-fetch": "^2.3.0",
|
||||
"@types/tar": "6.1.5",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"async-retry": "1.3.3",
|
||||
"execa": "^1.0.0",
|
||||
"fs-extra": "^7.0.0",
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.5.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"jest-junit": "16.0.0"
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"@types/semver": "6.0.0",
|
||||
"@types/text-table": "0.2.1",
|
||||
"@types/webpack-sources": "3.2.0",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"@vercel/routing-utils": "3.1.0",
|
||||
"async-sema": "3.0.1",
|
||||
"buffer-crc32": "0.2.13",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @vercel/node
|
||||
|
||||
## 3.0.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`65dec5b7e`](https://github.com/vercel/vercel/commit/65dec5b7e752f4da8fe0ffdb25215170453f6f8b)]:
|
||||
- @vercel/build-utils@7.2.4
|
||||
|
||||
## 3.0.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/node",
|
||||
"version": "3.0.9",
|
||||
"version": "3.0.10",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
|
||||
@@ -24,7 +24,7 @@
|
||||
"@edge-runtime/primitives": "4.0.5",
|
||||
"@edge-runtime/vm": "3.1.7",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"@vercel/error-utils": "2.0.2",
|
||||
"@vercel/nft": "0.24.2",
|
||||
"@vercel/static-config": "3.0.0",
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"@types/jest": "27.4.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/which": "3.0.0",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"execa": "^1.0.0",
|
||||
"fs-extra": "11.1.1",
|
||||
"jest-junit": "16.0.0",
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
"@types/aws-lambda": "8.10.19",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/semver": "6.0.0",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"jest-junit": "16.0.0"
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"@types/jest": "27.5.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@types/semver": "7.3.13",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"jest-junit": "16.0.0",
|
||||
"path-to-regexp": "6.2.1",
|
||||
"semver": "7.5.2"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "8.0.0",
|
||||
"@types/semver": "6.0.0",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"execa": "2.0.4",
|
||||
"fs-extra": "^7.0.1",
|
||||
"jest-junit": "16.0.0",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @vercel/static-build
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @vercel/gatsby-plugin-vercel-builder@2.0.10
|
||||
|
||||
## 2.0.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/static-build",
|
||||
"version": "2.0.10",
|
||||
"version": "2.0.11",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/build-step",
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/gatsby-plugin-vercel-analytics": "1.0.11",
|
||||
"@vercel/gatsby-plugin-vercel-builder": "2.0.9",
|
||||
"@vercel/gatsby-plugin-vercel-builder": "2.0.10",
|
||||
"@vercel/static-config": "3.0.0",
|
||||
"ts-morph": "12.0.0"
|
||||
},
|
||||
@@ -35,7 +35,7 @@
|
||||
"@types/node-fetch": "2.5.4",
|
||||
"@types/promise-timeout": "1.3.0",
|
||||
"@types/semver": "7.3.13",
|
||||
"@vercel/build-utils": "7.2.3",
|
||||
"@vercel/build-utils": "7.2.4",
|
||||
"@vercel/error-utils": "2.0.2",
|
||||
"@vercel/frameworks": "2.0.3",
|
||||
"@vercel/fs-detectors": "5.1.3",
|
||||
|
||||
38
pnpm-lock.yaml
generated
38
pnpm-lock.yaml
generated
@@ -186,7 +186,7 @@ importers:
|
||||
specifier: 1.0.4
|
||||
version: link:../constants
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../../packages/build-utils
|
||||
'@vercel/routing-utils':
|
||||
specifier: 3.1.0
|
||||
@@ -310,7 +310,7 @@ importers:
|
||||
packages/cli:
|
||||
dependencies:
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
'@vercel/fun':
|
||||
specifier: 1.1.0
|
||||
@@ -325,7 +325,7 @@ importers:
|
||||
specifier: 4.0.14
|
||||
version: link:../next
|
||||
'@vercel/node':
|
||||
specifier: 3.0.9
|
||||
specifier: 3.0.10
|
||||
version: link:../node
|
||||
'@vercel/python':
|
||||
specifier: 4.1.0
|
||||
@@ -340,7 +340,7 @@ importers:
|
||||
specifier: 2.0.2
|
||||
version: link:../ruby
|
||||
'@vercel/static-build':
|
||||
specifier: 2.0.10
|
||||
specifier: 2.0.11
|
||||
version: link:../static-build
|
||||
chokidar:
|
||||
specifier: 3.3.1
|
||||
@@ -476,10 +476,10 @@ importers:
|
||||
specifier: 1.0.0
|
||||
version: link:../../internals/get-package-json
|
||||
'@vercel-internals/types':
|
||||
specifier: 1.0.14
|
||||
specifier: 1.0.15
|
||||
version: link:../../internals/types
|
||||
'@vercel/client':
|
||||
specifier: 13.0.7
|
||||
specifier: 13.0.8
|
||||
version: link:../client
|
||||
'@vercel/error-utils':
|
||||
specifier: 2.0.2
|
||||
@@ -722,7 +722,7 @@ importers:
|
||||
packages/client:
|
||||
dependencies:
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
'@vercel/routing-utils':
|
||||
specifier: 3.1.0
|
||||
@@ -923,7 +923,7 @@ importers:
|
||||
specifier: 7.3.10
|
||||
version: 7.3.10
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
jest-junit:
|
||||
specifier: 16.0.0
|
||||
@@ -948,7 +948,7 @@ importers:
|
||||
specifier: 0.25.24
|
||||
version: 0.25.24
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
'@vercel/routing-utils':
|
||||
specifier: 3.1.0
|
||||
@@ -1015,7 +1015,7 @@ importers:
|
||||
specifier: 2.1.0
|
||||
version: 2.1.0
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
async-retry:
|
||||
specifier: 1.3.3
|
||||
@@ -1064,7 +1064,7 @@ importers:
|
||||
specifier: 14.18.33
|
||||
version: 14.18.33
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
execa:
|
||||
specifier: 3.2.0
|
||||
@@ -1125,7 +1125,7 @@ importers:
|
||||
specifier: 3.2.0
|
||||
version: 3.2.0
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
'@vercel/routing-utils':
|
||||
specifier: 3.1.0
|
||||
@@ -1212,7 +1212,7 @@ importers:
|
||||
specifier: 14.18.33
|
||||
version: 14.18.33
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
'@vercel/error-utils':
|
||||
specifier: 2.0.2
|
||||
@@ -1321,7 +1321,7 @@ importers:
|
||||
specifier: 3.0.0
|
||||
version: 3.0.0
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
execa:
|
||||
specifier: ^1.0.0
|
||||
@@ -1358,7 +1358,7 @@ importers:
|
||||
specifier: 6.0.0
|
||||
version: 6.0.0
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
execa:
|
||||
specifier: 3.2.0
|
||||
@@ -1395,7 +1395,7 @@ importers:
|
||||
specifier: 7.3.13
|
||||
version: 7.3.13
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
jest-junit:
|
||||
specifier: 16.0.0
|
||||
@@ -1439,7 +1439,7 @@ importers:
|
||||
specifier: 6.0.0
|
||||
version: 6.0.0
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
execa:
|
||||
specifier: 2.0.4
|
||||
@@ -1460,7 +1460,7 @@ importers:
|
||||
specifier: 1.0.11
|
||||
version: link:../gatsby-plugin-vercel-analytics
|
||||
'@vercel/gatsby-plugin-vercel-builder':
|
||||
specifier: 2.0.9
|
||||
specifier: 2.0.10
|
||||
version: link:../gatsby-plugin-vercel-builder
|
||||
'@vercel/static-config':
|
||||
specifier: 3.0.0
|
||||
@@ -1497,7 +1497,7 @@ importers:
|
||||
specifier: 7.3.13
|
||||
version: 7.3.13
|
||||
'@vercel/build-utils':
|
||||
specifier: 7.2.3
|
||||
specifier: 7.2.4
|
||||
version: link:../build-utils
|
||||
'@vercel/error-utils':
|
||||
specifier: 2.0.2
|
||||
|
||||
Reference in New Issue
Block a user