Vue components based on @govflanders Webuniversum components with our own branding applied.
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar) + Vue VSCode Snippets
.vue
Imports in TSTypeScript cannot handle type information for .vue
imports by default, so we replace the tsc
CLI with vue-tsc
for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue
types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
Extensions: Show Built-in Extensions
from VSCode's command palette
2) Find TypeScript and JavaScript Language Features
, right click and select Disable (Workspace)
Developer: Reload Window
from the command palette.See Vite Configuration Reference.
See Pre-commit for installation.
After installing this on your local machine, the config in .pre-commit-config.yaml
will be picked up and makes sure lint
and format
are run before commit to guarantee the code style.
Add following config to your settings.json
to enable lint and format on save.
{
...,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
yarn
yarn storybook
yarn build:watch
Yalc publish
Afterwards link the package in the desired implementing application.
yalc add @OnroerendErfgoed/vue_component_library@0.16.0
yalc update
yarn
yarn build
yarn test:unit:dev # or `yarn test:unit` for headless testing
yarn test:e2e:dev
This runs the end-to-end tests against the Vite development server. It is much faster than the production build.
But it's still recommended to test the production build with test:e2e
before deploying (e.g. in CI environments):
yarn build
yarn test:e2e
yarn lint
yarn format