Skip to content

Commit 49e0fbe

Browse files
committed
refactor: move jsx-runtime and jsx-dev-runtime to the top level
1 parent 48f403d commit 49e0fbe

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Badrap Oy
3+
Copyright (c) 2023 Badrap Oy
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,25 @@ npm i @badrap/libapp
1010

1111
## Enabling JSX/TSX support
1212

13-
Modify your tsconfig.json file by adding in the following lines:
13+
To enable JSX/TSX support for your whole codebase, modify your **tsconfig.json** file by adding in the following lines:
1414

15-
```
15+
```json
1616
{
1717
"compilerOptions": {
1818
...
1919
"jsx": "react-jsx",
20-
"jsxImportSource": "@badrap/libapp/ui"
20+
"jsxImportSource": "@badrap/libapp"
2121
},
2222
...
2323
}
2424
```
25+
26+
To enable JSX/TSX support for just one specific file, add the following pragma comment to the beginning of that file:
27+
28+
```ts
29+
/* @jsxImportSource @badrap/libapp */
30+
```
31+
32+
## License
33+
34+
This library is licensed under the MIT license. See [./LICENSE].

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"exports": {
1414
"./api": "./dist/api/index.js",
1515
"./ui": "./dist/ui/index.js",
16-
"./ui/jsx-runtime": "./dist/ui/jsx-runtime.js",
17-
"./ui/jsx-dev-runtime": "./dist/ui/jsx-dev-runtime.js"
16+
"./jsx-runtime": "./dist/jsx-runtime.js",
17+
"./jsx-dev-runtime": "./dist/jsx-dev-runtime.js"
1818
},
1919
"typesVersions": {
2020
"*": {

src/ui/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import type { UiNode, Fragment } from "./jsx-runtime";
1+
import type { UiNode, Fragment } from "../jsx-runtime";
22

33
export type { UiNode, Fragment };

0 commit comments

Comments
 (0)