From 17286307ce78715800f2867297f72646c8353af8 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Fri, 23 Oct 2026 07:11:49 +0000 Subject: [PATCH 1/2] 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 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Xk6AeCYpCK4SZRtHYKHGoe --- changes/namespace-entry-schema.docs.md | 1 + docs/docson/build-schema.json | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changes/namespace-entry-schema.docs.md diff --git a/changes/namespace-entry-schema.docs.md b/changes/namespace-entry-schema.docs.md new file mode 100644 index 0000000000..72f25b471d --- /dev/null +++ b/changes/namespace-entry-schema.docs.md @@ -0,0 +1 @@ +- State in the `rescript.json` schema that `namespace-entry` requires `namespace`, as `rescript` rejects it otherwise. diff --git a/docs/docson/build-schema.json b/docs/docson/build-schema.json index 21f48b1f22..189d8fa3a2 100644 --- a/docs/docson/build-schema.json +++ b/docs/docson/build-schema.json @@ -424,7 +424,7 @@ }, "namespace-entry": { "type": "string", - "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." + "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." }, "sources": { "$ref": "#/definitions/sources", @@ -562,5 +562,8 @@ } }, "additionalProperties": false, - "required": ["name", "sources"] + "required": ["name", "sources"], + "dependencies": { + "namespace-entry": ["namespace"] + } } From 8717742a37f3a838b57f5d1f0d37a2c1cc1c020f Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Fri, 23 Oct 2026 09:31:50 +0000 Subject: [PATCH 2/2] 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 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Xk6AeCYpCK4SZRtHYKHGoe --- docs/docson/build-schema.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/docson/build-schema.json b/docs/docson/build-schema.json index 189d8fa3a2..4799b0548a 100644 --- a/docs/docson/build-schema.json +++ b/docs/docson/build-schema.json @@ -564,6 +564,13 @@ "additionalProperties": false, "required": ["name", "sources"], "dependencies": { - "namespace-entry": ["namespace"] + "namespace-entry": { + "required": ["namespace"], + "properties": { + "namespace": { + "not": { "enum": [false] } + } + } + } } }