@h3ravel/arquebus 0.1.6 → 0.2.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.
Files changed (37) hide show
  1. package/bin/.gitkeep +0 -0
  2. package/{dist/index.cjs → bin/cli.cjs} +1160 -802
  3. package/bin/cli.d.cts +18 -0
  4. package/bin/cli.d.ts +18 -0
  5. package/bin/cli.js +4887 -183
  6. package/bin/index.cjs +4948 -0
  7. package/bin/index.d.cts +2 -0
  8. package/bin/index.d.ts +2 -0
  9. package/bin/index.js +4923 -0
  10. package/bin/migrations/stubs/migration-js.stub +21 -0
  11. package/bin/migrations/stubs/migration-ts.stub +18 -0
  12. package/bin/migrations/stubs/migration.create-js.stub +24 -0
  13. package/bin/migrations/stubs/migration.create-ts.stub +21 -0
  14. package/bin/migrations/stubs/migration.update-js.stub +25 -0
  15. package/bin/migrations/stubs/migration.update-ts.stub +22 -0
  16. package/bin/stubs/arquebus.config-js.stub +25 -0
  17. package/bin/stubs/arquebus.config-ts.stub +24 -0
  18. package/bin/stubs/model-js.stub +5 -0
  19. package/bin/stubs/model-ts.stub +5 -0
  20. package/dist/browser/index.cjs +116 -96
  21. package/dist/browser/index.d.cts +1205 -165
  22. package/dist/browser/index.d.ts +1205 -165
  23. package/dist/browser/index.js +114 -95
  24. package/dist/index.d.ts +1279 -347
  25. package/dist/index.js +3757 -3546
  26. package/package.json +24 -9
  27. package/src/migrations/stubs/migration-js.stub +21 -0
  28. package/src/migrations/stubs/migration-ts.stub +18 -0
  29. package/src/migrations/stubs/migration.create-js.stub +24 -0
  30. package/src/migrations/stubs/migration.create-ts.stub +21 -0
  31. package/src/migrations/stubs/migration.update-js.stub +25 -0
  32. package/src/migrations/stubs/migration.update-ts.stub +22 -0
  33. package/src/stubs/arquebus.config-js.stub +25 -0
  34. package/src/stubs/arquebus.config-ts.stub +24 -0
  35. package/src/stubs/model-js.stub +5 -0
  36. package/src/stubs/model-ts.stub +5 -0
  37. package/dist/index.d.cts +0 -457
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@h3ravel/arquebus",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
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.net/arquebus",
6
6
  "bin": {
7
- "arquebus": "./bin/cli.js"
7
+ "arquebus": "./bin/index.js"
8
8
  },
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -15,17 +15,29 @@
15
15
  "types": "./dist/index.d.ts",
16
16
  "files": [
17
17
  "dist",
18
- "bin"
18
+ "bin",
19
+ "src/stubs",
20
+ "src/migrations/stubs"
19
21
  ],
20
22
  "exports": {
21
23
  ".": {
24
+ "cli": {
25
+ "import": {
26
+ "types": "./bin/index.d.ts",
27
+ "default": "./bin/index.js"
28
+ },
29
+ "require": {
30
+ "types": "./bin/index.d.cts",
31
+ "default": "./bin/index.cjs"
32
+ }
33
+ },
22
34
  "worker": {
23
35
  "import": {
24
36
  "types": "./dist/index.d.ts",
25
37
  "default": "./dist/index.js"
26
38
  },
27
39
  "require": {
28
- "types": "./dist/index.d.ts",
40
+ "types": "./dist/index.d.cts",
29
41
  "default": "./dist/index.cjs"
30
42
  }
31
43
  },
@@ -35,7 +47,7 @@
35
47
  "default": "./dist/index.js"
36
48
  },
37
49
  "require": {
38
- "types": "./dist/index.d.ts",
50
+ "types": "./dist/index.d.cts",
39
51
  "default": "./dist/index.cjs"
40
52
  }
41
53
  },
@@ -45,7 +57,7 @@
45
57
  "default": "./dist/browser/index.js"
46
58
  },
