nivii 0.2.4 → 0.2.5

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.
Files changed (3) hide show
  1. package/README.md +1 -224
  2. package/dist/cli.js +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -153,233 +153,10 @@ nivii --help # Show all commands
153
153
 
154
154
  ---
155
155
 
156
- ## Architecture
157
-
158
- ```
159
- User runs: nivii share
160
-
161
-
162
- ┌─────────────────────────────────────────────────────────┐
163
- │ Nivii CLI (Node.js) │
164
- │ │
165
- │ 1. detectFramework() → identifies build system │
166
- │ 2. runBuild() → executes build command │
167
- │ 3. zipDirectory() → zips output dir │
168
- │ 4. uploadDeploy() → POST /deploy to API │
169
- │ 5. showQR() → renders QR in terminal │
170
- │ 6. startLiveSync() → WebSocket watcher (--live) │
171
- └──────────────────────────────┬──────────────────────────┘
172
- │ HTTPS multipart/form-data
173
-
174
- ┌─────────────────────────────────────────────────────────┐
175
- │ api.nivii.app (Cloudflare Worker) │
176
- │ │
177
- │ POST /deploy │
178
- │ ├─ Stores metadata in KV (slug, password, expiry…) │
179
- │ └─ Uploads deploy.zip to R2 bucket │
180
- └──────────────┬────────────────────────────────┬─────────┘
181
- │ │
182
- ▼ ▼
183
- ┌──────────────────────┐ ┌─────────────────────────────┐
184
- │ Cloudflare R2 │ │ Cloudflare KV │
185
- │ (Object Storage) │ │ (Metadata + Analytics) │
186
- │ │ │ │
187
- │ deploys/{slug}/ │ │ deploy:{slug} → JSON meta │
188
- │ └─ deploy.zip │ │ analytics:{slug} → stats │
189
- └──────────────────────┘ └─────────────────────────────┘
190
-
191
-
192
- ┌─────────────────────────────────────────────────────────┐
193
- │ *.nivii.app (Cloudflare Worker wildcard routing) │
194
- │ │
195
- │ GET xyz.nivii.app/ │
196
- │ ├─ Checks KV for metadata (expiry, password, OTP) │
197
- │ ├─ Serves files from R2 │
198
- │ └─ SPA fallback to index.html │
199
- │ │
200
- │ live.nivii.app/live/{slug} (WebSocket) │
201
- │ └─ LiveSyncDO (Durable Object) │
202
- │ └─ Broadcasts reload events to connected viewers │
203
- └─────────────────────────────────────────────────────────┘
204
- ```
205
-
206
- ---
207
-
208
- ## Self-Hosting on Cloudflare
209
-
210
- Deploy your own Nivii instance in ~10 minutes:
211
-
212
- ### Prerequisites
213
-
214
- - [Cloudflare account](https://cloudflare.com) (free tier works)
215
- - [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/): `npm i -g wrangler`
216
- - Node.js 18+
217
-
218
- ### Steps
219
-
220
- **1. Clone and install**
221
-
222
- ```bash
223
- git clone https://github.com/Aadigarg111/Nivi-sh.git
224
- cd Nivi-sh
225
- npm install
226
- ```
227
-
228
- **2. Create Cloudflare resources**
229
-
230
- ```bash
231
- # Login to Cloudflare
232
- wrangler login
233
-
234
- # Create KV namespace
235
- wrangler kv:namespace create "DB"
236
- wrangler kv:namespace create "DB" --preview
237
-
238
- # Create R2 bucket
239
- wrangler r2 bucket create nivii-deployments
240
- ```
241
-
242
- **3. Update wrangler.toml**
243
-
244
- ```toml
245
- # packages/worker/wrangler.toml
246
- [[kv_namespaces]]
247
- binding = "DB"
248
- id = "YOUR_ACTUAL_KV_ID" # from step 2
249
- preview_id = "YOUR_PREVIEW_KV_ID"
250
-
251
- [[r2_buckets]]
252
- binding = "BUCKET"
253
- bucket_name = "nivii-deployments"
254
- ```
255
-
256
- **4. Deploy the worker**
257
-
258
- ```bash
259
- cd packages/worker
260
- wrangler deploy
261
- ```
262
-
263
- **5. Configure DNS**
264
-
265
- Add a wildcard DNS record:
266
- ```
267
- Type: CNAME
268
- Name: *
269
- Target: your-worker.workers.dev
270
- Proxy: Enabled (orange cloud)
271
- ```
272
-
273
- **6. Point the CLI at your instance**
274
-
275
- ```bash
276
- export NIVII_API=https://api.your-domain.com
277
-
278
- # Or in config
279
- nivii config apiBase https://api.your-domain.com
280
- ```
281
-
282
- ---
283
-
284
- ## Configuration
285
-
286
- Config is stored at `~/.nivii/config.json`:
287
-
288
- ```json
289
- {
290
- "token": "your-pro-token",
291
- "plan": "free",
292
- "apiBase": "https://api.nivii.app",
293
- "deployments": [...]
294
- }
295
- ```
296
-
297
- Manage it:
298
-
299
- ```bash
300
- nivii config # show all
301
- nivii config token <tok> # set token
302
- nivii config apiBase <url> # point to self-hosted instance
303
- ```
304
-
305
- ---
306
-
307
- ## Roadmap v2
308
-
309
- - [ ] **Team workspaces** — share deployments with your team
310
- - [ ] **Custom domains** — deploy to `preview.your-company.com`
311
- - [ ] **GitHub Actions integration** — auto-share on every PR
312
- - [ ] **VS Code extension** — deploy with a keyboard shortcut
313
- - [ ] **Mobile app** — scan QR codes from Nivii deployments
314
- - [ ] **Zip-streaming upload** — faster uploads for large projects
315
- - [ ] **Screenshot previews** — auto-thumbnail for each deployment
316
- - [ ] **API keys + webhooks** — programmatic deployments
317
- - [ ] **Deployment history UI** — web dashboard at `app.nivii.app`
318
- - [ ] **SSR support** — run Express/Fastify apps in serverless mode
319
- - [ ] **Monorepo support** — deploy multiple packages at once
320
-
321
- ---
322
-
323
- ## Contributing
324
-
325
- Contributions are welcome! This is an AGPL-3.0 open-source project.
326
-
327
- ```bash
328
- # Fork and clone
329
- git clone https://github.com/YOUR_USERNAME/Nivi-sh.git
330
- cd Nivi-sh
331
-
332
- # Install dependencies
333
- npm install
334
-
335
- # Build CLI
336
- cd packages/cli && npm run build
337
-
338
- # Run locally
339
- node dist/cli.js share --help
340
- ```
341
-
342
- ### Project structure
343
-
344
- ```
345
- packages/cli/ - The NPM CLI tool (published as `nivii`)
346
- packages/worker/ - Cloudflare Worker backend
347
- landing/ - Landing page HTML
348
- .github/ - GitHub Actions workflows
349
- ```
350
-
351
- ### Submitting PRs
352
-
353
- 1. Fork the repository
354
- 2. Create a feature branch: `git checkout -b feat/my-feature`
355
- 3. Commit your changes: `git commit -m 'feat: add something cool'`
356
- 4. Push to your fork: `git push origin feat/my-feature`
357
- 5. Open a Pull Request
358
-
359
- Please follow conventional commits and keep PRs focused.
360
-
361
- ---
362
-
363
- ## License
364
-
365
- ```
366
- Nivii — Futuristic Project Sharing CLI
367
- Copyright (C) 2025 Aadigarg111
368
-
369
- This program is free software: you can redistribute it and/or modify
370
- it under the terms of the GNU Affero General Public License as published by
371
- the Free Software Foundation, either version 3 of the License, or
372
- (at your option) any later version.
373
- ```
374
-
375
- **[AGPL-3.0](./LICENSE)** — See the LICENSE file for full terms.
376
-
377
- ---
378
-
379
156
  <div align="center">
380
157
 
381
158
  Made with ❤️ by [Aadigarg111](https://github.com/Aadigarg111)
382
159
 
383
- ⚡ [nivii.app](https://nivii.app) · [npm](https://www.npmjs.com/package/nivii) · [GitHub](https://github.com/Aadigarg111/Nivi-sh)
160
+ ⚡ [nivii.app](https://nivii.app) · [npm](https://www.npmjs.com/package/nivii)
384
161
 
385
162
  </div>
package/dist/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nivii",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "⚡ The fastest, most beautiful way to share any local project via a live URL",
5
5
  "type": "module",
6
6
  "bin": {