@h3ravel/arquebus 0.6.5 → 0.6.7
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/README.md +5 -4
- package/package.json +4 -3
- package/bin/index.cjs +0 -5964
- package/bin/index.d.cts +0 -1
- package/bin/index.d.ts +0 -1
- package/bin/index.js +0 -5960
- package/bin/seeders-8GJzfIIN.js +0 -3
- package/bin/seeders-ByeSoCAQ.cjs +0 -131
- package/bin/seeders-CltigymO.js +0 -79
- package/bin/seeders-_xJ6VGVS.cjs +0 -3
- package/dist/browser/index.cjs +0 -1271
- package/dist/browser/index.d.cts +0 -4932
- package/dist/browser/index.d.ts +0 -4932
- package/dist/browser/index.js +0 -1218
- package/dist/index.cjs +0 -5750
- package/dist/index.d.cts +0 -5129
- package/dist/index.d.ts +0 -5129
- package/dist/index.js +0 -5679
- package/dist/inspector/index.cjs +0 -4961
- package/dist/inspector/index.d.cts +0 -83
- package/dist/inspector/index.d.ts +0 -83
- package/dist/inspector/index.js +0 -4932
- package/dist/migrations/chunk-PECeCxCb.js +0 -15
- package/dist/migrations/index.cjs +0 -5507
- package/dist/migrations/index.d.cts +0 -4965
- package/dist/migrations/index.d.ts +0 -4962
- package/dist/migrations/index.js +0 -5454
- package/dist/migrations/stubs/migration-js.stub +0 -21
- package/dist/migrations/stubs/migration-ts.stub +0 -18
- package/dist/migrations/stubs/migration.create-js.stub +0 -24
- package/dist/migrations/stubs/migration.create-ts.stub +0 -21
- package/dist/migrations/stubs/migration.update-js.stub +0 -25
- package/dist/migrations/stubs/migration.update-ts.stub +0 -22
- package/dist/seeders/index.cjs +0 -141
- package/dist/seeders/index.d.cts +0 -4766
- package/dist/seeders/index.d.ts +0 -4766
- package/dist/seeders/index.js +0 -118
- package/dist/seeders/index.ts +0 -3
- package/dist/seeders/runner.ts +0 -101
- package/dist/seeders/seeder-creator.ts +0 -42
- package/dist/seeders/seeder.ts +0 -10
- package/dist/stubs/arquebus.config-js.stub +0 -25
- package/dist/stubs/arquebus.config-ts.stub +0 -24
- package/dist/stubs/model-js.stub +0 -5
- package/dist/stubs/model-ts.stub +0 -5
- package/dist/stubs/seeder-js.stub +0 -13
- package/dist/stubs/seeder-ts.stub +0 -9
package/bin/seeders-8GJzfIIN.js
DELETED
package/bin/seeders-ByeSoCAQ.cjs
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (all) => {
|
|
9
|
-
let target = {};
|
|
10
|
-
for (var name in all) __defProp(target, name, {
|
|
11
|
-
get: all[name],
|
|
12
|
-
enumerable: true
|
|
13
|
-
});
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __copyProps = (to, from, except, desc) => {
|
|
17
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
18
|
-
key = keys[i];
|
|
19
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
20
|
-
get: ((k) => from[k]).bind(null, key),
|
|
21
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
27
|
-
value: mod,
|
|
28
|
-
enumerable: true
|
|
29
|
-
}) : target, mod));
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
let path = require("path");
|
|
33
|
-
path = __toESM(path);
|
|
34
|
-
let node_fs_promises = require("node:fs/promises");
|
|
35
|
-
node_fs_promises = __toESM(node_fs_promises);
|
|
36
|
-
let node_path = require("node:path");
|
|
37
|
-
node_path = __toESM(node_path);
|
|
38
|
-
let node_url = require("node:url");
|
|
39
|
-
node_url = __toESM(node_url);
|
|
40
|
-
|
|
41
|
-
//#region src/seeders/runner.ts
|
|
42
|
-
async function glob(folderPath) {
|
|
43
|
-
const { default: escalade } = await import("escalade");
|
|
44
|
-
const entries = [];
|
|
45
|
-
await escalade(folderPath, async (dir, names) => {
|
|
46
|
-
await Promise.all(names.map(async (name) => {
|
|
47
|
-
const p = path.default.join(dir, name);
|
|
48
|
-
try {
|
|
49
|
-
await (0, node_fs_promises.access)(p);
|
|
50
|
-
if (p.endsWith(".js") || p.endsWith(".ts")) entries.push(p);
|
|
51
|
-
} catch {}
|
|
52
|
-
}));
|
|
53
|
-
return "";
|
|
54
|
-
});
|
|
55
|
-
return entries;
|
|
56
|
-
}
|
|
57
|
-
var SeederRunner = class {
|
|
58
|
-
resolver;
|
|
59
|
-
connection;
|
|
60
|
-
paths = [];
|
|
61
|
-
constructor(resolver) {
|
|
62
|
-
this.resolver = resolver;
|
|
63
|
-
}
|
|
64
|
-
path(p) {
|
|
65
|
-
this.paths = Array.from(new Set([...this.paths, p]));
|
|
66
|
-
}
|
|
67
|
-
getPaths() {
|
|
68
|
-
return this.paths;
|
|
69
|
-
}
|
|
70
|
-
resolveConnection(connection) {
|
|
71
|
-
var _getInstance, _ref, _instance$connections;
|
|
72
|
-
const name = connection || this.connection || "default";
|
|
73
|
-
const instance = ((_getInstance = (_ref = this.resolver).getInstance) === null || _getInstance === void 0 ? void 0 : _getInstance.call(_ref)) ?? null;
|
|
74
|
-
if (!!!(instance === null || instance === void 0 || (_instance$connections = instance.connections) === null || _instance$connections === void 0 ? void 0 : _instance$connections[name])) this.resolver.autoLoad().catch(() => {
|
|
75
|
-
/** noop */
|
|
76
|
-
});
|
|
77
|
-
return this.resolver.fire(name);
|
|
78
|
-
}
|
|
79
|
-
setConnection(connection) {
|
|
80
|
-
this.connection = connection;
|
|
81
|
-
return this;
|
|
82
|
-
}
|
|
83
|
-
async getSeederFiles(paths) {
|
|
84
|
-
const files = [];
|
|
85
|
-
for (const p of paths) {
|
|
86
|
-
if (p.endsWith(".js") || p.endsWith(".ts")) {
|
|
87
|
-
files.push(p);
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
files.push(...await glob(p));
|
|
91
|
-
}
|
|
92
|
-
return files;
|
|
93
|
-
}
|
|
94
|
-
async resolvePath(filePath) {
|
|
95
|
-
try {
|
|
96
|
-
const mod = await import(filePath);
|
|
97
|
-
return new (mod.default ?? mod.Seeder)();
|
|
98
|
-
} catch {
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
async run(paths, connection) {
|
|
103
|
-
const files = await this.getSeederFiles(paths);
|
|
104
|
-
const conn = this.resolveConnection(connection);
|
|
105
|
-
for (const file of files) {
|
|
106
|
-
const seeder = await this.resolvePath(file);
|
|
107
|
-
if (seeder && typeof seeder.run === "function") await seeder.run(conn);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
var runner_default = SeederRunner;
|
|
112
|
-
|
|
113
|
-
//#endregion
|
|
114
|
-
Object.defineProperty(exports, '__export', {
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function () {
|
|
117
|
-
return __export;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
Object.defineProperty(exports, '__toESM', {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return __toESM;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(exports, 'runner_default', {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function () {
|
|
129
|
-
return runner_default;
|
|
130
|
-
}
|
|
131
|
-
});
|
package/bin/seeders-CltigymO.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
-
import { dirname } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
|
|
6
|
-
//#region src/seeders/runner.ts
|
|
7
|
-
async function glob(folderPath) {
|
|
8
|
-
const { default: escalade } = await import("escalade");
|
|
9
|
-
const entries = [];
|
|
10
|
-
await escalade(folderPath, async (dir, names) => {
|
|
11
|
-
await Promise.all(names.map(async (name) => {
|
|
12
|
-
const p = path.join(dir, name);
|
|
13
|
-
try {
|
|
14
|
-
await access(p);
|
|
15
|
-
if (p.endsWith(".js") || p.endsWith(".ts")) entries.push(p);
|
|
16
|
-
} catch {}
|
|
17
|
-
}));
|
|
18
|
-
return "";
|
|
19
|
-
});
|
|
20
|
-
return entries;
|
|
21
|
-
}
|
|
22
|
-
var SeederRunner = class {
|
|
23
|
-
resolver;
|
|
24
|
-
connection;
|
|
25
|
-
paths = [];
|
|
26
|
-
constructor(resolver) {
|
|
27
|
-
this.resolver = resolver;
|
|
28
|
-
}
|
|
29
|
-
path(p) {
|
|
30
|
-
this.paths = Array.from(new Set([...this.paths, p]));
|
|
31
|
-
}
|
|
32
|
-
getPaths() {
|
|
33
|
-
return this.paths;
|
|
34
|
-
}
|
|
35
|
-
resolveConnection(connection) {
|
|
36
|
-
var _getInstance, _ref, _instance$connections;
|
|
37
|
-
const name = connection || this.connection || "default";
|
|
38
|
-
const instance = ((_getInstance = (_ref = this.resolver).getInstance) === null || _getInstance === void 0 ? void 0 : _getInstance.call(_ref)) ?? null;
|
|
39
|
-
if (!!!(instance === null || instance === void 0 || (_instance$connections = instance.connections) === null || _instance$connections === void 0 ? void 0 : _instance$connections[name])) this.resolver.autoLoad().catch(() => {
|
|
40
|
-
/** noop */
|
|
41
|
-
});
|
|
42
|
-
return this.resolver.fire(name);
|
|
43
|
-
}
|
|
44
|
-
setConnection(connection) {
|
|
45
|
-
this.connection = connection;
|
|
46
|
-
return this;
|
|
47
|
-
}
|
|
48
|
-
async getSeederFiles(paths) {
|
|
49
|
-
const files = [];
|
|
50
|
-
for (const p of paths) {
|
|
51
|
-
if (p.endsWith(".js") || p.endsWith(".ts")) {
|
|
52
|
-
files.push(p);
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
files.push(...await glob(p));
|
|
56
|
-
}
|
|
57
|
-
return files;
|
|
58
|
-
}
|
|
59
|
-
async resolvePath(filePath) {
|
|
60
|
-
try {
|
|
61
|
-
const mod = await import(filePath);
|
|
62
|
-
return new (mod.default ?? mod.Seeder)();
|
|
63
|
-
} catch {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
async run(paths, connection) {
|
|
68
|
-
const files = await this.getSeederFiles(paths);
|
|
69
|
-
const conn = this.resolveConnection(connection);
|
|
70
|
-
for (const file of files) {
|
|
71
|
-
const seeder = await this.resolvePath(file);
|
|
72
|
-
if (seeder && typeof seeder.run === "function") await seeder.run(conn);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
var runner_default = SeederRunner;
|
|
77
|
-
|
|
78
|
-
//#endregion
|
|
79
|
-
export { runner_default };
|
package/bin/seeders-_xJ6VGVS.cjs
DELETED