feat: add @hono/react-compat package (#563)
* Add @hono/react-compat package The creation of this package was proposed by Gaetan Puleo. Co-authored-by: Gaetan Puleo <pro@gaetanpuleo.com> * remove the changelog file and fix the version in `package.json` these will be modified by Changesets * correct `exports` paths in `package.json` and add `hono` as dev dependency * export as `default` * add build command to the `package.json` at the top * add changeset. we release it as `patch` first. --------- Co-authored-by: Gaetan Puleo <pro@gaetanpuleo.com> Co-authored-by: Yusuke Wada <yusuke@kamawada.com>pull/569/head
parent
3d83b7a36f
commit
2b981105db
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hono/react-compat': patch
|
||||
---
|
||||
|
||||
Initial release
|
|
@ -31,6 +31,7 @@
|
|||
"build:prometheus": "yarn workspace @hono/prometheus build",
|
||||
"build:oidc-auth": "yarn workspace @hono/oidc-auth build",
|
||||
"build:node-ws": "yarn workspace @hono/node-ws build",
|
||||
"build:react-compat": "yarn workspace @hono/react-compat build",
|
||||
"build": "run-p 'build:*'",
|
||||
"lint": "eslint 'packages/**/*.{ts,tsx}'",
|
||||
"lint:fix": "eslint --fix 'packages/**/*.{ts,tsx}'",
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# Alias of hono/jsx for replacement of React
|
||||
|
||||
This package is used to install the React compatibility API provided by [Hono](https://github.com/honojs/hono). This package allows you to replace the "react" and "react-dom" entities with "@hono/react-compat".
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
npm install react@npm:@hono/react-compat react-dom@npm:@hono/react-compat
|
||||
```
|
||||
|
||||
After installing in this way, "@hono/react-compat" will be loaded when "react" is specified in the `jsxImportSource` setting or in the `import` statement. See the [npm docs](https://docs.npmjs.com/cli/v7/commands/npm-install) for more information about aliased installs.
|
||||
|
||||
## Author
|
||||
|
||||
Taku Amano <https://github.com/usualoma>
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"name": "@hono/react-compat",
|
||||
"type": "module",
|
||||
"version": "0.0.0",
|
||||
"description": "Alias of hono/jsx for replacement of React",
|
||||
"license": "MIT",
|
||||
"module": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsup ./src --format esm,cjs --dts",
|
||||
"publint": "publint",
|
||||
"release": "yarn build && yarn test && yarn publint && yarn publish"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"./*": {
|
||||
"types": "./dist/*.d.ts",
|
||||
"import": "./dist/*.js",
|
||||
"require": "./dist/*.cjs"
|
||||
}
|
||||
},
|
||||
"peerDependencies": {
|
||||
"hono": ">=4.5.*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"hono": "4.5.0-rc.1",
|
||||
"tsup": "^8.0.1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
export * from 'hono/jsx/dom/client'
|
||||
import * as honoJSXDomClient from 'hono/jsx/dom/client'
|
||||
export { honoJSXDomClient as default }
|
|
@ -0,0 +1,3 @@
|
|||
export * from 'hono/jsx'
|
||||
import * as honoJSX from 'hono/jsx'
|
||||
export { honoJSX as default }
|
|
@ -0,0 +1 @@
|
|||
export * from 'hono/jsx/jsx-dev-runtime'
|
|
@ -0,0 +1 @@
|
|||
export * from 'hono/jsx/jsx-runtime'
|
|
@ -0,0 +1,3 @@
|
|||
export * from 'hono/jsx/dom/server'
|
||||
import * as honoJSXDomServer from 'hono/jsx/dom/server'
|
||||
export { honoJSXDomServer as default }
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
],
|
||||
}
|
18
yarn.lock
18
yarn.lock
|
@ -2042,6 +2042,17 @@ __metadata:
|
|||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@hono/react-compat@workspace:packages/react-compat":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@hono/react-compat@workspace:packages/react-compat"
|
||||
dependencies:
|
||||
hono: "npm:4.5.0-rc.1"
|
||||
tsup: "npm:^8.0.1"
|
||||
peerDependencies:
|
||||
hono: ">=4.5.*"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@hono/react-renderer@workspace:packages/react-renderer":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@hono/react-renderer@workspace:packages/react-renderer"
|
||||
|
@ -9597,6 +9608,13 @@ __metadata:
|
|||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"hono@npm:4.5.0-rc.1":
|
||||
version: 4.5.0-rc.1
|
||||
resolution: "hono@npm:4.5.0-rc.1"
|
||||
checksum: aaba4187da6dfb697b63772fd3f05466697a01eb2cc8a0c189a0bc464d49f6cedc1caa107b390488634e72544551ed8b34d906b9ef5c5780f1860a68666d56de
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"hono@npm:^3.11.7":
|
||||
version: 3.11.7
|
||||
resolution: "hono@npm:3.11.7"
|
||||
|
|
Loading…
Reference in New Issue