@storecraft/database-sqlite 1.0.2 → 1.0.4

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