Skip to content

feat(cli): support --showConfig - #1041

Merged
camc314 merged 8 commits into
mainfrom
codex/show-config
Nov 20, 2026
Merged

camc314 merged 8 commits into
mainfrom
codex/show-config

Conversation

@camc314

@camc314 camc314 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

tsrs --showConfig exited with error: --showConfig is not supported by tsrs. (status 5). It now prints the resolved config as tsgo does: the options from the config and the command line, the options they imply ("module": "nodenext" adds moduleResolution and moduleDetection), and files, include, exclude, references and compileOnSave, with paths relative to the config file.

This ports Go ConvertToTSConfig with its implied options, the generated serializeCompilerOptions and serializeCompilerOptionEnum, and showConfig, called at the same point of tscCompilation. The paths go through new tspath ports of RelativePathFromPath and RelativePathFromFileToPath.

The working directory now follows Go's os.Getwd (newSystem): on Unix it is $PWD when that names the current directory. tsrs used std::env::current_dir, which resolves symlinks, so in a directory reached through a symlink the absolute paths that --showConfig prints differed:

$ cd /tmp/x && tsrs --showConfig    # macOS, tsconfig.json has "outDir": "dist"
tsgo:         "exclude": ["/tmp/x/dist"]
tsrs before:  "exclude": ["/private/tmp/x/dist"]

The change applies to tsc, --lsp and the --api --cwd default, which all use os.Getwd in Go. Watch mode is unaffected: the macOS watch tests pass, and a watch run from a symlinked $PWD reports edits.

Tests:

  • tsctests/showconfig_test.rs runs the 21 tsc/showConfig scenarios and configDir-template-showConfig and compares their baselines byte for byte. It fails when upstream adds a scenario it does not port, and it needs no Go dump, so it runs in CI.
  • showconfig_test.rs in tsrs_tsoptions ports Go's showconfig_test.go, which checks the serializer option by option against a reflection-based one.
  • show_config.rs in tsrs_cli runs the binary: implied options, an unknown option, and a symlinked $PWD (which fails without the working-directory change). Expected output is from tsgo at the pinned commit.
  • typed_paths_test.rs covers the new tspath helpers, including encoded dynamic roots, with expected values from Go.

docs/COMPATIBILITY.md lists --showConfig as supported and cites the current oracle counts: 228/250 tsc, 190/193 tsbuild and 40/42 tscWatch scenario baselines.

fixes #1032

@codspeed

codspeed Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠ïļ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 8 untouched benchmarks
âĐ 8 skipped benchmarks1


Comparing codex/show-config (cd8ac04) with main (4d59429)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. â†Đ

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run · main 4d594290b9b9 → PR merge 4fa704cb366a (head cd8ac045d05c)

Clef gate: Running benchmarks because the decision was unavailable (crates/tsrs_tsoptions/src/showconfig.rs: patch exceeds the Clef context limit (23711 bytes)).

Release builds in fast mode (TSRS_FAST=1) with Hyperfine 2 hardware counters. After warming each binary, alternating main/PR pairs measure wall time at both the fast preset's default checker count and with --singleThreaded, with ten pairs per configuration by default. Instructions come from the single-threaded runs; peak RSS comes from the default-count runs.
Incremental runs start with fresh build info before every invocation; check runs disable incremental compilation.

