The @obewds/vite-vue-ts-compo-pkg-starter modular design system component for Vue.js
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup>
SFCs, check out the script setup docs to learn more.
Since TypeScript cannot handle type information for .vue
imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in .vue
imports (for example to get props validation when using manual h(...)
calls), you can enable Volar's Take Over mode by following these steps:
- Run
Extensions: Show Built-in Extensions
from VS Code's command palette, look forTypeScript and JavaScript Language Features
, then right click and selectDisable (Workspace)
. By default, Take Over mode will enable itself if the default TypeScript extension is disabled. - Reload the VS Code window by running
Developer: Reload Window
from the command palette.
You can learn more about Take Over mode here.
Once the repo is local, you can install dependencies with:
npm install
To initialize your repository's files specific to your new repo/component name (under the @obewds
namespace), run:
npm run init:as -- your-repo-name
And to generate all of the files after changing the names to your repo/component name, use:
npm run publish:prep
Then you can launch Vite and the Workspace app and a separate local vite server for your docs with:
npm run dev
npm run docs:dev
And of course you can run tests with:
npm run test
npm run coverage
And last but not least, you can remove the init:as
script used to init the template files for your @obewds
namespaced repository name, using:
npm run delete:init:as
Don't forget to remove the npm scripts "init:as"
and "delete:init:as"
from your package.json
file after running the delete:init:as
command!
And after you've removed the npm scripts, it's safe to do a quick search of the repo files for the string
InitContent
and delete the file, and component import, and the component instance. And that will finish up clearing out all of the no longer needed content and files following theinit:as
process!
Lastly, delete this section and the Vite/Vue section above to prep this file for publishing to npm!
Check out the official docs for this component for more details!
Or check out the CHANGELOG for the code base!
npm install @obewds/vite-vue-ts-compo-pkg-starter --save-dev
npm uninstall @obewds/vite-vue-ts-compo-pkg-starter