@deessejs/collections 0.0.29 → 0.0.30

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.
@@ -0,0 +1,31 @@
1
+ import { Collection } from "../collections/types";
2
+ import { FieldKind } from "../fields";
3
+ export declare const DrizzleTypes: Record<FieldKind, () => any>;
4
+ export declare const toDrizzle: (collection: Collection) => import("drizzle-orm/pg-core").PgTableWithColumns<{
5
+ name: string;
6
+ schema: undefined;
7
+ columns: {
8
+ [x: string]: import("drizzle-orm/pg-core").PgColumn<{
9
+ name: any;
10
+ tableName: string;
11
+ dataType: any;
12
+ columnType: any;
13
+ data: any;
14
+ driverParam: any;
15
+ notNull: false;
16
+ hasDefault: false;
17
+ isPrimaryKey: false;
18
+ isAutoincrement: false;
19
+ hasRuntimeDefault: false;
20
+ enumValues: any;
21
+ baseColumn: never;
22
+ identity: undefined;
23
+ generated: undefined;
24
+ }, {}, {
25
+ [x: string]: any;
26
+ [x: number]: any;
27
+ [x: symbol]: any;
28
+ }>;
29
+ };
30
+ dialect: "pg";
31
+ }>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toDrizzle = exports.DrizzleTypes = void 0;
4
+ const pg_core_1 = require("drizzle-orm/pg-core");
5
+ exports.DrizzleTypes = {
6
+ boolean: () => (0, pg_core_1.boolean)(),
7
+ integer: () => (0, pg_core_1.integer)(),
8
+ serial: () => (0, pg_core_1.serial)(),
9
+ text: () => (0, pg_core_1.text)(),
10
+ varchar: () => (0, pg_core_1.varchar)(),
11
+ char: () => (0, pg_core_1.char)(),
12
+ numeric: () => (0, pg_core_1.numeric)(),
13
+ decimal: () => (0, pg_core_1.decimal)(),
14
+ json: () => (0, pg_core_1.json)(),
15
+ uuid: () => (0, pg_core_1.uuid)(),
16
+ timestamp: () => (0, pg_core_1.timestamp)(),
17
+ };
18
+ const toDrizzle = (collection) => {
19
+ return (0, pg_core_1.pgTable)(collection.slug, Object.fromEntries(Object.entries(collection.fields).map(([name, field]) => {
20
+ const kind = field.type.dsl.kind;
21
+ return [name, exports.DrizzleTypes[kind]()];
22
+ })));
23
+ };
24
+ exports.toDrizzle = toDrizzle;
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
package/dist/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export * from "./fields";
4
4
  export * from "./providers";
5
5
  export * from "./plugins";
6
6
  export * from "./dsl";
7
+ export * from "./drizzle";
package/dist/index.js CHANGED
@@ -20,3 +20,4 @@ __exportStar(require("./fields"), exports);
20
20
  __exportStar(require("./providers"), exports);
21
21
  __exportStar(require("./plugins"), exports);
22
22
  __exportStar(require("./dsl"), exports);
23
+ __exportStar(require("./drizzle"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deessejs/collections",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -40,23 +40,31 @@
40
40
  },
41
41
  "homepage": "https://github.com/Developers-Secrets-Inc/collections#readme",
42
42
  "devDependencies": {
43
- "zod": "^4.1.12",
44
43
  "@testing-library/dom": "^10.4.1",
45
44
  "@testing-library/user-event": "^14.6.1",
46
45
  "@types/jsdom": "^27.0.0",
47
46
  "@types/node": "^20.0.0",
47
+ "@types/pg": "^8.15.6",
48
48
  "@types/sinon": "^21.0.0",
49
49
  "@typescript-eslint/eslint-plugin": "^6.0.0",
50
50
  "@typescript-eslint/parser": "^6.0.0",
51
51
  "@vitest/coverage-v8": "^4.0.13",
52
52
  "@vitest/ui": "^4.0.13",
53
+ "drizzle-kit": "^0.31.8",
53
54
  "eslint": "^8.0.0",
54
55
  "jsdom": "^27.2.0",
55
56
  "sinon": "^21.0.0",
57
+ "tsx": "^4.21.0",
56
58
  "typescript": "^5.0.0",
57
- "vitest": "^4.0.13"
59
+ "vitest": "^4.0.13",
60
+ "zod": "^4.1.12"
58
61
  },
59
62
  "peerDependencies": {
60
63
  "zod": "^4.1.12"
64
+ },
65
+ "dependencies": {
66
+ "dotenv": "^17.2.3",
67
+ "drizzle-orm": "^0.45.0",
68
+ "pg": "^8.16.3"
61
69
  }
62
70
  }