Skip to content

Commit c5060ca

Browse files
committed
Simplify build process
1 parent d2b1aff commit c5060ca

File tree

6 files changed

+14
-1018
lines changed

6 files changed

+14
-1018
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
22
dist
3+
*lock.*

README.md

+6-12
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
77
This is an `esbuild` plugin for compiling libraries compatible with React 18 server and client component, Nextjs13, Remix, etc.
88

9-
## Why?
9+
## Why?
1010

1111
- Unleash the power of combining react client and server components in your libraries
1212
- TypeScript out of the box
1313
- Simple and tiny
14-
- Easy to use - just add the plugin and you are good to go
14+
- Easy to use — just add the plugin, and you are good to go
1515

16-
Introduction of React server components in React 18 has unlocked immense possibilities. However, library authors are not yet able to fully encash upon this potential. Many libraries like `chakra-ui`, simply add "use client" for each component. However, much more can be unlashed when we can use both server and client components to build libraries.
16+
Introduction of React server components in React 18 has unlocked immense possibilities. However, library authors are not yet able to fully encash upon this potential. Many libraries, like `chakra-ui`, simply add use client for each component. However, much more can be unleashed when we can use both server and client components to build libraries. Also check-out this [blog](https://mayank1513.medium.com/unleash-the-power-of-react-server-components-eb3fe7201231).
1717

1818
## Compatibility
1919

20-
- JavaScript/TypeScript React libraries using `tsup` or other builders based on `esbuild`
20+
- JavaScript/TypeScript React libraries using `tsup` or other builders based on `esbuild`
2121

22-
This plugin seamlessly integrates with `tsup` and other builders based on `esbuild`. With this you can have both server and client components in your library and the plugin will take care of the rest. All you need to do is add this plugin and add `"use client";` on top of client components (in your source code).
22+
This plugin seamlessly integrates with `tsup` and any other builders based on `esbuild`. With this you can have both server and client components in your library and the plugin will take care of the rest. All you need to do is add this plugin and add `"use client";` on top of client components (in your source code).
2323

2424
## Add dependencies:
2525

@@ -39,12 +39,8 @@ or
3939
npm install -D esbuild-react18-useclient
4040
```
4141

42-
43-
4442
> If you are using `monorepo` or `workspaces` you can install this plugin to root using `-w` or to specific workspace using `--filter your-package` or `--scope your-package` for `pnpm` and `yarn` workspaces respectively.
4543
46-
47-
4844
## Use with `tsup`
4945

5046
```javascript
@@ -62,8 +58,6 @@ export default defineConfig(options => ({
6258

6359
Licensed as MIT open source.
6460

65-
66-
6761
<hr />
6862

69-
<p style="text-align:center">with 💖 by <a href="https://mayank-chaudhari.vercel.app" target="_blank">Mayank Kumar Chaudhari</a></p>
63+
<p align="center" style="text-align:center">with 💖 by <a href="https://mayank-chaudhari.vercel.app" target="_blank">Mayank Kumar Chaudhari</a></p>

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "esbuild-react18-useclient",
3-
"version": "1.0.0",
3+
"version": "1.0.2",
44
"description": "esbuild plugin for compiling libraries compatible with React 18 server and client component, Nextjs13, Remix, etc.",
55
"main": "index.js",
66
"types": "index.d.ts",
@@ -9,7 +9,7 @@
99
"url": "git+https://github.com/mayank1513/esbuild-react18-useclient.git"
1010
},
1111
"scripts": {
12-
"build": "tsup src --dts && node createPackageJSON.js",
12+
"build": "tsc && node createPackageJSON.js",
1313
"publish-package": "npm run build && cp README.md dist/README.md && cd dist && npm publish && cd ..",
1414
"publish-gpr": "node prepGPR.js && cd dist && npm publish"
1515
},
@@ -36,7 +36,6 @@
3636
"devDependencies": {
3737
"@types/node": "^18",
3838
"esbuild": "^0.18.17",
39-
"tsup": "^7.1.0",
4039
"typescript": "^5.1.6"
4140
}
4241
}

0 commit comments

Comments
 (0)