@h3ravel/arquebus 2.0.0 → 3.0.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.
- package/bin/index.cjs +580 -451
- package/bin/index.js +566 -437
- package/dist/browser/index.cjs +54 -51
- package/dist/browser/index.d.ts +804 -737
- package/dist/browser/index.js +48 -44
- package/dist/concerns/index.cjs +152 -143
- package/dist/concerns/index.d.ts +849 -776
- package/dist/concerns/index.js +143 -133
- package/dist/index.cjs +186 -185
- package/dist/index.d.ts +856 -782
- package/dist/index.js +179 -177
- package/dist/inspector/index.cjs +175 -174
- package/dist/inspector/index.d.ts +0 -1
- package/dist/inspector/index.js +161 -159
- package/dist/migrations/index.cjs +183 -182
- package/dist/migrations/index.d.ts +799 -727
- package/dist/migrations/index.js +172 -170
- package/dist/relations/index.cjs +152 -143
- package/dist/relations/index.d.ts +835 -762
- package/dist/relations/index.js +143 -133
- package/dist/seeders/index.cjs +7 -5
- package/dist/seeders/index.d.ts +797 -724
- package/dist/seeders/index.js +8 -6
- package/dist/{migrations/stubs/stubs → stubs}/migration-js.stub +1 -0
- package/dist/{migrations/stubs/stubs → stubs}/migration-ts.stub +1 -0
- package/dist/{migrations/stubs/stubs → stubs}/migration.create-js.stub +1 -0
- package/dist/{migrations/stubs/stubs → stubs}/migration.create-ts.stub +1 -0
- package/dist/{migrations/stubs/stubs → stubs}/migration.update-js.stub +1 -0
- package/dist/{migrations/stubs/stubs → stubs}/migration.update-ts.stub +1 -0
- package/dist/stubs/model-ts.stub +9 -0
- package/package.json +31 -31
- package/types/builder.ts +1 -1
- package/types/database.ts +69 -0
- package/types/index.ts +3 -0
- package/types/model-builder.ts +132 -0
- package/types/query-builder.ts +0 -1
- package/types/query-methods.ts +0 -1
- package/types/schema.ts +92 -0
- package/types/utils.ts +1 -40
- package/dist/stubs/stubs/model-ts.stub +0 -5
- /package/dist/stubs/{stubs/arquebus.config-js.stub → arquebus.config-js.stub} +0 -0
- /package/dist/stubs/{stubs/arquebus.config-ts.stub → arquebus.config-ts.stub} +0 -0
- /package/dist/stubs/{stubs/model-js.stub → model-js.stub} +0 -0
- /package/dist/stubs/{stubs/seeder-js.stub → seeder-js.stub} +0 -0
- /package/dist/stubs/{stubs/seeder-ts.stub → seeder-ts.stub} +0 -0
package/dist/seeders/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ let node_fs_promises = require("node:fs/promises");
|
|
|
25
25
|
let path = require("path");
|
|
26
26
|
path = __toESM(path, 1);
|
|
27
27
|
let node_path = require("node:path");
|
|
28
|
+
let node_fs = require("node:fs");
|
|
28
29
|
let node_url = require("node:url");
|
|
29
30
|
//#region src/seeders/seeder.ts
|
|
30
31
|
var Seeder = class {};
|
|
@@ -53,16 +54,14 @@ var SeederRunner = class {
|
|
|
53
54
|
this.resolver = resolver;
|
|
54
55
|
}
|
|
55
56
|
path(p) {
|
|
56
|
-
this.paths = Array.from(new Set([...this.paths, p]));
|
|
57
|
+
this.paths = Array.from(/* @__PURE__ */ new Set([...this.paths, p]));
|
|
57
58
|
}
|
|
58
59
|
getPaths() {
|
|
59
60
|
return this.paths;
|
|
60
61
|
}
|
|
61
62
|
resolveConnection(connection) {
|
|
62
|
-
var _getInstance, _ref, _instance$connections;
|
|
63
63
|
const name = connection || this.connection || "default";
|
|
64
|
-
|
|
65
|
-
if (!!!(instance === null || instance === void 0 || (_instance$connections = instance.connections) === null || _instance$connections === void 0 ? void 0 : _instance$connections[name])) this.resolver.autoLoad().catch(() => {
|
|
64
|
+
if (!!!(this.resolver.getInstance?.() ?? null)?.connections?.[name]) this.resolver.autoLoad().catch(() => {
|
|
66
65
|
/** noop */
|
|
67
66
|
});
|
|
68
67
|
return this.resolver.fire(name);
|
|
@@ -117,7 +116,10 @@ var SeederCreator = class {
|
|
|
117
116
|
getStubPath(type) {
|
|
118
117
|
if (this.customStubPath) return path.default.join(this.customStubPath, `seeder-${type}.stub`);
|
|
119
118
|
const __dirname = this.getDirname({});
|
|
120
|
-
|
|
119
|
+
const name = `seeder-${type}.stub`;
|
|
120
|
+
const resolved = [path.default.join(__dirname, "stubs", name), path.default.join(__dirname, "../stubs", name)].find((candidate) => (0, node_fs.existsSync)(candidate));
|
|
121
|
+
if (!resolved) throw new Error(`Seeder stub not found: ${name}`);
|
|
122
|
+
return resolved;
|
|
121
123
|
}
|
|
122
124
|
getDirname(meta) {
|
|
123
125
|
if (typeof __dirname !== "undefined") return __dirname;
|