@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.
Files changed (47) hide show
  1. package/README.md +5 -4
  2. package/package.json +4 -3
  3. package/bin/index.cjs +0 -5964
  4. package/bin/index.d.cts +0 -1
  5. package/bin/index.d.ts +0 -1
  6. package/bin/index.js +0 -5960
  7. package/bin/seeders-8GJzfIIN.js +0 -3
  8. package/bin/seeders-ByeSoCAQ.cjs +0 -131
  9. package/bin/seeders-CltigymO.js +0 -79
  10. package/bin/seeders-_xJ6VGVS.cjs +0 -3
  11. package/dist/browser/index.cjs +0 -1271
  12. package/dist/browser/index.d.cts +0 -4932
  13. package/dist/browser/index.d.ts +0 -4932
  14. package/dist/browser/index.js +0 -1218
  15. package/dist/index.cjs +0 -5750
  16. package/dist/index.d.cts +0 -5129
  17. package/dist/index.d.ts +0 -5129
  18. package/dist/index.js +0 -5679
  19. package/dist/inspector/index.cjs +0 -4961
  20. package/dist/inspector/index.d.cts +0 -83
  21. package/dist/inspector/index.d.ts +0 -83
  22. package/dist/inspector/index.js +0 -4932
  23. package/dist/migrations/chunk-PECeCxCb.js +0 -15
  24. package/dist/migrations/index.cjs +0 -5507
  25. package/dist/migrations/index.d.cts +0 -4965
  26. package/dist/migrations/index.d.ts +0 -4962
  27. package/dist/migrations/index.js +0 -5454
  28. package/dist/migrations/stubs/migration-js.stub +0 -21
  29. package/dist/migrations/stubs/migration-ts.stub +0 -18
  30. package/dist/migrations/stubs/migration.create-js.stub +0 -24
  31. package/dist/migrations/stubs/migration.create-ts.stub +0 -21
  32. package/dist/migrations/stubs/migration.update-js.stub +0 -25
  33. package/dist/migrations/stubs/migration.update-ts.stub +0 -22
  34. package/dist/seeders/index.cjs +0 -141
  35. package/dist/seeders/index.d.cts +0 -4766
  36. package/dist/seeders/index.d.ts +0 -4766
  37. package/dist/seeders/index.js +0 -118
  38. package/dist/seeders/index.ts +0 -3
  39. package/dist/seeders/runner.ts +0 -101
  40. package/dist/seeders/seeder-creator.ts +0 -42
  41. package/dist/seeders/seeder.ts +0 -10
  42. package/dist/stubs/arquebus.config-js.stub +0 -25
  43. package/dist/stubs/arquebus.config-ts.stub +0 -24
  44. package/dist/stubs/model-js.stub +0 -5
  45. package/dist/stubs/model-ts.stub +0 -5
  46. package/dist/stubs/seeder-js.stub +0 -13
  47. package/dist/stubs/seeder-ts.stub +0 -9
@@ -1,3 +0,0 @@
1
- import { runner_default } from "./seeders-CltigymO.js";
2
-
3
- export { runner_default as SeederRunner };
@@ -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
- });
@@ -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 };
@@ -1,3 +0,0 @@
1
- const require_seeders = require('./seeders-ByeSoCAQ.cjs');
2
-
3
- exports.SeederRunner = require_seeders.runner_default;