@prisma/cli-init 0.0.0-dev.202505121430 → 0.0.0-dev.202505121459
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.
|
@@ -4,11 +4,11 @@ var __export = (target, all) => {
|
|
|
4
4
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
// platform/_lib/utils.ts
|
|
7
|
+
// src/platform/_lib/utils.ts
|
|
8
8
|
import { getCommandWithExecutor, isError as isError2, link } from "@prisma/internals";
|
|
9
9
|
import { bold, green } from "kleur/colors";
|
|
10
10
|
|
|
11
|
-
// platform/_lib/cli/parameters.ts
|
|
11
|
+
// src/platform/_lib/cli/parameters.ts
|
|
12
12
|
import { arg, isError } from "@prisma/internals";
|
|
13
13
|
var getRequiredParameter = (args, names, environmentVariable) => {
|
|
14
14
|
const value = getOptionalParameter(args, names, environmentVariable);
|
|
@@ -41,12 +41,12 @@ var getOptionalParameter = (args, names, environmentVariable) => {
|
|
|
41
41
|
return entry?.[1] ?? void 0;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
// platform/_lib/credentials.ts
|
|
44
|
+
// src/platform/_lib/credentials.ts
|
|
45
45
|
import fs2 from "fs-extra";
|
|
46
46
|
import path from "path";
|
|
47
47
|
import XdgAppPaths from "xdg-app-paths";
|
|
48
48
|
|
|
49
|
-
// platform/_lib/jsonFile.ts
|
|
49
|
+
// src/platform/_lib/jsonFile.ts
|
|
50
50
|
import fs from "fs-extra";
|
|
51
51
|
var parse = (buffer, { beforeParse, reviver } = {}) => {
|
|
52
52
|
let data = new TextDecoder().decode(buffer);
|
|
@@ -60,7 +60,7 @@ var loadJsonFile = async (filePath, options) => {
|
|
|
60
60
|
return parse(buffer, options);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
// platform/_lib/prelude.ts
|
|
63
|
+
// src/platform/_lib/prelude.ts
|
|
64
64
|
var unknownToError = (unknown) => {
|
|
65
65
|
if (unknown instanceof Error)
|
|
66
66
|
return unknown;
|
|
@@ -78,7 +78,7 @@ var tryCatch = (fn, catcher) => {
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
// platform/_lib/credentials.ts
|
|
81
|
+
// src/platform/_lib/credentials.ts
|
|
82
82
|
var credentialsFileDirectoryPath = new XdgAppPaths("prisma-platform-cli").config();
|
|
83
83
|
var credentialsFilePath = path.join(credentialsFileDirectoryPath, "auth.json");
|
|
84
84
|
var parseCredentials = (data) => {
|
|
@@ -95,7 +95,7 @@ var credentialsFile = {
|
|
|
95
95
|
delete: async () => fs2.pathExists(credentialsFilePath).then((exists) => exists ? fs2.remove(credentialsFilePath) : void 0).then(() => null).catch(unknownToError)
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
// platform/_lib/utils.ts
|
|
98
|
+
// src/platform/_lib/utils.ts
|
|
99
99
|
var platformParameters = {
|
|
100
100
|
global: {
|
|
101
101
|
// TODO Remove this from global once we have a way for parents to strip out flags upon parsing.
|
|
@@ -247,7 +247,7 @@ For more info, visit the Prisma Postgres docs: ${link("https://pris.ly/ppg-docs"
|
|
|
247
247
|
return isExistingPrismaProject ? existingPrismaProjectOutput : newPrismaProjectOutput;
|
|
248
248
|
};
|
|
249
249
|
|
|
250
|
-
// platform/accelerate/_.ts
|
|
250
|
+
// src/platform/accelerate/_.ts
|
|
251
251
|
var __exports = {};
|
|
252
252
|
__export(__exports, {
|
|
253
253
|
$: () => $,
|
|
@@ -255,7 +255,7 @@ __export(__exports, {
|
|
|
255
255
|
Enable: () => Enable
|
|
256
256
|
});
|
|
257
257
|
|
|
258
|
-
// platform/_lib/cli/dispatchToSubCommand.ts
|
|
258
|
+
// src/platform/_lib/cli/dispatchToSubCommand.ts
|
|
259
259
|
import { HelpError, link as link2 } from "@prisma/internals";
|
|
260
260
|
var dispatchToSubCommand = async (commands, argv, config) => {
|
|
261
261
|
const commandName = argv[0];
|
|
@@ -271,7 +271,7 @@ var dispatchToSubCommand = async (commands, argv, config) => {
|
|
|
271
271
|
return result;
|
|
272
272
|
};
|
|
273
273
|
|
|
274
|
-
// platform/_lib/cli/namespace.ts
|
|
274
|
+
// src/platform/_lib/cli/namespace.ts
|
|
275
275
|
var createNamespace = () => {
|
|
276
276
|
return class $7 {
|
|
277
277
|
constructor(commands) {
|
|
@@ -286,10 +286,10 @@ var createNamespace = () => {
|
|
|
286
286
|
};
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
-
// platform/accelerate/$.ts
|
|
289
|
+
// src/platform/accelerate/$.ts
|
|
290
290
|
var $ = createNamespace();
|
|
291
291
|
|
|
292
|
-
// platform/_lib/messages.ts
|
|
292
|
+
// src/platform/_lib/messages.ts
|
|
293
293
|
import { formatTable, mapObjectValues } from "@prisma/internals";
|
|
294
294
|
import { bold as bold2, dim, green as green2, white } from "kleur/colors";
|
|
295
295
|
var table = (object, renderersInput) => {
|
|
@@ -332,18 +332,18 @@ var messages = {
|
|
|
332
332
|
success: successMessage
|
|
333
333
|
};
|
|
334
334
|
|
|
335
|
-
// platform/_lib/pdp.ts
|
|
335
|
+
// src/platform/_lib/pdp.ts
|
|
336
336
|
import fetch, { Headers } from "node-fetch";
|
|
337
337
|
|
|
338
|
-
// platform/_lib/userAgent.ts
|
|
338
|
+
// src/platform/_lib/userAgent.ts
|
|
339
339
|
import Debug from "@prisma/debug";
|
|
340
340
|
import { isError as isError3 } from "@prisma/internals";
|
|
341
341
|
import * as Checkpoint from "checkpoint-client";
|
|
342
342
|
|
|
343
343
|
// package.json
|
|
344
|
-
var version = "0.0.0-dev.
|
|
344
|
+
var version = "0.0.0-dev.202505121459";
|
|
345
345
|
|
|
346
|
-
// platform/_lib/userAgent.ts
|
|
346
|
+
// src/platform/_lib/userAgent.ts
|
|
347
347
|
var debug = Debug("prisma:cli:platform:_lib:userAgent");
|
|
348
348
|
var getUserAgent = async () => {
|
|
349
349
|
const signature = await Checkpoint.getSignature().catch(unknownToError);
|
|
@@ -353,7 +353,7 @@ var getUserAgent = async () => {
|
|
|
353
353
|
return `prisma-cli-init/${version} (Signature: ${signatureString})`;
|
|
354
354
|
};
|
|
355
355
|
|
|
356
|
-
// platform/_lib/pdp.ts
|
|
356
|
+
// src/platform/_lib/pdp.ts
|
|
357
357
|
var platformAPIEndpoint = new URL("https://console.prisma.io/api");
|
|
358
358
|
var consoleUrl = new URL("https://console.prisma.io");
|
|
359
359
|
var requestOrThrow = async (params) => {
|
|
@@ -384,7 +384,7 @@ var errorFromPlatformError = (error) => {
|
|
|
384
384
|
return new Error(error.message);
|
|
385
385
|
};
|
|
386
386
|
|
|
387
|
-
// platform/accelerate/disable.ts
|
|
387
|
+
// src/platform/accelerate/disable.ts
|
|
388
388
|
var Disable = class _Disable {
|
|
389
389
|
static new() {
|
|
390
390
|
return new _Disable();
|
|
@@ -422,7 +422,7 @@ var Disable = class _Disable {
|
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
424
|
|
|
425
|
-
// platform/accelerate/enable.ts
|
|
425
|
+
// src/platform/accelerate/enable.ts
|
|
426
426
|
import { arg as arg2, isError as isError4, link as link3 } from "@prisma/internals";
|
|
427
427
|
var Enable = class _Enable {
|
|
428
428
|
static new() {
|
|
@@ -526,7 +526,7 @@ For more information, check out the Getting started guide here: ${gettingStarted
|
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
528
|
|
|
529
|
-
// platform/auth/_.ts
|
|
529
|
+
// src/platform/auth/_.ts
|
|
530
530
|
var __exports2 = {};
|
|
531
531
|
__export(__exports2, {
|
|
532
532
|
$: () => $2,
|
|
@@ -536,10 +536,10 @@ __export(__exports2, {
|
|
|
536
536
|
loginOrSignup: () => loginOrSignup
|
|
537
537
|
});
|
|
538
538
|
|
|
539
|
-
// platform/auth/$.ts
|
|
539
|
+
// src/platform/auth/$.ts
|
|
540
540
|
var $2 = createNamespace();
|
|
541
541
|
|
|
542
|
-
// platform/auth/login.ts
|
|
542
|
+
// src/platform/auth/login.ts
|
|
543
543
|
import { select } from "@inquirer/prompts";
|
|
544
544
|
import Debug2 from "@prisma/debug";
|
|
545
545
|
import { arg as arg3, getCommandWithExecutor as getCommandWithExecutor2, isError as isError5, link as link4 } from "@prisma/internals";
|
|
@@ -717,11 +717,11 @@ var loginOrSignup = async () => {
|
|
|
717
717
|
};
|
|
718
718
|
};
|
|
719
719
|
|
|
720
|
-
// platform/auth/logout.ts
|
|
720
|
+
// src/platform/auth/logout.ts
|
|
721
721
|
import { getCommandWithExecutor as getCommandWithExecutor3, isError as isError7 } from "@prisma/internals";
|
|
722
722
|
import { green as green4 } from "kleur/colors";
|
|
723
723
|
|
|
724
|
-
// platform/_lib/jwt.ts
|
|
724
|
+
// src/platform/_lib/jwt.ts
|
|
725
725
|
import { isError as isError6 } from "@prisma/internals";
|
|
726
726
|
var decodeJwt = (jwt) => {
|
|
727
727
|
if (typeof jwt !== "string")
|
|
@@ -750,7 +750,7 @@ var decodeJwt = (jwt) => {
|
|
|
750
750
|
return result;
|
|
751
751
|
};
|
|
752
752
|
|
|
753
|
-
// platform/auth/logout.ts
|
|
753
|
+
// src/platform/auth/logout.ts
|
|
754
754
|
var Logout = class _Logout {
|
|
755
755
|
static new() {
|
|
756
756
|
return new _Logout();
|
|
@@ -794,7 +794,7 @@ var Logout = class _Logout {
|
|
|
794
794
|
}
|
|
795
795
|
};
|
|
796
796
|
|
|
797
|
-
// platform/auth/show.ts
|
|
797
|
+
// src/platform/auth/show.ts
|
|
798
798
|
import { green as green5 } from "kleur/colors";
|
|
799
799
|
var Show = class _Show {
|
|
800
800
|
static new() {
|
|
@@ -841,7 +841,7 @@ var Show = class _Show {
|
|
|
841
841
|
}
|
|
842
842
|
};
|
|
843
843
|
|
|
844
|
-
// platform/environment/_.ts
|
|
844
|
+
// src/platform/environment/_.ts
|
|
845
845
|
var __exports3 = {};
|
|
846
846
|
__export(__exports3, {
|
|
847
847
|
$: () => $3,
|
|
@@ -851,10 +851,10 @@ __export(__exports3, {
|
|
|
851
851
|
getEnvironmentOrThrow: () => getEnvironmentOrThrow
|
|
852
852
|
});
|
|
853
853
|
|
|
854
|
-
// platform/environment/$.ts
|
|
854
|
+
// src/platform/environment/$.ts
|
|
855
855
|
var $3 = createNamespace();
|
|
856
856
|
|
|
857
|
-
// platform/environment/create.ts
|
|
857
|
+
// src/platform/environment/create.ts
|
|
858
858
|
var Create = class _Create {
|
|
859
859
|
static new() {
|
|
860
860
|
return new _Create();
|
|
@@ -901,7 +901,7 @@ var Create = class _Create {
|
|
|
901
901
|
}
|
|
902
902
|
};
|
|
903
903
|
|
|
904
|
-
// platform/environment/delete.ts
|
|
904
|
+
// src/platform/environment/delete.ts
|
|
905
905
|
import { arg as arg4, isError as isError8 } from "@prisma/internals";
|
|
906
906
|
var Delete = class _Delete {
|
|
907
907
|
static new() {
|
|
@@ -947,7 +947,7 @@ var Delete = class _Delete {
|
|
|
947
947
|
}
|
|
948
948
|
};
|
|
949
949
|
|
|
950
|
-
// platform/environment/show.ts
|
|
950
|
+
// src/platform/environment/show.ts
|
|
951
951
|
import { arg as arg5, isError as isError9 } from "@prisma/internals";
|
|
952
952
|
var Show2 = class _Show {
|
|
953
953
|
static new() {
|
|
@@ -1043,7 +1043,7 @@ var getEnvironmentOrThrow = async (input) => {
|
|
|
1043
1043
|
return environment;
|
|
1044
1044
|
};
|
|
1045
1045
|
|
|
1046
|
-
// platform/project/_.ts
|
|
1046
|
+
// src/platform/project/_.ts
|
|
1047
1047
|
var __exports4 = {};
|
|
1048
1048
|
__export(__exports4, {
|
|
1049
1049
|
$: () => $4,
|
|
@@ -1053,10 +1053,10 @@ __export(__exports4, {
|
|
|
1053
1053
|
createProjectOrThrow: () => createProjectOrThrow
|
|
1054
1054
|
});
|
|
1055
1055
|
|
|
1056
|
-
// platform/project/$.ts
|
|
1056
|
+
// src/platform/project/$.ts
|
|
1057
1057
|
var $4 = createNamespace();
|
|
1058
1058
|
|
|
1059
|
-
// platform/project/create.ts
|
|
1059
|
+
// src/platform/project/create.ts
|
|
1060
1060
|
var Create2 = class _Create {
|
|
1061
1061
|
static new() {
|
|
1062
1062
|
return new _Create();
|
|
@@ -1112,7 +1112,7 @@ var createProjectOrThrow = async (input) => {
|
|
|
1112
1112
|
return projectCreate;
|
|
1113
1113
|
};
|
|
1114
1114
|
|
|
1115
|
-
// platform/project/delete.ts
|
|
1115
|
+
// src/platform/project/delete.ts
|
|
1116
1116
|
import { arg as arg6, isError as isError10 } from "@prisma/internals";
|
|
1117
1117
|
var Delete2 = class _Delete {
|
|
1118
1118
|
static new() {
|
|
@@ -1158,7 +1158,7 @@ var Delete2 = class _Delete {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
};
|
|
1160
1160
|
|
|
1161
|
-
// platform/project/show.ts
|
|
1161
|
+
// src/platform/project/show.ts
|
|
1162
1162
|
import { arg as arg7, isError as isError11 } from "@prisma/internals";
|
|
1163
1163
|
var Show3 = class _Show {
|
|
1164
1164
|
static new() {
|
|
@@ -1207,7 +1207,7 @@ var Show3 = class _Show {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
};
|
|
1209
1209
|
|
|
1210
|
-
// platform/serviceToken/_.ts
|
|
1210
|
+
// src/platform/serviceToken/_.ts
|
|
1211
1211
|
var __exports5 = {};
|
|
1212
1212
|
__export(__exports5, {
|
|
1213
1213
|
$: () => $5,
|
|
@@ -1217,10 +1217,10 @@ __export(__exports5, {
|
|
|
1217
1217
|
createOrThrow: () => createOrThrow
|
|
1218
1218
|
});
|
|
1219
1219
|
|
|
1220
|
-
// platform/serviceToken/$.ts
|
|
1220
|
+
// src/platform/serviceToken/$.ts
|
|
1221
1221
|
var $5 = createNamespace();
|
|
1222
1222
|
|
|
1223
|
-
// platform/serviceToken/create.ts
|
|
1223
|
+
// src/platform/serviceToken/create.ts
|
|
1224
1224
|
var Create3 = class _Create {
|
|
1225
1225
|
constructor(legacy = false) {
|
|
1226
1226
|
this.legacy = legacy;
|
|
@@ -1283,7 +1283,7 @@ var createOrThrow = async (input) => {
|
|
|
1283
1283
|
return serviceTokenCreate;
|
|
1284
1284
|
};
|
|
1285
1285
|
|
|
1286
|
-
// platform/serviceToken/delete.ts
|
|
1286
|
+
// src/platform/serviceToken/delete.ts
|
|
1287
1287
|
var Delete3 = class _Delete {
|
|
1288
1288
|
constructor(legacy = false) {
|
|
1289
1289
|
this.legacy = legacy;
|
|
@@ -1328,7 +1328,7 @@ var Delete3 = class _Delete {
|
|
|
1328
1328
|
}
|
|
1329
1329
|
};
|
|
1330
1330
|
|
|
1331
|
-
// platform/serviceToken/show.ts
|
|
1331
|
+
// src/platform/serviceToken/show.ts
|
|
1332
1332
|
import { arg as arg8, isError as isError12 } from "@prisma/internals";
|
|
1333
1333
|
var Show4 = class _Show {
|
|
1334
1334
|
constructor(legacy = false) {
|
|
@@ -1380,7 +1380,7 @@ var Show4 = class _Show {
|
|
|
1380
1380
|
}
|
|
1381
1381
|
};
|
|
1382
1382
|
|
|
1383
|
-
// platform/workspace/_.ts
|
|
1383
|
+
// src/platform/workspace/_.ts
|
|
1384
1384
|
var __exports6 = {};
|
|
1385
1385
|
__export(__exports6, {
|
|
1386
1386
|
$: () => $6,
|
|
@@ -1389,10 +1389,10 @@ __export(__exports6, {
|
|
|
1389
1389
|
getUserWorkspacesOrThrow: () => getUserWorkspacesOrThrow
|
|
1390
1390
|
});
|
|
1391
1391
|
|
|
1392
|
-
// platform/workspace/$.ts
|
|
1392
|
+
// src/platform/workspace/$.ts
|
|
1393
1393
|
var $6 = createNamespace();
|
|
1394
1394
|
|
|
1395
|
-
// platform/workspace/show.ts
|
|
1395
|
+
// src/platform/workspace/show.ts
|
|
1396
1396
|
var Show5 = class _Show {
|
|
1397
1397
|
static new() {
|
|
1398
1398
|
return new _Show();
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
printPpgInitOutput,
|
|
5
5
|
requestOrThrow,
|
|
6
6
|
successMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UWTWVOK3.js";
|
|
8
8
|
|
|
9
|
-
// Init.ts
|
|
9
|
+
// src/Init.ts
|
|
10
10
|
import { confirm, input, select } from "@inquirer/prompts";
|
|
11
11
|
import {
|
|
12
12
|
arg,
|
|
@@ -30,7 +30,7 @@ import ora from "ora";
|
|
|
30
30
|
import path2 from "path";
|
|
31
31
|
import { match, P } from "ts-pattern";
|
|
32
32
|
|
|
33
|
-
// utils/client-output-path.ts
|
|
33
|
+
// src/utils/client-output-path.ts
|
|
34
34
|
import fs from "fs";
|
|
35
35
|
import path from "path";
|
|
36
36
|
import { getTsconfig } from "get-tsconfig";
|
|
@@ -63,7 +63,7 @@ function getSourceDirFromTypeScriptConfig() {
|
|
|
63
63
|
return config.compilerOptions?.rootDir ?? config.compilerOptions?.baseUrl ?? config.compilerOptions?.rootDirs?.[0];
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
// platform/accelerate/regions.ts
|
|
66
|
+
// src/platform/accelerate/regions.ts
|
|
67
67
|
var getRegionsOrThrow = async (input2) => {
|
|
68
68
|
const { token } = input2;
|
|
69
69
|
const { system } = await requestOrThrow({
|
|
@@ -95,13 +95,13 @@ var getPrismaPostgresRegionsOrThrow = async (input2) => {
|
|
|
95
95
|
return ppgRegions;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
// utils/print.ts
|
|
98
|
+
// src/utils/print.ts
|
|
99
99
|
import { bgRed, bold, red } from "kleur/colors";
|
|
100
100
|
function printError(text) {
|
|
101
101
|
return bold(bgRed(" ERROR ")) + " " + red(text);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
// Init.ts
|
|
104
|
+
// src/Init.ts
|
|
105
105
|
var defaultSchema = (props) => {
|
|
106
106
|
const {
|
|
107
107
|
datasourceProvider = "postgresql",
|
|
@@ -355,7 +355,7 @@ var Init = class _Init {
|
|
|
355
355
|
let generatedSchema;
|
|
356
356
|
let generatedName;
|
|
357
357
|
if (isPpgCommand) {
|
|
358
|
-
const PlatformCommands = await import("./_-
|
|
358
|
+
const PlatformCommands = await import("./_-GNTZG3LT.js");
|
|
359
359
|
const credentials = await credentialsFile.load();
|
|
360
360
|
if (isError(credentials))
|
|
361
361
|
throw credentials;
|
|
@@ -600,7 +600,7 @@ ${_Init.help}`);
|
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
602
|
|
|
603
|
-
// index.ts
|
|
603
|
+
// src/index.ts
|
|
604
604
|
function run(args, config) {
|
|
605
605
|
return new Init().parse(args, config);
|
|
606
606
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/cli-init",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.202505121459",
|
|
4
4
|
"description": "Init CLI for Prisma",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -28,10 +28,13 @@
|
|
|
28
28
|
],
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@arethetypeswrong/cli": "0.17.4",
|
|
31
|
+
"@prisma/get-platform": "6.7.0",
|
|
31
32
|
"@types/fs-extra": "11.0.4",
|
|
32
33
|
"@types/node": "22.3.0",
|
|
34
|
+
"strip-ansi": "7.1.0",
|
|
33
35
|
"tsup": "8.0.2",
|
|
34
|
-
"typescript": "5.8.3"
|
|
36
|
+
"typescript": "5.8.3",
|
|
37
|
+
"vitest": "3.1.3"
|
|
35
38
|
},
|
|
36
39
|
"dependencies": {
|
|
37
40
|
"@inquirer/prompts": "7.3.3",
|
|
@@ -58,7 +61,7 @@
|
|
|
58
61
|
"check:exports": "attw . --pack --profile esm-only",
|
|
59
62
|
"dev": "tsup --watch",
|
|
60
63
|
"lint": "eslint --fix .",
|
|
61
|
-
"test": "",
|
|
64
|
+
"test": "vitest",
|
|
62
65
|
"typecheck": "tsc --noEmit"
|
|
63
66
|
}
|
|
64
67
|
}
|