@vercel/build-utils 2.12.3-canary.18 → 2.12.3-canary.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/convert-runtime-to-plugin.d.ts +26 -3
- package/dist/convert-runtime-to-plugin.js +25 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +137 -87
- package/package.json +3 -3
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Lambda } from './lambda';
|
2
|
-
import type { BuildOptions } from './types';
|
2
|
+
import type { BuilderFunctions, BuildOptions } from './types';
|
3
3
|
/**
|
4
4
|
* Convert legacy Runtime to a Plugin.
|
5
5
|
* @param buildRuntime - a legacy build() function from a Runtime
|
@@ -7,7 +7,11 @@ import type { BuildOptions } from './types';
|
|
7
7
|
*/
|
8
8
|
export declare function convertRuntimeToPlugin(buildRuntime: (options: BuildOptions) => Promise<{
|
9
9
|
output: Lambda;
|
10
|
-
}>, ext: string): ({ workPath }: {
|
10
|
+
}>, ext: string): ({ vercelConfig, workPath, }: {
|
11
|
+
vercelConfig: {
|
12
|
+
functions?: BuilderFunctions;
|
13
|
+
regions?: string[];
|
14
|
+
};
|
11
15
|
workPath: string;
|
12
16
|
}) => Promise<void>;
|
13
17
|
/**
|
@@ -15,9 +19,28 @@ export declare function convertRuntimeToPlugin(buildRuntime: (options: BuildOpti
|
|
15
19
|
* property. Otherwise write a new file. This will also read `vercel.json`
|
16
20
|
* and apply relevant `functions` property config.
|
17
21
|
*/
|
18
|
-
export declare function updateFunctionsManifest({ workPath, pages, }: {
|
22
|
+
export declare function updateFunctionsManifest({ vercelConfig, workPath, pages, }: {
|
23
|
+
vercelConfig: {
|
24
|
+
functions?: BuilderFunctions;
|
25
|
+
regions?: string[];
|
26
|
+
};
|
19
27
|
workPath: string;
|
20
28
|
pages: {
|
21
29
|
[key: string]: any;
|
22
30
|
};
|
23
31
|
}): Promise<void>;
|
32
|
+
/**
|
33
|
+
* Will append routes to the `routes-manifest.json` file.
|
34
|
+
* If the file does not exist, it'll be created.
|
35
|
+
*/
|
36
|
+
export declare function updateRoutesManifest({ workPath, dynamicRoutes, }: {
|
37
|
+
workPath: string;
|
38
|
+
dynamicRoutes?: {
|
39
|
+
page: string;
|
40
|
+
regex: string;
|
41
|
+
namedRegex?: string;
|
42
|
+
routeKeys?: {
|
43
|
+
[named: string]: string;
|
44
|
+
};
|
45
|
+
}[];
|
46
|
+
}): Promise<void>;
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.updateFunctionsManifest = exports.convertRuntimeToPlugin = void 0;
|
6
|
+
exports.updateRoutesManifest = exports.updateFunctionsManifest = exports.convertRuntimeToPlugin = void 0;
|
7
7
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
8
8
|
const path_1 = require("path");
|
9
9
|
const glob_1 = __importDefault(require("./fs/glob"));
|
@@ -16,13 +16,14 @@ const minimatch_1 = __importDefault(require("minimatch"));
|
|
16
16
|
* @param ext - the file extension, for example `.py`
|
17
17
|
*/
|
18
18
|
function convertRuntimeToPlugin(buildRuntime, ext) {
|
19
|
-
|
19
|
+
// This `build()` signature should match `plugin.build()` signature in `vercel build`.
|
20
|
+
return async function build({ vercelConfig, workPath, }) {
|
20
21
|
const opts = { cwd: workPath };
|
21
22
|
const files = await glob_1.default('**', opts);
|
22
23
|
delete files['vercel.json']; // Builders/Runtimes didn't have vercel.json
|
23
24
|
const entrypoints = await glob_1.default(`api/**/*${ext}`, opts);
|
24
25
|
const pages = {};
|
25
|
-
const { functions = {} } =
|
26
|
+
const { functions = {} } = vercelConfig;
|
26
27
|
const traceDir = path_1.join(workPath, '.output', 'runtime-traced-files');
|
27
28
|
await fs_extra_1.default.ensureDir(traceDir);
|
28
29
|
for (const entrypoint of Object.keys(entrypoints)) {
|
@@ -78,7 +79,7 @@ function convertRuntimeToPlugin(buildRuntime, ext) {
|
|
78
79
|
await fs_extra_1.default.ensureDir(path_1.dirname(nft));
|
79
80
|
await fs_extra_1.default.writeFile(nft, json);
|
80
81
|
}
|
81
|
-
await updateFunctionsManifest({ workPath, pages });
|
82
|
+
await updateFunctionsManifest({ vercelConfig, workPath, pages });
|
82
83
|
};
|
83
84
|
}
|
84
85
|
exports.convertRuntimeToPlugin = convertRuntimeToPlugin;
|
@@ -104,18 +105,13 @@ async function readJson(filePath) {
|
|
104
105
|
throw err;
|
105
106
|
}
|
106
107
|
}
|
107
|
-
async function readVercelConfig(workPath) {
|
108
|
-
const vercelJsonPath = path_1.join(workPath, 'vercel.json');
|
109
|
-
return readJson(vercelJsonPath);
|
110
|
-
}
|
111
108
|
/**
|
112
109
|
* If `.output/functions-manifest.json` exists, append to the pages
|
113
110
|
* property. Otherwise write a new file. This will also read `vercel.json`
|
114
111
|
* and apply relevant `functions` property config.
|
115
112
|
*/
|
116
|
-
async function updateFunctionsManifest({ workPath, pages, }) {
|
113
|
+
async function updateFunctionsManifest({ vercelConfig, workPath, pages, }) {
|
117
114
|
const functionsManifestPath = path_1.join(workPath, '.output', 'functions-manifest.json');
|
118
|
-
const vercelConfig = await readVercelConfig(workPath);
|
119
115
|
const functionsManifest = await readJson(functionsManifestPath);
|
120
116
|
if (!functionsManifest.version)
|
121
117
|
functionsManifest.version = 1;
|
@@ -136,3 +132,22 @@ async function updateFunctionsManifest({ workPath, pages, }) {
|
|
136
132
|
await fs_extra_1.default.writeFile(functionsManifestPath, JSON.stringify(functionsManifest));
|
137
133
|
}
|
138
134
|
exports.updateFunctionsManifest = updateFunctionsManifest;
|
135
|
+
/**
|
136
|
+
* Will append routes to the `routes-manifest.json` file.
|
137
|
+
* If the file does not exist, it'll be created.
|
138
|
+
*/
|
139
|
+
async function updateRoutesManifest({ workPath, dynamicRoutes, }) {
|
140
|
+
const routesManifestPath = path_1.join(workPath, '.output', 'routes-manifest.json');
|
141
|
+
const routesManifest = await readJson(routesManifestPath);
|
142
|
+
if (!routesManifest.version)
|
143
|
+
routesManifest.version = 1;
|
144
|
+
if (routesManifest.pages404 === undefined)
|
145
|
+
routesManifest.pages404 = true;
|
146
|
+
if (dynamicRoutes) {
|
147
|
+
if (!routesManifest.dynamicRoutes)
|
148
|
+
routesManifest.dynamicRoutes = [];
|
149
|
+
routesManifest.dynamicRoutes.push(...dynamicRoutes);
|
150
|
+
}
|
151
|
+
await fs_extra_1.default.writeFile(routesManifestPath, JSON.stringify(routesManifest));
|
152
|
+
}
|
153
|
+
exports.updateRoutesManifest = updateRoutesManifest;
|
package/dist/index.d.ts
CHANGED
@@ -18,7 +18,7 @@ export { detectFramework } from './detect-framework';
|
|
18
18
|
export { DetectorFilesystem } from './detectors/filesystem';
|
19
19
|
export { readConfigFile } from './fs/read-config-file';
|
20
20
|
export { normalizePath } from './fs/normalize-path';
|
21
|
-
export { convertRuntimeToPlugin, updateFunctionsManifest, } from './convert-runtime-to-plugin';
|
21
|
+
export { convertRuntimeToPlugin, updateFunctionsManifest, updateRoutesManifest, } from './convert-runtime-to-plugin';
|
22
22
|
export * from './schemas';
|
23
23
|
export * from './types';
|
24
24
|
export * from './errors';
|
package/dist/index.js
CHANGED
@@ -26130,6 +26130,7 @@ exports.frameworks = [
|
|
26130
26130
|
},
|
26131
26131
|
buildCommand: {
|
26132
26132
|
placeholder: '`npm run build` or `blitz build`',
|
26133
|
+
value: 'blitz build',
|
26133
26134
|
},
|
26134
26135
|
devCommand: {
|
26135
26136
|
value: 'blitz start',
|
@@ -26138,8 +26139,6 @@ exports.frameworks = [
|
|
26138
26139
|
placeholder: 'Next.js default',
|
26139
26140
|
},
|
26140
26141
|
},
|
26141
|
-
devCommand: 'blitz start',
|
26142
|
-
buildCommand: 'blitz build',
|
26143
26142
|
getFsOutputDir: async () => '.next',
|
26144
26143
|
getOutputDirName: async () => 'public',
|
26145
26144
|
},
|
@@ -26168,6 +26167,7 @@ exports.frameworks = [
|
|
26168
26167
|
},
|
26169
26168
|
buildCommand: {
|
26170
26169
|
placeholder: '`npm run build` or `next build`',
|
26170
|
+
value: 'next build',
|
26171
26171
|
},
|
26172
26172
|
devCommand: {
|
26173
26173
|
value: 'next dev --port $PORT',
|
@@ -26183,8 +26183,6 @@ exports.frameworks = [
|
|
26183
26183
|
dependencies: ['next-plugin-sentry', 'next-sentry-source-maps'],
|
26184
26184
|
},
|
26185
26185
|
],
|
26186
|
-
devCommand: 'next dev --port $PORT',
|
26187
|
-
buildCommand: 'next build',
|
26188
26186
|
getFsOutputDir: async () => '.next',
|
26189
26187
|
getOutputDirName: async () => 'public',
|
26190
26188
|
cachePattern: '.next/cache/**',
|
@@ -26197,7 +26195,7 @@ exports.frameworks = [
|
|
26197
26195
|
tagline: 'Gatsby helps developers build blazing fast websites and apps with React.',
|
26198
26196
|
description: 'A Gatsby app, using the default starter theme and a Serverless Function API.',
|
26199
26197
|
website: 'https://gatsbyjs.org',
|
26200
|
-
sort:
|
26198
|
+
sort: 5,
|
26201
26199
|
envPrefix: 'GATSBY_',
|
26202
26200
|
detectors: {
|
26203
26201
|
every: [
|
@@ -26213,6 +26211,7 @@ exports.frameworks = [
|
|
26213
26211
|
},
|
26214
26212
|
buildCommand: {
|
26215
26213
|
placeholder: '`npm run build` or `gatsby build`',
|
26214
|
+
value: 'gatsby build',
|
26216
26215
|
},
|
26217
26216
|
devCommand: {
|
26218
26217
|
value: 'gatsby develop --port $PORT',
|
@@ -26223,8 +26222,6 @@ exports.frameworks = [
|
|
26223
26222
|
},
|
26224
26223
|
},
|
26225
26224
|
dependency: 'gatsby',
|
26226
|
-
devCommand: 'gatsby develop --port $PORT',
|
26227
|
-
buildCommand: 'gatsby build',
|
26228
26225
|
getOutputDirName: async () => 'public',
|
26229
26226
|
getFsOutputDir: async () => 'public',
|
26230
26227
|
defaultRoutes: async (dirPrefix) => {
|
@@ -26273,6 +26270,73 @@ exports.frameworks = [
|
|
26273
26270
|
},
|
26274
26271
|
cachePattern: '{.cache,public}/**',
|
26275
26272
|
},
|
26273
|
+
{
|
26274
|
+
name: 'Remix',
|
26275
|
+
slug: 'remix',
|
26276
|
+
demo: 'https://remix.examples.vercel.com',
|
26277
|
+
logo: 'https://raw.githubusercontent.com/vercel/vercel/main/packages/frameworks/logos/remix.svg',
|
26278
|
+
tagline: 'Build Better Websites',
|
26279
|
+
description: 'A new Remix app — the result of running `npx create-remix`.',
|
26280
|
+
website: 'https://remix.run',
|
26281
|
+
sort: 6,
|
26282
|
+
detectors: {
|
26283
|
+
every: [
|
26284
|
+
{
|
26285
|
+
path: 'package.json',
|
26286
|
+
matchContent: '"(dev)?(d|D)ependencies":\\s*{[^}]*"remix":\\s*".+?"[^}]*}',
|
26287
|
+
},
|
26288
|
+
],
|
26289
|
+
},
|
26290
|
+
settings: {
|
26291
|
+
installCommand: {
|
26292
|
+
placeholder: '`yarn install` or `npm install`',
|
26293
|
+
},
|
26294
|
+
buildCommand: {
|
26295
|
+
value: 'remix build',
|
26296
|
+
placeholder: '`npm run build` or `remix build`',
|
26297
|
+
},
|
26298
|
+
devCommand: {
|
26299
|
+
value: 'remix dev',
|
26300
|
+
placeholder: 'remix dev',
|
26301
|
+
},
|
26302
|
+
outputDirectory: {
|
26303
|
+
value: 'public',
|
26304
|
+
},
|
26305
|
+
},
|
26306
|
+
dependency: 'remix',
|
26307
|
+
getFsOutputDir: async () => 'public',
|
26308
|
+
getOutputDirName: async () => 'public',
|
26309
|
+
defaultRoutes: [
|
26310
|
+
{
|
26311
|
+
src: '^/build/(.*)$',
|
26312
|
+
headers: { 'cache-control': 'public, max-age=31536000, immutable' },
|
26313
|
+
continue: true,
|
26314
|
+
},
|
26315
|
+
{
|
26316
|
+
handle: 'filesystem',
|
26317
|
+
},
|
26318
|
+
{
|
26319
|
+
src: '/(.*)',
|
26320
|
+
dest: '/api',
|
26321
|
+
},
|
26322
|
+
],
|
26323
|
+
defaultRewrites: [
|
26324
|
+
{
|
26325
|
+
source: '/(.*)',
|
26326
|
+
regex: '/(.*)',
|
26327
|
+
destination: '/api',
|
26328
|
+
},
|
26329
|
+
],
|
26330
|
+
defaultHeaders: [
|
26331
|
+
{
|
26332
|
+
source: '^/build/(.*)$',
|
26333
|
+
regex: '^/build/(.*)$',
|
26334
|
+
headers: [
|
26335
|
+
{ key: 'cache-control', value: 'public, max-age=31536000, immutable' },
|
26336
|
+
],
|
26337
|
+
},
|
26338
|
+
]
|
26339
|
+
},
|
26276
26340
|
{
|
26277
26341
|
name: 'Hexo',
|
26278
26342
|
slug: 'hexo',
|
@@ -26281,7 +26345,6 @@ exports.frameworks = [
|
|
26281
26345
|
tagline: 'Hexo is a fast, simple & powerful blog framework powered by Node.js.',
|
26282
26346
|
description: 'A Hexo site, created with the Hexo CLI.',
|
26283
26347
|
website: 'https://hexo.io',
|
26284
|
-
sort: 3,
|
26285
26348
|
detectors: {
|
26286
26349
|
every: [
|
26287
26350
|
{
|
@@ -26296,6 +26359,7 @@ exports.frameworks = [
|
|
26296
26359
|
},
|
26297
26360
|
buildCommand: {
|
26298
26361
|
placeholder: '`npm run build` or `hexo generate`',
|
26362
|
+
value: 'hexo generate',
|
26299
26363
|
},
|
26300
26364
|
devCommand: {
|
26301
26365
|
value: 'hexo server --port $PORT',
|
@@ -26306,8 +26370,6 @@ exports.frameworks = [
|
|
26306
26370
|
},
|
26307
26371
|
},
|
26308
26372
|
dependency: 'hexo',
|
26309
|
-
devCommand: 'hexo server --port $PORT',
|
26310
|
-
buildCommand: 'hexo generate',
|
26311
26373
|
getFsOutputDir: async () => 'public',
|
26312
26374
|
getOutputDirName: async () => 'public',
|
26313
26375
|
},
|
@@ -26319,7 +26381,6 @@ exports.frameworks = [
|
|
26319
26381
|
tagline: '11ty is a simpler static site generator written in JavaScript, created to be an alternative to Jekyll.',
|
26320
26382
|
description: 'An Eleventy site, created with npm init.',
|
26321
26383
|
website: 'https://www.11ty.dev',
|
26322
|
-
sort: 4,
|
26323
26384
|
detectors: {
|
26324
26385
|
every: [
|
26325
26386
|
{
|
@@ -26334,6 +26395,7 @@ exports.frameworks = [
|
|
26334
26395
|
},
|
26335
26396
|
buildCommand: {
|
26336
26397
|
placeholder: '`npm run build` or `npx @11ty/eleventy`',
|
26398
|
+
value: 'npx @11ty/eleventy',
|
26337
26399
|
},
|
26338
26400
|
devCommand: {
|
26339
26401
|
value: 'npx @11ty/eleventy --serve --watch --port $PORT',
|
@@ -26344,8 +26406,6 @@ exports.frameworks = [
|
|
26344
26406
|
},
|
26345
26407
|
},
|
26346
26408
|
dependency: '@11ty/eleventy',
|
26347
|
-
devCommand: 'npx @11ty/eleventy --serve --watch --port $PORT',
|
26348
|
-
buildCommand: 'npx @11ty/eleventy',
|
26349
26409
|
getFsOutputDir: async () => '_site',
|
26350
26410
|
getOutputDirName: async () => '_site',
|
26351
26411
|
cachePattern: '.cache/**',
|
@@ -26372,6 +26432,7 @@ exports.frameworks = [
|
|
26372
26432
|
},
|
26373
26433
|
buildCommand: {
|
26374
26434
|
placeholder: '`npm run build` or `docusaurus build`',
|
26435
|
+
value: 'docusaurus build',
|
26375
26436
|
},
|
26376
26437
|
devCommand: {
|
26377
26438
|
value: 'docusaurus start --port $PORT',
|
@@ -26382,8 +26443,6 @@ exports.frameworks = [
|
|
26382
26443
|
},
|
26383
26444
|
},
|
26384
26445
|
dependency: '@docusaurus/core',
|
26385
|
-
devCommand: 'docusaurus start --port $PORT',
|
26386
|
-
buildCommand: 'docusaurus build',
|
26387
26446
|
getFsOutputDir: async (dirPrefix) => {
|
26388
26447
|
const base = 'build';
|
26389
26448
|
try {
|
@@ -26517,6 +26576,7 @@ exports.frameworks = [
|
|
26517
26576
|
},
|
26518
26577
|
buildCommand: {
|
26519
26578
|
placeholder: '`npm run build` or `docusaurus-build`',
|
26579
|
+
value: 'docusaurus-build',
|
26520
26580
|
},
|
26521
26581
|
devCommand: {
|
26522
26582
|
value: 'docusaurus-start --port $PORT',
|
@@ -26527,8 +26587,6 @@ exports.frameworks = [
|
|
26527
26587
|
},
|
26528
26588
|
},
|
26529
26589
|
dependency: 'docusaurus',
|
26530
|
-
devCommand: 'docusaurus-start --port $PORT',
|
26531
|
-
buildCommand: 'docusaurus-build',
|
26532
26590
|
getFsOutputDir: async (dirPrefix) => {
|
26533
26591
|
const base = 'build';
|
26534
26592
|
try {
|
@@ -26582,6 +26640,7 @@ exports.frameworks = [
|
|
26582
26640
|
},
|
26583
26641
|
buildCommand: {
|
26584
26642
|
placeholder: '`npm run build` or `preact build`',
|
26643
|
+
value: 'preact build',
|
26585
26644
|
},
|
26586
26645
|
devCommand: {
|
26587
26646
|
value: 'preact watch --port $PORT',
|
@@ -26592,8 +26651,6 @@ exports.frameworks = [
|
|
26592
26651
|
},
|
26593
26652
|
},
|
26594
26653
|
dependency: 'preact-cli',
|
26595
|
-
devCommand: 'preact watch --port $PORT',
|
26596
|
-
buildCommand: 'preact build',
|
26597
26654
|
getFsOutputDir: async () => 'build',
|
26598
26655
|
getOutputDirName: async () => 'build',
|
26599
26656
|
defaultRoutes: [
|
@@ -26638,6 +26695,7 @@ exports.frameworks = [
|
|
26638
26695
|
},
|
26639
26696
|
buildCommand: {
|
26640
26697
|
placeholder: '`npm run build` or `dojo build`',
|
26698
|
+
value: 'dojo build',
|
26641
26699
|
},
|
26642
26700
|
devCommand: {
|
26643
26701
|
value: 'dojo build -m dev -w -s -p $PORT',
|
@@ -26648,8 +26706,6 @@ exports.frameworks = [
|
|
26648
26706
|
},
|
26649
26707
|
},
|
26650
26708
|
dependency: '@dojo/cli',
|
26651
|
-
devCommand: 'dojo build -m dev -w -s -p $PORT',
|
26652
|
-
buildCommand: 'dojo build',
|
26653
26709
|
getFsOutputDir: async () => 'output/dist',
|
26654
26710
|
getOutputDirName: async () => path_1.join('output', 'dist'),
|
26655
26711
|
defaultRoutes: [
|
@@ -26704,6 +26760,7 @@ exports.frameworks = [
|
|
26704
26760
|
},
|
26705
26761
|
buildCommand: {
|
26706
26762
|
placeholder: '`npm run build` or `ember build`',
|
26763
|
+
value: 'ember build',
|
26707
26764
|
},
|
26708
26765
|
devCommand: {
|
26709
26766
|
value: 'ember serve --port $PORT',
|
@@ -26714,8 +26771,6 @@ exports.frameworks = [
|
|
26714
26771
|
},
|
26715
26772
|
},
|
26716
26773
|
dependency: 'ember-cli',
|
26717
|
-
devCommand: 'ember serve --port $PORT',
|
26718
|
-
buildCommand: 'ember build',
|
26719
26774
|
getFsOutputDir: async () => 'dist',
|
26720
26775
|
getOutputDirName: async () => 'dist',
|
26721
26776
|
defaultRoutes: [
|
@@ -26758,6 +26813,7 @@ exports.frameworks = [
|
|
26758
26813
|
},
|
26759
26814
|
buildCommand: {
|
26760
26815
|
placeholder: '`npm run build` or `vue-cli-service build`',
|
26816
|
+
value: 'vue-cli-service build',
|
26761
26817
|
},
|
26762
26818
|
devCommand: {
|
26763
26819
|
value: 'vue-cli-service serve --port $PORT',
|
@@ -26768,8 +26824,6 @@ exports.frameworks = [
|
|
26768
26824
|
},
|
26769
26825
|
},
|
26770
26826
|
dependency: '@vue/cli-service',
|
26771
|
-
devCommand: 'vue-cli-service serve --port $PORT',
|
26772
|
-
buildCommand: 'vue-cli-service build',
|
26773
26827
|
getFsOutputDir: async () => 'dist',
|
26774
26828
|
getOutputDirName: async () => 'dist',
|
26775
26829
|
defaultRoutes: [
|
@@ -26835,6 +26889,7 @@ exports.frameworks = [
|
|
26835
26889
|
},
|
26836
26890
|
buildCommand: {
|
26837
26891
|
placeholder: '`npm run build` or `ng build && scully`',
|
26892
|
+
value: 'ng build && scully',
|
26838
26893
|
},
|
26839
26894
|
devCommand: {
|
26840
26895
|
value: 'ng serve --port $PORT',
|
@@ -26845,8 +26900,6 @@ exports.frameworks = [
|
|
26845
26900
|
},
|
26846
26901
|
},
|
26847
26902
|
dependency: '@scullyio/init',
|
26848
|
-
devCommand: 'ng serve --port $PORT',
|
26849
|
-
buildCommand: 'ng build && scully',
|
26850
26903
|
getFsOutputDir: async () => 'dist',
|
26851
26904
|
getOutputDirName: async () => 'dist/static',
|
26852
26905
|
},
|
@@ -26872,6 +26925,7 @@ exports.frameworks = [
|
|
26872
26925
|
},
|
26873
26926
|
buildCommand: {
|
26874
26927
|
placeholder: '`npm run build` or `ng build`',
|
26928
|
+
value: 'ng build',
|
26875
26929
|
},
|
26876
26930
|
devCommand: {
|
26877
26931
|
value: 'ng serve --port $PORT',
|
@@ -26881,8 +26935,6 @@ exports.frameworks = [
|
|
26881
26935
|
},
|
26882
26936
|
},
|
26883
26937
|
dependency: '@ionic/angular',
|
26884
|
-
devCommand: 'ng serve --port $PORT',
|
26885
|
-
buildCommand: 'ng build',
|
26886
26938
|
getFsOutputDir: async () => 'www',
|
26887
26939
|
getOutputDirName: async () => 'www',
|
26888
26940
|
defaultRoutes: [
|
@@ -26924,6 +26976,7 @@ exports.frameworks = [
|
|
26924
26976
|
},
|
26925
26977
|
buildCommand: {
|
26926
26978
|
placeholder: '`npm run build` or `ng build`',
|
26979
|
+
value: 'ng build',
|
26927
26980
|
},
|
26928
26981
|
devCommand: {
|
26929
26982
|
value: 'ng serve --port $PORT',
|
@@ -26934,8 +26987,6 @@ exports.frameworks = [
|
|
26934
26987
|
},
|
26935
26988
|
},
|
26936
26989
|
dependency: '@angular/cli',
|
26937
|
-
devCommand: 'ng serve --port $PORT',
|
26938
|
-
buildCommand: 'ng build',
|
26939
26990
|
getFsOutputDir: async () => 'dist',
|
26940
26991
|
getOutputDirName: async (dirPrefix) => {
|
26941
26992
|
const base = 'dist';
|
@@ -26991,6 +27042,7 @@ exports.frameworks = [
|
|
26991
27042
|
},
|
26992
27043
|
buildCommand: {
|
26993
27044
|
placeholder: '`npm run build` or `polymer build`',
|
27045
|
+
value: 'polymer build',
|
26994
27046
|
},
|
26995
27047
|
devCommand: {
|
26996
27048
|
value: 'polymer serve --port $PORT',
|
@@ -27001,8 +27053,6 @@ exports.frameworks = [
|
|
27001
27053
|
},
|
27002
27054
|
},
|
27003
27055
|
dependency: 'polymer-cli',
|
27004
|
-
devCommand: 'polymer serve --port $PORT',
|
27005
|
-
buildCommand: 'polymer build',
|
27006
27056
|
getFsOutputDir: async () => 'build',
|
27007
27057
|
getOutputDirName: async (dirPrefix) => {
|
27008
27058
|
const base = 'build';
|
@@ -27042,6 +27092,7 @@ exports.frameworks = [
|
|
27042
27092
|
tagline: 'Svelte lets you write high performance reactive apps with significantly less boilerplate.',
|
27043
27093
|
description: 'A basic Svelte app using the default template.',
|
27044
27094
|
website: 'https://svelte.dev',
|
27095
|
+
sort: 3,
|
27045
27096
|
detectors: {
|
27046
27097
|
every: [
|
27047
27098
|
{
|
@@ -27060,6 +27111,7 @@ exports.frameworks = [
|
|
27060
27111
|
},
|
27061
27112
|
buildCommand: {
|
27062
27113
|
placeholder: '`npm run build` or `rollup -c`',
|
27114
|
+
value: 'rollup -c',
|
27063
27115
|
},
|
27064
27116
|
devCommand: {
|
27065
27117
|
value: 'rollup -c -w',
|
@@ -27069,8 +27121,6 @@ exports.frameworks = [
|
|
27069
27121
|
},
|
27070
27122
|
},
|
27071
27123
|
dependency: 'sirv-cli',
|
27072
|
-
devCommand: 'rollup -c -w',
|
27073
|
-
buildCommand: 'rollup -c',
|
27074
27124
|
getFsOutputDir: async () => 'public',
|
27075
27125
|
getOutputDirName: async () => 'public',
|
27076
27126
|
defaultRoutes: [
|
@@ -27112,6 +27162,7 @@ exports.frameworks = [
|
|
27112
27162
|
},
|
27113
27163
|
buildCommand: {
|
27114
27164
|
placeholder: '`npm run build` or `svelte-kit build`',
|
27165
|
+
value: 'svelte-kit build',
|
27115
27166
|
},
|
27116
27167
|
devCommand: {
|
27117
27168
|
value: 'svelte-kit dev --port $PORT',
|
@@ -27121,8 +27172,6 @@ exports.frameworks = [
|
|
27121
27172
|
placeholder: 'public',
|
27122
27173
|
},
|
27123
27174
|
},
|
27124
|
-
devCommand: 'svelte-kit dev --port $PORT',
|
27125
|
-
buildCommand: 'svelte-kit build',
|
27126
27175
|
getFsOutputDir: async () => '.output',
|
27127
27176
|
getOutputDirName: async () => 'public',
|
27128
27177
|
},
|
@@ -27148,6 +27197,7 @@ exports.frameworks = [
|
|
27148
27197
|
},
|
27149
27198
|
buildCommand: {
|
27150
27199
|
placeholder: '`npm run build` or `react-scripts build`',
|
27200
|
+
value: 'react-scripts build',
|
27151
27201
|
},
|
27152
27202
|
devCommand: {
|
27153
27203
|
value: 'react-scripts start',
|
@@ -27157,8 +27207,6 @@ exports.frameworks = [
|
|
27157
27207
|
},
|
27158
27208
|
},
|
27159
27209
|
dependency: '@ionic/react',
|
27160
|
-
devCommand: 'react-scripts start',
|
27161
|
-
buildCommand: 'react-scripts build',
|
27162
27210
|
getFsOutputDir: async () => 'build',
|
27163
27211
|
getOutputDirName: async () => 'build',
|
27164
27212
|
defaultRoutes: [
|
@@ -27234,6 +27282,7 @@ exports.frameworks = [
|
|
27234
27282
|
tagline: 'Create React App allows you to get going with React in no time.',
|
27235
27283
|
description: 'A React app, bootstrapped with create-react-app, and a Serverless Function API.',
|
27236
27284
|
website: 'https://create-react-app.dev',
|
27285
|
+
sort: 4,
|
27237
27286
|
envPrefix: 'REACT_APP_',
|
27238
27287
|
detectors: {
|
27239
27288
|
some: [
|
@@ -27253,6 +27302,7 @@ exports.frameworks = [
|
|
27253
27302
|
},
|
27254
27303
|
buildCommand: {
|
27255
27304
|
placeholder: '`npm run build` or `react-scripts build`',
|
27305
|
+
value: 'react-scripts build',
|
27256
27306
|
},
|
27257
27307
|
devCommand: {
|
27258
27308
|
value: 'react-scripts start',
|
@@ -27262,8 +27312,6 @@ exports.frameworks = [
|
|
27262
27312
|
},
|
27263
27313
|
},
|
27264
27314
|
dependency: 'react-scripts',
|
27265
|
-
devCommand: 'react-scripts start',
|
27266
|
-
buildCommand: 'react-scripts build',
|
27267
27315
|
getFsOutputDir: async () => 'build',
|
27268
27316
|
getOutputDirName: async () => 'build',
|
27269
27317
|
defaultRoutes: [
|
@@ -27353,6 +27401,7 @@ exports.frameworks = [
|
|
27353
27401
|
},
|
27354
27402
|
buildCommand: {
|
27355
27403
|
placeholder: '`npm run build` or `gridsome build`',
|
27404
|
+
value: 'gridsome build',
|
27356
27405
|
},
|
27357
27406
|
devCommand: {
|
27358
27407
|
value: 'gridsome develop -p $PORT',
|
@@ -27363,8 +27412,6 @@ exports.frameworks = [
|
|
27363
27412
|
},
|
27364
27413
|
},
|
27365
27414
|
dependency: 'gridsome',
|
27366
|
-
devCommand: 'gridsome develop -p $PORT',
|
27367
|
-
buildCommand: 'gridsome build',
|
27368
27415
|
getFsOutputDir: async () => 'dist',
|
27369
27416
|
getOutputDirName: async () => 'dist',
|
27370
27417
|
},
|
@@ -27390,6 +27437,7 @@ exports.frameworks = [
|
|
27390
27437
|
},
|
27391
27438
|
buildCommand: {
|
27392
27439
|
placeholder: '`npm run build` or `umi build`',
|
27440
|
+
value: 'umi build',
|
27393
27441
|
},
|
27394
27442
|
devCommand: {
|
27395
27443
|
value: 'umi dev --port $PORT',
|
@@ -27400,8 +27448,6 @@ exports.frameworks = [
|
|
27400
27448
|
},
|
27401
27449
|
},
|
27402
27450
|
dependency: 'umi',
|
27403
|
-
devCommand: 'umi dev --port $PORT',
|
27404
|
-
buildCommand: 'umi build',
|
27405
27451
|
getFsOutputDir: async () => 'dist',
|
27406
27452
|
getOutputDirName: async () => 'dist',
|
27407
27453
|
defaultRoutes: [
|
@@ -27443,6 +27489,7 @@ exports.frameworks = [
|
|
27443
27489
|
},
|
27444
27490
|
buildCommand: {
|
27445
27491
|
placeholder: '`npm run build` or `sapper export`',
|
27492
|
+
value: 'sapper export',
|
27446
27493
|
},
|
27447
27494
|
devCommand: {
|
27448
27495
|
value: 'sapper dev --port $PORT',
|
@@ -27453,8 +27500,6 @@ exports.frameworks = [
|
|
27453
27500
|
},
|
27454
27501
|
},
|
27455
27502
|
dependency: 'sapper',
|
27456
|
-
devCommand: 'sapper dev --port $PORT',
|
27457
|
-
buildCommand: 'sapper export',
|
27458
27503
|
getFsOutputDir: async () => '__sapper__/export',
|
27459
27504
|
getOutputDirName: async () => '__sapper__/export',
|
27460
27505
|
},
|
@@ -27480,6 +27525,7 @@ exports.frameworks = [
|
|
27480
27525
|
},
|
27481
27526
|
buildCommand: {
|
27482
27527
|
placeholder: '`npm run build` or `saber build`',
|
27528
|
+
value: 'saber build',
|
27483
27529
|
},
|
27484
27530
|
devCommand: {
|
27485
27531
|
value: 'saber --port $PORT',
|
@@ -27490,8 +27536,6 @@ exports.frameworks = [
|
|
27490
27536
|
},
|
27491
27537
|
},
|
27492
27538
|
dependency: 'saber',
|
27493
|
-
devCommand: 'saber --port $PORT',
|
27494
|
-
buildCommand: 'saber build',
|
27495
27539
|
getFsOutputDir: async () => 'public',
|
27496
27540
|
getOutputDirName: async () => 'public',
|
27497
27541
|
defaultRoutes: [
|
@@ -27548,6 +27592,7 @@ exports.frameworks = [
|
|
27548
27592
|
},
|
27549
27593
|
buildCommand: {
|
27550
27594
|
placeholder: '`npm run build` or `stencil build`',
|
27595
|
+
value: 'stencil build',
|
27551
27596
|
},
|
27552
27597
|
devCommand: {
|
27553
27598
|
value: 'stencil build --dev --watch --serve --port $PORT',
|
@@ -27558,8 +27603,6 @@ exports.frameworks = [
|
|
27558
27603
|
},
|
27559
27604
|
},
|
27560
27605
|
dependency: '@stencil/core',
|
27561
|
-
devCommand: 'stencil build --dev --watch --serve --port $PORT',
|
27562
|
-
buildCommand: 'stencil build',
|
27563
27606
|
getFsOutputDir: async () => 'www',
|
27564
27607
|
getOutputDirName: async () => 'www',
|
27565
27608
|
defaultRoutes: [
|
@@ -27621,6 +27664,7 @@ exports.frameworks = [
|
|
27621
27664
|
tagline: 'Nuxt.js is the web comprehensive framework that lets you dream big with Vue.js.',
|
27622
27665
|
description: 'A Nuxt.js app, bootstrapped with create-nuxt-app.',
|
27623
27666
|
website: 'https://nuxtjs.org',
|
27667
|
+
sort: 2,
|
27624
27668
|
envPrefix: 'NUXT_ENV_',
|
27625
27669
|
detectors: {
|
27626
27670
|
every: [
|
@@ -27636,6 +27680,7 @@ exports.frameworks = [
|
|
27636
27680
|
},
|
27637
27681
|
buildCommand: {
|
27638
27682
|
placeholder: '`npm run build` or `nuxt generate`',
|
27683
|
+
value: 'nuxt generate',
|
27639
27684
|
},
|
27640
27685
|
devCommand: {
|
27641
27686
|
value: 'nuxt',
|
@@ -27645,8 +27690,6 @@ exports.frameworks = [
|
|
27645
27690
|
},
|
27646
27691
|
},
|
27647
27692
|
dependency: 'nuxt',
|
27648
|
-
devCommand: 'nuxt',
|
27649
|
-
buildCommand: 'nuxt generate',
|
27650
27693
|
getFsOutputDir: async () => '.output',
|
27651
27694
|
getOutputDirName: async () => 'dist',
|
27652
27695
|
cachePattern: '.nuxt/**',
|
@@ -27704,8 +27747,6 @@ exports.frameworks = [
|
|
27704
27747
|
placeholder: 'RedwoodJS default',
|
27705
27748
|
},
|
27706
27749
|
},
|
27707
|
-
devCommand: 'yarn rw dev --fwd="--port=$PORT --open=false',
|
27708
|
-
buildCommand: 'yarn rw deploy vercel',
|
27709
27750
|
getFsOutputDir: async () => 'public',
|
27710
27751
|
getOutputDirName: async () => 'public',
|
27711
27752
|
},
|
@@ -27717,7 +27758,6 @@ exports.frameworks = [
|
|
27717
27758
|
tagline: 'Hugo is the world’s fastest framework for building websites, written in Go.',
|
27718
27759
|
description: 'A Hugo site, created with the Hugo CLI.',
|
27719
27760
|
website: 'https://gohugo.io',
|
27720
|
-
sort: 5,
|
27721
27761
|
detectors: {
|
27722
27762
|
some: [
|
27723
27763
|
{
|
@@ -27740,6 +27780,7 @@ exports.frameworks = [
|
|
27740
27780
|
},
|
27741
27781
|
buildCommand: {
|
27742
27782
|
placeholder: '`npm run build` or `hugo -D --gc`',
|
27783
|
+
value: 'hugo -D --gc',
|
27743
27784
|
},
|
27744
27785
|
devCommand: {
|
27745
27786
|
value: 'hugo server -D -w -p $PORT',
|
@@ -27749,8 +27790,6 @@ exports.frameworks = [
|
|
27749
27790
|
placeholder: '`public` or `publishDir` from the `config` file',
|
27750
27791
|
},
|
27751
27792
|
},
|
27752
|
-
devCommand: 'hugo server -D -w -p $PORT',
|
27753
|
-
buildCommand: 'hugo -D --gc',
|
27754
27793
|
getFsOutputDir: async (dirPrefix) => {
|
27755
27794
|
const config = await read_config_file_1.readConfigFile(['config.json', 'config.yaml', 'config.toml'].map(fileName => {
|
27756
27795
|
return path_1.join(dirPrefix, fileName);
|
@@ -27786,6 +27825,7 @@ exports.frameworks = [
|
|
27786
27825
|
},
|
27787
27826
|
buildCommand: {
|
27788
27827
|
placeholder: '`npm run build` or `jekyll build`',
|
27828
|
+
value: 'jekyll build',
|
27789
27829
|
},
|
27790
27830
|
devCommand: {
|
27791
27831
|
value: 'bundle exec jekyll serve --watch --port $PORT',
|
@@ -27795,8 +27835,6 @@ exports.frameworks = [
|
|
27795
27835
|
placeholder: '`_site` or `destination` from `_config.yml`',
|
27796
27836
|
},
|
27797
27837
|
},
|
27798
|
-
devCommand: 'bundle exec jekyll serve --watch --port $PORT',
|
27799
|
-
buildCommand: 'jekyll build',
|
27800
27838
|
getFsOutputDir: async (dirPrefix) => {
|
27801
27839
|
const config = await read_config_file_1.readConfigFile(path_1.join(dirPrefix, '_config.yml'));
|
27802
27840
|
return (config && config.destination) || '_site';
|
@@ -27828,6 +27866,7 @@ exports.frameworks = [
|
|
27828
27866
|
},
|
27829
27867
|
buildCommand: {
|
27830
27868
|
placeholder: '`npm run build` or `brunch build --production`',
|
27869
|
+
value: 'brunch build --production',
|
27831
27870
|
},
|
27832
27871
|
devCommand: {
|
27833
27872
|
value: 'brunch watch --server --port $PORT',
|
@@ -27837,8 +27876,6 @@ exports.frameworks = [
|
|
27837
27876
|
value: 'public',
|
27838
27877
|
},
|
27839
27878
|
},
|
27840
|
-
devCommand: 'brunch watch --server --port $PORT',
|
27841
|
-
buildCommand: 'brunch build --production',
|
27842
27879
|
getFsOutputDir: async () => 'public',
|
27843
27880
|
getOutputDirName: async () => 'public',
|
27844
27881
|
},
|
@@ -27862,18 +27899,17 @@ exports.frameworks = [
|
|
27862
27899
|
value: 'bundle install',
|
27863
27900
|
},
|
27864
27901
|
buildCommand: {
|
27865
|
-
|
27902
|
+
placeholder: '`npm run build` or `bundle exec middleman build`',
|
27903
|
+
value: 'bundle exec middleman build',
|
27866
27904
|
},
|
27867
27905
|
devCommand: {
|
27868
|
-
value: 'bundle exec middleman server -p $PORT',
|
27869
27906
|
placeholder: 'bundle exec middleman server',
|
27907
|
+
value: 'bundle exec middleman server -p $PORT',
|
27870
27908
|
},
|
27871
27909
|
outputDirectory: {
|
27872
27910
|
value: 'build',
|
27873
27911
|
},
|
27874
27912
|
},
|
27875
|
-
devCommand: 'bundle exec middleman server -p $PORT',
|
27876
|
-
buildCommand: 'bundle exec middleman build',
|
27877
27913
|
getFsOutputDir: async () => 'build',
|
27878
27914
|
getOutputDirName: async () => 'build',
|
27879
27915
|
cachePattern: '{vendor/bin,vendor/cache,vendor/bundle}/**',
|
@@ -27902,15 +27938,13 @@ exports.frameworks = [
|
|
27902
27938
|
value: 'zola build',
|
27903
27939
|
},
|
27904
27940
|
devCommand: {
|
27905
|
-
value: 'zola serve --port $PORT',
|
27906
27941
|
placeholder: 'zola serve',
|
27942
|
+
value: 'zola serve --port $PORT',
|
27907
27943
|
},
|
27908
27944
|
outputDirectory: {
|
27909
27945
|
value: 'public',
|
27910
27946
|
},
|
27911
27947
|
},
|
27912
|
-
devCommand: 'zola serve --port $PORT',
|
27913
|
-
buildCommand: 'zola build',
|
27914
27948
|
getFsOutputDir: async () => 'public',
|
27915
27949
|
getOutputDirName: async () => 'public',
|
27916
27950
|
defaultVersion: '0.13.0',
|
@@ -27938,17 +27972,17 @@ exports.frameworks = [
|
|
27938
27972
|
},
|
27939
27973
|
buildCommand: {
|
27940
27974
|
placeholder: '`npm run build` or `vite build`',
|
27975
|
+
value: 'vite build',
|
27941
27976
|
},
|
27942
27977
|
devCommand: {
|
27943
27978
|
placeholder: 'vite',
|
27979
|
+
value: 'vite',
|
27944
27980
|
},
|
27945
27981
|
outputDirectory: {
|
27946
27982
|
value: 'dist',
|
27947
27983
|
},
|
27948
27984
|
},
|
27949
27985
|
dependency: 'vite',
|
27950
|
-
devCommand: 'vite',
|
27951
|
-
buildCommand: 'vite build',
|
27952
27986
|
getFsOutputDir: async () => 'dist',
|
27953
27987
|
getOutputDirName: async () => 'dist',
|
27954
27988
|
},
|
@@ -27974,17 +28008,17 @@ exports.frameworks = [
|
|
27974
28008
|
},
|
27975
28009
|
buildCommand: {
|
27976
28010
|
placeholder: '`npm run build` or `parcel build`',
|
28011
|
+
value: 'parcel build',
|
27977
28012
|
},
|
27978
28013
|
devCommand: {
|
27979
28014
|
placeholder: 'parcel',
|
28015
|
+
value: 'parcel',
|
27980
28016
|
},
|
27981
28017
|
outputDirectory: {
|
27982
|
-
|
28018
|
+
value: 'dist',
|
27983
28019
|
},
|
27984
28020
|
},
|
27985
28021
|
dependency: 'parcel',
|
27986
|
-
devCommand: 'parcel',
|
27987
|
-
buildCommand: 'parcel build',
|
27988
28022
|
getFsOutputDir: async () => 'dist',
|
27989
28023
|
getOutputDirName: async () => 'dist',
|
27990
28024
|
defaultRoutes: [
|
@@ -28018,16 +28052,16 @@ exports.frameworks = [
|
|
28018
28052
|
},
|
28019
28053
|
buildCommand: {
|
28020
28054
|
placeholder: '`npm run vercel-build` or `npm run build`',
|
28055
|
+
value: null,
|
28021
28056
|
},
|
28022
28057
|
devCommand: {
|
28023
28058
|
placeholder: 'None',
|
28059
|
+
value: null,
|
28024
28060
|
},
|
28025
28061
|
outputDirectory: {
|
28026
28062
|
placeholder: '`public` if it exists, or `.`',
|
28027
28063
|
},
|
28028
28064
|
},
|
28029
|
-
devCommand: null,
|
28030
|
-
buildCommand: null,
|
28031
28065
|
getFsOutputDir: async (dirPrefix) => {
|
28032
28066
|
// Public if it exists or `.`
|
28033
28067
|
let base = 'public';
|
@@ -32246,7 +32280,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32246
32280
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
32247
32281
|
};
|
32248
32282
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
32249
|
-
exports.updateFunctionsManifest = exports.convertRuntimeToPlugin = void 0;
|
32283
|
+
exports.updateRoutesManifest = exports.updateFunctionsManifest = exports.convertRuntimeToPlugin = void 0;
|
32250
32284
|
const fs_extra_1 = __importDefault(__webpack_require__(5392));
|
32251
32285
|
const path_1 = __webpack_require__(5622);
|
32252
32286
|
const glob_1 = __importDefault(__webpack_require__(4240));
|
@@ -32259,13 +32293,14 @@ const minimatch_1 = __importDefault(__webpack_require__(9566));
|
|
32259
32293
|
* @param ext - the file extension, for example `.py`
|
32260
32294
|
*/
|
32261
32295
|
function convertRuntimeToPlugin(buildRuntime, ext) {
|
32262
|
-
|
32296
|
+
// This `build()` signature should match `plugin.build()` signature in `vercel build`.
|
32297
|
+
return async function build({ vercelConfig, workPath, }) {
|
32263
32298
|
const opts = { cwd: workPath };
|
32264
32299
|
const files = await glob_1.default('**', opts);
|
32265
32300
|
delete files['vercel.json']; // Builders/Runtimes didn't have vercel.json
|
32266
32301
|
const entrypoints = await glob_1.default(`api/**/*${ext}`, opts);
|
32267
32302
|
const pages = {};
|
32268
|
-
const { functions = {} } =
|
32303
|
+
const { functions = {} } = vercelConfig;
|
32269
32304
|
const traceDir = path_1.join(workPath, '.output', 'runtime-traced-files');
|
32270
32305
|
await fs_extra_1.default.ensureDir(traceDir);
|
32271
32306
|
for (const entrypoint of Object.keys(entrypoints)) {
|
@@ -32321,7 +32356,7 @@ function convertRuntimeToPlugin(buildRuntime, ext) {
|
|
32321
32356
|
await fs_extra_1.default.ensureDir(path_1.dirname(nft));
|
32322
32357
|
await fs_extra_1.default.writeFile(nft, json);
|
32323
32358
|
}
|
32324
|
-
await updateFunctionsManifest({ workPath, pages });
|
32359
|
+
await updateFunctionsManifest({ vercelConfig, workPath, pages });
|
32325
32360
|
};
|
32326
32361
|
}
|
32327
32362
|
exports.convertRuntimeToPlugin = convertRuntimeToPlugin;
|
@@ -32347,18 +32382,13 @@ async function readJson(filePath) {
|
|
32347
32382
|
throw err;
|
32348
32383
|
}
|
32349
32384
|
}
|
32350
|
-
async function readVercelConfig(workPath) {
|
32351
|
-
const vercelJsonPath = path_1.join(workPath, 'vercel.json');
|
32352
|
-
return readJson(vercelJsonPath);
|
32353
|
-
}
|
32354
32385
|
/**
|
32355
32386
|
* If `.output/functions-manifest.json` exists, append to the pages
|
32356
32387
|
* property. Otherwise write a new file. This will also read `vercel.json`
|
32357
32388
|
* and apply relevant `functions` property config.
|
32358
32389
|
*/
|
32359
|
-
async function updateFunctionsManifest({ workPath, pages, }) {
|
32390
|
+
async function updateFunctionsManifest({ vercelConfig, workPath, pages, }) {
|
32360
32391
|
const functionsManifestPath = path_1.join(workPath, '.output', 'functions-manifest.json');
|
32361
|
-
const vercelConfig = await readVercelConfig(workPath);
|
32362
32392
|
const functionsManifest = await readJson(functionsManifestPath);
|
32363
32393
|
if (!functionsManifest.version)
|
32364
32394
|
functionsManifest.version = 1;
|
@@ -32379,6 +32409,25 @@ async function updateFunctionsManifest({ workPath, pages, }) {
|
|
32379
32409
|
await fs_extra_1.default.writeFile(functionsManifestPath, JSON.stringify(functionsManifest));
|
32380
32410
|
}
|
32381
32411
|
exports.updateFunctionsManifest = updateFunctionsManifest;
|
32412
|
+
/**
|
32413
|
+
* Will append routes to the `routes-manifest.json` file.
|
32414
|
+
* If the file does not exist, it'll be created.
|
32415
|
+
*/
|
32416
|
+
async function updateRoutesManifest({ workPath, dynamicRoutes, }) {
|
32417
|
+
const routesManifestPath = path_1.join(workPath, '.output', 'routes-manifest.json');
|
32418
|
+
const routesManifest = await readJson(routesManifestPath);
|
32419
|
+
if (!routesManifest.version)
|
32420
|
+
routesManifest.version = 1;
|
32421
|
+
if (routesManifest.pages404 === undefined)
|
32422
|
+
routesManifest.pages404 = true;
|
32423
|
+
if (dynamicRoutes) {
|
32424
|
+
if (!routesManifest.dynamicRoutes)
|
32425
|
+
routesManifest.dynamicRoutes = [];
|
32426
|
+
routesManifest.dynamicRoutes.push(...dynamicRoutes);
|
32427
|
+
}
|
32428
|
+
await fs_extra_1.default.writeFile(routesManifestPath, JSON.stringify(routesManifest));
|
32429
|
+
}
|
32430
|
+
exports.updateRoutesManifest = updateRoutesManifest;
|
32382
32431
|
|
32383
32432
|
|
32384
32433
|
/***/ }),
|
@@ -34351,7 +34400,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
34351
34400
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
34352
34401
|
};
|
34353
34402
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
34354
|
-
exports.getPlatformEnv = exports.isStaticRuntime = exports.isOfficialRuntime = exports.updateFunctionsManifest = exports.convertRuntimeToPlugin = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.shouldServe = exports.streamToBuffer = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.execAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.download = exports.Prerender = exports.createLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
|
34403
|
+
exports.getPlatformEnv = exports.isStaticRuntime = exports.isOfficialRuntime = exports.updateRoutesManifest = exports.updateFunctionsManifest = exports.convertRuntimeToPlugin = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.shouldServe = exports.streamToBuffer = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.execAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.download = exports.Prerender = exports.createLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
|
34355
34404
|
const file_blob_1 = __importDefault(__webpack_require__(2397));
|
34356
34405
|
exports.FileBlob = file_blob_1.default;
|
34357
34406
|
const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
|
@@ -34416,6 +34465,7 @@ Object.defineProperty(exports, "normalizePath", ({ enumerable: true, get: functi
|
|
34416
34465
|
var convert_runtime_to_plugin_1 = __webpack_require__(7276);
|
34417
34466
|
Object.defineProperty(exports, "convertRuntimeToPlugin", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1.convertRuntimeToPlugin; } }));
|
34418
34467
|
Object.defineProperty(exports, "updateFunctionsManifest", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1.updateFunctionsManifest; } }));
|
34468
|
+
Object.defineProperty(exports, "updateRoutesManifest", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1.updateRoutesManifest; } }));
|
34419
34469
|
__exportStar(__webpack_require__(2416), exports);
|
34420
34470
|
__exportStar(__webpack_require__(5748), exports);
|
34421
34471
|
__exportStar(__webpack_require__(3983), exports);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/build-utils",
|
3
|
-
"version": "2.12.3-canary.
|
3
|
+
"version": "2.12.3-canary.21",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.js",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"@types/node-fetch": "^2.1.6",
|
31
31
|
"@types/semver": "6.0.0",
|
32
32
|
"@types/yazl": "^2.4.1",
|
33
|
-
"@vercel/frameworks": "0.5.1-canary.
|
33
|
+
"@vercel/frameworks": "0.5.1-canary.13",
|
34
34
|
"@vercel/ncc": "0.24.0",
|
35
35
|
"aggregate-error": "3.0.1",
|
36
36
|
"async-retry": "1.2.3",
|
@@ -49,5 +49,5 @@
|
|
49
49
|
"typescript": "4.3.4",
|
50
50
|
"yazl": "2.4.3"
|
51
51
|
},
|
52
|
-
"gitHead": "
|
52
|
+
"gitHead": "cc7b2691c1d43ecb19f1dd6e88f29137d85da61a"
|
53
53
|
}
|