@ohto/bones
v0.0.29
Published
This template should help get you started developing with Vue 3 in Vite.
Readme
components
This template should help get you started developing with Vue 3 in Vite.
Recommended IDE Setup
VSCode + Volar (and disable Vetur).
Type Support for .vue Imports in TS
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 Volar to make the TypeScript language service aware of .vue types.
Customize configuration
See Vite Configuration Reference.
Project Setup
pnpm installCompile and Hot-Reload for Development
pnpm devType-Check, Compile and Minify for Production
pnpm buildRun Unit Tests with Vitest
pnpm test:unitLint with ESLint
pnpm lintYou can generate new component scaffolding with the generator like so:
pnpm component:build forms LabelYou can tear it down like so:
pnpm component:destroy forms LabelBy default, your config files will just export the base config, however, you can customise it by overwriting the exports:
Default Grid config
export * from '@ohto/bones/components/layout/Grid/Grid.base.config.ts'Customised Grid config
import { EXPOSE as BaseExpose } from '@ohto/bones/components/layout/Grid/Grid.base.config.ts'
import type { TCustomGridProps } from '@ohto/bones/components/layout/Grid/Grid.base.config.ts'
export * from '@ohto/bones/components/layout/Grid/Grid.base.config.ts'
export const EXPOSE: (keyof TCustomGridProps)[] = [...BaseExpose]Breakpoint props can be used like so:
Input.map.ts
import type { TWithBreakpoints } from '@ohto/bones/types/breakpoints.types.ts'
export type TInputProps = HTMLInputElementProps & {
component?: string
variant?: 'small' | 'large' | TWithBreakpoints<'small' | 'large'>
}Input.base.config.ts
import type { TInputProps } from '@ohto/bones/components/forms/Input/Input.map.ts'
export type TCustomInputProps = TInputProps & {}
export const DEFAULTS = {} as const satisfies Partial<TCustomInputProps>
export const EXPOSE: (keyof TCustomInputProps)[] = ['variant']