json-rest-api 1.0.6 → 1.0.7

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.
@@ -18,7 +18,7 @@ const inspect = (obj) => util.inspect(obj, { depth: 5 })
18
18
 
19
19
  // Create a Knex instance connected to SQLite in-memory database
20
20
  const knex = knexLib({
21
- client: 'sqlite3',
21
+ client: 'better-sqlite3',
22
22
  connection: {
23
23
  filename: ':memory:'
24
24
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-rest-api",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  * - File upload support with busboy or formidable
15
15
  */
16
16
 
17
- import express from 'express';
17
+ import { requirePackage } from 'hooked-api';
18
18
  import { parseJsonApiQuery } from '../utils/connectors-query-parser.js';
19
19
  import { createContext } from './lib/request-helpers.js';
20
20
  import { createEnhancedLogger } from '../../../lib/enhanced-logger.js';
@@ -24,6 +24,14 @@ export const ExpressPlugin = {
24
24
  dependencies: ['rest-api'],
25
25
 
26
26
  async install({ on, vars, helpers, pluginOptions, log, scopes, api, runHooks, addHook }) {
27
+ // Dynamic import for Express
28
+ let express;
29
+ try {
30
+ express = (await import('express')).default;
31
+ } catch (e) {
32
+ requirePackage('express', 'express',
33
+ 'Express.js is required for HTTP server functionality. This is a peer dependency.');
34
+ }
27
35
  // Enhance the logger
28
36
  const enhancedLog = createEnhancedLogger(log, {
29
37
  logFullErrors: true,