Project Mode Single-thread wall time Δ Single-thread instructions Δ Default wall time Δ Default peak RSS Δ
vscode check +0.2% +0.002% +0.7% -0.4%
vscode incremental -0.3% +0.003% -3.5% -0.1%
xstate-main check -1.0% +0.003% -0.9% -0.5%
xstate-main incremental -0.4% +0.009% +4.0% -1.0%
webpack check -0.1% +0.002% -0.6% +0.8%
webpack incremental +5.3% +0.002% +0.4% -0.3%
mui-docs check +2.1% -0.004% -3.7% -0.5%
mui-docs incremental +2.2% +0.017% -2.3% +0.2%
Compiler check -2.3% +0.001% +3.8% -1.8%
Compiler incremental +1.8% +0.001% +0.6% -0.1%
Compiler-Unions check -2.0% +0.001% +7.3% +0.2%
Compiler-Unions incremental +0.1% 0.000% +0.6% +0.3%
cal-diy check +0.2% +0.006% +1.2% +0.5%
cal-diy incremental -9.6% +0.013% +2.7% 0.0%
formbricks-web check +0.2% +0.007% +1.2% +0.2%
formbricks-web incremental -1.5% +0.010% +0.5% -0.1%
supabase-studio check +0.4% +0.013% -2.1% +0.1%
supabase-studio incremental -2.2% +0.015% -1.6% -0.1%
t3code-server check +2.2% +0.004% -4.8% -0.2%
t3code-server incremental +0.2% +0.002% -1.4% +0.2%
mikro-orm check -0.2% +0.003% +1.0% +0.3%
mikro-orm incremental -1.8% +0.006% +0.1% +0.1%
next-packages-next check -0.8% +0.001% -0.4% 0.0%
next-packages-next incremental -0.9% +0.008% +6.3% -0.1%
next-root check -1.0% +0.003% +0.4% +0.2%
next-root incremental -0.9% +0.008% -0.1% +0.2%
storybook check +0.6% +0.003% +3.1% +1.4%
storybook incremental -9.5% +0.008% -1.2% -0.7%
nuxt check +1.3% +0.009% +0.2% -0.2%
nuxt incremental -1.0% +0.020% -0.7% +0.2%
playwright check -0.1% -0.001% -1.1% +0.4%
playwright incremental +7.0% +0.008% +4.9% +0.3%
drizzle-orm check +0.5% +0.003% 0.0% -0.5%
drizzle-orm incremental +6.7% +0.012% +0.7% +0.7%
typeorm check -0.9% +0.004% -1.5% 0.0%
typeorm incremental -1.2% +0.015% -6.0% +0.4%
date-fns check -0.6% +0.022% +1.9% -1.2%
date-fns incremental +0.5% +0.045% +2.1% +1.3%

Negative means the PR used less; positive means it used more. Deltas are medians of paired PR/main ratios for wall time and instructions. Single-threaded runs reduce scheduling noise; shared CI machines can still add noise to wall time.

