Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ pnpm build:mcp # nuxt build mcp → mcp/.output, the MCP server's Worker
pnpm preview # serve the generated site
pnpm check-types # type-check the .ts and .vue sources, the MCP server's included (see "The docs" for what it skips)
pnpm check-reference # check the component pages show app/reference/ as it is
pnpm lint # lint with oxlint and the shared @uxfront config (oxlint.config.ts), as CI does
pnpm format # format with oxfmt and the shared @uxfront config (oxfmt.config.ts)
pnpm check-mcp # after both builds: serve the MCP server with wrangler dev, and check every tool, resource and prompt against the built site
pnpm check-seo # after pnpm build: check what search engines and AI crawlers get (see "Keeping 100s")
pnpm test # run the reference implementations' tests (app/reference/<component>/*.test.ts), validate the contracts and test the MCP server and the agent plugin
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ jobs:
# and the contracts, validated against public/schemas/contract.json.
- run: pnpm test

lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
cache: pnpm
- run: pnpm install --frozen-lockfile
# oxlint with the shared @uxfront config (oxlint.config.ts). Errors fail the job, and
# warnings only annotate the PR.
- run: pnpm lint --format=github

build:
name: Build
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pnpm dev # the site, on http://localhost:3000
pnpm dev:mcp # the MCP server (mcp/port.mjs picks its port)
pnpm check-types # vue-tsc on the site, the MCP server and the plugin
pnpm check-reference # the component pages show app/reference/ as it is
pnpm lint # oxlint with the shared @uxfront config (oxlint.config.ts)
pnpm format # oxfmt with the shared @uxfront config (oxfmt.config.ts)
pnpm test # Vitest: reference tests, contracts, MCP server, agent plugin
pnpm build # nuxt generate → dist
pnpm build:mcp # nuxt build mcp → mcp/.output
Expand All @@ -23,7 +25,7 @@ Building needs Node 22.13 or later. Which checks to run depends on what you chan

| You changed | Run |
| ------------------------------------------------ | ---------------------------------------------------------- |
| Anything | `pnpm check-types` and `pnpm test` |
| Anything | `pnpm check-types`, `pnpm lint` and `pnpm test` |
| A docs page or `app/reference/` | `pnpm check-reference` too |
| `mcp/`, or the headings and contracts it reads | `pnpm build`, `pnpm build:mcp`, then `pnpm check-mcp` |
| The homepage | `pnpm build`, then `pnpm lighthouse` |
Expand Down
2 changes: 1 addition & 1 deletion app/reference/select/Select.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ beforeAll(() => {
document.addEventListener(
"pointerup",
(event) => {
for (const el of [...shown]) if (!el.contains(event.target as Node)) el.hidePopover();
for (const el of shown) if (!el.contains(event.target as Node)) el.hidePopover();
},
true,
);
Expand Down
2 changes: 1 addition & 1 deletion content/docs/3.components/select/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ beforeAll(() => {
document.addEventListener(
"pointerup",
(event) => {
for (const el of [...shown]) if (!el.contains(event.target as Node)) el.hidePopover();
for (const el of shown) if (!el.contains(event.target as Node)) el.hidePopover();
},
true,
);
Expand Down
17 changes: 17 additions & 0 deletions oxfmt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import base from "@uxfront/oxfmt-config";
import { defineConfig } from "oxfmt";

export default defineConfig({
...base,
ignorePatterns: [
...(base.ignorePatterns ?? []),
// The docs are MDC, where formatting moves the content of nested blocks and rewrites
// the example code on the pages, and the plugin's skills ship live from `main`.
"**/*.md",
// The component pages show these files byte for byte: `pnpm check-reference` fails
// when a page and its file differ.
"app/reference/**",
// Vendored schemas, never edited by hand.
"plugins/schemas/**",
],
});
39 changes: 39 additions & 0 deletions oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import vue from "@uxfront/oxlint-config/vue";
import { defineConfig } from "oxlint";

export default defineConfig({
extends: [vue],
rules: {
// Destructuring a key beside a rest element is how the code copies an object without
// that key, like `({ component, ...contract }) => contract`, so the key is unused on
// purpose. Setting an option drops oxlint's defaults, so the `^_` patterns restate them.
"no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
overrides: [
{
// It renders the sidebar in place of Nuxt UI's UContentNavigation and keeps its code
// in step with the original (AGENTS.md, "Things that change together"), whose theme
// line spreads `appConfig.ui?.contentNavigation || {}`.
files: ["app/components/docs/DocsNavigation.vue"],
rules: {
"unicorn/no-useless-fallback-in-spread": "off",
},
},
{
// ACCENTS matches combining marks on their own, after NFD has split them off their
// letters, so the class holds combining marks on purpose, written as escapes.
files: ["app/reference/combobox/Combobox.vue"],
rules: {
"no-misleading-character-class": "off",
},
},
],
});
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"check-reference": "node scripts/check-reference.mjs",
"check-mcp": "node scripts/check-mcp.mjs",
"check-seo": "node scripts/check-seo.mjs",
"lint": "oxlint",
"lint:fix": "oxlint --fix",
"format": "oxfmt",
"format:check": "oxfmt --check",
"test": "vitest run",
"lighthouse": "pnpm dlx @lhci/cli@0.15.1 autorun"
},
Expand All @@ -40,12 +44,16 @@
"@testing-library/user-event": "^14.6.7",
"@testing-library/vue": "^8.1.0",
"@types/node": "^24.13.6",
"@uxfront/oxfmt-config": "^0.1.1",
"@uxfront/oxlint-config": "^0.1.1",
"@vitejs/plugin-vue": "^6.0.9",
"ajv": "^8.20.0",
"ajv-formats": "^3.0.1",
"github-slugger": "^2.0.0",
"jsdom": "^31.0.1",
"lightningcss": "^1.33.0",
"oxfmt": "^0.79.0",
"oxlint": "^1.94.0",
"typescript": "^6.0.3",
"vitest": "^5.0.3",
"vue-tsc": "^3.3.11",
Expand Down
Loading
Loading