@vercel/fs-detectors 5.0.0 → 5.0.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/detect-builders.js +701 -748
- package/dist/detect-builders.js.map +7 -1
- package/dist/detect-file-system-api.js +177 -154
- package/dist/detect-file-system-api.js.map +7 -1
- package/dist/detect-framework.js +196 -143
- package/dist/detect-framework.js.map +7 -1
- package/dist/detectors/filesystem.js +106 -109
- package/dist/detectors/filesystem.js.map +7 -1
- package/dist/detectors/local-file-system-detector.js +90 -63
- package/dist/detectors/local-file-system-detector.js.map +7 -1
- package/dist/get-project-paths.js +74 -35
- package/dist/get-project-paths.js.map +7 -1
- package/dist/index.js +85 -48
- package/dist/index.js.map +7 -1
- package/dist/is-official-runtime.js +34 -19
- package/dist/is-official-runtime.js.map +7 -1
- package/dist/monorepos/get-monorepo-default-settings.js +154 -150
- package/dist/monorepos/get-monorepo-default-settings.js.map +7 -1
- package/dist/monorepos/monorepo-managers.js +112 -100
- package/dist/monorepos/monorepo-managers.js.map +7 -1
- package/dist/package-managers/package-managers.js +79 -55
- package/dist/package-managers/package-managers.js.map +7 -1
- package/dist/workspaces/get-glob-fs.js +90 -66
- package/dist/workspaces/get-glob-fs.js.map +7 -1
- package/dist/workspaces/get-workspace-package-paths.js +130 -79
- package/dist/workspaces/get-workspace-package-paths.js.map +7 -1
- package/dist/workspaces/get-workspaces.js +71 -31
- package/dist/workspaces/get-workspaces.js.map +7 -1
- package/dist/workspaces/workspace-managers.js +104 -92
- package/dist/workspaces/workspace-managers.js.map +7 -1
- package/package.json +6 -6
|
@@ -1,165 +1,169 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4
11
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var get_monorepo_default_settings_exports = {};
|
|
30
|
+
__export(get_monorepo_default_settings_exports, {
|
|
31
|
+
MissingBuildPipeline: () => MissingBuildPipeline,
|
|
32
|
+
MissingBuildTarget: () => MissingBuildTarget,
|
|
33
|
+
getMonorepoDefaultSettings: () => getMonorepoDefaultSettings
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(get_monorepo_default_settings_exports);
|
|
36
|
+
var import_path = require("path");
|
|
37
|
+
var import_monorepo_managers = require("./monorepo-managers");
|
|
38
|
+
var import_package_managers = require("../package-managers/package-managers");
|
|
39
|
+
var import_detect_framework = require("../detect-framework");
|
|
40
|
+
var import_json5 = __toESM(require("json5"));
|
|
41
|
+
var import_semver = __toESM(require("semver"));
|
|
13
42
|
class MissingBuildPipeline extends Error {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
43
|
+
constructor() {
|
|
44
|
+
super(
|
|
45
|
+
"Missing required `build` pipeline in turbo.json or package.json Turbo configuration."
|
|
46
|
+
);
|
|
47
|
+
}
|
|
17
48
|
}
|
|
18
|
-
exports.MissingBuildPipeline = MissingBuildPipeline;
|
|
19
49
|
class MissingBuildTarget extends Error {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
50
|
+
constructor() {
|
|
51
|
+
super(
|
|
52
|
+
"Missing required `build` target in either nx.json, project.json, or package.json Nx configuration."
|
|
53
|
+
);
|
|
54
|
+
}
|
|
23
55
|
}
|
|
24
|
-
exports.MissingBuildTarget = MissingBuildTarget;
|
|
25
56
|
function supportsRootCommand(turboSemVer) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
57
|
+
if (!turboSemVer) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if (!import_semver.default.validRange(turboSemVer)) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return !import_semver.default.intersects(turboSemVer, "<1.8.0");
|
|
33
64
|
}
|
|
34
65
|
async function getMonorepoDefaultSettings(projectName, projectPath, relativeToRoot, detectorFilesystem) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
66
|
+
const [monorepoManager, packageManager] = await Promise.all([
|
|
67
|
+
(0, import_detect_framework.detectFramework)({
|
|
68
|
+
fs: detectorFilesystem,
|
|
69
|
+
frameworkList: import_monorepo_managers.monorepoManagers
|
|
70
|
+
}),
|
|
71
|
+
(0, import_detect_framework.detectFramework)({
|
|
72
|
+
fs: detectorFilesystem,
|
|
73
|
+
frameworkList: import_package_managers.packageManagers
|
|
74
|
+
})
|
|
75
|
+
]);
|
|
76
|
+
if (monorepoManager === "turbo") {
|
|
77
|
+
const [turboJSONBuf, packageJSONBuf] = await Promise.all([
|
|
78
|
+
detectorFilesystem.readFile("turbo.json").catch(() => null),
|
|
79
|
+
detectorFilesystem.readFile("package.json").catch(() => null)
|
|
44
80
|
]);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
turboSemVer =
|
|
64
|
-
packageJSON?.dependencies?.turbo ||
|
|
65
|
-
packageJSON?.devDependencies?.turbo ||
|
|
66
|
-
null;
|
|
67
|
-
}
|
|
68
|
-
if (!hasBuildPipeline) {
|
|
69
|
-
throw new MissingBuildPipeline();
|
|
70
|
-
}
|
|
71
|
-
if (projectPath === '/') {
|
|
72
|
-
return {
|
|
73
|
-
monorepoManager: 'turbo',
|
|
74
|
-
buildCommand: 'turbo run build',
|
|
75
|
-
installCommand: packageManager ? `${packageManager} install` : null,
|
|
76
|
-
commandForIgnoringBuildStep: 'npx turbo-ignore',
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
let buildCommand = null;
|
|
80
|
-
if (projectPath) {
|
|
81
|
-
if (supportsRootCommand(turboSemVer)) {
|
|
82
|
-
buildCommand = `turbo run build`;
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
// We don't know for sure if the local `turbo` supports inference.
|
|
86
|
-
buildCommand = `cd ${relativeToRoot} && turbo run build --filter={${projectPath}}...`;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return {
|
|
90
|
-
monorepoManager: 'turbo',
|
|
91
|
-
buildCommand,
|
|
92
|
-
installCommand: packageManager === 'npm'
|
|
93
|
-
? `${packageManager} install --prefix=${relativeToRoot}`
|
|
94
|
-
: packageManager
|
|
95
|
-
? `${packageManager} install`
|
|
96
|
-
: null,
|
|
97
|
-
commandForIgnoringBuildStep: 'npx turbo-ignore',
|
|
98
|
-
};
|
|
81
|
+
let hasBuildPipeline = false;
|
|
82
|
+
let turboSemVer = null;
|
|
83
|
+
if (turboJSONBuf !== null) {
|
|
84
|
+
const turboJSON = import_json5.default.parse(turboJSONBuf.toString("utf-8"));
|
|
85
|
+
if (turboJSON?.pipeline?.build) {
|
|
86
|
+
hasBuildPipeline = true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (packageJSONBuf !== null) {
|
|
90
|
+
const packageJSON = JSON.parse(packageJSONBuf.toString("utf-8"));
|
|
91
|
+
if (packageJSON?.turbo?.pipeline?.build) {
|
|
92
|
+
hasBuildPipeline = true;
|
|
93
|
+
}
|
|
94
|
+
turboSemVer = packageJSON?.dependencies?.turbo || packageJSON?.devDependencies?.turbo || null;
|
|
95
|
+
}
|
|
96
|
+
if (!hasBuildPipeline) {
|
|
97
|
+
throw new MissingBuildPipeline();
|
|
99
98
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
99
|
+
if (projectPath === "/") {
|
|
100
|
+
return {
|
|
101
|
+
monorepoManager: "turbo",
|
|
102
|
+
buildCommand: "turbo run build",
|
|
103
|
+
installCommand: packageManager ? `${packageManager} install` : null,
|
|
104
|
+
commandForIgnoringBuildStep: "npx turbo-ignore"
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
let buildCommand = null;
|
|
108
|
+
if (projectPath) {
|
|
109
|
+
if (supportsRootCommand(turboSemVer)) {
|
|
110
|
+
buildCommand = `turbo run build`;
|
|
111
|
+
} else {
|
|
112
|
+
buildCommand = `cd ${relativeToRoot} && turbo run build --filter={${projectPath}}...`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
monorepoManager: "turbo",
|
|
117
|
+
buildCommand,
|
|
118
|
+
installCommand: packageManager === "npm" ? `${packageManager} install --prefix=${relativeToRoot}` : packageManager ? `${packageManager} install` : null,
|
|
119
|
+
commandForIgnoringBuildStep: "npx turbo-ignore"
|
|
120
|
+
};
|
|
121
|
+
} else if (monorepoManager === "nx") {
|
|
122
|
+
const nxJSONBuf = await detectorFilesystem.readFile("nx.json");
|
|
123
|
+
const nxJSON = import_json5.default.parse(nxJSONBuf.toString("utf-8"));
|
|
124
|
+
if (!nxJSON?.targetDefaults?.build) {
|
|
125
|
+
const [projectJSONBuf, packageJSONBuf] = await Promise.all([
|
|
126
|
+
detectorFilesystem.readFile((0, import_path.join)(projectPath, "project.json")).catch(() => null),
|
|
127
|
+
detectorFilesystem.readFile((0, import_path.join)(projectPath, "package.json")).catch(() => null)
|
|
128
|
+
]);
|
|
129
|
+
let hasBuildTarget = false;
|
|
130
|
+
if (projectJSONBuf) {
|
|
131
|
+
const projectJSON = import_json5.default.parse(projectJSONBuf.toString("utf-8"));
|
|
132
|
+
if (projectJSON?.targets?.build) {
|
|
133
|
+
hasBuildTarget = true;
|
|
131
134
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
}
|
|
136
|
+
if (packageJSONBuf) {
|
|
137
|
+
const packageJSON = import_json5.default.parse(packageJSONBuf.toString("utf-8"));
|
|
138
|
+
if (packageJSON?.nx) {
|
|
139
|
+
if (packageJSON.nx.targets?.build) {
|
|
140
|
+
hasBuildTarget = true;
|
|
141
|
+
}
|
|
138
142
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
}
|
|
144
|
+
if (!hasBuildTarget) {
|
|
145
|
+
throw new MissingBuildTarget();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (projectPath === "/") {
|
|
149
|
+
return {
|
|
150
|
+
monorepoManager: "nx",
|
|
151
|
+
buildCommand: "npx nx build",
|
|
152
|
+
installCommand: packageManager ? `${packageManager} install` : null
|
|
153
|
+
};
|
|
150
154
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
'installCommand',
|
|
159
|
-
`node ${relativeToRoot}/common/scripts/install-run-rush.js install`
|
|
160
|
-
);
|
|
161
|
-
} */
|
|
162
|
-
return null;
|
|
155
|
+
return {
|
|
156
|
+
monorepoManager: "nx",
|
|
157
|
+
buildCommand: projectName ? `cd ${relativeToRoot} && npx nx build ${projectName}` : null,
|
|
158
|
+
installCommand: packageManager === "npm" ? `${packageManager} install --prefix=${relativeToRoot}` : packageManager ? `${packageManager} install` : null
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
163
162
|
}
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
164
|
+
0 && (module.exports = {
|
|
165
|
+
MissingBuildPipeline,
|
|
166
|
+
MissingBuildTarget,
|
|
167
|
+
getMonorepoDefaultSettings
|
|
168
|
+
});
|
|
169
|
+
//# sourceMappingURL=get-monorepo-default-settings.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/monorepos/get-monorepo-default-settings.ts"],
|
|
4
|
+
"sourcesContent": ["import { join } from 'path';\nimport { monorepoManagers } from './monorepo-managers';\nimport { packageManagers } from '../package-managers/package-managers';\nimport { DetectorFilesystem } from '../detectors/filesystem';\nimport { detectFramework } from '../detect-framework';\nimport JSON5 from 'json5';\nimport semver from 'semver';\n\nexport class MissingBuildPipeline extends Error {\n constructor() {\n super(\n 'Missing required `build` pipeline in turbo.json or package.json Turbo configuration.'\n );\n }\n}\n\nexport class MissingBuildTarget extends Error {\n constructor() {\n super(\n 'Missing required `build` target in either nx.json, project.json, or package.json Nx configuration.'\n );\n }\n}\n\nfunction supportsRootCommand(turboSemVer: string | undefined) {\n if (!turboSemVer) {\n return false;\n }\n\n if (!semver.validRange(turboSemVer)) {\n return false;\n }\n\n return !semver.intersects(turboSemVer, '<1.8.0');\n}\n\ntype MonorepoDefaultSettings = {\n buildCommand?: string | null;\n installCommand?: string | null;\n commandForIgnoringBuildStep?: string;\n monorepoManager: string;\n} | null;\n\nexport async function getMonorepoDefaultSettings(\n projectName: string,\n projectPath: string,\n relativeToRoot: string,\n detectorFilesystem: DetectorFilesystem\n): Promise<MonorepoDefaultSettings> {\n const [monorepoManager, packageManager] = await Promise.all([\n detectFramework({\n fs: detectorFilesystem,\n frameworkList: monorepoManagers,\n }),\n detectFramework({\n fs: detectorFilesystem,\n frameworkList: packageManagers,\n }),\n ]);\n\n if (monorepoManager === 'turbo') {\n const [turboJSONBuf, packageJSONBuf] = await Promise.all([\n detectorFilesystem.readFile('turbo.json').catch(() => null),\n detectorFilesystem.readFile('package.json').catch(() => null),\n ]);\n\n let hasBuildPipeline = false;\n let turboSemVer = null;\n\n if (turboJSONBuf !== null) {\n const turboJSON = JSON5.parse(turboJSONBuf.toString('utf-8'));\n\n if (turboJSON?.pipeline?.build) {\n hasBuildPipeline = true;\n }\n }\n\n if (packageJSONBuf !== null) {\n const packageJSON = JSON.parse(packageJSONBuf.toString('utf-8'));\n\n if (packageJSON?.turbo?.pipeline?.build) {\n hasBuildPipeline = true;\n }\n\n turboSemVer =\n packageJSON?.dependencies?.turbo ||\n packageJSON?.devDependencies?.turbo ||\n null;\n }\n\n if (!hasBuildPipeline) {\n throw new MissingBuildPipeline();\n }\n\n if (projectPath === '/') {\n return {\n monorepoManager: 'turbo',\n buildCommand: 'turbo run build',\n installCommand: packageManager ? `${packageManager} install` : null,\n commandForIgnoringBuildStep: 'npx turbo-ignore',\n };\n }\n\n let buildCommand = null;\n if (projectPath) {\n if (supportsRootCommand(turboSemVer)) {\n buildCommand = `turbo run build`;\n } else {\n // We don't know for sure if the local `turbo` supports inference.\n buildCommand = `cd ${relativeToRoot} && turbo run build --filter={${projectPath}}...`;\n }\n }\n\n return {\n monorepoManager: 'turbo',\n buildCommand,\n installCommand:\n packageManager === 'npm'\n ? `${packageManager} install --prefix=${relativeToRoot}`\n : packageManager\n ? `${packageManager} install`\n : null,\n commandForIgnoringBuildStep: 'npx turbo-ignore',\n };\n } else if (monorepoManager === 'nx') {\n // No ENOENT handling required here since conditional wouldn't be `true` unless `nx.json` was found.\n const nxJSONBuf = await detectorFilesystem.readFile('nx.json');\n const nxJSON = JSON5.parse(nxJSONBuf.toString('utf-8'));\n\n if (!nxJSON?.targetDefaults?.build) {\n const [projectJSONBuf, packageJSONBuf] = await Promise.all([\n detectorFilesystem\n .readFile(join(projectPath, 'project.json'))\n .catch(() => null),\n detectorFilesystem\n .readFile(join(projectPath, 'package.json'))\n .catch(() => null),\n ]);\n\n let hasBuildTarget = false;\n\n if (projectJSONBuf) {\n const projectJSON = JSON5.parse(projectJSONBuf.toString('utf-8'));\n if (projectJSON?.targets?.build) {\n hasBuildTarget = true;\n }\n }\n\n if (packageJSONBuf) {\n const packageJSON = JSON5.parse(packageJSONBuf.toString('utf-8'));\n if (packageJSON?.nx) {\n if (packageJSON.nx.targets?.build) {\n hasBuildTarget = true;\n }\n }\n }\n\n if (!hasBuildTarget) {\n throw new MissingBuildTarget();\n }\n }\n\n if (projectPath === '/') {\n return {\n monorepoManager: 'nx',\n buildCommand: 'npx nx build',\n installCommand: packageManager ? `${packageManager} install` : null,\n };\n }\n return {\n monorepoManager: 'nx',\n buildCommand: projectName\n ? `cd ${relativeToRoot} && npx nx build ${projectName}`\n : null,\n installCommand:\n packageManager === 'npm'\n ? `${packageManager} install --prefix=${relativeToRoot}`\n : packageManager\n ? `${packageManager} install`\n : null,\n };\n }\n // TODO (@Ethan-Arrowood) - Revisit rush support when we can test it better\n /* else if (monorepoManager === 'rush') {\n setCommand(\n 'buildCommand',\n `node ${relativeToRoot}/common/scripts/install-run-rush.js build --to ${projectName}`\n );\n setCommand(\n 'installCommand',\n `node ${relativeToRoot}/common/scripts/install-run-rush.js install`\n );\n } */\n\n return null;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AACrB,+BAAiC;AACjC,8BAAgC;AAEhC,8BAAgC;AAChC,mBAAkB;AAClB,oBAAmB;AAEZ,MAAM,6BAA6B,MAAM;AAAA,EAC9C,cAAc;AACZ;AAAA,MACE;AAAA,IACF;AAAA,EACF;AACF;AAEO,MAAM,2BAA2B,MAAM;AAAA,EAC5C,cAAc;AACZ;AAAA,MACE;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,oBAAoB,aAAiC;AAC5D,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,cAAAA,QAAO,WAAW,WAAW,GAAG;AACnC,WAAO;AAAA,EACT;AAEA,SAAO,CAAC,cAAAA,QAAO,WAAW,aAAa,QAAQ;AACjD;AASA,eAAsB,2B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,MAAM,cAAc,oBAAoB,WAAW,KACnD;AAAA,MACJ,gBACE,mBAAmB,QACf,GAAG,cAAc,qBAAqB,cAAc,KACpD,iBACA,GAAG,cAAc,aACjB;AAAA,IACR;AAAA,EACF;AAaA,SAAO;AACT;",
|
|
6
|
+
"names": ["semver", "JSON5"]
|
|
7
|
+
}
|
|
@@ -1,106 +1,118 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
buildCommand: {
|
|
36
|
-
placeholder: 'Turborepo default',
|
|
37
|
-
value: null,
|
|
38
|
-
},
|
|
39
|
-
outputDirectory: {
|
|
40
|
-
value: null,
|
|
41
|
-
},
|
|
42
|
-
installCommand: {
|
|
43
|
-
value: null,
|
|
44
|
-
},
|
|
45
|
-
devCommand: {
|
|
46
|
-
value: null,
|
|
47
|
-
},
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var monorepo_managers_exports = {};
|
|
20
|
+
__export(monorepo_managers_exports, {
|
|
21
|
+
default: () => monorepo_managers_default,
|
|
22
|
+
monorepoManagers: () => monorepoManagers
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(monorepo_managers_exports);
|
|
25
|
+
const monorepoManagers = [
|
|
26
|
+
{
|
|
27
|
+
name: "Turborepo",
|
|
28
|
+
slug: "turbo",
|
|
29
|
+
logo: "https://api-frameworks.vercel.sh/monorepo-logos/turborepo.svg",
|
|
30
|
+
darkModeLogo: "https://api-frameworks.vercel.sh/monorepo-logos/turborepo-dark.svg",
|
|
31
|
+
detectors: {
|
|
32
|
+
some: [
|
|
33
|
+
{
|
|
34
|
+
path: "turbo.json"
|
|
48
35
|
},
|
|
36
|
+
{
|
|
37
|
+
path: "package.json",
|
|
38
|
+
matchContent: '"turbo":\\s*{[^}]*.+[^}]*}'
|
|
39
|
+
}
|
|
40
|
+
]
|
|
49
41
|
},
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
42
|
+
settings: {
|
|
43
|
+
buildCommand: {
|
|
44
|
+
placeholder: "Turborepo default",
|
|
45
|
+
value: null
|
|
46
|
+
},
|
|
47
|
+
outputDirectory: {
|
|
48
|
+
value: null
|
|
49
|
+
},
|
|
50
|
+
installCommand: {
|
|
51
|
+
value: null
|
|
52
|
+
},
|
|
53
|
+
devCommand: {
|
|
54
|
+
value: null
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "Nx",
|
|
60
|
+
slug: "nx",
|
|
61
|
+
logo: "https://api-frameworks.vercel.sh/monorepo-logos/nx.svg",
|
|
62
|
+
detectors: {
|
|
63
|
+
every: [
|
|
64
|
+
{
|
|
65
|
+
path: "nx.json"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
76
68
|
},
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
69
|
+
settings: {
|
|
70
|
+
buildCommand: {
|
|
71
|
+
placeholder: "Nx default",
|
|
72
|
+
value: null
|
|
73
|
+
},
|
|
74
|
+
outputDirectory: {
|
|
75
|
+
value: null
|
|
76
|
+
},
|
|
77
|
+
installCommand: {
|
|
78
|
+
value: null
|
|
79
|
+
},
|
|
80
|
+
devCommand: {
|
|
81
|
+
value: null
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "Rush",
|
|
87
|
+
slug: "rush",
|
|
88
|
+
logo: "https://api-frameworks.vercel.sh/monorepo-logos/rush.svg",
|
|
89
|
+
detectors: {
|
|
90
|
+
every: [
|
|
91
|
+
{
|
|
92
|
+
path: "rush.json"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
103
95
|
},
|
|
96
|
+
settings: {
|
|
97
|
+
buildCommand: {
|
|
98
|
+
placeholder: "Rush default",
|
|
99
|
+
value: null
|
|
100
|
+
},
|
|
101
|
+
outputDirectory: {
|
|
102
|
+
value: null
|
|
103
|
+
},
|
|
104
|
+
installCommand: {
|
|
105
|
+
placeholder: "Rush default"
|
|
106
|
+
},
|
|
107
|
+
devCommand: {
|
|
108
|
+
value: null
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
104
112
|
];
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
var monorepo_managers_default = monorepoManagers;
|
|
114
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
115
|
+
0 && (module.exports = {
|
|
116
|
+
monorepoManagers
|
|
117
|
+
});
|
|
118
|
+
//# sourceMappingURL=monorepo-managers.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/monorepos/monorepo-managers.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Framework } from '@vercel/frameworks';\n\n/**\n * The supported list of monorepo managers.\n *\n * This list is designed to work with the @see {@link detectFramework} function.\n *\n * @example\n * import { monorepoManagers as frameworkList } from '@vercel/fs-detectors'\n * import { detectFramework } from '@vercel/fs-detectors'\n *\n * const fs = new GitDetectorFilesystem(...)\n * detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null\n *\n */\nexport const monorepoManagers: Array<\n Omit<Framework, 'description' | 'getOutputDirName'>\n> = [\n {\n name: 'Turborepo',\n slug: 'turbo',\n logo: 'https://api-frameworks.vercel.sh/monorepo-logos/turborepo.svg',\n darkModeLogo:\n 'https://api-frameworks.vercel.sh/monorepo-logos/turborepo-dark.svg',\n detectors: {\n some: [\n {\n path: 'turbo.json',\n },\n {\n path: 'package.json',\n matchContent: '\"turbo\":\\\\s*{[^}]*.+[^}]*}',\n },\n ],\n },\n settings: {\n buildCommand: {\n placeholder: 'Turborepo default',\n value: null,\n },\n outputDirectory: {\n value: null,\n },\n installCommand: {\n value: null,\n },\n devCommand: {\n value: null,\n },\n },\n },\n {\n name: 'Nx',\n slug: 'nx',\n logo: 'https://api-frameworks.vercel.sh/monorepo-logos/nx.svg',\n detectors: {\n every: [\n {\n path: 'nx.json',\n },\n ],\n },\n settings: {\n buildCommand: {\n placeholder: 'Nx default',\n value: null,\n },\n outputDirectory: {\n value: null,\n },\n installCommand: {\n value: null,\n },\n devCommand: {\n value: null,\n },\n },\n },\n {\n name: 'Rush',\n slug: 'rush',\n logo: 'https://api-frameworks.vercel.sh/monorepo-logos/rush.svg',\n detectors: {\n every: [\n {\n path: 'rush.json',\n },\n ],\n },\n settings: {\n buildCommand: {\n placeholder: 'Rush default',\n value: null,\n },\n outputDirectory: {\n value: null,\n },\n installCommand: {\n placeholder: 'Rush default',\n },\n devCommand: {\n value: null,\n },\n },\n },\n];\n\nexport default monorepoManagers;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,MAAM,mBAET;AAAA,EACF;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,cACE;AAAA,IACF,WAAW;AAAA,MACT,MAAM;AAAA,QACJ;AAAA,UACE,MAAM;AAAA,QACR;AAAA,QACA;AAAA,UACE,MAAM;AAAA,UACN,cAAc;AAAA,QAChB;AAAA,MACF;AAAA,IACF;AAAA,IACA,UAAU;AAAA,MACR,cAAc;AAAA,QACZ,aAAa;AAAA,QACb,OAAO;AAAA,MACT;AAAA,MACA,iBAAiB;AAAA,QACf,OAAO;AAAA,MACT;AAAA,MACA,gBAAgB;AAAA,QACd,OAAO;AAAA,MACT;AAAA,MACA,YAAY;AAAA,QACV,OAAO;AAAA,MACT;AAAA,IACF;AAAA,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