Skip to content

Commit

Permalink
Publish CJS (#19)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 28, 2024
1 parent 5776b5e commit db13394
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-candles-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"rpc-anywhere": minor
---

Publish CJS version.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Create a type-safe RPC anywhere.
npm i rpc-anywhere
```

[✨ Interactive demo ✨](https://rpc-anywhere.dio.la/)

---

RPC Anywhere lets you create RPCs in **any** context, as long as a transport layer is provided. In other words: a way for messages to get from point A to point B and vice-versa.
Expand Down Expand Up @@ -89,9 +91,10 @@ It also ships with a few transports: iframes, Electron, browser extensions, work
- Message ports: `window`, iframes, workers, broadcast channels, etc.
- Browser extensions: content scripts ↔ service worker.
- Electron IPC (coming soon).
- Tiny (~1kb gzipped).
- Flexible (no enforced client-server architecture).
- Promise-based with optional proxy APIs (e.g. `rpc.requestName(params)`).
- Infers schema type from runtime request handlers.
- Promise-based with optional proxy APIs (e.g. `proxy.requestName(params)`).
- Schema type can be inferred from the request handlers.
- Optional lazy initialization (e.g. `rpc.setTransport(transport)`).

## <a name='Gettingstarted'></a>Getting started
Expand Down Expand Up @@ -237,7 +240,7 @@ Start with [RPC](./docs/1-rpc.md), then read about your transport of choice on t

The API reference is available at [tsdocs.dev](https://tsdocs.dev/docs/rpc-anywhere/).

**This package is ESM-only at the moment.** File an issue if this is a problem for you.
**This package is published as both ESM and CommonJS.**

## <a name='Typesafetyfeatures'></a>Type safety and features

Expand Down
Binary file modified bun.lockb
Binary file not shown.
32 changes: 19 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,45 @@
"demo": "bun --bun conc -k bun:demo:*"
},
"dependencies": {
"browser-namespace": "^1.3.0"
"browser-namespace": "^1.4.0"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"bun-types": "latest",
"concurrently": "^8.2.2",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"prettier": "^3.1.1",
"eslint-plugin-simple-import-sort": "^12.0.0",
"prettier": "^3.2.5",
"servor": "^4.0.2",
"tailwindcss": "^3.4.0",
"tshy": "^1.8.2",
"tailwindcss": "^3.4.1",
"tshy": "^1.11.1",
"typescript": "^5.3.3"
},
"tshy": {
"dialects": [
"esm"
],
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"exclude": [
"./src/tests/**/*"
]
},
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts"
}

0 comments on commit db13394

Please sign in to comment.