Skip to content

Commit 0ee533c

Browse files
authored
Merge branch 'main' into 4-12_add-team
2 parents 219fc3c + 41e78e2 commit 0ee533c

9 files changed

Lines changed: 122 additions & 55 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ jobs:
121121
# Pin Rust tooling paths to avoid $HOME mismatch issues.
122122
CARGO_HOME: /root/.cargo
123123
RUSTUP_HOME: /root/.rustup
124+
# `-crt-static`: vite-task's `fspy_preload_unix` cdylib (unconditional
125+
# build-dep since voidzero-dev/vite-task#344) can't link against a
126+
# static musl libc. vite+ ships as a NAPI module that links musl libc
127+
# dynamically anyway, so matching here is correct.
128+
# Must mirror `.cargo/config.toml` rustflags — RUSTFLAGS env overrides
129+
# both [build] and [target.*] levels.
130+
RUSTFLAGS: --cfg tokio_unstable -C link-args=-Wl,--warn-unresolved-symbols -C target-feature=-crt-static
124131
steps:
125132
- name: Install Alpine dependencies
126133
shell: sh {0}

Cargo.lock

Lines changed: 40 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ dunce = "1.0.5"
8989
fast-glob = "1.0.0"
9090
flate2 = { version = "=1.1.9", features = ["zlib-rs"] }
9191
form_urlencoded = "1.2.1"
92-
fspy = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "954cd3bead71be4ddc1e3183110d713bbe26286b" }
92+
fspy = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c45e5e72d3a17b850310128480e92d3e332c2d5a" }
9393
futures = "0.3.31"
9494
futures-util = "0.3.31"
9595
glob = "0.3.2"
@@ -194,16 +194,16 @@ vfs = "0.13.0"
194194
vite_command = { path = "crates/vite_command" }
195195
vite_error = { path = "crates/vite_error" }
196196
vite_js_runtime = { path = "crates/vite_js_runtime" }
197-
vite_glob = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "954cd3bead71be4ddc1e3183110d713bbe26286b" }
197+
vite_glob = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c45e5e72d3a17b850310128480e92d3e332c2d5a" }
198198
vite_install = { path = "crates/vite_install" }
199199
vite_migration = { path = "crates/vite_migration" }
200200
vite_setup = { path = "crates/vite_setup" }
201201
vite_shared = { path = "crates/vite_shared" }
202202
vite_static_config = { path = "crates/vite_static_config" }
203-
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "954cd3bead71be4ddc1e3183110d713bbe26286b" }
204-
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "954cd3bead71be4ddc1e3183110d713bbe26286b" }
205-
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "954cd3bead71be4ddc1e3183110d713bbe26286b" }
206-
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "954cd3bead71be4ddc1e3183110d713bbe26286b" }
203+
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c45e5e72d3a17b850310128480e92d3e332c2d5a" }
204+
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c45e5e72d3a17b850310128480e92d3e332c2d5a" }
205+
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c45e5e72d3a17b850310128480e92d3e332c2d5a" }
206+
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c45e5e72d3a17b850310128480e92d3e332c2d5a" }
207207
walkdir = "2.5.0"
208208
wax = "0.6.0"
209209
which = "8.0.0"

packages/cli/bin/oxfmt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
// This enables IDE extensions (e.g., oxc-vscode) to discover and start the LSP server.
55
// Binary resolution follows the same approach as `src/resolve-fmt.ts`.
66

7-
if (!process.argv.includes('--lsp')) {
8-
console.error('This oxfmt wrapper is for IDE extension use only (--lsp mode).');
7+
const isLSP = process.argv.includes('--lsp');
8+
const isStdin = process.argv.some((arg) => arg.startsWith('--stdin-filepath'));
9+
if (!isLSP && !isStdin) {
10+
console.error('This oxfmt wrapper is for IDE extension use only (lsp or stdin mode).');
911
console.error('To format your code, run: vp fmt');
1012
process.exit(1);
1113
}

packages/cli/snap-tests/bin-oxfmt-wrapper/snap.txt

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,52 @@
11
[1]> node ../node_modules/vite-plus/bin/oxfmt # should reject non-LSP usage
2-
This oxfmt wrapper is for IDE extension use only (--lsp mode).
2+
This oxfmt wrapper is for IDE extension use only (lsp or stdin mode).
33
To format your code, run: vp fmt
44

55
[1]> node ../node_modules/vite-plus/bin/oxfmt --help # should reject non-LSP usage
6-
This oxfmt wrapper is for IDE extension use only (--lsp mode).
6+
This oxfmt wrapper is for IDE extension use only (lsp or stdin mode).
77
To format your code, run: vp fmt
88

9-
> node ../node_modules/vite-plus/bin/oxfmt --lsp --help # should exercise import path
9+
> node ../node_modules/vite-plus/bin/oxfmt --lsp --help # should allow LSP mode
10+
Usage: [-c=PATH] [PATH]...
11+
12+
Mode Options:
13+
--init Initialize `.oxfmtrc.json` with default values
14+
--migrate=SOURCE Migrate configuration to `.oxfmtrc.json` from specified source
15+
Available sources: prettier, biome
16+
--lsp Start language server protocol (LSP) server
17+
--stdin-filepath=PATH Specify the file name to use to infer which parser to use
18+
19+
Output Options:
20+
--write Format and write files in place (default)
21+
--check Check if files are formatted, also show statistics
22+
--list-different List files that would be changed
23+
24+
Config Options
25+
-c, --config=PATH Path to the configuration file (.json, .jsonc, .ts, .mts, .cts, .js,
26+
.mjs, .cjs)
27+
28+
Ignore Options
29+
--ignore-path=PATH Path to ignore file(s). Can be specified multiple times. If not
30+
specified, .gitignore and .prettierignore in the current directory are
31+
used.
32+
--with-node-modules Format code in node_modules directory (skipped by default)
33+
34+
Runtime Options
35+
--no-error-on-unmatched-pattern Do not exit with error when pattern is unmatched
36+
--threads=INT Number of threads to use. Set to 1 for using only 1 CPU core.
37+
38+
Available positional items:
39+
PATH Single file, path or list of paths. Glob patterns are also supported.
40+
(Be sure to quote them, otherwise your shell may expand them before
41+
passing.) Exclude patterns with `!` prefix like `'!**/fixtures/*.js'`
42+
are also supported. If not provided, current working directory is used.
43+
44+
Available options:
45+
-h, --help Prints help information
46+
-V, --version Prints version information
47+
48+
49+
> node ../node_modules/vite-plus/bin/oxfmt --stdin-filepath=a.ts --help # should allow Stdin mode
1050
Usage: [-c=PATH] [PATH]...
1151

1252
Mode Options:

packages/cli/snap-tests/bin-oxfmt-wrapper/steps.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"commands": [
33
"node ../node_modules/vite-plus/bin/oxfmt # should reject non-LSP usage",
44
"node ../node_modules/vite-plus/bin/oxfmt --help # should reject non-LSP usage",
5-
"node ../node_modules/vite-plus/bin/oxfmt --lsp --help # should exercise import path"
5+
"node ../node_modules/vite-plus/bin/oxfmt --lsp --help # should allow LSP mode",
6+
"node ../node_modules/vite-plus/bin/oxfmt --stdin-filepath=a.ts --help # should allow Stdin mode"
67
]
78
}

0 commit comments

Comments
 (0)