Skip to content

Commit

Permalink
chore: update tsx cases and tsx examples
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Feb 16, 2025
1 parent 2a0bf5b commit 8b0e420
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
16 changes: 11 additions & 5 deletions examples/server-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
"name": "server-actions-example",
"type": "module",
"exports": {
"./inline": "./dist/inline.js",
"./client": "./dist/client.js"
"./inline": {
"types": "./dist/inline.d.ts",
"default": "./dist/inline.js"
},
"./client": {
"types": "./dist/client.d.ts",
"default": "./dist/client.js"
}
},
"devDependencies": {
"@types/react": "*"
"@types/react": "latest"
},
"dependencies": {
"react": "*"
"peerDependencies": {
"react": "^18 || ^19"
}
}
2 changes: 2 additions & 0 deletions examples/server-actions/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"compilerOptions": {
"module": "ES6",
"moduleResolution": "node",
"jsx": "react-jsx",
"target": "ES2022"
}
Expand Down
12 changes: 12 additions & 0 deletions test/integration/mixed-directives/mixed-directives.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ describe('integration - mixed-directives', () => {
}
export { action1 as a };
",
"client.d.ts": "import * as react_jsx_runtime from 'react/jsx-runtime';
declare function Page(): react_jsx_runtime.JSX.Element;
export { Page as default };
",
"client.js": "'use client';
import { jsx } from 'react/jsx-runtime';
Expand All @@ -28,6 +34,12 @@ describe('integration - mixed-directives', () => {
});
}
export { Page as default };
",
"inline.d.ts": "import * as react_jsx_runtime from 'react/jsx-runtime';
declare function Page(): react_jsx_runtime.JSX.Element;
export { Page as default };
",
"inline.js": "import { jsx } from 'react/jsx-runtime';
Expand Down
13 changes: 9 additions & 4 deletions test/integration/mixed-directives/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
"name": "mixed-directives",
"type": "module",
"exports": {
"./inline": "./dist/inline.js",
"./client": "./dist/client.js"
"./inline": {
"types": "./dist/inline.d.ts",
"default": "./dist/inline.js"
},
"./client": {
"types": "./dist/client.d.ts",
"default": "./dist/client.js"
}
},
"dependencies": {
"react": "*",
"react-dom": "*"
"react": "*"
}
}
2 changes: 2 additions & 0 deletions test/integration/mixed-directives/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"compilerOptions": {
"module": "ES6",
"moduleResolution": "node",
"jsx": "react-jsx",
"target": "ES2022"
},
Expand Down

0 comments on commit 8b0e420

Please sign in to comment.