@_linked/primitives 1.3.1 → 1.3.2
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 +21 -0
- package/lib/cjs/package.d.ts +19 -3
- package/lib/cjs/package.js +19 -10
- package/lib/cjs/package.js.map +1 -1
- package/lib/cjs/package.json +1 -1
- package/lib/esm/package.d.ts +19 -3
- package/lib/esm/package.js +17 -3
- package/lib/esm/package.js.map +1 -1
- package/lib/esm/package.json +1 -1
- package/package.json +1 -1
- package/test/package-identity.test.mjs +28 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @\_linked/primitives
|
|
2
2
|
|
|
3
|
+
## 1.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#37](https://github.com/linked-fw/primitives/pull/37) [`d7803e0`](https://github.com/linked-fw/primitives/commit/d7803e09f303015f6ba4f14ef3d610e7cda0c289) Thanks [@flyon](https://github.com/flyon)! - Give this package its own linked identity
|
|
8
|
+
|
|
9
|
+
`src/package.ts` re-exported core's decorators verbatim and declared
|
|
10
|
+
`packageName` as a bare literal that nothing was bound to, so everything
|
|
11
|
+
declared here registered under `@_linked/core`: the `radix` ontology landed in
|
|
12
|
+
core's entry in the package tree, and the next `@linkedShape` added here would
|
|
13
|
+
silently have been given a `.../shape/core/...` IRI. `Server.call` routes on
|
|
14
|
+
the package name a shape carries, so one naming the wrong package is simply
|
|
15
|
+
unreachable.
|
|
16
|
+
|
|
17
|
+
**No shape IRI changes**, because no shape is decorated here today — that is
|
|
18
|
+
why this is a patch and not a minor. The only visible change is where the
|
|
19
|
+
`radix` ontology is registered in the package tree.
|
|
20
|
+
|
|
21
|
+
Same defect and same fix as linked-fw/owl#26, where shapes did exist and the
|
|
22
|
+
IRIs did change.
|
|
23
|
+
|
|
3
24
|
## 1.3.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/lib/cjs/package.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This package's own linked identity.
|
|
3
|
+
*
|
|
4
|
+
* It used to re-export core's decorators verbatim and declare `packageName`
|
|
5
|
+
* as a bare literal that nothing was bound to. The decorators therefore came
|
|
6
|
+
* from `corePackage`, so everything declared here registered under
|
|
7
|
+
* `@_linked/core`: this package's ontology landed in core's entry in the
|
|
8
|
+
* package tree, and the next shape added here would silently have been given a
|
|
9
|
+
* `.../shape/core/...` IRI. That IRI is persisted data and `Server.call`
|
|
10
|
+
* routes on the package name inside it, so a shape naming the wrong package is
|
|
11
|
+
* simply unreachable.
|
|
12
|
+
*
|
|
13
|
+
* No shape is decorated here today, so nothing was mis-registered — the cost
|
|
14
|
+
* was waiting for the first one. Same defect, same fix, as linked-fw/owl#26.
|
|
15
|
+
*/
|
|
16
|
+
export declare const linkedShape: {
|
|
17
|
+
<T extends typeof import("@_linked/core/shapes/Shape").Shape>(constructor: T): void;
|
|
18
|
+
<T extends typeof import("@_linked/core/shapes/Shape").Shape>(config?: import("@_linked/core/utils/Package").ShapeConfig): (constructor: T) => void;
|
|
19
|
+
}, linkedUtil: (constructor: any) => any, linkedOntology: (allFileExports: any, nameSpace: (term: string) => import("@_linked/core/utils/NodeReference").NodeReferenceValue, suggestedPrefixAndFileName: string, loadDataFunction?: () => Promise<any>, dataSource?: string | string[]) => void, registerPackageExport: (exportedObject: any) => void, registerPackageModule: (_module: any) => void, getPackageShape: (name: string) => import("@_linked/core/shapes/Shape").ShapeConstructor | undefined, packageExports: any, packageName: string;
|
package/lib/cjs/package.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
exports.packageName = exports.packageExports = exports.getPackageShape = exports.registerPackageModule = exports.registerPackageExport = exports.linkedOntology = exports.linkedUtil = exports.linkedShape = void 0;
|
|
5
|
+
const Package_1 = require("@_linked/core/utils/Package");
|
|
6
|
+
/**
|
|
7
|
+
* This package's own linked identity.
|
|
8
|
+
*
|
|
9
|
+
* It used to re-export core's decorators verbatim and declare `packageName`
|
|
10
|
+
* as a bare literal that nothing was bound to. The decorators therefore came
|
|
11
|
+
* from `corePackage`, so everything declared here registered under
|
|
12
|
+
* `@_linked/core`: this package's ontology landed in core's entry in the
|
|
13
|
+
* package tree, and the next shape added here would silently have been given a
|
|
14
|
+
* `.../shape/core/...` IRI. That IRI is persisted data and `Server.call`
|
|
15
|
+
* routes on the package name inside it, so a shape naming the wrong package is
|
|
16
|
+
* simply unreachable.
|
|
17
|
+
*
|
|
18
|
+
* No shape is decorated here today, so nothing was mis-registered — the cost
|
|
19
|
+
* was waiting for the first one. Same defect, same fix, as linked-fw/owl#26.
|
|
20
|
+
*/
|
|
21
|
+
_a = (0, Package_1.linkedPackage)('@_linked/primitives'), exports.linkedShape = _a.linkedShape, exports.linkedUtil = _a.linkedUtil, exports.linkedOntology = _a.linkedOntology, exports.registerPackageExport = _a.registerPackageExport, exports.registerPackageModule = _a.registerPackageModule, exports.getPackageShape = _a.getPackageShape, exports.packageExports = _a.packageExports, exports.packageName = _a.packageName;
|
|
13
22
|
//# sourceMappingURL=package.js.map
|
package/lib/cjs/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":";;;;AAAA,yDAA0D;AAE1D;;;;;;;;;;;;;;GAcG;AACU,KAST,IAAA,uBAAa,EAAC,qBAAqB,CAAC,EARtC,mBAAW,mBACX,kBAAU,kBACV,sBAAc,sBACd,6BAAqB,6BACrB,6BAAqB,6BACrB,uBAAe,uBACf,sBAAc,sBACd,mBAAW,kBAC4B"}
|
package/lib/cjs/package.json
CHANGED
package/lib/esm/package.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This package's own linked identity.
|
|
3
|
+
*
|
|
4
|
+
* It used to re-export core's decorators verbatim and declare `packageName`
|
|
5
|
+
* as a bare literal that nothing was bound to. The decorators therefore came
|
|
6
|
+
* from `corePackage`, so everything declared here registered under
|
|
7
|
+
* `@_linked/core`: this package's ontology landed in core's entry in the
|
|
8
|
+
* package tree, and the next shape added here would silently have been given a
|
|
9
|
+
* `.../shape/core/...` IRI. That IRI is persisted data and `Server.call`
|
|
10
|
+
* routes on the package name inside it, so a shape naming the wrong package is
|
|
11
|
+
* simply unreachable.
|
|
12
|
+
*
|
|
13
|
+
* No shape is decorated here today, so nothing was mis-registered — the cost
|
|
14
|
+
* was waiting for the first one. Same defect, same fix, as linked-fw/owl#26.
|
|
15
|
+
*/
|
|
16
|
+
export declare const linkedShape: {
|
|
17
|
+
<T extends typeof import("@_linked/core/shapes/Shape").Shape>(constructor: T): void;
|
|
18
|
+
<T extends typeof import("@_linked/core/shapes/Shape").Shape>(config?: import("@_linked/core/utils/Package").ShapeConfig): (constructor: T) => void;
|
|
19
|
+
}, linkedUtil: (constructor: any) => any, linkedOntology: (allFileExports: any, nameSpace: (term: string) => import("@_linked/core/utils/NodeReference").NodeReferenceValue, suggestedPrefixAndFileName: string, loadDataFunction?: () => Promise<any>, dataSource?: string | string[]) => void, registerPackageExport: (exportedObject: any) => void, registerPackageModule: (_module: any) => void, getPackageShape: (name: string) => import("@_linked/core/shapes/Shape").ShapeConstructor | undefined, packageExports: any, packageName: string;
|
package/lib/esm/package.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { linkedPackage } from '@_linked/core/utils/Package';
|
|
2
|
+
/**
|
|
3
|
+
* This package's own linked identity.
|
|
4
|
+
*
|
|
5
|
+
* It used to re-export core's decorators verbatim and declare `packageName`
|
|
6
|
+
* as a bare literal that nothing was bound to. The decorators therefore came
|
|
7
|
+
* from `corePackage`, so everything declared here registered under
|
|
8
|
+
* `@_linked/core`: this package's ontology landed in core's entry in the
|
|
9
|
+
* package tree, and the next shape added here would silently have been given a
|
|
10
|
+
* `.../shape/core/...` IRI. That IRI is persisted data and `Server.call`
|
|
11
|
+
* routes on the package name inside it, so a shape naming the wrong package is
|
|
12
|
+
* simply unreachable.
|
|
13
|
+
*
|
|
14
|
+
* No shape is decorated here today, so nothing was mis-registered — the cost
|
|
15
|
+
* was waiting for the first one. Same defect, same fix, as linked-fw/owl#26.
|
|
16
|
+
*/
|
|
17
|
+
export const { linkedShape, linkedUtil, linkedOntology, registerPackageExport, registerPackageModule, getPackageShape, packageExports, packageName, } = linkedPackage('@_linked/primitives');
|
|
4
18
|
//# sourceMappingURL=package.js.map
|
package/lib/esm/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAE1D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,EACX,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,WAAW,GACZ,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC"}
|
package/lib/esm/package.json
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import test from 'node:test';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Which `linkedPackage()` the decorators come from decides the name everything
|
|
6
|
+
* in this package registers under — the ontology here today, and the IRI of the
|
|
7
|
+
* first `@linkedShape` anyone adds tomorrow. `src/package.ts` used to re-export
|
|
8
|
+
* core's decorators, so all of it landed under `@_linked/core`.
|
|
9
|
+
*
|
|
10
|
+
* The test is on object identity rather than on a registered IRI or a key in
|
|
11
|
+
* the global package tree, because both of those are core's own shapes and have
|
|
12
|
+
* changed across its versions — and CI resolves a different `@_linked/core`
|
|
13
|
+
* from the workspace does. `packageExports` *being* core's registry object is
|
|
14
|
+
* the defect itself, stated in the one form that holds on every version.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
test('this package does not share core\'s export registry', async () => {
|
|
18
|
+
const own = await import(new URL('../lib/esm/package.js', import.meta.url));
|
|
19
|
+
const core = await import('@_linked/core/package');
|
|
20
|
+
|
|
21
|
+
assert.notEqual(
|
|
22
|
+
own.packageExports,
|
|
23
|
+
core.packageExports,
|
|
24
|
+
'packageExports is core\'s registry: the decorators here are core\'s, so ' +
|
|
25
|
+
'everything declared in this package registers under @_linked/core',
|
|
26
|
+
);
|
|
27
|
+
assert.equal(own.packageName, '@_linked/primitives');
|
|
28
|
+
});
|