@storecraft/database-sql-base 1.3.0 → 1.3.1

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.
Files changed (2) hide show
  1. package/migrate.js +4 -2
  2. package/package.json +2 -2
package/migrate.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * @import { SqlDialectType } from './types.public.js';
4
4
  * @import { Migration } from 'kysely';
5
5
  */
6
- import { fileURLToPath } from "node:url";
6
+ import { fileURLToPath, pathToFileURL } from "node:url";
7
7
  import * as path from 'path'
8
8
  import { promises as fs } from 'fs'
9
9
  import {
@@ -38,7 +38,9 @@ export const get_migrations = async (dialect_type='SQLITE') => {
38
38
  for (const file of files) {
39
39
  if(file.endsWith('.js')) {
40
40
  const file_name = file.split('.').slice(0, -1).join('.');
41
- const migration = await import(path.join(__dirname, folder, file));
41
+ const file_path = path.join(__dirname, folder, file);
42
+ const file_url = pathToFileURL(file_path);
43
+ const migration = await import(file_url.href);
42
44
  migrations[file_name] = migration;
43
45
  }
44
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storecraft/database-sql-base",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Official SQL Database driver for storecraft",
5
5
  "license": "MIT",
6
6
  "author": "Tomer Shalev (https://github.com/store-craft)",
@@ -33,7 +33,7 @@
33
33
  "database-sql-base:test:postgres": "node ./tests/runner.postgres-local.test.js",
34
34
  "database-sql-base:test:mysql": "node ./tests/runner.mysql-local.test.js",
35
35
  "test": "npm run database-sql-base:test:sqlite && npm run database-sql-base:test:postgres && npm run database-sql-base:test:mysql",
36
- "sc-publish": "npm publish"
36
+ "sc-publish-patch": "npm version patch && npm publish"
37
37
  },
38
38
  "dependencies": {
39
39
  "@storecraft/core": "^1.0.0",