Skip to content

Commit a3e49d1

Browse files
authored
Merge pull request #441 from code-hike/ts-module-resolution-node
Use type wildcards for moduleResolution node compatibility
2 parents 8a6d167 + bed14e3 commit a3e49d1

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

.changeset/violet-insects-melt.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"codehike": patch
3+
---
4+
5+
Compatibility with ts `moduleResolution: node`, fix #437

packages/codehike/package.json

+12-4
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,27 @@
2323
"type": "github",
2424
"url": "https://github.com/sponsors/code-hike"
2525
},
26+
"files": [
27+
"dist/**"
28+
],
2629
"exports": {
2730
"./package.json": "./package.json",
2831
".": "./dist/index.js",
2932
"./mdx": "./dist/mdx.js",
3033
"./blocks": "./dist/blocks.js",
31-
"./code": "./dist/code/index.js",
34+
"./code": "./dist/code.js",
3235
"./utils/token-transitions": "./dist/utils/token-transitions.js",
3336
"./utils/static-fallback": "./dist/utils/static-fallback.js",
3437
"./utils/selection": "./dist/utils/selection.js"
3538
},
36-
"files": [
37-
"dist/**"
38-
],
39+
"types": "index.d.ts",
40+
"typesVersions": {
41+
"*": {
42+
"*": [
43+
"dist/*"
44+
]
45+
}
46+
},
3947
"scripts": {
4048
"build": "tsc -p . ",
4149
"dev": "tsc -p . --watch",

packages/codehike/src/code/index.tsx renamed to packages/codehike/src/code.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ import type {
1616
CustomToken,
1717
CustomTokenWithAnnotation,
1818
InlineProps,
19-
} from "./types.js"
19+
} from "./code/types.js"
2020

21-
import { highlight } from "./highlight.js"
22-
import { Pre, Inline } from "./pre.js"
23-
import { InnerPre, getPreRef, InnerLine, InnerToken } from "./inner.js"
21+
import { highlight } from "./code/highlight.js"
22+
import { Pre, Inline } from "./code/pre.js"
23+
import { InnerPre, getPreRef, InnerLine, InnerToken } from "./code/inner.js"
2424

2525
export type {
2626
RawCode,

0 commit comments

Comments
 (0)