@_linked/server 2.13.5 → 2.13.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.
- package/CHANGELOG.md +22 -0
- package/docs/architecture/01-server-only-surface.md +58 -0
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/ontologies/lincd-server.js +0 -3
- package/lib/esm/ontologies/lincd-server.js.map +1 -1
- package/lib/esm/ontologies/lincd-server.register.d.ts +1 -0
- package/lib/esm/ontologies/lincd-server.register.js +17 -0
- package/lib/esm/ontologies/lincd-server.register.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @\_linked/server
|
|
2
2
|
|
|
3
|
+
## 2.13.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#98](https://github.com/linked-fw/server/pull/98) [`fe41a81`](https://github.com/linked-fw/server/commit/fe41a81cb84252890258566fcd668e8ef7e534b1) Thanks [@flyon](https://github.com/flyon)! - The ontology no longer registers by importing itself.
|
|
8
|
+
|
|
9
|
+
It carried `import * as _this from './<prefix>.js'` and passed that namespace to
|
|
10
|
+
`linkedOntology()`. Under `tsc` the self-reference survives; under a bundler it does
|
|
11
|
+
not — Rollup treats it as a circular import and elides it, so the binding is
|
|
12
|
+
`undefined` and a consuming app dies at boot with `_this is not defined`.
|
|
13
|
+
|
|
14
|
+
Registration now lives in a `<prefix>.register.ts` sibling, imported from the package
|
|
15
|
+
entry. Nothing changes for consumers: importing this package still registers the
|
|
16
|
+
ontology.
|
|
17
|
+
|
|
18
|
+
## 2.13.6
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#83](https://github.com/linked-fw/server/pull/83) [`5b58619`](https://github.com/linked-fw/server/commit/5b586190b45d52ac8ab70f90e414a7d52fc4d3a9) Thanks [@flyon](https://github.com/flyon)! - Document this package's server-only surface — see
|
|
23
|
+
`docs/architecture/01-server-only-surface.md`.
|
|
24
|
+
|
|
3
25
|
## 2.13.5
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: Why this package declares its own server-only surface rather than being named by
|
|
3
|
+
consumers, what the declaration means, and the one part of this package that is not server-only
|
|
4
|
+
and should not live here.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# This package's server-only surface
|
|
8
|
+
|
|
9
|
+
This package is a **replaceable module**. An application may swap it for another implementation,
|
|
10
|
+
and anything that depends on knowing it by name breaks the moment someone does.
|
|
11
|
+
|
|
12
|
+
That matters for one specific rule: **a frontend bundle must not contain this package.** Almost
|
|
13
|
+
everything here touches a filesystem, a process or a socket, and a `ShapeProvider` extends
|
|
14
|
+
`BackendProvider`, which imports node's `path`. Pull any of it into a client graph and the bundler
|
|
15
|
+
resolves `path` to the abandoned npm shim of the same name, the shim references `process`, and the
|
|
16
|
+
application hydrates into an empty shell with `ReferenceError: process is not defined` — an error
|
|
17
|
+
naming nothing that would lead you back to the import.
|
|
18
|
+
|
|
19
|
+
## The declaration
|
|
20
|
+
|
|
21
|
+
```jsonc
|
|
22
|
+
"linked": {
|
|
23
|
+
"serverOnly": [".", "./shapes/*", "./server/*", "./utils/*"]
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
A consuming application's client/server boundary check reads this, rather than hardcoding
|
|
28
|
+
`@_linked/server`. The difference is not stylistic: a check that names this package protects one
|
|
29
|
+
arrangement of the framework, and a replacement inherits none of it. A check that reads
|
|
30
|
+
declarations protects whatever is installed.
|
|
31
|
+
|
|
32
|
+
It is purely declarative. No code, no exports, and no resolution behaviour depends on it.
|
|
33
|
+
|
|
34
|
+
## The convention it complements
|
|
35
|
+
|
|
36
|
+
A consumer also treats anything under `<pkg>/backend/**` as server-only, in **any** package, with
|
|
37
|
+
no declaration needed. Between the two, no application has to know a package by name.
|
|
38
|
+
|
|
39
|
+
A package whose server-only code all lives under `backend/` therefore needs no `linked.serverOnly`
|
|
40
|
+
at all. This package declares one because its server-only surface predates that convention and is
|
|
41
|
+
spread across several subpaths.
|
|
42
|
+
|
|
43
|
+
## What is not server-only, and should move
|
|
44
|
+
|
|
45
|
+
Three exports are client-safe and are published from here anyway:
|
|
46
|
+
|
|
47
|
+
| Export | Who uses it |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `BackendAPIStore` | the store a **browser** uses to talk to the backend; constructed by an app's frontend storage config |
|
|
50
|
+
| `getAccessUrlLocalFileStore` | the same frontend config |
|
|
51
|
+
| `LincdWebApp` | constructed in a React hook |
|
|
52
|
+
|
|
53
|
+
They belong in `@_linked/server-utils`, which exists for exactly the isomorphic half of the
|
|
54
|
+
framework. Until they move, every consuming application must carry a standing exception in its
|
|
55
|
+
boundary check — and a boundary with permanent exceptions stops being one.
|
|
56
|
+
|
|
57
|
+
Tracked as follow-up work; noted here so the next person to wonder why an app imports
|
|
58
|
+
`@_linked/server` from its frontend finds the answer.
|
package/lib/esm/index.d.ts
CHANGED
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,uCAAuC,CAAC;AAE/C,cAAc;AACd,OAAO,0BAA0B,CAAC;AAClC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,wCAAwC,CAAC;AAChD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,yBAAyB,CAAC;AAEjC,iBAAiB;AACjB,OAAO,sBAAsB,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { createNameSpace } from '@_linked/core/utils/NameSpace';
|
|
2
|
-
import { linkedOntology } from '../package.js';
|
|
3
|
-
import * as _this from './lincd-server.js';
|
|
4
2
|
/**
|
|
5
3
|
* Load the data of this ontology.
|
|
6
4
|
* In @_linked/core, loadData returns the raw JSON import — no JSONLD.parse() needed.
|
|
@@ -45,5 +43,4 @@ export const lincdServer = {
|
|
|
45
43
|
LincdAPI,
|
|
46
44
|
hasAPI,
|
|
47
45
|
};
|
|
48
|
-
linkedOntology(_this, ns, 'lincd-server', loadData, '../data/lincd-server.json');
|
|
49
46
|
//# sourceMappingURL=lincd-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lincd-server.js","sourceRoot":"","sources":["../../../src/ontologies/lincd-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"lincd-server.js","sourceRoot":"","sources":["../../../src/ontologies/lincd-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,IAAI,QAAQ,GAAG,KAAK,IAAI,EAAE;IAC/B,YAAY;IACZ,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,2BAA2B,EAAE;QACrD,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;KACvB,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,CAAC,IAAI,EAAE,GAAG,eAAe,CAAC,oCAAoC,CAAC,CAAC;AAEtE,MAAM,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AAE1B,uEAAuE;AACvE,0EAA0E;AAC1E,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,2EAA2E;AAC3E,0EAA0E;AAC1E,MAAM,WAAW,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;AACtC,MAAM,gBAAgB,GAAG,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAChD,MAAM,aAAa,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC;AAC1C,MAAM,YAAY,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC;AACxC,MAAM,eAAe,GAAG,EAAE,CAAC,iBAAiB,CAAC,CAAC;AAC9C,MAAM,WAAW,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;AACtC,MAAM,UAAU,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC;AACpC,MAAM,gBAAgB,GAAG,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAChD,MAAM,WAAW,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;AACtC,MAAM,QAAQ,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC;AAChC,MAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;AAE5B,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,WAAW;IACX,gBAAgB;IAChB,aAAa;IACb,YAAY;IACZ,WAAW;IACX,eAAe;IACf,WAAW;IACX,UAAU;IACV,gBAAgB;IAChB,QAAQ;IACR,MAAM;CACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers this ontology.
|
|
3
|
+
*
|
|
4
|
+
* Kept out of `lincd-server.ts` because registration needs that module's whole export
|
|
5
|
+
* namespace, and a module cannot import itself once a bundler is involved: Rollup
|
|
6
|
+
* treats a static self-reference as a circular import and elides it, so the binding is
|
|
7
|
+
* undefined at runtime and the consuming app dies at boot with `_this is not
|
|
8
|
+
* defined`. `tsc` preserves it, which is why the pattern survived for as long as
|
|
9
|
+
* packages were built with `tsc` alone.
|
|
10
|
+
*
|
|
11
|
+
* From a sibling module the same import is ordinary and survives.
|
|
12
|
+
*/
|
|
13
|
+
import * as terms from './lincd-server.js';
|
|
14
|
+
import { loadData, ns } from './lincd-server.js';
|
|
15
|
+
import { linkedOntology } from '../package.js';
|
|
16
|
+
linkedOntology(terms, ns, 'lincd-server', loadData, '../data/lincd-server.json');
|
|
17
|
+
//# sourceMappingURL=lincd-server.register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lincd-server.register.js","sourceRoot":"","sources":["../../../src/ontologies/lincd-server.register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAC,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAE7C,cAAc,CACZ,KAAK,EACL,EAAE,EACF,cAAc,EACd,QAAQ,EACR,2BAA2B,CAC5B,CAAC"}
|