@storecraft/database-postgres 1.0.1 → 1.0.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/README.md CHANGED
@@ -16,12 +16,11 @@ npm i @storecraft/database-postgres
16
16
  ```js
17
17
  import 'dotenv/config';
18
18
  import http from "node:http";
19
-
20
19
  import { App } from '@storecraft/core'
21
- import { NodePlatform } from '@storecraft/platforms/node';
20
+ import { NodePlatform } from '@storecraft/core/platform/node';
21
+ import { NodeLocalStorage } from '@storecraft/core/storage/node'
22
22
  import { Postgres } from '@storecraft/database-postgres';
23
23
  import { migrateToLatest } from '@storecraft/database-sql-base/migrate.js'
24
- import { NodeLocalStorage } from '@storecraft/storage-local/node'
25
24
 
26
25
  const app = new App(
27
26
  {
@@ -41,7 +40,7 @@ const app = new App(
41
40
  }
42
41
  })
43
42
  )
44
- .withStorage(new NodeLocalStorage(join(homedir(), 'tomer')))
43
+ .withStorage(new NodeLocalStorage('storage'))
45
44
 
46
45
  await app.init();
47
46
  await migrateToLatest(app.db, false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storecraft/database-postgres",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Official Postgres Database driver for storecraft",
5
5
  "license": "MIT",
6
6
  "author": "Tomer Shalev (https://github.com/store-craft)",
@@ -29,8 +29,6 @@
29
29
  "pg": "^8.11.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@storecraft/platforms": "^1.0.0",
33
- "@storecraft/test-runner": "^1.0.0",
34
32
  "@types/pg": "^8.11.2",
35
33
  "@types/node": "^20.11.0",
36
34
  "dotenv": "^16.3.1",
@@ -1,8 +1,8 @@
1
1
  import { App } from '@storecraft/core';
2
2
  import { Postgres } from '@storecraft/database-postgres';
3
3
  import { migrateToLatest } from '@storecraft/database-sql-base/migrate.js';
4
- import { NodePlatform } from '@storecraft/platforms/node';
5
- import { api_index } from '@storecraft/test-runner'
4
+ import { NodePlatform } from '@storecraft/core/platform/node';
5
+ import { api } from '@storecraft/core/test-runner'
6
6
 
7
7
  export const create_app = async () => {
8
8
 
@@ -34,63 +34,14 @@ export const create_app = async () => {
34
34
  async function test() {
35
35
  const app = await create_app();
36
36
 
37
- Object.entries(api_index).slice(0, -1).forEach(
37
+ Object.entries(api).slice(0, -1).forEach(
38
38
  ([name, runner]) => {
39
39
  runner.create(app).run();
40
40
  }
41
41
  );
42
- const last_test = Object.values(api_index).at(-1).create(app);
42
+ const last_test = Object.values(api).at(-1).create(app);
43
43
  last_test.after(async () => { await app.db.disconnect() });
44
44
  last_test.run();
45
45
  }
46
46
 
47
47
  test();
48
-
49
- async function test2() {
50
- const app = await create_app();
51
-
52
- api_index.api_auth_test.create(app).run();
53
-
54
- api_index.api_tags_crud_test.create(app).run();
55
- api_index.api_tags_list_test.create(app).run();
56
-
57
- api_index.api_collections_crud_test.create(app).run();
58
- api_index.api_collections_list_test.create(app).run();
59
- api_index.api_collections_products_test.create(app).run();
60
-
61
- api_index.api_products_crud_test.create(app).run();
62
- api_index.api_products_collections_test.create(app).run();
63
- api_index.api_products_list_test.create(app).run();
64
- api_index.api_products_discounts_test.create(app).run();
65
- api_index.api_products_variants_test.create(app).run();
66
-
67
- api_index.api_shipping_crud_test.create(app).run();
68
- api_index.api_shipping_list_test.create(app).run();
69
-
70
- api_index.api_posts_crud_test.create(app).run();
71
- api_index.api_posts_list_test.create(app).run();
72
-
73
- api_index.api_customers_crud_test.create(app).run();
74
- api_index.api_customers_list_test.create(app).run();
75
-
76
- api_index.api_orders_crud_test.create(app).run();
77
- api_index.api_orders_list_test.create(app).run();
78
-
79
- api_index.api_storefronts_crud_test.create(app).run();
80
- api_index.api_storefronts_list_test.create(app).run();
81
- api_index.api_storefronts_all_connections_test.create(app).run();
82
-
83
- api_index.api_notifications_crud_test.create(app).run();
84
- api_index.api_notifications_list_test.create(app).run();
85
-
86
- api_index.api_images_crud_test.create(app).run();
87
- api_index.api_images_list_test.create(app).run();
88
-
89
- api_index.api_discounts_crud_test.create(app).run();
90
- api_index.api_discounts_list_test.create(app).run();
91
- api_index.api_discounts_products_test.create(app).run();
92
-
93
-
94
- }
95
-
96
- // test2();
File without changes