Skip to content

Commit

Permalink
feat(convention): add project templates and commit conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Nov 18, 2021
1 parent 1792a94 commit 6724379
Show file tree
Hide file tree
Showing 11 changed files with 1,860 additions and 43 deletions.
67 changes: 67 additions & 0 deletions .github/COMMIT_CONVENTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
## Git Commit Message Convention

Using conventional commit messages, we can automate the process of generating the CHANGELOG file. All commits messages will automatically be validated against the following regex.

``` js
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|ci|chore|types|build|improvement)((.+))?: .{1,50}/
```

## Commit Message Format
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:

> The **scope** is optional
```
feat(router): add support for prefix
Prefix makes it easier to append a path to a group of routes
```

1. `feat` is type.
2. `router` is scope and is optional
3. `add support for prefix` is the subject
4. The **body** is followed by a blank line.
5. The optional **footer** can be added after the body, followed by a blank line.

## Types
Only one type can be used at a time and only following types are allowed.

- feat
- fix
- docs
- style
- refactor
- perf
- test
- workflow
- ci
- chore
- types
- build

If a type is `feat` or `fix`, then the commit will appear in the CHANGELOG.md file. However if there is any BREAKING CHANGE, the commit will always appear in the changelog.

### Revert
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>`., where the hash is the SHA of the commit being reverted.

## Scope
The scope could be anything specifying place of the commit change. For example: `router`, `view`, `querybuilder`, `database`, `model` and so on.

## Subject
The subject contains succinct description of the change:

- use the imperative, present tense: "change" not "changed" nor "changes".
- don't capitalize first letter
- no dot (.) at the end

## Body

Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

## Footer

The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open_collective: secjs
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- CLICK "Preview" FOR INSTRUCTIONS IN A MORE READABLE FORMAT -->

## Prerequisites

- Ensure the issue isn't already reported.
- Ensure you are reporting the bug in the correct repository.

*Delete the above section and the instructions in the sections below before submitting*

## Description

If this is a feature request, explain why it should be added. Specific use-cases and problems that it solve are best.

For bug reports, please provide as much *relevant* info as possible.

## Package version
<!-- YOUR ANSWER -->

## Error Message & Stack Trace

## Relevant Information
28 changes: 28 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- CLICK "Preview" FOR INSTRUCTIONS IN A MORE READABLE FORMAT -->

## Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

## Types of changes

What types of changes does your code introduce?

_Put an `x` in the boxes that apply_

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Checklist

_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._

- [ ] I have read the [CONTRIBUTING](https://github.com/SecJS/Generator/blob/master/CONTRIBUTING.md) documentation
- [ ] Lint and unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added necessary documentation (if appropriate)

## Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
Binary file modified .github/generator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id: release

- name: Publish to NPM Registry
run: yarn publish --access public
run: npm publish --access public
if: steps.release.outputs.released == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
136 changes: 114 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# compiled output
node_modules
node_modules/

# Logs
logs
Expand All @@ -8,29 +7,122 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# OS
.DS_Store
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Tests
/coverage
/.nyc_output
# Runtime data
pids
*.pid
*.seed
*.pid.lock

# IDEs and editors
/.idea
.project
.classpath
.c9/
.env.testing
*.launch
.settings/
*.sublime-workspace
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# Yarn Integrity file
.yarn-integrity

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IDE
.idea
.vscode

# dotenv environment variables file
.env
.env.testing
.env.production

# Build files
# *.js
# *.d.ts
# dist
# build
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing

SecJS is a community driven project. You are free to contribute in any of the following ways.

- [Coding style](coding-style)
- [Fix bugs by creating PR's](fix-bugs-by-creating-prs)
- [Share an RFC for new features or big changes](share-an-rfc-for-new-features-or-big-changes)
- [Report security issues](report-security-issues)
- [Be a part of the community](be-a-part-of-community)

## Coding style

Majority of SecJS core packages are written in Typescript. Having a brief knowledge of Typescript is required to contribute to the core.

## Fix bugs by creating PR's

We appreciate every time you report a bug in the packages. However, taking time to submit a PR can help us in fixing bugs quickly and ensure a healthy and stable eco-system.

Go through the following points, before creating a new PR.

1. Create an issue discussing the bug or short-coming in the package.
2. Once approved, go ahead and fork the repository.
3. Make sure to start from the `develop`, since this is the upto date branch.
4. Make sure to keep commits small and relevant.
5. We follow [conventional-commits](https://github.com/conventional-changelog/conventional-changelog) to structure our commit messages. Instead of running `git commit -m "message"`, you must run only `git commit`, which will show you prompts to create a valid commit message.
6. Once done with all the changes, create a PR against the `develop` branch.

## Share an RFC for new features or big changes

Sharing PR's for small changes works great. However, when contributing big features to the package, it is required to go through the RFC process.

### What is an RFC?

RFC stands for **Request for Commits**, a standard process followed by many other frameworks including [Ember](https://github.com/emberjs/rfcs), [yarn](https://github.com/yarnpkg/rfcs) and [rust](https://github.com/rust-lang/rfcs).

In brief, RFC process allows you to talk about the changes with everyone in the community and get a view of the core team before dedicating your time to work on the feature.

The RFC proposals are created as issues on [SecJS/Rfcs](https://github.com/SecJS/Rfcs) repository. Make sure to read the README to learn about the process in depth.

## Report security issues

All the security issues, must be reported via [email](mailto:[email protected]) and not using any of the public channels.

## Be a part of community

We welcome you to participate in the [forum](https://forum.secjs.com.br/) and the SecJS [discord server](https://discord.me/secjs). You are free to ask your questions and share your work or contributions made to SecJS eco-system.

We follow a strict [Code of Conduct](https://secjs.com.br/community-guidelines) to make sure everyone is respectful to each other.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
[![GitHub followers](https://img.shields.io/github/followers/jlenon7.svg?style=social&label=Follow&maxAge=2592000)](https://github.com/jlenon7?tab=followers)
[![GitHub stars](https://img.shields.io/github/stars/secjs/generator.svg?style=social&label=Star&maxAge=2592000)](https://github.com/secjs/generator/stargazers/)

<p>
<a href="https://www.buymeacoffee.com/secjs" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
</p>

<p>
<img alt="GitHub language count" src="https://img.shields.io/github/languages/count/secjs/generator?style=for-the-badge&logo=appveyor">

<img alt="Repository size" src="https://img.shields.io/github/repo-size/secjs/generator?style=for-the-badge&logo=appveyor">

<img alt="License" src="https://img.shields.io/badge/license-MIT-brightgreen?style=for-the-badge&logo=appveyor">

<img alt="Commitizen" src="https://img.shields.io/badge/commitizen-friendly-brightgreen?style=for-the-badge&logo=appveyor">
</p>

The intention behind this repository is to always maintain a code `Generator` to any NodeJS project or framework.
Expand Down Expand Up @@ -42,4 +48,6 @@ yo secjs Foo --path=./Bar

---

## License

Made with 🖤 by [jlenon7](https://github.com/jlenon7) :wave
Loading

0 comments on commit 6724379

Please sign in to comment.