@zktx.io/walrus-sites-preview 0.0.3 → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 zktx.io
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,35 +1,95 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/zktx-io/walrus-sites-preview/main/Walrus_Logotype_Black.png" alt="Walrus" width="360" />
3
+ </p>
4
+
1
5
  # Walrus Sites Preview
2
6
 
3
- Preview Walrus Sites already deployed on testnet or mainnet locally using a familiar
4
- npm → localhost workflow — without setting up a portal.
7
+ Preview Walrus Sites already deployed on testnet or mainnet through a familiar
8
+ **npm → localhost** workflow.
9
+
10
+ Walrus Sites Preview is a small CLI for opening a current deployment locally
11
+ during design review, QA, planning review, or stakeholder feedback. It is meant
12
+ to sit alongside existing Walrus portal and deployment workflows, not replace
13
+ them.
14
+
15
+ A developer can share one command, and teammates can review the deployed site on
16
+ `localhost` using the same kind of browser workflow they use for regular web
17
+ projects.
18
+
19
+ ---
20
+
21
+ ## Demo Video
22
+
23
+ A short demo showing how to preview a deployed Walrus Site locally:
5
24
 
6
- This tool is for developers who want to quickly preview or debug a deployed Walrus Site in a simple, local-style environment.
25
+ https://github.com/user-attachments/assets/c28c033a-92c5-4ee9-82e0-1406319842c7
26
+
27
+ ---
28
+
29
+ ## Quickstart (one-liner)
30
+
31
+ Preview a deployed Walrus Site in a single command:
32
+
33
+ ```sh
34
+ npx @zktx.io/walrus-sites-preview -testnet -id 0xYOUR_SITE_OBJECT_ID
35
+ ```
36
+
37
+ Then open:
38
+
39
+ ```text
40
+ http://localhost:3000
41
+ ```
42
+
43
+ You can also add `--open` to open the browser automatically:
44
+
45
+ ```sh
46
+ npx @zktx.io/walrus-sites-preview -testnet -id 0xYOUR_SITE_OBJECT_ID --open
47
+ ```
7
48
 
8
49
  ---
9
50
 
10
51
  ## Why this exists
11
52
 
12
- Previewing a Walrus Site on testnet usually requires setting up a portal, which can be difficult for beginners and unnecessary for quick debugging.
53
+ Walrus portals remain the right place for production access, integration
54
+ testing, and portal-specific behavior. This CLI covers a narrower case: quickly
55
+ checking an already deployed site during an internal review cycle.
56
+
57
+ In that situation, teams often need a simple browser URL for the current
58
+ deployment while keeping the existing deployment pipeline unchanged. Provide a
59
+ site object ID, and this CLI fetches the resources and serves a local preview.
13
60
 
14
- This CLI removes that friction.
15
- Give it a site object ID, and it serves the site locally.
61
+ The goal is to make review handoff simpler while preserving the established
62
+ Walrus workflow.
16
63
 
17
64
  ---
18
65
 
19
66
  ## What it does
20
67
 
21
68
  - Loads a Walrus Site using a site object ID
22
- - Fetches resources via Sui RPC + Walrus aggregator
23
- - Serves the site locally (e.g. `http://localhost:3000`)
24
- - Focused purely on developer preview and debugging
69
+ - Fetches resources via Sui RPC and the Walrus aggregator
70
+ - Serves the site locally (for example, `http://localhost:3000`)
71
+ - Provides a local review path that can sit alongside portal-based workflows
72
+ - Supports preview, debugging, QA, and review workflows
25
73
 
26
- This is not a production hosting solution and does not replace portals.
74
+ This is **not** a production hosting solution and does not replace Walrus portals.
75
+
76
+ ---
77
+
78
+ ## Who this is for
79
+
80
+ - Developers who want a quick local preview of an already deployed Walrus Site
81
+ - Web designers reviewing visual changes from a testnet deployment
82
+ - Planners, PMs, and QA reviewers checking an in-progress site before release
83
+ - Teams that want a lightweight local review command for deployed Walrus Sites
84
+
85
+ For many internal review sessions, a reviewer can start with the command and the
86
+ site object ID. Wallets and deployment keys are not part of the preview flow.
27
87
 
28
88
  ---
29
89
 
30
90
  ## Requirements
31
91
 
32
- - Node.js 18+
92
+ - Node.js 18 or later
33
93
 
34
94
  ---
35
95
 
@@ -39,11 +99,14 @@ This is not a production hosting solution and does not replace portals.
39
99
  npm i -D @zktx.io/walrus-sites-preview
