@h3ravel/arquebus 0.6.4 → 0.6.6

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/bin/index.cjs CHANGED
@@ -2,18 +2,14 @@
2
2
  const require_seeders = require('./seeders-ByeSoCAQ.cjs');
3
3
  let commander = require("commander");
4
4
  commander = require_seeders.__toESM(commander);
5
- let fs_promises = require("fs/promises");
6
- fs_promises = require_seeders.__toESM(fs_promises);
7
- let escalade_sync = require("escalade/sync");
8
- escalade_sync = require_seeders.__toESM(escalade_sync);
5
+ let __h3ravel_shared = require("@h3ravel/shared");
6
+ __h3ravel_shared = require_seeders.__toESM(__h3ravel_shared);
9
7
  let path = require("path");
10
8
  path = require_seeders.__toESM(path);
11
9
  let resolve_from = require("resolve-from");
12
10
  resolve_from = require_seeders.__toESM(resolve_from);
13
11
  let node_fs_promises = require("node:fs/promises");
14
12
  node_fs_promises = require_seeders.__toESM(node_fs_promises);
15
- let __h3ravel_shared = require("@h3ravel/shared");
16
- __h3ravel_shared = require_seeders.__toESM(__h3ravel_shared);
17
13
  let radashi = require("radashi");
18
14
  radashi = require_seeders.__toESM(radashi);
19
15
  let dayjs_plugin_advancedFormat_js = require("dayjs/plugin/advancedFormat.js");
@@ -40,16 +36,6 @@ dotenv = require_seeders.__toESM(dotenv);
40
36
  //#region src/cli/utils.ts
41
37
  const join = path.default.join;
