@_linked/primitives 1.3.0 → 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 CHANGED
@@ -1,5 +1,37 @@
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
+
24
+ ## 1.3.1
25
+
26
+ ### Patch Changes
27
+
28
+ - [#34](https://github.com/linked-fw/primitives/pull/34) [`6514c31`](https://github.com/linked-fw/primitives/commit/6514c31aef96a8b4d087e1edf48aa86abe693b87) Thanks [@flyon](https://github.com/flyon)! - Add a root `types` field so a bare import gets types under node10 resolution.
29
+
30
+ There was no `types`/`typings` field at all, so a `moduleResolution: node10` consumer doing
31
+ `import … from '@_linked/primitives'` got `TS2307` — `exports` is ignored under node10. The value
32
+ `index.d.ts` is redirected by the existing `typesVersions` to `lib/esm/index.d.ts`, matching the
33
+ sibling packages.
34
+
3
35
  ## 1.3.0
4
36
 
5
37
  ### Minor Changes
@@ -1,3 +1,19 @@
1
- import { getPackageShape, linkedOntology, linkedShape, linkedUtil, packageExports, registerPackageExport, registerPackageModule } from '@_linked/core/package';
2
- export declare const packageName: string;
3
- export { getPackageShape, linkedOntology, linkedShape, linkedUtil, packageExports, registerPackageExport, registerPackageModule, };
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;
@@ -1,13 +1,22 @@
1
1
  "use strict";
2
+ var _a;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerPackageModule = exports.registerPackageExport = exports.packageExports = exports.linkedUtil = exports.linkedShape = exports.linkedOntology = exports.getPackageShape = exports.packageName = void 0;
4
- const package_1 = require("@_linked/core/package");
5
- Object.defineProperty(exports, "getPackageShape", { enumerable: true, get: function () { return package_1.getPackageShape; } });
6
- Object.defineProperty(exports, "linkedOntology", { enumerable: true, get: function () { return package_1.linkedOntology; } });
7
- Object.defineProperty(exports, "linkedShape", { enumerable: true, get: function () { return package_1.linkedShape; } });
8
- Object.defineProperty(exports, "linkedUtil", { enumerable: true, get: function () { return package_1.linkedUtil; } });
9
- Object.defineProperty(exports, "packageExports", { enumerable: true, get: function () { return package_1.packageExports; } });
10
- Object.defineProperty(exports, "registerPackageExport", { enumerable: true, get: function () { return package_1.registerPackageExport; } });
11
- Object.defineProperty(exports, "registerPackageModule", { enumerable: true, get: function () { return package_1.registerPackageModule; } });
12
- exports.packageName = { packageName: '@_linked/primitives' }.packageName;
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
@@ -1 +1 @@
1
- {"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":";;;AAAA,mDAQ+B;AAK7B,gGAZA,yBAAe,OAYA;AACf,+FAZA,wBAAc,OAYA;AACd,4FAZA,qBAAW,OAYA;AACX,2FAZA,oBAAU,OAYA;AACV,+FAZA,wBAAc,OAYA;AACd,sGAZA,+BAAqB,OAYA;AACrB,sGAZA,+BAAqB,OAYA;AATR,mBAAW,GAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,aAAC"}
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"}
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/linked-fw/primitives.git"
12
12
  },
13
- "version": "1.3.0",
13
+ "version": "1.3.2",
14
14
  "packageManager": "npm@11.19.1",
15
15
  "linkedPackage": true,
16
16
  "license": "ISC",
@@ -1,3 +1,19 @@
1
- import { getPackageShape, linkedOntology, linkedShape, linkedUtil, packageExports, registerPackageExport, registerPackageModule } from '@_linked/core/package';
2
- export declare const packageName: string;
3
- export { getPackageShape, linkedOntology, linkedShape, linkedUtil, packageExports, registerPackageExport, registerPackageModule, };
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;
@@ -1,4 +1,18 @@
1
- import { getPackageShape, linkedOntology, linkedShape, linkedUtil, packageExports, registerPackageExport, registerPackageModule, } from '@_linked/core/package';
2
- export const { packageName } = { packageName: '@_linked/primitives' };
3
- export { getPackageShape, linkedOntology, linkedShape, linkedUtil, packageExports, registerPackageExport, registerPackageModule, };
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
@@ -1 +1 @@
1
- {"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,cAAc,EACd,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;AAEtE,OAAO,EACL,eAAe,EACf,cAAc,EACd,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,qBAAqB,GACtB,CAAC"}
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"}
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/linked-fw/primitives.git"
12
12
  },
13
- "version": "1.3.0",
13
+ "version": "1.3.2",
14
14
  "packageManager": "npm@11.19.1",
15
15
  "linkedPackage": true,
16
16
  "license": "ISC",
package/package.json CHANGED
@@ -10,10 +10,11 @@
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/linked-fw/primitives.git"
12
12
  },
13
- "version": "1.3.0",
13
+ "version": "1.3.2",
14
14
  "packageManager": "npm@11.19.1",
15
15
  "linkedPackage": true,
16
16
  "main": "lib/cjs/index.js",
17
+ "types": "index.d.ts",
17
18
  "license": "ISC",
18
19
  "scripts": {
19
20
  "start": "npm exec linked dev",
@@ -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
+ });