@happydesigns/ui 0.20.0 → 0.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/app/components/MaintenancePage.vue +80 -0
- package/app/components/search/SiteSearch.client.vue +27 -0
- package/content/app/components/search/ContentSearch.client.vue +2 -12
- package/content/app/composables/useContentSearchData.ts +1 -0
- package/content/server/api/navigation.json.get.ts +1 -0
- package/content/server/api/search.json.get.ts +1 -0
- package/content/server/utils/contentSearch.ts +1 -0
- package/nuxt.config.ts +4 -0
- package/package.json +39 -35
package/README.md
CHANGED
|
@@ -39,6 +39,17 @@ Run Nuxt preparation after changing dependencies or layer configuration:
|
|
|
39
39
|
pnpm exec nuxt prepare
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
## Maintenance page
|
|
43
|
+
|
|
44
|
+
For a branded temporary notice, use `HMaintenancePage` with title, description, actions and optional logo/tools/footer slots. Activation, routing and HTTP status stay application-owned. See [Maintenance page](docs/content/6.configuration/9.maintenance.md).
|
|
45
|
+
|
|
46
|
+
## Site search
|
|
47
|
+
|
|
48
|
+
Render `<HSiteSearch />` once in the app shell and use `<UContentSearchButton />`
|
|
49
|
+
to open it. Configure navigation shortcuts with `app.search.links` and
|
|
50
|
+
`app.search.groups`. The base-layer search does not load content indexes or
|
|
51
|
+
activate Nuxt Content or Studio. See [Search](docs/content/6.configuration/8.content-search.md).
|
|
52
|
+
|
|
42
53
|
## Content collections
|
|
43
54
|
|
|
44
55
|
Applications using Nuxt Content extend `@happydesigns/ui/content` instead of
|
|
@@ -93,6 +104,22 @@ pnpm build
|
|
|
93
104
|
|
|
94
105
|
`pnpm dev` starts the playground app. `pnpm build` builds the playground.
|
|
95
106
|
|
|
107
|
+
`pnpm consumer:check` installs the packed package in a temporary workspace outside this repository, then typechecks and renders base and Content consumers. It needs registry access; the fixtures use their own dependencies and TypeScript configuration rather than the source checkout's installation.
|
|
108
|
+
|
|
109
|
+
Tests focus on public behavior: schema validation, routing, search loading and recovery, author resolution, and release safety. Build checks cover rendered content, unpublished search exclusions, and documentation endpoints. Avoid assertions on source-code spelling, internal component structure, or documentation copy; package integration is checked by the installed consumer rather than a separate file inventory.
|
|
110
|
+
|
|
111
|
+
Use a Node release supported by the pinned Nuxt development dependency. Development and CI use the Nuxt version declared in `package.json`; the packed-consumer check follows that same version. The published layer's `engines` describe consumer requirements, not every tool in this checkout.
|
|
112
|
+
|
|
113
|
+
## Releases
|
|
114
|
+
|
|
115
|
+
Use Conventional Commits and run `pnpm release:preview` to review the proposed version and changelog without changing files. From a clean worktree, `pnpm release` prepares the version, `CHANGELOG.md`, release commit and annotated tag locally. It does not push or publish to GitHub or npm. While on v0, compatible changes increment patch; breaking changes increment minor. Prerelease preparation uses `pnpm release:pre`, `pnpm release:alpha` or `pnpm release:beta`.
|
|
116
|
+
|
|
117
|
+
Review the generated release, then push the branch and tag with `git push --follow-tags` only when authorized. Tag CI checks version, release commit and changelog consistency and runs the existing validation pipeline before automatically publishing the GitHub release. Release notes come only from that version's `CHANGELOG.md` section, parsed by Changelogen. Prereleases are not marked Latest; stable versions use GitHub's version-based Latest selection. No additional package archive or checksum is uploaded.
|
|
118
|
+
|
|
119
|
+
npm publication remains a separate, authorized `pnpm publish` step; use `pnpm publish --tag next` for prereleases. GitHub CI uses its temporary repository token and requires no npm credentials. Neither the GitHub release nor npm publication deploys consumer applications.
|
|
120
|
+
|
|
121
|
+
If tag CI fails, fix the cause and rerun it where possible. Never move a published tag or rerun version preparation to retry delivery. Already published GitHub releases are left unchanged; an existing draft for the same tag is published with the verified changelog. If a release's source needs correction, prepare a new version.
|
|
122
|
+
|
|
96
123
|
## Product Docs
|
|
97
124
|
|
|
98
125
|
The product docs live in `docs/` and are built with Docus.
|
|
@@ -104,6 +131,8 @@ pnpm docs:build
|
|
|
104
131
|
|
|
105
132
|
`pnpm docs:build` generates a static Docus build in `docs/.output/public`. Use `pnpm docs:build:server` only when the deployment target needs a server-capable Docus build for live MCP support.
|
|
106
133
|
|
|
134
|
+
`pnpm docs:typecheck:server` checks the documentation application's own server sources using Nuxt's generated server configuration. `pnpm docs:build` also validates the generated reference API responses, including dynamic component and example routes.
|
|
135
|
+
|
|
107
136
|
The docs explain how to use the layer, content model, components, composables, variants, and configuration. Component props, slots, examples, variants, and collection tables are generated from the package source where possible.
|
|
108
137
|
|
|
109
138
|
## Package Scope
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ButtonProps } from '@nuxt/ui'
|
|
3
|
+
|
|
4
|
+
withDefaults(defineProps<{
|
|
5
|
+
title: string
|
|
6
|
+
description?: string
|
|
7
|
+
icon?: string
|
|
8
|
+
iconColor?: 'primary' | 'secondary'
|
|
9
|
+
mainId?: string
|
|
10
|
+
actions?: ButtonProps[]
|
|
11
|
+
}>(), { actions: () => [], mainId: 'main-content', iconColor: 'primary' })
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="flex min-h-dvh flex-col bg-default text-default">
|
|
16
|
+
<header v-if="$slots.logo || $slots.tools" class="border-b border-default">
|
|
17
|
+
<UContainer class="flex min-h-16 max-w-[88rem] items-center justify-between gap-6 py-3">
|
|
18
|
+
<slot name="logo" />
|
|
19
|
+
<slot name="tools" />
|
|
20
|
+
</UContainer>
|
|
21
|
+
</header>
|
|
22
|
+
<main :id="mainId" tabindex="-1" class="holding-surface relative isolate flex flex-1 items-center px-0 py-16 sm:py-20">
|
|
23
|
+
<UContainer class="relative w-full">
|
|
24
|
+
<div class="mx-auto max-w-3xl text-center">
|
|
25
|
+
<UIcon v-if="icon" :name="icon" class="mb-6 size-10 sm:size-12" :class="iconColor === 'secondary' ? 'text-secondary' : 'text-primary'" aria-hidden="true" />
|
|
26
|
+
<h1 class="text-4xl font-semibold tracking-tight text-balance text-highlighted sm:text-5xl">
|
|
27
|
+
{{ title }}
|
|
28
|
+
</h1>
|
|
29
|
+
<p v-if="description" class="mx-auto mt-6 max-w-xl text-lg leading-relaxed text-muted sm:text-xl">
|
|
30
|
+
{{ description }}
|
|
31
|
+
</p>
|
|
32
|
+
<slot />
|
|
33
|
+
<div v-if="actions.length || $slots.actions" class="mt-8 flex flex-wrap justify-center gap-3 sm:mt-10">
|
|
34
|
+
<slot name="actions">
|
|
35
|
+
<UButton v-for="(action, index) in actions" :key="index" v-bind="action" />
|
|
36
|
+
</slot>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</UContainer>
|
|
40
|
+
</main>
|
|
41
|
+
<footer v-if="$slots.footer" class="border-t border-default py-6 text-sm text-muted">
|
|
42
|
+
<UContainer><slot name="footer" /></UContainer>
|
|
43
|
+
</footer>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<style scoped>
|
|
48
|
+
.holding-surface {
|
|
49
|
+
background: var(--ui-bg);
|
|
50
|
+
background-image: radial-gradient(ellipse at center, transparent 15%, color-mix(in srgb, var(--ui-bg-muted) 20%, var(--ui-bg)) 100%);
|
|
51
|
+
}
|
|
52
|
+
.holding-surface::before {
|
|
53
|
+
content: '';
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
z-index: -1;
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
opacity: .13;
|
|
59
|
+
background-image: radial-gradient(ellipse 3px 1px, var(--ui-primary) 95%, transparent), radial-gradient(ellipse 1px 3px, var(--ui-primary) 95%, transparent);
|
|
60
|
+
background-size: 44px 44px;
|
|
61
|
+
mask-image: radial-gradient(ellipse at center, transparent 25%, black 100%);
|
|
62
|
+
}
|
|
63
|
+
/* Static monochrome grain dithers the gradient without filtering the content. */
|
|
64
|
+
.holding-surface::after {
|
|
65
|
+
content: '';
|
|
66
|
+
position: absolute;
|
|
67
|
+
inset: 0;
|
|
68
|
+
z-index: -1;
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
opacity: .045;
|
|
71
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='grain' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Cpath fill='%23808080' filter='url(%23grain)' d='M0 0h160v160H0z'/%3E%3C/svg%3E");
|
|
72
|
+
background-size: 160px 160px;
|
|
73
|
+
}
|
|
74
|
+
@media (forced-colors: active) {
|
|
75
|
+
.holding-surface::before,
|
|
76
|
+
.holding-surface::after {
|
|
77
|
+
display: none;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CommandPaletteGroup, ContentSearchProps } from '@nuxt/ui'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<Pick<ContentSearchProps, 'files' | 'navigation' | 'loading' | 'groups'>>()
|
|
5
|
+
const appConfig = useAppConfig()
|
|
6
|
+
const search = computed(() => appConfig.app.search)
|
|
7
|
+
const searchTerm = ref('')
|
|
8
|
+
const groups = computed<CommandPaletteGroup[]>(() => [
|
|
9
|
+
...props.groups ?? [],
|
|
10
|
+
...search.value.groups ?? [],
|
|
11
|
+
])
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<UContentSearch
|
|
16
|
+
v-model:search-term="searchTerm"
|
|
17
|
+
:title="search.title"
|
|
18
|
+
:description="search.description"
|
|
19
|
+
:placeholder="search.placeholder"
|
|
20
|
+
:links="search.links"
|
|
21
|
+
:groups="groups"
|
|
22
|
+
:files="props.files"
|
|
23
|
+
:navigation="props.navigation"
|
|
24
|
+
:loading="props.loading"
|
|
25
|
+
:fuse="{ resultLimit: search.resultLimit }"
|
|
26
|
+
/>
|
|
27
|
+
</template>
|
|
@@ -4,14 +4,11 @@ import type { CommandPaletteGroup } from '@nuxt/ui'
|
|
|
4
4
|
const appConfig = useAppConfig()
|
|
5
5
|
const { open } = useContentSearch()
|
|
6
6
|
const search = computed(() => appConfig.app.search)
|
|
7
|
-
const searchTerm = ref('')
|
|
8
7
|
const { navigation, files, status, error, load } = useContentSearchData()
|
|
9
8
|
|
|
10
9
|
const groups = computed<CommandPaletteGroup[]>(() => {
|
|
11
|
-
const configuredGroups = search.value.groups ?? []
|
|
12
|
-
|
|
13
10
|
if (!error.value) {
|
|
14
|
-
return
|
|
11
|
+
return []
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
return [
|
|
@@ -28,7 +25,6 @@ const groups = computed<CommandPaletteGroup[]>(() => {
|
|
|
28
25
|
},
|
|
29
26
|
],
|
|
30
27
|
},
|
|
31
|
-
...configuredGroups,
|
|
32
28
|
]
|
|
33
29
|
})
|
|
34
30
|
|
|
@@ -44,16 +40,10 @@ watch(open, (isOpen) => {
|
|
|
44
40
|
</script>
|
|
45
41
|
|
|
46
42
|
<template>
|
|
47
|
-
<
|
|
48
|
-
v-model:search-term="searchTerm"
|
|
49
|
-
:title="search.title"
|
|
50
|
-
:description="search.description"
|
|
51
|
-
:placeholder="search.placeholder"
|
|
52
|
-
:links="search.links"
|
|
43
|
+
<HSiteSearch
|
|
53
44
|
:groups="groups"
|
|
54
45
|
:files="files"
|
|
55
46
|
:navigation="navigation"
|
|
56
47
|
:loading="status === 'pending'"
|
|
57
|
-
:fuse="{ resultLimit: search.resultLimit }"
|
|
58
48
|
/>
|
|
59
49
|
</template>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ContentNavigationItem } from '@nuxt/content'
|
|
2
2
|
import type { ContentSearchFile } from '@nuxt/ui'
|
|
3
|
+
import { $fetch } from '#imports'
|
|
3
4
|
import { createContentSearchLoader } from '../../../app/utils/createContentSearchLoader'
|
|
4
5
|
|
|
5
6
|
export interface ContentSearchDataLoaders {
|
|
@@ -2,6 +2,7 @@ import type { PageCollections, SQLOperator } from '@nuxt/content'
|
|
|
2
2
|
import type { H3Event } from 'h3'
|
|
3
3
|
import type { SearchCollectionConfig, SearchConfig } from '../../../app/types/config'
|
|
4
4
|
import type { PageCollectionName } from '../../../app/types/content'
|
|
5
|
+
import { setResponseHeader } from 'h3'
|
|
5
6
|
|
|
6
7
|
interface ConfigurableSearchQuery {
|
|
7
8
|
where: (field: string, operator: SQLOperator, value?: unknown) => unknown
|
package/nuxt.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happydesigns/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.20.
|
|
4
|
+
"version": "0.20.2",
|
|
5
5
|
"private": false,
|
|
6
|
-
"packageManager": "pnpm@11.11.0",
|
|
7
6
|
"description": "A reusable Nuxt foundation for content-driven happydesigns websites and applications.",
|
|
8
7
|
"author": "happydesigns",
|
|
9
8
|
"homepage": "https://github.com/happydesigns/ui#readme",
|
|
@@ -45,57 +44,62 @@
|
|
|
45
44
|
"publishConfig": {
|
|
46
45
|
"access": "public"
|
|
47
46
|
},
|
|
48
|
-
"scripts": {
|
|
49
|
-
"dev": "nuxt dev playground",
|
|
50
|
-
"docs": "nuxt dev docs",
|
|
51
|
-
"docs:build": "nuxt generate docs && node scripts/validate-docs-output.mjs",
|
|
52
|
-
"docs:build:server": "nuxt build docs",
|
|
53
|
-
"prepare": "nuxt prepare && nuxt prepare playground",
|
|
54
|
-
"build": "nuxt build playground",
|
|
55
|
-
"generate": "nuxt generate playground && node scripts/validate-playground-output.mjs",
|
|
56
|
-
"package:check": "node scripts/validate-package.mjs",
|
|
57
|
-
"consumer:check": "node scripts/validate-consumer.mjs",
|
|
58
|
-
"preview": "nuxt preview playground",
|
|
59
|
-
"lint": "eslint .",
|
|
60
|
-
"lint:fix": "eslint . --fix",
|
|
61
|
-
"typecheck": "nuxt typecheck && nuxt typecheck playground",
|
|
62
|
-
"test": "vitest run",
|
|
63
|
-
"test:watch": "vitest",
|
|
64
|
-
"release": "changelogen --release",
|
|
65
|
-
"release:pre": "changelogen --release --prerelease",
|
|
66
|
-
"release:alpha": "changelogen --release --versionSuffix alpha.0",
|
|
67
|
-
"release:beta": "changelogen --release --versionSuffix beta.0"
|
|
68
|
-
},
|
|
69
47
|
"peerDependencies": {
|
|
70
48
|
"tailwindcss": "^4.3.2",
|
|
71
|
-
"vue": "^3.5.41"
|
|
49
|
+
"vue": "^3.5.41",
|
|
50
|
+
"vue-router": "^4.6.0 || ^5.0.0"
|
|
72
51
|
},
|
|
73
52
|
"dependencies": {
|
|
74
53
|
"@happydesigns/nuxt-variants": "^0.2.0",
|
|
75
54
|
"@iconify-json/heroicons": "^1.2.3",
|
|
76
|
-
"@iconify-json/lucide": "^1.2.
|
|
77
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
78
|
-
"@nuxt/content": "^3.
|
|
79
|
-
"@nuxt/ui": "^4.
|
|
55
|
+
"@iconify-json/lucide": "^1.2.152",
|
|
56
|
+
"@iconify-json/simple-icons": "^1.2.101",
|
|
57
|
+
"@nuxt/content": "^3.17.0",
|
|
58
|
+
"@nuxt/ui": "^4.12.2",
|
|
80
59
|
"@vueuse/core": "^14.3.0",
|
|
81
60
|
"better-sqlite3": "^12.11.1",
|
|
82
|
-
"
|
|
83
|
-
"
|
|
61
|
+
"h3": "^1.15.11",
|
|
62
|
+
"nuxt-studio": "^1.8.2",
|
|
63
|
+
"zod": "^4.6.7"
|
|
84
64
|
},
|
|
85
65
|
"devDependencies": {
|
|
86
66
|
"@antfu/eslint-config": "^9.1.0",
|
|
87
|
-
"@antfu/ni": "^30.
|
|
88
|
-
"@nuxt/eslint-config": "^1.
|
|
67
|
+
"@antfu/ni": "^30.6.0",
|
|
68
|
+
"@nuxt/eslint-config": "^1.17.0",
|
|
69
|
+
"@takumi-rs/core": "1.8.7",
|
|
89
70
|
"changelogen": "^0.6.2",
|
|
90
71
|
"cross-env": "^10.1.0",
|
|
91
72
|
"docus": "5.12.3",
|
|
92
|
-
"eslint": "^10.
|
|
93
|
-
"nuxt": "4.
|
|
73
|
+
"eslint": "^10.14.0",
|
|
74
|
+
"nuxt": "4.6.4",
|
|
94
75
|
"typescript": "^6.0.3",
|
|
95
76
|
"vitest": "^4.1.10",
|
|
77
|
+
"vue-router": "5.4.0",
|
|
96
78
|
"vue-tsc": "^3.3.7"
|
|
97
79
|
},
|
|
98
80
|
"resolutions": {
|
|
99
81
|
"@happydesigns/ui": "workspace:*"
|
|
82
|
+
},
|
|
83
|
+
"scripts": {
|
|
84
|
+
"dev": "nuxt dev playground",
|
|
85
|
+
"docs": "nuxt dev docs",
|
|
86
|
+
"docs:build": "nuxt generate docs && node scripts/validate-docs-output.mjs",
|
|
87
|
+
"docs:build:server": "nuxt build docs",
|
|
88
|
+
"docs:typecheck:server": "nuxt prepare docs && tsc --noEmit --project docs/tsconfig.server.json",
|
|
89
|
+
"build": "nuxt build playground && node scripts/validate-playground-output.mjs",
|
|
90
|
+
"generate": "nuxt generate playground && node scripts/validate-playground-output.mjs",
|
|
91
|
+
"consumer:check": "node scripts/validate-consumer.mjs",
|
|
92
|
+
"preview": "nuxt preview playground",
|
|
93
|
+
"lint": "eslint .",
|
|
94
|
+
"lint:fix": "eslint . --fix",
|
|
95
|
+
"typecheck": "nuxt typecheck && nuxt typecheck playground",
|
|
96
|
+
"test": "vitest run",
|
|
97
|
+
"test:watch": "vitest",
|
|
98
|
+
"release:preview": "changelogen --no-output",
|
|
99
|
+
"release:check": "node scripts/github-release.mjs --check",
|
|
100
|
+
"release": "changelogen --release --no-github --clean",
|
|
101
|
+
"release:pre": "changelogen --release --prerelease --no-github --clean",
|
|
102
|
+
"release:alpha": "changelogen --release --versionSuffix alpha.0 --no-github --clean",
|
|
103
|
+
"release:beta": "changelogen --release --versionSuffix beta.0 --no-github --clean"
|
|
100
104
|
}
|
|
101
|
-
}
|
|
105
|
+
}
|