Yeoman Nitro Generator
Yeoman generator for Nitro - lets you quickly set up a frontend project with sensible defaults and best practices.
Nitro is a Node.js application for simple and complex frontend development with a tiny footprint.
It provides a proven but flexible structure to develop your frontend code, even in a large team.
Keep track of your code with a modularized frontend. This app and the suggested
atomic design and BEM
concepts could help.
Nitro is simple, fast and flexible. It works on macOS, Windows and Linux. Use this app for all your frontend work.
Usage
Before using, you need of course node installed.
Nitro and the Nitro generator are tested with the current
"Active LTS" versions of node.js (release 6.x and 8.x).
The generator uses yarn as package manager because it's much faster than npm.
Create or update a project
The simple way
Using npx:
npx -p yo -p generator-nitro@latest -- yo nitro
This creates a new project or updates an existing project in the current directory to the newest nitro version.
The alternative way
Install yo
and generator-nitro
globally:
yarn global add yo generator-nitro
Then run:
yo nitro
If you want to update an existing project, update the generator to the newest version before you run yo nitro
:
yarn add generator-nitro
Project Generation
On creating a new project, you will be guided through some configuration options:
- Desired Name
--name=
(default: current directory name) - Desired CSS preprocessor
--pre=
(less
orscss
; default:scss
) - Desired view file extension
--viewExt=
(html
,hbs
ormustache
; default:hbs
) - Using client side templates
--clientTpl
(default: false) - Including example code
--exampleCode
(default: false) - Installing
nitro-exporter
--exporter
(default: false)
The choosen options will be stored for the next project generation.
It's possible to pass in these options through the command line:
npx -p yo -p generator-nitro@latest -- yo nitro --name=myproject --pre=less --viewExt=hbs --clientTpl
# or
yo nitro --name=myproject --pre=less --viewExt=hbs --clientTpl
You may bypass the questions with --skip-questions
. This will use the defaults for not specified options
npx -p yo -p generator-nitro@latest -- yo nitro --name=myproject --clientTpl --exporter --skip-questions
# or
yo nitro --name=myproject --clientTpl --exporter --skip-questions
Project Update
If you start the generator in an existing project, you will be asked to update the project. It is best to overwrite all local files and check the differences after.
Updating to a new major version needs some more work. Please check the release notes
Generators
Available generators:
yo nitro
(akayo nitro:app
)yo nitro:pattern [name]
Note: Generators are to be run from the root directory of your project.
Generated app
See how to use the generated app
Testing
Running yarn test
will run the jasmine
unit tests.
yarn test
Contribute
We are more than happy to accept external contributions to the project in the form of feedback, bug reports and pull requests :)
See the contributing docs
Changelog
Recent changes can be viewed on Github on the Releases Page