Skip to content

Commit

Permalink
Storybook build fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
arietrouw committed Dec 28, 2024
1 parent e082b75 commit 488f599
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { InfuraProvider } from 'ethers'
import React from 'react'

import { SentinelCard } from './Card.tsx'
import NftSentinelManifest from './NftSentinel.json'
import { NftSentinelManifest } from './manifest.ts'

const loadFromManifest = async () => {
const mnemonic = 'later puppy sound rebuild rebuild noise ozone amazing hope broccoli crystal grief'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as NftSentinelManifest } from './NftSentinel.json' assert { type: 'json' }
6 changes: 0 additions & 6 deletions packages/modules/packages/sentinal/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext",
"typeRoots": [],
},
"exclude": ["dist", "docs", "packages", "node_modules"],
"extends": "@xylabs/tsconfig-react"
}
6 changes: 0 additions & 6 deletions packages/modules/packages/witness/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext",
"typeRoots": [],
},
"exclude": ["dist", "docs", "packages", "node_modules"],
"extends": "@xylabs/tsconfig-react"
}
7 changes: 0 additions & 7 deletions packages/modules/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext",
"typeRoots": [],
},
"exclude": ["dist", "docs", "packages", "node_modules"],
"extends": "@xylabs/tsconfig-react",
"include": ["src"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react'

import { AddressMenuItemRenderer } from './MenuItemRenderer.tsx'

const address: Address = toHex(randomBytes(20))
const address: Address = toHex(randomBytes(20).buffer)
const payload: AddressPayload = {
address,
schema: AddressSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const signatureDataFromBoundWitness = (boundWitness: BoundWitness) => {
result.push({
address: boundWitness.addresses[i],
previous_hash: boundWitness.previous_hashes?.[i],
signature: boundWitness.$meta?.signatures?.[i] ?? [],
signature: boundWitness.$signatures?.[i] ?? [],
})
}
return result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ export const BoundWitnessSignatureTableRow: React.FC<BoundWitnessSignatureTableR
}) => {
const [errors] = usePromise(
async () =>
hash && address ? await BoundWitnessValidator.validateSignature(toUint8Array(hash), toUint8Array(address), toUint8Array(signature)) : [],
hash && address
? await BoundWitnessValidator.validateSignature(
toUint8Array(hash).buffer,
toUint8Array(address).buffer,
toUint8Array(signature)?.buffer,
)
: [],
[hash, address, signature],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ export const NftScoreRenderer: React.FC<NftScoreRendererProps> = ({ payload, ...
</TableHead>
<TableBody>
{categories.map(([category, score]) => {
const typedScore = score as unknown as Score
return score
? (
<TableRow key={category}>
<TableCell key="Category">{category}</TableCell>
<TableCell key="Actual">{score[0]}</TableCell>
<TableCell key="Possible">{score[1]}</TableCell>
<TableCell key="Rating">{getScoreIcon(score)}</TableCell>
<TableCell key="Actual">{typedScore[0]}</TableCell>
<TableCell key="Possible">{typedScore[1]}</TableCell>
<TableCell key="Rating">{getScoreIcon(typedScore)}</TableCell>
</TableRow>
)
: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, { useState } from 'react'
import type { FavoriteItemEvent } from './lib/index.ts'
import { AddressRenderRowBox } from './RenderRowBox.tsx'

const address: Address = toHex(randomBytes(20))
const address: Address = toHex(randomBytes(20).buffer)

const StorybookEntry = {
argTypes: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const signatureDataFromBoundWitness = (boundWitness: BoundWitness) => {
result.push({
address: boundWitness.addresses[i],
previous_hash: boundWitness.previous_hashes[i],
signature: boundWitness.$meta.signatures?.[i],
signature: boundWitness.$signatures?.[i],
})
}
return result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ export const BlockSignatureTableRow: React.FC<BlockSignatureTableRowProps> = ({
}) => {
const [errors] = usePromise(
async () =>
hash && address ? await BoundWitnessValidator.validateSignature(toUint8Array(hash), toUint8Array(address), toUint8Array(signature)) : [],
hash && address
? await BoundWitnessValidator.validateSignature(
toUint8Array(hash).buffer,
toUint8Array(address).buffer,
toUint8Array(signature)?.buffer,
)
: [],
[hash, address, signature],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { CreatablePackageManifest } from '@xyo-network/react-manifest'
import { TimestampWitness } from '@xyo-network/witness-timestamp'
import { InfuraProvider } from 'ethers'

import contractWitnessManifest from './contract-witness-index-node.json'
import contractWitnessManifest from './contract-witness-index-node.json' assert { type: 'json' }

export const ContractWitnessManifestNode: CreatablePackageManifest = (locator: ModuleFactoryLocator): PackageManifestPayload => {
locator.register(MemoryArchivist)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { CreatablePackageManifest } from '@xyo-network/react-manifest'
import { TimestampWitness } from '@xyo-network/witness-timestamp'
import { InfuraProvider } from 'ethers'

import tokenDivinerIndexManifest from './token-diviner-index.json'
import tokenDivinerIndexManifest from './token-diviner-index.json' assert { type: 'json' }

export const TokenDivinerIndexManifestNode: CreatablePackageManifest = (locator: ModuleFactoryLocator): PackageManifestPayload => {
locator.register(MemoryArchivist)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { PackageManifestPayload } from '@xyo-network/manifest'
import type { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
import type { CreatablePackageManifest } from '@xyo-network/react-manifest'

import tokenNodeManifest from './token-node.json'
import tokenNodeManifest from './token-node.json' assert { type: 'json' }

export const TokenManifestNode: CreatablePackageManifest = (locator: ModuleFactoryLocator): PackageManifestPayload => {
locator.register(MemoryBoundWitnessDiviner)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { PackageManifestPayload } from '@xyo-network/manifest'
import type { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'

import type { CreatablePackageManifest } from '../../types/index.ts'
import archivistManifest from './archivist-manifest.json'
import archivistManifest from './archivist-manifest.json' assert { type: 'json' }

export const ArchivistManifestNode: CreatablePackageManifest = (locator: ModuleFactoryLocator): PackageManifestPayload => {
locator.register(MemoryPayloadDiviner)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TimestampWitness } from '@xyo-network/witness-timestamp'

import type { CreatablePackageManifest } from '../../types/index.ts'
import { AddDayDiviner } from '../modules/index.ts'
import sentinelManifest from './sentinel-manifest.json'
import sentinelManifest from './sentinel-manifest.json' assert { type: 'json' }

export const SentinelManifestNode: CreatablePackageManifest = (locator: ModuleFactoryLocator): PackageManifestPayload => {
locator.register(TimestampWitness)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import React, { useState } from 'react'

import type { PoweredByXyoProps } from '../PoweredByXyo.tsx'
import { PoweredByXyo } from '../PoweredByXyo.tsx'
import simpleNodeInlineManifest from './simple-node-inline-manifest.json'
import { simpleNodeInlineManifest } from './manifest.ts'

const StorybookEntry = {
component: PoweredByXyo,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as simpleNodeInlineManifest } from './simple-node-inline-manifest.json' assert { type: 'json' }

0 comments on commit 488f599

Please sign in to comment.