Skip to content

feat!: replace tsx loader with jiti based ts loader#458

Draft
binoy14 wants to merge 2 commits intomainfrom
02-23-feat_replace_tsx_loader_with_jiti_based_ts_loader
Draft

feat!: replace tsx loader with jiti based ts loader#458
binoy14 wants to merge 2 commits intomainfrom
02-23-feat_replace_tsx_loader_with_jiti_based_ts_loader

Conversation

@binoy14
Copy link
Contributor

@binoy14 binoy14 commented Feb 23, 2026

feat!: replace tsx loader with jiti based ts loader

fix: replace tsx loader in exec script with jiti

Copy link
Contributor Author

binoy14 commented Feb 23, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link

claude bot commented Feb 23, 2026

Claude finished @binoy14's task in 2m 16s —— View job


PR Review

  • Read changed files
  • Analyze code for issues

3 issues found:

1. Stale JSDoc in importModule.ts:24

The comment still says "thin wrapper around tsx" after switching to jiti.

// packages/@sanity/cli-core/src/util/importModule.ts:24
* This is a thin wrapper around tsx to allow swapping out the underlying implementation in the future if needed.

Fix this →


2. Stale JSDoc in tsWorkerTask.ts:19

The comment says "Executes a worker file with tsx registered" but jiti is now used.

// packages/@sanity/cli-core/src/loaders/ts/tsWorkerTask.ts:19
* Executes a worker file with tsx registered.

Fix this →


3. Dead null check in execScript.ts:29-31

import.meta.resolve() either returns a string or throws — it never returns a falsy value. The if (!jitiLoaderPath) guard is unreachable dead code, and the explicit : string type annotation makes the contradiction visible to TypeScript.

// packages/@sanity/cli/src/actions/exec/execScript.ts:28-31
const jitiLoaderPath: string = import.meta.resolve('@rexxars/jiti', import.meta.url)
if (!jitiLoaderPath) {
  throw new Error('@sanity/cli not able to resolve jiti loader')
}

Remove the null check, or wrap the import.meta.resolve call in a try/catch if you want to provide a better error message.

Fix this →

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