Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

@milkfloat/generators

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@milkfloat/generators

Code generators for Halo

latest
npmnpm
Version
1.0.1-rc1
Version published
Maintainers
3
Created
Source

Frontend Code Generators

Project Status Project Build

These are code generators to create code from templates to aid with faster development.

This is part of the Developer Experience (DX) initiative of the Design System - to aid developers working with new and existing projects.

Getting Started

These generators create code for React projects and are compatible with the design system's starter-kit.

  • Add this repo to your projects dependencies (package.json)
  • Add a script to your package.json to trigger the generators: "generate": "plop --plopfile ./node_modules/halo-ui-generators/index.js"
  • Run npm run generate <component|hook|view> {name}

You could also create your own plopfile.js to export the file from your node_modules - this allows you to extend with your own configurations if required. This is the method used by the starter-kit.

plopfile.js
module.exports = require("./node_modules/halo-ui-generators")

npm scripts (add to package.json)

"generate": "plop",
...

Available Generators

Component

plop component <name>

This creates a new folder, component, unit test file and default README.md with some basic scaffolding.

View

plop view <name>

This creates a new folder, component, provider, unit test file and default README.md with some basic scaffolding.

This is used for the top-level route components (pages). You can use the providers to encapsulate route specific state.

Context

plop context <name>

This creates a file inside the context directory with some basic scaffolding for generic Context API usage. The file will export a Provider and a hook to use the context in other components.

Hook

plop hook <name>

This creates a js file inside the hooks directory with some basic scaffolding for generic usage.

Technology

Plop has been used to generate code via templates. https://plopjs.com/

Keywords

plop

FAQs

Package last updated on 19 Mar 2021

Did you know?

Socket

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