diff --git a/lib/rules/cicd_rules.ex b/lib/rules/cicd_rules.ex index 4d72a91..76b6ae1 100644 --- a/lib/rules/cicd_rules.ex +++ b/lib/rules/cicd_rules.ex @@ -305,12 +305,19 @@ defmodule Hypatia.Rules.CicdRules do # ship via npm because the Office host loads `.js` from a # Node-packaged manifest). Parallel to VSCode extension carve-out. "/office-addin/", - # (5c) Estate "bindings/{javascript,typescript,deno}/" subdirs are - # consumer-facing exports of estate-internal proven libraries - # to npm-consuming downstreams (parallel to /bindings/deno/ - # under :typescript_detected). NOT estate-internal npm use. + # (5c) Estate "bindings/{javascript,typescript,rescript,deno}/" + # subdirs are consumer-facing exports of estate-internal proven + # libraries to npm-consuming downstreams (parallel to + # /bindings/deno/ under :typescript_detected). NOT + # estate-internal npm use. The rescript variant is + # host-required for the rescript-to-js compile chain (same + # pattern as JS/TS consumer exports, just produced from .res + # sources). Surfaced during standards#275 STEP 7 closeout + # estate-wide scan (proven-servers/bindings/rescript/ was the + # single uncarved hit). "/bindings/javascript/", "/bindings/typescript/", + "/bindings/rescript/", # (6) Example / test fixtures "/example/", "/examples/", diff --git a/test/rules/cicd_rules_rescript_npm_js_test.exs b/test/rules/cicd_rules_rescript_npm_js_test.exs index 2d624b1..aec89c5 100644 --- a/test/rules/cicd_rules_rescript_npm_js_test.exs +++ b/test/rules/cicd_rules_rescript_npm_js_test.exs @@ -188,6 +188,19 @@ defmodule Hypatia.Rules.CicdRules.RescriptNpmJsTest do assert Enum.find(results, &(&1.rule == :nodejs_detected)) == nil, "example/fixture lockfiles demonstrate npm consumer — not own toolchain" end + + test "exempts */bindings/{javascript,typescript,rescript}/ consumer exports" do + files = [ + "proven-servers/bindings/javascript/package-lock.json", + "proven-servers/bindings/typescript/package-lock.json", + "proven-servers/bindings/rescript/package-lock.json" + ] + + results = CicdRules.check_commit_blocks(files) + + assert Enum.find(results, &(&1.rule == :nodejs_detected)) == nil, + "consumer-facing language bindings under /bindings/{js,ts,res}/ ship to npm-consuming downstreams (parallel to /bindings/deno/ under :typescript_detected); the rescript variant is host-required for the rescript-to-js compile chain" + end end # ---------------------------------------------------------- Unnecessarily-JS