0.0.56 • Published 5 years ago

@hingejs/generator v0.0.56

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

HingeJS - CLI Project Generator

Command line interface and Simple Single Page Application and code generator

Most of the features have been implemented. This is a work in progress until a 1.0.0 release.

What is this for?

This project generator creates a process to build web applications using web components. It can be in a single page application or traditional page links. The packaged services and custom elements are used to help make development easier. You can use any services or other custom element libraries.

Is this just another framework?

Technically it is not. The libraries used in development have little to no dependencies. Custom Elements allow you to build custom HTML tags using plain JavaScript only. Long gone are the days of having to copy HTML/CSS/JS and manually insert them for one piece of functionality. This is now done in one file and used as a custom HTML tag, native to the browser.

This generator sets you up so you have the following features available to you faster.

  • Build/Bundle process
  • Routing
  • Services
  • Web component suite
  • CSS/JS linting
  • Unit testing
  • Web dev server
  • HTML cached templates
  • i18n translation process
  • Templates generated for rapid development

Why use this

As lightweight as you can get! The build process has dev-dependencies but the core SPA JS bundled dist files are just a couple of helper services and some baseline elements all with zero(0) dependencies. What you end up with is a purely native, low overhead application with the latest and greatest JS has to offer. That means speed and a very small file size for a full production application.

To maintain the application the developer just needs to know JavaScript. There is no extra process, custom or made-up design, just ES6+ JavaScript.

Wiki

For more information, tips and guides visit:

Related packages

Installation

Install this package globally

$ npm install @hingejs/generator -g

Quick use guide

Step 1 Generate a project in a folder called test

$ hingejs new test

Replace test with any folder name of your choosing

Step 2 Wait for the files to be copied and npm install to be completed

Step 3 Enter the new project folder

$ cd test

Step 4 Run the command to start development

$ npm start

Generate Project

New project

$ hingejs new <projectFolderName>

Folder name must be lowercase and allows for alpha-numeric, slashes(/), dashes(-) and underscores(_) characters.

Alias n

$ hingejs n <projectFolderName>

example with project folder name

$ hingejs new test

Options

CommandShortCutDescription
--i18n-iInternationalize the new project
--port -pInteger argument ( Default: 9000)

Internationalization Info: https://developer.mozilla.org/en-US/docs/Glossary/I18N

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.

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

$ cd <projectFolderName>
$ npm start

You can refer to the README.md file

Generate Files

New template file

$ hingejs generate <type> <name>

Alias g

$ hingejs g <type> <name>

Examples:

$ hingejs generate component <name>
$ hingejs generate element <name>
$ hingejs generate feature <name>
$ hingejs generate service <name>

$ hingejs g c <name>
$ hingejs g e <name>
$ hingejs g f <name>
$ hingejs g s <name>

Types

CommandShortCutDescription
componentcComponents are project specific and have element/service dependencies
elementeCustom elements should be built dependency free to be used for any project
featurefNew route page for the application
servicesSingleton/Observable based services to manage business logic

Options

CommandShortCutDescription
--shadow-sShadow dom for element

example of option

$ hingejs generate element tool-tip --shadow

the shortcut command route

$ hingejs g e tool-tip -s

Generate Name Rules

Component and Elements

Follows rules for w3c custom elements. Must begin with an alpha character. Can be alpha-numeric, but must contain one hyphen(-).

$ hingejs generate component tool-tip

or

$ hingejs generate element tool-tip

tool-tip to be used as <tool-tip></tool-tip>

Services

Must be lowercase with hyphen's(-) to separate words.

$ hingejs generate service to-do

todo will become TodoService

to-do will become ToDoService

Using a service in the application you can do the following. Webpack is configured to resolve 'services' as an alias to the correct path of ./src/services/index.js.

import { TodoService } from 'services'

Features

Must be lowercase with directory separators(/). This structure will be generated in the features folder.

$ hingejs generate feature todo/home

todo will become todo/todo.js

todo/home will become todo/home.js

0.0.56

5 years ago

0.0.55

5 years ago

0.0.54

5 years ago

0.0.53

5 years ago

0.0.52

5 years ago

0.0.51

5 years ago

0.0.50

5 years ago

0.0.49

5 years ago

0.0.48

5 years ago

0.0.47

5 years ago

0.0.46

5 years ago

0.0.45

5 years ago

0.0.44

5 years ago

0.0.43

5 years ago

0.0.42

5 years ago

0.0.41

5 years ago

0.0.40

5 years ago

0.0.39

5 years ago

0.0.38

5 years ago

0.0.37

5 years ago

0.0.36

5 years ago

0.0.35

5 years ago

0.0.34

5 years ago

0.0.33

5 years ago

0.0.32

5 years ago

0.0.31

5 years ago

0.0.30

5 years ago

0.0.29

5 years ago

0.0.28

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago