@stonyx/orm 0.3.2-alpha.103 → 0.3.2-alpha.105
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/dist/main.js +7 -1
- package/package.json +6 -6
- package/src/main.ts +7 -1
package/dist/main.js
CHANGED
|
@@ -19,7 +19,6 @@ import log from 'stonyx/log';
|
|
|
19
19
|
import { forEachFileImport } from '@stonyx/utils/file';
|
|
20
20
|
import { kebabCaseToPascalCase, pluralize } from '@stonyx/utils/string';
|
|
21
21
|
import { registerPluralName } from './plural-registry.js';
|
|
22
|
-
import setupRestServer from './setup-rest-server.js';
|
|
23
22
|
import baseTransforms from './transforms.js';
|
|
24
23
|
import Store from './store.js';
|
|
25
24
|
import Serializer from './serializer.js';
|
|
@@ -131,6 +130,13 @@ export default class Orm {
|
|
|
131
130
|
promises.push(db.init());
|
|
132
131
|
}
|
|
133
132
|
if (restServer.enabled === 'true') {
|
|
133
|
+
// Lazy-imported so the optional `@stonyx/rest-server` peer is only resolved
|
|
134
|
+
// when the consumer has actually enabled REST. A static import here pulls
|
|
135
|
+
// setup-rest-server -> orm-request/meta-request -> '@stonyx/rest-server'
|
|
136
|
+
// into the entry graph, so `import('@stonyx/orm')` throws
|
|
137
|
+
// ERR_MODULE_NOT_FOUND for an ORM-only consumer that never installed the
|
|
138
|
+
// optional peer. Same reason the SQL/DynamoDB drivers above are lazy. (#280)
|
|
139
|
+
const { default: setupRestServer } = await import('./setup-rest-server.js');
|
|
134
140
|
promises.push(setupRestServer(restServer.route, paths.access, restServer.metaRoute));
|
|
135
141
|
}
|
|
136
142
|
// Wire up memory resolver so store.find() can check model memory flags
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"stonyx-async",
|
|
5
5
|
"stonyx-module"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.3.2-alpha.
|
|
7
|
+
"version": "0.3.2-alpha.105",
|
|
8
8
|
"description": "",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"type": "module",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://github.com/abofs/stonyx-orm#readme",
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@stonyx/cron": "0.2.1-beta.
|
|
65
|
-
"@stonyx/events": "0.1.1-beta.
|
|
66
|
-
"@stonyx/utils": "0.2.3-beta.
|
|
67
|
-
"stonyx": "0.2.3-beta.
|
|
64
|
+
"@stonyx/cron": "0.2.1-beta.122",
|
|
65
|
+
"@stonyx/events": "0.1.1-beta.64",
|
|
66
|
+
"@stonyx/utils": "0.2.3-beta.27",
|
|
67
|
+
"stonyx": "0.2.3-beta.94"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@aws-sdk/client-dynamodb": "^3.0.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@stonyx/rest-server": "0.2.1-beta.
|
|
94
|
+
"@stonyx/rest-server": "0.2.1-beta.123",
|
|
95
95
|
"@types/node": "^25.6.0",
|
|
96
96
|
"mysql2": "^3.20.0",
|
|
97
97
|
"pg": "^8.20.0",
|
package/src/main.ts
CHANGED
|
@@ -20,7 +20,6 @@ import log from 'stonyx/log';
|
|
|
20
20
|
import { forEachFileImport } from '@stonyx/utils/file';
|
|
21
21
|
import { kebabCaseToPascalCase, pluralize } from '@stonyx/utils/string';
|
|
22
22
|
import { registerPluralName } from './plural-registry.js';
|
|
23
|
-
import setupRestServer from './setup-rest-server.js';
|
|
24
23
|
import baseTransforms from './transforms.js';
|
|
25
24
|
import Store from './store.js';
|
|
26
25
|
import Serializer from './serializer.js';
|
|
@@ -177,6 +176,13 @@ export default class Orm {
|
|
|
177
176
|
}
|
|
178
177
|
|
|
179
178
|
if (restServer.enabled === 'true') {
|
|
179
|
+
// Lazy-imported so the optional `@stonyx/rest-server` peer is only resolved
|
|
180
|
+
// when the consumer has actually enabled REST. A static import here pulls
|
|
181
|
+
// setup-rest-server -> orm-request/meta-request -> '@stonyx/rest-server'
|
|
182
|
+
// into the entry graph, so `import('@stonyx/orm')` throws
|
|
183
|
+
// ERR_MODULE_NOT_FOUND for an ORM-only consumer that never installed the
|
|
184
|
+
// optional peer. Same reason the SQL/DynamoDB drivers above are lazy. (#280)
|
|
185
|
+
const { default: setupRestServer } = await import('./setup-rest-server.js');
|
|
180
186
|
promises.push(setupRestServer(restServer.route, paths.access, restServer.metaRoute));
|
|
181
187
|
}
|
|
182
188
|
|