-
-
Notifications
You must be signed in to change notification settings - Fork 123
[WIP] Support language: deno
#965
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #965 +/- ##
==========================================
- Coverage 90.15% 83.58% -6.57%
==========================================
Files 66 67 +1
Lines 12244 12352 +108
==========================================
- Hits 11039 10325 -714
- Misses 1205 2027 +822 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (16.1 MiB → 16.1 MiB) Expand for cargo-bloat outputPR Branch ResultsBase Branch Results |
* Do not check for `script` subprocess status (#964) * Update README * Allow using system trusted store by `PREK_NATIVE_TLS` (#959) * Fix compatibility with older luarocks (#967) * support isolated hook environments for `language: deno` - Implement Deno language handler with dependency isolation - Support npm packages via `additional_dependencies` - Add 8 tests covering basic usage, dependencies, and error cases - example config showing deno fmt, lint, and npm eslint hook usage * support Deno auto installation Implement full-fledged Deno language support with automatic version management, mirroring the installation patterns used for Node.js and Go. - **installer.rs**: New DenoInstaller that downloads and installs Deno versions - Downloads from GitHub releases (https://github.com/denoland/deno/releases) - Searches installed versions in $PREK_HOME/tools/deno - Falls back to system Deno if version matches - Supports all platforms: Linux, macOS, Windows (x86_64, aarch64) - Uses file locking to prevent concurrent installations - Implements proper binary extraction and permission setup - **version.rs**: New DenoVersion and DenoRequest types - Supports version specifications: exact (1.40.0), major (1), major.minor (1.40) - Supports semver ranges: ">= 1.40, < 1.50" - Handles "deno", "deno@version", "latest", "system" formats - Supports local path specifications - Comprehensive unit tests for version parsing - **deno.rs**: Updated to use DenoInstaller - Removed manual system-only detection - Integrated with DenoInstaller for automatic downloads - Simplified installation flow - Proper health checks with version validation * Update language support status (#970) * Update language support status * Tweak * Fix DenoRequest parsing * Generate cli reference * Fail windows CI when an error occured (#971) * Fail windows CI when an error occured * Fix tests * Use global client * delete outdated test, deno auto-installs after 2nd commit addresses #968 (comment) * refactor(deno): symlink deno executable into hook bin dir and use PATH resolution - Create bin/ directory in hook environment with symlinked deno executable - Prepend bin/ to PATH during install and run, matching Node implementation - Use entry.resolve() to find commands in PATH instead of manual replacement - Enables shell scripts to call `deno` directly with correct isolated version - add test verifying deno is available in PATH for shell scripts addresses #968 (comment) * refactor(deno): simplify install logic and add dependency caching - Simplify find_script_to_cache() using functional approach - Fix is_cacheable_script() to only match JS/TS files (prevents caching shell scripts) - Add support for .mjs, .tsx, .jsx extensions - Extract deno_bin variable to reduce duplication - Consolidate PATH setup to single location - Simplify deno.json creation logic - Add deno cache call during install for offline hook execution --------- Co-authored-by: Jo <[email protected]> Co-authored-by: Steven Taylor <[email protected]>
For #619
Not finished yet. Currently below example works:
.pre-commit-config.yaml:eslint.config.js: