-
-
Notifications
You must be signed in to change notification settings - Fork 158
runtime: add native @parcel/watcher compatibility facade #8532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| feat(runtime): add a native `@parcel/watcher` 2.5.x compatibility facade backed | ||
| by OS filesystem events. OpenCode's platform-selected watcher packages now route | ||
| to one GC-rooted native implementation with coalescing, rename, ignore, | ||
| snapshot, overflow-rescan, and safe-unsubscribe semantics instead of falling | ||
| back to a no-op when its Node-API addon cannot load. A 20,000-file idle tree | ||
| used about 1.3 ms of process CPU over five seconds on macOS. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,6 +187,17 @@ pub const NATIVE_MODULES: &[&str] = &[ | |
| // for Socket Firewall's TLS-MITM CA so forge's pure-JS crypto isn't | ||
| // AOT-compiled. | ||
| "node-forge", | ||
| // @parcel/watcher's root binding and the eight published Node-API | ||
| // sidecars. HIR canonicalizes sidecars to the root dispatch table. | ||
| "@parcel/watcher", | ||
| "@parcel/watcher-darwin-x64", | ||
| "@parcel/watcher-darwin-arm64", | ||
| "@parcel/watcher-linux-x64-glibc", | ||
| "@parcel/watcher-linux-x64-musl", | ||
| "@parcel/watcher-linux-arm64-glibc", | ||
| "@parcel/watcher-linux-arm64-musl", | ||
| "@parcel/watcher-win32-x64", | ||
| "@parcel/watcher-win32-arm64", | ||
|
Comment on lines
+190
to
+200
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- candidate files ---'
git ls-files | rg '(^|/)(entries\.rs|.*parcel.*watcher.*|other\.md)$' | head -80
printf '%s\n' '--- registrations and implementation symbols ---'
rg -n -C 4 'parcel/watcher|js_parcel_watcher_subscribe|ignorePaths|ignoreGlobs|unsubscribe' \
crates test-files docs 2>/dev/null | head -400
printf '%s\n' '--- entries outline ---'
ast-grep outline crates/perry-api-manifest/src/entries.rs --match 'parcel/watcher' --view expanded 2>/dev/null || true
printf '%s\n' '--- focused entries range ---'
cat -n crates/perry-api-manifest/src/entries.rs | sed -n '170,215p'
printf '%s\n' '--- focused test ---'
cat -n test-files/test_parcel_watcher_facade.ts | sed -n '1,180p'
printf '%s\n' '--- focused docs ---'
cat -n docs/src/stdlib/other.md | sed -n '235,285p'Repository: PerryTS/perry Length of output: 43074 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- extension outline ---'
ast-grep outline crates/perry-ext-parcel-watcher/src/lib.rs | head -160
printf '%s\n' '--- extension state/options ---'
cat -n crates/perry-ext-parcel-watcher/src/lib.rs | sed -n '1,285p'
printf '%s\n' '--- subscribe/unsubscribe implementation ---'
cat -n crates/perry-ext-parcel-watcher/src/lib.rs | sed -n '580,790p'
printf '%s\n' '--- native dispatch implementation ---'
cat -n crates/perry-codegen/src/lower_call/native_table/parcel_watcher.rs | sed -n '1,260p'
printf '%s\n' '--- binding metadata ---'
cat -n crates/perry/well_known_bindings.toml | sed -n '645,725p'
printf '%s\n' '--- root and wrapper resolution references ---'
rg -n -C 5 'well_known_bindings|alias-of|/wrapper|NATIVE_MODULES|native module|native_modules' \
crates/perry crates/perry-api-manifest crates/perry-codegen 2>/dev/null | head -500
printf '%s\n' '--- upstream package metadata and wrapper ---'
curl -fsSL https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/package.json | sed -n '1,180p'
curl -fsSL https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/index.js | sed -n '1,220p'
curl -fsSL https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/wrapper.js | sed -n '1,260p'Repository: PerryTS/perry Length of output: 50369 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- upstream package metadata ---'
curl -fsSL https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/package.json | \
rg -n '"main"|"exports"|"version"|"wrapper|index|package"' -C 3
printf '%s\n' '--- upstream index.js ---'
curl -fsSL https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/index.js | cat -n
printf '%s\n' '--- upstream wrapper.js ---'
curl -fsSL https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/wrapper.js | cat -n
printf '%s\n' '--- upstream source file names ---'
for f in index.js wrapper.js package.json; do
url="https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/$f"
printf '%s ' "$f"
curl -fsSL "$url" | sha256sum
done
printf '%s\n' '--- resolver implementation candidates ---'
rg -l -g '*.rs' -g '*.ts' 'target-dependent|dynamic require|canonicalize.*sidecar|alias-of|well_known_bindings|NATIVE_MODULES' crates | sort
printf '%s\n' '--- wrapper and native dispatch references ---'
rg -n -C 6 -g '*.rs' -g '*.ts' 'wrapper|parcel_watcher|PARCEL_WATCHER_ROWS|native_module|native modules' \
crates/perry-hir crates/perry-codegen crates/perry-compiler crates/perry 2>/dev/null | head -350
printf '%s\n' '--- callback and promise helper ranges ---'
cat -n crates/perry-ext-parcel-watcher/src/lib.rs | sed -n '430,580p'
cat -n crates/perry-ext-parcel-watcher/src/lib.rs | sed -n '760,870p'Repository: PerryTS/perry Length of output: 49075 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- rooting API definitions and uses ---'
rg -n -C 6 'struct TransientRootScope|impl TransientRootScope|fn root_addr|fn root_nanbox|register_handle\(' \
crates/perry-ffi crates/perry-ext-* crates/perry-runtime crates/perry-stdlib 2>/dev/null | head -500
printf '%s\n' '--- analogous callback-rooted native functions ---'
rg -n -C 8 'root_addr|CallbackRoot|register_handle.*callback|callback.*root' \
crates/perry-ext-* crates/perry-runtime crates/perry-stdlib 2>/dev/null | head -500
printf '%s\n' '--- focused unsubscribe and root-scope helpers ---'
cat -n crates/perry-ext-parcel-watcher/src/lib.rs | sed -n '620,765p'
rg -n -C 8 'pub.*TransientRootScope|pub.*root_addr|pub.*register_handle|struct AddrRoot|root_addr' crates/perry-ffi
printf '%s\n' '--- static dominance probe ---'
python3 - <<'PY'
from pathlib import Path
p = Path("crates/perry-ext-parcel-watcher/src/lib.rs")
text = p.read_text()
for name in ("js_parcel_watcher_subscribe", "js_parcel_watcher_unsubscribe"):
start = text.index(f"pub unsafe extern \"C\" fn {name}")
end = text.find("\n}\n", start) + 3
body = text[start:end]
print(f"{name}:")
for i, line in enumerate(body.splitlines(), start=1):
if any(token in line for token in (
"let promise", "parse_options", "snapshot_tree", "recommended_watcher",
"watcher.watch", "register_handle", "root_addr", "callback",
"promise.resolve", "promise.reject"
)):
print(f" {i:03}: {line}")
PYRepository: PerryTS/perry Length of output: 50369 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- FFI root API locations ---'
fd -t f -e rs . crates/perry-ffi crates/perry-runtime | xargs rg -l \
'TransientRootScope|root_addr|pub fn register_handle|pub unsafe fn js_array_push|pub unsafe fn js_object_set_field' | sort
printf '%s\n' '--- exact root API definitions ---'
fd -t f -e rs . crates/perry-ffi crates/perry-runtime | xargs rg -n -C 12 \
'struct TransientRootScope|impl TransientRootScope|fn root_addr|fn root_nanbox|fn register_handle|fn js_array_push|fn js_object_set_field' | head -260
printf '%s\n' '--- event array source ---'
cat -n crates/perry-ext-parcel-watcher/src/lib.rs | sed -n '452,490p'
printf '%s\n' '--- compact root/collection source-order verifier ---'
python3 - <<'PY'
from pathlib import Path
p = Path("crates/perry-ext-parcel-watcher/src/lib.rs")
text = p.read_text()
for name in ("event_array", "js_parcel_watcher_subscribe", "js_parcel_watcher_unsubscribe"):
start = text.index(("fn " if name == "event_array" else 'pub unsafe extern "C" fn ') + name)
depth = 0
end = None
for i in range(start, len(text)):
if text[i] == "{":
depth += 1
elif text[i] == "}":
depth -= 1
if depth == 0:
end = i + 1
break
body = text[start:end]
print(f"\n{name}")
for lineno, line in enumerate(body.splitlines(), 1):
stripped = line.strip()
if any(token in stripped for token in (
"root_nanbox", "root_addr", "register_handle",
"js_object_alloc_with_shape", "js_object_set_field",
"js_array_push", "parse_options", "JsPromise::new",
"snapshot_tree", "recommended_watcher", "watcher.watch",
)):
print(f"{lineno:03}: {stripped}")
PYRepository: PerryTS/perry Length of output: 29555 Preserve the Registering the root package as native bypasses its 2.5.1 JavaScript wrapper. Direct root imports therefore do not normalize
📍 Affects 3 files
🤖 Prompt for AI Agents |
||
| ]; | ||
|
|
||
| /// Node built-in submodules that Perry routes through the | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,62 @@ | |
| use super::*; | ||
|
|
||
| pub(crate) const API_MANIFEST_PART_2: &[ApiEntry] = &[ | ||
| method_sig( | ||
| "@parcel/watcher", | ||
| "subscribe", | ||
| false, | ||
| None, | ||
| &[p_str("dir"), p_any("callback"), p_any("options")], | ||
| TypeSpec::Promise, | ||
| ), | ||
| method_sig( | ||
| "@parcel/watcher", | ||
| "unsubscribe", | ||
| false, | ||
| None, | ||
| &[p_str("dir"), p_any("callback"), p_any("options")], | ||
| TypeSpec::Promise, | ||
| ), | ||
| method_sig( | ||
| "@parcel/watcher", | ||
| "writeSnapshot", | ||
| false, | ||
| None, | ||
| &[p_str("dir"), p_str("snapshot"), p_any("options")], | ||
| TypeSpec::Promise, | ||
| ), | ||
| method_sig( | ||
| "@parcel/watcher", | ||
| "getEventsSince", | ||
| false, | ||
| None, | ||
| &[p_str("dir"), p_str("snapshot"), p_any("options")], | ||
| TypeSpec::Promise, | ||
| ), | ||
|
Comment on lines
+11
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- target file ---'
cat -n crates/perry-api-manifest/src/entries/part_2.rs | sed -n '1,90p'
printf '%s\n' '--- parameter helper definitions and uses ---'
rg -n -C 3 'fn p_(any|str)|p_any\\(|optional|ParamSpec|TypeSpec' crates/perry-api-manifest crates | head -240
printf '%s\n' '--- watcher-related entries and facade references ---'
rg -n -C 4 '`@parcel/watcher`|writeSnapshot|getEventsSince|subscribe|unsubscribe' . --glob '!target' --glob '!node_modules' | head -320Repository: PerryTS/perry Length of output: 24044 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- target file ---'
cat -n crates/perry-api-manifest/src/entries/part_2.rs | sed -n '1,90p'
printf '%s\n' '--- parameter helper definitions and uses ---'
rg -n -C 3 'fn p_(any|str)|p_any\(|optional|ParamSpec|TypeSpec' crates/perry-api-manifest crates | head -240
printf '%s\n' '--- watcher-related entries and facade references ---'
rg -n -C 4 '`@parcel/watcher`|writeSnapshot|getEventsSince|subscribe|unsubscribe' . --glob '!target' --glob '!node_modules' | head -320Repository: PerryTS/perry Length of output: 50369 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- watcher-related tracked files ---'
git ls-files | rg -i 'watcher|parcel'
printf '%s\n' '--- optional parameter handling ---'
rg -n -C 5 'ParamSpec::Named|optional|params\.len|arity|argument.*count|missing.*argument' crates/perry-api-manifest crates/perry-* --glob '*.rs' | head -260
printf '%s\n' '--- watcher API source references ---'
rg -n -C 3 'writeSnapshot|getEventsSince|`@parcel/watcher`|parcel/watcher' --glob '*.rs' --glob '*.ts' --glob '*.js' --glob '*.d.ts' --glob '*.toml' . | head -220
printf '%s\n' '--- upstream declaration ---'
curl -fsSL --max-time 20 https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/index.d.ts | sed -n '1,180p'Repository: PerryTS/perry Length of output: 39047 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- Parcel watcher native table ---'
cat -n crates/perry-codegen/src/lower_call/native_table/parcel_watcher.rs | sed -n '1,260p'
printf '%s\n' '--- Parcel watcher facade signatures and option handling ---'
rg -n -C 8 'pub extern|fn (subscribe|unsubscribe|write_snapshot|get_events_since)|options|snapshot_options|subscribe_options' crates/perry-ext-parcel-watcher/src/lib.rs | head -360
printf '%s\n' '--- omitted-options tests ---'
cat -n test-files/test_parcel_watcher_idle.ts | sed -n '1,180p'
printf '%s\n' '--- manifest consumers of optional parameters ---'
rg -n -C 8 'optional' crates --glob '*.rs' | rg -v 'target' | head -300Repository: PerryTS/perry Length of output: 38072 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- all direct manifest parameter consumers ---'
rg -n -C 6 'entry\.params|api_entry\.params|\.params\(\)|ParamSpec::Named|ParamSpec::Rest' crates --glob '*.rs' | head -420
printf '%s\n' '--- native call lowering modules ---'
ast-grep outline crates/perry-codegen/src/lower_call
printf '%s\n' '--- native call argument padding and arity logic ---'
rg -n -C 10 'NativeModSig|args:.*NA_|arg_count|args\.len|pad|undefined|missing|lower.*native|native.*call' crates/perry-codegen/src/lower_call crates/perry-hir/src --glob '*.rs' | head -420
printf '%s\n' '--- manifest lookup and signature validation ---'
rg -n -C 10 'API_MANIFEST|find.*api|lookup.*api|ApiEntry|ParamSpec' crates/perry-hir crates/perry-codegen crates/perry --glob '*.rs' | head -420Repository: PerryTS/perry Length of output: 50370 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- omitted native parameter padding ---'
cat -n crates/perry-codegen/src/lower_call/omitted_native_params.rs | sed -n '1,260p'
printf '%s\n' '--- native module dispatch ---'
cat -n crates/perry-codegen/src/lower_call/native_module_dispatch.rs | sed -n '1,300p'
printf '%s\n' '--- native call lowering ---'
cat -n crates/perry-codegen/src/lower_call/native/mod.rs | sed -n '1,280p'
printf '%s\n' '--- API manifest package usage ---'
rg -n -C 5 'perry_api_manifest|API_MANIFEST|emit.*d\.ts|render_signature' crates --glob '*.rs' | head -260Repository: PerryTS/perry Length of output: 50369 🏁 Script executed: #!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import re
import urllib.request
manifest = Path("crates/perry-api-manifest/src/entries/part_2.rs").read_text()
entries = {
"subscribe": r'"subscribe".*?&\[p_str\("dir"\), p_any\("callback"\), p_any\("options"\)\]',
"unsubscribe": r'"unsubscribe".*?&\[p_str\("dir"\), p_any\("callback"\), p_any\("options"\)\]',
"writeSnapshot": r'"writeSnapshot".*?&\[p_str\("dir"\), p_str\("snapshot"\), p_any\("options"\)\]',
"getEventsSince": r'"getEventsSince".*?&\[p_str\("dir"\), p_str\("snapshot"\), p_any\("options"\)\]',
}
for name, pattern in entries.items():
assert re.search(pattern, manifest, re.S), f"missing local required signature: {name}"
upstream = urllib.request.urlopen(
"https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/index.d.ts",
timeout=20,
).read().decode()
for name in entries:
block = re.search(
rf"export function {name}\((.*?)\):",
upstream,
re.S,
)
assert block, f"missing upstream declaration: {name}"
assert re.search(r"\bopts\?\s*:\s*Options", block.group(1)), (
f"upstream options is not optional: {name}"
)
native_table = Path(
"crates/perry-codegen/src/lower_call/native_table/parcel_watcher.rs"
).read_text()
for runtime in (
"js_parcel_watcher_subscribe",
"js_parcel_watcher_unsubscribe",
"js_parcel_watcher_write_snapshot",
"js_parcel_watcher_get_events_since",
):
assert runtime in native_table, f"missing native runtime row: {runtime}"
padding = Path(
"crates/perry-codegen/src/lower_call/native_module_dispatch.rs"
).read_text()
assert "If fewer args than sig expects, pad" in padding
assert "TAG_UNDEFINED" in padding
print("all four manifest options are required locally, optional upstream, and native lowering pads omitted slots")
PYRepository: PerryTS/perry Length of output: 2438 🏁 Script executed: #!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import re
import ssl
import urllib.request
manifest = Path("crates/perry-api-manifest/src/entries/part_2.rs").read_text()
patterns = {
"subscribe": r'"subscribe".*?&\[p_str\("dir"\), p_any\("callback"\), p_any\("options"\)\]',
"unsubscribe": r'"unsubscribe".*?&\[p_str\("dir"\), p_any\("callback"\), p_any\("options"\)\]',
"writeSnapshot": r'"writeSnapshot".*?&\[p_str\("dir"\), p_str\("snapshot"\), p_any\("options"\)\]',
"getEventsSince": r'"getEventsSince".*?&\[p_str\("dir"\), p_str\("snapshot"\), p_any\("options"\)\]',
}
for name, pattern in patterns.items():
assert re.search(pattern, manifest, re.S), f"missing local required signature: {name}"
context = ssl._create_unverified_context()
upstream = urllib.request.urlopen(
"https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/index.d.ts",
timeout=20,
context=context,
).read().decode()
for name in patterns:
block = re.search(rf"export function {name}\((.*?)\):", upstream, re.S)
assert block, f"missing upstream declaration: {name}"
assert re.search(r"\bopts\?\s*:\s*Options", block.group(1)), (
f"upstream options is not optional: {name}"
)
padding = Path(
"crates/perry-codegen/src/lower_call/native_module_dispatch.rs"
).read_text()
assert "If fewer args than sig expects, pad" in padding
assert "TAG_UNDEFINED" in padding
facade = Path("crates/perry-ext-parcel-watcher/src/lib.rs").read_text()
assert "fn parse_options(options_bits: f64)" in facade
assert "WatchOptionsKey::default()" in facade
print("local manifest: required; upstream declarations: optional; native lowering: padded; facade: defaults absent options")
PYRepository: PerryTS/perry Length of output: 267 🏁 Script executed: #!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import re
import ssl
import urllib.request
manifest = Path("crates/perry-api-manifest/src/entries/part_2.rs").read_text()
patterns = {
"subscribe": r'"subscribe".*?&\[p_str\("dir"\), p_any\("callback"\), p_any\("options"\)\]',
"unsubscribe": r'"unsubscribe".*?&\[p_str\("dir"\), p_any\("callback"\), p_any\("options"\)\]',
"writeSnapshot": r'"writeSnapshot".*?&\[p_str\("dir"\), p_str\("snapshot"\), p_any\("options"\)\]',
"getEventsSince": r'"getEventsSince".*?&\[p_str\("dir"\), p_str\("snapshot"\), p_any\("options"\)\]',
}
for name, pattern in patterns.items():
assert re.search(pattern, manifest, re.S), f"missing local required signature: {name}"
upstream = urllib.request.urlopen(
"https://raw.githubusercontent.com/parcel-bundler/watcher/v2.5.1/index.d.ts",
timeout=20,
context=ssl._create_unverified_context(),
).read().decode()
for name in patterns:
block = re.search(rf"export function {name}\((.*?)\):", upstream, re.S)
assert block, f"missing upstream declaration: {name}"
assert re.search(r"\bopts\?\s*:\s*Options", block.group(1)), (
f"upstream options is not optional: {name}"
)
padding = Path(
"crates/perry-codegen/src/lower_call/native_module_dispatch.rs"
).read_text()
assert "If fewer args than sig expects, pad" in padding
assert "TAG_UNDEFINED" in padding
facade = Path("crates/perry-ext-parcel-watcher/src/lib.rs").read_text()
assert "fn parse_options(options_bits: f64)" in facade
assert "WatchOptionsKey::default()" in facade
print("local manifest: required; upstream declarations: optional; native lowering: padded; facade: defaults absent options")
PYRepository: PerryTS/perry Length of output: 267 Make the 🤖 Prompt for AI Agents |
||
| method_sig( | ||
| "@parcel/watcher", | ||
| "__nativeEventCount", | ||
| false, | ||
| None, | ||
| &[], | ||
| TypeSpec::Number, | ||
| ), | ||
| // Platform sidecars canonicalize to the root dispatch table during HIR | ||
| // lowering. One manifest row per alias keeps resolver/manifest coverage | ||
| // explicit without duplicating the full surface eight times. | ||
| method("@parcel/watcher-darwin-x64", "subscribe", false, None), | ||
| method("@parcel/watcher-darwin-arm64", "subscribe", false, None), | ||
| method("@parcel/watcher-linux-x64-glibc", "subscribe", false, None), | ||
| method("@parcel/watcher-linux-x64-musl", "subscribe", false, None), | ||
| method( | ||
| "@parcel/watcher-linux-arm64-glibc", | ||
| "subscribe", | ||
| false, | ||
| None, | ||
| ), | ||
| method("@parcel/watcher-linux-arm64-musl", "subscribe", false, None), | ||
| method("@parcel/watcher-win32-x64", "subscribe", false, None), | ||
| method("@parcel/watcher-win32-arm64", "subscribe", false, None), | ||
| method_sig( | ||
| "lodash", | ||
| "drop", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| use super::*; | ||
|
|
||
| /// The low-level binding object consumed by `@parcel/watcher/wrapper`. | ||
| /// Platform package names are canonicalized to `@parcel/watcher` by HIR | ||
| /// lowering, so one table covers the root plus every native-addon sidecar. | ||
| pub(super) const PARCEL_WATCHER_ROWS: &[NativeModSig] = &[ | ||
| NativeModSig { | ||
| module: "@parcel/watcher", | ||
| has_receiver: false, | ||
| method: "subscribe", | ||
| class_filter: None, | ||
| runtime: "js_parcel_watcher_subscribe", | ||
| args: &[NA_STR, NA_PTR, NA_F64], | ||
| ret: NR_PROMISE, | ||
| }, | ||
| NativeModSig { | ||
| module: "@parcel/watcher", | ||
| has_receiver: false, | ||
| method: "unsubscribe", | ||
| class_filter: None, | ||
| runtime: "js_parcel_watcher_unsubscribe", | ||
| args: &[NA_STR, NA_PTR, NA_F64], | ||
| ret: NR_PROMISE, | ||
| }, | ||
| NativeModSig { | ||
| module: "@parcel/watcher", | ||
| has_receiver: false, | ||
| method: "writeSnapshot", | ||
| class_filter: None, | ||
| runtime: "js_parcel_watcher_write_snapshot", | ||
| args: &[NA_STR, NA_STR, NA_F64], | ||
| ret: NR_PROMISE, | ||
| }, | ||
| NativeModSig { | ||
| module: "@parcel/watcher", | ||
| has_receiver: false, | ||
| method: "getEventsSince", | ||
| class_filter: None, | ||
| runtime: "js_parcel_watcher_get_events_since", | ||
| args: &[NA_STR, NA_STR, NA_F64], | ||
| ret: NR_PROMISE, | ||
| }, | ||
| NativeModSig { | ||
| module: "@parcel/watcher", | ||
| has_receiver: false, | ||
| method: "__nativeEventCount", | ||
| class_filter: None, | ||
| runtime: "js_parcel_watcher_native_event_count", | ||
| args: &[], | ||
| ret: NR_F64, | ||
| }, | ||
| ]; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| [package] | ||
| name = "perry-ext-parcel-watcher" | ||
| version.workspace = true | ||
| edition.workspace = true | ||
| license.workspace = true | ||
| description = "Native @parcel/watcher 2.5 compatibility facade backed by notify" | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
||
| [lib] | ||
| crate-type = ["staticlib", "rlib"] | ||
|
|
||
| [dependencies] | ||
| perry-ffi.workspace = true | ||
| notify.workspace = true | ||
| fancy-regex = "0.18" | ||
| serde = { workspace = true, features = ["derive"] } | ||
| serde_json.workspace = true | ||
|
Comment on lines
+14
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check whether fancy-regex is declared in the workspace dependency catalog.
rg -n 'fancy-regex' Cargo.toml
rg -n 'fancy-regex' --glob '**/Cargo.toml'Repository: PerryTS/perry Length of output: 151 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workspace manifests ---'
git ls-files '*Cargo.toml' | sort
printf '%s\n' '--- root workspace dependency declarations ---'
sed -n '1,220p' Cargo.toml
printf '%s\n' '--- target manifest ---'
sed -n '1,120p' crates/perry-ext-parcel-watcher/Cargo.toml
printf '%s\n' '--- all fancy-regex references, including case-insensitive matches ---'
rg -n -i --hidden --glob '!target/**' --glob '!node_modules/**' 'fancy[-_]regex|fancyregex' . || trueRepository: PerryTS/perry Length of output: 28361 🏁 Script executed: #!/bin/bash
set -eu
python3 - <<'PY'
import re
from pathlib import Path
for path in [Path("Cargo.toml"), Path("crates/perry-runtime/Cargo.toml"),
Path("crates/perry-ext-parcel-watcher/Cargo.toml")]:
text = path.read_text()
print(f"--- {path} ---")
for i, line in enumerate(text.splitlines(), 1):
if "workspace.dependencies" in line or "fancy-regex" in line:
print(f"{i}: {line}")
lock = Path("Cargo.lock").read_text().splitlines()
print("--- Cargo.lock fancy-regex package entries ---")
for i, line in enumerate(lock):
if line == 'name = "fancy-regex"':
print("\n".join(lock[max(0, i-2):i+5]))
PYRepository: PerryTS/perry Length of output: 765 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- root workspace dependency catalog ---'
sed -n '330,430p' Cargo.toml
printf '%s\n' '--- all fancy-regex dependency declarations ---'
rg -n '^[[:space:]]*fancy-regex[[:space:]]*=' --glob '**/Cargo.toml' .
printf '%s\n' '--- lockfile package and dependent references ---'
rg -n -A8 -B2 '^name = "fancy-regex"$|^[[:space:]]*"fancy-regex",' Cargo.lockRepository: PerryTS/perry Length of output: 4043 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workspace version declarations ---'
rg -n -C3 'workspace\.package|^version[[:space:]]*=|Current Version:' Cargo.toml README.md CHANGELOG.md .github 2>/dev/null || true
printf '%s\n' '--- relevant working-tree changes ---'
git status --short -- Cargo.toml crates/perry-ext-parcel-watcher/Cargo.toml
git diff --unified=20 -- Cargo.toml crates/perry-ext-parcel-watcher/Cargo.tomlRepository: PerryTS/perry Length of output: 28913 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- documented current version ---'
rg -n -C2 '\*\*Current Version:\*\*' CLAUDE.md || true
printf '%s\n' '--- latest commit changes for the reviewed manifest and version metadata ---'
git show --stat --oneline HEAD -- Cargo.toml CLAUDE.md crates/perry-ext-parcel-watcher/Cargo.toml
git show --format= --unified=8 HEAD -- Cargo.toml CLAUDE.md crates/perry-ext-parcel-watcher/Cargo.tomlRepository: PerryTS/perry Length of output: 4748 Bump the workspace version and keep
🤖 Prompt for AI Agents |
||
|
|
||
| [dev-dependencies] | ||
| perry-ffi = { workspace = true, features = ["runtime-link"] } | ||
| tempfile.workspace = true | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Bump the workspace version.
This change edits
Cargo.toml, and the PR description states that no version bump is included. The repository rule requires a patch increment in[workspace.package].versiontogether with the**Current Version:**line above it. Add both edits.As per coding guidelines: "Bump version: Increment patch in
[workspace.package].versioninCargo.tomland the**Current Version:**line above."🤖 Prompt for AI Agents
Source: Coding guidelines