@prisma/cli-init 0.0.0-dev.202506171842 → 0.0.0-dev.202506171847
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.
|
@@ -344,7 +344,7 @@ import internals5 from "@prisma/internals";
|
|
|
344
344
|
import * as Checkpoint from "checkpoint-client";
|
|
345
345
|
|
|
346
346
|
// package.json
|
|
347
|
-
var version = "0.0.0-dev.
|
|
347
|
+
var version = "0.0.0-dev.202506171847";
|
|
348
348
|
|
|
349
349
|
// src/platform/_lib/userAgent.ts
|
|
350
350
|
var debug = Debug("prisma:cli:platform:_lib:userAgent");
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
credentialsFile,
|
|
4
|
-
poll,
|
|
5
|
-
printPpgInitOutput,
|
|
6
|
-
requestOrThrow,
|
|
7
|
-
successMessage
|
|
8
|
-
} from "./chunk-3NINNG6I.js";
|
|
9
2
|
import {
|
|
10
3
|
Engine,
|
|
11
4
|
encodeAPIKey,
|
|
@@ -29,6 +22,13 @@ import {
|
|
|
29
22
|
withResolvers,
|
|
30
23
|
y
|
|
31
24
|
} from "./chunk-ASMCGOOW.js";
|
|
25
|
+
import {
|
|
26
|
+
credentialsFile,
|
|
27
|
+
poll,
|
|
28
|
+
printPpgInitOutput,
|
|
29
|
+
requestOrThrow,
|
|
30
|
+
successMessage
|
|
31
|
+
} from "./chunk-O3JCNL5E.js";
|
|
32
32
|
import {
|
|
33
33
|
__commonJS,
|
|
34
34
|
__require,
|
|
@@ -1653,85 +1653,6 @@ var require_proper_lockfile = __commonJS({
|
|
|
1653
1653
|
|
|
1654
1654
|
// src/Init.ts
|
|
1655
1655
|
import { confirm, input, select } from "@inquirer/prompts";
|
|
1656
|
-
import internals from "@prisma/internals";
|
|
1657
|
-
import dotenv from "dotenv";
|
|
1658
|
-
import { Schema as Shape } from "effect";
|
|
1659
|
-
import fs2 from "fs";
|
|
1660
|
-
import { bold as bold2, dim, green, red as red2, yellow } from "kleur/colors";
|
|
1661
|
-
import ora from "ora";
|
|
1662
|
-
import path2 from "path";
|
|
1663
|
-
import { match, P } from "ts-pattern";
|
|
1664
|
-
|
|
1665
|
-
// src/utils/client-output-path.ts
|
|
1666
|
-
import fs from "fs";
|
|
1667
|
-
import path from "path";
|
|
1668
|
-
import { getTsconfig } from "get-tsconfig";
|
|
1669
|
-
function determineClientOutputPath(schemaDir) {
|
|
1670
|
-
const sourceDir = getSourceDir();
|
|
1671
|
-
const outputPath = path.join(sourceDir, "generated", "prisma");
|
|
1672
|
-
const relativeOutputPath = path.relative(schemaDir, outputPath);
|
|
1673
|
-
return relativeOutputPath.replaceAll(path.sep, "/");
|
|
1674
|
-
}
|
|
1675
|
-
function getSourceDir() {
|
|
1676
|
-
const projectDir = process.cwd();
|
|
1677
|
-
const sourceRootFromTsConfig = getSourceDirFromTypeScriptConfig();
|
|
1678
|
-
if (sourceRootFromTsConfig) {
|
|
1679
|
-
return path.join(projectDir, sourceRootFromTsConfig);
|
|
1680
|
-
}
|
|
1681
|
-
for (const dir of ["src", "lib", "app"]) {
|
|
1682
|
-
const absoluteSourceDir = path.join(projectDir, dir);
|
|
1683
|
-
if (fs.existsSync(absoluteSourceDir)) {
|
|
1684
|
-
return absoluteSourceDir;
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
|
-
return projectDir;
|
|
1688
|
-
}
|
|
1689
|
-
function getSourceDirFromTypeScriptConfig() {
|
|
1690
|
-
const tsconfig = getTsconfig();
|
|
1691
|
-
if (!tsconfig) {
|
|
1692
|
-
return void 0;
|
|
1693
|
-
}
|
|
1694
|
-
const { config } = tsconfig;
|
|
1695
|
-
return config.compilerOptions?.rootDir ?? config.compilerOptions?.baseUrl ?? config.compilerOptions?.rootDirs?.[0];
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
|
-
// src/platform/accelerate/regions.ts
|
|
1699
|
-
var getRegionsOrThrow = async (input2) => {
|
|
1700
|
-
const { token } = input2;
|
|
1701
|
-
const { system } = await requestOrThrow({
|
|
1702
|
-
token,
|
|
1703
|
-
body: {
|
|
1704
|
-
query: (
|
|
1705
|
-
/* GraphQL */
|
|
1706
|
-
`
|
|
1707
|
-
query {
|
|
1708
|
-
system {
|
|
1709
|
-
accelerate {
|
|
1710
|
-
regions {
|
|
1711
|
-
id
|
|
1712
|
-
displayName
|
|
1713
|
-
ppgStatus
|
|
1714
|
-
}
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
`
|
|
1719
|
-
)
|
|
1720
|
-
}
|
|
1721
|
-
});
|
|
1722
|
-
return system.accelerate.regions;
|
|
1723
|
-
};
|
|
1724
|
-
var getPrismaPostgresRegionsOrThrow = async (input2) => {
|
|
1725
|
-
const regions = await getRegionsOrThrow(input2);
|
|
1726
|
-
const ppgRegions = regions.filter((_) => _.ppgStatus !== "unsupported").sort((a2, b) => b.displayName.localeCompare(a2.displayName));
|
|
1727
|
-
return ppgRegions;
|
|
1728
|
-
};
|
|
1729
|
-
|
|
1730
|
-
// src/utils/print.ts
|
|
1731
|
-
import { bgRed, bold, red } from "kleur/colors";
|
|
1732
|
-
function printError(text) {
|
|
1733
|
-
return bold(bgRed(" ERROR ")) + " " + red(text);
|
|
1734
|
-
}
|
|
1735
1656
|
|
|
1736
1657
|
// ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
1737
1658
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
@@ -3142,6 +3063,87 @@ async function unstable_startServer(options) {
|
|
|
3142
3063
|
}
|
|
3143
3064
|
}
|
|
3144
3065
|
|
|
3066
|
+
// src/Init.ts
|
|
3067
|
+
import internals from "@prisma/internals";
|
|
3068
|
+
import dotenv from "dotenv";
|
|
3069
|
+
import { Schema as Shape } from "effect";
|
|
3070
|
+
import fs2 from "fs";
|
|
3071
|
+
import { bold as bold2, dim, green, red as red2, yellow } from "kleur/colors";
|
|
3072
|
+
import ora from "ora";
|
|
3073
|
+
import path2 from "path";
|
|
3074
|
+
import { match, P } from "ts-pattern";
|
|
3075
|
+
|
|
3076
|
+
// src/utils/client-output-path.ts
|
|
3077
|
+
import fs from "fs";
|
|
3078
|
+
import path from "path";
|
|
3079
|
+
import { getTsconfig } from "get-tsconfig";
|
|
3080
|
+
function determineClientOutputPath(schemaDir) {
|
|
3081
|
+
const sourceDir = getSourceDir();
|
|
3082
|
+
const outputPath = path.join(sourceDir, "generated", "prisma");
|
|
3083
|
+
const relativeOutputPath = path.relative(schemaDir, outputPath);
|
|
3084
|
+
return relativeOutputPath.replaceAll(path.sep, "/");
|
|
3085
|
+
}
|
|
3086
|
+
function getSourceDir() {
|
|
3087
|
+
const projectDir = process.cwd();
|
|
3088
|
+
const sourceRootFromTsConfig = getSourceDirFromTypeScriptConfig();
|
|
3089
|
+
if (sourceRootFromTsConfig) {
|
|
3090
|
+
return path.join(projectDir, sourceRootFromTsConfig);
|
|
3091
|
+
}
|
|
3092
|
+
for (const dir of ["src", "lib", "app"]) {
|
|
3093
|
+
const absoluteSourceDir = path.join(projectDir, dir);
|
|
3094
|
+
if (fs.existsSync(absoluteSourceDir)) {
|
|
3095
|
+
return absoluteSourceDir;
|
|
3096
|
+
}
|
|
3097
|
+
}
|
|
3098
|
+
return projectDir;
|
|
3099
|
+
}
|
|
3100
|
+
function getSourceDirFromTypeScriptConfig() {
|
|
3101
|
+
const tsconfig = getTsconfig();
|
|
3102
|
+
if (!tsconfig) {
|
|
3103
|
+
return void 0;
|
|
3104
|
+
}
|
|
3105
|
+
const { config } = tsconfig;
|
|
3106
|
+
return config.compilerOptions?.rootDir ?? config.compilerOptions?.baseUrl ?? config.compilerOptions?.rootDirs?.[0];
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3109
|
+
// src/platform/accelerate/regions.ts
|
|
3110
|
+
var getRegionsOrThrow = async (input2) => {
|
|
3111
|
+
const { token } = input2;
|
|
3112
|
+
const { system } = await requestOrThrow({
|
|
3113
|
+
token,
|
|
3114
|
+
body: {
|
|
3115
|
+
query: (
|
|
3116
|
+
/* GraphQL */
|
|
3117
|
+
`
|
|
3118
|
+
query {
|
|
3119
|
+
system {
|
|
3120
|
+
accelerate {
|
|
3121
|
+
regions {
|
|
3122
|
+
id
|
|
3123
|
+
displayName
|
|
3124
|
+
ppgStatus
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
}
|
|
3129
|
+
`
|
|
3130
|
+
)
|
|
3131
|
+
}
|
|
3132
|
+
});
|
|
3133
|
+
return system.accelerate.regions;
|
|
3134
|
+
};
|
|
3135
|
+
var getPrismaPostgresRegionsOrThrow = async (input2) => {
|
|
3136
|
+
const regions = await getRegionsOrThrow(input2);
|
|
3137
|
+
const ppgRegions = regions.filter((_) => _.ppgStatus !== "unsupported").sort((a2, b) => b.displayName.localeCompare(a2.displayName));
|
|
3138
|
+
return ppgRegions;
|
|
3139
|
+
};
|
|
3140
|
+
|
|
3141
|
+
// src/utils/print.ts
|
|
3142
|
+
import { bgRed, bold, red } from "kleur/colors";
|
|
3143
|
+
function printError(text) {
|
|
3144
|
+
return bold(bgRed(" ERROR ")) + " " + red(text);
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3145
3147
|
// src/Init.ts
|
|
3146
3148
|
var defaultSchema = (props) => {
|
|
3147
3149
|
const {
|
|
@@ -3395,7 +3397,7 @@ var Init = class _Init {
|
|
|
3395
3397
|
let generatedSchema;
|
|
3396
3398
|
let generatedName;
|
|
3397
3399
|
if (isPpgCommand) {
|
|
3398
|
-
const PlatformCommands = await import("./_-
|
|
3400
|
+
const PlatformCommands = await import("./_-NAIH7KVL.js");
|
|
3399
3401
|
const credentials = await credentialsFile.load();
|
|
3400
3402
|
if (internals.isError(credentials))
|
|
3401
3403
|
throw credentials;
|