@vercel/build-utils 2.12.3-canary.46 → 2.12.3-canary.47
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.
@@ -6,7 +6,7 @@ import type { BuildOptions } from './types';
|
|
6
6
|
* @param packageName - the name of the package, for example `vercel-plugin-python`
|
7
7
|
* @param ext - the file extension, for example `.py`
|
8
8
|
*/
|
9
|
-
export declare function
|
9
|
+
export declare function _experimental_convertRuntimeToPlugin(buildRuntime: (options: BuildOptions) => Promise<{
|
10
10
|
output: Lambda;
|
11
11
|
}>, packageName: string, ext: string): ({ workPath }: {
|
12
12
|
workPath: string;
|
@@ -15,7 +15,7 @@ export declare function convertRuntimeToPlugin(buildRuntime: (options: BuildOpti
|
|
15
15
|
* If `.output/functions-manifest.json` exists, append to the pages
|
16
16
|
* property. Otherwise write a new file.
|
17
17
|
*/
|
18
|
-
export declare function
|
18
|
+
export declare function _experimental_updateFunctionsManifest({ workPath, pages, }: {
|
19
19
|
workPath: string;
|
20
20
|
pages: {
|
21
21
|
[key: string]: any;
|
@@ -25,7 +25,7 @@ export declare function updateFunctionsManifest({ workPath, pages, }: {
|
|
25
25
|
* Append routes to the `routes-manifest.json` file.
|
26
26
|
* If the file does not exist, it will be created.
|
27
27
|
*/
|
28
|
-
export declare function
|
28
|
+
export declare function _experimental_updateRoutesManifest({ workPath, redirects, rewrites, headers, dynamicRoutes, staticRoutes, }: {
|
29
29
|
workPath: string;
|
30
30
|
redirects?: {
|
31
31
|
source: string;
|
@@ -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.
|
6
|
+
exports._experimental_updateRoutesManifest = exports._experimental_updateFunctionsManifest = exports._experimental_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"));
|
@@ -46,7 +46,7 @@ const getSourceFiles = async (workPath, ignoreFilter) => {
|
|
46
46
|
* @param packageName - the name of the package, for example `vercel-plugin-python`
|
47
47
|
* @param ext - the file extension, for example `.py`
|
48
48
|
*/
|
49
|
-
function
|
49
|
+
function _experimental_convertRuntimeToPlugin(buildRuntime, packageName, ext) {
|
50
50
|
// This `build()` signature should match `plugin.build()` signature in `vercel build`.
|
51
51
|
return async function build({ workPath }) {
|
52
52
|
// We also don't want to provide any files to Runtimes that were ignored
|
@@ -224,10 +224,10 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
|
|
224
224
|
}
|
225
225
|
// Add any Serverless Functions that were exposed by the Legacy Runtime
|
226
226
|
// to the `functions-manifest.json` file provided in `.output`.
|
227
|
-
await
|
227
|
+
await _experimental_updateFunctionsManifest({ workPath, pages });
|
228
228
|
};
|
229
229
|
}
|
230
|
-
exports.
|
230
|
+
exports._experimental_convertRuntimeToPlugin = _experimental_convertRuntimeToPlugin;
|
231
231
|
async function readJson(filePath) {
|
232
232
|
try {
|
233
233
|
const str = await fs_extra_1.default.readFile(filePath, 'utf8');
|
@@ -244,7 +244,7 @@ async function readJson(filePath) {
|
|
244
244
|
* If `.output/functions-manifest.json` exists, append to the pages
|
245
245
|
* property. Otherwise write a new file.
|
246
246
|
*/
|
247
|
-
async function
|
247
|
+
async function _experimental_updateFunctionsManifest({ workPath, pages, }) {
|
248
248
|
const functionsManifestPath = path_1.join(workPath, '.output', 'functions-manifest.json');
|
249
249
|
const functionsManifest = await readJson(functionsManifestPath);
|
250
250
|
if (!functionsManifest.version)
|
@@ -256,12 +256,12 @@ async function updateFunctionsManifest({ workPath, pages, }) {
|
|
256
256
|
}
|
257
257
|
await fs_extra_1.default.writeFile(functionsManifestPath, JSON.stringify(functionsManifest));
|
258
258
|
}
|
259
|
-
exports.
|
259
|
+
exports._experimental_updateFunctionsManifest = _experimental_updateFunctionsManifest;
|
260
260
|
/**
|
261
261
|
* Append routes to the `routes-manifest.json` file.
|
262
262
|
* If the file does not exist, it will be created.
|
263
263
|
*/
|
264
|
-
async function
|
264
|
+
async function _experimental_updateRoutesManifest({ workPath, redirects, rewrites, headers, dynamicRoutes, staticRoutes, }) {
|
265
265
|
const routesManifestPath = path_1.join(workPath, '.output', 'routes-manifest.json');
|
266
266
|
const routesManifest = await readJson(routesManifestPath);
|
267
267
|
if (!routesManifest.version)
|
@@ -295,4 +295,4 @@ async function updateRoutesManifest({ workPath, redirects, rewrites, headers, dy
|
|
295
295
|
}
|
296
296
|
await fs_extra_1.default.writeFile(routesManifestPath, JSON.stringify(routesManifest));
|
297
297
|
}
|
298
|
-
exports.
|
298
|
+
exports._experimental_updateRoutesManifest = _experimental_updateRoutesManifest;
|
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="node" />
|
2
1
|
import FileBlob from './file-blob';
|
3
2
|
import FileFsRef from './file-fs-ref';
|
4
3
|
import FileRef from './file-ref';
|
@@ -21,7 +20,7 @@ export { detectFramework } from './detect-framework';
|
|
21
20
|
export { DetectorFilesystem } from './detectors/filesystem';
|
22
21
|
export { readConfigFile } from './fs/read-config-file';
|
23
22
|
export { normalizePath } from './fs/normalize-path';
|
24
|
-
export {
|
23
|
+
export { _experimental_convertRuntimeToPlugin, _experimental_updateFunctionsManifest, _experimental_updateRoutesManifest, } from './convert-runtime-to-plugin';
|
25
24
|
export * from './schemas';
|
26
25
|
export * from './types';
|
27
26
|
export * from './errors';
|
@@ -35,8 +34,3 @@ export declare const isStaticRuntime: (name?: string | undefined) => boolean;
|
|
35
34
|
* Throws an error if *both* env vars are defined.
|
36
35
|
*/
|
37
36
|
export declare const getPlatformEnv: (name: string) => string | undefined;
|
38
|
-
/**
|
39
|
-
* Helper function for generating file or directories names in `.output/inputs`
|
40
|
-
* for dependencies of files provided to the File System API.
|
41
|
-
*/
|
42
|
-
export declare const getInputHash: (source: Buffer | string) => string;
|
package/dist/index.js
CHANGED
@@ -32724,7 +32724,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32724
32724
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
32725
32725
|
};
|
32726
32726
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
32727
|
-
exports.
|
32727
|
+
exports._experimental_updateRoutesManifest = exports._experimental_updateFunctionsManifest = exports._experimental_convertRuntimeToPlugin = void 0;
|
32728
32728
|
const fs_extra_1 = __importDefault(__webpack_require__(5392));
|
32729
32729
|
const path_1 = __webpack_require__(5622);
|
32730
32730
|
const glob_1 = __importDefault(__webpack_require__(4240));
|
@@ -32767,7 +32767,7 @@ const getSourceFiles = async (workPath, ignoreFilter) => {
|
|
32767
32767
|
* @param packageName - the name of the package, for example `vercel-plugin-python`
|
32768
32768
|
* @param ext - the file extension, for example `.py`
|
32769
32769
|
*/
|
32770
|
-
function
|
32770
|
+
function _experimental_convertRuntimeToPlugin(buildRuntime, packageName, ext) {
|
32771
32771
|
// This `build()` signature should match `plugin.build()` signature in `vercel build`.
|
32772
32772
|
return async function build({ workPath }) {
|
32773
32773
|
// We also don't want to provide any files to Runtimes that were ignored
|
@@ -32945,10 +32945,10 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
|
|
32945
32945
|
}
|
32946
32946
|
// Add any Serverless Functions that were exposed by the Legacy Runtime
|
32947
32947
|
// to the `functions-manifest.json` file provided in `.output`.
|
32948
|
-
await
|
32948
|
+
await _experimental_updateFunctionsManifest({ workPath, pages });
|
32949
32949
|
};
|
32950
32950
|
}
|
32951
|
-
exports.
|
32951
|
+
exports._experimental_convertRuntimeToPlugin = _experimental_convertRuntimeToPlugin;
|
32952
32952
|
async function readJson(filePath) {
|
32953
32953
|
try {
|
32954
32954
|
const str = await fs_extra_1.default.readFile(filePath, 'utf8');
|
@@ -32965,7 +32965,7 @@ async function readJson(filePath) {
|
|
32965
32965
|
* If `.output/functions-manifest.json` exists, append to the pages
|
32966
32966
|
* property. Otherwise write a new file.
|
32967
32967
|
*/
|
32968
|
-
async function
|
32968
|
+
async function _experimental_updateFunctionsManifest({ workPath, pages, }) {
|
32969
32969
|
const functionsManifestPath = path_1.join(workPath, '.output', 'functions-manifest.json');
|
32970
32970
|
const functionsManifest = await readJson(functionsManifestPath);
|
32971
32971
|
if (!functionsManifest.version)
|
@@ -32977,12 +32977,12 @@ async function updateFunctionsManifest({ workPath, pages, }) {
|
|
32977
32977
|
}
|
32978
32978
|
await fs_extra_1.default.writeFile(functionsManifestPath, JSON.stringify(functionsManifest));
|
32979
32979
|
}
|
32980
|
-
exports.
|
32980
|
+
exports._experimental_updateFunctionsManifest = _experimental_updateFunctionsManifest;
|
32981
32981
|
/**
|
32982
32982
|
* Append routes to the `routes-manifest.json` file.
|
32983
32983
|
* If the file does not exist, it will be created.
|
32984
32984
|
*/
|
32985
|
-
async function
|
32985
|
+
async function _experimental_updateRoutesManifest({ workPath, redirects, rewrites, headers, dynamicRoutes, staticRoutes, }) {
|
32986
32986
|
const routesManifestPath = path_1.join(workPath, '.output', 'routes-manifest.json');
|
32987
32987
|
const routesManifest = await readJson(routesManifestPath);
|
32988
32988
|
if (!routesManifest.version)
|
@@ -33016,7 +33016,7 @@ async function updateRoutesManifest({ workPath, redirects, rewrites, headers, dy
|
|
33016
33016
|
}
|
33017
33017
|
await fs_extra_1.default.writeFile(routesManifestPath, JSON.stringify(routesManifest));
|
33018
33018
|
}
|
33019
|
-
exports.
|
33019
|
+
exports._experimental_updateRoutesManifest = _experimental_updateRoutesManifest;
|
33020
33020
|
|
33021
33021
|
|
33022
33022
|
/***/ }),
|
@@ -35290,8 +35290,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35290
35290
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
35291
35291
|
};
|
35292
35292
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
35293
|
-
exports.
|
35294
|
-
const crypto_1 = __webpack_require__(6417);
|
35293
|
+
exports.getPlatformEnv = exports.isStaticRuntime = exports.isOfficialRuntime = exports._experimental_updateRoutesManifest = exports._experimental_updateFunctionsManifest = exports._experimental_convertRuntimeToPlugin = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.getIgnoreFilter = 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;
|
35295
35294
|
const file_blob_1 = __importDefault(__webpack_require__(2397));
|
35296
35295
|
exports.FileBlob = file_blob_1.default;
|
35297
35296
|
const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
|
@@ -35358,9 +35357,9 @@ Object.defineProperty(exports, "readConfigFile", ({ enumerable: true, get: funct
|
|
35358
35357
|
var normalize_path_1 = __webpack_require__(6261);
|
35359
35358
|
Object.defineProperty(exports, "normalizePath", ({ enumerable: true, get: function () { return normalize_path_1.normalizePath; } }));
|
35360
35359
|
var convert_runtime_to_plugin_1 = __webpack_require__(7276);
|
35361
|
-
Object.defineProperty(exports, "
|
35362
|
-
Object.defineProperty(exports, "
|
35363
|
-
Object.defineProperty(exports, "
|
35360
|
+
Object.defineProperty(exports, "_experimental_convertRuntimeToPlugin", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1._experimental_convertRuntimeToPlugin; } }));
|
35361
|
+
Object.defineProperty(exports, "_experimental_updateFunctionsManifest", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1._experimental_updateFunctionsManifest; } }));
|
35362
|
+
Object.defineProperty(exports, "_experimental_updateRoutesManifest", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1._experimental_updateRoutesManifest; } }));
|
35364
35363
|
__exportStar(__webpack_require__(2416), exports);
|
35365
35364
|
__exportStar(__webpack_require__(5748), exports);
|
35366
35365
|
__exportStar(__webpack_require__(3983), exports);
|
@@ -35403,14 +35402,6 @@ const getPlatformEnv = (name) => {
|
|
35403
35402
|
return n;
|
35404
35403
|
};
|
35405
35404
|
exports.getPlatformEnv = getPlatformEnv;
|
35406
|
-
/**
|
35407
|
-
* Helper function for generating file or directories names in `.output/inputs`
|
35408
|
-
* for dependencies of files provided to the File System API.
|
35409
|
-
*/
|
35410
|
-
const getInputHash = (source) => {
|
35411
|
-
return crypto_1.createHash('sha1').update(source).digest('hex');
|
35412
|
-
};
|
35413
|
-
exports.getInputHash = getInputHash;
|
35414
35405
|
|
35415
35406
|
|
35416
35407
|
/***/ }),
|
@@ -35800,14 +35791,6 @@ module.exports = require("constants");
|
|
35800
35791
|
|
35801
35792
|
/***/ }),
|
35802
35793
|
|
35803
|
-
/***/ 6417:
|
35804
|
-
/***/ ((module) => {
|
35805
|
-
|
35806
|
-
"use strict";
|
35807
|
-
module.exports = require("crypto");
|
35808
|
-
|
35809
|
-
/***/ }),
|
35810
|
-
|
35811
35794
|
/***/ 8614:
|
35812
35795
|
/***/ ((module) => {
|
35813
35796
|
|
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.47",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.js",
|
@@ -49,5 +49,5 @@
|
|
49
49
|
"typescript": "4.3.4",
|
50
50
|
"yazl": "2.4.3"
|
51
51
|
},
|
52
|
-
"gitHead": "
|
52
|
+
"gitHead": "38d643a8e68ad0c71433788f3b770e4b4c1378ee"
|
53
53
|
}
|