startupjs 0.61.12 → 0.61.13
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/orm.js +20 -0
- package/package.json +3 -2
- package/test/orm.test.js +14 -0
package/orm.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* COMPAT-ONLY legacy entrypoint for older code and third-party LMS packages
|
|
3
|
+
* which still import model helpers from `startupjs/orm`.
|
|
4
|
+
*
|
|
5
|
+
* Purpose:
|
|
6
|
+
* - preserve the historic import path while the new Startupjs package surface is
|
|
7
|
+
* organized around `startupjs` root exports
|
|
8
|
+
* - avoid mechanical divergence in downstream apps and patched dependencies
|
|
9
|
+
*
|
|
10
|
+
* Contract in this compat file:
|
|
11
|
+
* - `BaseModel` is exposed as an alias of the current `Signal` export
|
|
12
|
+
* - `hasMany` and `belongsTo` are re-exported from the current root package API
|
|
13
|
+
*
|
|
14
|
+
* Explicit limitations:
|
|
15
|
+
* - this file is internal compat support and is intentionally not part of the
|
|
16
|
+
* main documented Startupjs API surface
|
|
17
|
+
* - it only restores the legacy `startupjs/orm` surface used by the LMS stack
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export { Signal as BaseModel, hasMany, belongsTo } from './index.js'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "startupjs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.61.
|
|
4
|
+
"version": "0.61.13",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">= 14"
|
|
7
7
|
},
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./index.js",
|
|
12
12
|
"./app": "./app.js",
|
|
13
|
+
"./orm": "./orm.js",
|
|
13
14
|
"./auth": "./auth.js",
|
|
14
15
|
"./server": "./server.js",
|
|
15
16
|
"./schema": "./schema.js",
|
|
@@ -59,5 +60,5 @@
|
|
|
59
60
|
"scripts": {
|
|
60
61
|
"test": "node --experimental-specifier-resolution=node --test"
|
|
61
62
|
},
|
|
62
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "94c0c94b80870fa975266a48eb1673ab74d67231"
|
|
63
64
|
}
|
package/test/orm.test.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import test from 'node:test'
|
|
2
|
+
import assert from 'node:assert/strict'
|
|
3
|
+
|
|
4
|
+
import { Signal, hasMany, belongsTo } from '../index.js'
|
|
5
|
+
import { BaseModel, hasMany as ormHasMany, belongsTo as ormBelongsTo } from '../orm.js'
|
|
6
|
+
|
|
7
|
+
test('startupjs/orm exposes BaseModel as Signal', () => {
|
|
8
|
+
assert.equal(BaseModel, Signal)
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
test('startupjs/orm re-exports relation helpers', () => {
|
|
12
|
+
assert.equal(ormHasMany, hasMany)
|
|
13
|
+
assert.equal(ormBelongsTo, belongsTo)
|
|
14
|
+
})
|