File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+
3+ // LSP-only wrapper for oxfmt.
4+ // This enables IDE extensions (e.g., oxc-vscode) to discover and start the LSP server.
5+ // Binary resolution follows the same approach as `src/resolve-fmt.ts`.
6+
7+ if ( ! process . argv . includes ( '--lsp' ) ) {
8+ console . error ( 'This oxfmt wrapper is for IDE extension use only (--lsp mode).' ) ;
9+ console . error ( 'To format your code, run: vp fmt' ) ;
10+ process . exit ( 1 ) ;
11+ }
12+
13+ import { createRequire } from 'node:module' ;
14+
15+ const require = createRequire ( import . meta. url ) ;
16+ const oxfmtBin = require . resolve ( 'oxfmt/bin/oxfmt' ) ;
17+
18+ await import ( oxfmtBin ) ;
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+
3+ // LSP-only wrapper for oxlint.
4+ // This enables IDE extensions (e.g., oxc-vscode) to discover and start the LSP server.
5+ // Binary resolution follows the same approach as `src/resolve-lint.ts`.
6+
7+ if ( ! process . argv . includes ( '--lsp' ) ) {
8+ console . error ( 'This oxlint wrapper is for IDE extension use only (--lsp mode).' ) ;
9+ console . error ( 'To lint your code, run: vp lint' ) ;
10+ process . exit ( 1 ) ;
11+ }
12+
13+ import { createRequire } from 'node:module' ;
14+ import { dirname , join } from 'node:path' ;
15+
16+ const require = createRequire ( import . meta. url ) ;
17+ const oxlintMainPath = require . resolve ( 'oxlint' ) ;
18+ const oxlintBin = join ( dirname ( dirname ( oxlintMainPath ) ) , 'bin' , 'oxlint' ) ;
19+
20+ await import ( oxlintBin ) ;
Original file line number Diff line number Diff line change 22 "name" : " vite-plus" ,
33 "version" : " 0.0.0" ,
44 "bin" : {
5+ "oxfmt" : " ./bin/oxfmt" ,
6+ "oxlint" : " ./bin/oxlint" ,
57 "vp" : " ./bin/vp"
68 },
79 "files" : [
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " bin-oxfmt-wrapper" ,
3+ "version" : " 0.0.0" ,
4+ "private" : true
5+ }
Original file line number Diff line number Diff line change 1+ [1]> oxfmt # should reject non-LSP usage
2+ This oxfmt wrapper is for IDE extension use only (--lsp mode).
3+ To format your code, run: vp fmt
4+
5+ [1]> oxfmt --help # should reject non-LSP usage
6+ This oxfmt wrapper is for IDE extension use only (--lsp mode).
7+ To format your code, run: vp fmt
Original file line number Diff line number Diff line change 1+ {
2+ "ignoredPlatforms" : [" win32" ],
3+ "commands" : [" oxfmt # should reject non-LSP usage" , " oxfmt --help # should reject non-LSP usage" ]
4+ }
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " bin-oxlint-wrapper" ,
3+ "version" : " 0.0.0" ,
4+ "private" : true
5+ }
Original file line number Diff line number Diff line change 1+ [1]> oxlint # should reject non-LSP usage
2+ This oxlint wrapper is for IDE extension use only (--lsp mode).
3+ To lint your code, run: vp lint
4+
5+ [1]> oxlint --help # should reject non-LSP usage
6+ This oxlint wrapper is for IDE extension use only (--lsp mode).
7+ To lint your code, run: vp lint
Original file line number Diff line number Diff line change 1+ {
2+ "ignoredPlatforms" : [" win32" ],
3+ "commands" : [
4+ " oxlint # should reject non-LSP usage" ,
5+ " oxlint --help # should reject non-LSP usage"
6+ ]
7+ }
You can’t perform that action at this time.
0 commit comments