@casekit/orm 0.0.1-alpha.0 → 0.0.1-alpha.2
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/.github/actions/ci-setup/action.yml +1 -0
- package/.github/workflows/ci.yml +25 -0
- package/lib/schema/types/loose/LooseRelationsDefinition.d.ts +3 -1
- package/lib/schema/types/loose/LooseRelationsDefinition.d.ts.map +1 -1
- package/lib/schema/types/loose/LooseRelationsDefinitions.d.ts +1 -1
- package/lib/schema/types/loose/LooseRelationsDefinitions.d.ts.map +1 -1
- package/lib/test/db/models/post.model.d.ts +1 -1
- package/lib/test/db/models/tenant.model.d.ts +2 -2
- package/lib/test/db/models/tenantUser.model.d.ts +2 -2
- package/lib/test/db/models/user.model.d.ts +2 -2
- package/package.json +2 -2
- package/src/schema/types/loose/LooseRelationsDefinition.ts +6 -1
- package/src/schema/types/loose/LooseRelationsDefinitions.ts +1 -1
- package/src/test/db/models/foo.relations.ts +1 -1
- package/src/test/db/models/post.model.ts +1 -1
- package/src/test/db/models/post.relations.ts +1 -1
- package/src/test/db/models/tenant.model.ts +1 -1
- package/src/test/db/models/tenant.relations.ts +1 -1
- package/src/test/db/models/tenantUser.model.ts +1 -1
- package/src/test/db/models/tenantUser.relations.ts +1 -1
- package/src/test/db/models/user.model.ts +1 -1
- package/src/test/db/models/user.relations.ts +1 -1
package/.github/workflows/ci.yml
CHANGED
|
@@ -74,6 +74,31 @@ jobs:
|
|
|
74
74
|
- name: Prettier
|
|
75
75
|
run: pnpm prettier
|
|
76
76
|
|
|
77
|
+
publish:
|
|
78
|
+
name: "🔥 Publish"
|
|
79
|
+
needs: [test, typecheck, lint, prettier]
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
82
|
+
steps:
|
|
83
|
+
- uses: actions/checkout@v4
|
|
84
|
+
- name: Set up Git config
|
|
85
|
+
run: |
|
|
86
|
+
git config user.name "$(git log -n 1 --pretty=format:%an)"
|
|
87
|
+
git config user.email "$(git log -n 1 --pretty=format:%ae)"
|
|
88
|
+
- uses: ./.github/actions/ci-setup
|
|
89
|
+
- name: Build
|
|
90
|
+
run: pnpm build
|
|
91
|
+
- name: Version
|
|
92
|
+
run: pnpm version prerelease --preid=alpha
|
|
93
|
+
- name: Publish
|
|
94
|
+
run: pnpm publish
|
|
95
|
+
env:
|
|
96
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
97
|
+
- name: Push
|
|
98
|
+
run: git push
|
|
99
|
+
- name: Push tag
|
|
100
|
+
run: git push --tags
|
|
101
|
+
|
|
77
102
|
dependabot:
|
|
78
103
|
name: "🤖 Dependabot"
|
|
79
104
|
needs: [test, typecheck, lint, prettier]
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ModelName } from "../helpers/ModelName";
|
|
2
|
+
import { LooseModelDefinitions } from "./LooseModelDefinitions";
|
|
1
3
|
import { LooseRelationDefinition } from "./LooseRelationDefinition";
|
|
2
|
-
export type LooseRelationsDefinition = Record<string, LooseRelationDefinition>;
|
|
4
|
+
export type LooseRelationsDefinition<Models extends LooseModelDefinitions, _M extends ModelName<Models>> = Record<string, LooseRelationDefinition>;
|
|
3
5
|
//# sourceMappingURL=LooseRelationsDefinition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LooseRelationsDefinition.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/loose/LooseRelationsDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"LooseRelationsDefinition.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/loose/LooseRelationsDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,MAAM,wBAAwB,CAChC,MAAM,SAAS,qBAAqB,EACpC,EAAE,SAAS,SAAS,CAAC,MAAM,CAAC,IAC5B,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC"}
|
|
@@ -2,6 +2,6 @@ import { ModelName } from "../helpers/ModelName";
|
|
|
2
2
|
import { LooseModelDefinitions } from "./LooseModelDefinitions";
|
|
3
3
|
import { LooseRelationsDefinition } from "./LooseRelationsDefinition";
|
|
4
4
|
export type LooseRelationsDefinitions<Models extends LooseModelDefinitions> = {
|
|
5
|
-
[M in ModelName<Models>]?: LooseRelationsDefinition
|
|
5
|
+
[M in ModelName<Models>]?: LooseRelationsDefinition<Models, M>;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=LooseRelationsDefinitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LooseRelationsDefinitions.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/loose/LooseRelationsDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,MAAM,yBAAyB,CAAC,MAAM,SAAS,qBAAqB,IAAI;KACzE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,wBAAwB;
|
|
1
|
+
{"version":3,"file":"LooseRelationsDefinitions.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/loose/LooseRelationsDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,MAAM,yBAAyB,CAAC,MAAM,SAAS,qBAAqB,IAAI;KACzE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,wBAAwB,CAAC,MAAM,EAAE,CAAC,CAAC;CACjE,CAAC"}
|
|
@@ -2,7 +2,7 @@ export declare const tenant: {
|
|
|
2
2
|
readonly columns: {
|
|
3
3
|
readonly id: {
|
|
4
4
|
readonly type: "uuid";
|
|
5
|
-
readonly default: import("
|
|
5
|
+
readonly default: import("../../..").SQLStatement;
|
|
6
6
|
readonly primaryKey: true;
|
|
7
7
|
};
|
|
8
8
|
readonly name: {
|
|
@@ -10,7 +10,7 @@ export declare const tenant: {
|
|
|
10
10
|
};
|
|
11
11
|
readonly createdAt: {
|
|
12
12
|
readonly type: "timestamp";
|
|
13
|
-
readonly default: import("
|
|
13
|
+
readonly default: import("../../..").SQLStatement;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
};
|
|
@@ -3,7 +3,7 @@ export declare const tenantUser: {
|
|
|
3
3
|
readonly columns: {
|
|
4
4
|
readonly id: {
|
|
5
5
|
readonly type: "uuid";
|
|
6
|
-
readonly default: import("
|
|
6
|
+
readonly default: import("../../..").SQLStatement;
|
|
7
7
|
readonly primaryKey: true;
|
|
8
8
|
};
|
|
9
9
|
readonly tenantId: {
|
|
@@ -22,7 +22,7 @@ export declare const tenantUser: {
|
|
|
22
22
|
};
|
|
23
23
|
readonly createdAt: {
|
|
24
24
|
readonly type: "timestamp with time zone";
|
|
25
|
-
readonly default: import("
|
|
25
|
+
readonly default: import("../../..").SQLStatement;
|
|
26
26
|
};
|
|
27
27
|
readonly deletedAt: {
|
|
28
28
|
readonly type: "timestamp with time zone";
|
|
@@ -3,7 +3,7 @@ export declare const user: {
|
|
|
3
3
|
readonly columns: {
|
|
4
4
|
readonly id: {
|
|
5
5
|
readonly type: "uuid";
|
|
6
|
-
readonly default: import("
|
|
6
|
+
readonly default: import("../../..").SQLStatement;
|
|
7
7
|
};
|
|
8
8
|
readonly username: {
|
|
9
9
|
readonly zodSchema: z.ZodString;
|
|
@@ -28,7 +28,7 @@ export declare const user: {
|
|
|
28
28
|
readonly primaryKey: ["id"];
|
|
29
29
|
readonly uniqueConstraints: [{
|
|
30
30
|
readonly columns: ["username"];
|
|
31
|
-
readonly where: import("
|
|
31
|
+
readonly where: import("../../..").SQLStatement;
|
|
32
32
|
}];
|
|
33
33
|
};
|
|
34
34
|
//# sourceMappingURL=user.model.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@casekit/orm",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.2",
|
|
4
4
|
"description": "A simple ORM",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
|
|
51
51
|
"prettier": "prettier -c src",
|
|
52
52
|
"prettier:write": "prettier -w src",
|
|
53
|
-
"release": "pnpm build && pnpm version --prerelease --preid=
|
|
53
|
+
"release": "pnpm build && pnpm version --prerelease --preid=alpha && pnpm publish",
|
|
54
54
|
"test": "vitest --typecheck",
|
|
55
55
|
"test:coverage": "vitest --typecheck --coverage",
|
|
56
56
|
"typecheck": "tsc --noEmit"
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { ModelName } from "../helpers/ModelName";
|
|
2
|
+
import { LooseModelDefinitions } from "./LooseModelDefinitions";
|
|
1
3
|
import { LooseRelationDefinition } from "./LooseRelationDefinition";
|
|
2
4
|
|
|
3
|
-
export type LooseRelationsDefinition
|
|
5
|
+
export type LooseRelationsDefinition<
|
|
6
|
+
Models extends LooseModelDefinitions,
|
|
7
|
+
_M extends ModelName<Models>,
|
|
8
|
+
> = Record<string, LooseRelationDefinition>;
|
|
@@ -3,5 +3,5 @@ import { LooseModelDefinitions } from "./LooseModelDefinitions";
|
|
|
3
3
|
import { LooseRelationsDefinition } from "./LooseRelationsDefinition";
|
|
4
4
|
|
|
5
5
|
export type LooseRelationsDefinitions<Models extends LooseModelDefinitions> = {
|
|
6
|
-
[M in ModelName<Models>]?: LooseRelationsDefinition
|
|
6
|
+
[M in ModelName<Models>]?: LooseRelationsDefinition<Models, M>;
|
|
7
7
|
};
|