Skip to content

feat: add experimental golar support#1229

Open
OskarLebuda wants to merge 2 commits intonuxt:mainfrom
OskarLebuda:feat/experimental-golar
Open

feat: add experimental golar support#1229
OskarLebuda wants to merge 2 commits intonuxt:mainfrom
OskarLebuda:feat/experimental-golar

Conversation

@OskarLebuda
Copy link
Contributor

@OskarLebuda OskarLebuda commented Feb 17, 2026

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This PR adds experimental support for golar as a new typecheck executor in nuxi. It introduces executor selection in the command flow, wires package resolution/installation for golar, and updates the warning message to clearly communicate its experimental status.

Below are timing results collected on a private project with more than 7k files.

$ pnpm golar -p ... --noEmit --extendedDiagnostics
Files:              7939
Lines:            898236
Identifiers:      976191
$ hyperfine --warmup=3 --runs=10 "pnpm test:tscheck --executor vue-tsc" "pnpm test:tscheck --executor golar"

Benchmark 1: pnpm test:tscheck --executor vue-tsc
  Time (mean ± σ):     16.806 s ±  1.482 s    [User: 20.357 s, System: 2.418 s]
  Range (min … max):   15.604 s … 19.559 s    10 runs

Benchmark 2: pnpm test:tscheck --executor golar
  Time (mean ± σ):      3.390 s ±  0.191 s    [User: 8.136 s, System: 1.463 s]
  Range (min … max):    3.141 s …  3.800 s    10 runs

Summary
  pnpm test:tscheck --executor golar ran
    4.96 ± 0.52 times faster than pnpm test:tscheck --executor vue-tsc

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

📦 Bundle Size Comparison

📈 nuxi

Metric Base Head Diff
Rendered 3695.68 KB 3696.43 KB +0.75 KB (+0.02%)

📈 nuxt-cli

Metric Base Head Diff
Rendered 138.81 KB 139.55 KB +0.74 KB (+0.53%)

➡️ create-nuxt

Metric Base Head Diff
Rendered 1644.95 KB 1644.95 KB 0.00 KB (0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 17, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing OskarLebuda:feat/experimental-golar (bbbe301) with main (9face47)

Open in CodSpeed

@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2026

📝 Walkthrough

Walkthrough

This pull request introduces an executor abstraction for the typecheck command, enabling selection between vue-tsc and golar type-checking backends. The implementation adds a command argument for executor selection, type guards to validate executor values, and a resolveExecutor function mapping executors to their CLI entry points. Hard-coded vue-tsc references are replaced with dynamic executor resolution. Bun and npx invocation logic is updated to install and run the selected executor and its dependencies. An experimental warning is logged when using the golar backend. A test:tscheck script is added to playground/package.json.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add experimental golar support' accurately describes the main change—introducing experimental support for golar as a new typecheck executor, which aligns with the changeset.
Description check ✅ Passed The pull request description clearly explains the new feature adding experimental golar support as a typecheck executor, including technical details and performance benchmarks.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/nuxi/src/commands/typecheck.ts (2)

98-100: isExecutor duplicates the executor list — derive it from executorPackages instead.

The type guard hardcodes 'vue-tsc' | 'golar', duplicating the keys already in executorPackages. If a new executor is added to the map, this guard must be updated in sync.

Proposed refactor
 function isExecutor(value: unknown): value is Executor {
-  return value === 'vue-tsc' || value === 'golar'
+  return typeof value === 'string' && value in executorPackages
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/nuxi/src/commands/typecheck.ts` around lines 98 - 100, The
isExecutor type guard currently hardcodes 'vue-tsc' and 'golar'; change it to
derive allowed executors from the keys of executorPackages so it stays in sync:
implement isExecutor(value: unknown): value is Executor by checking typeof value
=== 'string' and that (Object.keys(executorPackages) as
string[]).includes(value), using executorPackages (the existing map) and
returning that boolean so the guard reflects the map dynamically.

67-79: Bun global install is a significant side effect.

bun install --global modifies the user's global environment. If the user has a different version of these packages installed globally, this could cause conflicts. This may have been the pre-existing behavior for vue-tsc, but it's worth noting that adding golar and @golar/vue to global installs raises the surface area. Consider using bunx with --bun flag or a temporary install approach if available.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/nuxi/src/commands/typecheck.ts` around lines 67 - 79, The current
branch in typecheck.ts uses isBun to run bun install --global with
executorPackages (in the isBun block around the calls to x) which causes
unwanted global side effects; change this to avoid global installs by either
invoking bunx with the --bun flag or doing a transient/local install instead of
--global (e.g., run bunx [executor,...] or install into the local cwd) so you no
longer call bun install --global for packages in executorPackages; update the
calls around x('bun', [...]) and x('bunx', [...]) to use the non-global approach
and ensure nodeOptions/stdio and cwd are preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/nuxi/src/commands/typecheck.ts`:
- Line 43: The code silently defaults to 'vue-tsc' when ctx.args.executor is
invalid; update the logic around isExecutor and the executor assignment to
detect an unrecognized ctx.args.executor and either log a warning via the
existing logger/context or throw a user-facing error instead of silently falling
back; refer to isExecutor, ctx.args.executor and the executor variable to
implement a check that emits a clear message like "Unrecognized --executor
value: <value>, defaulting to 'vue-tsc'" (or throws) before setting executor to
'vue-tsc'.

---

Nitpick comments:
In `@packages/nuxi/src/commands/typecheck.ts`:
- Around line 98-100: The isExecutor type guard currently hardcodes 'vue-tsc'
and 'golar'; change it to derive allowed executors from the keys of
executorPackages so it stays in sync: implement isExecutor(value: unknown):
value is Executor by checking typeof value === 'string' and that
(Object.keys(executorPackages) as string[]).includes(value), using
executorPackages (the existing map) and returning that boolean so the guard
reflects the map dynamically.
- Around line 67-79: The current branch in typecheck.ts uses isBun to run bun
install --global with executorPackages (in the isBun block around the calls to
x) which causes unwanted global side effects; change this to avoid global
installs by either invoking bunx with the --bun flag or doing a transient/local
install instead of --global (e.g., run bunx [executor,...] or install into the
local cwd) so you no longer call bun install --global for packages in
executorPackages; update the calls around x('bun', [...]) and x('bunx', [...])
to use the non-global approach and ensure nodeOptions/stdio and cwd are
preserved.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 17, 2026

  • nuxt-cli-playground

    npm i https://pkg.pr.new/create-nuxt@1229
    
    npm i https://pkg.pr.new/nuxi@1229
    
    npm i https://pkg.pr.new/@nuxt/cli@1229
    

commit: bbbe301

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.

1 participant