Skip to content

Commit

Permalink
chore: implement generator readme (hadenlabs#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
luismayta committed Mar 17, 2021
1 parent 51afb99 commit ec7ba53
Show file tree
Hide file tree
Showing 2 changed files with 267 additions and 0 deletions.
75 changes: 75 additions & 0 deletions provision/generators/README.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#

# Name of this project
name: commitlint-config

email:
support: [email protected]

# Logo for this project
#logo: docs/logo.png

# License of this project
license: 'MIT'

# Canonical GitHub repo
github_repo: hadenlabs/commitlint-config

# Badges to display
badges:
- name: Lint
image: https://github.com/hadenlabs/commitlint-config/actions/workflows/lint.yml/badge.svg?branch=develop
url: https://github.com/hadenlabs/commitlint-config/actions
- name: Issues
image: https://img.shields.io/github/issues/hadenlabs/commitlint-config.svg
url: https://github.com/hadenlabs/commitlint-config/issues
- name: Latest Release
image: https://img.shields.io/github/release/hadenlabs/commitlint-config.svg
url: https://github.com/hadenlabs/commitlint-config/releases

# Short description of this project
description: |-
Commitlint configuration
installation:
- 'docs/include/installation/yarn.md'
- 'docs/include/installation/npm.md'

usage: |-
Create file `.commitlintrc.json` with extending preset and define set of scopes:
```json
{
"extends": ["@hadenlabs/config-conventional"],
"rules": {
"type-enum": [
2,
"always",
[
// as examples
'app',
'common'
]
]
}
}
```
Add to `package.json` next section:
```json
{
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
```
192 changes: 192 additions & 0 deletions provision/templates/README.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<!--
** DO NOT EDIT THIS FILE
**
** 1) Make all changes to `README.yaml`
** 2) Run`make readme` to rebuild this file.
**
** (We maintain HUNDREDS of open source projects. This is how we maintain our sanity.)
**
-->

{{ defineDatasource "config" .Env.README_YAML | regexp.Replace ".*" "" }} {{ defineDatasource "includes" .Env.README_INCLUDES | regexp.Replace ".*" "" }}

# {{(ds "config").name}}{{ if gt (len (ds "config").name) 34 }}{{ print "\n\n" }}{{ end }}
{{ if has (ds "config") "badges" }}{{- range $badge := (ds "config").badges -}}{{ printf " [![%s](%s)](%s)" $badge.name $badge.image $badge.url }}{{ end }}{{ end }}

{{ if has (ds "config") "logo" }} ![{{(ds "config").name}}]({{ (ds "config").logo }}) {{- end -}}

{{ if has (ds "config") "description" }} {{(ds "config").description }} {{ end }}


{{ if has (ds "config") "screenshots" }}

## Screenshots

{{ range $screenshot := (ds "config").screenshots }}
{{ printf "![%s](%s)\n*%s*" $screenshot.name $screenshot.url $screenshot.description }}
{{ end }}{{ end }}

{{ if has (ds "config") "features" }}
## Features
{{ range $feature := (ds "config").features }}{{printf "- %s\n" $feature}}{{ end }}
{{ end }}

{{ if has (ds "config") "introduction" }}

## Introduction

{{ (ds "config").introduction -}} {{ end }}


{{ if has (ds "config") "todo" }}

## To-do

{{ range $todo := (ds "config").todo }}
{{ printf "* [%s](%s)" $todo.name $todo.url }}
{{ end }}
{{ end }}

{{ if has (ds "config") "requirements" }}

## Requirements

{{ (ds "config").requirements -}} {{ end }}


{{ if has (ds "config") "installation" }}
## Installation
{{ range $file := (datasource "config").installation -}}
{{ (include "includes" $file) }}
{{- end }}
{{- end }}

{{ if has (ds "config") "usage" }}

## Usage

{{ (ds "config").usage -}} {{ end }}


{{ if has (ds "config") "quickstart" -}}

## Quick Start

{{ (ds "config").quickstart -}} {{ end }}

{{ if has (ds "config") "examples" }}

## Examples

{{ range $file := (datasource "config").examples -}}
{{ (include "includes" $file) }}
{{- end }}
{{ end }}

{{ if has (ds "config") "include" }} {{ range $file := (datasource "config").include -}} {{ (include "includes" $file) }} {{- end }} {{- end }}

{{ if has (ds "config") "related" }}

## Related Projects

Check out these related projects.
{{ range $related := (ds "config").related }}
{{ printf "* [%s](%s) - %s" $related.name $related.url $related.description }}
{{ end }}

{{ end}}

{{ if has (ds "config") "references" }}

## References

For additional context, refer to some of these links.
{{ range $reference := (ds "config").references }}
{{ printf "* [%s](%s) - %s" $reference.name $reference.url $reference.description }}
{{ end }}
{{ end}}

## Help

**Got a question?**

File a GitHub [issue]({{ printf "https://github.com/%s/issues" (ds "config").github_repo}}), send us an [email](email) or join our [Slack Community](slack).

## Contributing

### Bug Reports & Feature Requests

Please use the [issue tracker]({{ printf "https://github.com/%s/issues" (ds "config").github_repo}}) to report any bugs or file feature requests.

### Development

In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

1. **Fork** the repo on GitHub
2. **Clone** the project to your own machine
3. **Commit** changes to your own branch
4. **Push** your work back up to your fork
5. Submit a **Pull Request** so that we can review your changes

**NOTE:** Be sure to rebase the latest changes from "upstream" before making a pull request!

#### Versioning

Releases are managed using github release feature. We use [Semantic Versioning](http://semver.org) for all the releases. Every change made to the code base will be referred to in the release notes (except for cleanups and refactorings).

{{ if has (ds "config") "copyrights" }}

## Copyrights

{{ range $copyright := (ds "config").copyrights -}} {{ printf "Copyright © %s-%d [%s](%s)\n" $copyright.year time.Now.Year $copyright.name $copyright.url }} {{ end }}

{{ else }}

## Copyright

Copyright © 2018-{{ time.Now.Year }} [Hadenlabs](https://hadenlabs.com)
{{ end}}


## Trademarks

All other trademarks referenced herein are the property of their respective owners.

{{ if has (datasource "config") "contributors" }}

### :star: Contributors

| {{ range $contributor := (ds "config").contributors }}{{ printf " [![%s][%s_avatar]][%s_homepage]<br/>[%s][%s_homepage] |" $contributor.name $contributor.github $contributor.github $contributor.name $contributor.github}}{{ end }}
|{{- range $contributor := (ds "config").contributors -}}---|{{ end }}

{{ range $contributor := (ds "config").contributors -}}
{{- if has $contributor "homepage" }}
{{ printf " [%s_homepage]: %s" $contributor.github $contributor.homepage }}
{{ else -}}
{{ printf " [%s_homepage]: https://github.com/%s" $contributor.github $contributor.github }}
{{ end -}}
{{ if has $contributor "avatar" }}
{{ printf " [%s_avatar]: %s" $contributor.github $contributor.avatar }}
{{ else -}}
{{ printf " [%s_avatar]: https://github.com/%s.png?size=150" $contributor.github $contributor.github }}
{{- end }}
{{ end }}

{{ end }}


{{ if has (ds "config") "license" }}

## License

The code and styles are licensed under the {{(ds "config").license }} license [See project license.](LICENSE).

{{ end }}

## Don't forget to 🌟 Star 🌟 the repo if you like {{(ds "config").name}}

[Your feedback is appreciated]({{ printf "https://github.com/%s/issues" (ds "config").github_repo}})

0 comments on commit ec7ba53

Please sign in to comment.