Measured medians (main → PR)
Project Mode Single-thread wall time (s) Single-thread instructions Default wall time (s) Default peak RSS (MiB)
vscode check 15.092 → 15.147 82,257,905,549.5 → 82,259,655,622.5 3.654 → 3.707 1843.9 → 1836.8
vscode incremental 11.952 → 12.195 84,672,590,640.5 → 84,675,944,401.5 1.955 → 1.902 2164.0 → 2162.1
xstate-main check 0.592 → 0.588 5,565,999,372.5 → 5,566,110,129.5 0.146 → 0.146 243.8 → 242.5
xstate-main incremental 0.769 → 0.767 5,728,587,455.5 → 5,729,131,094.5 0.202 → 0.214 245.4 → 243.0
webpack check 1.288 → 1.278 10,884,823,331.5 → 10,884,964,294 0.257 → 0.256 402.8 → 406.2
webpack incremental 1.220 → 1.285 11,108,422,604.5 → 11,108,232,703 0.307 → 0.319 404.2 → 403.0
mui-docs check 3.879 → 3.987 33,108,903,145 → 33,108,281,368.5 1.684 → 1.582 1237.8 → 1231.5
mui-docs incremental 2.912 → 2.988 34,453,342,131.5 → 34,460,348,744 1.288 → 1.269 1158.6 → 1160.5
Compiler check 0.184 → 0.179 1,775,739,779 → 1,775,753,586.5 0.078 → 0.078 77.9 → 76.5
Compiler incremental 0.196 → 0.196 1,788,543,736 → 1,788,564,705.5 0.086 → 0.088 79.7 → 79.7
Compiler-Unions check 0.296 → 0.291 3,053,513,486.5 → 3,053,540,994.5 0.164 → 0.169 81.3 → 81.5
Compiler-Unions incremental 0.207 → 0.207 3,065,385,514 → 3,065,385,339.5 0.097 → 0.097 84.8 → 85.1
cal-diy check 3.484 → 3.533 28,969,600,452 → 28,971,537,592.5 1.024 → 1.037 1352.1 → 1358.5
cal-diy incremental 3.203 → 2.974 30,589,404,274.5 → 30,593,466,680 1.279 → 1.266 1267.4 → 1267.7
formbricks-web check 4.135 → 4.125 37,083,647,713 → 37,085,625,933.5 0.955 → 0.958 1581.3 → 1584.0
formbricks-web incremental 3.904 → 4.055 39,686,114,497.5 → 39,689,467,762.5 1.132 → 1.258 1623.6 → 1622.7
supabase-studio check 4.246 → 4.273 40,817,361,350 → 40,823,660,040.5 0.960 → 0.935 1309.7 → 1311.2
supabase-studio incremental 4.883 → 4.687 43,763,990,851 → 43,771,613,314.5 1.108 → 1.081 1366.4 → 1365.4
t3code-server check 5.228 → 5.040 41,054,814,010 → 41,057,089,080 1.920 → 1.789 1451.2 → 1448.8
t3code-server incremental 4.004 → 3.967 41,581,507,543 → 41,582,936,163.5 1.502 → 1.490 1303.8 → 1305.8
mikro-orm check 5.821 → 5.666 44,484,500,459.5 → 44,484,991,521.5 1.103 → 1.110 1280.9 → 1284.9
mikro-orm incremental 4.434 → 4.430 44,793,809,570.5 → 44,796,863,866 1.210 → 1.205 1256.8 → 1257.5
next-packages-next check 1.532 → 1.535 17,404,604,878 → 17,404,978,081 0.379 → 0.377 560.0 → 559.8
next-packages-next incremental 2.458 → 2.277 17,730,157,967 → 17,731,364,655.5 0.693 → 0.694 565.6 → 565.3
next-root check 2.475 → 2.316 13,962,740,571 → 13,963,203,613.5 0.560 → 0.567 431.8 → 432.8
next-root incremental 2.232 → 2.199 14,425,041,897.5 → 14,426,106,236 0.653 → 0.644 472.2 → 472.9
storybook check 1.704 → 1.673 8,867,098,945.5 → 8,867,355,805 0.434 → 0.434 394.8 → 400.3
storybook incremental 1.249 → 1.126 9,192,575,843.5 → 9,192,642,050 0.319 → 0.309 376.3 → 373.7
nuxt check 0.875 → 0.876 8,500,978,274.5 → 8,501,699,168.5 0.233 → 0.225 391.1 → 390.5
nuxt incremental 1.772 → 1.721 8,902,819,210.5 → 8,904,528,465.5 0.378 → 0.376 392.1 → 392.7
playwright check 0.684 → 0.690 7,403,007,684 → 7,402,982,497 0.181 → 0.176 362.8 → 364.3
playwright incremental 1.668 → 1.688 7,574,411,149.5 → 7,575,030,445 0.387 → 0.403 339.3 → 340.3
drizzle-orm check 0.554 → 0.559 5,948,402,970.5 → 5,948,702,342 0.187 → 0.192 382.6 → 380.7
drizzle-orm incremental 0.803 → 0.832 6,119,524,531.5 → 6,120,149,592.5 0.338 → 0.346 344.0 → 346.2
typeorm check 0.639 → 0.639 6,392,473,623.5 → 6,392,731,342 0.142 → 0.139 226.9 → 226.9
typeorm incremental 0.673 → 0.671 6,769,560,256 → 6,770,599,418.5 0.188 → 0.176 232.3 → 233.3
date-fns check 0.309 → 0.304 3,347,869,977.5 → 3,348,794,982 0.092 → 0.097 154.6 → 152.7
date-fns incremental 0.337 → 0.335 3,583,813,353.5 → 3,586,225,552 0.156 → 0.159 163.0 → 165.2

