Socket
Socket
Sign inDemoInstall

@nuxt/blueprints

Package Overview
Dependencies
5
Maintainers
8
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nuxt/blueprints

Module for Nuxt.js to create distributable micro-apps


Version published
Weekly downloads
4
increased by300%
Maintainers
8
Created
Weekly downloads
 

Changelog

Source

0.1.0-beta.4 (2019-10-11)

Bug Fixes

  • allow implementor to override pathPrefix, default is to use the id (cb47cf0)

Readme

Source

@nuxt/blueprints

Module for Nuxt.js to create distributable micro-apps

npm version npm downloads Circle CI Codecov License

:construction: WIP

This module is considered experimental and a work-in-progress.

Examples

Check the example for a simple blueprint example.

If you are looking for a more advanced example, have a look at the NuxtPress repository which is also build using blueprints.

Node v12.4 required

If you wish to run the example from this repo, you need to use at least Node v12.4.0 due to the use of static class features. Those are transpiled on release using @babel/plugin-proposal-class-properties, but the example runs from source.

Quick Docs

The blueprint module is a supercharged module container which supports autodiscovery of folders and resolving of templates/files.

Features:

  • Define a template by adding the template identifiers tmpl or template to the name (the template identifier is removed before Nuxt.js will build the files)
  • Files which are not templates are just copied if needed (small performance improvement)
  • Prefix template identifiers with a $ to replace the identifier with the blueprint instance id (instead of removing the template identifier)

Main methods

  • autodiscover(<rootDir>, { validate(<path>), filter(<parsed path>) }) Filter and validate callbacks are more or less the same, validate runs during walking the fs and receives the full path as string argument . Filter runs when the fs walking has finished and passes the result of path.parse as argument.

It returns the found files by type, where type is the name of the first level folder

  • resolveFiles(<files>, <pathPrefix>)

This method simply checks if a add<capitalize(type)> method exists. Eg if you have a first level folder plugins then it will call the addPlugins method with the list of files. If the corresponding method doesnt exists then its assumed it are just generic files (or templates) which need to be copied. The pathPrefix argument is the folder in buildDir into which the files will be copied (i.e. if you set this to 'my-id' then all the blueprint files/templates are copied into .nuxt/my-id)

It returns a mapping of the src to dst for all files

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using npm run dev

License

MIT License

Copyright (c) Nuxt.js Team

Keywords

FAQs

Last updated on 11 Oct 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc