@prisma/cli-init 0.7.0 → 0.8.0

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.
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
2
 
3
- // ../../node_modules/.pnpm/valibot@1.2.0_typescript@5.8.3/node_modules/valibot/dist/index.mjs
3
+ // ../../node_modules/.pnpm/valibot@1.2.0_typescript@5.9.3/node_modules/valibot/dist/index.mjs
4
4
  var store$4;
5
5
  // @__NO_SIDE_EFFECTS__
6
6
  function getGlobalConfig(config$1) {
@@ -693,7 +693,7 @@ function withResolvers(options) {
693
693
  };
694
694
  }
695
695
 
696
- // ../../node_modules/.pnpm/std-env@3.9.0/node_modules/std-env/dist/index.mjs
696
+ // ../../node_modules/.pnpm/std-env@3.10.0/node_modules/std-env/dist/index.mjs
697
697
  var r = /* @__PURE__ */ Object.create(null);
698
698
  var i = (e) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e ? r : globalThis);
699
699
  var o = new Proxy(r, { get(e, s) {
@@ -829,7 +829,110 @@ function envPaths(name, { suffix = "nodejs" } = {}) {
829
829
  return linux(name);
830
830
  }
831
831
 
832
- // ../../node_modules/.pnpm/grammex@3.1.10/node_modules/grammex/dist/utils.js
832
+ // ../../node_modules/.pnpm/graphmatch@1.1.0/node_modules/graphmatch/dist/utils.js
833
+ var getNodes = (node) => {
834
+ const nodes = /* @__PURE__ */ new Set();
835
+ const queue = [node];
836
+ for (let i2 = 0; i2 < queue.length; i2++) {
837
+ const node2 = queue[i2];
838
+ if (nodes.has(node2))
839
+ continue;
840
+ nodes.add(node2);
841
+ const { children } = node2;
842
+ if (!children?.length)
843
+ continue;
844
+ for (let ci = 0, cl = children.length; ci < cl; ci++) {
845
+ queue.push(children[ci]);
846
+ }
847
+ }
848
+ return Array.from(nodes);
849
+ };
850
+ var getNodeFlags = (node) => {
851
+ let flags = "";
852
+ const nodes = getNodes(node);
853
+ for (let i2 = 0, l2 = nodes.length; i2 < l2; i2++) {
854
+ const node2 = nodes[i2];
855
+ if (!node2.regex)
856
+ continue;
857
+ const nodeFlags = node2.regex.flags;
858
+ flags || (flags = nodeFlags);
859
+ if (flags === nodeFlags)
860
+ continue;
861
+ throw new Error(`Inconsistent RegExp flags used: "${flags}" and "${nodeFlags}"`);
862
+ }
863
+ return flags;
864
+ };
865
+ var getNodeSourceWithCache = (node, partial, cache) => {
866
+ const cached = cache.get(node);
867
+ if (cached !== void 0)
868
+ return cached;
869
+ const isNodePartial = node.partial ?? partial;
870
+ let source = "";
871
+ if (node.regex) {
872
+ source += isNodePartial ? "(?:$|" : "";
873
+ source += node.regex.source;
874
+ }
875
+ if (node.children?.length) {
876
+ const children = uniq(node.children.map((node2) => getNodeSourceWithCache(node2, partial, cache)).filter(Boolean));
877
+ if (children?.length) {
878
+ const isSomeChildNonPartial = node.children.some((child) => !child.regex || !(child.partial ?? partial));
879
+ const needsWrapperGroup = children.length > 1 || isNodePartial && (!source.length || isSomeChildNonPartial);
880
+ source += needsWrapperGroup ? isNodePartial ? "(?:$|" : "(?:" : "";
881
+ source += children.join("|");
882
+ source += needsWrapperGroup ? ")" : "";
883
+ }
884
+ }
885
+ if (node.regex) {
886
+ source += isNodePartial ? ")" : "";
887
+ }
888
+ cache.set(node, source);
889
+ return source;
890
+ };
891
+ var getNodeSource = (node, partial) => {
892
+ const cache = /* @__PURE__ */ new Map();
893
+ const nodes = getNodes(node);
894
+ for (let i2 = nodes.length - 1; i2 >= 0; i2--) {
895
+ const source = getNodeSourceWithCache(nodes[i2], partial, cache);
896
+ if (i2 > 0)
897
+ continue;
898
+ return source;
899
+ }
900
+ return "";
901
+ };
902
+ var uniq = (values) => {
903
+ return Array.from(new Set(values));
904
+ };
905
+
906
+ // ../../node_modules/.pnpm/graphmatch@1.1.0/node_modules/graphmatch/dist/index.js
907
+ var graphmatch = (node, input, options) => {
908
+ return graphmatch.compile(node, options).test(input);
909
+ };
910
+ graphmatch.compile = (node, options) => {
911
+ const partial = options?.partial ?? false;
912
+ const source = getNodeSource(node, partial);
913
+ const flags = getNodeFlags(node);
914
+ return new RegExp(`^(?:${source})$`, flags);
915
+ };
916
+ var dist_default = graphmatch;
917
+
918
+ // ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/compile/index.js
919
+ var compile = (node, options) => {
920
+ const re = dist_default.compile(node, options);
921
+ const source = `${re.source.slice(0, -1)}[\\\\/]?$`;
922
+ const flags = re.flags;
923
+ return new RegExp(source, flags);
924
+ };
925
+ var compile_default = compile;
926
+
927
+ // ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/merge/index.js
928
+ var merge = (res) => {
929
+ const source = res.map((re) => re.source).join("|") || "$^";
930
+ const flags = res[0]?.flags;
931
+ return new RegExp(source, flags);
932
+ };
933
+ var merge_default = merge;
934
+
935
+ // ../../node_modules/.pnpm/grammex@3.1.12/node_modules/grammex/dist/utils.js
833
936
  var isArray = (value) => {
834
937
  return Array.isArray(value);
835
938
  };
@@ -885,7 +988,7 @@ var memoize = (fn) => {
885
988
  };
886
989
  };
887
990
 
888
- // ../../node_modules/.pnpm/grammex@3.1.10/node_modules/grammex/dist/index.js
991
+ // ../../node_modules/.pnpm/grammex@3.1.12/node_modules/grammex/dist/index.js
889
992
  var parse = (input, rule, options = {}) => {
890
993
  const state = { cache: {}, input, index: 0, indexBacktrackMax: 0, options, output: [] };
891
994
  const matched = resolve(rule)(state);
@@ -1034,6 +1137,9 @@ var optional2 = (rule, handler) => {
1034
1137
  var star = (rule, handler) => {
1035
1138
  return repeat(rule, 0, Infinity, handler);
1036
1139
  };
1140
+ var plus = (rule, handler) => {
1141
+ return repeat(rule, 1, Infinity, handler);
1142
+ };
1037
1143
  var and = (rules, handler) => {
1038
1144
  const erules = rules.map(resolve);
1039
1145
  return memoizable(handleable(backtrackable((state) => {
@@ -1179,23 +1285,51 @@ var resolve = memoize((rule) => {
1179
1285
  throw new Error("Invalid rule");
1180
1286
  });
1181
1287
 
1182
- // ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/utils.js
1288
+ // ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/utils.js
1183
1289
  var identity = (value) => {
1184
1290
  return value;
1185
1291
  };
1186
- var makeParser = (grammar) => {
1187
- return (input) => {
1188
- return parse(input, grammar, { memoization: false }).join("");
1292
+ var isString2 = (value) => {
1293
+ return typeof value === "string";
1294
+ };
1295
+ var memoizeByObject = (fn) => {
1296
+ const cacheFull = /* @__PURE__ */ new WeakMap();
1297
+ const cachePartial = /* @__PURE__ */ new WeakMap();
1298
+ return (globs, options) => {
1299
+ const cache = options?.partial ? cachePartial : cacheFull;
1300
+ const cached = cache.get(globs);
1301
+ if (cached !== void 0)
1302
+ return cached;
1303
+ const result = fn(globs, options);
1304
+ cache.set(globs, result);
1305
+ return result;
1189
1306
  };
1190
1307
  };
1191
- var memoize2 = (fn) => {
1192
- const cache = {};
1193
- return (arg) => {
1194
- return cache[arg] ?? (cache[arg] = fn(arg));
1308
+ var memoizeByPrimitive = (fn) => {
1309
+ const cacheFull = {};
1310
+ const cachePartial = {};
1311
+ return (glob, options) => {
1312
+ const cache = options?.partial ? cachePartial : cacheFull;
1313
+ return cache[glob] ?? (cache[glob] = fn(glob, options));
1195
1314
  };
1196
1315
  };
1197
1316
 
1198
- // ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/range.js
1317
+ // ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/normalize/grammar.js
1318
+ var Escaped = match(/\\./, identity);
1319
+ var Passthrough = match(/./, identity);
1320
+ var StarStarStar = match(/\*\*\*+/, "*");
1321
+ var StarStarNoLeft = match(/([^/{[(!])\*\*/, (_2, $1) => `${$1}*`);
1322
+ var StarStarNoRight = match(/(^|.)\*\*(?=[^*/)\]}])/, (_2, $1) => `${$1}*`);
1323
+ var Grammar = star(or([Escaped, StarStarStar, StarStarNoLeft, StarStarNoRight, Passthrough]));
1324
+ var grammar_default = Grammar;
1325
+
1326
+ // ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/normalize/index.js
1327
+ var normalize = (glob) => {
1328
+ return parse(glob, grammar_default, { memoization: false }).join("");
1329
+ };
1330
+ var normalize_default = normalize;
1331
+
1332
+ // ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/range.js
1199
1333
  var ALPHABET = "abcdefghijklmnopqrstuvwxyz";
1200
1334
  var int2alpha = (int) => {
1201
1335
  let alpha = "";
@@ -1229,82 +1363,121 @@ var makeRangeAlpha = (start, end) => {
1229
1363
  return makeRangeInt(alpha2int(start), alpha2int(end)).map(int2alpha);
1230
1364
  };
1231
1365
 
1232
- // ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/convert/grammar.js
1233
- var Escaped = match(/\\./, identity);
1234
- var Escape = match(/[$.*+?^(){}[\]\|]/, (char) => `\\${char}`);
1235
- var Slash = match(/[\\/]/, "[\\\\/]");
1236
- var Passthrough = match(/./, identity);
1237
- var NegationOdd = match(/^(?:!!)*!(.*)$/, (_2, glob) => `(?!^${parser_default(glob)}$).*?`);
1238
- var NegationEven = match(/^(!!)+/, "");
1366
+ // ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/parse/utils.js
1367
+ var regex3 = (source) => {
1368
+ const regex4 = new RegExp(source, "s");
1369
+ return { partial: false, regex: regex4, children: [] };
1370
+ };
1371
+ var alternation = (children) => {
1372
+ return { children };
1373
+ };
1374
+ var sequence = /* @__PURE__ */ (() => {
1375
+ const pushToLeaves = (parent, child, handled) => {
1376
+ if (handled.has(parent))
1377
+ return;
1378
+ handled.add(parent);
1379
+ const { children } = parent;
1380
+ if (!children.length) {
1381
+ children.push(child);
1382
+ } else {
1383
+ for (let i2 = 0, l2 = children.length; i2 < l2; i2++) {
1384
+ pushToLeaves(children[i2], child, handled);
1385
+ }
1386
+ }
1387
+ };
1388
+ return (nodes) => {
1389
+ if (!nodes.length) {
1390
+ return alternation([]);
1391
+ }
1392
+ for (let i2 = nodes.length - 1; i2 >= 1; i2--) {
1393
+ const handled = /* @__PURE__ */ new Set();
1394
+ const parent = nodes[i2 - 1];
1395
+ const child = nodes[i2];
1396
+ pushToLeaves(parent, child, handled);
1397
+ }
1398
+ return nodes[0];
1399
+ };
1400
+ })();
1401
+ var slash = () => {
1402
+ const regex4 = new RegExp("[\\\\/]", "s");
1403
+ return { regex: regex4, children: [] };
1404
+ };
1405
+
1406
+ // ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/parse/grammar.js
1407
+ var Escaped2 = match(/\\./, regex3);
1408
+ var Escape = match(/[$.*+?^(){}[\]\|]/, (char) => regex3(`\\${char}`));
1409
+ var Slash = match(/[\\\/]/, slash);
1410
+ var Passthrough2 = match(/[^$.*+?^(){}[\]\|\\\/]+/, regex3);
1411
+ var NegationOdd = match(/^(?:!!)*!(.*)$/, (_2, glob) => regex3(`(?!^${dist_default2.compile(glob).source}$).*?`));
1412
+ var NegationEven = match(/^(!!)+/);
1239
1413
  var Negation = or([NegationOdd, NegationEven]);
1240
- var StarStarBetween = match(/\/(\*\*\/)+/, "(?:[\\\\/].+[\\\\/]|[\\\\/])");
1241
- var StarStarStart = match(/^(\*\*\/)+/, "(?:^|.*[\\\\/])");
1242
- var StarStarEnd = match(/\/(\*\*)$/, "(?:[\\\\/].*|$)");
1243
- var StarStarNone = match(/\*\*/, ".*");
1414
+ var StarStarBetween = match(/\/(\*\*\/)+/, () => alternation([sequence([slash(), regex3(".+?"), slash()]), slash()]));
1415
+ var StarStarStart = match(/^(\*\*\/)+/, () => alternation([regex3("^"), sequence([regex3(".*?"), slash()])]));
1416
+ var StarStarEnd = match(/\/(\*\*)$/, () => alternation([sequence([slash(), regex3(".*?")]), regex3("$")]));
1417
+ var StarStarNone = match(/\*\*/, () => regex3(".*?"));
1244
1418
  var StarStar = or([StarStarBetween, StarStarStart, StarStarEnd, StarStarNone]);
1245
- var StarDouble = match(/\*\/(?!\*\*\/|\*$)/, "[^\\\\/]*[\\\\/]");
1246
- var StarSingle = match(/\*/, "[^\\\\/]*");
1419
+ var StarDouble = match(/\*\/(?!\*\*\/|\*$)/, () => sequence([regex3("[^\\\\/]*?"), slash()]));
1420
+ var StarSingle = match(/\*/, () => regex3("[^\\\\/]*"));
1247
1421
  var Star = or([StarDouble, StarSingle]);
1248
- var Question = match("?", "[^\\\\/]");
1422
+ var Question = match("?", () => regex3("[^\\\\/]"));
1249
1423
  var ClassOpen = match("[", identity);
1250
1424
  var ClassClose = match("]", identity);
1251
1425
  var ClassNegation = match(/[!^]/, "^\\\\/");
1252
1426
  var ClassRange = match(/[a-z]-[a-z]|[0-9]-[0-9]/i, identity);
1427
+ var ClassEscaped = match(/\\./, identity);
1253
1428
  var ClassEscape = match(/[$.*+?^(){}[\|]/, (char) => `\\${char}`);
1254
- var ClassPassthrough = match(/[^\]]/, identity);
1255
- var ClassValue = or([Escaped, ClassEscape, ClassRange, ClassPassthrough]);
1256
- var Class = and([ClassOpen, optional2(ClassNegation), star(ClassValue), ClassClose]);
1429
+ var ClassSlash = match(/[\\\/]/, "\\\\/");
1430
+ var ClassPassthrough = match(/[^$.*+?^(){}[\]\|\\\/]+/, identity);
1431
+ var ClassValue = or([ClassEscaped, ClassEscape, ClassSlash, ClassRange, ClassPassthrough]);
1432
+ var Class = and([ClassOpen, optional2(ClassNegation), star(ClassValue), ClassClose], (_2) => regex3(_2.join("")));
1257
1433
  var RangeOpen = match("{", "(?:");
1258
1434
  var RangeClose = match("}", ")");
1259
1435
  var RangeNumeric = match(/(\d+)\.\.(\d+)/, (_2, $1, $2) => makeRangePaddedInt(+$1, +$2, Math.min($1.length, $2.length)).join("|"));
1260
1436
  var RangeAlphaLower = match(/([a-z]+)\.\.([a-z]+)/, (_2, $1, $2) => makeRangeAlpha($1, $2).join("|"));
1261
1437
  var RangeAlphaUpper = match(/([A-Z]+)\.\.([A-Z]+)/, (_2, $1, $2) => makeRangeAlpha($1.toLowerCase(), $2.toLowerCase()).join("|").toUpperCase());
1262
1438
  var RangeValue = or([RangeNumeric, RangeAlphaLower, RangeAlphaUpper]);
1263
- var Range = and([RangeOpen, RangeValue, RangeClose]);
1264
- var BracesOpen = match("{", "(?:");
1265
- var BracesClose = match("}", ")");
1266
- var BracesComma = match(",", "|");
1267
- var BracesEscape = match(/[$.*+?^(){[\]\|]/, (char) => `\\${char}`);
1268
- var BracesPassthrough = match(/[^}]/, identity);
1439
+ var Range = and([RangeOpen, RangeValue, RangeClose], (_2) => regex3(_2.join("")));
1440
+ var BracesOpen = match("{");
1441
+ var BracesClose = match("}");
1442
+ var BracesComma = match(",");
1443
+ var BracesEscaped = match(/\\./, regex3);
1444
+ var BracesEscape = match(/[$.*+?^(){[\]\|]/, (char) => regex3(`\\${char}`));
1445
+ var BracesSlash = match(/[\\\/]/, slash);
1446
+ var BracesPassthrough = match(/[^$.*+?^(){}[\]\|\\\/,]+/, regex3);
1269
1447
  var BracesNested = lazy(() => Braces);
1270
- var BracesValue = or([StarStar, Star, Question, Class, Range, BracesNested, Escaped, BracesEscape, BracesComma, BracesPassthrough]);
1271
- var Braces = and([BracesOpen, star(BracesValue), BracesClose]);
1272
- var Grammar = star(or([Negation, StarStar, Star, Question, Class, Range, Braces, Escaped, Escape, Slash, Passthrough]));
1273
- var grammar_default = Grammar;
1274
-
1275
- // ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/convert/parser.js
1276
- var parser = makeParser(grammar_default);
1277
- var parser_default = parser;
1278
-
1279
- // ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/normalize/grammar.js
1280
- var Escaped2 = match(/\\./, identity);
1281
- var Passthrough2 = match(/./, identity);
1282
- var StarStarStar = match(/\*\*\*+/, "*");
1283
- var StarStarNoLeft = match(/([^/{[(!])\*\*/, (_2, $1) => `${$1}*`);
1284
- var StarStarNoRight = match(/(^|.)\*\*(?=[^*/)\]}])/, (_2, $1) => `${$1}*`);
1285
- var Grammar2 = star(or([Escaped2, StarStarStar, StarStarNoLeft, StarStarNoRight, Passthrough2]));
1448
+ var BracesEmptyValue = match("", () => regex3("(?:)"));
1449
+ var BracesFullValue = plus(or([StarStar, Star, Question, Class, Range, BracesNested, BracesEscaped, BracesEscape, BracesSlash, BracesPassthrough]), sequence);
1450
+ var BracesValue = or([BracesFullValue, BracesEmptyValue]);
1451
+ var Braces = and([BracesOpen, optional2(and([BracesValue, star(and([BracesComma, BracesValue]))])), BracesClose], alternation);
1452
+ var Grammar2 = star(or([Negation, StarStar, Star, Question, Class, Range, Braces, Escaped2, Escape, Slash, Passthrough2]), sequence);
1286
1453
  var grammar_default2 = Grammar2;
1287
1454
 
1288
- // ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/normalize/parser.js
1289
- var parser2 = makeParser(grammar_default2);
1290
- var parser_default2 = parser2;
1455
+ // ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/parse/index.js
1456
+ var _parse = (glob) => {
1457
+ return parse(glob, grammar_default2, { memoization: false })[0];
1458
+ };
1459
+ var parse_default = _parse;
1291
1460
 
1292
- // ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/index.js
1293
- var zeptomatch = (glob, path2) => {
1294
- if (Array.isArray(glob)) {
1295
- const res = glob.map(zeptomatch.compile);
1296
- const isMatch = res.some((re) => re.test(path2));
1297
- return isMatch;
1298
- } else {
1299
- const re = zeptomatch.compile(glob);
1300
- const isMatch = re.test(path2);
1301
- return isMatch;
1302
- }
1461
+ // ../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/index.js
1462
+ var zeptomatch = (glob, path2, options) => {
1463
+ return zeptomatch.compile(glob, options).test(path2);
1303
1464
  };
1304
- zeptomatch.compile = memoize2((glob) => {
1305
- return new RegExp(`^${parser_default(parser_default2(glob))}[\\\\/]?$`, "s");
1306
- });
1307
- var dist_default = zeptomatch;
1465
+ zeptomatch.compile = (() => {
1466
+ const compileGlob = memoizeByPrimitive((glob, options) => {
1467
+ return compile_default(parse_default(normalize_default(glob)), options);
1468
+ });
1469
+ const compileGlobs = memoizeByObject((globs, options) => {
1470
+ return merge_default(globs.map((glob) => compileGlob(glob, options)));
1471
+ });
1472
+ return (glob, options) => {
1473
+ if (isString2(glob)) {
1474
+ return compileGlob(glob, options);
1475
+ } else {
1476
+ return compileGlobs(glob, options);
1477
+ }
1478
+ };
1479
+ })();
1480
+ var dist_default2 = zeptomatch;
1308
1481
 
1309
1482
  // ../../dev/server/src/filesystem.ts
1310
1483
  var GLOBAL_DIR_ROOT_PATH = envPaths("prisma-dev");
@@ -1332,7 +1505,7 @@ async function writeBinaryFile(buffer, path2) {
1332
1505
  await chmod(path2, "755");
1333
1506
  }
1334
1507
  async function streamAsTextTo(file, path2) {
1335
- await file.stream().pipeTo(WriteStream.toWeb(createWriteStream(path2, { encoding: "utf-8" })));
1508
+ await file.stream().pipeTo(WriteStream.toWeb(createWriteStream(path2, { encoding: "utf8" })));
1336
1509
  }
1337
1510
  function isFileNotFoundError(error) {
1338
1511
  return error != null && typeof error === "object" && "code" in error && error.code === "ENOENT";
@@ -1354,7 +1527,7 @@ async function readDirectoryNames(path2, globs) {
1354
1527
  try {
1355
1528
  const dirents = await readdir(path2, { withFileTypes: true });
1356
1529
  return dirents.reduce((names, dirent) => {
1357
- if (dirent.isDirectory() && !dirent.name.startsWith(".") && (!globs || dist_default(globs, dirent.name))) {
1530
+ if (dirent.isDirectory() && !dirent.name.startsWith(".") && (!globs || dist_default2(globs, dirent.name))) {
1358
1531
  names.push(dirent.name);
1359
1532
  }
1360
1533
  return names;