tsrs-lint

Release tsrs-lint linting each project's source files with all 61 rules. After a warmup run of each binary, alternating main/PR pairs (10 per mode) measure wall time, CPU time and peak RSS with TSRS_FAST unset and with TSRS_FAST=1.

Project Mode Wall time Δ CPU time Δ Peak RSS Δ Diagnostics (main → PR)
webpack default -0.2% +0.1% +0.2% 37258, identical
webpack TSRS_FAST=1 -0.2% -1.7% -0.2% 37258, identical
drizzle-orm default -1.4% -0.5% 0.0% 7057, identical
drizzle-orm TSRS_FAST=1 -1.1% -1.6% +0.1% 7057, identical
xstate-main default +2.0% +2.4% +1.1% 6489, identical
xstate-main TSRS_FAST=1 +1.1% +1.8% +0.2% 6489, identical

Negative means the PR used less. Wall and CPU time deltas are medians of paired PR/main ratios; peak RSS compares medians.

Measured lint medians (main → PR)
Project Mode Wall time (s) CPU time (s) Peak RSS (MiB)
webpack default 0.394 → 0.384 1.987 → 1.989 466.9 → 467.6
webpack TSRS_FAST=1 0.399 → 0.383 2.031 → 1.992 467.1 → 466.4
drizzle-orm default 0.241 → 0.239 1.248 → 1.281 403.5 → 403.5
drizzle-orm TSRS_FAST=1 0.248 → 0.235 1.272 → 1.250 403.4 → 403.9
xstate-main default 0.329 → 0.335 1.459 → 1.473 342.1 → 345.7
xstate-main TSRS_FAST=1 0.329 → 0.332 1.443 → 1.441 344.0 → 344.5

@camc314
camc314 marked this pull request as ready for review November 20, 2026 16:56
Copilot AI balanced review requested due to automatic review settings November 20, 2026 16:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T17:01:01.447158Z cd8ac04 New commits
â„đïļ 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.

Go's tsc, LSP and API servers get the working directory from os.Getwd, which
on Unix returns $PWD when it names the current directory. tsrs used
std::env::current_dir, which resolves symlinks, so in a directory reached
through a symlink (such as /tmp on macOS) absolute paths in the output, for
example the `exclude` entries printed by --showConfig, differed from tsgo.

osvfs::getwd ports os.Getwd, and the tsc system, `--lsp`, `--api` and the
filepath.Abs port use it.
TsConfig::to_json writes compileOnSave whenever it is set, including false; the comment said a false value was omitted too. Go's *bool field with omitzero likewise omits only nil.
â€Ķler_options

Go's generator also leaves out options marked showConfig: false (generate-options.ts:346), which is why listFiles and listEmittedFiles are not serialized.
relative_path_from_path and relative_path_from_file_to_path port Go's relative_path.go, so they get the matching file (docs/PORTING.md: one Rust file per Go file). relativePathFromNormalizedPaths stays in rooted_path.rs, where Go defines it.
Go's RelativePathFromPath and RelativePathFromFileToPath take RootedDirectoryPath, RootedFilePath and RootedPath values, which are normalized by construction. The Rust ports take &str, and an unnormalized input such as /project/src/.. gives a wrong result, so the comments state the requirement.
The only dynamic-name case had different roots and returned early, so removing the root separator trim or the case-sensitive comparison in relative_path_from_normalized_paths left every test passing. The expected values come from Go's tspath on the pinned commit.
â€Ķselines

The test counted its own scenarios, so a scenario added upstream would go untested in CI; only the Go-dump oracle, which CI does not run, would see it. It now compares the ported baselines with the files of tsc/showConfig plus extends/configDir-template-showConfig.js.
@camc314
camc314 enabled auto-merge November 20, 2026 17:00
@camc314
camc314 added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 5b5bed1 Nov 20, 2026
69 checks passed
@camc314
camc314 deleted the codex/show-config branch November 20, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): implement tsc-compatible --showConfig

2 participants