A7 N-2, §411: the-private-network's TypeScript contract regenerated as index.js and index.d.ts; no artifact keeps a series

Builds: design 47 G §339, §341, §411
Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-12 04:57:49 +01:00
parent ca6d8cd8eb
commit 7ebd665c76
7 changed files with 46 additions and 20 deletions
@@ -10,7 +10,6 @@
"paths": [
"go/seats/theprivatenetwork"
],
"series": "0.1",
"generated-from": "."
},
{
@@ -20,7 +19,6 @@
"paths": [
"ts/seats/theprivatenetwork"
],
"series": "0.1",
"generated-from": "."
}
]
@@ -2,7 +2,7 @@
// The contract of the seat "the-private-network", defined whole (seats/the-private-network/seat.json): The seat of the private network (ADR 0110): the one network the mesh runs over, which a machine can have only one of; the mesh provides its holder itself and the provision carries no fields.
export const seat = "the-private-network";
export declare const seat: "the-private-network";
/** is the form of the provision private-network. */
export type PrivateNetworkForm = Record<string, unknown>;
@@ -0,0 +1,6 @@
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "the-private-network", defined whole (seats/the-private-network/seat.json): The seat of the private network (ADR 0110): the one network the mesh runs over, which a machine can have only one of; the mesh provides its holder itself and the provision carries no fields.
export const seat = "the-private-network";
@@ -1,13 +1,18 @@
{
"description": "The contract of the seat the-private-network, generated from its definition.",
"exports": {
".": "./src/index.ts"
".": {
"default": "./index.js",
"types": "./index.d.ts"
}
},
"files": [
"src"
"index.js",
"index.d.ts",
"parts"
],
"name": "@novox/mesh-connectivity-contracts-the-private-network",
"type": "module",
"types": "./src/index.ts",
"types": "./index.d.ts",
"version": "0.1.0"
}
@@ -1,12 +0,0 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noEmit": true,
"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*.ts"]
}
@@ -74,3 +74,33 @@ func TestEveryProvisionTheModuleOffersSaysItsCredentialForm(t *testing.T) {
}
}
}
// Design 47 G §411, §339, §341: no artifact of this repository's manifests keeps a `series` (one version per module), and
// the generated TypeScript contract is `index.js` with its `index.d.ts`, with no source for a build of its own.
func TestNoArtifactKeepsASeriesAndTheTypeScriptContractIsJavaScript(t *testing.T) {
for _, path := range []string{"../../module.json", "../../../mesh-connectivity-contracts/module.json"} {
file, err := os.ReadFile(path)
if err != nil {
t.Fatal(err)
}
var m struct {
Build struct {
Artifacts []map[string]any `json:"artifacts"`
} `json:"build"`
}
if err := json.Unmarshal(file, &m); err != nil {
t.Fatal(err)
}
for _, a := range m.Build.Artifacts {
if _, ok := a["series"]; ok {
t.Errorf("%s: the artifact %v keeps a series, which the manifest validator refuses (§411)", path, a["name"])
}
}
}
dir := "../../../mesh-connectivity-contracts/ts/seats/theprivatenetwork/"
for file, want := range map[string]bool{"index.js": true, "index.d.ts": true, "src/index.ts": false, "tsconfig.json": false} {
if _, err := os.Stat(dir + file); (err == nil) != want {
t.Errorf("%s: present %v, want %v (§341)", file, err == nil, want)
}
}
}
+1 -2
View File
@@ -30,8 +30,7 @@
"language": "go",
"paths": [
"go"
],
"series": "0.1"
]
}
]
}