@vercel/build-utils 2.16.0 → 2.16.1-canary.2
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/fs/run-user-scripts.js +18 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.js +162 -12
- package/dist/should-serve.d.ts +2 -2
- package/dist/should-serve.js +4 -3
- package/dist/types.d.ts +2 -0
- package/dist/workspaces/workspace-managers.d.ts +17 -0
- package/dist/workspaces/workspace-managers.js +127 -0
- package/package.json +3 -3
@@ -186,15 +186,20 @@ async function scanParentDirs(destPath, readPackageJson = false) {
|
|
186
186
|
fs_extra_1.default.pathExists(path_1.default.join(currentDestPath, 'yarn.lock')),
|
187
187
|
read_config_file_1.readConfigFile(path_1.default.join(currentDestPath, 'pnpm-lock.yaml')),
|
188
188
|
]);
|
189
|
-
|
190
|
-
|
191
|
-
|
189
|
+
// Priority order is Yarn > pnpm > npm
|
190
|
+
// - find highest priority lock file and use that
|
191
|
+
if (hasYarnLock) {
|
192
|
+
cliType = 'yarn';
|
192
193
|
}
|
193
|
-
if (
|
194
|
+
else if (pnpmLockYaml) {
|
194
195
|
cliType = 'pnpm';
|
195
196
|
// just ensure that it is read as a number and not a string
|
196
197
|
lockfileVersion = Number(pnpmLockYaml.lockfileVersion);
|
197
198
|
}
|
199
|
+
else if (packageLockJson) {
|
200
|
+
cliType = 'npm';
|
201
|
+
lockfileVersion = packageLockJson.lockfileVersion;
|
202
|
+
}
|
198
203
|
// Only stop iterating if a lockfile was found, because it's possible
|
199
204
|
// that the lockfile is in a higher path than where the `package.json`
|
200
205
|
// file was found.
|
@@ -307,6 +312,15 @@ function getEnvForPackageManager({ cliType, lockfileVersion, nodeVersion, env, }
|
|
307
312
|
console.log('Detected `package-lock.json` generated by npm 7...');
|
308
313
|
}
|
309
314
|
}
|
315
|
+
else if (cliType === 'pnpm') {
|
316
|
+
if (typeof lockfileVersion === 'number' &&
|
317
|
+
lockfileVersion === 5.4 &&
|
318
|
+
((nodeVersion === null || nodeVersion === void 0 ? void 0 : nodeVersion.major) || 0) > 12) {
|
319
|
+
// Ensure that pnpm 7 is at the beginning of the `$PATH`
|
320
|
+
newEnv.PATH = `/pnpm7/pnpm:${env.PATH}`;
|
321
|
+
console.log('Detected `pnpm-lock.yaml` generated by pnpm 7...');
|
322
|
+
}
|
323
|
+
}
|
310
324
|
else {
|
311
325
|
// Yarn v2 PnP mode may be activated, so force "node-modules" linker style
|
312
326
|
if (!env.YARN_NODE_LINKER) {
|
package/dist/index.d.ts
CHANGED
@@ -11,11 +11,10 @@ import rename from './fs/rename';
|
|
11
11
|
import { execAsync, spawnAsync, execCommand, spawnCommand, walkParentDirs, getScriptName, installDependencies, runPackageJsonScript, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getSpawnOptions, getNodeBinPath, scanParentDirs } from './fs/run-user-scripts';
|
12
12
|
import { getLatestNodeVersion, getDiscontinuedNodeVersions } from './fs/node-version';
|
13
13
|
import streamToBuffer from './fs/stream-to-buffer';
|
14
|
-
import shouldServe from './should-serve';
|
15
14
|
import debug from './debug';
|
16
15
|
import getIgnoreFilter from './get-ignore-filter';
|
17
16
|
import { getPlatformEnv } from './get-platform-env';
|
18
|
-
export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, execAsync, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, streamToBuffer,
|
17
|
+
export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, execAsync, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, streamToBuffer, debug, isSymbolicLink, getLambdaOptionsFromFunction, scanParentDirs, getIgnoreFilter, };
|
19
18
|
export { EdgeFunction } from './edge-function';
|
20
19
|
export { detectBuilders, detectOutputDirectory, detectApiDirectory, detectApiExtensions, } from './detect-builders';
|
21
20
|
export { detectFileSystemAPI } from './detect-file-system-api';
|
@@ -23,6 +22,7 @@ export { detectFramework } from './detect-framework';
|
|
23
22
|
export { DetectorFilesystem } from './detectors/filesystem';
|
24
23
|
export { readConfigFile } from './fs/read-config-file';
|
25
24
|
export { normalizePath } from './fs/normalize-path';
|
25
|
+
export * from './should-serve';
|
26
26
|
export * from './schemas';
|
27
27
|
export * from './types';
|
28
28
|
export * from './errors';
|
@@ -31,3 +31,4 @@ export * from './errors';
|
|
31
31
|
*/
|
32
32
|
export declare const isOfficialRuntime: (desired: string, name?: string | undefined) => boolean;
|
33
33
|
export declare const isStaticRuntime: (name?: string | undefined) => boolean;
|
34
|
+
export { workspaceManagers } from './workspaces/workspace-managers';
|
package/dist/index.js
CHANGED
@@ -27001,8 +27001,7 @@ exports.frameworks = [
|
|
27001
27001
|
detectors: {
|
27002
27002
|
every: [
|
27003
27003
|
{
|
27004
|
-
path: '
|
27005
|
-
matchContent: '"(dev)?(d|D)ependencies":\\s*{[^}]*"remix":\\s*".+?"[^}]*}',
|
27004
|
+
path: 'remix.config.js',
|
27006
27005
|
},
|
27007
27006
|
],
|
27008
27007
|
},
|
@@ -35049,15 +35048,20 @@ async function scanParentDirs(destPath, readPackageJson = false) {
|
|
35049
35048
|
fs_extra_1.default.pathExists(path_1.default.join(currentDestPath, 'yarn.lock')),
|
35050
35049
|
read_config_file_1.readConfigFile(path_1.default.join(currentDestPath, 'pnpm-lock.yaml')),
|
35051
35050
|
]);
|
35052
|
-
|
35053
|
-
|
35054
|
-
|
35051
|
+
// Priority order is Yarn > pnpm > npm
|
35052
|
+
// - find highest priority lock file and use that
|
35053
|
+
if (hasYarnLock) {
|
35054
|
+
cliType = 'yarn';
|
35055
35055
|
}
|
35056
|
-
if (
|
35056
|
+
else if (pnpmLockYaml) {
|
35057
35057
|
cliType = 'pnpm';
|
35058
35058
|
// just ensure that it is read as a number and not a string
|
35059
35059
|
lockfileVersion = Number(pnpmLockYaml.lockfileVersion);
|
35060
35060
|
}
|
35061
|
+
else if (packageLockJson) {
|
35062
|
+
cliType = 'npm';
|
35063
|
+
lockfileVersion = packageLockJson.lockfileVersion;
|
35064
|
+
}
|
35061
35065
|
// Only stop iterating if a lockfile was found, because it's possible
|
35062
35066
|
// that the lockfile is in a higher path than where the `package.json`
|
35063
35067
|
// file was found.
|
@@ -35170,6 +35174,15 @@ function getEnvForPackageManager({ cliType, lockfileVersion, nodeVersion, env, }
|
|
35170
35174
|
console.log('Detected `package-lock.json` generated by npm 7...');
|
35171
35175
|
}
|
35172
35176
|
}
|
35177
|
+
else if (cliType === 'pnpm') {
|
35178
|
+
if (typeof lockfileVersion === 'number' &&
|
35179
|
+
lockfileVersion === 5.4 &&
|
35180
|
+
((nodeVersion === null || nodeVersion === void 0 ? void 0 : nodeVersion.major) || 0) > 12) {
|
35181
|
+
// Ensure that pnpm 7 is at the beginning of the `$PATH`
|
35182
|
+
newEnv.PATH = `/pnpm7/pnpm:${env.PATH}`;
|
35183
|
+
console.log('Detected `pnpm-lock.yaml` generated by pnpm 7...');
|
35184
|
+
}
|
35185
|
+
}
|
35173
35186
|
else {
|
35174
35187
|
// Yarn v2 PnP mode may be activated, so force "node-modules" linker style
|
35175
35188
|
if (!env.YARN_NODE_LINKER) {
|
@@ -35441,7 +35454,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35441
35454
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
35442
35455
|
};
|
35443
35456
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
35444
|
-
exports.isStaticRuntime = exports.isOfficialRuntime = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.EdgeFunction = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.
|
35457
|
+
exports.workspaceManagers = exports.isStaticRuntime = exports.isOfficialRuntime = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.EdgeFunction = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.streamToBuffer = exports.getPlatformEnv = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.getEnvForPackageManager = exports.runCustomInstallCommand = 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.NodejsLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
|
35445
35458
|
const file_blob_1 = __importDefault(__webpack_require__(2397));
|
35446
35459
|
exports.FileBlob = file_blob_1.default;
|
35447
35460
|
const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
|
@@ -35489,8 +35502,6 @@ Object.defineProperty(exports, "getLatestNodeVersion", ({ enumerable: true, get:
|
|
35489
35502
|
Object.defineProperty(exports, "getDiscontinuedNodeVersions", ({ enumerable: true, get: function () { return node_version_1.getDiscontinuedNodeVersions; } }));
|
35490
35503
|
const stream_to_buffer_1 = __importDefault(__webpack_require__(2560));
|
35491
35504
|
exports.streamToBuffer = stream_to_buffer_1.default;
|
35492
|
-
const should_serve_1 = __importDefault(__webpack_require__(2564));
|
35493
|
-
exports.shouldServe = should_serve_1.default;
|
35494
35505
|
const debug_1 = __importDefault(__webpack_require__(1868));
|
35495
35506
|
exports.debug = debug_1.default;
|
35496
35507
|
const get_ignore_filter_1 = __importDefault(__webpack_require__(1148));
|
@@ -35514,6 +35525,7 @@ var read_config_file_1 = __webpack_require__(7792);
|
|
35514
35525
|
Object.defineProperty(exports, "readConfigFile", ({ enumerable: true, get: function () { return read_config_file_1.readConfigFile; } }));
|
35515
35526
|
var normalize_path_1 = __webpack_require__(6261);
|
35516
35527
|
Object.defineProperty(exports, "normalizePath", ({ enumerable: true, get: function () { return normalize_path_1.normalizePath; } }));
|
35528
|
+
__exportStar(__webpack_require__(2564), exports);
|
35517
35529
|
__exportStar(__webpack_require__(2416), exports);
|
35518
35530
|
__exportStar(__webpack_require__(5748), exports);
|
35519
35531
|
__exportStar(__webpack_require__(3983), exports);
|
@@ -35534,6 +35546,8 @@ const isStaticRuntime = (name) => {
|
|
35534
35546
|
return exports.isOfficialRuntime('static', name);
|
35535
35547
|
};
|
35536
35548
|
exports.isStaticRuntime = isStaticRuntime;
|
35549
|
+
var workspace_managers_1 = __webpack_require__(4896);
|
35550
|
+
Object.defineProperty(exports, "workspaceManagers", ({ enumerable: true, get: function () { return workspace_managers_1.workspaceManagers; } }));
|
35537
35551
|
|
35538
35552
|
|
35539
35553
|
/***/ }),
|
@@ -35824,8 +35838,9 @@ exports.buildsSchema = {
|
|
35824
35838
|
"use strict";
|
35825
35839
|
|
35826
35840
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
35841
|
+
exports.shouldServe = void 0;
|
35827
35842
|
const path_1 = __webpack_require__(5622);
|
35828
|
-
|
35843
|
+
const shouldServe = ({ entrypoint, files, requestPath, }) => {
|
35829
35844
|
requestPath = requestPath.replace(/\/$/, ''); // sanitize trailing '/'
|
35830
35845
|
entrypoint = entrypoint.replace(/\\/, '/'); // windows compatibility
|
35831
35846
|
if (entrypoint === requestPath && hasProp(files, entrypoint)) {
|
@@ -35836,8 +35851,8 @@ function shouldServe({ entrypoint, files, requestPath, }) {
|
|
35836
35851
|
return true;
|
35837
35852
|
}
|
35838
35853
|
return false;
|
35839
|
-
}
|
35840
|
-
exports.
|
35854
|
+
};
|
35855
|
+
exports.shouldServe = shouldServe;
|
35841
35856
|
function hasProp(obj, key) {
|
35842
35857
|
return Object.hasOwnProperty.call(obj, key);
|
35843
35858
|
}
|
@@ -35853,6 +35868,141 @@ function hasProp(obj, key) {
|
|
35853
35868
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
35854
35869
|
|
35855
35870
|
|
35871
|
+
/***/ }),
|
35872
|
+
|
35873
|
+
/***/ 4896:
|
35874
|
+
/***/ ((__unused_webpack_module, exports) => {
|
35875
|
+
|
35876
|
+
"use strict";
|
35877
|
+
|
35878
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
35879
|
+
exports.workspaceManagers = void 0;
|
35880
|
+
/**
|
35881
|
+
* The supported list of workspace managers.
|
35882
|
+
*
|
35883
|
+
* This list is designed to work with the @see {@link detectFramework} function.
|
35884
|
+
*
|
35885
|
+
* @example
|
35886
|
+
* import { workspaceManagers as frameworkList } from '@vercel/build-utils/workspaces'
|
35887
|
+
* import { detectFramework } from '@vercel/build-utils'
|
35888
|
+
*
|
35889
|
+
* const fs = new GitDetectorFilesystem(...)
|
35890
|
+
* detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null
|
35891
|
+
*
|
35892
|
+
* @todo Will be used by the detect-eligible-projects API endpoint for a given git url.
|
35893
|
+
*/
|
35894
|
+
exports.workspaceManagers = [
|
35895
|
+
{
|
35896
|
+
name: 'Yarn',
|
35897
|
+
slug: 'yarn',
|
35898
|
+
detectors: {
|
35899
|
+
every: [
|
35900
|
+
{
|
35901
|
+
path: 'package.json',
|
35902
|
+
matchContent: '"workspaces":\\s*(?:\\[[^\\]]*]|{[^}]*"packages":[^}]*})',
|
35903
|
+
},
|
35904
|
+
{
|
35905
|
+
path: 'yarn.lock',
|
35906
|
+
},
|
35907
|
+
],
|
35908
|
+
},
|
35909
|
+
// unused props - needed for typescript
|
35910
|
+
description: '',
|
35911
|
+
logo: '',
|
35912
|
+
settings: {
|
35913
|
+
buildCommand: {
|
35914
|
+
value: '',
|
35915
|
+
placeholder: '',
|
35916
|
+
},
|
35917
|
+
devCommand: {
|
35918
|
+
value: '',
|
35919
|
+
placeholder: '',
|
35920
|
+
},
|
35921
|
+
installCommand: {
|
35922
|
+
value: '',
|
35923
|
+
placeholder: '',
|
35924
|
+
},
|
35925
|
+
outputDirectory: {
|
35926
|
+
value: '',
|
35927
|
+
placeholder: '',
|
35928
|
+
},
|
35929
|
+
},
|
35930
|
+
getOutputDirName: () => Promise.resolve(''),
|
35931
|
+
},
|
35932
|
+
{
|
35933
|
+
name: 'pnpm',
|
35934
|
+
slug: 'pnpm',
|
35935
|
+
detectors: {
|
35936
|
+
every: [
|
35937
|
+
{
|
35938
|
+
path: 'pnpm-workspace.yaml',
|
35939
|
+
},
|
35940
|
+
],
|
35941
|
+
},
|
35942
|
+
// unused props - needed for typescript
|
35943
|
+
description: '',
|
35944
|
+
logo: '',
|
35945
|
+
settings: {
|
35946
|
+
buildCommand: {
|
35947
|
+
value: '',
|
35948
|
+
placeholder: '',
|
35949
|
+
},
|
35950
|
+
devCommand: {
|
35951
|
+
value: '',
|
35952
|
+
placeholder: '',
|
35953
|
+
},
|
35954
|
+
installCommand: {
|
35955
|
+
value: '',
|
35956
|
+
placeholder: '',
|
35957
|
+
},
|
35958
|
+
outputDirectory: {
|
35959
|
+
value: '',
|
35960
|
+
placeholder: '',
|
35961
|
+
},
|
35962
|
+
},
|
35963
|
+
getOutputDirName: () => Promise.resolve(''),
|
35964
|
+
},
|
35965
|
+
{
|
35966
|
+
name: 'npm',
|
35967
|
+
slug: 'npm',
|
35968
|
+
detectors: {
|
35969
|
+
every: [
|
35970
|
+
{
|
35971
|
+
path: 'package.json',
|
35972
|
+
matchContent: '"workspaces":\\s*(?:\\[[^\\]]*]|{[^}]*"packages":[^}]*})',
|
35973
|
+
},
|
35974
|
+
{
|
35975
|
+
path: 'package-lock.json',
|
35976
|
+
},
|
35977
|
+
],
|
35978
|
+
},
|
35979
|
+
// unused props - needed for typescript
|
35980
|
+
description: '',
|
35981
|
+
logo: '',
|
35982
|
+
settings: {
|
35983
|
+
buildCommand: {
|
35984
|
+
value: '',
|
35985
|
+
placeholder: '',
|
35986
|
+
},
|
35987
|
+
devCommand: {
|
35988
|
+
value: '',
|
35989
|
+
placeholder: '',
|
35990
|
+
},
|
35991
|
+
installCommand: {
|
35992
|
+
value: '',
|
35993
|
+
placeholder: '',
|
35994
|
+
},
|
35995
|
+
outputDirectory: {
|
35996
|
+
value: '',
|
35997
|
+
placeholder: '',
|
35998
|
+
},
|
35999
|
+
},
|
36000
|
+
getOutputDirName: () => Promise.resolve(''),
|
36001
|
+
},
|
36002
|
+
];
|
36003
|
+
exports.default = exports.workspaceManagers;
|
36004
|
+
|
36005
|
+
|
35856
36006
|
/***/ }),
|
35857
36007
|
|
35858
36008
|
/***/ 5685:
|
package/dist/should-serve.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export
|
1
|
+
import type { ShouldServe } from './types';
|
2
|
+
export declare const shouldServe: ShouldServe;
|
package/dist/should-serve.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.shouldServe = void 0;
|
3
4
|
const path_1 = require("path");
|
4
|
-
|
5
|
+
const shouldServe = ({ entrypoint, files, requestPath, }) => {
|
5
6
|
requestPath = requestPath.replace(/\/$/, ''); // sanitize trailing '/'
|
6
7
|
entrypoint = entrypoint.replace(/\\/, '/'); // windows compatibility
|
7
8
|
if (entrypoint === requestPath && hasProp(files, entrypoint)) {
|
@@ -12,8 +13,8 @@ function shouldServe({ entrypoint, files, requestPath, }) {
|
|
12
13
|
return true;
|
13
14
|
}
|
14
15
|
return false;
|
15
|
-
}
|
16
|
-
exports.
|
16
|
+
};
|
17
|
+
exports.shouldServe = shouldServe;
|
17
18
|
function hasProp(obj, key) {
|
18
19
|
return Object.hasOwnProperty.call(obj, key);
|
19
20
|
}
|
package/dist/types.d.ts
CHANGED
@@ -305,6 +305,7 @@ export interface BuilderV3 {
|
|
305
305
|
version: 3;
|
306
306
|
build: BuildV3;
|
307
307
|
prepareCache?: PrepareCache;
|
308
|
+
shouldServe?: ShouldServe;
|
308
309
|
startDevServer?: StartDevServer;
|
309
310
|
}
|
310
311
|
declare type ImageFormat = 'image/avif' | 'image/webp';
|
@@ -353,5 +354,6 @@ export interface BuildResultV3 {
|
|
353
354
|
export declare type BuildV2 = (options: BuildOptions) => Promise<BuildResultV2>;
|
354
355
|
export declare type BuildV3 = (options: BuildOptions) => Promise<BuildResultV3>;
|
355
356
|
export declare type PrepareCache = (options: PrepareCacheOptions) => Promise<Files>;
|
357
|
+
export declare type ShouldServe = (options: ShouldServeOptions) => boolean | Promise<boolean>;
|
356
358
|
export declare type StartDevServer = (options: StartDevServerOptions) => Promise<StartDevServerResult>;
|
357
359
|
export {};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { Framework } from '@vercel/frameworks';
|
2
|
+
/**
|
3
|
+
* The supported list of workspace managers.
|
4
|
+
*
|
5
|
+
* This list is designed to work with the @see {@link detectFramework} function.
|
6
|
+
*
|
7
|
+
* @example
|
8
|
+
* import { workspaceManagers as frameworkList } from '@vercel/build-utils/workspaces'
|
9
|
+
* import { detectFramework } from '@vercel/build-utils'
|
10
|
+
*
|
11
|
+
* const fs = new GitDetectorFilesystem(...)
|
12
|
+
* detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null
|
13
|
+
*
|
14
|
+
* @todo Will be used by the detect-eligible-projects API endpoint for a given git url.
|
15
|
+
*/
|
16
|
+
export declare const workspaceManagers: Array<Framework>;
|
17
|
+
export default workspaceManagers;
|
@@ -0,0 +1,127 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.workspaceManagers = void 0;
|
4
|
+
/**
|
5
|
+
* The supported list of workspace managers.
|
6
|
+
*
|
7
|
+
* This list is designed to work with the @see {@link detectFramework} function.
|
8
|
+
*
|
9
|
+
* @example
|
10
|
+
* import { workspaceManagers as frameworkList } from '@vercel/build-utils/workspaces'
|
11
|
+
* import { detectFramework } from '@vercel/build-utils'
|
12
|
+
*
|
13
|
+
* const fs = new GitDetectorFilesystem(...)
|
14
|
+
* detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null
|
15
|
+
*
|
16
|
+
* @todo Will be used by the detect-eligible-projects API endpoint for a given git url.
|
17
|
+
*/
|
18
|
+
exports.workspaceManagers = [
|
19
|
+
{
|
20
|
+
name: 'Yarn',
|
21
|
+
slug: 'yarn',
|
22
|
+
detectors: {
|
23
|
+
every: [
|
24
|
+
{
|
25
|
+
path: 'package.json',
|
26
|
+
matchContent: '"workspaces":\\s*(?:\\[[^\\]]*]|{[^}]*"packages":[^}]*})',
|
27
|
+
},
|
28
|
+
{
|
29
|
+
path: 'yarn.lock',
|
30
|
+
},
|
31
|
+
],
|
32
|
+
},
|
33
|
+
// unused props - needed for typescript
|
34
|
+
description: '',
|
35
|
+
logo: '',
|
36
|
+
settings: {
|
37
|
+
buildCommand: {
|
38
|
+
value: '',
|
39
|
+
placeholder: '',
|
40
|
+
},
|
41
|
+
devCommand: {
|
42
|
+
value: '',
|
43
|
+
placeholder: '',
|
44
|
+
},
|
45
|
+
installCommand: {
|
46
|
+
value: '',
|
47
|
+
placeholder: '',
|
48
|
+
},
|
49
|
+
outputDirectory: {
|
50
|
+
value: '',
|
51
|
+
placeholder: '',
|
52
|
+
},
|
53
|
+
},
|
54
|
+
getOutputDirName: () => Promise.resolve(''),
|
55
|
+
},
|
56
|
+
{
|
57
|
+
name: 'pnpm',
|
58
|
+
slug: 'pnpm',
|
59
|
+
detectors: {
|
60
|
+
every: [
|
61
|
+
{
|
62
|
+
path: 'pnpm-workspace.yaml',
|
63
|
+
},
|
64
|
+
],
|
65
|
+
},
|
66
|
+
// unused props - needed for typescript
|
67
|
+
description: '',
|
68
|
+
logo: '',
|
69
|
+
settings: {
|
70
|
+
buildCommand: {
|
71
|
+
value: '',
|
72
|
+
placeholder: '',
|
73
|
+
},
|
74
|
+
devCommand: {
|
75
|
+
value: '',
|
76
|
+
placeholder: '',
|
77
|
+
},
|
78
|
+
installCommand: {
|
79
|
+
value: '',
|
80
|
+
placeholder: '',
|
81
|
+
},
|
82
|
+
outputDirectory: {
|
83
|
+
value: '',
|
84
|
+
placeholder: '',
|
85
|
+
},
|
86
|
+
},
|
87
|
+
getOutputDirName: () => Promise.resolve(''),
|
88
|
+
},
|
89
|
+
{
|
90
|
+
name: 'npm',
|
91
|
+
slug: 'npm',
|
92
|
+
detectors: {
|
93
|
+
every: [
|
94
|
+
{
|
95
|
+
path: 'package.json',
|
96
|
+
matchContent: '"workspaces":\\s*(?:\\[[^\\]]*]|{[^}]*"packages":[^}]*})',
|
97
|
+
},
|
98
|
+
{
|
99
|
+
path: 'package-lock.json',
|
100
|
+
},
|
101
|
+
],
|
102
|
+
},
|
103
|
+
// unused props - needed for typescript
|
104
|
+
description: '',
|
105
|
+
logo: '',
|
106
|
+
settings: {
|
107
|
+
buildCommand: {
|
108
|
+
value: '',
|
109
|
+
placeholder: '',
|
110
|
+
},
|
111
|
+
devCommand: {
|
112
|
+
value: '',
|
113
|
+
placeholder: '',
|
114
|
+
},
|
115
|
+
installCommand: {
|
116
|
+
value: '',
|
117
|
+
placeholder: '',
|
118
|
+
},
|
119
|
+
outputDirectory: {
|
120
|
+
value: '',
|
121
|
+
placeholder: '',
|
122
|
+
},
|
123
|
+
},
|
124
|
+
getOutputDirName: () => Promise.resolve(''),
|
125
|
+
},
|
126
|
+
];
|
127
|
+
exports.default = exports.workspaceManagers;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/build-utils",
|
3
|
-
"version": "2.16.
|
3
|
+
"version": "2.16.1-canary.2",
|
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.2",
|
33
|
-
"@vercel/frameworks": "0.8.0",
|
33
|
+
"@vercel/frameworks": "0.8.1-canary.0",
|
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.5.1"
|
51
51
|
},
|
52
|
-
"gitHead": "
|
52
|
+
"gitHead": "d91bca7d6bc8066690c0db4b11990a354d13ebbd"
|
53
53
|
}
|