Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This document provides guidelines for AI agents working on the qrcode.vue repository.
Sign in to like and favorite skills
This document provides guidelines for AI agents working on the qrcode.vue repository. It includes build/test commands, code style conventions, and project-specific patterns.
The project uses npm scripts defined in
package.json:
| Command | Purpose |
|---|---|
| Start development server with hot reload (rsbuild) |
| Build production bundles using Rollup (CommonJS, ES module, UMD) |
| Run all tests using rstest |
Use the rstest CLI directly:
# Run a specific test file npx rstest test/index.test.ts # Run tests matching a pattern npx rstest --testNamePattern="renders SVG"
TypeScript with strict mode enabled. Type checking runs during Rollup build (ES modules only). Manual check:
npx tsc --noEmit
.editorconfigstrict: true)type for simple aliases, interface for extensible object shapesExample:
import { defineComponent, Fragment, h, PropType, ref } from 'vue' import QR from './qrcodegen'
QrcodeVue, QrcodeSvg, QrcodeCanvas)private modifierdefineComponentPropType annotationsref and computedonMounted, onUpdated, etc.h() (hyperscript) – no template DSLname property set to PascalCase stringExample prop definition:
const QRCodeProps = { value: { type: String, required: true, default: '', }, size: { type: Number, default: 100, }, // ... }
throw new RangeError for invalid arguments (see qrcodegen.ts)Path2D detection)Follow existing file's style:
qrcodegen.ts uses semicolons consistently (legacy TypeScript/JavaScript)index.ts uses semicolons mostly for statements but not after function declarations@rstest/core and @vue/test-utilstest/ directory with .test.ts extensiondescribe/it patternmount() from @vue/test-utilsexpect() from @rstest/coreExample:
import { describe, expect, it } from '@rstest/core' import { mount } from '@vue/test-utils' import QrcodeVue from '../src' describe('QrcodeVue', () => { it('renders correctly with default props', () => { const wrapper = mount(QrcodeVue, { props: { value: 'test' }, }) expect(wrapper.html()).toContain('<canvas') }) })
rollup.config.js)rsbuild.config.js)tsconfig.json)src/ index.ts # Main Vue component (exports QrcodeVue, QrcodeSvg, QrcodeCanvas) qrcodegen.ts # QR code generator library (external, Project Nayuki) test/ index.test.ts # Component tests example/ # Demo application webpack-entry.ts # Entry point for dev server webpack.html # HTML template styles.scss # Demo styles typings/ # TypeScript declarations dist/ # Built artifacts (ignored in git)
vue: ^3.0.0qrcodegen.ts) is a third‑party library – avoid modifications unless absolutely necessaryThis file was generated for agentic coding assistants. Update it as the project evolves.