Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/split-jsonc-parser-edit.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions packages/intent/src/setup/workspace-patterns.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions packages/intent/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ export default defineConfig({
'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(
'./node_modules/jsonc-parser/lib/esm/impl/parser.js',
import.meta.url,
),
),
// yaml's `node` export condition is a CommonJS build that rolldown cannot
// tree-shake; point at the ES module build its `default` condition serves.
yaml: fileURLToPath(
Expand Down
Loading