Nuxt Modules

onmax/nuxt-skills/skills/nuxt-modules

作者 onmax008232b5d7a5MIT719 个星标收录于 2026年10月8日更新于 2026年10月8日仓库2天前更新

Use when creating Nuxt modules: (1) Published npm modules (@nuxtjs/, nuxt-), (2) Local project modules (modules/ directory), (3) Runtime extensions (components, composables, plugins), (4) Server extensions (API routes, middleware), (5) Releasing/publishing modules to npm, (6) Setting up CI/CD workflows for modules. Provides defineNuxtModule patterns, Kit utilities, hooks, E2E testing, and release automation.

AI 生成的概览

指导创建 Nuxt 模块,涵盖模块结构、Kit 工具、钩子、E2E 测试、发布与 CI 工作流。

功能
该技能为构建扩展框架功能的 Nuxt 模块提供指导,包括发布到 npm 的模块、项目本地模块、运行时扩展和服务端扩展。它指向若干参考文件,内容涵盖 defineNuxtModule 模式、Kit 工具、钩子、E2E 测试、最佳实践、npm 发布以及可直接复制的 CI/CD 工作流模板。它还概述了模块类型、项目结构和快速开始命令。
适用场景
适用于创建 Nuxt 模块时,无论是发布到 npm 还是项目本地使用。也适用于添加运行时或服务端扩展、编写 E2E 测试、发布模块,或为模块搭建 CI/CD 工作流。
运行要求
仅为说明性内容,不附带脚本。按快速开始命令操作需要 Node.js、npm,以及用于 npx nuxi init 和安装依赖的网络访问。

Nuxt Module Development

Guide for creating Nuxt modules that extend framework functionality.

Related skills: nuxt (basics), vue (runtime patterns)

Quick Start

bash
npx nuxi init -t module my-modulecd my-module && npm installnpm run dev        # Start playgroundnpm run dev:build  # Build in watch modenpm run test       # Run tests

Available Guidance

  • references/development.md [blocked] - Module anatomy, defineNuxtModule, Kit utilities, hooks
  • references/testing-and-publishing.md [blocked] - E2E testing, best practices, releasing, publishing
  • references/ci-workflows.md [blocked] - Copy-paste CI/CD workflow templates

Loading Files

Consider loading these reference files based on your task:

  • references/development.md [blocked] - if building module features, using defineNuxtModule, or working with Kit utilities
  • references/testing-and-publishing.md [blocked] - if writing E2E tests, publishing to npm, or following best practices
  • references/ci-workflows.md [blocked] - if setting up CI/CD workflows for your module

DO NOT load all files at once. Load only what's relevant to your current task.

Module Types

TypeLocationUse Case
Publishednpm package@nuxtjs/, nuxt- distribution
Localmodules/ dirProject-specific extensions
Inlinenuxt.config.tsSimple one-off hooks

Project Structure

my-module/├── src/│   ├── module.ts           # Entry point│   └── runtime/            # Injected into user's app│       ├── components/│       ├── composables/│       ├── plugins/│       └── server/├── playground/             # Dev testing└── test/fixtures/          # E2E tests

Resources

来源与署名

来源:onmax/nuxt-skills位于skills/nuxt-modules提交008232b

许可证: MIT

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架