@prisma/cli 3.0.0-dev.136.1 → 3.0.0-dev.137.1
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/controllers/app.js +14 -47
- package/package.json +2 -2
package/dist/controllers/app.js
CHANGED
|
@@ -32,8 +32,9 @@ import { createSelectPromptPort } from "./select-prompt-port.js";
|
|
|
32
32
|
import { requireAuthenticatedAuthState } from "./auth.js";
|
|
33
33
|
import { listRealWorkspaceProjects } from "./project.js";
|
|
34
34
|
import path from "node:path";
|
|
35
|
-
import { access
|
|
35
|
+
import { access } from "node:fs/promises";
|
|
36
36
|
import { COMPUTE_REGIONS, ENTRYPOINT_BUILD_TYPES, FRAMEWORKS, LOCAL_DEV_BUILD_TYPES, frameworkByKey, frameworkFromAlias, isConfigBackedBuildType } from "@prisma/compute-sdk/config";
|
|
37
|
+
import { detectComputeAppFromDirectory } from "@prisma/compute-sdk/config/directory";
|
|
37
38
|
import { Result, matchError } from "better-result";
|
|
38
39
|
import open from "open";
|
|
39
40
|
//#region src/controllers/app.ts
|
|
@@ -1990,55 +1991,21 @@ async function resolveDeployEntrypoint(cwd, framework, explicitEntrypoint, signa
|
|
|
1990
1991
|
}
|
|
1991
1992
|
}
|
|
1992
1993
|
async function detectDeployFramework(cwd, signal) {
|
|
1993
|
-
const
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
buildType: framework.buildType,
|
|
2002
|
-
displayName: framework.displayName,
|
|
2003
|
-
annotation
|
|
2004
|
-
};
|
|
2005
|
-
}
|
|
2006
|
-
return null;
|
|
2007
|
-
}
|
|
2008
|
-
async function detectFrameworkConfigFile(cwd, framework, signal) {
|
|
2009
|
-
for (const candidate of framework.detectConfigFiles) {
|
|
2010
|
-
const filePath = path.join(cwd, candidate);
|
|
2011
|
-
signal.throwIfAborted();
|
|
2012
|
-
try {
|
|
2013
|
-
const content = await readFile(filePath, {
|
|
2014
|
-
encoding: "utf8",
|
|
2015
|
-
signal
|
|
2016
|
-
});
|
|
2017
|
-
return {
|
|
2018
|
-
exists: true,
|
|
2019
|
-
standalone: /\boutput\s*:\s*["'`]standalone["'`]/.test(content),
|
|
2020
|
-
path: filePath
|
|
2021
|
-
};
|
|
2022
|
-
} catch (error) {
|
|
2023
|
-
if (signal.aborted) throw error;
|
|
2024
|
-
if (error.code !== "ENOENT") throw error;
|
|
2025
|
-
}
|
|
2026
|
-
}
|
|
1994
|
+
const detected = await detectComputeAppFromDirectory({
|
|
1995
|
+
appPath: cwd,
|
|
1996
|
+
signal
|
|
1997
|
+
});
|
|
1998
|
+
if (!detected) return null;
|
|
1999
|
+
let annotation = "detected from package.json";
|
|
2000
|
+
if (detected.configFile?.standaloneOutput) annotation = "standalone output detected";
|
|
2001
|
+
else if (detected.configFile) annotation = `detected from ${path.basename(detected.configFile.path)}`;
|
|
2027
2002
|
return {
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2003
|
+
key: detected.framework,
|
|
2004
|
+
buildType: detected.buildType,
|
|
2005
|
+
displayName: detected.frameworkName,
|
|
2006
|
+
annotation
|
|
2031
2007
|
};
|
|
2032
2008
|
}
|
|
2033
|
-
function hasPackageDependency(packageJson, dependencyName) {
|
|
2034
|
-
return hasDependency(packageJson?.dependencies, dependencyName) || hasDependency(packageJson?.devDependencies, dependencyName);
|
|
2035
|
-
}
|
|
2036
|
-
function hasAnyPackageDependency(packageJson, dependencyNames) {
|
|
2037
|
-
return dependencyNames.some((dependencyName) => hasPackageDependency(packageJson, dependencyName));
|
|
2038
|
-
}
|
|
2039
|
-
function hasDependency(dependencies, dependencyName) {
|
|
2040
|
-
return Boolean(dependencies && typeof dependencies === "object" && dependencyName in dependencies);
|
|
2041
|
-
}
|
|
2042
2009
|
function frameworkFromUserFacingValue(value, annotation) {
|
|
2043
2010
|
const framework = frameworkFromAlias(value);
|
|
2044
2011
|
if (!framework) throw frameworkNotDetectedError(void 0, value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/cli",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.137.1",
|
|
4
4
|
"description": "Command-line interface for the Prisma Developer Platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@clack/prompts": "^1.5.0",
|
|
47
|
-
"@prisma/compute-sdk": "0.
|
|
47
|
+
"@prisma/compute-sdk": "0.39.0",
|
|
48
48
|
"@prisma/credentials-store": "^7.8.0",
|
|
49
49
|
"@prisma/management-api-sdk": "^1.55.0",
|
|
50
50
|
"better-result": "^2.9.2",
|