@intellectual-frontiers/libraries 0.4.1 → 0.5.1
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/dist/affected.d.ts +1 -1
- package/dist/changes.js +2 -1
- package/dist/check.js +21 -2
- package/dist/dev.js +1 -1
- package/dist/generate-ontology.d.ts +2 -0
- package/dist/generate-ontology.js +41 -1
- package/dist/imports/nist-sp-800-53.auto.prov.ttl +22 -0
- package/dist/imports/schema-org.auto.prov.ttl +22 -0
- package/dist/install-bun.js +1 -1
- package/dist/libraries.d.ts +34 -2
- package/dist/libraries.js +70 -9
- package/dist/license/PolyForm-Noncommercial-1.0.0.md +73 -0
- package/dist/link.d.ts +1 -1
- package/dist/link.js +4 -4
- package/dist/metapackages.d.ts +62 -0
- package/dist/metapackages.js +187 -0
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +1 -1
- package/dist/pack-library.d.ts +7 -0
- package/dist/pack-library.js +31 -56
- package/dist/pack-metapackage.d.ts +22 -0
- package/dist/pack-metapackage.js +147 -0
- package/dist/pins.d.ts +1 -1
- package/dist/pins.js +1 -1
- package/dist/readme.d.ts +13 -1
- package/dist/readme.js +45 -4
- package/dist/releasing.d.ts +8 -1
- package/dist/releasing.js +44 -14
- package/dist/workflows/definitions.d.ts +2 -2
- package/dist/workflows/definitions.js +31 -113
- package/dist/workflows/model.d.ts +2 -0
- package/dist/workflows/render.js +2 -0
- package/dist/workflows/schema/github-workflow.schema.json +2290 -0
- package/package.json +28 -13
- package/src/affected.ts +1 -1
- package/src/changes.ts +2 -1
- package/src/check.ts +21 -2
- package/src/dev.ts +1 -1
- package/src/generate-ontology.ts +42 -1
- package/src/imports/nist-sp-800-53.auto.prov.ttl +22 -0
- package/src/imports/schema-org.auto.prov.ttl +22 -0
- package/src/install-bun.ts +1 -1
- package/src/libraries.ts +88 -8
- package/src/license/PolyForm-Noncommercial-1.0.0.md +73 -0
- package/src/link.ts +4 -4
- package/src/metapackages.ts +203 -0
- package/src/mod.ts +1 -1
- package/src/pack-library.ts +37 -53
- package/src/pack-metapackage.ts +137 -0
- package/src/pins.ts +1 -1
- package/src/readme.ts +49 -4
- package/src/releasing.ts +47 -16
- package/src/workflows/definitions.ts +34 -131
- package/src/workflows/model.ts +2 -0
- package/src/workflows/render.ts +1 -0
- package/src/workflows/schema/github-workflow.schema.json +2290 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intellectual-frontiers/libraries",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "The libraries of a repository of commons as code: the manifest of a library and the check that it and its folder agree, which libraries a change affects, the typed workflows of GitHub Actions and their generator, the pinned Bun, the packer that builds, inspects and packs a library for npm with its declarations, and the commands that hold a whole repository to Mizan (check, change control, versions, the register and the ontologies).",
|
|
5
5
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
6
6
|
"type": "module",
|
|
@@ -35,6 +35,11 @@
|
|
|
35
35
|
"bun": "./src/dev.ts",
|
|
36
36
|
"default": "./dist/dev.js"
|
|
37
37
|
},
|
|
38
|
+
"./family": {
|
|
39
|
+
"types": "./dist/family.d.ts",
|
|
40
|
+
"bun": "./src/family.ts",
|
|
41
|
+
"default": "./dist/family.js"
|
|
42
|
+
},
|
|
38
43
|
"./generate-ontology": {
|
|
39
44
|
"types": "./dist/generate-ontology.d.ts",
|
|
40
45
|
"bun": "./src/generate-ontology.ts",
|
|
@@ -60,6 +65,11 @@
|
|
|
60
65
|
"bun": "./src/link.ts",
|
|
61
66
|
"default": "./dist/link.js"
|
|
62
67
|
},
|
|
68
|
+
"./metapackages": {
|
|
69
|
+
"types": "./dist/metapackages.d.ts",
|
|
70
|
+
"bun": "./src/metapackages.ts",
|
|
71
|
+
"default": "./dist/metapackages.js"
|
|
72
|
+
},
|
|
63
73
|
"./newer": {
|
|
64
74
|
"types": "./dist/newer.d.ts",
|
|
65
75
|
"bun": "./src/newer.ts",
|
|
@@ -75,6 +85,11 @@
|
|
|
75
85
|
"bun": "./src/pack-library.ts",
|
|
76
86
|
"default": "./dist/pack-library.js"
|
|
77
87
|
},
|
|
88
|
+
"./pack-metapackage": {
|
|
89
|
+
"types": "./dist/pack-metapackage.d.ts",
|
|
90
|
+
"bun": "./src/pack-metapackage.ts",
|
|
91
|
+
"default": "./dist/pack-metapackage.js"
|
|
92
|
+
},
|
|
78
93
|
"./pins": {
|
|
79
94
|
"types": "./dist/pins.d.ts",
|
|
80
95
|
"bun": "./src/pins.ts",
|
|
@@ -127,18 +142,18 @@
|
|
|
127
142
|
}
|
|
128
143
|
},
|
|
129
144
|
"dependencies": {
|
|
130
|
-
"@intellectual-frontiers/core": "0.1
|
|
131
|
-
"@intellectual-frontiers/crypto": "0.1
|
|
132
|
-
"@intellectual-frontiers/formats": "0.1
|
|
133
|
-
"@intellectual-frontiers/githost": "0.1
|
|
134
|
-
"@intellectual-frontiers/kanon": "0.
|
|
135
|
-
"@intellectual-frontiers/mizan": "0.1
|
|
136
|
-
"@intellectual-frontiers/net": "0.1
|
|
137
|
-
"@intellectual-frontiers/ontology": "0.
|
|
138
|
-
"@intellectual-frontiers/quality": "0.
|
|
139
|
-
"@intellectual-frontiers/rdf": "0.1
|
|
140
|
-
"@intellectual-frontiers/system": "0.1
|
|
141
|
-
"@intellectual-frontiers/terminal": "0.1
|
|
145
|
+
"@intellectual-frontiers/core": "0.2.1",
|
|
146
|
+
"@intellectual-frontiers/crypto": "0.2.1",
|
|
147
|
+
"@intellectual-frontiers/formats": "0.2.1",
|
|
148
|
+
"@intellectual-frontiers/githost": "0.2.1",
|
|
149
|
+
"@intellectual-frontiers/kanon": "0.3.1",
|
|
150
|
+
"@intellectual-frontiers/mizan": "0.2.1",
|
|
151
|
+
"@intellectual-frontiers/net": "0.2.1",
|
|
152
|
+
"@intellectual-frontiers/ontology": "0.4.1",
|
|
153
|
+
"@intellectual-frontiers/quality": "0.3.1",
|
|
154
|
+
"@intellectual-frontiers/rdf": "0.2.1",
|
|
155
|
+
"@intellectual-frontiers/system": "0.2.1",
|
|
156
|
+
"@intellectual-frontiers/terminal": "0.2.1"
|
|
142
157
|
},
|
|
143
158
|
"files": [
|
|
144
159
|
"dist",
|
package/src/affected.ts
CHANGED
|
@@ -37,7 +37,7 @@ import { type Library, readLibraries } from "./libraries.ts";
|
|
|
37
37
|
|
|
38
38
|
/** What a library reads: its folder, the folders and files it takes from others, what it depends on, and the files it imports one by one. */
|
|
39
39
|
export type Inputs = {
|
|
40
|
-
/** The paths of the library's inputs: `commons/<name>/` and each folder (`commons/
|
|
40
|
+
/** The paths of the library's inputs: `commons/<name>/` and each folder (`commons/core/src/**`) or file the library takes from another. */
|
|
41
41
|
readonly paths: readonly string[];
|
|
42
42
|
/** The folders of commons that the library depends on through its package. */
|
|
43
43
|
readonly dependsOn: readonly string[];
|
package/src/changes.ts
CHANGED
|
@@ -80,6 +80,7 @@ import { readSpecTexts } from "@intellectual-frontiers/mizan/spec-files";
|
|
|
80
80
|
import { packagingTerms } from "@intellectual-frontiers/ontology/audit";
|
|
81
81
|
import * as ifccmOntology from "@intellectual-frontiers/ontology/ifccm";
|
|
82
82
|
import * as ifqsOntology from "@intellectual-frontiers/ontology/ifqs";
|
|
83
|
+
import * as otoOntology from "@intellectual-frontiers/ontology/oto";
|
|
83
84
|
import { terms } from "@intellectual-frontiers/ontology/mizan";
|
|
84
85
|
|
|
85
86
|
/** One rule's result in a run of the check (0020-ifccm FR-031): its findings, or the reason it did not run. Its shape is the quality system's `CheckRule`, so a caller keeps it as a record without this file knowing the quality system. */
|
|
@@ -174,7 +175,7 @@ function sourcesUnder(root: string): readonly { readonly path: string; readonly
|
|
|
174
175
|
|
|
175
176
|
/** The citations of requirements by the terms of commons' own ontologies (`mz:definedBy`), for the chain's third stage (`--terms commons`, and the default of `--trace`). */
|
|
176
177
|
function termCitations(): readonly { readonly term: string; readonly cites: readonly string[]; readonly file: string }[] {
|
|
177
|
-
return [...terms, ...packagingTerms, ...ifccmOntology.terms, ...ifqsOntology.terms].map((t) => ({
|
|
178
|
+
return [...terms, ...packagingTerms, ...ifccmOntology.terms, ...ifqsOntology.terms, ...otoOntology.terms].map((t) => ({
|
|
178
179
|
term: t.values.termIri,
|
|
179
180
|
cites: t.values.definedBy ?? [],
|
|
180
181
|
file: "commons/ontology",
|
package/src/check.ts
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
import * as ifccmOntology from "@intellectual-frontiers/ontology/ifccm";
|
|
39
39
|
import * as ifrOntology from "@intellectual-frontiers/ontology/ifr";
|
|
40
40
|
import * as ifqsOntology from "@intellectual-frontiers/ontology/ifqs";
|
|
41
|
+
import * as otoOntology from "@intellectual-frontiers/ontology/oto";
|
|
41
42
|
import { pm } from "@intellectual-frontiers/ontology/supply-chain/packaging";
|
|
42
43
|
import { type RulePlugin, rulePlugins } from "@intellectual-frontiers/mizan/rules";
|
|
43
44
|
import { holdHarness } from "@intellectual-frontiers/mizan/harness";
|
|
@@ -73,7 +74,7 @@ export function termRecordsOf(audit: readonly (typeof terms)[number][]): readonl
|
|
|
73
74
|
|
|
74
75
|
/** Mizan's own terms and the packaging ontology's as the rules read them. */
|
|
75
76
|
export function mizanTermRecords(): readonly TermRecord[] {
|
|
76
|
-
return termRecordsOf([...terms, ...packagingTerms, ...ifccmOntology.terms, ...ifqsOntology.terms, ...ifrOntology.terms]);
|
|
77
|
+
return termRecordsOf([...terms, ...packagingTerms, ...ifccmOntology.terms, ...ifqsOntology.terms, ...otoOntology.terms, ...ifrOntology.terms]);
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
/** The prefixes of commons' own ontologies and their namespaces. */
|
|
@@ -82,6 +83,7 @@ const PREFIXES = {
|
|
|
82
83
|
pm: "https://www.intellectualfrontiers.com/ontology/packaging#",
|
|
83
84
|
ifccm: ifccmOntology.IFCCM.iri,
|
|
84
85
|
ifqs: ifqsOntology.IFQS.iri,
|
|
86
|
+
oto: otoOntology.OTO.iri,
|
|
85
87
|
ifr: ifrOntology.IFR.iri,
|
|
86
88
|
} as const;
|
|
87
89
|
|
|
@@ -94,7 +96,7 @@ function curieOf(iri: string): string {
|
|
|
94
96
|
/** The deprecated terms of commons' own ontologies, by CURIE, with what replaces each (0018-standards-first): a specification that names one is found. */
|
|
95
97
|
export function deprecatedTerms(): ReadonlyMap<string, string> {
|
|
96
98
|
return new Map(
|
|
97
|
-
[...terms, ...packagingTerms, ...ifccmOntology.terms, ...ifqsOntology.terms, ...ifrOntology.terms].flatMap((t) =>
|
|
99
|
+
[...terms, ...packagingTerms, ...ifccmOntology.terms, ...ifqsOntology.terms, ...otoOntology.terms, ...ifrOntology.terms].flatMap((t) =>
|
|
98
100
|
t.values.deprecatedOn === undefined ? [] : [[curieOf(t.values.termIri), curieOf(t.values.replacedBy ?? "")] as const],
|
|
99
101
|
),
|
|
100
102
|
);
|
|
@@ -152,6 +154,11 @@ export function main(
|
|
|
152
154
|
ontology: ifqsOntology.classes.map((c) => c.iri),
|
|
153
155
|
recorded: ifqsOntology.terms.map((t) => t.values.termIri),
|
|
154
156
|
},
|
|
157
|
+
{
|
|
158
|
+
file: "commons/ontology/src/oto/oto.ts",
|
|
159
|
+
ontology: otoOntology.classes.map((c) => c.iri),
|
|
160
|
+
recorded: otoOntology.terms.map((t) => t.values.termIri),
|
|
161
|
+
},
|
|
155
162
|
{
|
|
156
163
|
file: "commons/ontology/src/ifr/ifr.ts",
|
|
157
164
|
ontology: ifrOntology.classes.map((c) => c.iri),
|
|
@@ -172,6 +179,18 @@ export function main(
|
|
|
172
179
|
...Object.keys(audienceModels),
|
|
173
180
|
]),
|
|
174
181
|
pm: new Set(Object.keys(pm)),
|
|
182
|
+
oto: new Set([
|
|
183
|
+
...Object.keys(otoOntology.oto),
|
|
184
|
+
...[
|
|
185
|
+
otoOntology.domains,
|
|
186
|
+
otoOntology.invariants,
|
|
187
|
+
otoOntology.pillars,
|
|
188
|
+
otoOntology.principles,
|
|
189
|
+
otoOntology.maturityLevels,
|
|
190
|
+
otoOntology.dimensions,
|
|
191
|
+
otoOntology.alignmentStates,
|
|
192
|
+
].flatMap((l) => Object.keys(l)),
|
|
193
|
+
]),
|
|
175
194
|
ifr: ifrOntology.termNames,
|
|
176
195
|
ifccm: new Set([
|
|
177
196
|
...Object.keys(ifccmOntology.ifccm),
|
package/src/dev.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @remarks
|
|
13
13
|
* Nothing is installed per library. The repository's root installs the packages every library shares (`bun install`, once), the libraries are linked under `commons/node_modules` (a link for each folder whose package
|
|
14
|
-
* name is `@intellectual-frontiers/<folder
|
|
14
|
+
* name is `@intellectual-frontiers/<folder>`), so that a library that imports another by its package name reads the checkout's source, never a copy from a
|
|
15
15
|
* registry: the `exports` of each package are the sources. A library with a package of its own outside the shared set (a database driver) is installed in its folder, once. The affected libraries are those of
|
|
16
16
|
* `affected.ts` (the same code the workflow of CI runs); TypeScript 7 checks each library's own `tsconfig.json`, several at a time, and the tests of each run in a `bun test` process of its own, from its folder as `verify` runs them, several at a time.
|
|
17
17
|
*
|
package/src/generate-ontology.ts
CHANGED
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
import * as ifccmOntology from "@intellectual-frontiers/ontology/ifccm";
|
|
38
38
|
import * as ifrOntology from "@intellectual-frontiers/ontology/ifr";
|
|
39
39
|
import * as ifqsOntology from "@intellectual-frontiers/ontology/ifqs";
|
|
40
|
+
import * as otoOntology from "@intellectual-frontiers/ontology/oto";
|
|
40
41
|
import * as kanonOntology from "@intellectual-frontiers/ontology/kanon";
|
|
41
42
|
import { formatRdfFinding, type OntologyFile, validate } from "@intellectual-frontiers/rdf";
|
|
42
43
|
import { stdio } from "@intellectual-frontiers/system";
|
|
@@ -208,6 +209,46 @@ export const IFQS: OntologyPublication = {
|
|
|
208
209
|
license: CC0,
|
|
209
210
|
};
|
|
210
211
|
|
|
212
|
+
/** The Operational Truth Ontology (commons ontology 0002-oto), as it is published. */
|
|
213
|
+
export const OTO: OntologyPublication = {
|
|
214
|
+
name: "oto",
|
|
215
|
+
ns: { prefix: "oto", iri: otoOntology.OTO.iri },
|
|
216
|
+
idNs: { prefix: "mzid", iri: MZID.iri },
|
|
217
|
+
curies: [
|
|
218
|
+
["oto", otoOntology.OTO.iri],
|
|
219
|
+
["ifqs", ifqsOntology.IFQS.iri],
|
|
220
|
+
["mz", MZ.iri],
|
|
221
|
+
["xsd", "http://www.w3.org/2001/XMLSchema#"],
|
|
222
|
+
["rdfs", "http://www.w3.org/2000/01/rdf-schema#"],
|
|
223
|
+
["skos", "http://www.w3.org/2004/02/skos/core#"],
|
|
224
|
+
["dcterms", "http://purl.org/dc/terms/"],
|
|
225
|
+
["prov", "http://www.w3.org/ns/prov#"],
|
|
226
|
+
],
|
|
227
|
+
files: otoOntology.files,
|
|
228
|
+
ontology: otoOntology.otoOntology,
|
|
229
|
+
classes: otoOntology.classes,
|
|
230
|
+
properties: otoOntology.properties,
|
|
231
|
+
terms: otoOntology.terms,
|
|
232
|
+
schemas: [otoOntology.DomainSchema, otoOntology.MaturityLevelSchema, otoOntology.Alignment],
|
|
233
|
+
lists: listsOf("oto", [
|
|
234
|
+
["Domain", otoOntology.domains],
|
|
235
|
+
["Invariant", otoOntology.invariants],
|
|
236
|
+
["Pillar", otoOntology.pillars],
|
|
237
|
+
["Principle", otoOntology.principles],
|
|
238
|
+
["MaturityLevel", otoOntology.maturityLevels],
|
|
239
|
+
["Dimension", otoOntology.dimensions],
|
|
240
|
+
["AlignmentState", otoOntology.alignmentStates],
|
|
241
|
+
]),
|
|
242
|
+
source: "commons/ontology/src/oto/*.ts",
|
|
243
|
+
run: RUN,
|
|
244
|
+
shapes: { prefix: "otosh", iri: "https://www.intellectualfrontiers.com/ontology/oto-shapes#" },
|
|
245
|
+
schemasIri: "https://www.intellectualfrontiers.com/ontology/oto-schemas",
|
|
246
|
+
sssomSetId: "https://www.intellectualfrontiers.com/ontology/oto-mappings",
|
|
247
|
+
sssomCuries: { dcterms: "http://purl.org/dc/terms/", prov: "http://www.w3.org/ns/prov#", ifqs: ifqsOntology.IFQS.iri },
|
|
248
|
+
viewTitle: "Operational Truth Ontology",
|
|
249
|
+
license: CC0,
|
|
250
|
+
};
|
|
251
|
+
|
|
211
252
|
/** The ontology of Intellectual Frontiers Releases (commons 0026-works-versioning), as it is published. */
|
|
212
253
|
export const IFR: OntologyPublication = {
|
|
213
254
|
name: "ifr",
|
|
@@ -279,7 +320,7 @@ export const KANON: OntologyPublication = {
|
|
|
279
320
|
};
|
|
280
321
|
|
|
281
322
|
/** The ontologies of commons that are published, each from its own typed modules: Mizan's, then the ones its specifications define. */
|
|
282
|
-
export const publications: readonly OntologyPublication[] = [MIZAN, IFCCM, IFQS, IFR, KANON];
|
|
323
|
+
export const publications: readonly OntologyPublication[] = [MIZAN, IFCCM, IFQS, OTO, IFR, KANON];
|
|
283
324
|
|
|
284
325
|
/** Where the generated files are downloaded from: this repository's `commons/` folder on its default branch. */
|
|
285
326
|
const DOWNLOAD_BASE = "https://raw.githubusercontent.com/intellectual-frontiers/.github/main/commons/";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# AUTO-GENERATED with ../../../ontology/src/standards/nist-sp-800-53/controls.auto.ts by commons/mizan/src/integrations/pure/import-oscal-catalog.ts (commons 0019-mizan-integrations FR-009). Do not edit.
|
|
2
|
+
|
|
3
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
4
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
5
|
+
|
|
6
|
+
<urn:ifc:mizan:module:nist-sp-800-53> a prov:Entity ;
|
|
7
|
+
dcterms:source "../../../ontology/src/standards/nist-sp-800-53/controls.auto.ts" ;
|
|
8
|
+
prov:wasGeneratedBy <urn:ifc:mizan:import:nist-sp-800-53:64ca6b4161de51ab6af098a7d101d326f14c95e1abf721396cd8a049e8115eeb> ;
|
|
9
|
+
prov:wasDerivedFrom <urn:sha256:64ca6b4161de51ab6af098a7d101d326f14c95e1abf721396cd8a049e8115eeb> .
|
|
10
|
+
|
|
11
|
+
<urn:ifc:mizan:import:nist-sp-800-53:64ca6b4161de51ab6af098a7d101d326f14c95e1abf721396cd8a049e8115eeb> a prov:Activity ;
|
|
12
|
+
prov:used <urn:sha256:64ca6b4161de51ab6af098a7d101d326f14c95e1abf721396cd8a049e8115eeb> ;
|
|
13
|
+
prov:wasAssociatedWith <urn:ifc:mizan:generator:commons:mizan:src:integrations:pure:import-oscal-catalog.ts> .
|
|
14
|
+
|
|
15
|
+
<urn:ifc:mizan:generator:commons:mizan:src:integrations:pure:import-oscal-catalog.ts> a prov:SoftwareAgent .
|
|
16
|
+
|
|
17
|
+
<urn:sha256:64ca6b4161de51ab6af098a7d101d326f14c95e1abf721396cd8a049e8115eeb> a prov:Entity ;
|
|
18
|
+
dcterms:title "NIST SP 800-53 Rev. 5.2.0 (OSCAL catalog)" ;
|
|
19
|
+
dcterms:publisher "National Institute of Standards and Technology" ;
|
|
20
|
+
dcterms:hasVersion "5.2.0" ;
|
|
21
|
+
dcterms:source <https://raw.githubusercontent.com/usnistgov/oscal-content/f0de6d8d8c059d374f15e0ae07508d82e370fc1d/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json> ;
|
|
22
|
+
dcterms:license <https://spdx.org/licenses/Public domain (a work of the United States Government, 17 U.S.C. 105).html> .
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# AUTO-GENERATED with ../../../ontology/src/supply-chain/packaging/schema.auto.ts by commons/mizan/src/integrations/pure/import-vocabulary.ts (commons 0019-mizan-integrations FR-009). Do not edit.
|
|
2
|
+
|
|
3
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
4
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
5
|
+
|
|
6
|
+
<urn:ifc:mizan:module:schema-org> a prov:Entity ;
|
|
7
|
+
dcterms:source "../../../ontology/src/supply-chain/packaging/schema.auto.ts" ;
|
|
8
|
+
prov:wasGeneratedBy <urn:ifc:mizan:import:schema-org:7f15ca89398c4f235f478a4b3b8d1f975d63c5a860b77c8a8fce01f791b7ae2f> ;
|
|
9
|
+
prov:wasDerivedFrom <urn:sha256:7f15ca89398c4f235f478a4b3b8d1f975d63c5a860b77c8a8fce01f791b7ae2f> .
|
|
10
|
+
|
|
11
|
+
<urn:ifc:mizan:import:schema-org:7f15ca89398c4f235f478a4b3b8d1f975d63c5a860b77c8a8fce01f791b7ae2f> a prov:Activity ;
|
|
12
|
+
prov:used <urn:sha256:7f15ca89398c4f235f478a4b3b8d1f975d63c5a860b77c8a8fce01f791b7ae2f> ;
|
|
13
|
+
prov:wasAssociatedWith <urn:ifc:mizan:generator:commons:mizan:src:integrations:pure:import-vocabulary.ts> .
|
|
14
|
+
|
|
15
|
+
<urn:ifc:mizan:generator:commons:mizan:src:integrations:pure:import-vocabulary.ts> a prov:SoftwareAgent .
|
|
16
|
+
|
|
17
|
+
<urn:sha256:7f15ca89398c4f235f478a4b3b8d1f975d63c5a860b77c8a8fce01f791b7ae2f> a prov:Entity ;
|
|
18
|
+
dcterms:title "schema.org" ;
|
|
19
|
+
dcterms:publisher "Schema.org Community Group" ;
|
|
20
|
+
dcterms:hasVersion "30.1" ;
|
|
21
|
+
dcterms:source <https://schema.org/version/30.1/schemaorg-current-https.ttl> ;
|
|
22
|
+
dcterms:license <https://spdx.org/licenses/CC-BY-SA-3.0.html> .
|
package/src/install-bun.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bun at the version commons pins (its version, address, SHA-256, format and folder per platform in `commons/generated/pins.auto.env`, commons
|
|
3
|
-
* 0005-typescript-
|
|
3
|
+
* 0005-typescript-practice FR-026, 0002-packaging FR-019), fetched from that address with retries, kept only where its SHA-256 is the pinned one, unpacked by the
|
|
4
4
|
* kernel's own zip reader and put in a folder; nothing but IFC TypeScript itself, so it runs on Node 26 (or Bun) on Linux, macOS
|
|
5
5
|
* and Windows with no shell, no Python and no unzip. CI's `.github/actions/bun` runs it.
|
|
6
6
|
*
|
package/src/libraries.ts
CHANGED
|
@@ -39,6 +39,8 @@ import {
|
|
|
39
39
|
string,
|
|
40
40
|
err,
|
|
41
41
|
ok,
|
|
42
|
+
refine,
|
|
43
|
+
type Brand,
|
|
42
44
|
type Result,
|
|
43
45
|
} from "@intellectual-frontiers/core";
|
|
44
46
|
import { parseSpdxId, type SpdxId } from "./license/standard.ts";
|
|
@@ -93,8 +95,52 @@ export type Library = {
|
|
|
93
95
|
readonly family?: LibraryFamily;
|
|
94
96
|
/** The license its `LICENSE` and its packed `package.json` carry, where it is not the default of the repository (`license/standard.ts`; commons 0035-licensing FR-003). */
|
|
95
97
|
readonly license?: SpdxId;
|
|
98
|
+
/** The constants of its sources that say its own version (`ERGONEX_VERSION`), each a file from the library's folder and the name of the constant: the release rewrites them with the version, and a check finds one that disagrees. */
|
|
99
|
+
readonly versionConstants?: readonly VersionConstant[];
|
|
100
|
+
/** The package the library publishes where it is not `@intellectual-frontiers/<name>` (the `data` library publishes `@intellectual-frontiers/arcactl`; commons 0036-distribution FR-009). */
|
|
101
|
+
readonly publishes?: PackageName;
|
|
102
|
+
/** Why the library is kept out of the release: it is verified and packed like any other, and has no release record entry, no tag, no set and no registry (FR-0xx of 0001-libraries). */
|
|
103
|
+
readonly held?: HeldReason;
|
|
104
|
+
/** The set the library is, where it is a metapackage: a folder with no code of its own whose package depends on the libraries of the set at exact versions (commons 0036-distribution FR-005). */
|
|
105
|
+
readonly bundle?: BundleName;
|
|
96
106
|
};
|
|
97
107
|
|
|
108
|
+
/** The reason a library is held out of the release: a non-empty sentence, made only by {@link parseHeldReason}. */
|
|
109
|
+
export type HeldReason = Brand<string, "held reason">;
|
|
110
|
+
const heldDecoder = refine(string, "held reason", (t) => t.trim() !== "" && t.trim() === t && !t.includes("\n"));
|
|
111
|
+
|
|
112
|
+
/** A held reason from text, or why the text is not one. */
|
|
113
|
+
export function parseHeldReason(text: string): Result<HeldReason, string> {
|
|
114
|
+
const r = heldDecoder(text, "held");
|
|
115
|
+
return r.kind === "ok" ? ok(r.value) : err("library.held is one non-empty line that says why the library is kept out of the release");
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** The scope of the packages of commons. */
|
|
119
|
+
export const PACKAGE_SCOPE = "@intellectual-frontiers/";
|
|
120
|
+
|
|
121
|
+
/** The sets that a metapackage is: the whole of commons, and the four roles of the libraries; a closed union, and the name of the folder and of the package of each. */
|
|
122
|
+
export const BUNDLES = ["commons", "foundation", "patterns", "programs", "standards"] as const;
|
|
123
|
+
/** The name of a set of libraries a metapackage is. */
|
|
124
|
+
export type BundleName = (typeof BUNDLES)[number];
|
|
125
|
+
|
|
126
|
+
/** The name of a package of commons: `@intellectual-frontiers/` and a name, made only by {@link parsePackageName}. */
|
|
127
|
+
export type PackageName = Brand<string, "package name">;
|
|
128
|
+
const packageNameDecoder = refine(string, "package name", (t) => /^@intellectual-frontiers\/[a-z][a-z0-9-]*$/.test(t));
|
|
129
|
+
|
|
130
|
+
/** A package name of commons from text, or why the text is not one. */
|
|
131
|
+
export function parsePackageName(text: string): Result<PackageName, string> {
|
|
132
|
+
const r = packageNameDecoder(text, "package");
|
|
133
|
+
return r.kind === "ok" ? ok(r.value) : err(`${JSON.stringify(text)} is not a package of commons (@intellectual-frontiers/ and a name of lower-case letters, digits and hyphens)`);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** The package a library publishes: the one its manifest names in `publishes`, else `@intellectual-frontiers/<name>` (commons 0036-distribution FR-009). */
|
|
137
|
+
export function publishedPackage(l: Pick<Library, "name" | "publishes">): string {
|
|
138
|
+
return l.publishes ?? `${PACKAGE_SCOPE}${l.name}`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** A constant of a library's sources that holds the library's version: the file (from the library's folder) and the constant's name. */
|
|
142
|
+
export type VersionConstant = { readonly file: string; readonly name: string };
|
|
143
|
+
|
|
98
144
|
/** The lowest conformance level that requires a library to declare `kanon`; none yet (0033-kanon FR-014, OQ-1): a level asks for it by naming itself here. */
|
|
99
145
|
export const KANON_REQUIRED_FROM: LevelKey | undefined = undefined;
|
|
100
146
|
|
|
@@ -117,11 +163,18 @@ const nameDecoder: Decoder<string> = (input, path = "$") => {
|
|
|
117
163
|
? r
|
|
118
164
|
: err({ kind: "decode", path, expected: "a name of lower-case letters, digits and hyphens", found: describe(input) });
|
|
119
165
|
};
|
|
166
|
+
const constantName: Decoder<string> = (input, path = "$") => {
|
|
167
|
+
const r = string(input, path);
|
|
168
|
+
if (r.kind === "err") return r;
|
|
169
|
+
return /^[A-Za-z_][A-Za-z0-9_]*$/.test(r.value)
|
|
170
|
+
? r
|
|
171
|
+
: err({ kind: "decode", path, expected: "the name of a constant: letters, digits and underscores", found: describe(input) });
|
|
172
|
+
};
|
|
120
173
|
const body = object(
|
|
121
174
|
{ name: nameDecoder, verify: nonEmpty, version: nonEmpty, exports: array(nonEmpty) },
|
|
122
|
-
{ level: literal(...LEVELS), specKit: nonEmpty, summary: nonEmpty, distribution: array(literal(...REGISTRIES)), kanon: unknownValue, family: object({ host: nonEmpty, role: literal(...ROLES) }), license: nonEmpty },
|
|
175
|
+
{ level: literal(...LEVELS), specKit: nonEmpty, summary: nonEmpty, distribution: array(literal(...REGISTRIES)), kanon: unknownValue, family: object({ host: nonEmpty, role: literal(...ROLES) }), license: nonEmpty, versionConstants: array(object({ file: nonEmpty, name: constantName })), publishes: nonEmpty, bundle: literal(...BUNDLES), held: string },
|
|
123
176
|
);
|
|
124
|
-
const FIELDS = ["name", "level", "specKit", "verify", "version", "exports", "summary", "distribution", "kanon", "family", "license"] as const;
|
|
177
|
+
const FIELDS = ["name", "level", "specKit", "verify", "version", "exports", "summary", "distribution", "kanon", "family", "license", "versionConstants", "publishes", "bundle", "held"] as const;
|
|
125
178
|
|
|
126
179
|
/** The manifest read from the text of its file: `export const library = { ... }` and no other export, read as data and never run (0027-commons-libraries FR-012). */
|
|
127
180
|
export function decodeLibrarySource(source: string): Result<Library, string> {
|
|
@@ -139,9 +192,16 @@ export function decodeLibrarySource(source: string): Result<Library, string> {
|
|
|
139
192
|
if (r.kind === "err") return err(formatDecodeError(r.error));
|
|
140
193
|
const v = r.value;
|
|
141
194
|
const distribution = v.distribution ?? DEFAULT_DISTRIBUTION;
|
|
142
|
-
|
|
195
|
+
let held: HeldReason | undefined;
|
|
196
|
+
if (v.held !== undefined) {
|
|
197
|
+
const h = parseHeldReason(v.held);
|
|
198
|
+
if (h.kind === "err") return err(h.error);
|
|
199
|
+
held = h.value;
|
|
200
|
+
if (v.publishes !== undefined || v.bundle !== undefined) return err("library.held is not given with library.publishes or library.bundle: a held library is published nowhere");
|
|
201
|
+
}
|
|
202
|
+
if (held === undefined && (distribution.length === 0 || new Set(distribution).size !== distribution.length))
|
|
143
203
|
return err("library.distribution lists each registry once and at least one (FR-015)");
|
|
144
|
-
if (!distribution.includes("github"))
|
|
204
|
+
if (held === undefined && !distribution.includes("github"))
|
|
145
205
|
return err(
|
|
146
206
|
"library.distribution includes github: a library is published to the GitHub package registry whatever else it is published to (FR-015, FR-016)",
|
|
147
207
|
);
|
|
@@ -163,6 +223,15 @@ export function decodeLibrarySource(source: string): Result<Library, string> {
|
|
|
163
223
|
if (l.kind === "err") return err(`library.license: ${l.error}`);
|
|
164
224
|
license = l.value;
|
|
165
225
|
}
|
|
226
|
+
let publishes: PackageName | undefined;
|
|
227
|
+
if (v.publishes !== undefined) {
|
|
228
|
+
const p = parsePackageName(v.publishes);
|
|
229
|
+
if (p.kind === "err") return err(`library.publishes: ${p.error}`);
|
|
230
|
+
publishes = p.value;
|
|
231
|
+
}
|
|
232
|
+
if (v.bundle !== undefined && v.bundle !== v.name)
|
|
233
|
+
return err(`library.bundle ${v.bundle} is the set of the metapackage of that name: the folder is named ${v.bundle}, and this one is ${v.name} (0036-distribution FR-005)`);
|
|
234
|
+
if (v.bundle !== undefined && publishes !== undefined) return err("library.bundle and library.publishes are not both given: a metapackage publishes the package of its folder (0036-distribution FR-005)");
|
|
166
235
|
return ok({
|
|
167
236
|
name: v.name,
|
|
168
237
|
level: v.level ?? DEFAULT_LIBRARY_LEVEL,
|
|
@@ -175,6 +244,10 @@ export function decodeLibrarySource(source: string): Result<Library, string> {
|
|
|
175
244
|
...(kanon === undefined ? {} : { kanon }),
|
|
176
245
|
...(family === undefined ? {} : { family }),
|
|
177
246
|
...(license === undefined ? {} : { license }),
|
|
247
|
+
...(v.versionConstants === undefined ? {} : { versionConstants: v.versionConstants }),
|
|
248
|
+
...(publishes === undefined ? {} : { publishes }),
|
|
249
|
+
...(v.bundle === undefined ? {} : { bundle: v.bundle }),
|
|
250
|
+
...(held === undefined ? {} : { held }),
|
|
178
251
|
});
|
|
179
252
|
}
|
|
180
253
|
|
|
@@ -305,8 +378,10 @@ const list = (items: readonly string[]): string => {
|
|
|
305
378
|
export function requirementOf(id: string, l: Library): string {
|
|
306
379
|
const kit = l.specKit === undefined ? "" : `, its spec kit at \`commons/${l.name}/${l.specKit}\``;
|
|
307
380
|
const summary = l.summary === undefined ? "" : ` ${l.summary}`;
|
|
308
|
-
const where = l.distribution.map((r) => REGISTRY_NAME[r]).join(" and ")
|
|
309
|
-
|
|
381
|
+
const where = l.held === undefined ? l.distribution.map((r) => REGISTRY_NAME[r]).join(" and ") : `no registry (held out of the release: ${l.held})`;
|
|
382
|
+
const own = l.publishes === undefined ? `@intellectual-frontiers/${l.name}` : l.publishes;
|
|
383
|
+
const sets = l.bundle === undefined ? "" : `, a metapackage with no code of its own (the set ${l.bundle}, 0036-distribution FR-005)`;
|
|
384
|
+
return `- **${id}**: \`commons/${l.name}\` MUST be a library at conformance level ${l.level} (\`${LEVEL_TERM[l.level]}\`): the package \`${own}\`${sets} at version \`${l.version}\`${kit}, exporting ${list(l.exports)}, published to ${where}, proved by \`cd commons/${l.name} && ${l.verify}\`.${summary}`;
|
|
310
385
|
}
|
|
311
386
|
|
|
312
387
|
/** The row of `enforcement.tsv` of a library's requirement. */
|
|
@@ -327,13 +402,18 @@ export function idsIn(spec: string): ReadonlyMap<string, string> {
|
|
|
327
402
|
return out;
|
|
328
403
|
}
|
|
329
404
|
|
|
330
|
-
/**
|
|
405
|
+
/**
|
|
406
|
+
* The id each library has: the one it had, or the next number after the greatest. A number belongs to the first library that holds it in the specification: where a second one holds it (two branches each gave the next number to a
|
|
407
|
+
* library, and a merge kept both), the second is given the next number after the greatest, so that the generator makes the section again with one number for each library.
|
|
408
|
+
*/
|
|
331
409
|
export function idsFor(libraries: readonly Library[], had: ReadonlyMap<string, string>): ReadonlyMap<string, string> {
|
|
332
410
|
const out = new Map<string, string>();
|
|
411
|
+
const first = new Map<string, string>();
|
|
412
|
+
for (const [name, id] of had) if (!first.has(id)) first.set(id, name);
|
|
333
413
|
let next = Math.max(FIRST_GENERATED - 1, ...[...had.values()].map((id) => Number(id.slice(3)))) + 1;
|
|
334
414
|
for (const l of libraries) {
|
|
335
415
|
const id = had.get(l.name);
|
|
336
|
-
if (id !== undefined) out.set(l.name, id);
|
|
416
|
+
if (id !== undefined && first.get(id) === l.name) out.set(l.name, id);
|
|
337
417
|
else out.set(l.name, `FR-${String(next++).padStart(3, "0")}`);
|
|
338
418
|
}
|
|
339
419
|
return out;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# PolyForm Noncommercial License 1.0.0
|
|
2
|
+
|
|
3
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
8
|
+
|
|
9
|
+
## Copyright License
|
|
10
|
+
|
|
11
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
12
|
+
|
|
13
|
+
## Distribution License
|
|
14
|
+
|
|
15
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
16
|
+
|
|
17
|
+
## Notices
|
|
18
|
+
|
|
19
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
20
|
+
|
|
21
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
22
|
+
|
|
23
|
+
## Changes and New Works License
|
|
24
|
+
|
|
25
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
26
|
+
|
|
27
|
+
## Patent License
|
|
28
|
+
|
|
29
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
30
|
+
|
|
31
|
+
## Noncommercial Purposes
|
|
32
|
+
|
|
33
|
+
Any noncommercial purpose is a permitted purpose.
|
|
34
|
+
|
|
35
|
+
## Personal Uses
|
|
36
|
+
|
|
37
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
38
|
+
|
|
39
|
+
## Noncommercial Organizations
|
|
40
|
+
|
|
41
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
42
|
+
|
|
43
|
+
## Fair Use
|
|
44
|
+
|
|
45
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
46
|
+
|
|
47
|
+
## No Other Rights
|
|
48
|
+
|
|
49
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
50
|
+
|
|
51
|
+
## Patent Defense
|
|
52
|
+
|
|
53
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
54
|
+
|
|
55
|
+
## Violations
|
|
56
|
+
|
|
57
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
58
|
+
|
|
59
|
+
## No Liability
|
|
60
|
+
|
|
61
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
62
|
+
|
|
63
|
+
## Definitions
|
|
64
|
+
|
|
65
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
66
|
+
|
|
67
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
68
|
+
|
|
69
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
70
|
+
|
|
71
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
72
|
+
|
|
73
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
package/src/link.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* bun commons/libraries/src/link.ts link what is not linked, from the repository above this folder (or --repo DIR)
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* A folder of `commons/` whose `package.json` is named `@intellectual-frontiers/<name>` is linked as that name
|
|
9
|
+
* A folder of `commons/` whose `package.json` is named `@intellectual-frontiers/<name>` is linked as that name (the metapackage `commons/commons` bears `@intellectual-frontiers/commons`). A link
|
|
10
10
|
* that is there is left as it is. Only the built-ins of Node are used, so it runs on Bun and on Node 26 before anything is installed.
|
|
11
11
|
*
|
|
12
12
|
* @limits
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* @example
|
|
16
16
|
* ```ts
|
|
17
17
|
* import { linksOf } from "./link.ts";
|
|
18
|
-
* linksOf(".").get("@intellectual-frontiers/commons"); // the path of commons/
|
|
18
|
+
* linksOf(".").get("@intellectual-frontiers/commons"); // the path of commons/commons
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
21
|
* Spec: 0001-libraries FR-011
|
|
@@ -38,13 +38,13 @@ const nameOf = (file: string): string | undefined => {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
/** The packages of commons by name and the folder of each
|
|
41
|
+
/** The packages of commons by name and the folder of each. */
|
|
42
42
|
export function linksOf(repo: string): ReadonlyMap<string, string> {
|
|
43
43
|
const links = new Map<string, string>();
|
|
44
44
|
const dirs = readdirSync(join(repo, "commons"), { withFileTypes: true })
|
|
45
45
|
.filter((e) => e.isDirectory() && e.name !== "node_modules")
|
|
46
46
|
.map((e) => e.name)
|
|
47
|
-
.sort((a, b) => (a
|
|
47
|
+
.sort((a, b) => (a < b ? -1 : 1));
|
|
48
48
|
for (const d of dirs) {
|
|
49
49
|
const name = nameOf(join(repo, "commons", d, "package.json"));
|
|
50
50
|
if (name !== undefined && name.startsWith(SCOPE) && !links.has(name)) links.set(name, join(repo, "commons", d));
|