∺ HingeJS - CLI Project Generator
Command line interface
Simple Single Page Application and code generator
Installation
Install this package globally
$ npm install @hingejs/generator -g
Generate Project
Please note: You can always Internationalize your application later but it is recommended to do this from the beginning rather than updating during development. This CLI will not be able to do that for you so choose carefully from the start.
New project
$ hingejs new <projectFolderName>
Alias
n
$ hingejs n <projectFolderName>
example with project folder name
$ hingejs new test
Options
Command | ShortCut | Description |
---|---|---|
--i18n | -i | Internationalize the new project |
--port | -p | Integer argument ( Default: 9000) |
Internationalization Info: https://developer.mozilla.org/en-US/docs/Glossary/I18N
Examples:
$ hingejs new test --i18n
$ hingejs new test --port 7500
$ hingejs new test --i18n --port 7500
Once generated you can run the following command to start the project
You can refer to the project README.md file
$ cd <projectFolderName>
$ npm start
Generate Files
New template file
$ hingejs generate <type>
Alias
g
$ hingejs g <type>
Examples:
$ hingejs generate component
$ hingejs generate element
$ hingejs generate feature
$ hingejs generate service
$ hingejs g c
$ hingejs g e
$ hingejs g f
$ hingejs g s
Types
Command | ShortCut | Description |
---|---|---|
component | c | Components are project specific and have element/service dependencies |
element | e | Custom elements should be built dependency free to be used for any project |
feature | f | New route page for the application |
service | s | Singleton/Observable based services to manage business logic |