Skip to content

Commit f1eedca

Browse files
cknittclaude
andauthored
Mark namespace-entry as requiring namespace in the build schema (#8984)
* Mark namespace-entry as requiring namespace in the build schema The schema said a `namespace-entry` without a namespace has no effect, which describes the Rust build system; `rescript` rejects such a configuration. The description now says so, and a `dependencies` rule lets editors flag a `namespace-entry` without a `namespace` key. Signed-off-by: Christoph Knittel <ck@cca.io> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xk6AeCYpCK4SZRtHYKHGoe * Reject namespace false beside namespace-entry in the build schema Codex review: the property dependency accepted `"namespace": false` with a `namespace-entry`, which `rescript` rejects. The schema dependency now also requires `namespace` not to be `false`. Signed-off-by: Christoph Knittel <ck@cca.io> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xk6AeCYpCK4SZRtHYKHGoe --------- Signed-off-by: Christoph Knittel <ck@cca.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b7b0d3a commit f1eedca

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- State in the `rescript.json` schema that `namespace-entry` requires `namespace`, as `rescript` rejects it otherwise.

‎docs/docson/build-schema.json‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@
424424
},
425425
"namespace-entry": {
426426
"type": "string",
427-
"description": "Name of the module that serves as the entry of a namespaced package. It is compiled without the namespace suffix, so other packages refer to it by its own name, and it opens the namespace to refer to the package's other modules. Only has an effect when `namespace` is enabled."
427+
"description": "Name of the module that serves as the entry of a namespaced package. It is compiled without the namespace suffix, so other packages refer to it by its own name, and it opens the namespace to refer to the package's other modules. Requires `namespace`: `rescript` rejects a `namespace-entry` without a namespace."
428428
},
429429
"sources": {
430430
"$ref": "#/definitions/sources",
@@ -562,5 +562,15 @@
562562
}
563563
},
564564
"additionalProperties": false,
565-
"required": ["name", "sources"]
565+
"required": ["name", "sources"],
566+
"dependencies": {
567+
"namespace-entry": {
568+
"required": ["namespace"],
569+
"properties": {
570+
"namespace": {
571+
"not": { "enum": [false] }
572+
}
573+
}
574+
}
575+
}
566576
}

0 commit comments

Comments
 (0)