Skip to content

Commit

Permalink
feat: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
songkeys committed Oct 25, 2024
1 parent 17bae3a commit 8cb9797
Show file tree
Hide file tree
Showing 121 changed files with 6,304 additions and 5,929 deletions.
14 changes: 0 additions & 14 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"files": {
"ignore": ["./dist/**/*"]
},
"formatter": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
Expand All @@ -17,16 +14,5 @@
"noExplicitAny": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingComma": "all",
"semicolons": "asNeeded"
}
},

"organizeImports": {
"enabled": true
}
}
134 changes: 67 additions & 67 deletions examples/vite/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,107 +1,107 @@
<script setup lang="ts">
import { createContract, createIndexer } from 'crossbell'
import { onErrorCaptured, ref } from 'vue'
import { useDark, useEventListener, useLocalStorage } from '@vueuse/core'
import { type Address } from 'abitype'
import { useDark, useEventListener, useLocalStorage } from "@vueuse/core";
import type { Address } from "abitype";
import { createContract, createIndexer } from "crossbell";
import { onErrorCaptured, ref } from "vue";
useDark()
useEventListener(window, 'error', (event) => showResult(event))
useEventListener(window, 'unhandledrejection', (event) =>
showResult(event.reason.toString()),
)
useDark();
useEventListener(window, "error", (event) => showResult(event));
useEventListener(window, "unhandledrejection", (event) =>
showResult(event.reason.toString()),
);
onErrorCaptured((err) => {
showResult(err)
})
showResult(err);
});
const metamask = window.ethereum
const contract = createContract(metamask)
const metamask = window.ethereum;
const contract = createContract(metamask);
const indexer = createIndexer()
const indexer = createIndexer();
const address = useLocalStorage<Address>('address', '0x')
const characterId = useLocalStorage('characterId', '')
const handle = useLocalStorage('handle', '')
const result = ref('')
const loading = ref(false)
const address = useLocalStorage<Address>("address", "0x");
const characterId = useLocalStorage("characterId", "");
const handle = useLocalStorage("handle", "");
const result = ref("");
const loading = ref(false);
async function connect() {
await showResult(contract.walletClient.requestAddresses())
await showResult(contract.walletClient.requestAddresses());
}
async function showResult(p: any) {
loading.value = true
try {
result.value = JSON.stringify(
await p,
(key: string, value: any) =>
typeof value === 'bigint' ? value.toString() : value,
2,
)
} catch (err: any) {
result.value = err
} finally {
loading.value = false
}
loading.value = true;
try {
result.value = JSON.stringify(
await p,
(key: string, value: any) =>
typeof value === "bigint" ? value.toString() : value,
2,
);
} catch (err: any) {
result.value = err;
} finally {
loading.value = false;
}
}
function balance() {
showResult(
contract.csb.getBalance({
owner: address.value,
}),
)
showResult(
contract.csb.getBalance({
owner: address.value,
}),
);
}
function transfer() {
showResult(
contract.csb.transfer({
toAddress: address.value,
amount: 0,
}),
)
showResult(
contract.csb.transfer({
toAddress: address.value,
amount: 0,
}),
);
}
function getPrimaryHandle() {
showResult(
contract.character.getPrimaryId({
address: address.value,
}),
)
showResult(
contract.character.getPrimaryId({
address: address.value,
}),
);
}
function getCharacterByHandle() {
showResult(
contract.character.getByHandle({
handle: handle.value,
}),
)
showResult(
contract.character.getByHandle({
handle: handle.value,
}),
);
}
function getCharacter() {
showResult(
contract.character.get({
characterId: characterId.value,
}),
)
showResult(
contract.character.get({
characterId: characterId.value,
}),
);
}
function setPrimaryCharacterId() {
showResult(
contract.character.setPrimaryId({
characterId: +characterId.value,
}),
)
showResult(
contract.character.setPrimaryId({
characterId: +characterId.value,
}),
);
}
function getCharacters() {
showResult(indexer.character.getMany(address.value))
showResult(indexer.character.getMany(address.value));
}
function getNotes() {
showResult(indexer.note.getMany({ characterId: characterId.value }))
showResult(indexer.note.getMany({ characterId: characterId.value }));
}
function getFeeds() {
showResult(indexer.feed.getManyByCharacter(characterId.value))
showResult(indexer.feed.getManyByCharacter(characterId.value));
}
</script>

Expand Down
12 changes: 6 additions & 6 deletions examples/vite/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@unocss/reset/tailwind.css'
import 'uno.css'
import { createApp } from 'vue'
import App from './App.vue'
import './style.css'
import "@unocss/reset/tailwind.css";
import "uno.css";
import { createApp } from "vue";
import App from "./App.vue";
import "./style.css";

createApp(App).mount('#app')
createApp(App).mount("#app");
6 changes: 3 additions & 3 deletions examples/vite/src/style.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
input {
--at-apply: 'p2 w-250px bg-transparent border rounded border-gray-200 dark:border-gray-700 outline-none active:outline-none';
--at-apply: "p2 w-250px bg-transparent border rounded border-gray-200 dark:border-gray-700 outline-none active:outline-none";
}

button {
--at-apply: 'px-4 py-1 rounded inline-block bg-yellow-600 text-white cursor-pointer hover:bg-yellow-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50';
--at-apply: "px-4 py-1 rounded inline-block bg-yellow-600 text-white cursor-pointer hover:bg-yellow-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50";
}

hr {
--at-apply: 'my-3';
--at-apply: "my-3";
}
40 changes: 20 additions & 20 deletions examples/vite/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"jsx": "preserve",
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"lib": ["ESNext", "DOM"],
"skipLibCheck": true,
"noEmit": true,
"paths": {
"crossbell": ["../../src/index.ts"]
},
"experimentalDecorators": true
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"jsx": "preserve",
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"lib": ["ESNext", "DOM"],
"skipLibCheck": true,
"noEmit": true,
"paths": {
"crossbell": ["../../src/index.ts"]
},
"experimentalDecorators": true
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
}
11 changes: 8 additions & 3 deletions examples/vite/unocss.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import transformerDirectives from '@unocss/transformer-directives'
import { defineConfig, presetAttributify, presetIcons, presetUno } from 'unocss'
import transformerDirectives from "@unocss/transformer-directives";
import {
defineConfig,
presetAttributify,
presetIcons,
presetUno,
} from "unocss";

export default defineConfig({
presets: [presetUno(), presetAttributify(), presetIcons()],
transformers: [transformerDirectives()],
})
});
18 changes: 9 additions & 9 deletions examples/vite/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import path from 'node:path'
import Vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import { defineConfig, loadEnv } from 'vite'
import path from "node:path";
import Vue from "@vitejs/plugin-vue";
import UnoCSS from "unocss/vite";
import { defineConfig, loadEnv } from "vite";

export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const env = loadEnv(mode, process.cwd(), "");
return {
resolve: {
alias: {
crossbell: path.resolve(__dirname, '../../src/index.ts'),
crossbell: path.resolve(__dirname, "../../src/index.ts"),
},
},
define: {
'globalThis.process.env.CROSSBELL_RPC_ADDRESS': JSON.stringify(
"globalThis.process.env.CROSSBELL_RPC_ADDRESS": JSON.stringify(
env.CROSSBELL_RPC_ADDRESS,
),
},
plugins: [Vue(), UnoCSS()],
}
})
};
});
Loading

0 comments on commit 8cb9797

Please sign in to comment.