npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tenrok/vue-intellisense

v1.0.3

Published

A CLI tool to help enabling IntelliSense on your Vue components

Downloads

8

Readme

Vue IntelliSense

A CLI tool to help enabling IntelliSense on your Vue components

npm i -D @tenrok/vue-intellisense

# or globally
npm i -g @tenrok/vue-intellisense

Usage

You'll need VSCode and Vetur installed.

Vetur has a feature to get IntelliSense for your Vue components, however, you need to provide a bunch of config files for this.

The Vue IntelliSense CLI generates the required files with zero-config required!

TLDR;

Generate the required Vetur files for all your Vue components:

vue-int --input /src/components --output vetur --recursive

Then add this to your package.json:

{
  "vetur": {
    "tags": "vetur/tags.json",
    "attributes": "vetur/attributes.json"
  }
}

That's it! 🎉

Motivation

Check out the blog post!

CLI Manual

Usage
  $ vue-int --input <path> --output <path>

Options
  --output, -o  A folder to save the generated files.
  --input, -i  Either a Vue file, or a folder with vue components. In case it's a folder, it will not care about nested folders.
  --recursive, -r  consider all vue files in all nested folders as well.
  --alias, -a  List files contain aliases config.

Examples
  # target a specific Vue file to generate IntelliSense for
  $ vue-int --output 'vetur' --input 'src/components/MyButton.vue'

  # target all files in a folder - without nested folders
  $ vue-int --output 'vetur' --input 'src/components'

  # target all files in a folder - with nested folders
  $ vue-int --output 'vetur' --input 'src/components' --recursive

  # target all files in a folder - with nested folders and and using alias for import
  $ vue-int --output 'vetur' --input 'src/components' --recursive --alias alias.config.js other-alias.config.js

  # support nested object inside config file like: { resolve: { alias: { "@components": "/src/components" } } }
  $ vue-int --output 'vetur' --input 'src/components' --recursive --alias webpack.config.js#resolve#alias other-alias.config.js

Exits with code 0 when done or with 1 when an error has occured.

Alias options

If in your component use alias import like below, you have to input alias config file(s).

import ComponentA from '@src/componentA.vue'
or
import scriptA from '@components/scriptA'

There are 3 ways to input alias config file(s). All support multiple files

1. Using tsconfig or jsconfig file

vue-int --output 'vetur' --input 'src/components' --alias tsconfig.json other.jsconfig.json
// @file /home/user/project-dir/tsconfig.json
{
  "compilerOptions": {
    "baseUrl": ".", // default = '.'
    "paths": {
      "@/*": ["./*"],
      "@": ["./index.ts", "./index.vue"],
      "@src/*": ["./src/*"],
      "@src": ["./src/index.ts", "./src/index.vue"],
      "@components/*": ["./src/components/*"],
      "@components": ["./src/components/index.ts", "./src/components/index.vue"]
    }
  }
}

2. Using nested alias file

vue-int --output 'vetur' --input 'src/components' --alias alias.config.js#resolve#alias other.alias.config.js#nested#alias
// @file /home/user/project-dir/alias.config.js
const path = require('path')

module.exports = {
  resolve: {
    alias: {
      // <= this is nested #resolve#alias
      '@': path.resolve(__dirname, '.'),
      '@src': path.resolve(__dirname, './src'),
      '@views': path.resolve(__dirname, './src/views'),
      '@components': path.resolve(__dirname, './src/components'),
    },
  },
}

3. Using non-nested alias file

vue-int --output 'vetur' --input 'src/components' --alias alias.config.js other.alias.config.js
// @file /home/user/project-dir/alias.config.js
const path = require('path')

module.exports = {
  // <= this is non-nested
  '@': path.resolve(__dirname, '.'),
  '@src': path.resolve(__dirname, './src'),
  '@views': path.resolve(__dirname, './src/views'),
  '@components': path.resolve(__dirname, './src/components'),
}

Contributing

Any contribution welcome! Would love for this to work with other code editors as well!