Skip to content

Commit

Permalink
refactor: release
Browse files Browse the repository at this point in the history
  • Loading branch information
dalechyn committed Dec 22, 2024
1 parent 23e192b commit a8b19e6
Show file tree
Hide file tree
Showing 274 changed files with 6,470 additions and 6,495 deletions.
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"useShorthandArrayType": "error"
},
"suspicious": {
"noShadowRestrictedNames": "off",
"noArrayIndexKey": "off",
"noAssignInExpressions": "off",
"noConfusingVoidType": "off",
Expand Down
2 changes: 1 addition & 1 deletion buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ plugins:
- target=ts
- import_extension=js
- json_types=true
out: src/Node/Internal/Protobufs
out: src/core/protobufs
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"changeset:prepublish": "pnpm version:update && bun scripts/prepublishOnly.ts && pnpm build",
"changeset:publish": "pnpm changeset:prepublish && changeset publish",
"changeset:version": "changeset version && pnpm install --lockfile-only && pnpm version:update && pnpm format",
"docs:dev": "pnpm --filter site dev",
"docs:extract": "pnpm api-extractor run -c scripts/docgen/api-extractor.json && tsx scripts/docgen/build.ts",
"docs:gen": "pnpm clean && pnpm build:types && pnpm docs:extract",
"docs:build": "pnpm docs:gen && pnpm --filter site build",
"clean": "rm -rf *.tsbuildinfo src/*.tsbuildinfo src/_esm src/_types",
"format": "biome format --write",
"lint": "biome check --fix",
Expand All @@ -28,9 +32,14 @@
"@bufbuild/protoc-gen-es": "^2.2.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.9",
"@microsoft/api-extractor": "^7.48.0",
"@microsoft/api-extractor-model": "^7.30.0",
"@microsoft/tsdoc": "^0.15.1",
"@microsoft/tsdoc-config": "^0.17.1",
"@types/bun": "latest",
"@types/node": "^22.7.4",
"buf": "^0.1.1",
"fs-extra": "^11.2.0",
"knip": "^5.33.3",
"publint": "^0.2.11",
"sherif": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"private": true,
"scripts": {
"dev": "node --import tsx src/index.ts",
"dev": "tsx src/index.ts",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down
119 changes: 17 additions & 102 deletions playground/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Actions, Client, Transport } from 'fhub'
// import { Actions as NodeActions } from 'fhub/Node'
import * as Fhub from 'fhub'
import * as FhubCore from 'fhub/core'
// import { NextPageToken } from 'fhub/_types/Node/Types'

const RPC_URL = process.env.RPC_URL ?? 'https://hub-grpc.pinata.cloud'
// const FID = (() => {
Expand All @@ -12,108 +13,22 @@ const RPC_URL = process.env.RPC_URL ?? 'https://hub-grpc.pinata.cloud'
// return process.env.PRIVATE_KEY as `0x${string}`
// })()

const client = Client.create(
Transport.grpcNode({
const client = Fhub.Client.create(
Fhub.Transport.grpcNode({
baseUrl: RPC_URL,
httpVersion: '2',
}),
)

// Actions.Cast.getCast(client, {
// fid: 3621n,
// hash: '880700eca6c454facaa9bd05ef15fa0b6996a0d2' as any,
// }).then((res) => console.log(res))

// console.time('casts')
// const casts = await Actions.Cast.getCastsByFid(client, {
// fid: 3n,
// pageSize: 2,
// })
// console.timeEnd('casts')
// console.dir(casts, { depth: null })
//
// console.time('bio')
// const myBio = await Actions.UserData.getUserDataBio(client, { fid: 11517n })
// // biome-ignore lint/suspicious/noConsoleLog: <explanation>
// console.log(myBio)
// console.timeEnd('bio')

// const castWithReactions = await Actions.Cast.getCast(client, {
// hash: '0x62cda93dc3889a6f0c819cd4d9392b3af2cb452a',
// fid: 862185n,
// })
// console.dir(castWithReactions, { depth: null })
// // biome-ignore lint/suspicious/noConsoleLog: <explanation>
// console.log('likes', castWithReactions.likes.length)
// // biome-ignore lint/suspicious/noConsoleLog: <explanation>
// console.log('recasts', castWithReactions.recasts.length)

// events subscriptions
// for await (const cast of Actions.Watch.watchCasts(client)) {
// // biome-ignore lint/suspicious/noConsoleLog: <explanation>
// console.log(`${cast.fid} casted at ${cast.timestamp}: ${cast.text.value}`)
// }
//

// const cast = await Actions.Cast.getCast(client, {
// fid: FID,
// hash: '0x388ec5079a518ca133ec87aac23e1c4743bcc860',
// })

//cast creation

// const message = await Actions.Cast.create(client, {
// text: `I'm sending this cast from fhub. It contains mentions of @farcaster, @dalechyn.eth, @vladyslav.
// It also contains a cast embed (https://warpcast.com/dalechyn.eth/0x9c0a228b). I sent it using just a string.
// It also contains a cool cat pic at the end\nhttps://wrpcd.net/cdn-cgi/imagedelivery/BXluQx4ige9GuW0Ia56BHw/0cf0da74-9bf1-4d4a-4b96-2cb950801400/original`,
// account: {
// fid: FID,
// privateKey: PRIVATE_KEY,
// },
// })

//follow creation

// const message = await Actions.Follow.createByUsername(client, {
// follow: {
// username: 'compusophy',
// },
// account: {
// fid: FID,
// privateKey: PRIVATE_KEY,
// },
// })

// like cast

// const message = await Actions.Like.create(client, {
// like: {
// hash: '0xcefbeba351b33fb62ca8c7a6ba75dd9a365f0254',
// fid: 616n,
// },
// account: {
// fid: FID,
// privateKey: PRIVATE_KEY,
// },
// })

//recast

// const message = await Actions.Recast.create(client, {
// recast: {
// hash: '0xcefbeba351b33fb62ca8c7a6ba75dd9a365f0254',
// fid: 616n,
// },
// account: {
// fid: FID,
// privateKey: PRIVATE_KEY,
// },
// })

// console.dir(message)

// for await (const cast of Actions.Watch.watchCastsMentioningUsername(client, {
// username: 'bleu.eth',
// }))
// console.dir(cast)
console.dir(await Actions.User.get(client, { fid: 11517n }))
console.dir(
await FhubCore.Actions.Cast.get(client, {
fid: 11517n,
hash: '0x11241be53fe76933e48e5d601a199ed3f5db254b',
}),
)
console.dir(
await Fhub.Actions.SuperCast.get(client, {
fid: 11517n,
hash: '0x11241be53fe76933e48e5d601a199ed3f5db254b',
}),
)
Loading

0 comments on commit a8b19e6

Please sign in to comment.