@h3ravel/arquebus 0.1.6 → 0.2.1
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/.gitkeep +0 -0
- package/bin/cli.cjs +4942 -0
- package/bin/cli.d.cts +18 -0
- package/bin/cli.d.ts +18 -0
- package/bin/cli.js +4887 -183
- package/bin/index.cjs +1 -0
- package/bin/index.d.cts +2 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +1 -0
- package/bin/migrations/stubs/migration-js.stub +21 -0
- package/bin/migrations/stubs/migration-ts.stub +18 -0
- package/bin/migrations/stubs/migration.create-js.stub +24 -0
- package/bin/migrations/stubs/migration.create-ts.stub +21 -0
- package/bin/migrations/stubs/migration.update-js.stub +25 -0
- package/bin/migrations/stubs/migration.update-ts.stub +22 -0
- package/bin/stubs/arquebus.config-js.stub +25 -0
- package/bin/stubs/arquebus.config-ts.stub +24 -0
- package/bin/stubs/model-js.stub +5 -0
- package/bin/stubs/model-ts.stub +5 -0
- package/dist/browser/index.cjs +1 -1404
- package/dist/browser/index.d.cts +1263 -164
- package/dist/browser/index.d.ts +1263 -164
- package/dist/browser/index.js +1 -1340
- package/dist/index.cjs +1 -4584
- package/dist/index.d.cts +1337 -345
- package/dist/index.d.ts +1337 -345
- package/dist/index.js +1 -4512
- package/package.json +27 -10
- package/src/migrations/stubs/migration-js.stub +21 -0
- package/src/migrations/stubs/migration-ts.stub +18 -0
- package/src/migrations/stubs/migration.create-js.stub +24 -0
- package/src/migrations/stubs/migration.create-ts.stub +21 -0
- package/src/migrations/stubs/migration.update-js.stub +25 -0
- package/src/migrations/stubs/migration.update-ts.stub +22 -0
- package/src/stubs/arquebus.config-js.stub +25 -0
- package/src/stubs/arquebus.config-ts.stub +24 -0
- package/src/stubs/model-js.stub +5 -0
- package/src/stubs/model-ts.stub +5 -0
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/arquebus",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
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/
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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",
|
|
@@ -109,6 +121,7 @@
|
|
|
109
121
|
"@types/pluralize": "^0.0.33",
|
|
110
122
|
"@typescript-eslint/eslint-plugin": "^8.40.0",
|
|
111
123
|
"@typescript-eslint/parser": "^8.40.0",
|
|
124
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
112
125
|
"cross-env": "^7.0.3",
|
|
113
126
|
"eslint": "^9.33.0",
|
|
114
127
|
"husky": "^8.0.3",
|
|
@@ -119,8 +132,10 @@
|
|
|
119
132
|
"prettier": "2.6.2",
|
|
120
133
|
"sqlite3": "5.1.7",
|
|
121
134
|
"tedious": "15.1.0",
|
|
135
|
+
"terser": "^5.43.1",
|
|
122
136
|
"ts-node": "^10.9.2",
|
|
123
137
|
"tsup": "^8.5.0",
|
|
138
|
+
"tsx": "^4.20.4",
|
|
124
139
|
"typescript": "^5.9.2",
|
|
125
140
|
"typescript-eslint": "^8.40.0",
|
|
126
141
|
"vite-tsconfig-paths": "^5.1.4",
|
|
@@ -141,8 +156,10 @@
|
|
|
141
156
|
"readmeFilename": "README.md",
|
|
142
157
|
"license": "MIT",
|
|
143
158
|
"scripts": {
|
|
144
|
-
"build": "tsup",
|
|
159
|
+
"build": "tsup --minify terser",
|
|
145
160
|
"lint": "eslint . --ext .ts",
|
|
161
|
+
"cmd": "cross-env TEST=true tsx --experimental-specifier-resolution=node src/cli",
|
|
162
|
+
"cmd:watch": "cross-env TEST=true tsx watch --experimental-specifier-resolution=node src/cli",
|
|
146
163
|
"test:mysql": "cross-env DB=mysql vitest --project node",
|
|
147
164
|
"test:postgres": "cross-env DB=postgres vitest --project node",
|
|
148
165
|
"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
|
+
})
|