@_linked/cli 1.37.0 → 1.38.0
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 +6 -0
- package/lib/esm/cli-methods.d.ts.map +1 -1
- package/lib/esm/cli-methods.js +5 -4
- package/lib/esm/cli-methods.js.map +1 -1
- package/lib/esm/utils/ontologyNamespace.d.ts +21 -0
- package/lib/esm/utils/ontologyNamespace.d.ts.map +1 -0
- package/lib/esm/utils/ontologyNamespace.js +30 -0
- package/lib/esm/utils/ontologyNamespace.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The root every first-party and community ontology publishes under (arch-02): an ontology's
|
|
3
|
+
* namespace is `https://linked.cm/ont/{ontologySlug}/`, next to the package's shapes at
|
|
4
|
+
* `https://linked.cm/shape/{publicSlug}/`. It replaces the legacy `http://lincd.org/ont/` root.
|
|
5
|
+
*/
|
|
6
|
+
export declare const LINKED_ONTOLOGY_ROOT = "https://linked.cm/ont/";
|
|
7
|
+
/**
|
|
8
|
+
* The default namespace for a scaffolded ontology: `https://linked.cm/ont/{slug}/`.
|
|
9
|
+
*
|
|
10
|
+
* `name` is a package name or an ontology prefix. It is reduced the way core derives a package's
|
|
11
|
+
* publicSlug — the npm scope is dropped and the rest kebab-cased — so a package's own ontology
|
|
12
|
+
* (`@_linked/server` → `https://linked.cm/ont/server/`) shares the slug of its shapes.
|
|
13
|
+
*
|
|
14
|
+
* Private packages do not use this root: they publish under a workspace-scoped one
|
|
15
|
+
* (`https://{workspaceSlug}.id.create.now/ont/{ontologySlug}/`), which the caller passes as the
|
|
16
|
+
* explicit `uriBase` of `create-package` / `create-ontology`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function defaultOntologyNamespace(name: string): string;
|
|
19
|
+
/** A namespace ends in `/` or `#`; a bare base gets the `/` it needs. */
|
|
20
|
+
export declare function asNamespace(uriBase: string): string;
|
|
21
|
+
//# sourceMappingURL=ontologyNamespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontologyNamespace.d.ts","sourceRoot":"","sources":["../../../src/utils/ontologyNamespace.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM7D;AAED,yEAAyE;AACzE,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { packageNameToSlug } from './shapeReferences.js';
|
|
2
|
+
/**
|
|
3
|
+
* The root every first-party and community ontology publishes under (arch-02): an ontology's
|
|
4
|
+
* namespace is `https://linked.cm/ont/{ontologySlug}/`, next to the package's shapes at
|
|
5
|
+
* `https://linked.cm/shape/{publicSlug}/`. It replaces the legacy `http://lincd.org/ont/` root.
|
|
6
|
+
*/
|
|
7
|
+
export const LINKED_ONTOLOGY_ROOT = 'https://linked.cm/ont/';
|
|
8
|
+
/**
|
|
9
|
+
* The default namespace for a scaffolded ontology: `https://linked.cm/ont/{slug}/`.
|
|
10
|
+
*
|
|
11
|
+
* `name` is a package name or an ontology prefix. It is reduced the way core derives a package's
|
|
12
|
+
* publicSlug — the npm scope is dropped and the rest kebab-cased — so a package's own ontology
|
|
13
|
+
* (`@_linked/server` → `https://linked.cm/ont/server/`) shares the slug of its shapes.
|
|
14
|
+
*
|
|
15
|
+
* Private packages do not use this root: they publish under a workspace-scoped one
|
|
16
|
+
* (`https://{workspaceSlug}.id.create.now/ont/{ontologySlug}/`), which the caller passes as the
|
|
17
|
+
* explicit `uriBase` of `create-package` / `create-ontology`.
|
|
18
|
+
*/
|
|
19
|
+
export function defaultOntologyNamespace(name) {
|
|
20
|
+
const slug = packageNameToSlug(name);
|
|
21
|
+
if (!slug) {
|
|
22
|
+
throw new Error(`Cannot derive an ontology slug from '${name}'`);
|
|
23
|
+
}
|
|
24
|
+
return `${LINKED_ONTOLOGY_ROOT}${slug}/`;
|
|
25
|
+
}
|
|
26
|
+
/** A namespace ends in `/` or `#`; a bare base gets the `/` it needs. */
|
|
27
|
+
export function asNamespace(uriBase) {
|
|
28
|
+
return /[/#]$/.test(uriBase) ? uriBase : `${uriBase}/`;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=ontologyNamespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontologyNamespace.js","sourceRoot":"","sources":["../../../src/utils/ontologyNamespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,GAAG,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,GAAG,oBAAoB,GAAG,IAAI,GAAG,CAAC;AAC3C,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC;AACzD,CAAC","sourcesContent":["import {packageNameToSlug} from './shapeReferences.js';\n\n/**\n * The root every first-party and community ontology publishes under (arch-02): an ontology's\n * namespace is `https://linked.cm/ont/{ontologySlug}/`, next to the package's shapes at\n * `https://linked.cm/shape/{publicSlug}/`. It replaces the legacy `http://lincd.org/ont/` root.\n */\nexport const LINKED_ONTOLOGY_ROOT = 'https://linked.cm/ont/';\n\n/**\n * The default namespace for a scaffolded ontology: `https://linked.cm/ont/{slug}/`.\n *\n * `name` is a package name or an ontology prefix. It is reduced the way core derives a package's\n * publicSlug — the npm scope is dropped and the rest kebab-cased — so a package's own ontology\n * (`@_linked/server` → `https://linked.cm/ont/server/`) shares the slug of its shapes.\n *\n * Private packages do not use this root: they publish under a workspace-scoped one\n * (`https://{workspaceSlug}.id.create.now/ont/{ontologySlug}/`), which the caller passes as the\n * explicit `uriBase` of `create-package` / `create-ontology`.\n */\nexport function defaultOntologyNamespace(name: string): string {\n const slug = packageNameToSlug(name);\n if (!slug) {\n throw new Error(`Cannot derive an ontology slug from '${name}'`);\n }\n return `${LINKED_ONTOLOGY_ROOT}${slug}/`;\n}\n\n/** A namespace ends in `/` or `#`; a bare base gets the `/` it needs. */\nexport function asNamespace(uriBase: string): string {\n return /[/#]$/.test(uriBase) ? uriBase : `${uriBase}/`;\n}\n"]}
|