@frigear-nu/base
@frigear-nu/base
Shared Nuxt layer for the frigear.nu websites.
This package is the common foundation used by the Nuxt apps in this monorepo. It centralizes shared configuration, Nuxt modules, app defaults, and styling primitives so the websites stay consistent without duplicating setup in each app.
What it provides
- Shared Nuxt config and module wiring
- Tailwind and UI defaults
- Common app-level conventions and aliases
- Reusable runtime setup for Frigear.nu sites
Consumers
Usage
pnpm add @frigear-nu/base nuxt
// nuxt.config.ts
export default defineNuxtConfig({
extends: ['@frigear-nu/base'],
})
nuxt is a peer dependency. The layer ships as source (app, modules, shared, utils, content.config.ts,
nuxt.config.ts) with no build step. Its @frigear-nu/menu dependency is installed with it.
Setup
From the repository root:
corepack enable
pnpm install
Local development
This package is usually consumed through the app workspaces rather than run directly. If you need to validate the layer in isolation:
pnpm --filter '@frigear-nu/base' typecheck
pnpm --filter '@frigear-nu/base' lint
Common workspace commands
# Validate the shared layer
pnpm --filter '@frigear-nu/base' typecheck
pnpm --filter '@frigear-nu/base' lint
# Run an app that consumes the layer
pnpm --filter '@frigear-nu/website' dev
Optional i18n for content
Content collections (config, pages) support opt-in localization, fully driven by the consuming app:
- By default (no i18n configured), content stays flat:
content/config.yaml,content/pages/**. - To localize, register
@nuxtjs/i18nin the consuming app and configure itslocales(e.g.['en', 'no']), then nest content under a locale folder:content/en/config.yaml,content/en/pages/**,content/no/config.yaml,content/no/pages/**. - When locales are configured,
content.config.tsdefines locale-suffixed collections (config_en,pages_en, ...) instead of the flat ones.useConfig/useCurrentPagepick the right collection automatically based on the current$i18nlocale. - No locale folder/config means no behavior change — this feature is entirely opt-in.
The config and pages collections are validated against WebsiteConfigSchema and WebsitePageSchema (see
shared/schema/config.ts and shared/schema/page.ts). For the full schema reference and more detail on the
localized/non-localized setup, see the Base Layer docs.
Page front matter also accepts container: true, which wraps the rendered body in a UContainer (use it for plain prose pages such as legal; pages built from u-page-* sections manage their own containers). It also accepts seo: { title, description, image, noindex }, and config.yaml accepts seo: { titleTemplate, description, image }; the layer ships no SEO defaults, see the docs.
Notes
- This package is a shared workspace dependency and is linked via
workspace:*from apps. - Keep changes here compatible with both consuming apps.
- If you change module config or public runtime behavior, validate both app consumers in the same change.
Publishing
Released like the other packages (see the publishing guide):
the Release workflow with base-layer, or pnpm exec release-it from this folder. Check what ships with
pnpm pack --dry-run. Only the paths in files are published; add new top-level folders there. Dependencies the layer
needs at runtime belong in dependencies, not devDependencies. There is deliberately no postinstall script: it would
run in every consumer's install.
Related Packages
Shared UI components and composables for Frigear Nuxt applications, built on Nux...
Email, SMS and generic notification dispatch (pluggable drivers) Nuxt module, sh...
Named, shareable navigation menus - modules contribute items (extendMenu / a run...
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.1.0 | ^3.0 | MIT | |
| 0.0.6 | ^3.0 | MIT | |
| 0.0.5 | ^3.0 | MIT | |
| 0.0.4 | ^3.0 | MIT | |
| 0.0.3 | ^3.0 | MIT | |
| 0.0.2 | ^3.0 | MIT |
Pre-releases (1)
| Version | Released | License |
|---|---|---|
| 0.0.0-stage |