drizzle-kit 0.26.2-9f627ed → 0.26.2-a1e0ae9
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/api.js +1 -1
- package/api.mjs +1 -1
- package/bin.cjs +91 -91
- package/package.json +2 -2
package/api.js
CHANGED
|
@@ -22204,7 +22204,7 @@ function isConfig(data) {
|
|
|
22204
22204
|
}
|
|
22205
22205
|
if ("client" in data) {
|
|
22206
22206
|
const type = typeof data["client"];
|
|
22207
|
-
if (type !== "object" && type !== "undefined")
|
|
22207
|
+
if (type !== "object" && type !== "function" && type !== "undefined")
|
|
22208
22208
|
return false;
|
|
22209
22209
|
return true;
|
|
22210
22210
|
}
|
package/api.mjs
CHANGED
|
@@ -22209,7 +22209,7 @@ function isConfig(data) {
|
|
|
22209
22209
|
}
|
|
22210
22210
|
if ("client" in data) {
|
|
22211
22211
|
const type = typeof data["client"];
|
|
22212
|
-
if (type !== "object" && type !== "undefined")
|
|
22212
|
+
if (type !== "object" && type !== "function" && type !== "undefined")
|
|
22213
22213
|
return false;
|
|
22214
22214
|
return true;
|
|
22215
22215
|
}
|
package/bin.cjs
CHANGED
|
@@ -11498,10 +11498,10 @@ var init_outputs = __esm({
|
|
|
11498
11498
|
)
|
|
11499
11499
|
},
|
|
11500
11500
|
common: {
|
|
11501
|
-
ambiguousParams: (
|
|
11502
|
-
`You can't use both --config and other cli options for ${
|
|
11501
|
+
ambiguousParams: (command) => withStyle.error(
|
|
11502
|
+
`You can't use both --config and other cli options for ${command} command`
|
|
11503
11503
|
),
|
|
11504
|
-
schema: (
|
|
11504
|
+
schema: (command) => withStyle.error(`"--schema" is a required field for ${command} command`)
|
|
11505
11505
|
},
|
|
11506
11506
|
postgres: {
|
|
11507
11507
|
connection: {
|
|
@@ -11552,7 +11552,7 @@ var init_common = __esm({
|
|
|
11552
11552
|
init_lib();
|
|
11553
11553
|
init_schemaValidator();
|
|
11554
11554
|
init_outputs();
|
|
11555
|
-
assertCollisions = (
|
|
11555
|
+
assertCollisions = (command, options, whitelist, remainingKeys) => {
|
|
11556
11556
|
const { config, ...rest } = options;
|
|
11557
11557
|
let atLeastOneParam = false;
|
|
11558
11558
|
for (const key of Object.keys(rest)) {
|
|
@@ -11566,7 +11566,7 @@ var init_common = __esm({
|
|
|
11566
11566
|
if (!atLeastOneParam) {
|
|
11567
11567
|
return "config";
|
|
11568
11568
|
}
|
|
11569
|
-
console.log(outputs.common.ambiguousParams(
|
|
11569
|
+
console.log(outputs.common.ambiguousParams(command));
|
|
11570
11570
|
process.exit(1);
|
|
11571
11571
|
};
|
|
11572
11572
|
sqliteDriversLiterals = [
|
|
@@ -11751,7 +11751,7 @@ var init_libsql = __esm({
|
|
|
11751
11751
|
url: stringType().min(1),
|
|
11752
11752
|
authToken: stringType().min(1).optional()
|
|
11753
11753
|
});
|
|
11754
|
-
printConfigConnectionIssues = (options,
|
|
11754
|
+
printConfigConnectionIssues = (options, command) => {
|
|
11755
11755
|
let text = `Please provide required params for 'turso' dialect:
|
|
11756
11756
|
`;
|
|
11757
11757
|
console.log(error(text));
|
|
@@ -11932,25 +11932,25 @@ var init_sqlite = __esm({
|
|
|
11932
11932
|
return o;
|
|
11933
11933
|
})
|
|
11934
11934
|
]);
|
|
11935
|
-
printConfigConnectionIssues4 = (options,
|
|
11935
|
+
printConfigConnectionIssues4 = (options, command) => {
|
|
11936
11936
|
const parsedDriver = sqliteDriver.safeParse(options.driver);
|
|
11937
11937
|
const driver2 = parsedDriver.success ? parsedDriver.data : "";
|
|
11938
11938
|
if (driver2 === "expo") {
|
|
11939
|
-
if (
|
|
11939
|
+
if (command === "migrate") {
|
|
11940
11940
|
console.log(
|
|
11941
11941
|
error(
|
|
11942
11942
|
`You can't use 'migrate' command with Expo SQLite, please follow migration instructions in our docs - https://orm.drizzle.team/docs/get-started-sqlite#expo-sqlite`
|
|
11943
11943
|
)
|
|
11944
11944
|
);
|
|
11945
|
-
} else if (
|
|
11945
|
+
} else if (command === "studio") {
|
|
11946
11946
|
console.log(
|
|
11947
11947
|
error(
|
|
11948
11948
|
`You can't use 'studio' command with Expo SQLite, please use Expo Plugin https://www.npmjs.com/package/expo-drizzle-studio-plugin`
|
|
11949
11949
|
)
|
|
11950
11950
|
);
|
|
11951
|
-
} else if (
|
|
11951
|
+
} else if (command === "pull") {
|
|
11952
11952
|
console.log(error("You can't use 'pull' command with Expo SQLite"));
|
|
11953
|
-
} else if (
|
|
11953
|
+
} else if (command === "push") {
|
|
11954
11954
|
console.log(error("You can't use 'push' command with Expo SQLite"));
|
|
11955
11955
|
} else {
|
|
11956
11956
|
console.log(error("Unexpected error with expo driver \u{1F914}"));
|
|
@@ -52409,12 +52409,12 @@ var require_dist_cjs32 = __commonJS({
|
|
|
52409
52409
|
this.middlewareStack = (0, import_middleware_stack.constructStack)();
|
|
52410
52410
|
this.config = config;
|
|
52411
52411
|
}
|
|
52412
|
-
send(
|
|
52412
|
+
send(command, optionsOrCb, cb) {
|
|
52413
52413
|
const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0;
|
|
52414
52414
|
const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb;
|
|
52415
|
-
const handler =
|
|
52415
|
+
const handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
|
|
52416
52416
|
if (callback) {
|
|
52417
|
-
handler(
|
|
52417
|
+
handler(command).then(
|
|
52418
52418
|
(result) => callback(null, result.output),
|
|
52419
52419
|
(err2) => callback(err2)
|
|
52420
52420
|
).catch(
|
|
@@ -52424,7 +52424,7 @@ var require_dist_cjs32 = __commonJS({
|
|
|
52424
52424
|
}
|
|
52425
52425
|
);
|
|
52426
52426
|
} else {
|
|
52427
|
-
return handler(
|
|
52427
|
+
return handler(command).then((result) => result.output);
|
|
52428
52428
|
}
|
|
52429
52429
|
}
|
|
52430
52430
|
destroy() {
|
|
@@ -52624,8 +52624,8 @@ var require_dist_cjs32 = __commonJS({
|
|
|
52624
52624
|
var ClassBuilder = _ClassBuilder;
|
|
52625
52625
|
var SENSITIVE_STRING = "***SensitiveInformation***";
|
|
52626
52626
|
var createAggregatedClient = /* @__PURE__ */ __name((commands, Client2) => {
|
|
52627
|
-
for (const
|
|
52628
|
-
const CommandCtor = commands[
|
|
52627
|
+
for (const command of Object.keys(commands)) {
|
|
52628
|
+
const CommandCtor = commands[command];
|
|
52629
52629
|
const methodImpl = /* @__PURE__ */ __name(async function(args, optionsOrCb, cb) {
|
|
52630
52630
|
const command22 = new CommandCtor(args);
|
|
52631
52631
|
if (typeof optionsOrCb === "function") {
|
|
@@ -52638,7 +52638,7 @@ var require_dist_cjs32 = __commonJS({
|
|
|
52638
52638
|
return this.send(command22, optionsOrCb);
|
|
52639
52639
|
}
|
|
52640
52640
|
}, "methodImpl");
|
|
52641
|
-
const methodName = (
|
|
52641
|
+
const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, "");
|
|
52642
52642
|
Client2.prototype[methodName] = methodImpl;
|
|
52643
52643
|
}
|
|
52644
52644
|
}, "createAggregatedClient");
|
|
@@ -85609,7 +85609,7 @@ ${fields.join("\n")}
|
|
|
85609
85609
|
}
|
|
85610
85610
|
});
|
|
85611
85611
|
|
|
85612
|
-
// ../node_modules/.pnpm/@drizzle-team+brocli@0.10.
|
|
85612
|
+
// ../node_modules/.pnpm/@drizzle-team+brocli@0.10.2/node_modules/@drizzle-team/brocli/index.js
|
|
85613
85613
|
var __create2 = Object.create;
|
|
85614
85614
|
var __defProp2 = Object.defineProperty;
|
|
85615
85615
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -86113,32 +86113,32 @@ var defaultEventHandler = async (event) => {
|
|
|
86113
86113
|
var _a;
|
|
86114
86114
|
switch (event.type) {
|
|
86115
86115
|
case "command_help": {
|
|
86116
|
-
const
|
|
86117
|
-
const commandName = getCommandNameWithParents(
|
|
86116
|
+
const command3 = event.command;
|
|
86117
|
+
const commandName = getCommandNameWithParents(command3);
|
|
86118
86118
|
const cliName = event.name;
|
|
86119
|
-
const desc =
|
|
86120
|
-
const subs = (_a =
|
|
86119
|
+
const desc = command3.desc ?? command3.shortDesc;
|
|
86120
|
+
const subs = (_a = command3.subcommands) == null ? void 0 : _a.filter((s2) => !s2.hidden);
|
|
86121
86121
|
const subcommands = subs && subs.length ? subs : void 0;
|
|
86122
86122
|
if (desc !== void 0) {
|
|
86123
86123
|
console.log(`
|
|
86124
86124
|
${desc}`);
|
|
86125
86125
|
}
|
|
86126
|
-
const opts = Object.values(
|
|
86126
|
+
const opts = Object.values(command3.options ?? {}).filter(
|
|
86127
86127
|
(opt) => !opt.config.isHidden
|
|
86128
86128
|
);
|
|
86129
86129
|
const positionals = opts.filter((opt) => opt.config.type === "positional");
|
|
86130
86130
|
const options = opts.filter((opt) => opt.config.type !== "positional");
|
|
86131
86131
|
console.log("\nUsage:");
|
|
86132
|
-
if (
|
|
86132
|
+
if (command3.handler) {
|
|
86133
86133
|
console.log(
|
|
86134
86134
|
` ${cliName ? cliName + " " : ""}${commandName}${positionals.length ? " " + positionals.map(({ config: p2 }) => getOptionTypeText(p2)).join(" ") : ""} [flags]`
|
|
86135
86135
|
);
|
|
86136
86136
|
} else
|
|
86137
86137
|
console.log(` ${cliName ? cliName + " " : ""}${commandName} [command]`);
|
|
86138
|
-
if (
|
|
86138
|
+
if (command3.aliases) {
|
|
86139
86139
|
console.log(`
|
|
86140
86140
|
Aliases:`);
|
|
86141
|
-
console.log(` ${[
|
|
86141
|
+
console.log(` ${[command3.name, ...command3.aliases].join(", ")}`);
|
|
86142
86142
|
}
|
|
86143
86143
|
if (subcommands) {
|
|
86144
86144
|
console.log("\nAvailable Commands:");
|
|
@@ -86218,8 +86218,8 @@ Use "${cliName ? cliName + " " : ""}${commandName} [command] --help" for more in
|
|
|
86218
86218
|
const maxLength = commands.reduce((p2, e2) => e2.name.length > p2 ? e2.name.length : p2, 0);
|
|
86219
86219
|
const paddedLength = maxLength + padding;
|
|
86220
86220
|
const data = commands.map(
|
|
86221
|
-
(
|
|
86222
|
-
const desc2 =
|
|
86221
|
+
(c) => ` ${c.name.padEnd(paddedLength)}${(() => {
|
|
86222
|
+
const desc2 = c.shortDesc ?? c.desc;
|
|
86223
86223
|
if (!(desc2 == null ? void 0 : desc2.length))
|
|
86224
86224
|
return "";
|
|
86225
86225
|
const split = desc2.split("\n");
|
|
@@ -86311,8 +86311,8 @@ Type '${cName} --help' to get the help on command.`;
|
|
|
86311
86311
|
return true;
|
|
86312
86312
|
}
|
|
86313
86313
|
case "missing_args_error": {
|
|
86314
|
-
const missingOpts = event
|
|
86315
|
-
msg = `Command '${
|
|
86314
|
+
const { missing: missingOpts, command: command3 } = event;
|
|
86315
|
+
msg = `Command '${command3.name}' is missing following required options: ${missingOpts.map((opt) => {
|
|
86316
86316
|
const name = opt.shift();
|
|
86317
86317
|
const aliases = opt;
|
|
86318
86318
|
if (aliases.length)
|
|
@@ -86322,8 +86322,8 @@ Type '${cName} --help' to get the help on command.`;
|
|
|
86322
86322
|
break;
|
|
86323
86323
|
}
|
|
86324
86324
|
case "unrecognized_args_error": {
|
|
86325
|
-
const { command:
|
|
86326
|
-
msg = `Unrecognized options for command '${
|
|
86325
|
+
const { command: command3, unrecognized } = event;
|
|
86326
|
+
msg = `Unrecognized options for command '${command3.name}': ${unrecognized.join(", ")}`;
|
|
86327
86327
|
break;
|
|
86328
86328
|
}
|
|
86329
86329
|
case "unknown_error": {
|
|
@@ -86420,21 +86420,21 @@ var assignParent = (parent, subcommands) => subcommands.forEach((e2) => {
|
|
|
86420
86420
|
if (e2.subcommands)
|
|
86421
86421
|
assignParent(e2, e2.subcommands);
|
|
86422
86422
|
});
|
|
86423
|
-
var
|
|
86423
|
+
var command2 = (command3) => {
|
|
86424
86424
|
var _a, _b, _c;
|
|
86425
|
-
const allNames =
|
|
86426
|
-
const cmd = (0, import_clone.default)(
|
|
86427
|
-
if (
|
|
86425
|
+
const allNames = command3.aliases ? [command3.name, ...command3.aliases] : [command3.name];
|
|
86426
|
+
const cmd = (0, import_clone.default)(command3);
|
|
86427
|
+
if (command3.subcommands && command3.options && Object.values(command3.options).find((opt) => opt._.config.type === "positional")) {
|
|
86428
86428
|
throw new BroCliError(
|
|
86429
86429
|
`Can't define command '${cmd.name}' - command can't have subcommands and positional args at the same time!`
|
|
86430
86430
|
);
|
|
86431
86431
|
}
|
|
86432
|
-
if (!
|
|
86432
|
+
if (!command3.handler && !command3.subcommands) {
|
|
86433
86433
|
throw new BroCliError(
|
|
86434
86434
|
`Can't define command '${cmd.name}' - command without subcommands must have a handler present!`
|
|
86435
86435
|
);
|
|
86436
86436
|
}
|
|
86437
|
-
const processedOptions =
|
|
86437
|
+
const processedOptions = command3.options ? validateOptions(command3.options) : void 0;
|
|
86438
86438
|
cmd.options = processedOptions;
|
|
86439
86439
|
cmd.name = cmd.name ?? ((_a = cmd.aliases) == null ? void 0 : _a.shift());
|
|
86440
86440
|
if (!cmd.name)
|
|
@@ -86471,33 +86471,33 @@ var command = (command2) => {
|
|
|
86471
86471
|
};
|
|
86472
86472
|
var getCommandInner = (commands, candidates, args, cliName, cliDescription) => {
|
|
86473
86473
|
const { data: arg, originalIndex: index4 } = candidates.shift();
|
|
86474
|
-
const
|
|
86474
|
+
const command3 = commands.find((c) => {
|
|
86475
86475
|
const names = c.aliases ? [c.name, ...c.aliases] : [c.name];
|
|
86476
86476
|
const res = names.find((name) => name === arg);
|
|
86477
86477
|
return res;
|
|
86478
86478
|
});
|
|
86479
|
-
if (!
|
|
86479
|
+
if (!command3) {
|
|
86480
86480
|
return {
|
|
86481
|
-
command:
|
|
86481
|
+
command: command3,
|
|
86482
86482
|
args
|
|
86483
86483
|
};
|
|
86484
86484
|
}
|
|
86485
86485
|
const newArgs = removeByIndex(args, index4);
|
|
86486
|
-
if (!candidates.length || !
|
|
86486
|
+
if (!candidates.length || !command3.subcommands) {
|
|
86487
86487
|
return {
|
|
86488
|
-
command:
|
|
86488
|
+
command: command3,
|
|
86489
86489
|
args: newArgs
|
|
86490
86490
|
};
|
|
86491
86491
|
}
|
|
86492
86492
|
const newCandidates = candidates.map((c) => ({ data: c.data, originalIndex: c.originalIndex - 1 }));
|
|
86493
|
-
const subcommand = getCommandInner(
|
|
86493
|
+
const subcommand = getCommandInner(command3.subcommands, newCandidates, newArgs, cliName, cliDescription);
|
|
86494
86494
|
if (!subcommand.command) {
|
|
86495
86495
|
throw new BroCliError(void 0, {
|
|
86496
86496
|
type: "error",
|
|
86497
86497
|
violation: "unknown_subcommand_error",
|
|
86498
86498
|
name: cliName,
|
|
86499
86499
|
description: cliDescription,
|
|
86500
|
-
command:
|
|
86500
|
+
command: command3,
|
|
86501
86501
|
offender: candidates[0].data
|
|
86502
86502
|
});
|
|
86503
86503
|
}
|
|
@@ -86537,8 +86537,8 @@ var getCommand = (commands, args, cliName, cliDescription) => {
|
|
|
86537
86537
|
args: removeByIndex(args, firstCandidate.originalIndex)
|
|
86538
86538
|
};
|
|
86539
86539
|
}
|
|
86540
|
-
const { command:
|
|
86541
|
-
if (!
|
|
86540
|
+
const { command: command3, args: argsRes } = getCommandInner(commands, candidates, args, cliName, cliDescription);
|
|
86541
|
+
if (!command3) {
|
|
86542
86542
|
throw new BroCliError(void 0, {
|
|
86543
86543
|
type: "error",
|
|
86544
86544
|
violation: "unknown_command_error",
|
|
@@ -86549,11 +86549,11 @@ var getCommand = (commands, args, cliName, cliDescription) => {
|
|
|
86549
86549
|
});
|
|
86550
86550
|
}
|
|
86551
86551
|
return {
|
|
86552
|
-
command:
|
|
86552
|
+
command: command3,
|
|
86553
86553
|
args: argsRes
|
|
86554
86554
|
};
|
|
86555
86555
|
};
|
|
86556
|
-
var parseArg = (
|
|
86556
|
+
var parseArg = (command3, options, positionals, arg, nextArg, cliName, cliDescription) => {
|
|
86557
86557
|
let data = void 0;
|
|
86558
86558
|
const argSplit = arg.split("=");
|
|
86559
86559
|
const hasEq = arg.includes("=");
|
|
@@ -86580,7 +86580,7 @@ var parseArg = (command2, options, positionals, arg, nextArg, cliName, cliDescri
|
|
|
86580
86580
|
name: cliName,
|
|
86581
86581
|
description: cliDescription,
|
|
86582
86582
|
violation: "enum_violation",
|
|
86583
|
-
command:
|
|
86583
|
+
command: command3,
|
|
86584
86584
|
option: pos[1],
|
|
86585
86585
|
offender: {
|
|
86586
86586
|
dataPart: arg
|
|
@@ -86626,7 +86626,7 @@ var parseArg = (command2, options, positionals, arg, nextArg, cliName, cliDescri
|
|
|
86626
86626
|
description: cliDescription,
|
|
86627
86627
|
violation: "invalid_boolean_syntax",
|
|
86628
86628
|
option: opt,
|
|
86629
|
-
command:
|
|
86629
|
+
command: command3,
|
|
86630
86630
|
offender: {
|
|
86631
86631
|
namePart,
|
|
86632
86632
|
dataPart
|
|
@@ -86644,7 +86644,7 @@ var parseArg = (command2, options, positionals, arg, nextArg, cliName, cliDescri
|
|
|
86644
86644
|
description: cliDescription,
|
|
86645
86645
|
violation: "invalid_string_syntax",
|
|
86646
86646
|
option: opt,
|
|
86647
|
-
command:
|
|
86647
|
+
command: command3,
|
|
86648
86648
|
offender: {
|
|
86649
86649
|
namePart,
|
|
86650
86650
|
dataPart
|
|
@@ -86658,7 +86658,7 @@ var parseArg = (command2, options, positionals, arg, nextArg, cliName, cliDescri
|
|
|
86658
86658
|
description: cliDescription,
|
|
86659
86659
|
violation: "enum_violation",
|
|
86660
86660
|
option: opt,
|
|
86661
|
-
command:
|
|
86661
|
+
command: command3,
|
|
86662
86662
|
offender: {
|
|
86663
86663
|
namePart,
|
|
86664
86664
|
dataPart
|
|
@@ -86675,7 +86675,7 @@ var parseArg = (command2, options, positionals, arg, nextArg, cliName, cliDescri
|
|
|
86675
86675
|
description: cliDescription,
|
|
86676
86676
|
violation: "invalid_number_syntax",
|
|
86677
86677
|
option: opt,
|
|
86678
|
-
command:
|
|
86678
|
+
command: command3,
|
|
86679
86679
|
offender: {
|
|
86680
86680
|
namePart,
|
|
86681
86681
|
dataPart
|
|
@@ -86690,7 +86690,7 @@ var parseArg = (command2, options, positionals, arg, nextArg, cliName, cliDescri
|
|
|
86690
86690
|
description: cliDescription,
|
|
86691
86691
|
violation: "invalid_number_value",
|
|
86692
86692
|
option: opt,
|
|
86693
|
-
command:
|
|
86693
|
+
command: command3,
|
|
86694
86694
|
offender: {
|
|
86695
86695
|
namePart,
|
|
86696
86696
|
dataPart
|
|
@@ -86704,7 +86704,7 @@ var parseArg = (command2, options, positionals, arg, nextArg, cliName, cliDescri
|
|
|
86704
86704
|
description: cliDescription,
|
|
86705
86705
|
violation: "expected_int",
|
|
86706
86706
|
option: opt,
|
|
86707
|
-
command:
|
|
86707
|
+
command: command3,
|
|
86708
86708
|
offender: {
|
|
86709
86709
|
namePart,
|
|
86710
86710
|
dataPart
|
|
@@ -86718,7 +86718,7 @@ var parseArg = (command2, options, positionals, arg, nextArg, cliName, cliDescri
|
|
|
86718
86718
|
description: cliDescription,
|
|
86719
86719
|
violation: "below_min",
|
|
86720
86720
|
option: opt,
|
|
86721
|
-
command:
|
|
86721
|
+
command: command3,
|
|
86722
86722
|
offender: {
|
|
86723
86723
|
namePart,
|
|
86724
86724
|
dataPart
|
|
@@ -86732,7 +86732,7 @@ var parseArg = (command2, options, positionals, arg, nextArg, cliName, cliDescri
|
|
|
86732
86732
|
description: cliDescription,
|
|
86733
86733
|
violation: "above_max",
|
|
86734
86734
|
option: opt,
|
|
86735
|
-
command:
|
|
86735
|
+
command: command3,
|
|
86736
86736
|
offender: {
|
|
86737
86737
|
namePart,
|
|
86738
86738
|
dataPart
|
|
@@ -86750,8 +86750,8 @@ var parseArg = (command2, options, positionals, arg, nextArg, cliName, cliDescri
|
|
|
86750
86750
|
option: option == null ? void 0 : option[1]
|
|
86751
86751
|
};
|
|
86752
86752
|
};
|
|
86753
|
-
var parseOptions = (
|
|
86754
|
-
const options =
|
|
86753
|
+
var parseOptions = (command3, args, cliName, cliDescription, omitKeysOfUndefinedOptions) => {
|
|
86754
|
+
const options = command3.options;
|
|
86755
86755
|
const optEntries = Object.entries(options ?? {}).map(
|
|
86756
86756
|
(opt) => [opt[0], opt[1].config]
|
|
86757
86757
|
);
|
|
@@ -86770,7 +86770,7 @@ var parseOptions = (command2, args, cliName, cliDescription, omitKeysOfUndefined
|
|
|
86770
86770
|
skipNext,
|
|
86771
86771
|
isHelp,
|
|
86772
86772
|
isVersion
|
|
86773
|
-
} = parseArg(
|
|
86773
|
+
} = parseArg(command3, nonPositionalEntries, positionalEntries, arg, nextArg, cliName, cliDescription);
|
|
86774
86774
|
if (!option)
|
|
86775
86775
|
unrecognizedArgsArr.push(arg.split("=")[0]);
|
|
86776
86776
|
if (skipNext)
|
|
@@ -86798,7 +86798,7 @@ var parseOptions = (command2, args, cliName, cliDescription, omitKeysOfUndefined
|
|
|
86798
86798
|
violation: "missing_args_error",
|
|
86799
86799
|
name: cliName,
|
|
86800
86800
|
description: cliDescription,
|
|
86801
|
-
command:
|
|
86801
|
+
command: command3,
|
|
86802
86802
|
missing: missingRequiredArr
|
|
86803
86803
|
});
|
|
86804
86804
|
}
|
|
@@ -86808,13 +86808,13 @@ var parseOptions = (command2, args, cliName, cliDescription, omitKeysOfUndefined
|
|
|
86808
86808
|
violation: "unrecognized_args_error",
|
|
86809
86809
|
name: cliName,
|
|
86810
86810
|
description: cliDescription,
|
|
86811
|
-
command:
|
|
86811
|
+
command: command3,
|
|
86812
86812
|
unrecognized: unrecognizedArgsArr
|
|
86813
86813
|
});
|
|
86814
86814
|
}
|
|
86815
86815
|
return Object.keys(result).length ? result : void 0;
|
|
86816
86816
|
};
|
|
86817
|
-
var getCommandNameWithParents = (
|
|
86817
|
+
var getCommandNameWithParents = (command3) => command3.parent ? `${getCommandNameWithParents(command3.parent)} ${command3.name}` : command3.name;
|
|
86818
86818
|
var validateCommands = (commands, parent) => {
|
|
86819
86819
|
const storedNames = {};
|
|
86820
86820
|
for (const cmd of commands) {
|
|
@@ -86868,13 +86868,13 @@ var run = async (commands, config) => {
|
|
|
86868
86868
|
}
|
|
86869
86869
|
const helpIndex = args.findIndex((arg) => arg === "--help" || arg === "-h");
|
|
86870
86870
|
if (helpIndex !== -1 && (helpIndex > 0 ? ((_a = args[helpIndex - 1]) == null ? void 0 : _a.startsWith("-")) && !args[helpIndex - 1].includes("=") ? false : true : true)) {
|
|
86871
|
-
const
|
|
86872
|
-
if (typeof
|
|
86873
|
-
return
|
|
86871
|
+
const command4 = getCommand(processedCmds, args, cliName, cliDescription).command;
|
|
86872
|
+
if (typeof command4 === "object") {
|
|
86873
|
+
return command4.help !== void 0 ? await executeOrLog(command4.help) : await eventHandler({
|
|
86874
86874
|
type: "command_help",
|
|
86875
86875
|
description: cliDescription,
|
|
86876
86876
|
name: cliName,
|
|
86877
|
-
command:
|
|
86877
|
+
command: command4
|
|
86878
86878
|
});
|
|
86879
86879
|
} else {
|
|
86880
86880
|
return help !== void 0 ? await executeOrLog(help) : await eventHandler({
|
|
@@ -86893,8 +86893,8 @@ var run = async (commands, config) => {
|
|
|
86893
86893
|
description: cliDescription
|
|
86894
86894
|
});
|
|
86895
86895
|
}
|
|
86896
|
-
const { command:
|
|
86897
|
-
if (!
|
|
86896
|
+
const { command: command3, args: newArgs } = getCommand(processedCmds, args, cliName, cliDescription);
|
|
86897
|
+
if (!command3) {
|
|
86898
86898
|
return help !== void 0 ? await executeOrLog(help) : await eventHandler({
|
|
86899
86899
|
type: "global_help",
|
|
86900
86900
|
description: cliDescription,
|
|
@@ -86902,7 +86902,7 @@ var run = async (commands, config) => {
|
|
|
86902
86902
|
commands: processedCmds
|
|
86903
86903
|
});
|
|
86904
86904
|
}
|
|
86905
|
-
if (
|
|
86905
|
+
if (command3 === "help") {
|
|
86906
86906
|
let helpCommand;
|
|
86907
86907
|
let newestArgs = newArgs;
|
|
86908
86908
|
do {
|
|
@@ -86922,13 +86922,13 @@ var run = async (commands, config) => {
|
|
|
86922
86922
|
commands: processedCmds
|
|
86923
86923
|
});
|
|
86924
86924
|
}
|
|
86925
|
-
const optionResult = parseOptions(
|
|
86925
|
+
const optionResult = parseOptions(command3, newArgs, cliName, cliDescription, omitKeysOfUndefinedOptions);
|
|
86926
86926
|
if (optionResult === "help") {
|
|
86927
|
-
return
|
|
86927
|
+
return command3.help !== void 0 ? await executeOrLog(command3.help) : await eventHandler({
|
|
86928
86928
|
type: "command_help",
|
|
86929
86929
|
description: cliDescription,
|
|
86930
86930
|
name: cliName,
|
|
86931
|
-
command:
|
|
86931
|
+
command: command3
|
|
86932
86932
|
});
|
|
86933
86933
|
}
|
|
86934
86934
|
if (optionResult === "version") {
|
|
@@ -86938,19 +86938,19 @@ var run = async (commands, config) => {
|
|
|
86938
86938
|
description: cliDescription
|
|
86939
86939
|
});
|
|
86940
86940
|
}
|
|
86941
|
-
if (
|
|
86941
|
+
if (command3.handler) {
|
|
86942
86942
|
if (config == null ? void 0 : config.hook)
|
|
86943
|
-
await config.hook("before",
|
|
86944
|
-
await
|
|
86943
|
+
await config.hook("before", command3);
|
|
86944
|
+
await command3.handler(command3.transform ? await command3.transform(optionResult) : optionResult);
|
|
86945
86945
|
if (config == null ? void 0 : config.hook)
|
|
86946
|
-
await config.hook("after",
|
|
86946
|
+
await config.hook("after", command3);
|
|
86947
86947
|
return;
|
|
86948
86948
|
} else {
|
|
86949
|
-
return
|
|
86949
|
+
return command3.help !== void 0 ? await executeOrLog(command3.help) : await eventHandler({
|
|
86950
86950
|
type: "command_help",
|
|
86951
86951
|
description: cliDescription,
|
|
86952
86952
|
name: cliName,
|
|
86953
|
-
command:
|
|
86953
|
+
command: command3
|
|
86954
86954
|
});
|
|
86955
86955
|
}
|
|
86956
86956
|
} catch (e2) {
|
|
@@ -88374,7 +88374,7 @@ var optionBreakpoints = boolean().desc(
|
|
|
88374
88374
|
);
|
|
88375
88375
|
var optionDriver = string().enum(...drivers).desc("Database driver");
|
|
88376
88376
|
var optionCasing = string().enum("camelCase", "snake_case").desc("Casing for serialization");
|
|
88377
|
-
var generate =
|
|
88377
|
+
var generate = command2({
|
|
88378
88378
|
name: "generate",
|
|
88379
88379
|
options: {
|
|
88380
88380
|
config: optionConfig,
|
|
@@ -88420,7 +88420,7 @@ var generate = command({
|
|
|
88420
88420
|
}
|
|
88421
88421
|
}
|
|
88422
88422
|
});
|
|
88423
|
-
var migrate =
|
|
88423
|
+
var migrate = command2({
|
|
88424
88424
|
name: "migrate",
|
|
88425
88425
|
options: {
|
|
88426
88426
|
config: optionConfig
|
|
@@ -88527,7 +88527,7 @@ var optionsDatabaseCredentials = {
|
|
|
88527
88527
|
// specific cases
|
|
88528
88528
|
driver: optionDriver
|
|
88529
88529
|
};
|
|
88530
|
-
var push =
|
|
88530
|
+
var push = command2({
|
|
88531
88531
|
name: "push",
|
|
88532
88532
|
options: {
|
|
88533
88533
|
config: optionConfig,
|
|
@@ -88658,7 +88658,7 @@ var push = command({
|
|
|
88658
88658
|
process.exit(0);
|
|
88659
88659
|
}
|
|
88660
88660
|
});
|
|
88661
|
-
var check =
|
|
88661
|
+
var check = command2({
|
|
88662
88662
|
name: "check",
|
|
88663
88663
|
options: {
|
|
88664
88664
|
config: optionConfig,
|
|
@@ -88676,7 +88676,7 @@ var check = command({
|
|
|
88676
88676
|
console.log("Everything's fine \u{1F436}\u{1F525}");
|
|
88677
88677
|
}
|
|
88678
88678
|
});
|
|
88679
|
-
var up =
|
|
88679
|
+
var up = command2({
|
|
88680
88680
|
name: "up",
|
|
88681
88681
|
options: {
|
|
88682
88682
|
config: optionConfig,
|
|
@@ -88702,7 +88702,7 @@ var up = command({
|
|
|
88702
88702
|
}
|
|
88703
88703
|
}
|
|
88704
88704
|
});
|
|
88705
|
-
var pull =
|
|
88705
|
+
var pull = command2({
|
|
88706
88706
|
name: "introspect",
|
|
88707
88707
|
aliases: ["pull"],
|
|
88708
88708
|
options: {
|
|
@@ -88833,7 +88833,7 @@ var pull = command({
|
|
|
88833
88833
|
process.exit(0);
|
|
88834
88834
|
}
|
|
88835
88835
|
});
|
|
88836
|
-
var drop =
|
|
88836
|
+
var drop = command2({
|
|
88837
88837
|
name: "drop",
|
|
88838
88838
|
options: {
|
|
88839
88839
|
config: optionConfig,
|
|
@@ -88850,7 +88850,7 @@ var drop = command({
|
|
|
88850
88850
|
await dropMigration(config);
|
|
88851
88851
|
}
|
|
88852
88852
|
});
|
|
88853
|
-
var studio =
|
|
88853
|
+
var studio = command2({
|
|
88854
88854
|
name: "studio",
|
|
88855
88855
|
options: {
|
|
88856
88856
|
config: optionConfig,
|
|
@@ -88963,14 +88963,14 @@ init_utils2();
|
|
|
88963
88963
|
var version2 = async () => {
|
|
88964
88964
|
const { npmVersion } = await ormCoreVersions();
|
|
88965
88965
|
const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
|
|
88966
|
-
const envVersion = "0.26.2-
|
|
88966
|
+
const envVersion = "0.26.2-a1e0ae9";
|
|
88967
88967
|
const kitVersion = envVersion ? `v${envVersion}` : "--";
|
|
88968
88968
|
const versions = `drizzle-kit: ${kitVersion}
|
|
88969
88969
|
${ormVersion}`;
|
|
88970
88970
|
console.log(source_default.gray(versions), "\n");
|
|
88971
88971
|
};
|
|
88972
88972
|
var legacyCommand = (name, newName) => {
|
|
88973
|
-
return
|
|
88973
|
+
return command2({
|
|
88974
88974
|
name,
|
|
88975
88975
|
hidden: true,
|
|
88976
88976
|
handler: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drizzle-kit",
|
|
3
|
-
"version": "0.26.2-
|
|
3
|
+
"version": "0.26.2-a1e0ae9",
|
|
4
4
|
"homepage": "https://orm.drizzle.team",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"drizzle",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"publish": "npm publish package.tgz"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@drizzle-team/brocli": "^0.10.
|
|
45
|
+
"@drizzle-team/brocli": "^0.10.2",
|
|
46
46
|
"@esbuild-kit/esm-loader": "^2.5.5",
|
|
47
47
|
"esbuild": "^0.19.7",
|
|
48
48
|
"esbuild-register": "^3.5.0"
|