Vue components based on @govflanders Webuniversum components with our own branding applied.
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar) + Vue VSCode Snippets
TypeScript 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:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensions
from VSCode's command palette - Find
TypeScript and JavaScript Language Features
, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
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 - for sharing locally developed packages across your local environment. - https://github.com/wclr/yalc
Yalc publish
Afterwards link the package in the desired implementing application.
yalc add @OnroerendErfgoed/[email protected]
yalc update
yarn
yarn build
Run Headed Component Tests with Cypress Component Testing
yarn test:unit:dev # or `yarn test:unit` for headless testing
Run End-to-End Tests with Cypress
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
Lint with ESLint
yarn lint
Format with Prettier
yarn format