GithubHelp home page GithubHelp logo

kerunix / nuxt-typed-router Goto Github PK

View Code? Open in Web Editor NEW

This project forked from victorgarciaesgi/nuxt-typed-router

0.0 0.0 0.0 8.73 MB

🚦Provide autocompletion for pages route names and params in Nuxt apps

Home Page: https://nuxt-typed-router.vercel.app

License: MIT License

TypeScript 98.22% Vue 1.78%

nuxt-typed-router's Introduction

nuxt-typed-router cover

npm version npm downloads npm downloads

Provide a type safe router to Nuxt with auto-generated typed definitions for route names and autocompletion for route params

  • NuxtLink route autocomplete and params type-check
  • useRouter, useRoute and navigateTo route autocomplete and params type-check
  • Supports optional params and catchAll routes
  • Out of the box i18n support
  • Supports routes extended by config and modules

A beta version with path autocomplete is available in version v3.0.0-beta.0 https://github.com/victorgarciaesgi/nuxt-typed-router/releases/tag/v3.0.0-beta.0




Documentation

Documentation

Play with it

Open in StackBlitz

Demo repo 🧪 : nuxt-typed-router-demo


Compatibility:

Quick start

For Nuxt 3

yarn add -D nuxt-typed-router
# or
npm install -D nuxt-typed-router
# or
pnpm install -D nuxt-typed-router

Nuxt 2 legacy

Nuxt 2 version is no longer maintained, but still available in nuxt2 branch It only has route name autocomplete functionnality

yarn add -D nuxt-typed-router@legacy
# or
npm install -D nuxt-typed-router@legacy

Configuration

Register the module in the nuxt.config.ts, done!

export default defineNuxtConfig({
  modules: ['nuxt-typed-router'],
});

Roadmap

  • Add path autocomplete with TS string templates
  • Enforce strong params typing depending of origin route
  • Add support for validate in definePageMeta
  • Add strict option to prevent path navigation

Development

  1. Clone this repository
  2. Install dependencies using pnpm
  3. Build project for local tests pnpm run test
  4. Start dev playground pnpm run prepack && pnpm run dev
  5. Build project for deploy pnpm prepack

📑 License

MIT License

nuxt-typed-router's People

Contributors

victorgarciaesgi avatar victortotem avatar dependabot-preview[bot] avatar thunfisch987 avatar danielroe avatar mahdiboomeri avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.