create-sia-app 0.1.15 → 0.1.16
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/package.json +1 -1
- package/template/CLAUDE.md +4 -4
- package/template/README.md +2 -2
- package/template/package.json +1 -1
- package/template/src/components/auth/ApproveScreen.tsx +1 -1
- package/template/src/components/auth/AuthFlow.tsx +1 -1
- package/template/src/components/auth/ConnectScreen.tsx +1 -1
- package/template/src/components/auth/RecoveryScreen.tsx +1 -1
- package/template/src/components/upload/UploadZone.tsx +1 -1
- package/template/src/lib/constants.ts +1 -1
- package/template/src/stores/auth.ts +1 -1
- package/template/vite.config.ts +1 -1
package/package.json
CHANGED
package/template/CLAUDE.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
A starter template for building decentralized storage apps on the Sia network. Uses [
|
|
5
|
+
A starter template for building decentralized storage apps on the Sia network. Uses [`@siafoundation/sia-storage`](https://www.npmjs.com/package/@siafoundation/sia-storage) — a TypeScript SDK that ships a pre-compiled WASM binary for encryption, uploads, downloads, and key management. WASM runs on the main thread (Rust async — no workers required).
|
|
6
6
|
|
|
7
|
-
**Tech stack:** React 19, TypeScript, Vite, Tailwind CSS 4, Zustand,
|
|
7
|
+
**Tech stack:** React 19, TypeScript, Vite, Tailwind CSS 4, Zustand, `@siafoundation/sia-storage`
|
|
8
8
|
|
|
9
9
|
## Architecture
|
|
10
10
|
|
|
@@ -28,7 +28,7 @@ Returning users skip `requestConnection`/`waitForApproval`/`register` entirely.
|
|
|
28
28
|
|
|
29
29
|
### SDK
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
`@siafoundation/sia-storage` handles:
|
|
32
32
|
- Encrypted file uploads/downloads (erasure coding + encryption)
|
|
33
33
|
- Key derivation from recovery phrases (BIP-39)
|
|
34
34
|
- Object pinning and metadata management
|
|
@@ -62,7 +62,7 @@ Auth state persists to localStorage via Zustand's `persist` middleware. The stor
|
|
|
62
62
|
### Upload a file
|
|
63
63
|
|
|
64
64
|
```ts
|
|
65
|
-
import { PinnedObject } from 'sia-storage'
|
|
65
|
+
import { PinnedObject } from '@siafoundation/sia-storage'
|
|
66
66
|
|
|
67
67
|
const object = new PinnedObject()
|
|
68
68
|
const pinnedObject = await sdk.upload(object, file.stream(), {
|
package/template/README.md
CHANGED
|
@@ -76,7 +76,7 @@ const sdk = useAuthStore((s) => s.sdk)
|
|
|
76
76
|
- [Tailwind CSS](https://tailwindcss.com) 4
|
|
77
77
|
- [Zustand](https://zustand.docs.pmnd.rs) (state management)
|
|
78
78
|
- [Biome](https://biomejs.dev) (linting & formatting)
|
|
79
|
-
- [sia-storage](https://www.npmjs.com/package/sia-storage) (Sia SDK — encryption, erasure coding, direct host transfers via WASM)
|
|
79
|
+
- [@siafoundation/sia-storage](https://www.npmjs.com/package/@siafoundation/sia-storage) (Sia SDK — encryption, erasure coding, direct host transfers via WASM)
|
|
80
80
|
|
|
81
81
|
## Project Structure
|
|
82
82
|
|
|
@@ -94,4 +94,4 @@ src/
|
|
|
94
94
|
## Learn More
|
|
95
95
|
|
|
96
96
|
- [Sia Documentation](https://docs.sia.tech)
|
|
97
|
-
- [sia-storage](https://www.npmjs.com/package/sia-storage)
|
|
97
|
+
- [@siafoundation/sia-storage](https://www.npmjs.com/package/@siafoundation/sia-storage)
|
package/template/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react'
|
|
2
|
-
import type { Builder } from 'sia-storage'
|
|
2
|
+
import type { Builder } from '@siafoundation/sia-storage'
|
|
3
3
|
import { useAuthStore } from '../../stores/auth'
|
|
4
4
|
import { CopyButton } from '../CopyButton'
|
|
5
5
|
import { DevNote } from '../DevNote'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react'
|
|
2
|
-
import { AppKey, Builder, initSia } from 'sia-storage'
|
|
2
|
+
import { AppKey, Builder, initSia } from '@siafoundation/sia-storage'
|
|
3
3
|
import { APP_META } from '../../lib/constants'
|
|
4
4
|
import { useAuthStore } from '../../stores/auth'
|
|
5
5
|
import { ApproveScreen } from './ApproveScreen'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
|
-
import { Builder } from 'sia-storage'
|
|
2
|
+
import { Builder } from '@siafoundation/sia-storage'
|
|
3
3
|
import { APP_META, DEFAULT_INDEXER_URL } from '../../lib/constants'
|
|
4
4
|
import { useAuthStore } from '../../stores/auth'
|
|
5
5
|
import { DevNote } from '../DevNote'
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
type Builder,
|
|
4
4
|
generateRecoveryPhrase,
|
|
5
5
|
validateRecoveryPhrase,
|
|
6
|
-
} from 'sia-storage'
|
|
6
|
+
} from '@siafoundation/sia-storage'
|
|
7
7
|
import { useAuthStore } from '../../stores/auth'
|
|
8
8
|
import { CopyButton } from '../CopyButton'
|
|
9
9
|
import { DevNote } from '../DevNote'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
|
-
import { encodedSize, PinnedObject, type ShardProgress } from 'sia-storage'
|
|
2
|
+
import { encodedSize, PinnedObject, type ShardProgress } from '@siafoundation/sia-storage'
|
|
3
3
|
import { APP_KEY, DATA_SHARDS, PARITY_SHARDS } from '../../lib/constants'
|
|
4
4
|
import { useAuthStore } from '../../stores/auth'
|
|
5
5
|
import { DevNote } from '../DevNote'
|
package/template/vite.config.ts
CHANGED
|
@@ -6,5 +6,5 @@ export default defineConfig({
|
|
|
6
6
|
plugins: [react(), tailwindcss()],
|
|
7
7
|
// sia-storage loads its WASM via `new URL(..., import.meta.url)`; excluding
|
|
8
8
|
// it from the deps pre-bundler keeps that URL pointing at the real file.
|
|
9
|
-
optimizeDeps: { exclude: ['sia-storage'] },
|
|
9
|
+
optimizeDeps: { exclude: ['@siafoundation/sia-storage'] },
|
|
10
10
|
})
|