@cycjimmy/hello-vue-lib
v2.0.0
Published
hello vue lib
Readme
hello-vue-lib
An ESM-only Vue 3 component library template with automatic test, release and maintenance workflows. Demo
Requirements
- Node.js
^22.22.2 || ^24.15.0 || >=26.0.0for development (the build scripts run through Node's native TypeScript stripping, and the lint/test toolchain needs the same range). - An ESM environment. The package ships a single
importentry: there is no CommonJS and no UMD bundle. - Vue
^3.5.0as a peer dependency. The generated declarations rely on theDefineComponenttype shape introduced in Vue 3.5.
Install
npm install @cycjimmy/hello-vue-libUsage
The style sheet is a separate file, so it has to be imported explicitly:
import HelloWorld from '@cycjimmy/hello-vue-lib'
import '@cycjimmy/hello-vue-lib/style.css'A named export is available as well:
import { HelloWorld } from '@cycjimmy/hello-vue-lib'The component accepts one required prop, msg: string.
Breaking changes in v2
- CommonJS and UMD bundles were removed.
exportsonly exposes animportentry, andmain/modulepoint at the same ESM file. - Styles are emitted to
dist/index.cssand must be imported through@cycjimmy/hello-vue-lib/style.css. - Type declarations are generated into
dist/; the hand-writtentypes/index.d.tsplaceholder was removed. vueis a peer dependency (^3.5.0) instead of a regular dependency, so the published manifest constrains the Vue version the declarations target.- Node.js
^22.22.2 || ^24.15.0 || >=26.0.0is required to build, test and lint. - The toolchain moved to Vite 8, Vitest 5, TypeScript 6, ESLint 10 with
@antfu/eslint-config(Prettier was removed) and stylelint for SCSS.
Packages
dist/index.js: ESM entry (vuestays external).dist/index.css: the component styles.dist/index.d.ts: the generated declarations.
Development
npm install
npm run dev| Script | Description |
| --- | --- |
| npm run dev | Start the Vite dev server for the demo. |
| npm run build | Build the ESM entry, the style sheet and the declarations. |
| npm run build:deployment | Build the demo into .publish/ for GitHub Pages. |
| npm test | Run the unit tests once. |
| npm run test:watch | Run the unit tests in watch mode. |
| npm run test:coverage | Run the unit tests with coverage (lcov for Coveralls). |
| npm run test:types | Check that the packaged declarations resolve for a NodeNext ESM consumer (run it after npm run package). |
| npm run type-check | Type check the library, the demo and the build configs. |
| npm run lint | Lint JavaScript/TypeScript/Vue with ESLint. |
| npm run lint:fix | Lint and auto-fix with ESLint. |
| npm run lint:style | Lint the SCSS in src/ with stylelint. |
| npm run lint:style:fix | Lint and auto-fix the SCSS with stylelint. |
| npm run package | Build and prepare the publishable .release/ directory. |
Release
Commits follow the Conventional Commits
specification. Pushing to main makes semantic-release bump the version, update
docs/CHANGELOG.md, publish to npm through trusted publishing
(OIDC) and to the GitHub Package Registry, and push the vN branch.
Issues are triaged automatically: a report without enough information is
labelled needs-info and closed after 7 days without a reply, and issues without
activity are marked stale after half a year and closed two weeks later.