40
100
  ```
41
101
 
102
+ > Note: This package is published as a scoped npm package:
103
+ > `@zktx.io/walrus-sites-preview`
104
+
42
105
  ---
43
106
 
44
- ## Quick Start
107
+ ## Quick Start (npm scripts)
45
108
 
46
- Add an npm script to your project:
109
+ Add an npm script to your project so teammates can run a familiar command:
47
110
 
48
111
  ```json
49
112
  {
@@ -62,23 +125,63 @@ npm run preview:testnet
62
125
 
63
126
  Then open:
64
127
 
65
- `http://localhost:3000`
128
+ ```text
129
+ http://localhost:3000
130
+ ```
66
131
 
67
132
  You can inspect the resolved configuration at:
68
133
 
69
- `http://localhost:3000/__config`
134
+ ```text
135
+ http://localhost:3000/__config
136
+ ```
137
+
138
+ ---
139
+
140
+ ## How to get a Site Object ID
141
+
142
+ `walrus-sites-preview` requires a **Walrus Site Object ID**.
143
+
144
+ When a site is deployed to Walrus Sites — whether via the official site-builder CLI or a CI workflow — the **Site Object ID is printed in the deployment output**.
145
+
146
+ Look for a line similar to:
147
+
148
+ ```text
149
+ Site object ID: 0x...
150
+ ```
151
+
152
+ or:
153
+
154
+ ```text
155
+ "site_obj_id": "0x..."
156
+ ```
157
+
158
+ Copy this value and pass it to the preview command.
159
+
160
+ For detailed deployment guides, see:
161
+
162
+ - Publishing a Walrus Site (official docs):
163
+ [https://docs.wal.app/docs/sites/getting-started/publishing-your-first-site](https://docs.wal.app/docs/sites/getting-started/publishing-your-first-site)
164
+ - Deploying via GitHub Actions (walrus-sites-provenance):
165
+ [https://github.com/marketplace/actions/walrus-sites-provenance](https://github.com/marketplace/actions/walrus-sites-provenance)
166
+
167
+ > This tool does not deploy or update sites.
168
+ > It only previews already deployed Walrus Sites.
70
169
 
71
170
  ---
72
171
 
73
172
  ## Configuration
74
173
 
75
- You can optionally create a `config.json` next to your `package.json`.
174
+ You may optionally create a `config.json` next to your `package.json`.
175
+
176
+ CLI flags always override file-based configuration.
76
177
 
77
- CLI flags always override file-based config.
178
+ When using `-testnet` or `-mainnet`, the following values are filled automatically:
78
179
 
79
- If you use `-testnet` or `-mainnet`, the required RPC and aggregator URLs are filled automatically.
180
+ - `rpcUrlList`
181
+ - `aggregatorUrl`
182
+ - `sitePackage`
80
183
 
81
- `config.json` supports:
184
+ ### Supported fields
82
185
 
83
186
  - `siteObjectId` (required)
84
187
  - `rpcUrlList` (required unless using `-testnet` / `-mainnet`)
@@ -87,7 +190,7 @@ If you use `-testnet` or `-mainnet`, the required RPC and aggregator URLs are fi
87
190
  - `network` (optional, informational)
88
191
  - `host`, `port` (via CLI flags)
89
192
 
90
- Example:
193
+ ### Example
91
194
 
92
195
  ```json
93
196
  {
@@ -99,7 +202,11 @@ Example:
99
202
  }
100
203
  ```
101
204
 
102
- To pass arguments dynamically:
205
+ ---
206
+
207
+ ## Passing arguments dynamically
208
+
209
+ Install the package:
103
210
 
104
211
  ```sh
105
212
  npm i -D @zktx.io/walrus-sites-preview
@@ -127,9 +234,19 @@ npm run preview -- -testnet -id 0xYOUR_SITE_OBJECT_ID -port 3000
127
234
 
128
235
  This package vendors and adapts parts of the Walrus Sites portal source code.
129
236
 
130
- Where `dist` comes from (portal build):
237
+ The vendored portal worker code is currently aligned with the upstream
238
+ `portal/worker` package version `2.9.0`.
131
239
 
132
- - Source repo: https://github.com/MystenLabs/walrus-sites/tree/main/portal
240
+ Origin of the bundled `dist` assets (portal build):
241
+
242
+ - Source repository:
243
+ [https://github.com/MystenLabs/walrus-sites/tree/main/portal](https://github.com/MystenLabs/walrus-sites/tree/main/portal)
133
244
  - `portal/worker` → `./portal-worker`
134
245
  - `portal/common` → `./portal-common`
135
- - Source: `./portal-worker/src` (service worker TypeScript) and `./portal-worker/static` (static assets)
246
+ - Included sources:
247
+ - `./portal-worker/src` (service worker TypeScript)
248
+ - `./portal-worker/static` (static assets)
249
+
250
+ ## License
251
+
252
+ MIT