47
59
  "require": {
48
- "types": "./dist/browser/index.d.ts",
60
+ "types": "./dist/browser/index.d.cts",
49
61
  "default": "./dist/browser/index.cjs"
50
62
  }
51
63
  },
@@ -55,7 +67,7 @@
55
67
  "default": "./dist/index.js"
56
68
  },
57
69
  "require": {
58
- "types": "./dist/index.d.ts",
70
+ "types": "./dist/index.d.cts",
59
71
  "default": "./dist/index.cjs"
60
72
  }
61
73
  }
@@ -66,7 +78,7 @@
66
78
  "default": "./dist/browser/index.js"
67
79
  },
68
80
  "require": {
69
- "types": "./dist/browser/index.d.ts",
81
+ "types": "./dist/browser/index.d.cts",
70
82
  "default": "./dist/browser/index.cjs"
71
83
  }
72
84
  },
@@ -92,8 +104,8 @@
92
104
  ]
93
105
  },
94
106
  "dependencies": {
107
+ "chalk": "^5.6.0",
95
108
  "collect.js": "^4.36.1",
96
- "colorette": "^2.0.20",
97
109
  "commander": "^11.1.0",
98
110
  "dayjs": "^1.11.13",
99
111
  "dotenv": "^17.2.1",
@@ -121,6 +133,7 @@
121
133
  "tedious": "15.1.0",
122
134
  "ts-node": "^10.9.2",
123
135
  "tsup": "^8.5.0",
136
+ "tsx": "^4.20.4",
124
137
  "typescript": "^5.9.2",
125
138
  "typescript-eslint": "^8.40.0",
126
139
  "vite-tsconfig-paths": "^5.1.4",
@@ -143,6 +156,8 @@
143
156
  "scripts": {
144
157
  "build": "tsup",
145
158
  "lint": "eslint . --ext .ts",
159
+ "cmd": "cross-env TEST=true tsx --experimental-specifier-resolution=node src/cli",
160
+ "cmd:watch": "cross-env TEST=true tsx watch --experimental-specifier-resolution=node src/cli",
146
161
  "test:mysql": "cross-env DB=mysql vitest --project node",
147
162
  "test:postgres": "cross-env DB=postgres vitest --project node",
148
163
  "test:sqlite": "cross-env DB=sqlite vitest --project node",
@@ -0,0 +1,21 @@
1
+ import { Migration } from '@h3ravel/arquebus'
2
+
3
+ export default class extends Migration {
4
+ /**
5
+ * Run the migrations.
6
+ *
7
+ * @param {(import('@h3ravel/arquebus/types/query-builder').SchemaBuilder)} schema
8
+ */
9
+ async up(schema) {
10
+ //
11
+ }
12
+
13
+ /**
14
+ * Reverse the migrations.
15
+ *
16
+ * @param {(import('@h3ravel/arquebus/types/query-builder').SchemaBuilder)} schema
17
+ */
18
+ async down(schema) {
19
+ //
20
+ }
21
+ };
@@ -0,0 +1,18 @@
1
+ import { Migration } from '@h3ravel/arquebus'
2
+ import { SchemaBuilder } from '@h3ravel/arquebus/types/query-builder';
3
+
4
+ export default class extends Migration {
5
+ /**
6
+ * Run the migrations.
7
+ */
8
+ async up (schema: SchemaBuilder) {
9
+ //
10
+ }
11
+
12
+ /**
13
+ * Reverse the migrations.
14
+ */
15
+ async down (schema: SchemaBuilder) {
16
+ //
17
+ }
18
+ };
@@ -0,0 +1,24 @@
1
+ import { Migration } from '@h3ravel/arquebus'
2
+
3
+ export default class extends Migration {
4
+ /**
5
+ * Run the migrations.
6
+ *
7
+ * @param {(import('@h3ravel/arquebus/types/query-builder').SchemaBuilder)} schema
8
+ */
9
+ async up(schema) {
10
+ await schema.createTable('{{ table }}', (table) => {
11
+ table.increments('id');
12
+ table.timestamps();
13
+ });
14
+ }
15
+
16
+ /**
17
+ * Reverse the migrations.
18
+ *
19
+ * @param {(import('@h3ravel/arquebus/types/query-builder').SchemaBuilder)} schema
20
+ */
21
+ async down(schema) {
22
+ await schema.dropTableIfExists('{{ table }}');
23
+ }
24
+ };
@@ -0,0 +1,21 @@
1
+ import { Migration } from '@h3ravel/arquebus'
2
+ import { SchemaBuilder } from '@h3ravel/arquebus/types/query-builder';
3
+
4
+ export default class extends Migration {
5
+ /**
6
+ * Run the migrations.
7
+ */
8
+ async up(schema: SchemaBuilder) {
9
+ await schema.createTable('{{ table }}', (table) => {
10
+ table.increments('id');
11
+ table.timestamps();
12
+ });
13
+ }
14
+
15
+ /**
16
+ * Reverse the migrations.
17
+ */
18
+ async down(schema: SchemaBuilder) {
19
+ await schema.dropTableIfExists('{{ table }}');
20
+ }
21
+ };
@@ -0,0 +1,25 @@
1
+ import { Migration } from '@h3ravel/arquebus'
2
+
3
+ export default class extends Migration {
4
+ /**
5
+ * Run the migrations.
6
+ *
7
+ * @param {(import('@h3ravel/arquebus/types/query-builder').SchemaBuilder)} schema
8
+ */
9
+ async up(schema) {
10
+ await schema.table('{{ table }}', (table) => {
11
+ //
12
+ });
13
+ }
14
+
15
+ /**
16
+ * Reverse the migrations.
17
+ *
18
+ * @param {(import('@h3ravel/arquebus/types/query-builder').SchemaBuilder)} schema
19
+ */
20
+ async down(schema) {
21
+ await schema.table('{{ table }}', (table) => {
22
+ //
23
+ });
24
+ }
25
+ };
@@ -0,0 +1,22 @@
1
+ import { Migration } from '@h3ravel/arquebus'
2
+ import { SchemaBuilder } from '@h3ravel/arquebus/types/query-builder';
3
+
4
+ export default class extends Migration {
5
+ /**
6
+ * Run the migrations.
7
+ */
8
+ async up(schema: SchemaBuilder) {
9
+ await schema.table('{{ table }}', (table) => {
10
+ //
11
+ });
12
+ }
13
+
14
+ /**
15
+ * Reverse the migrations.
16
+ */
17
+ async down(schema: SchemaBuilder) {
18
+ await schema.table('{{ table }}', (table) => {
19
+ //
20
+ });
21
+ }
22
+ };
@@ -0,0 +1,25 @@
1
+ import { defineConfig } from '@h3ravel/arquebus'
2
+
3
+ export default defineConfig({
4
+ client: 'mysql2',
5
+ connection: {
6
+ host: 'localhost',
7
+ database: 'database',
8
+ user: 'user',
9
+ password: 'password'
10
+ },
11
+ migrations: {
12
+ table: 'migrations',
13
+ path: './migrations',
14
+ },
15
+ factories: {
16
+ path: './factories',
17
+ },
18
+ seeders: {
19
+ path: './seeders',
20
+ },
21
+ models: {
22
+ path: './models'
23
+ }
24
+ })
25
+
@@ -0,0 +1,24 @@
1
+ import { defineConfig } from '@h3ravel/arquebus'
2
+
3
+ export default defineConfig({
4
+ client: 'mysql2',
5
+ connection: {
6
+ host: 'localhost',
7
+ database: 'database',
8
+ user: 'user',
9
+ password: 'password'
10
+ },
11
+ migrations: {
12
+ table: 'migrations',
13
+ path: './migrations',
14
+ },
15
+ factories: {
16
+ path: './factories',
17
+ },
18
+ seeders: {
19
+ path: './seeders',
20
+ },
21
+ models: {
22
+ path: './models'
23
+ }
24
+ })
@@ -0,0 +1,5 @@
1
+ import { Model } from '@h3ravel/arquebus'
2
+
3
+ export default class {{ name }} extends Model {
4
+ //
5
+ }
@@ -0,0 +1,5 @@
1
+ import { Model } from '@h3ravel/arquebus'
2
+
3
+ export default class {{ name }} extends Model {
4
+ //
5
+ }