Skip to content

manage project structure with CLI #58

@pi0

Description

@pi0

This is a superset of nuxt/nuxt.js#13552 and a requirement of devtools vision.

Nuxt heavily depends on filesystem structure to configure project. As a result, we introduce filesystem entities such as pages, components, composables and plugins.

However, it is not easy to manage such entities. Creating a page, see what components are scanned, what plugins are available, what pages are there and mapped to which routes, etc.

The idea is to expose entity namespaces from nuxi cli to manage these. Some examples:

nuxi pages add <name>
nuxi pages show
nuxi pages update /blog/* --meta title="Blog:"

nuxi plugins add <name>
nuxi plugins show
nuxi plugins disable <name>

nuxi composables show

Related: nuxi module * (https://github.com/nuxt/framework/discussions/569)

By exposing this functionality from CLI (and later an API service), they can be used both for CLI lovers and also nuxt devtools to easily manage entities without duplicating logic.

Roadmap:

  • Scaffold shortcuts for nuxi add <template> <name> as nuxi <template> add <name>
  • Implement show for each
  • Update utilities - penging unjs template (@pi0) (meanwhile ideas welcome)
  • Wait for devtools to share vision and next steps

Entities we can start with:

  • component
  • composable
  • layout
  • middleware
  • page
  • plugin
  • api

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions