WebComponent(spec) builds a custom-element base class from a spec: shadow root or declarative shadow DOM, template, shared stylesheet (adopted, or a <style> once per root for light DOM), reflected props with two-way attribute sync, a per-connection AbortSignal, host event wiring, and typed element refs. Types derive exact observedAttributes, prop value types, ref element types from selectors, and reject prop names that collide with the base class or mixin members. Tooling: strict tsconfig, type-aware oxlint, oxfmt, and Vitest browser mode (Chromium) with type tests.
44 lines
1.1 KiB
JSON
44 lines
1.1 KiB
JSON
{
|
|
"name": "wc-mixin",
|
|
"version": "0.1.0",
|
|
"description": "Web Component Mixin",
|
|
"license": "MIT",
|
|
"author": "Buddy Sandidge",
|
|
"type": "module",
|
|
"main": "dist/index.js",
|
|
"types": "dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"import": "./dist/index.js"
|
|
},
|
|
"./package.json": "./package.json"
|
|
},
|
|
"sideEffects": false,
|
|
"files": [
|
|
"dist",
|
|
"src",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"scripts": {
|
|
"build": "rm -rf dist && tsc",
|
|
"typecheck": "tsc --noEmit && tsc -p tsconfig.test.json",
|
|
"lint": "oxlint --type-aware src test",
|
|
"format": "oxfmt '*.md' '*.ts' 'src/**/*.ts' 'test/**/*.ts'",
|
|
"format:check": "oxfmt --check '*.md' '*.ts' 'src/**/*.ts' 'test/**/*.ts'",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"prepublishOnly": "npm run format:check && npm run lint && npm run typecheck && npm run test && npm run build"
|
|
},
|
|
"devDependencies": {
|
|
"@vitest/browser-playwright": "^5.1.0",
|
|
"oxfmt": "^0.76.0",
|
|
"oxlint": "^1.91.0",
|
|
"oxlint-tsgolint": "^7.0.2006",
|
|
"playwright": "^1.65.0",
|
|
"typescript": "^7.0.2",
|
|
"vitest": "^5.1.0"
|
|
}
|
|
}
|