Skip to content

Commit 000e5c9

Browse files
committed
fix: declare codemirror-json5 module typings and clarify release build
Add ambient declarations for codemirror-json5 exports (language, linter, defaults) so TypeScript resolves those imports. Use `bun run build` in the release npm script so the package build script runs explicitly rather than relying on Bun’s build shorthand.
1 parent e061926 commit 000e5c9

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
"test:coverage": "vitest run --coverage",
117117
"tsc": "tsc && bun replace:env",
118118
"version-packages": "changeset version && bun typedoc && bun prettier:write CHANGELOG.md && git add package.json bun-lock.yaml CHANGELOG.md",
119-
"release": "bun build && changeset publish",
119+
"release": "bun run build && changeset publish",
120120
"typedoc": "typedoc --out docs src/index.ts src/json5.ts && bun prettier:write docs/**/*",
121121
"prettier:write": "prettier --ignore-path .gitignore --write",
122122
"replace:env": "sh scripts/replace-env.sh"

src/types/codemirror-json5.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
declare module "codemirror-json5" {
2+
import type { LanguageSupport, LRLanguage } from "@codemirror/language";
3+
import type { Extension } from "@codemirror/state";
4+
import type { LintSource } from "@codemirror/lint";
5+
6+
export function json5(): LanguageSupport;
7+
export const json5Language: LRLanguage;
8+
export function json5ParseLinter(): LintSource;
9+
export default json5;
10+
}

0 commit comments

Comments
 (0)