From f75aa8cfa3446e5a6c60e1daa6bf9d2cc6ef0edf Mon Sep 17 00:00:00 2001 From: Hebilicious Date: Sat, 3 Jun 2023 18:53:10 +0700 Subject: [PATCH] feat: add auto-imports --- .eslintrc | 4 +- README.md | 55 ++++++++++++-------- packages/vue-query-nuxt/package.json | 6 +++ packages/vue-query-nuxt/src/module.ts | 13 +++-- packages/vue-query-nuxt/src/runtime/utils.ts | 13 +++++ playgrounds/advanced/app.vue | 2 - playgrounds/simple/app.vue | 2 - test/fixtures/todos/app.vue | 2 - 8 files changed, 64 insertions(+), 33 deletions(-) diff --git a/.eslintrc b/.eslintrc index 8e814db..6f44bcb 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,6 +5,8 @@ "@typescript-eslint/comma-dangle": ["error", "never"], "comma-dangle": ["error", "never"], "yml/quotes": "off", - "antfu/if-newline": "off" + "antfu/if-newline": "off", + "curly": ["error", "multi-line"], + "object-property-newline": ["off", { "allowAllPropertiesOnSameLine": true}] } } diff --git a/README.md b/README.md index 53e0f20..9778818 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # โš—๏ธ Vue Query Nuxt [![CI](https://github.com/Hebilicious/vue-query-nuxt/actions/workflows/ci.yaml/badge.svg)](https://github.com/Hebilicious/vue-query-nuxt/actions/workflows/ci.yaml) -[![npm version](https://badge.fury.io/js/@hebilicious%2Fvue-query-nuxt.svg)](https://badge.fury.io/js/@hebilicious%2Fvue-query-nuxt) +[![npm version](https://badge.fury.io/js/@hebilicious%20vue-query-nuxt.svg)](https://badge.fury.io/js/@hebilicious%20vue-query-nuxt) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ๐Ÿš€ Welcome to __Vue Query Nuxt__! @@ -9,44 +9,43 @@ This Nuxt Module automatically installs and configure Vue Query for your Nuxt application. It has 0 config out-of-the box and extremely lightweight. -## โš ๏ธ Disclaimer +## Features -_๐Ÿงช This module is in active development._ +- 0 config out-of-the box +- All configurations options available +- Auto Imports for Vue Query composables Refer to the [Vue Query documentation](https://tanstack.com/query/latest/docs/vue/quick-start) for more information about Vue Query. -## ๐Ÿ“ฆ Installation +## ๐Ÿ“ฆ How to use - -1. Use npm, pnpm or yarn to install the dependencies. +### 1. Use npm, pnpm or yarn to install the dependencies. ```bash +# npm npm i @hebilicious/vue-query-nuxt @tanstack/vue-query -``` - -```bash +# pnpm pnpm i @hebilicious/vue-query-nuxt @tanstack/vue-query +# yarn +yarn add @hebilicious/vue-query-nuxt @tanstack/vue-query ``` -```bash -yarn i @hebilicious/vue-query-nuxt @tanstack/vue-query -``` +### 2. Add the modules to your Nuxt modules -2. Add the modules to your Nuxt modules +In `nuxt.config.ts` : ```ts -// In nuxt.config.ts export default defineNuxtConfig({ modules: ["@hebilicious/vue-query-nuxt"] }) ``` -3. Use right away +### 3. Use right away -```html -