Skip to content

Feature Request: Enhancement of "modular add ..." #1366

@steveukx

Description

@steveukx

The current modular add ... command enables developers to scaffold new apps and views in their modular workspace based on template files within the modular-scripts module itself.

This feature would enhance the current functionality to allow referencing templates as either an npm module name or a cloneable git repository URL. By making this change, modular would be:

  • more lightweight: there will no longer be the need to bundle the templates along with modular-scripts so they wouldn't form part of the initial download when installing modular-scripts.

  • more flexible: unlocks the ability for other libraries/frameworks to share templates through the modular eco-system, either by sharing examples as separate repos, or publishing examples into a package manager (npm/yarn etc) as part of a build process.

  • more responsive: the templates used by modular add will no longer be bound to the version of modular-scripts being used, meaning that upgrades and updates to the template can be published independently of modular-scripts.

Examples:

# use the content of @steveukx/some-view-example module published to npm:
modular add @steveukx/some-view-example

# use a git export from the specified git remote
modular add https://github.com/steveukx/some-view-example.git

# use a short name to reference a package known to modular-scripts
# this would be the module @modular-scripts/template-view
modular add view

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions