Skip to the content.

Nuxt App Generator (@tgmc/likwidlibs:nuxt-app)

Nx workspace generator to scaffold enterprise-grade Nuxt 4 applications in the @tgmc monorepo.

Usage

npx nx g @tgmc/likwidlibs:nuxt-app <app-name> [options]

Or run interactively:

npx nx g @tgmc/likwidlibs:nuxt-app

Options

Option Type Default Description
name string (prompted) Name of the application (e.g., portal, docs, store).
directory string core Target directory relative to monorepo root.
deploymentTarget string aws-sam Target CD workflow: aws-sam, docker-node, or static-cloudflare.
ui boolean true (prompted) Extend @tgmc/nuxt-layer-ui (the Ui* kit) instead of @tgmc/nuxt-layer-base.
theme boolean true (prompted) Use the @tgmc/theme stylesheet and Sass; off uses the system-colour fallback.
icons boolean true (prompted) Install @nuxt/icon with Lucide.
primevue boolean see below PrimeVue behind the Ui* kit. ui and theme apps only; asked in an interactive nx g when omitted, else true.
media boolean see below Register the media components. ui apps only; asked in an interactive nx g when omitted, else true.
includeE2e boolean true Whether to scaffold a companion Cypress a11y E2E test project (core/<name>-e2e).

Nx prompts can’t depend on an earlier answer, and a schema default would hide whether the user passed a flag, so primevue and media have neither a prompt nor a default in the schema. The generator asks for them itself, only when they apply (a base-only app gets neither; a theme-off app gets no PrimeVue) and only in an interactive terminal (NX_INTERACTIVE=true and a TTY). Non-interactive runs (--no-interactive, CI) never prompt; pass --primevue / --media explicitly, or they default to on. --primevue or --media with --no-ui, and --primevue with --no-theme, fail with an error.

What Gets Scaffolded

  1. Nuxt 4 Application (core/<name>):
    • Extends @tgmc/nuxt-layer-ui (or @tgmc/nuxt-layer-base with --no-ui) and writes a tgmc: block with the chosen features (theme, icon, and for ui apps primevue and media; see nuxt-layers.md § 1a). The base layer adds nitro.externals.inline: ['nuxt'], which a Nuxt 4.6 app needs to render.
    • package.json lists only the chosen features’ packages, with the root’s ranges: @tgmc/theme; @nuxt/icon and @iconify-json/lucide; primevue and @primevue/nuxt-module; @tgmc/media-client and @tgmc/media-player.
    • Pug layout shell (app/app.vue): <UiSkipLink /> first, landmark regions, main#main-content with tabindex="-1", and <UiAnnouncer />, both from the base layer. ui apps also mount <UiToastHost /> (PrimeVue’s toast, or the native list without PrimeVue).
    • Example landing page (app/pages/index.vue, Pug) using the contrast roles (--theme-primary-fill-color and --theme-on-primary-color), --touch-target, the theme focus-ring mixin and useA11yAnnouncer().
    • With icons, nuxt.config.ts has an empty icon.clientBundle.icons for the app’s own Lucide names; the shared ones come from TGMC_BASE_ICONS. Without icons there is no icon block.
    • In-app axe-core accessibility test (tests/a11y.spec.ts, Vitest + jsdom, WCAG 2.0, 2.1 and 2.2 A/AA tags); the generator’s smoke spec runs it, ESLint and the E2E type-check on every generator test run.
    • ESM eslint.config.js on @nuxt/eslint-config/flat with eslint-plugin-vue-pug, and boundary rules guarding against @tgmc/utilities/browser imports in SSR code.
    • App .gitignore (.nuxt, .output, .data, dist, node_modules, coverage, logs, .env* except .env.example). @nuxt/eslint-config reads the nearest .gitignore, so the app’s own file keeps lint scoped to the app.
    • Nx targets are inferred from package.json scripts and the config files (nuxt.config.ts, vitest.config.ts, eslint.config.js) — no project.json, like every project in this repo. Tags live in package.json → nx.tags.
  2. Companion E2E Suite (core/<name>-e2e) (optional): an ESM package ("type": "module") whose package.json declares nx.implicitDependencies: ["@tgmc/<name>"] and the same e2e target as core/web-e2e.
    • Cypress 15 with axe-core injected by a cy.runAxe() command (src/support/e2e.ts) — no extra Cypress plugins.
    • Landing-page WCAG 2.2 AA audit and a keyboard check with cy.press(Cypress.Keyboard.Keys.TAB) (src/e2e/a11y-audit.cy.ts).
  3. Continuous Deployment (.github/workflows/<name>-cd*.yml), by deploymentTarget:
    • aws-sam (default): mirrors cd-aws.yml / cd-aws-prod.yml (cicd.md). <name>-cd.yml runs a deployable-gate job (is @tgmc/<name> affected?) and then deploy-test in the test Environment (environment-scoped AWS_ROLE_ARN for OIDC): npm run build:libs, Nitro aws_lambda build, sam deploy of the generated core/<name>/infra/template.yaml (Stage=test) and a smoke GET of the HttpApiUrl output. <name>-cd-prod.yml deploys Stage=production on a published (non-prerelease) Release or a confirm=deploy dispatch in the production Environment. The SAM stack is Lambda + HTTP API only; assets are inlined (serveStatic: 'inline').
    • docker-node: containerized Nitro node-server build with GitHub Container Registry publish (add core/<name>/Dockerfile yourself).
    • static-cloudflare: static pre-rendering via nuxt generate and Cloudflare Pages deployment.
    • Every job sets HUSKY: '0' (repo CI policy).

Development