Skip to content

Commit 04ff8ab

Browse files
committed
chore: format code
1 parent 368093f commit 04ff8ab

File tree

9 files changed

+34
-20
lines changed

9 files changed

+34
-20
lines changed

package.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,26 @@
4242
},
4343
"scripts": {
4444
"init": "pnpm i",
45-
"dev": "run-p dev:*",
45+
"dev": "run-p dev:* && pnpm run play",
4646
"dev:client": "",
4747
"dev:server": "",
48-
"play": "pnpm run --filter @ikun-svelte-devtools/playground dev",
48+
"dev:icons": "",
49+
"dev:shared": "",
50+
"dev:utils:client": "",
51+
"dev:utils:server": "",
4952
"build": "",
5053
"build:client": "",
5154
"build:server": "",
55+
"build:icons": "",
56+
"build:shared": "",
57+
"build:utils:client": "",
58+
"build:utils:server": "",
59+
"play": "pnpm run --filter @ikun-svelte-devtools/playground dev",
5260
"lint": "prettier --plugin-search-dir --check . && eslint .",
5361
"format": "prettier --plugin-search-dir --write .",
5462
"release": "bumpp package.json packages/*/**/package.json packages/*/package.json --commit --push --tag",
5563
"clean:dist": "rimraf dist && esno scripts/clean.js",
56-
"prepare": "",
64+
"prepare": "npx simple-git-hooks",
5765
"update:deps": "npx taze -w -r major && pnpm run init",
5866
"publish:npm": "pnpm publish --no-git-checks --access public"
5967
},
@@ -85,10 +93,14 @@
8593
"bumpp": "^9.1.1",
8694
"npm-run-all": "^4.1.5",
8795
"rimraf": "^5.0.1",
88-
"simple-git-hooks": "^2.8.1",
96+
"simple-git-hooks": "^2.9.0",
8997
"typescript": "^5.1.6",
9098
"tsup": "^7.2.0",
9199
"del": "^7.0.0",
92100
"esno": "latest"
101+
},
102+
"simple-git-hooks": {
103+
"pre-commit": "pnpm run format && pnpm run lint",
104+
"commit-msg": "node vertify-commit.js"
93105
}
94106
}

packages/client/src/components/Copy.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { copyText } from '@baiwusanyu/utils-com'
33
import { KMessage, KIcon } from "@ikun-ui/core";
4-
export let data: {}
4+
export let data: any = {}
55
export let width = '24px'
66
export let height = '24px'
77
export let attrs={}

packages/client/src/components/IframeView.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
export let colorMode = darkLight()
66
export let src = ''
77
const iframeCacheMap = new Map<string, HTMLIFrameElement>()
8-
let anchor = null
9-
let iframeEl = null
8+
let anchor: HTMLElement | null = null
9+
let iframeEl: HTMLIFrameElement | null = null
1010
let box:DOMRect | null = null
1111
let isAddEvt = false
1212
$:if(anchor){
@@ -69,6 +69,7 @@
6969
html?.classList.toggle('light', colorMode === 'dark')
7070
}
7171
catch (e) {
72+
console.error(e)
7273
}
7374
}
7475

packages/client/src/views/document.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
Logo,
99
CarbonCarbon,
1010
CarbonQuery
11-
}
11+
} as Record<string, any>
1212
</script>
1313
<div class="grid grid-cols-2 grid-rows-2 gap-4 p-8 w-full min-h-full">
14-
{#each documentDetail as doc, index (doc.id)}
14+
{#each documentDetail as doc (doc.id)}
1515
<div class="flex p4 border border-solid border-main rounded-lg hover:animate-LianYi">
1616
<div class="flex-auto">
1717
<div class="flex items-center">

packages/client/src/views/graph.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const handleDataToChartData = (initData) =>{
5656
const { data, main } = initData
5757
const { level } = getGraphConfig()
5858
const nodes: Data['nodes'] = data.map((mod) => {
59-
const path = mod.id.replace(/\?.*$/, '').replace(/\#.*$/, '')
59+
const path = mod.id.replace(/\?.*$/, '').replace(/#.*$/, '')
6060
const pathSegments = path.split('/')
6161
const id = mod.id
6262

packages/server/src/app/eye-dropper.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
}
77
88
interface EyeDropper {
9-
new(): EyeDropper
109
open: (options?: EyeDropperOpenOptions) => Promise<{ sRGBHex: string }>
1110
[Symbol.toStringTag]: 'EyeDropper'
1211
}

packages/utils/client/src/babble-interact.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function updateOffset(left: number, top: number, dom: HTMLElement) {
44
dom.style.transform = 'translate(0%, 0%)';
55
}
66

7-
export function babbleInteract(domId: string, clickFn?: Function) {
7+
export function babbleInteract(domId: string, clickFn?: () => void) {
88
const interactDom = document.querySelector(domId) as HTMLElement;
99
let isDragging = false;
1010
let initialX, initialY;

packages/utils/client/src/modal-interact.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export function dragResize(node: HTMLElement, params) {
4141

4242
if (isResizing.includes('m')) {
4343
// drag modal
44-
let leftCur = Math.max(e.clientX - initialX, 0);
45-
let bottomCur = e.clientY + initialY + node!.offsetHeight;
44+
const leftCur = Math.max(e.clientX - initialX, 0);
45+
const bottomCur = e.clientY + initialY + node!.offsetHeight;
4646
bottom = `calc(100% - ${bottomCur}px)`;
4747
left = `${Math.min(leftCur, document.body.offsetWidth - node!.offsetWidth)}px`;
4848
}

packages/utils/server/src/vite-dev-rpc.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import type { WebSocketClient, WebSocketServer } from 'vite';
44
import type { ViteHotContext } from 'vite-hot-client';
55

66
// create rpc group
7-
export function createRPCServer<ClientFunction = {}, ServerFunctions = {}>(
8-
name: string,
9-
ws: WebSocketServer,
10-
functions: ServerFunctions
11-
) {
7+
export function createRPCServer<
8+
ClientFunction = Record<any, any>,
9+
ServerFunctions = Record<any, any>
10+
>(name: string, ws: WebSocketServer, functions: ServerFunctions) {
1211
const event = `${name}:rpc`;
1312

1413
const group = createBirpcGroup<ClientFunction, ServerFunctions>(
@@ -39,7 +38,10 @@ export function createRPCServer<ClientFunction = {}, ServerFunctions = {}>(
3938
}
4039

4140
// create rpc client
42-
export function createRPCClient<ServerFunctions = {}, ClientFunctions = {}>(
41+
export function createRPCClient<
42+
ClientFunctions = Record<any, any>,
43+
ServerFunctions = Record<any, any>
44+
>(
4345
name: string,
4446
hot: ViteHotContext | Promise<ViteHotContext>,
4547
functions: ClientFunctions = {} as ClientFunctions

0 commit comments

Comments
 (0)