@storecraft/database-planetscale 1.0.0 → 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
@@ -2,13 +2,13 @@
2
2
 
3
3
  <div style="text-align:center">
4
4
  <img src='https://storecraft.app/storecraft-color.svg'
5
- width='90%'' />
5
+ width='90%' />
6
6
  </div><hr/><br/>
7
7
 
8
8
  Official `Planetscale` (cloud MySql) driver for `StoreCraft` on any platforms.
9
9
 
10
10
  ```bash
11
- npm i @storecraft/database-neon
11
+ npm i @storecraft/database-planetscale
12
12
  ```
13
13
 
14
14
  ## Setup
@@ -23,14 +23,11 @@ npm i @storecraft/database-neon
23
23
  ```js
24
24
  import 'dotenv/config';
25
25
  import http from "node:http";
26
- import { join } from "node:path";
27
- import { homedir } from "node:os";
28
-
29
26
  import { App } from '@storecraft/core'
30
- import { NodePlatform } from '@storecraft/platforms/node';
27
+ import { NodePlatform } from '@storecraft/core/platform/node';
28
+ import { NodeLocalStorage } from '@storecraft/core/storage/node'
31
29
  import { PlanetScale } from '@storecraft/database-planetscale'
32
30
  import { migrateToLatest } from '@storecraft/database-planetscale/migrate.js'
33
- import { NodeLocalStorage } from '@storecraft/storage-local/node'
34
31
 
35
32
 
36
33
  const app = new App(
@@ -49,7 +46,7 @@ const app = new App(
49
46
  }
50
47
  )
51
48
  )
52
- .withStorage(new NodeLocalStorage(join(homedir(), 'tomer')))
49
+ .withStorage(new NodeLocalStorage('storage'))
53
50
 
54
51
  await app.init();
55
52
  await migrateToLatest(app.db, false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storecraft/database-planetscale",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "`Storecraft` database driver for `PlanetScale` (cloud mysql)",
5
5
  "license": "MIT",
6
6
  "author": "Tomer Shalev (https://github.com/store-craft)",
@@ -8,7 +8,7 @@
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/store-craft/storecraft.git",
11
- "directory": "packages/database-planetscale"
11
+ "directory": "packages/databases/database-planetscale"
12
12
  },
13
13
  "keywords": [
14
14
  "commerce",
@@ -21,7 +21,8 @@
21
21
  "types": "./types.public.d.ts",
22
22
  "scripts": {
23
23
  "database-planetscale:test": "node ./tests/runner.test.js",
24
- "database-planetscale:publish": "npm publish --access public"
24
+ "test": "npm run database-planetscale:test",
25
+ "prepublishOnly": "npm version patch --force"
25
26
  },
26
27
  "peerDependencies": {
27
28
  "kysely": "*"
@@ -32,7 +33,6 @@
32
33
  "@storecraft/database-sql-base": "^1.0.0"
33
34
  },
34
35
  "devDependencies": {
35
- "@storecraft/test-runner": "^1.0.0",
36
36
  "@types/node": "^20.11.0",
37
37
  "dotenv": "^16.3.1",
38
38
  "uvu": "^0.5.6"
@@ -1,6 +1,6 @@
1
1
  import { App } from '@storecraft/core';
2
- import { NodePlatform } from '@storecraft/platforms/node';
3
- import { api_index } from '@storecraft/test-runner'
2
+ import { NodePlatform } from '@storecraft/core/platform/node';
3
+ import { api } from '@storecraft/core/test-runner'
4
4
  import { PlanetScale } from '@storecraft/database-planetscale';
5
5
  import { migrateToLatest } from '@storecraft/database-planetscale/migrate.js';
6
6
 
@@ -31,12 +31,12 @@ async function test() {
31
31
 
32
32
  await migrateToLatest(app.db, false);
33
33
 
34
- Object.entries(api_index).slice(0, -1).forEach(
34
+ Object.entries(api).slice(0, -1).forEach(
35
35
  ([name, runner]) => {
36
36
  runner.create(app).run();
37
37
  }
38
38
  );
39
- const last_test = Object.values(api_index).at(-1).create(app);
39
+ const last_test = Object.values(api).at(-1).create(app);
40
40
  last_test.after(async ()=>{app.db.disconnect()});
41
41
  last_test.run();
42
42
  }