@verdnatura/vn-front-lib
v0.0.8
Published
Vue 3 component and composable library
Downloads
890
Keywords
Readme
vn-front-lib
A shared library of Vue 3 components and composables used across the
salix-front and hedera-web projects. It is not a standalone app —
it's built in library mode (Vite build.lib) and consumed as a dependency.
What's inside
lib/components/— Vue components (prefixed withVn, e.g.VnInput).lib/composables/— reusable composables (e.g.useRequired,useValidator).lib/stores/— Pinia stores (e.g.useValidationsStore).lib/i18n/locale/— translation files (en.yml,es.yml).
pinia, vue-i18n, axios, validator and quasar are expected to be
provided by the consuming project (declared as peerDependencies).
Recommended VS Code extension
This project uses oxlint and
oxfmt for linting and
formatting. It's advisable to install the
Oxc VS Code extension,
which powers format-on-save and inline lint diagnostics based on the
.oxlintrc.json and .oxfmtrc.json config files in this repo.
Scripts
pnpm install
pnpm run dev # Vite dev server
pnpm run build # build the library (output to dist/)
pnpm run lint # oxlint
pnpm run lint:fix # oxlint --fix
pnpm run fmt # oxfmt
pnpm run fmt:check # oxfmt --checkDeveloping locally against another project
To test changes locally in another project (e.g. salix-front or
hedera-web) without publishing, add this repo as a real pnpm workspace
member rather than using a plain link: dependency, so vue/pinia get
deduped into a single instance across both projects:
In the consuming project's
pnpm-workspace.yaml, add this repo as a package:packages: - . - ../vn-front-libIn the consuming project's
package.json, depend on it via the workspace protocol, using the real package name:"vn-front-lib": "workspace:@verdnatura/vn-front-lib@*",Enable the
vnSourceresolution condition in the consumer's Vite/Vitest config so imports resolve to this repo'slib/source instead of thedist/build:resolve: { conditions: ['vnSource'], },Reinstall dependencies in the consuming project (
pnpm install), then runpnpm why vue -r/pnpm why pinia -rto confirm only one version of each resolves across the workspace.
