Skip to content

refactor(migrate): reuse native shell parsing for literal commands - #3138

Merged
fengmk2 merged 4 commits into
mainfrom
refactor/native-shell-command
Oct 20, 2026
Merged

fengmk2 merged 4 commits into
mainfrom
refactor/native-shell-command

Conversation

@fengmk2

@fengmk2 fengmk2 commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Git hooks and Vitest migrations use a separate TypeScript shell parser. This duplicates native parsing and can produce different quoting and command boundaries.

Both migrations now call parseLiteralCommands directly through the native binding. It uses the existing Bash syntax tree and returns UTF-16 offsets to preserve quotes and spacing. The TypeScript parser file is removed. Shared migration helpers define package-manager wrappers and shell-state commands.

Native script rewrites also share their parsing, command traversal, and output formatting steps. Each caller retains its rules for environment overrides, directory changes, and migration flags.

Fixes #3136.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

CLI artifact sizes (31f6841)

Final release artifacts built by the canonical build-upstream and build-windows-cli actions.
The dist rows use the Linux build. The core total excludes .node files to match the release artifact.

Artifact Format Base PR Change
packages/cli/dist Directory total 2.15 MiB 2.14 MiB -2.09 KiB (-0.10%)
packages/core/dist Directory total 4.08 MiB 4.08 MiB 0 B (0.00%)
Combined package dist Directory total 6.23 MiB 6.23 MiB -2.09 KiB (-0.03%)
vp (Linux x64) Binary 7.22 MiB 7.22 MiB 0 B (0.00%)
vp (Linux x64) gzip -9 3.35 MiB 3.35 MiB 0 B (0.00%)
NAPI (Linux x64) Binary 35.13 MiB 35.14 MiB +16.00 KiB (+0.04%)
NAPI (Linux x64) gzip -9 14.00 MiB 14.01 MiB +12.08 KiB (+0.08%)
vp (macOS ARM64) Binary 4.77 MiB 4.77 MiB 0 B (0.00%)
vp (macOS ARM64) gzip -9 2.87 MiB 2.87 MiB 0 B (0.00%)
NAPI (macOS ARM64) Binary 42.00 MiB 42.01 MiB +16.14 KiB (+0.04%)
NAPI (macOS ARM64) gzip -9 18.15 MiB 18.16 MiB +13.21 KiB (+0.07%)
vp (Windows x64) Binary 5.27 MiB 5.27 MiB 0 B (0.00%)
vp (Windows x64) gzip -9 2.46 MiB 2.46 MiB 0 B (0.00%)
NAPI (Windows x64) Binary 31.19 MiB 31.20 MiB +13.50 KiB (+0.04%)
NAPI (Windows x64) gzip -9 12.71 MiB 12.72 MiB +3.42 KiB (+0.03%)
Trampoline (Windows x64) Binary 13.50 KiB 13.50 KiB 0 B (0.00%)
Trampoline (Windows x64) gzip -9 7.09 KiB 7.09 KiB +1 B (+0.01%)
Installer (Windows x64) Binary 3.64 MiB 3.64 MiB 0 B (0.00%)
Installer (Windows x64) gzip -9 1.78 MiB 1.78 MiB -1 B (-0.00%)

@fengmk2

fengmk2 commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T07:10:53.308517Z d2cdc9c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: d2cdc9cf4d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://refactor-native-shell-command-viteplus-dev.voidzero-docs.workers.dev (commit 31f6841)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://8cc5adef-viteplus-dev.voidzero-docs.workers.dev 31f6841 2026-10-20T11:49:12.248Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://6e46e5fe-viteplus-dev.voidzero-docs.workers.dev d2cdc9c 2026-10-20T07:05:46.743Z Visit the dashboard ↗

@fengmk2
fengmk2 marked this pull request as ready for review October 20, 2026 09:41
@fengmk2 fengmk2 self-assigned this Oct 20, 2026
@fengmk2
fengmk2 requested review from cpojer and wan9chi October 20, 2026 09:41
@fengmk2
fengmk2 merged commit 47c8c99 into main Oct 20, 2026
69 checks passed
@fengmk2
fengmk2 deleted the refactor/native-shell-command branch October 20, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(migrate): reuse native shell parsing for literal command analysis

2 participants