Skip to content

Commit 7d5493c

Browse files
committed
support typescript
1 parent daaf8ba commit 7d5493c

File tree

8 files changed

+1059
-2
lines changed

8 files changed

+1059
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ or
2828
npm install -D esbuild-react18-useclient
2929
```
3030

31+
32+
33+
> 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.
34+
35+
36+
3137
## Use with `tsup`
3238

3339
```javascript
@@ -44,3 +50,9 @@ export default defineConfig(options => ({
4450
## License
4551

4652
Licensed as MIT open source.
53+
54+
55+
56+
<hr />
57+
58+
<p style="text-align:center">with 💖 by <a href="https://mayank-chaudhari.vercel.app" target="_blank">Mayank Kumar Chaudhari</a></p>

createPackageJSON.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"use strict";
2+
3+
const fs = require("fs");
4+
const path = require("path");
5+
const packageJson = require(path.resolve(__dirname, "package.json"));
6+
7+
const { devDependencies, scripts, ...newPackageJSON } = packageJson;
8+
9+
fs.writeFileSync(
10+
path.resolve(__dirname, "dist", "package.json"),
11+
JSON.stringify(newPackageJSON, null, 2)
12+
);

package.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@
33
"version": "1.0.0",
44
"description": "esbuild plugin for compiling libraries compatible with React 18 server and client component, Nextjs13, Remix, etc.",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"repository": {
78
"type": "git",
89
"url": "git+https://github.com/mayank1513/esbuild-react18-useclient.git"
910
},
11+
"scripts": {
12+
"build": "tsup src --dts && node createPackageJSON.js",
13+
"publish-package": "npm run build && cp README.md dist/README.md"
14+
},
1015
"keywords": [
1116
"react",
1217
"nextjs",
18+
"esbuild",
19+
"esbuild-plugin",
20+
"useclient",
21+
"tsup",
1322
"react18",
1423
"react-server-components",
1524
"react-client-components",
@@ -21,5 +30,11 @@
2130
"bugs": {
2231
"url": "https://github.com/mayank1513/esbuild-react18-useclient/issues"
2332
},
24-
"homepage": "https://github.com/mayank1513/esbuild-react18-useclient#readme"
33+
"homepage": "https://github.com/mayank1513/esbuild-react18-useclient#readme",
34+
"devDependencies": {
35+
"@types/node": "^18",
36+
"esbuild": "^0.18.17",
37+
"tsup": "^7.1.0",
38+
"typescript": "^5.1.6"
39+
}
2540
}

0 commit comments

Comments
 (0)