1.0.8 • Published 4 years ago

@last-rev/generator v1.0.8

Weekly downloads
133
License
ISC
Repository
github
Last release
4 years ago

Installation

npm install -g @last-rev/generator

Usage

lr-gen

Generators

component

Generates component scaffolding for LastRev projects. You must be within an npm project. It will generate component scaffolding in the src/components directory.

You will be prompted to enter the component name (NOTE: it must be in PascalCase).

For example, entering component name Foo will generate the following file tree:

.
├── Foo
│   ├── Foo.js
│   ├── Foo.mock.js
│   ├── Foo.module.scss
│   ├── Foo.story.js
│   ├── Foo.test.js
│   └── index.js

usage

lr-gen component
# or a single command with no prompts
lr-gen component {component Name} {contentType Name}
# for example
lr-gen component Foo pageFoo

This generator relies on some environment variables in order to run correctly.

A .env file in the root of your project with the correct variables to access contentful is required. See @last-rev/integration-contentful for more info.

redux module

Generates scaffolding for LastRev redux modules. You must be within an npm project. It will generate scaffolding in the src/redux/modules directory.

It will also update the src/redux/modules/index.js file to output the new module.

You will be prompted to enter the module name.

For example, entering module name foo will generate the following file tree:

.
├── foo
│   ├── foo.actions.js
│   ├── foo.actions.test.js
│   ├── foo.mock.js
│   ├── foo.reducer.js
│   ├── foo.types.js
│   └── index.js

usage

lr-gen redux module
# or a single command with no prompts
lr-gen redux module {module Name}
# for example
lr-gen redux module Foo