Socket
Book a DemoInstallSign in
Socket

atomic-scripts

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atomic-scripts

React Component Generator in Atomic-Design Manner

latest
Source
npmnpm
Version
2.1.2
Version published
Maintainers
1
Created
Source

atomic-scripts

Greenkeeper badge a small cli helper-tool for fast component scaffolding.

npm Build Status Coverage Status

Installation

  • npm install --save-dev atomic-scripts or yarn add --dev atomic-scripts

  • Update your package.json like this:

    {
      "scripts": {
    +   "atomic": "atomic-scripts"
      },
    + "atomic-scripts": {
    +   "componentsDir": "src/components/"
    + }
    }
    

Usage:

In your terminal start the cli-script via: npm run atomic or yarn atomic

The answer all the questions and the component will be scaffolded into the correct directory. atomic-scripts

Configuration

For custom componentTypes to choose in your cli: add them in your package.json config:

  "atomic-scripts": {
+   "componentTypes": [
+      "atom",
+      "molecule",
+      "organism",
+      "template"          
+    ]
  }
}

If you want to specify your own templates: configure the path of your own templates.js in the package.json config:

  "atomic-scripts": {
    "componentsDir": "src/components/",
+   "templates": "thePathToYour/templates.js"
  }
}

The specified templates.js MUST export an array of objects which contains two keys: fileName and fileContent.

These two can be strings or functions. If a function is supplied it will called with one parameter: an object with all user answers and must return a string.

Here is an example how this answers object could look like:

{
  type: 'atom',
  name: 'TestComponent',
}

For an quickstart look at the original templates.js file.

Created by

License

MIT © Michael Seel

Keywords

react

FAQs

Package last updated on 05 Dec 2017

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.