Git Product home page Git Product logo

generator-reaction's Introduction

generator-reaction

NPM version CircleCI

This is a Yeoman generator plugin used by Reaction Commerce developers. The main generator creates a new project. There are also subgenerators for creating a new NPM package project and for quickly adding GraphQL files to the main Reaction project.

Installation

First, globally install Yeoman and generator-reaction using npm (we assume you have pre-installed node.js).

npm install -g yo generator-reaction

If you are adding or modifying generators in this package, you can test them prior to publishing by running npm link in the generator project's root directory to make the template available globally on your system.

npm link

Generate a new frontend or backend Node project

mkdir project-name
cd project-name
yo reaction

Generate a new NPM package project

mkdir package-name
cd package-name
yo reaction:npm

Generate GraphQL files in the main Reaction app

yo reaction:graphql

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.

Commit Messages

To ensure that all contributors follow the correct message convention, each time you commit your message will be validated with the commitlint package, enabled by the husky Git hooks manager.

Examples of commit messages: https://github.com/semantic-release/semantic-release

Publication to NPM

The generator-reaction package is automatically published by CI when commits are merged or pushed to the master branch. This is done using semantic-release, which also determines version bumps based on conventional Git commit messages.

License

GPL-3.0 © Reaction Commerce, Inc.

generator-reaction's People

Contributors

akarshit avatar aldeed avatar dependabot[bot] avatar focusaurus avatar impactmass avatar kieckhafer avatar mpaktiti avatar spencern avatar ticean avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

suresh44t ihalton

generator-reaction's Issues

Linting doesn't work out-of-the-box for new developers

When I first ran the generator to create a basic front-end app, I got several errors when I tried to run docker-compose run web yarn run lint.

The package.json file did not have any of the devDependencies I needed to get eslint running. I got errors indicated required modules were missing, like: [Error - 13:54:51] Cannot find module 'babel-eslint' Referenced from: /Users/machikoyasuda/Desktop/reaction-static/package.json

Here is how I got linting working for me locally:

# rename .yarnrc
yarn add @reactioncommerce/eslint-config --dev
npx install-peerdeps --dev @reactioncommerce/eslint-config
# restart VSCode
yarn add babel-eslint --dev
# restart VSCode
# magically started working
# unrename .yarnrc
docker-compose run web yarn run lint
# test runs

In my generated app, I ran all of these things so that the package.json file has all the devDependencies listed and CircleCI was able to build it and run yarn run lint itself: https://github.com/reactioncommerce/reaction-static/pull/16

To improve dev experience, I think we should:

  • Add these docs to the generator README, or,
  • Make sure the generator generated app has these necessary linting tools built in it

Improved / additional UI app generators

We have a frontend app generator, but it is just a create-react-app template. Think about ways we can generate different types of apps that are closer to a functioning starter kit.

New type of generated project: blank npm module

Piggy-backing off of this checklist doc: reactioncommerce/reaction-docs#605

A Reaction dev should be able to use the generator to create a blank npm module, shipped with .github, .circleci with semantic release workflow, .gitignore, .npmignore, LICENSE.md, CODE_OF_CONDUCT.md, README.md, package.json, package-lock.json (with Reaction Commerce ESLint configs)

Low Severity: Regular Expression Denial of Service (ReDoS)

Vulnerable module: braces
Introduced through: [email protected]
Detailed Path:

Remediation: No remediation path available.

Overview:
braces is a Bash-like brace expansion, implemented in JavaScript.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks. It used a regular expression (^{(,+(?:({,+})),|,(?:({,+})),+)}) in order to detects empty braces. This can cause an impact of about 10 seconds matching time for data 50K characters long.

More about this issue
Snyk Report

hadolint:latest is failing dockerfile-lint

In reaction-static, I manually tagged hadolint to hadolint/hadolint:v1.6.6-6-g254b4ff because the latest as of June 6, 2018 is failing:

Build-agent version 0.0.6102-5598269 (2018-06-05T17:36:34+0000)
Starting container hadolint/hadolint
  image cache not found on this host, downloading hadolint/hadolint
latest: Pulling from hadolint/hadolint
2065556beb50: Pulling fs layer
2065556beb50: Download complete
2065556beb50: Pull complete
Digest: sha256:65dbc90228c3a06b7e8a581da12be04cec2ff79a549d0e4e57ab3d3a986e4d20
Status: Downloaded newer image for hadolint/hadolint:latest
  using image hadolint/hadolint@sha256:65dbc90228c3a06b7e8a581da12be04cec2ff79a549d0e4e57ab3d3a986e4d20
CircleCI was unable to start the container because container entrypoint or command failed to start.

This typically means that the passed entrypoint or command is not found is not valid.  Try clearing entrypoint/command values.
Original error: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"

Example: https://circleci.com/gh/reactioncommerce/reaction-static/536

For now, I've tagged it to the previous version. We should investigate the issue or follow up with Hadolint and file a bug.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.