@ghom/orm 1.3.1 → 1.3.3
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/dist/typings/index.d.ts +0 -8
- package/package.json +6 -6
- package/src/index.ts +0 -12
- package/tests/tables/a.js +2 -2
- package/tests/tables/b.js +3 -3
- package/tests/tables/c.js +2 -2
- package/tests/test.js +11 -7
package/dist/typings/index.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
export * from "./app/orm.js";
|
|
2
2
|
export * from "./app/table.js";
|
|
3
|
-
declare module "@ghom/orm/esm" {
|
|
4
|
-
export * from "./app/orm.js";
|
|
5
|
-
export * from "./app/table.js";
|
|
6
|
-
}
|
|
7
|
-
declare module "@ghom/orm/cjs" {
|
|
8
|
-
export * from "./app/orm.js";
|
|
9
|
-
export * from "./app/table.js";
|
|
10
|
-
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghom/orm",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/typings/index.d.ts",
|
|
8
8
|
"description": "TypeScript KnexJS ORM & handler",
|
|
9
9
|
"prettier": {
|
|
10
10
|
"semi": false
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"import": "./dist/esm/index.js",
|
|
14
|
+
"require": "./dist/cjs/index.js"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"format": "prettier --write src tsconfig.*",
|
|
18
18
|
"build": "rm -fr dist/* && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json && fixup.sh",
|
|
19
|
-
"test": "npm run build && jest tests/test.js --detectOpenHandles",
|
|
19
|
+
"test": "npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js tests/test.js --detectOpenHandles",
|
|
20
20
|
"prepublishOnly": "npm run format && npm test"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
1
|
export * from "./app/orm.js"
|
|
2
2
|
export * from "./app/table.js"
|
|
3
|
-
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
declare module "@ghom/orm/esm" {
|
|
6
|
-
export * from "./app/orm.js"
|
|
7
|
-
export * from "./app/table.js"
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
declare module "@ghom/orm/cjs" {
|
|
12
|
-
export * from "./app/orm.js"
|
|
13
|
-
export * from "./app/table.js"
|
|
14
|
-
}
|
package/tests/tables/a.js
CHANGED
package/tests/tables/b.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Table } from "../.."
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default new Table({
|
|
4
4
|
name: "b",
|
|
5
5
|
migrations: {
|
|
6
6
|
0: (table) =>
|
|
@@ -9,7 +9,7 @@ module.exports = new Table({
|
|
|
9
9
|
.references("id")
|
|
10
10
|
.inTable("c")
|
|
11
11
|
.onDelete("cascade")
|
|
12
|
-
.notNullable()
|
|
12
|
+
.notNullable()
|
|
13
13
|
},
|
|
14
14
|
priority: 1,
|
|
15
15
|
setup(table) {
|
package/tests/tables/c.js
CHANGED
package/tests/test.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import dotenv from "dotenv"
|
|
2
|
+
import path from "path"
|
|
3
|
+
|
|
4
|
+
dotenv.config({ path: "./.env" })
|
|
5
|
+
|
|
6
|
+
import { ORM } from "../"
|
|
7
|
+
|
|
8
|
+
import a from "./tables/a"
|
|
9
|
+
import b from "./tables/b"
|
|
10
|
+
import c from "./tables/c"
|
|
7
11
|
|
|
8
12
|
const orm = new ORM({
|
|
9
|
-
tablePath: path.join(
|
|
13
|
+
tablePath: path.join("tests","tables"),
|
|
10
14
|
logger: console,
|
|
11
15
|
})
|
|
12
16
|
|