vue-composition-toolkit v0.0.0
vue-composition-toolkit
Vue composition-api toolkit.
Progress Tracking
- useCssVar
- useSWR
- useWindowSize
- useWindowFocus
- useAsyncState
- useCopyToClipboard
- useRaf
- useGeolocation
- useMouse
- useOnline
- useVisibilityState
- useTimeout
- useTimeoutFn
- useInterval
- useRendered
- useScroll
- useScrolling
- useLocalStorage
- useSessionStorage
- useCounter
- useToggle
- useBoolean
- More...Welcome contribution
Prior Art
vue-composition-toolkit is heavily inspired by react-use.
Contribution
We are really excited that you are interested in contributing to vue-composition-toolkit, read the following to learn how to contribute great work.
Development Setup
This project is still in a very early stage, and Vue3 has not yet released the npm package, therefore, you need to complete the following steps to start the project:
- Cloning project
# clone vue-composition-toolkit
git clone https://github.com/shuidi-fed/vue-composition-toolkit.git
# clone vue3
git clone https://github.com/vuejs/vue-next.git- Building Vue3 locally
# clone
git clone https://github.com/vuejs/vue-next.git
# install deps
yarn
# build
yarn build --types- Installation deps & copy
# Installation deps
cd vue-composition-toolkit
yarn install
# Copy vue3 built resources to vue-composition-toolkit/node_modules/@vue
cp vue3/packages vue-composition-toolkit/node_modules/@vueDevelopment Guide
- Add a composition api function
Add the useXXX.ts file under the src/ folder, for example: useBoolean.ts.
- Add the corresponding test file
Add the corresponding test file under the src/__tests__/ folder, for example: src/__tests__/useBoolean.spec.ts.
- Add the corresponding story
A story is a showcase, stored in the src/stories folder, for example: src/stories/useBoolean.story.ts. A story should export a component(the default export), and the corresponding markdown document, then register the story in examples/metaData.ts.
- Running story/example
Run the following command to start the story/example
yarn dev examplesRun test
# run all tests
$ yarn test
# run tests in watch mode
$ yarn test --watch
# run tests in a specific file
$ yarn test fileName
# run a specific test in a specific file
$ yarn test fileName -t 'test name'Debug single test file in vscode:
- Open a test file
- Make breakpoint
- Click Start debugging
Project Structure
src: Store the source code of the composition api toolkit.src/__tests__: Store the test code associated with the composition api toolkit.src/stories: Store thestory/examplecode associated with the composition api toolkit.examples: A simple version of the StoryBook alternative for vue-composition-toolkit.
Core Author
vue-composition-api © HcySunYang, Released under the MIT License. Authored and maintained by HcySunYang.
homepage · GitHub @HcySunYang · Twitter @HcySunYang
6 years ago