42
38
  var Utils = class {
43
- /**
44
- * Wraps text with chalk
45
- *
46
- * @param txt
47
- * @param color
48
- * @returns
49
- */
50
- static textFormat(txt, color) {
51
- return String(txt).split(":").map((e, i, a) => i == 0 && a.length > 1 ? color(" " + e + ": ") : e).join("");
52
- }
53
39
  static findModulePkg(moduleId, cwd) {
54
40
  const parts = moduleId.replace(/\\/g, "/").split("/");
55
41
  let packageName = "";
@@ -64,29 +50,6 @@ var Utils = class {
64
50
  if (path$6) return [join(cwd, path$6)];
65
51
  return [...migrator.getPaths(), join(cwd, defaultPath)];
66
52
  }
67
- /**
68
- * Check if file exists
69
- *
70
- * @param path
71
- * @returns
72
- */
73
- static async fileExists(path$6) {
74
- try {
75
- await (0, fs_promises.access)(path$6);
76
- return true;
77
- } catch {
78
- return false;
79
- }
80
- }
81
- static findUpConfig(cwd, name$1, extensions) {
82
- return (0, escalade_sync.default)(cwd, (_dir, names) => {
83
- for (const ext of extensions) {
84
- const filename = `${name$1}.${ext}`;
85
- if (names.includes(filename)) return filename;
86
- }
87
- return false;
88
- });
89
- }
90
53
  };
91
54
  var TableGuesser = class TableGuesser {
92
55
  static CREATE_PATTERNS = [/^create_(\w+)_table$/, /^create_(\w+)$/];
@@ -3166,11 +3129,11 @@ var arquebus = class arquebus {
3166
3129
  path.default.join(process.cwd(), "test")
3167
3130
  ];
3168
3131
  for (const dir of candidateDirs) {
3169
- const found = Utils.findUpConfig(dir, "arquebus.config", [
3132
+ const found = __h3ravel_shared.FileSystem.resolveFileUp("arquebus.config", [
3170
3133
  "js",
3171
3134
  "ts",
3172
3135
  "cjs"
3173
- ]);
3136
+ ], dir);
3174
3137
  if (found) if (!found.endsWith(".ts") || process.env.NODE_ENV !== "production") {
3175
3138
  config = (await import(found)).default;
3176
3139
  if (addConnection) instance.addConnection(config, config.client);
@@ -5108,7 +5071,7 @@ var Migrator = class {
5108
5071
  for (const migration of migrations) {
5109
5072
  const file = files$1[migration.migration];
5110
5073
  if (!file) {
5111
- __h3ravel_shared.Logger.twoColumnLog(__h3ravel_shared.Logger.parse([[migration.migration, "green"]], "", false), __h3ravel_shared.Logger.parse([["Migration not found", "yellow"]], "", false));
5074
+ __h3ravel_shared.Logger.twoColumnDetail(__h3ravel_shared.Logger.parse([[migration.migration, "green"]], "", false), __h3ravel_shared.Logger.parse([["Migration not found", "yellow"]], "", false));
5112
5075
  continue;
5113
5076
  }
5114
5077
  rolledBack.push(file);
@@ -5464,7 +5427,7 @@ var MigrationCreator = class {
5464
5427
  //#endregion
5465
5428
  //#region package.json
5466
5429
  var name = "@h3ravel/arquebus";
5467
- var version = "0.6.3";
5430
+ var version = "0.6.6";
5468
5431
  var packageManager = "pnpm@10.14.0";
5469
5432
  var description = "Arquebus ORM is a Beautiful, expressive ORM inspired by Laravel's Eloquent, designed for TypeScript applications and for the H3ravel Framework.";
5470
5433
  var homepage = "https://h3ravel.toneflix.net/arquebus";
@@ -5600,7 +5563,7 @@ var scripts = {
5600
5563
  var husky = { "hooks": { "pre-commit": "lint-staged" } };
5601
5564
  var lint_staged = { "*.{js,json}": ["prettier --write", "git add"] };
5602
5565
  var dependencies = {
5603
- "@h3ravel/shared": "^0.20.12",
5566
+ "@h3ravel/shared": "^0.21.0",
5604
5567
  "@h3ravel/support": "^0.12.0",
5605
5568
  "barrelize": "^1.6.4",
5606
5569
  "chalk": "^5.6.2",
@@ -5710,11 +5673,11 @@ var Cli = class Cli {
5710
5673
  }
5711
5674
  async loadPaths() {
5712
5675
  this.cwd = path.default.join(process.cwd(), this.basePath);
5713
- this.configPath = Utils.findUpConfig(this.cwd, "arquebus.config", [
5676
+ this.configPath = __h3ravel_shared.FileSystem.resolveFileUp("arquebus.config", [
5714
5677
  "js",
5715
5678
  "ts",
5716
5679
  "cjs"
5717
- ]) ?? void 0;
5680
+ ], this.cwd) ?? void 0;
5718
5681
  this.modulePath = Utils.findModulePkg("@h3ravel/arquebus", this.cwd) ?? "";
5719
5682
  try {
5720
5683
  this.modulePackage = await import(path.default.join(this.modulePath, "package.json"));
@@ -5883,10 +5846,10 @@ var Cli = class Cli {
5883
5846
  if (sts) this.output[sts](msg);
5884
5847
  }).status(this.config, opts, true);
5885
5848
  if (migrations.length > 0) {
5886
- __h3ravel_shared.Logger.twoColumnLog(__h3ravel_shared.Logger.log("Migration name", "gray", false), __h3ravel_shared.Logger.log("Batch / Status", "gray", false));
5849
+ __h3ravel_shared.Logger.twoColumnDetail(__h3ravel_shared.Logger.log("Migration name", "gray", false), __h3ravel_shared.Logger.log("Batch / Status", "gray", false));
5887
5850
  migrations.forEach((migration) => {
5888
5851
  const status = migration.ran ? `[${migration.batch}] ${__h3ravel_shared.Logger.log("Ran", "green", false)}` : __h3ravel_shared.Logger.log("Pending", "yellow", false);
5889
- __h3ravel_shared.Logger.twoColumnLog(migration.name, status);
5852
+ __h3ravel_shared.Logger.twoColumnDetail(migration.name, status);
5890
5853
  });
5891
5854
  } else console.log("No migrations found");
5892
5855
  } catch (e) {
@@ -5922,7 +5885,7 @@ var Cli = class Cli {
5922
5885
  if (!this.configPath) this.terminateNotFound();
5923
5886
  const seederPath = path.default.join(this.cwd, opts.path ?? ((_this$config$seeders2 = this.config.seeders) === null || _this$config$seeders2 === void 0 ? void 0 : _this$config$seeders2.path) ?? "./seeders", __h3ravel_support.Str.of(name$1).snake("-") + "." + opts.type);
5924
5887
  try {
5925
- if (!opts.force && await Utils.fileExists(seederPath)) this.output.error("ERROR: Seeder already exists.");
5888
+ if (!opts.force && await __h3ravel_shared.FileSystem.fileExists(seederPath)) this.output.error("ERROR: Seeder already exists.");
5926
5889
  await (0, node_fs_promises.mkdir)(path.default.dirname(seederPath), { recursive: true });
5927
5890
  const stubPath = path.default.join(this.modulePath, `src/stubs/seeder-${opts.type}.stub`);
5928
5891
  let stub = await (0, node_fs_promises.readFile)(stubPath, "utf-8");
@@ -5941,7 +5904,7 @@ var Cli = class Cli {
5941
5904
  if (!this.configPath) this.terminateNotFound();
5942
5905
  const modelPath = path.default.join(this.cwd, opts.path ?? ((_this$config$models = this.config.models) === null || _this$config$models === void 0 ? void 0 : _this$config$models.path) ?? "./models", name$1.toLowerCase() + "." + opts.type);
5943
5906
  try {
5944
- if (!opts.force && await Utils.fileExists(modelPath)) this.output.error("ERROR: Model already exists.");
5907
+ if (!opts.force && await __h3ravel_shared.FileSystem.fileExists(modelPath)) this.output.error("ERROR: Model already exists.");
5945
5908
  await (0, node_fs_promises.mkdir)(path.default.dirname(modelPath), { recursive: true });
5946
5909
  const stubPath = path.default.join(this.modulePath, `src/stubs/model-${opts.type}.stub`);
5947
5910
  let stub = await (0, node_fs_promises.readFile)(stubPath, "utf-8");
package/bin/index.js CHANGED
@@ -2,12 +2,10 @@
2
2
  import "./seeders-CltigymO.js";
3
3
  import "node:module";
4
4
  import { Argument, Option, program } from "commander";
5
- import { access } from "fs/promises";
6
- import escalade from "escalade/sync";
5
+ import { FileSystem, Logger, TaskManager } from "@h3ravel/shared";
7
6
  import path from "path";
8
7
  import resolveFrom from "resolve-from";
9
8
  import fs, { copyFile, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
10
- import { FileSystem, Logger, TaskManager } from "@h3ravel/shared";
11
9
  import { assign, camel, diff, flat, get, isArray, isEmpty, isEqual, isString, omit, pick, set, snake, trim } from "radashi";
12
10
  import advancedFormat from "dayjs/plugin/advancedFormat.js";
13
11
  import dayjs from "dayjs";
@@ -35,16 +33,6 @@ var __export = (all) => {
35
33
  //#region src/cli/utils.ts
36
34
  const join = path.join;
37
35
  var Utils = class {
38
- /**
39
- * Wraps text with chalk
40
- *
41
- * @param txt
42
- * @param color
43
- * @returns
44
- */
45
- static textFormat(txt, color) {
46
- return String(txt).split(":").map((e, i, a) => i == 0 && a.length > 1 ? color(" " + e + ": ") : e).join("");
47
- }
48
36
  static findModulePkg(moduleId, cwd) {
49
37
  const parts = moduleId.replace(/\\/g, "/").split("/");
50
38
  let packageName = "";
@@ -59,29 +47,6 @@ var Utils = class {
59
47
  if (path$1) return [join(cwd, path$1)];
60
48
  return [...migrator.getPaths(), join(cwd, defaultPath)];
61
49
  }
62
- /**
63
- * Check if file exists
64
- *
65
- * @param path
66
- * @returns
67
- */
68
- static async fileExists(path$1) {
69
- try {
70
- await access(path$1);
71
- return true;
72
- } catch {
73
- return false;
74
- }
75
- }
76
- static findUpConfig(cwd, name$1, extensions) {
77
- return escalade(cwd, (_dir, names) => {
78
- for (const ext of extensions) {
79
- const filename = `${name$1}.${ext}`;
80
- if (names.includes(filename)) return filename;
81
- }
82
- return false;
83
- });
84
- }
85
50
  };
86
51
  var TableGuesser = class TableGuesser {
87
52
  static CREATE_PATTERNS = [/^create_(\w+)_table$/, /^create_(\w+)$/];
@@ -3161,11 +3126,11 @@ var arquebus = class arquebus {
3161
3126
  path.join(process.cwd(), "test")
3162
3127
  ];
3163
3128
  for (const dir of candidateDirs) {
3164
- const found = Utils.findUpConfig(dir, "arquebus.config", [
3129
+ const found = FileSystem.resolveFileUp("arquebus.config", [
3165
3130
  "js",
3166
3131
  "ts",
3167
3132
  "cjs"
3168
- ]);
3133
+ ], dir);
3169
3134
  if (found) if (!found.endsWith(".ts") || process.env.NODE_ENV !== "production") {
3170
3135
  config$1 = (await import(found)).default;
3171
3136
  if (addConnection) instance.addConnection(config$1, config$1.client);
@@ -5103,7 +5068,7 @@ var Migrator = class {
5103
5068
  for (const migration of migrations) {
5104
5069
  const file = files$1[migration.migration];
5105
5070
  if (!file) {
5106
- Logger.twoColumnLog(Logger.parse([[migration.migration, "green"]], "", false), Logger.parse([["Migration not found", "yellow"]], "", false));
5071
+ Logger.twoColumnDetail(Logger.parse([[migration.migration, "green"]], "", false), Logger.parse([["Migration not found", "yellow"]], "", false));
5107
5072
  continue;
5108
5073
  }
5109
5074
  rolledBack.push(file);
@@ -5459,7 +5424,7 @@ var MigrationCreator = class {
5459
5424
  //#endregion
5460
5425
  //#region package.json
5461
5426
  var name = "@h3ravel/arquebus";
5462
- var version = "0.6.3";
5427
+ var version = "0.6.6";
5463
5428
  var packageManager = "pnpm@10.14.0";
5464
5429
  var description = "Arquebus ORM is a Beautiful, expressive ORM inspired by Laravel's Eloquent, designed for TypeScript applications and for the H3ravel Framework.";
5465
5430
  var homepage = "https://h3ravel.toneflix.net/arquebus";
@@ -5595,7 +5560,7 @@ var scripts = {
5595
5560
  var husky = { "hooks": { "pre-commit": "lint-staged" } };
5596
5561
  var lint_staged = { "*.{js,json}": ["prettier --write", "git add"] };
5597
5562
  var dependencies = {
5598
- "@h3ravel/shared": "^0.20.12",
5563
+ "@h3ravel/shared": "^0.21.0",
5599
5564
  "@h3ravel/support": "^0.12.0",
5600
5565
  "barrelize": "^1.6.4",
5601
5566
  "chalk": "^5.6.2",
@@ -5705,11 +5670,11 @@ var Cli = class Cli {
5705
5670
  }
5706
5671
  async loadPaths() {
5707
5672
  this.cwd = path.join(process.cwd(), this.basePath);
5708
- this.configPath = Utils.findUpConfig(this.cwd, "arquebus.config", [
5673
+ this.configPath = FileSystem.resolveFileUp("arquebus.config", [
5709
5674
  "js",
5710
5675
  "ts",
5711
5676
  "cjs"
5712
- ]) ?? void 0;
5677
+ ], this.cwd) ?? void 0;
5713
5678
  this.modulePath = Utils.findModulePkg("@h3ravel/arquebus", this.cwd) ?? "";
5714
5679
  try {
5715
5680
  this.modulePackage = await import(path.join(this.modulePath, "package.json"));
@@ -5878,10 +5843,10 @@ var Cli = class Cli {
5878
5843
  if (sts) this.output[sts](msg);
5879
5844
  }).status(this.config, opts, true);
5880
5845
  if (migrations.length > 0) {
5881
- Logger.twoColumnLog(Logger.log("Migration name", "gray", false), Logger.log("Batch / Status", "gray", false));
5846
+ Logger.twoColumnDetail(Logger.log("Migration name", "gray", false), Logger.log("Batch / Status", "gray", false));
5882
5847
  migrations.forEach((migration) => {
5883
5848
  const status = migration.ran ? `[${migration.batch}] ${Logger.log("Ran", "green", false)}` : Logger.log("Pending", "yellow", false);
5884
- Logger.twoColumnLog(migration.name, status);
5849
+ Logger.twoColumnDetail(migration.name, status);
5885
5850
  });
5886
5851
  } else console.log("No migrations found");
5887
5852
  } catch (e) {
@@ -5917,7 +5882,7 @@ var Cli = class Cli {
5917
5882
  if (!this.configPath) this.terminateNotFound();
5918
5883
  const seederPath = path.join(this.cwd, opts.path ?? ((_this$config$seeders2 = this.config.seeders) === null || _this$config$seeders2 === void 0 ? void 0 : _this$config$seeders2.path) ?? "./seeders", Str.of(name$1).snake("-") + "." + opts.type);
5919
5884
  try {
5920
- if (!opts.force && await Utils.fileExists(seederPath)) this.output.error("ERROR: Seeder already exists.");
5885
+ if (!opts.force && await FileSystem.fileExists(seederPath)) this.output.error("ERROR: Seeder already exists.");
5921
5886
  await mkdir(path.dirname(seederPath), { recursive: true });
5922
5887
  const stubPath = path.join(this.modulePath, `src/stubs/seeder-${opts.type}.stub`);
5923
5888
  let stub = await readFile(stubPath, "utf-8");
@@ -5936,7 +5901,7 @@ var Cli = class Cli {
5936
5901
  if (!this.configPath) this.terminateNotFound();
5937
5902
  const modelPath = path.join(this.cwd, opts.path ?? ((_this$config$models = this.config.models) === null || _this$config$models === void 0 ? void 0 : _this$config$models.path) ?? "./models", name$1.toLowerCase() + "." + opts.type);
5938
5903
  try {
5939
- if (!opts.force && await Utils.fileExists(modelPath)) this.output.error("ERROR: Model already exists.");
5904
+ if (!opts.force && await FileSystem.fileExists(modelPath)) this.output.error("ERROR: Model already exists.");
5940
5905
  await mkdir(path.dirname(modelPath), { recursive: true });
5941
5906
  const stubPath = path.join(this.modulePath, `src/stubs/model-${opts.type}.stub`);
5942
5907
  let stub = await readFile(stubPath, "utf-8");
package/dist/index.cjs CHANGED
@@ -43,18 +43,14 @@ let path = require("path");
43
43
  path = __toESM(path);
44
44
  let fs = require("fs");
45
45
  fs = __toESM(fs);
46
- let fs_promises = require("fs/promises");
47
- fs_promises = __toESM(fs_promises);
48
- let escalade_sync = require("escalade/sync");
49
- escalade_sync = __toESM(escalade_sync);
50
- let resolve_from = require("resolve-from");
51
- resolve_from = __toESM(resolve_from);
52
- let pluralize = require("pluralize");
53
- pluralize = __toESM(pluralize);
54
46
  let __h3ravel_shared = require("@h3ravel/shared");
55
47
  __h3ravel_shared = __toESM(__h3ravel_shared);
48
+ let pluralize = require("pluralize");
49
+ pluralize = __toESM(pluralize);
56
50
  let node_fs_promises = require("node:fs/promises");
57
51
  node_fs_promises = __toESM(node_fs_promises);
52
+ let resolve_from = require("resolve-from");
53
+ resolve_from = __toESM(resolve_from);
58
54
  let node_path = require("node:path");
59
55
  node_path = __toESM(node_path);
60
56
  let node_url = require("node:url");
@@ -1691,59 +1687,6 @@ var QueryBuilder = class QueryBuilder extends Inference$2 {
1691
1687
  };
1692
1688
  var query_builder_default = QueryBuilder;
1693
1689
 
1694
- //#endregion
1695
- //#region src/cli/utils.ts
1696
- const join = path.default.join;
1697
- var Utils = class {
1698
- /**
1699
- * Wraps text with chalk
1700
- *
1701
- * @param txt
1702
- * @param color
1703
- * @returns
1704
- */
1705
- static textFormat(txt, color) {
1706
- return String(txt).split(":").map((e, i, a) => i == 0 && a.length > 1 ? color(" " + e + ": ") : e).join("");
1707
- }
1708
- static findModulePkg(moduleId, cwd) {
1709
- const parts = moduleId.replace(/\\/g, "/").split("/");
1710
- let packageName = "";
1711
- if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
1712
- packageName += parts.shift();
1713
- const packageJson = path.default.join(packageName, "package.json");
1714
- const resolved = resolve_from.default.silent(cwd ?? process.cwd(), packageJson);
1715
- if (!resolved) return;
1716
- return path.default.join(path.default.dirname(resolved), parts.join("/"));
1717
- }
1718
- static async getMigrationPaths(cwd, migrator, defaultPath, path$6) {
1719
- if (path$6) return [join(cwd, path$6)];
1720
- return [...migrator.getPaths(), join(cwd, defaultPath)];
1721
- }
1722
- /**
1723
- * Check if file exists
1724
- *
1725
- * @param path
1726
- * @returns
1727
- */
1728
- static async fileExists(path$6) {
1729
- try {
1730
- await (0, fs_promises.access)(path$6);
1731
- return true;
1732
- } catch {
1733
- return false;
1734
- }
1735
- }
1736
- static findUpConfig(cwd, name, extensions) {
1737
- return (0, escalade_sync.default)(cwd, (_dir, names) => {
1738
- for (const ext of extensions) {
1739
- const filename = `${name}.${ext}`;
1740
- if (names.includes(filename)) return filename;
1741
- }
1742
- return false;
1743
- });
1744
- }
1745
- };
1746
-
1747
1690
  //#endregion
1748
1691
  //#region src/arquebus.ts
1749
1692
  var arquebus = class arquebus {
@@ -1868,11 +1811,11 @@ var arquebus = class arquebus {
1868
1811
  path.default.join(process.cwd(), "test")
1869
1812
  ];
1870
1813
  for (const dir of candidateDirs) {
1871
- const found = Utils.findUpConfig(dir, "arquebus.config", [
1814
+ const found = __h3ravel_shared.FileSystem.resolveFileUp("arquebus.config", [
1872
1815
  "js",
1873
1816
  "ts",
1874
1817
  "cjs"
1875
- ]);
1818
+ ], dir);
1876
1819
  if (found) if (!found.endsWith(".ts") || process.env.NODE_ENV !== "production") {
1877
1820
  config = (await import(found)).default;
1878
1821
  if (addConnection) instance.addConnection(config, config.client);
@@ -5147,7 +5090,7 @@ var Migrator = class {
5147
5090
  for (const migration of migrations) {
5148
5091
  const file = files[migration.migration];
5149
5092
  if (!file) {
5150
- __h3ravel_shared.Logger.twoColumnLog(__h3ravel_shared.Logger.parse([[migration.migration, "green"]], "", false), __h3ravel_shared.Logger.parse([["Migration not found", "yellow"]], "", false));
5093
+ __h3ravel_shared.Logger.twoColumnDetail(__h3ravel_shared.Logger.parse([[migration.migration, "green"]], "", false), __h3ravel_shared.Logger.parse([["Migration not found", "yellow"]], "", false));
5151
5094
  continue;
5152
5095
  }
5153
5096
  rolledBack.push(file);
@@ -5259,6 +5202,26 @@ var Migrator = class {
5259
5202
  };
5260
5203
  var migrator_default = Migrator;
5261
5204
 
5205
+ //#endregion
5206
+ //#region src/cli/utils.ts
5207
+ const join = path.default.join;
5208
+ var Utils = class {
5209
+ static findModulePkg(moduleId, cwd) {
5210
+ const parts = moduleId.replace(/\\/g, "/").split("/");
5211
+ let packageName = "";
5212
+ if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
5213
+ packageName += parts.shift();
5214
+ const packageJson = path.default.join(packageName, "package.json");
5215
+ const resolved = resolve_from.default.silent(cwd ?? process.cwd(), packageJson);
5216
+ if (!resolved) return;
5217
+ return path.default.join(path.default.dirname(resolved), parts.join("/"));
5218
+ }
5219
+ static async getMigrationPaths(cwd, migrator, defaultPath, path$6) {
5220
+ if (path$6) return [join(cwd, path$6)];
5221
+ return [...migrator.getPaths(), join(cwd, defaultPath)];
5222
+ }
5223
+ };
5224
+
5262
5225
  //#endregion
5263
5226
  //#region src/migrate.ts
5264
5227
  var Migrate = class {
@@ -5433,9 +5396,9 @@ var seeder_default = Seeder;
5433
5396
  //#endregion
5434
5397
  //#region src/seeders/runner.ts
5435
5398
  async function glob(folderPath) {
5436
- const { default: escalade$1 } = await import("escalade");
5399
+ const { default: escalade } = await import("escalade");
5437
5400
  const entries = [];
5438
- await escalade$1(folderPath, async (dir, names) => {
5401
+ await escalade(folderPath, async (dir, names) => {
5439
5402
  await Promise.all(names.map(async (name) => {
5440
5403
  const p = path.default.join(dir, name);
5441
5404
  try {
package/dist/index.js CHANGED
@@ -6,12 +6,10 @@ import collect$1, { Collection, collect } from "collect.js";
6
6
  import Knex$1 from "knex";
7
7
  import path from "path";
8
8
  import { existsSync } from "fs";
9
- import { access } from "fs/promises";
10
- import escalade from "escalade/sync";
11
- import resolveFrom from "resolve-from";
9
+ import { FileSystem, Logger, TaskManager } from "@h3ravel/shared";
12
10
  import pluralize from "pluralize";
13
- import { Logger, TaskManager } from "@h3ravel/shared";
14
- import fs, { access as access$1, mkdir, readFile, writeFile } from "node:fs/promises";
11
+ import fs, { access, mkdir, readFile, writeFile } from "node:fs/promises";
12
+ import resolveFrom from "resolve-from";
15
13
  import { dirname } from "node:path";
16
14
  import { fileURLToPath } from "node:url";
17
15
 
@@ -1658,59 +1656,6 @@ var QueryBuilder = class QueryBuilder extends Inference$2 {
1658
1656
  };
1659
1657
  var query_builder_default = QueryBuilder;
1660
1658
 
1661
- //#endregion
1662
- //#region src/cli/utils.ts
1663
- const join = path.join;
1664
- var Utils = class {
1665
- /**
1666
- * Wraps text with chalk
1667
- *
1668
- * @param txt
1669
- * @param color
1670
- * @returns
1671
- */
1672
- static textFormat(txt, color) {
1673
- return String(txt).split(":").map((e, i, a) => i == 0 && a.length > 1 ? color(" " + e + ": ") : e).join("");
1674
- }
1675
- static findModulePkg(moduleId, cwd) {
1676
- const parts = moduleId.replace(/\\/g, "/").split("/");
1677
- let packageName = "";
1678
- if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
1679
- packageName += parts.shift();
1680
- const packageJson = path.join(packageName, "package.json");
1681
- const resolved = resolveFrom.silent(cwd ?? process.cwd(), packageJson);
1682
- if (!resolved) return;
1683
- return path.join(path.dirname(resolved), parts.join("/"));
1684
- }
1685
- static async getMigrationPaths(cwd, migrator, defaultPath, path$1) {
1686
- if (path$1) return [join(cwd, path$1)];
1687
- return [...migrator.getPaths(), join(cwd, defaultPath)];
1688
- }
1689
- /**
1690
- * Check if file exists
1691
- *
1692
- * @param path
1693
- * @returns
1694
- */
1695
- static async fileExists(path$1) {
1696
- try {
1697
- await access(path$1);
1698
- return true;
1699
- } catch {
1700
- return false;
1701
- }
1702
- }
1703
- static findUpConfig(cwd, name, extensions) {
1704
- return escalade(cwd, (_dir, names) => {
1705
- for (const ext of extensions) {
1706
- const filename = `${name}.${ext}`;
1707
- if (names.includes(filename)) return filename;
1708
- }
1709
- return false;
1710
- });
1711
- }
1712
- };
1713
-
1714
1659
  //#endregion
1715
1660
  //#region src/arquebus.ts
1716
1661
  var arquebus = class arquebus {
@@ -1835,11 +1780,11 @@ var arquebus = class arquebus {
1835
1780
  path.join(process.cwd(), "test")
1836
1781
  ];
1837
1782
  for (const dir of candidateDirs) {
1838
- const found = Utils.findUpConfig(dir, "arquebus.config", [
1783
+ const found = FileSystem.resolveFileUp("arquebus.config", [
1839
1784
  "js",
1840
1785
  "ts",
1841
1786
  "cjs"
1842
- ]);
1787
+ ], dir);
1843
1788
  if (found) if (!found.endsWith(".ts") || process.env.NODE_ENV !== "production") {
1844
1789
  config = (await import(found)).default;
1845
1790
  if (addConnection) instance.addConnection(config, config.client);
@@ -5114,7 +5059,7 @@ var Migrator = class {
5114
5059
  for (const migration of migrations) {
5115
5060
  const file = files[migration.migration];
5116
5061
  if (!file) {
5117
- Logger.twoColumnLog(Logger.parse([[migration.migration, "green"]], "", false), Logger.parse([["Migration not found", "yellow"]], "", false));
5062
+ Logger.twoColumnDetail(Logger.parse([[migration.migration, "green"]], "", false), Logger.parse([["Migration not found", "yellow"]], "", false));
5118
5063
  continue;
5119
5064
  }
5120
5065
  rolledBack.push(file);
@@ -5226,6 +5171,26 @@ var Migrator = class {
5226
5171
  };
5227
5172
  var migrator_default = Migrator;
5228
5173
 
5174
+ //#endregion
5175
+ //#region src/cli/utils.ts
5176
+ const join = path.join;
5177
+ var Utils = class {
5178
+ static findModulePkg(moduleId, cwd) {
5179
+ const parts = moduleId.replace(/\\/g, "/").split("/");
5180
+ let packageName = "";
5181
+ if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
5182
+ packageName += parts.shift();
5183
+ const packageJson = path.join(packageName, "package.json");
5184
+ const resolved = resolveFrom.silent(cwd ?? process.cwd(), packageJson);
5185
+ if (!resolved) return;
5186
+ return path.join(path.dirname(resolved), parts.join("/"));
5187
+ }
5188
+ static async getMigrationPaths(cwd, migrator, defaultPath, path$1) {
5189
+ if (path$1) return [join(cwd, path$1)];
5190
+ return [...migrator.getPaths(), join(cwd, defaultPath)];
5191
+ }
5192
+ };
5193
+
5229
5194
  //#endregion
5230
5195
  //#region src/migrate.ts
5231
5196
  var Migrate = class {
@@ -5400,13 +5365,13 @@ var seeder_default = Seeder;
5400
5365
  //#endregion
5401
5366
  //#region src/seeders/runner.ts
5402
5367
  async function glob(folderPath) {
5403
- const { default: escalade$1 } = await import("escalade");
5368
+ const { default: escalade } = await import("escalade");
5404
5369
  const entries = [];
5405
- await escalade$1(folderPath, async (dir, names) => {
5370
+ await escalade(folderPath, async (dir, names) => {
5406
5371
  await Promise.all(names.map(async (name) => {
5407
5372
  const p = path.join(dir, name);
5408
5373
  try {
5409
- await access$1(p);
5374
+ await access(p);
5410
5375
  if (p.endsWith(".js") || p.endsWith(".ts")) entries.push(p);
5411
5376
  } catch {}
5412
5377
  }));
@@ -43,16 +43,12 @@ let path = require("path");
43
43
  path = __toESM(path);
44
44
  let fs = require("fs");
45
45
  fs = __toESM(fs);
46
- let fs_promises = require("fs/promises");
47
- fs_promises = __toESM(fs_promises);
48
- let escalade_sync = require("escalade/sync");
49
- escalade_sync = __toESM(escalade_sync);
50
- let resolve_from = require("resolve-from");
51
- resolve_from = __toESM(resolve_from);
46
+ let __h3ravel_shared = require("@h3ravel/shared");
47
+ __h3ravel_shared = __toESM(__h3ravel_shared);
52
48
  let pluralize = require("pluralize");
53
49
  pluralize = __toESM(pluralize);
54
- require("@h3ravel/shared");
55
50
  require("node:fs/promises");
51
+ require("resolve-from");
56
52
  require("node:path");
57
53
  require("node:url");
58
54
 
@@ -2924,59 +2920,6 @@ var QueryBuilder = class QueryBuilder extends Inference$1 {
2924
2920
  };
2925
2921
  var query_builder_default = QueryBuilder;
2926
2922
 
2927
- //#endregion
2928
- //#region src/cli/utils.ts
2929
- const join = path.default.join;
2930
- var Utils = class {
2931
- /**
2932
- * Wraps text with chalk
2933
- *
2934
- * @param txt
2935
- * @param color
2936
- * @returns
2937
- */
2938
- static textFormat(txt, color) {
2939
- return String(txt).split(":").map((e, i, a) => i == 0 && a.length > 1 ? color(" " + e + ": ") : e).join("");
2940
- }
2941
- static findModulePkg(moduleId, cwd) {
2942
- const parts = moduleId.replace(/\\/g, "/").split("/");
2943
- let packageName = "";
2944
- if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
2945
- packageName += parts.shift();
2946
- const packageJson = path.default.join(packageName, "package.json");
2947
- const resolved = resolve_from.default.silent(cwd ?? process.cwd(), packageJson);
2948
- if (!resolved) return;
2949
- return path.default.join(path.default.dirname(resolved), parts.join("/"));
2950
- }
2951
- static async getMigrationPaths(cwd, migrator, defaultPath, path$6) {
2952
- if (path$6) return [join(cwd, path$6)];
2953
- return [...migrator.getPaths(), join(cwd, defaultPath)];
2954
- }
2955
- /**
2956
- * Check if file exists
2957
- *
2958
- * @param path
2959
- * @returns
2960
- */
2961
- static async fileExists(path$6) {
2962
- try {
2963
- await (0, fs_promises.access)(path$6);
2964
- return true;
2965
- } catch {
2966
- return false;
2967
- }
2968
- }
2969
- static findUpConfig(cwd, name, extensions) {
2970
- return (0, escalade_sync.default)(cwd, (_dir, names) => {
2971
- for (const ext of extensions) {
2972
- const filename = `${name}.${ext}`;
2973
- if (names.includes(filename)) return filename;
2974
- }
2975
- return false;
2976
- });
2977
- }
2978
- };
2979
-
2980
2923
  //#endregion
2981
2924
  //#region src/arquebus.ts
2982
2925
  var arquebus = class arquebus {
@@ -3101,11 +3044,11 @@ var arquebus = class arquebus {
3101
3044
  path.default.join(process.cwd(), "test")
3102
3045
  ];
3103
3046
  for (const dir of candidateDirs) {
3104
- const found = Utils.findUpConfig(dir, "arquebus.config", [
3047
+ const found = __h3ravel_shared.FileSystem.resolveFileUp("arquebus.config", [
3105
3048
  "js",
3106
3049
  "ts",
3107
3050
  "cjs"
3108
- ]);
3051
+ ], dir);
3109
3052
  if (found) if (!found.endsWith(".ts") || process.env.NODE_ENV !== "production") {
3110
3053
  config = (await import(found)).default;
3111
3054
  if (addConnection) instance.addConnection(config, config.client);
@@ -4788,6 +4731,10 @@ var Builder = class Builder extends Inference {
4788
4731
  };
4789
4732
  var builder_default = Builder;
4790
4733
 
4734
+ //#endregion
4735
+ //#region src/cli/utils.ts
4736
+ const join = path.default.join;
4737
+
4791
4738
  //#endregion
4792
4739
  //#region src/inspector/dialects/sqlite.ts
4793
4740
  function parseDefaultValue(value) {
@@ -6,12 +6,10 @@ import collect$1, { Collection, collect } from "collect.js";
6
6
  import Knex$1 from "knex";
7
7
  import path from "path";
8
8
  import { existsSync } from "fs";
9
- import { access } from "fs/promises";
10
- import escalade from "escalade/sync";
11
- import resolveFrom from "resolve-from";
9
+ import { FileSystem } from "@h3ravel/shared";
12
10
  import pluralize from "pluralize";
13
- import "@h3ravel/shared";
14
11
  import "node:fs/promises";
12
+ import "resolve-from";
15
13
  import "node:path";
16
14
  import "node:url";
17
15
 
@@ -2895,59 +2893,6 @@ var QueryBuilder = class QueryBuilder extends Inference$1 {
2895
2893
  };
2896
2894
  var query_builder_default = QueryBuilder;
2897
2895
 
2898
- //#endregion
2899
- //#region src/cli/utils.ts
2900
- const join = path.join;
2901
- var Utils = class {
2902
- /**
2903
- * Wraps text with chalk
2904
- *
2905
- * @param txt
2906
- * @param color
2907
- * @returns
2908
- */
2909
- static textFormat(txt, color) {
2910
- return String(txt).split(":").map((e, i, a) => i == 0 && a.length > 1 ? color(" " + e + ": ") : e).join("");
2911
- }
2912
- static findModulePkg(moduleId, cwd) {
2913
- const parts = moduleId.replace(/\\/g, "/").split("/");
2914
- let packageName = "";
2915
- if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
2916
- packageName += parts.shift();
2917
- const packageJson = path.join(packageName, "package.json");
2918
- const resolved = resolveFrom.silent(cwd ?? process.cwd(), packageJson);
2919
- if (!resolved) return;
2920
- return path.join(path.dirname(resolved), parts.join("/"));
2921
- }
2922
- static async getMigrationPaths(cwd, migrator, defaultPath, path$1) {
2923
- if (path$1) return [join(cwd, path$1)];
2924
- return [...migrator.getPaths(), join(cwd, defaultPath)];
2925
- }
2926
- /**
2927
- * Check if file exists
2928
- *
2929
- * @param path
2930
- * @returns
2931
- */
2932
- static async fileExists(path$1) {
2933
- try {
2934
- await access(path$1);
2935
- return true;
2936
- } catch {
2937
- return false;
2938
- }
2939
- }
2940
- static findUpConfig(cwd, name, extensions) {
2941
- return escalade(cwd, (_dir, names) => {
2942
- for (const ext of extensions) {
2943
- const filename = `${name}.${ext}`;
2944
- if (names.includes(filename)) return filename;
2945
- }
2946
- return false;
2947
- });
2948
- }
2949
- };
2950
-
2951
2896
  //#endregion
2952
2897
  //#region src/arquebus.ts
2953
2898
  var arquebus = class arquebus {
@@ -3072,11 +3017,11 @@ var arquebus = class arquebus {
3072
3017
  path.join(process.cwd(), "test")
3073
3018
  ];
3074
3019
  for (const dir of candidateDirs) {
3075
- const found = Utils.findUpConfig(dir, "arquebus.config", [
3020
+ const found = FileSystem.resolveFileUp("arquebus.config", [
3076
3021
  "js",
3077
3022
  "ts",
3078
3023
  "cjs"
3079
- ]);
3024
+ ], dir);
3080
3025
  if (found) if (!found.endsWith(".ts") || process.env.NODE_ENV !== "production") {
3081
3026
  config = (await import(found)).default;
3082
3027
  if (addConnection) instance.addConnection(config, config.client);
@@ -4759,6 +4704,10 @@ var Builder = class Builder extends Inference {
4759
4704
  };
4760
4705
  var builder_default = Builder;
4761
4706
 
4707
+ //#endregion
4708
+ //#region src/cli/utils.ts
4709
+ const join = path.join;
4710
+
4762
4711
  //#endregion
4763
4712
  //#region src/inspector/dialects/sqlite.ts
4764
4713
  function parseDefaultValue(value) {
@@ -45,12 +45,6 @@ let path = require("path");
45
45
  path = __toESM(path);
46
46
  let fs = require("fs");
47
47
  fs = __toESM(fs);
48
- let fs_promises = require("fs/promises");
49
- fs_promises = __toESM(fs_promises);
50
- let escalade_sync = require("escalade/sync");
51
- escalade_sync = __toESM(escalade_sync);
52
- let resolve_from = require("resolve-from");
53
- resolve_from = __toESM(resolve_from);
54
48
  let pluralize = require("pluralize");
55
49
  pluralize = __toESM(pluralize);
56
50
  let node_fs_promises = require("node:fs/promises");
@@ -59,6 +53,8 @@ let node_path = require("node:path");
59
53
  node_path = __toESM(node_path);
60
54
  let node_url = require("node:url");
61
55
  node_url = __toESM(node_url);
56
+ let resolve_from = require("resolve-from");
57
+ resolve_from = __toESM(resolve_from);
62
58
 
63
59
  //#region src/migrations/migration-repository.ts
64
60
  var MigrationRepository = class {
@@ -2997,59 +2993,6 @@ var QueryBuilder = class QueryBuilder extends Inference$2 {
2997
2993
  };
2998
2994
  var query_builder_default = QueryBuilder;
2999
2995
 
3000
- //#endregion
3001
- //#region src/cli/utils.ts
3002
- const join = path.default.join;
3003
- var Utils = class {
3004
- /**
3005
- * Wraps text with chalk
3006
- *
3007
- * @param txt
3008
- * @param color
3009
- * @returns
3010
- */
3011
- static textFormat(txt, color) {
3012
- return String(txt).split(":").map((e, i, a) => i == 0 && a.length > 1 ? color(" " + e + ": ") : e).join("");
3013
- }
3014
- static findModulePkg(moduleId, cwd) {
3015
- const parts = moduleId.replace(/\\/g, "/").split("/");
3016
- let packageName = "";
3017
- if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
3018
- packageName += parts.shift();
3019
- const packageJson = path.default.join(packageName, "package.json");
3020
- const resolved = resolve_from.default.silent(cwd ?? process.cwd(), packageJson);
3021
- if (!resolved) return;
3022
- return path.default.join(path.default.dirname(resolved), parts.join("/"));
3023
- }
3024
- static async getMigrationPaths(cwd, migrator, defaultPath, path$7) {
3025
- if (path$7) return [join(cwd, path$7)];
3026
- return [...migrator.getPaths(), join(cwd, defaultPath)];
3027
- }
3028
- /**
3029
- * Check if file exists
3030
- *
3031
- * @param path
3032
- * @returns
3033
- */
3034
- static async fileExists(path$7) {
3035
- try {
3036
- await (0, fs_promises.access)(path$7);
3037
- return true;
3038
- } catch {
3039
- return false;
3040
- }
3041
- }
3042
- static findUpConfig(cwd, name, extensions) {
3043
- return (0, escalade_sync.default)(cwd, (_dir, names) => {
3044
- for (const ext of extensions) {
3045
- const filename = `${name}.${ext}`;
3046
- if (names.includes(filename)) return filename;
3047
- }
3048
- return false;
3049
- });
3050
- }
3051
- };
3052
-
3053
2996
  //#endregion
3054
2997
  //#region src/arquebus.ts
3055
2998
  var arquebus = class arquebus {
@@ -3174,11 +3117,11 @@ var arquebus = class arquebus {
3174
3117
  path.default.join(process.cwd(), "test")
3175
3118
  ];
3176
3119
  for (const dir of candidateDirs) {
3177
- const found = Utils.findUpConfig(dir, "arquebus.config", [
3120
+ const found = __h3ravel_shared.FileSystem.resolveFileUp("arquebus.config", [
3178
3121
  "js",
3179
3122
  "ts",
3180
3123
  "cjs"
3181
- ]);
3124
+ ], dir);
3182
3125
  if (found) if (!found.endsWith(".ts") || process.env.NODE_ENV !== "production") {
3183
3126
  config = (await import(found)).default;
3184
3127
  if (addConnection) instance.addConnection(config, config.client);
@@ -5136,7 +5079,7 @@ var Migrator = class {
5136
5079
  for (const migration of migrations) {
5137
5080
  const file = files[migration.migration];
5138
5081
  if (!file) {
5139
- __h3ravel_shared.Logger.twoColumnLog(__h3ravel_shared.Logger.parse([[migration.migration, "green"]], "", false), __h3ravel_shared.Logger.parse([["Migration not found", "yellow"]], "", false));
5082
+ __h3ravel_shared.Logger.twoColumnDetail(__h3ravel_shared.Logger.parse([[migration.migration, "green"]], "", false), __h3ravel_shared.Logger.parse([["Migration not found", "yellow"]], "", false));
5140
5083
  continue;
5141
5084
  }
5142
5085
  rolledBack.push(file);
@@ -5248,6 +5191,26 @@ var Migrator = class {
5248
5191
  };
5249
5192
  var migrator_default = Migrator;
5250
5193
 
5194
+ //#endregion
5195
+ //#region src/cli/utils.ts
5196
+ const join = path.default.join;
5197
+ var Utils = class {
5198
+ static findModulePkg(moduleId, cwd) {
5199
+ const parts = moduleId.replace(/\\/g, "/").split("/");
5200
+ let packageName = "";
5201
+ if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
5202
+ packageName += parts.shift();
5203
+ const packageJson = path.default.join(packageName, "package.json");
5204
+ const resolved = resolve_from.default.silent(cwd ?? process.cwd(), packageJson);
5205
+ if (!resolved) return;
5206
+ return path.default.join(path.default.dirname(resolved), parts.join("/"));
5207
+ }
5208
+ static async getMigrationPaths(cwd, migrator, defaultPath, path$7) {
5209
+ if (path$7) return [join(cwd, path$7)];
5210
+ return [...migrator.getPaths(), join(cwd, defaultPath)];
5211
+ }
5212
+ };
5213
+
5251
5214
  //#endregion
5252
5215
  //#region src/migrate.ts
5253
5216
  var Migrate = class {
@@ -7,13 +7,11 @@ import collect, { Collection, collect as collect$1 } from "collect.js";
7
7
  import Knex$1 from "knex";
8
8
  import path from "path";
9
9
  import { existsSync } from "fs";
10
- import { access } from "fs/promises";
11
- import escalade from "escalade/sync";
12
- import resolveFrom from "resolve-from";
13
10
  import pluralize from "pluralize";
14
11
  import fs, { copyFile, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
15
12
  import path$1, { dirname } from "node:path";
16
13
  import { fileURLToPath } from "node:url";
14
+ import resolveFrom from "resolve-from";
17
15
 
18
16
  //#region src/migrations/migration-repository.ts
19
17
  var MigrationRepository = class {
@@ -2952,59 +2950,6 @@ var QueryBuilder = class QueryBuilder extends Inference$2 {
2952
2950
  };
2953
2951
  var query_builder_default = QueryBuilder;
2954
2952
 
2955
- //#endregion
2956
- //#region src/cli/utils.ts
2957
- const join = path.join;
2958
- var Utils = class {
2959
- /**
2960
- * Wraps text with chalk
2961
- *
2962
- * @param txt
2963
- * @param color
2964
- * @returns
2965
- */
2966
- static textFormat(txt, color) {
2967
- return String(txt).split(":").map((e, i, a) => i == 0 && a.length > 1 ? color(" " + e + ": ") : e).join("");
2968
- }
2969
- static findModulePkg(moduleId, cwd) {
2970
- const parts = moduleId.replace(/\\/g, "/").split("/");
2971
- let packageName = "";
2972
- if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
2973
- packageName += parts.shift();
2974
- const packageJson = path.join(packageName, "package.json");
2975
- const resolved = resolveFrom.silent(cwd ?? process.cwd(), packageJson);
2976
- if (!resolved) return;
2977
- return path.join(path.dirname(resolved), parts.join("/"));
2978
- }
2979
- static async getMigrationPaths(cwd, migrator, defaultPath, path$2) {
2980
- if (path$2) return [join(cwd, path$2)];
2981
- return [...migrator.getPaths(), join(cwd, defaultPath)];
2982
- }
2983
- /**
2984
- * Check if file exists
2985
- *
2986
- * @param path
2987
- * @returns
2988
- */
2989
- static async fileExists(path$2) {
2990
- try {
2991
- await access(path$2);
2992
- return true;
2993
- } catch {
2994
- return false;
2995
- }
2996
- }
2997
- static findUpConfig(cwd, name, extensions) {
2998
- return escalade(cwd, (_dir, names) => {
2999
- for (const ext of extensions) {
3000
- const filename = `${name}.${ext}`;
3001
- if (names.includes(filename)) return filename;
3002
- }
3003
- return false;
3004
- });
3005
- }
3006
- };
3007
-
3008
2953
  //#endregion
3009
2954
  //#region src/arquebus.ts
3010
2955
  var arquebus = class arquebus {
@@ -3129,11 +3074,11 @@ var arquebus = class arquebus {
3129
3074
  path.join(process.cwd(), "test")
3130
3075
  ];
3131
3076
  for (const dir of candidateDirs) {
3132
- const found = Utils.findUpConfig(dir, "arquebus.config", [
3077
+ const found = FileSystem.resolveFileUp("arquebus.config", [
3133
3078
  "js",
3134
3079
  "ts",
3135
3080
  "cjs"
3136
- ]);
3081
+ ], dir);
3137
3082
  if (found) if (!found.endsWith(".ts") || process.env.NODE_ENV !== "production") {
3138
3083
  config = (await import(found)).default;
3139
3084
  if (addConnection) instance.addConnection(config, config.client);
@@ -5097,7 +5042,7 @@ var Migrator = class {
5097
5042
  for (const migration of migrations) {
5098
5043
  const file = files[migration.migration];
5099
5044
  if (!file) {
5100
- Logger.twoColumnLog(Logger.parse([[migration.migration, "green"]], "", false), Logger.parse([["Migration not found", "yellow"]], "", false));
5045
+ Logger.twoColumnDetail(Logger.parse([[migration.migration, "green"]], "", false), Logger.parse([["Migration not found", "yellow"]], "", false));
5101
5046
  continue;
5102
5047
  }
5103
5048
  rolledBack.push(file);
@@ -5209,6 +5154,26 @@ var Migrator = class {
5209
5154
  };
5210
5155
  var migrator_default = Migrator;
5211
5156
 
5157
+ //#endregion
5158
+ //#region src/cli/utils.ts
5159
+ const join = path.join;
5160
+ var Utils = class {
5161
+ static findModulePkg(moduleId, cwd) {
5162
+ const parts = moduleId.replace(/\\/g, "/").split("/");
5163
+ let packageName = "";
5164
+ if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
5165
+ packageName += parts.shift();
5166
+ const packageJson = path.join(packageName, "package.json");
5167
+ const resolved = resolveFrom.silent(cwd ?? process.cwd(), packageJson);
5168
+ if (!resolved) return;
5169
+ return path.join(path.dirname(resolved), parts.join("/"));
5170
+ }
5171
+ static async getMigrationPaths(cwd, migrator, defaultPath, path$2) {
5172
+ if (path$2) return [join(cwd, path$2)];
5173
+ return [...migrator.getPaths(), join(cwd, defaultPath)];
5174
+ }
5175
+ };
5176
+
5212
5177
  //#endregion
5213
5178
  //#region src/migrate.ts
5214
5179
  var Migrate = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h3ravel/arquebus",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "Arquebus ORM is a Beautiful, expressive ORM inspired by Laravel's Eloquent, designed for TypeScript applications and for the H3ravel Framework.",
5
5
  "homepage": "https://h3ravel.toneflix.net/arquebus",
6
6
  "bin": {
@@ -134,7 +134,7 @@
134
134
  ]
135
135
  },
136
136
  "dependencies": {
137
- "@h3ravel/shared": "^0.20.12",
137
+ "@h3ravel/shared": "^0.21.0",
138
138
  "@h3ravel/support": "^0.12.0",
139
139
  "barrelize": "^1.6.4",
140
140
  "chalk": "^5.6.2",