@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.
@@ -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.1",
3
+ "version": "1.3.3",
4
4
  "license": "MIT",
5
- "main": "dist/cjs/index.js",
6
- "module": "dist/esm/index.js",
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
- "./esm": "./dist/esm/index.js",
14
- "./cjs": "./dist/cjs/index.js"
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
@@ -1,6 +1,6 @@
1
- const { Table } = require("../..")
1
+ import { Table } from "../.."
2
2
 
3
- module.exports = new Table({
3
+ export default new Table({
4
4
  name: "a",
5
5
  priority: 0,
6
6
  setup(table) {
package/tests/tables/b.js CHANGED
@@ -1,6 +1,6 @@
1
- const { Table } = require("../..")
1
+ import { Table } from "../.."
2
2
 
3
- module.exports = new Table({
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
@@ -1,6 +1,6 @@
1
- const { Table } = require("../..")
1
+ import { Table } from "../.."
2
2
 
3
- module.exports = new Table({
3
+ export default new Table({
4
4
  name: "c",
5
5
  priority: 2,
6
6
  setup(table) {
package/tests/test.js CHANGED
@@ -1,12 +1,16 @@
1
- require("dotenv").config({ path: "./.env" })
2
- const path = require("path")
3
- const { ORM } = require("..")
4
- const a = require("./tables/a")
5
- const b = require("./tables/b")
6
- const c = require("./tables/c")
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(__dirname, "tables"),
13
+ tablePath: path.join("tests","tables"),
10
14
  logger: console,
11
15
  })
12
16