Skip to content
Source
Sign inSign up
TanStack/intent

perf: split jsonc-parser edit and format out of project-context #343

MergedLadyBluenotes(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/343/headmerged by LadyBluenotes(GitHub profile, opens in a new tab)

Showing 3 changed files with 13 additions and 2 deletions.

x
0 of 3 viewed, 3 left
5 additions and 0 deletions.changeset/split-jsonc-parser-edit.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/intent': patch
+---
+​
+Keep `jsonc-parser`'s editing and formatting modules out of the shared `project-context` chunk so read-only commands (`intent list`, `intent load`, `intent stale`, and `intent validate`) do not load JSONC edit and format code on startup; behavior does not change.
2 additions and 2 deletionspackages/intent/src/setup/workspace-patterns.tsModified
View file
@@ -1,10 +1,10 @@
import { existsSync, lstatSync, readFileSync, readdirSync } from 'node:fs'
import { dirname, join } from 'node:path'
-import { parse as parseJsonc } from 'jsonc-parser'
+import { parse as parseJsonc } from 'jsonc-parser/lib/esm/main.js'
import { parse as parseYaml } from 'yaml'
import { hasAnySkillFile } from '../shared/utils.js'
import { readPackageJson } from '../core/package-json.js'
-import type { ParseError } from 'jsonc-parser'
+import type { ParseError } from 'jsonc-parser/lib/esm/main.js'
import type { IntentFsCache } from '../discovery/fs-cache.js'
​
function normalizeWorkspacePattern(pattern: string): string {
6 additions and 0 deletionspackages/intent/tsdown.config.tsModified
View file
@@ -61,6 +61,12 @@
'jsonc-parser': fileURLToPath(
new URL('./node_modules/jsonc-parser/lib/esm/main.js', import.meta.url),
),
+ 'jsonc-parser/lib/esm/main.js': fileURLToPath(
+ new URL(