@masterpeach/plugin-react 0.0.0-experimental-20260625203238
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +156 -0
- package/dist/ConfirmModal-BDOS4CPh.js +2852 -0
- package/dist/D3SankeyCharts-D89ah1De.js +1288 -0
- package/dist/index-B67iXHsu.js +37450 -0
- package/dist/index.d.ts +215 -0
- package/dist/index.js +4 -0
- package/dist/plugin-react.css +1 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# @peach/plugin-react
|
|
2
|
+
|
|
3
|
+
Public React package for embedding Peach Plugin in npm/bundler applications.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @peach/plugin-react react react-dom wagmi viem @wagmi/core @tanstack/react-query @reown/appkit @reown/appkit-adapter-wagmi
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
React, wagmi, viem, TanStack Query, and AppKit packages are peer dependencies and stay external in the ESM build.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { PeachPlugin, type PeachPluginReactOptions } from "@peach/plugin-react";
|
|
17
|
+
|
|
18
|
+
const options: PeachPluginReactOptions = {
|
|
19
|
+
display: {
|
|
20
|
+
mode: "integrated",
|
|
21
|
+
},
|
|
22
|
+
theme: "light",
|
|
23
|
+
defaultTokens: {
|
|
24
|
+
sell: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
|
25
|
+
buy: "0x55d398326f99059fF775485246999027B3197955",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function SwapPanel() {
|
|
30
|
+
return <PeachPlugin {...options} />;
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Styles
|
|
35
|
+
|
|
36
|
+
The default `useShadowDOM={true}` mode injects plugin styles into the shadow root. If you render into the host document with `useShadowDOM={false}`, import the optional stylesheet:
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import "@peach/plugin-react/style.css";
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Build Output
|
|
43
|
+
|
|
44
|
+
- ESM entry: `dist/index.js`
|
|
45
|
+
- Types: `dist/index.d.ts`
|
|
46
|
+
- Optional stylesheet: `dist/plugin-react.css`
|
|
47
|
+
|
|
48
|
+
## NPM Publish Script
|
|
49
|
+
|
|
50
|
+
Publish through the existing monorepo script only. Do not run `npm publish`
|
|
51
|
+
manually for this package; the script writes the version, builds, runs the
|
|
52
|
+
release guard, packs the package, and publishes the verified tarball.
|
|
53
|
+
|
|
54
|
+
Run every publish command from the monorepo root. The default script target is
|
|
55
|
+
`@peach/plugin-react`; pass `--package <name-or-dir>` only when publishing another
|
|
56
|
+
non-private package under `packages/plugin/*`.
|
|
57
|
+
|
|
58
|
+
Replace `<version>` with the version you want to publish. Use a prerelease
|
|
59
|
+
version such as `<prerelease-version>` for test releases.
|
|
60
|
+
|
|
61
|
+
### 1. Prepare npm access
|
|
62
|
+
|
|
63
|
+
Make sure the shell is authenticated before publishing:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm whoami
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
If publishing from CI, provide `NODE_AUTH_TOKEN` through the CI environment. If
|
|
70
|
+
npm two-factor auth is enabled and the token does not bypass 2FA, pass
|
|
71
|
+
`--otp <code>` when publishing.
|
|
72
|
+
|
|
73
|
+
### 2. Dry-run with the script
|
|
74
|
+
|
|
75
|
+
Dry-run with the exact version you plan to publish:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pnpm plugin:publish -- --version <version> --dry-run
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The publish script writes the requested version into the package manifest before
|
|
82
|
+
building, so keep the `package.json` version change as part of the release
|
|
83
|
+
commit.
|
|
84
|
+
|
|
85
|
+
### 3. Publish a test release with the script
|
|
86
|
+
|
|
87
|
+
Use the test release script for prerelease validation. It publishes with the
|
|
88
|
+
`test` npm dist-tag:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pnpm plugin:publish:test -- --version <prerelease-version>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Equivalent environment-driven command:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
PEACH_PLUGIN_RELEASE_ENV=test PEACH_PLUGIN_VERSION=<prerelease-version> pnpm plugin:publish
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
After publishing, verify the published package and wire it into the debug app if
|
|
101
|
+
needed:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm view @peach/plugin-react@test version
|
|
105
|
+
pnpm --filter plugin-debug dev
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 4. Publish production with the script
|
|
109
|
+
|
|
110
|
+
Use the production release script for the final version. It publishes with the
|
|
111
|
+
`latest` npm dist-tag:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
pnpm plugin:publish:prod -- --version <version>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Equivalent environment-driven command:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
PEACH_PLUGIN_RELEASE_ENV=production PEACH_PLUGIN_VERSION=<version> pnpm plugin:publish
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 5. Optional flags and environment defaults
|
|
124
|
+
|
|
125
|
+
CLI flags:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
pnpm plugin:publish -- \
|
|
129
|
+
--package @peach/plugin-react \
|
|
130
|
+
--version <version> \
|
|
131
|
+
--tag latest \
|
|
132
|
+
--registry https://registry.npmjs.org/ \
|
|
133
|
+
--otp <code>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Environment defaults:
|
|
137
|
+
|
|
138
|
+
- `PEACH_PLUGIN_RELEASE_ENV`: `test`, `production`, or `prod`.
|
|
139
|
+
- `PEACH_PLUGIN_PACKAGE`: same as `--package`.
|
|
140
|
+
- `PEACH_PLUGIN_VERSION`: same as `--version`.
|
|
141
|
+
- `PEACH_PLUGIN_TAG`: same as `--tag`; overrides the release-env tag default.
|
|
142
|
+
- `PEACH_PLUGIN_REGISTRY`: same as `--registry`.
|
|
143
|
+
- `PEACH_PLUGIN_OTP`: same as `--otp`.
|
|
144
|
+
- `PEACH_PLUGIN_DRY_RUN`: set to `1`, `true`, `yes`, or `on` to enable dry-run.
|
|
145
|
+
|
|
146
|
+
CLI flags override environment defaults.
|
|
147
|
+
|
|
148
|
+
### Script behavior
|
|
149
|
+
|
|
150
|
+
`packages/plugin/scripts/publish-package.mjs` resolves a non-private package from
|
|
151
|
+
`packages/plugin/*`, writes the target version to its `package.json`, runs
|
|
152
|
+
`pnpm --filter <pkg> build`, runs `pnpm --filter <pkg> test:release`, creates a
|
|
153
|
+
temporary tarball with `pnpm pack`, and publishes that verified tarball with
|
|
154
|
+
`npm publish`.
|
|
155
|
+
|
|
156
|
+
For script-tag CDN usage, use `@peach/plugin-script` instead.
|