Skip to content

Commit

Permalink
fix: fix import path
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiboss committed Jun 14, 2024
1 parent 916b924 commit ad0aa52
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 20 deletions.
1 change: 1 addition & 0 deletions scripts/update-hooks-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'node:fs'
import path from 'node:path'
import url from 'node:url'

// TODO: re-write use import.meta.dirname
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
const srcDir = path.resolve(__dirname, '../src')
const targetPath = path.resolve(__dirname, '../website/src/pages/search/hooks.json')
Expand Down
2 changes: 1 addition & 1 deletion src/use-network/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useStableFn } from '@shined/use'
import { useEffect, useRef } from 'react'
import { useEventListener } from '../use-event-listener'
import { useSetState } from '../use-set-state'
import { useStableFn } from '../use-stable-fn'
import { useSupported } from '../use-supported'
import { now } from '../utils'

Expand Down
14 changes: 10 additions & 4 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,24 @@
"@docusaurus/module-type-aliases": "3.3.2",
"@docusaurus/tsconfig": "3.3.2",
"@docusaurus/types": "3.3.2",
"@iconify-json/mdi": "^1.1.66",
"@unocss/postcss": "^0.59.4",
"@unocss/preset-icons": "^0.59.4",
"gray-matter": "^4.0.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "~5.2.2",
"unocss": "^0.59.4"
},
"browserslist": {
"production": [">0.5%", "not dead", "not op_mini all"],
"development": ["last 3 chrome version", "last 3 firefox version", "last 5 safari version"]
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 3 chrome version",
"last 3 firefox version",
"last 5 safari version"
]
},
"engines": {
"node": ">=18.0"
Expand Down
14 changes: 0 additions & 14 deletions website/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion website/src/components/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const repoBase = 'https://github.com/sheinsight/use/blob/main/src'

export const OTP = () => Math.random().toString().slice(-6)
export const OTP = (): string => Math.random().toString().slice(-6)
export const wait = (ms = 300, res: string = OTP()): Promise<string> =>
new Promise((resolve) => setTimeout(() => resolve(res), ms))
4 changes: 4 additions & 0 deletions website/uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export default defineConfig({
dark: { dark: '[data-theme="dark"]' },
}),
presetIcons({
cdn: 'https://esm.sh/',
// collections: {
// mdi: () => import('@iconify-json/mdi/icons.json').then((i) => i.default),
// },
extraProperties: {
display: 'inline-block',
},
Expand Down

0 comments on commit ad0aa52

Please sign in to comment.