@loomcore/api 0.2.35 → 0.2.36

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.
@@ -3,6 +3,7 @@ import { Pool } from 'pg';
3
3
  import { MongoClient } from 'mongodb';
4
4
  import fs from 'fs';
5
5
  import path from 'path';
6
+ import { pathToFileURL } from 'node:url';
6
7
  import { buildMongoUrl } from '../mongo-db/utils/build-mongo-url.util.js';
7
8
  import { buildPostgresUrl } from '../postgres/utils/build-postgres-url.util.js';
8
9
  import { getPostgresInitialSchema } from '../postgres/migrations/postgres-initial-schema.js';
@@ -144,14 +145,15 @@ export class MigrationRunner {
144
145
  };
145
146
  }
146
147
  else {
148
+ const importUrl = pathToFileURL(fullPath).href;
147
149
  return {
148
150
  name: f,
149
151
  up: async () => {
150
- const mod = await import(fullPath);
152
+ const mod = await import(importUrl);
151
153
  await mod.up({ context });
152
154
  },
153
155
  down: async () => {
154
- const mod = await import(fullPath);
156
+ const mod = await import(importUrl);
155
157
  await mod.down({ context });
156
158
  }
157
159
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcore/api",
3
- "version": "0.2.35",
3
+ "version": "0.2.36",
4
4
  "private": false,
5
5
  "description": "Loom Core Api - An opinionated Node.js api using Typescript, Express, and MongoDb or PostgreSQL",
6
6
  "scripts": {