https://github.com/apajo/hygen_scaffold_generator
Generate code scaffolding from your boilerplate code
https://github.com/apajo/hygen_scaffold_generator
Last synced: 3 months ago
JSON representation
Generate code scaffolding from your boilerplate code
- Host: GitHub
- URL: https://github.com/apajo/hygen_scaffold_generator
- Owner: apajo
- License: bsd-3-clause
- Created: 2022-11-27T20:47:48.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T00:15:33.000Z (over 2 years ago)
- Last Synced: 2025-01-14T15:20:46.373Z (4 months ago)
- Language: TypeScript
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hygen scaffold generator
[](https://badge.fury.io/js/angular2-expandable-list)
[](https://github.com/prettier/prettier)> Generate code scaffolding from your boilerplate code
## Prerequisites
This project requires NodeJS (version 16 or later) and NPM.
[Node 16](http://nodejs.org/) and [Yarn 1.22.19](https://yarnpkg.com/) are really easy to install.
To make sure you have them available on your machine,
try running the following command.```sh
$ yarn -v && node -v
1.22.19
v16.18.0
```## Table of contents
- [Hygen scaffold generator](#hygen-scaffold-generator)
- [Prerequisites](#prerequisites)
- [Table of contents](#table-of-contents)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Usage](#usage)
- [Example use case](#example-use-case)
- [Serving the app](#serving-the-app)
- [Running the tests](#running-the-tests)
- [Building a distribution version](#building-a-distribution-version)
- [Contributing](#contributing)
- [Credits](#credits)
- [Versioning](#versioning)
- [Authors](#authors)
- [License](#license)## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
## Installation
**BEFORE YOU INSTALL:** please read the [prerequisites](#prerequisites)
Start with cloning this repo on your local machine:
```sh
$ git clone https://github.com/apajo/hygen_scaffold_generator.git .hygen
$ cd .hygen
```To install and set up the library, run:
```sh
$ yarn
$ yarn setup
```## Usage
### Example use case
Example file structure:
```
│ UserModule.java
│
└───Model
│ │ UserModel.java
│ │ UserGroupModel.java
│
└───resources
│ │ translations.yml
```Contents of `UserModule.java`
```java
package com.my_namespace;public class UserModule {
}
```With these files in your working directory run:
```sh
$ hygen generator template --name=my_template_group --action=template_name --className=User --namespace=com.my_namespace
```
This generates your new template into _templates director.Equivalent interactive `hygen generator template`
Now anywhere in your project (with .hygen.js in the parent directory) you can run:
```sh
$ hygen my_template_group template_name --namespace=com.another_namespace --className=Document
```Equivalent interactive command `hygen my_template_group template_name`
Output of the command:
```
│ DocumentModule.java
│
└───Model
│ │ DocumentModel.java
│ │ DocumentGroupModel.java
│
└───resources
│ │ translations.yml
```Contents of `DocumentModule.java`
```java
package com.another_namespace;public class DocumentModule {
}
```### Serving the app
```sh
$ yarn start
```### Running the tests
```sh
$ yarn test
```### Building a distribution version
```sh
$ yarn build
```This task will create a distribution version of the project
inside your local `dist/` folder## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Add your changes: `git add .`
4. Commit your changes: `git commit -am 'Add some feature'`
5. Push to the branch: `git push origin my-new-feature`
6. Submit a pull request :sunglasses:## Credits
TODO: Write credits
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/apajo/hygen_scaffold_generator/tags).
## Authors
* **Andres Pajo** - *Initial work* - [apajo](https://apajo.ee/)
See also the list of [contributors](https://github.com/apajo/hygen_scaffold_generator) who participated in this project.
## License
[MIT License](https://andreasonny.mit-license.org/2019) © Andrea SonnY