Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: get solid examples working again #199

Merged
merged 2 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions examples/solid/uploads-list/src/ContentPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ export function ContentPage () {
<thead className='near-white tl'>
<tr>
<th className='pa3'>Data CID</th>
<th className='pa3'>CAR CID</th>
<th className='pa3'>Date</th>
</tr>
</thead>
<tbody>
{data().results.map(({ dataCid, carCids, uploadedAt }) => (
<tr key={dataCid} className='stripe-light'>
<td className='pa3'>{dataCid}</td>
<td className='pa3'>{carCids[0]}</td>
<td className='pa3'>{uploadedAt.toLocaleString()}</td>
{data().results.map(({ root }) => (
<tr key={root.toString()} className='stripe-light'>
<td className='pa3'>{root.toString()}</td>
</tr>
))}
</tbody>
Expand Down
8 changes: 4 additions & 4 deletions packages/solid-keyring/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
},
"homepage": "https://github.com/web3-storage/w3ui/tree/main/packages/solid-keyring",
"dependencies": {
"@w3ui/keyring-core": "^2.0.1"
"@w3ui/keyring-core": "^2.0.1",
"@ucanto/interface": "^4.0.3",
"@ucanto/principal": "^4.0.3",
"@web3-storage/access": "^9.2.0"
},
"peerDependencies": {
"solid-js": "^1.5.0"
},
"devDependencies": {
"@ucanto/interface": "^4.0.3",
"@ucanto/principal": "^4.0.3",
"@web3-storage/access": "^9.2.0"
}
}
9 changes: 6 additions & 3 deletions packages/solid-keyring/src/providers/Keyring.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { createContext, useContext, createSignal, createComponent, ParentComponent } from 'solid-js'
import { createStore } from 'solid-js/store'
import { createAgent, getCurrentSpace, getSpaces, KeyringContextState, KeyringContextActions, ServiceConfig } from '@w3ui/keyring-core'
import type { ParentComponent } from 'solid-js'
import type { KeyringContextState, KeyringContextActions, ServiceConfig } from '@w3ui/keyring-core'
import type { Agent } from '@web3-storage/access'
import type { Delegation, Capability, DID } from '@ucanto/interface'

import { createContext, useContext, createSignal, createComponent } from 'solid-js'
import { createStore } from 'solid-js/store'
import { createAgent, getCurrentSpace, getSpaces } from '@w3ui/keyring-core'

export { KeyringContextState, KeyringContextActions }

export type KeyringContextValue = [
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-uploader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
},
"homepage": "https://github.com/web3-storage/w3ui/tree/main/packages/solid-uploader",
"dependencies": {
"@w3ui/solid-keyring": "^2.0.0",
"@w3ui/uploader-core": "^3.0.1",
"@web3-storage/capabilities": "^2.0.0",
"multiformats": "^10.0.2"
},
"peerDependencies": {
"@w3ui/solid-keyring": "^2.0.0",
"solid-js": "^1.5.0"
}
}
3 changes: 2 additions & 1 deletion packages/solid-uploader/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { uploadFile, uploadDirectory, Service, CARMetadata } from '@w3ui/uploader-core'
export { uploadFile, uploadDirectory } from '@w3ui/uploader-core'
export type { Service, CARMetadata } from '@w3ui/uploader-core'
export * from './providers/Uploader'
7 changes: 5 additions & 2 deletions packages/solid-uploads-list/src/resources/UploadsList.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { createResource, InitializedResourceReturn, ResourceOptions, ResourceReturn, ResourceSource } from 'solid-js'
import type { InitializedResourceReturn, ResourceOptions, ResourceReturn, ResourceSource } from 'solid-js'
import type { Space } from '@w3ui/keyring-core'
import { list, ServiceConfig, ListResponse, UploadListResult } from '@w3ui/uploads-list-core'
import type { ServiceConfig, ListResponse, UploadListResult } from '@w3ui/uploads-list-core'
import type { Capability, Proof, Signer } from '@ucanto/interface'

import { createResource } from 'solid-js'
import { list } from '@w3ui/uploads-list-core'
import { list as uploadList } from '@web3-storage/capabilities/upload'

interface UploadsListSource extends ServiceConfig {
Expand Down