Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lib/rules/cicd_rules.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down
13 changes: 13 additions & 0 deletions test/rules/cicd_rules_rescript_npm_js_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading