chore(extension): wire lint-ignore and version-sync for the extension

oxlint/prettier ignore the vendored snapshot-extractor copy and the
generated wasm output; check-version-sync gains a check that the
extension manifest tracks the workspace version.
This commit is contained in:
Kayshen-X 2026-08-04 21:48:10 +08:00
parent da83157b73
commit f2e5383e89
3 changed files with 31 additions and 1 deletions

View file

@ -5,5 +5,13 @@
"perf": "warn"
},
"plugins": ["react", "typescript", "import", "unicorn"],
"ignorePatterns": ["node_modules", "out", "dist", "**/routeTree.gen.ts", "**/*.gen.*"]
"ignorePatterns": [
"node_modules",
"out",
"dist",
"**/routeTree.gen.ts",
"**/*.gen.*",
"op-chrome-extension/vendor/**",
"op-chrome-extension/wasm/**"
]
}

12
packages/.prettierignore Normal file
View file

@ -0,0 +1,12 @@
# Read by `oxfmt` (it honours .gitignore and .prettierignore in this directory).
#
# The Chrome extension ships a byte-identical copy of the Rust DOM extractor
# (`crates/op-html/assets/snapshot-extractor.js`). Formatting it here would
# break `op-chrome-extension/scripts/check-extractor-sync.sh` — the copy is
# only ever refreshed from the canonical asset.
op-chrome-extension/vendor/
# wasm-bindgen output for the extension's Rust logic core, regenerated by
# `op-chrome-extension/scripts/build-wasm.sh`. Generated code is never edited,
# so formatting it would only produce churn.
op-chrome-extension/wasm/

View file

@ -344,6 +344,15 @@ validate_package_versions() {
fi
}
validate_chrome_extension_manifest_version() {
manifest=packages/op-chrome-extension/manifest.json
manifest_version=$(jq -r '.version' "$manifest")
if [[ "$manifest_version" != "$current_version" ]]; then
report_missing "$manifest" \
"Chrome extension manifest version ${manifest_version} must match Cargo workspace version ${current_version}; edit the \"version\" field (scripts/sync-version.sh does not rewrite this file — see packages/op-chrome-extension/README.md)"
fi
}
validate_release_tag() {
tag_name=
if [[ "${GITHUB_REF:-}" == refs/tags/v* ]]; then
@ -411,6 +420,7 @@ validate_rust_product_version_producers() {
validate_workspace_package_versions
validate_package_versions
validate_chrome_extension_manifest_version
validate_release_tag
validate_cli_bundle_version_template
validate_rust_product_version_producers