You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Contributing to js-quality-starter
1
+
# Contributing to js-quality-starter-with-release
2
2
3
-
We welcome contributions to the `js-quality-starter` template! By contributing, you help improve this foundation for JavaScript projects for everyone.
3
+
We welcome contributions to the `js-quality-starter-with-release` template! By contributing, you help improve this foundation for JavaScript projects for everyone.
4
4
5
5
Please take a moment to review this document to understand our contribution guidelines.
6
6
@@ -20,7 +20,7 @@ Please take a moment to review this document to understand our contribution guid
20
20
21
21
## Code of Conduct
22
22
23
-
This project and everyone participating in it is governed by the [js-quality-starter Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [YOUR_PROJECT_CONTACT_EMAIL].
23
+
This project and everyone participating in it is governed by the js-quality-starter-with-release Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [YOUR_PROJECT_CONTACT_EMAIL].
24
24
25
25
## How to Contribute
26
26
@@ -50,8 +50,8 @@ If you're new to contributing to open source or this project, here's a general w
50
50
2.**Clone** your forked repository to your local machine:
51
51
52
52
```bash
53
-
git clone https://github.com/your-username/your-forked-repo.git # Replace with your forked repository URL
54
-
cd js-quality-starter
53
+
git clone https://github.com/your-username/js-quality-starter-with-release.git # Replace with your username
54
+
cd js-quality-starter-with-release
55
55
```
56
56
57
57
3.**Install dependencies**:
@@ -76,7 +76,7 @@ If you're new to contributing to open source or this project, here's a general w
76
76
git push origin feature/your-feature-name
77
77
```
78
78
79
-
9. Open a **Pull Request** to the `main` branch of the original `js-quality-starter` repository.
79
+
9. Open a **Pull Request** to the `main` branch of the original `js-quality-starter-with-release` repository.
80
80
81
81
### Pull Request Guidelines
82
82
@@ -125,4 +125,4 @@ We encourage the use of Conventional Commits for clear and consistent commit his
125
125
126
126
## License
127
127
128
-
By contributing to `js-quality-starter`, you agree that your contributions will be licensed under its MIT License.
128
+
By contributing to `js-quality-starter-with-release`, you agree that your contributions will be licensed under its MIT License.
A template repository for modern JavaScript projects with pre-configured linting, formatting, testing, and CI/CD using GitHub Actions.
9
+
A template repository for modern JavaScript projects with pre-configured linting, formatting, testing, and a fully automated release pipeline using `semantic-release`.
9
10
10
11
This template provides a solid foundation for any new JavaScript project, ensuring code quality and consistency from the start.
Tired of repetitive setup, inconsistent code, and integration headaches? See how `js-quality-started` provides a superior foundation compared to starting from scratch or using basic boilerplates.
43
+
Tired of repetitive setup, inconsistent code, and integration headaches? See how `js-quality-started-with-release` provides a superior foundation compared to starting from scratch or using basic boilerplates.
@@ -107,6 +108,8 @@ After creating your repository from this template, be sure to:
107
108
1.**Update `package.json`**: Change the `name`, `description`, and `author` fields.
108
109
2.**Update `LICENSE`**: Modify the `[year]` and `[fullname]` to reflect your project's ownership.
109
110
3.**Update `CODE_OF_CONDUCT.md` and `CONTRIBUTING.md`**: Replace the `[YOUR_PROJECT_CONTACT_EMAIL]` placeholder with a valid project contact email.
111
+
4.**Update `README.md` badges**: Replace `your-username/your-new-repo` in the badge URLs with your actual GitHub username and repository name.
112
+
5.**Configure Publishing (Optional)**: In `.releaserc.js`, change `npmPublish: false` to `npmPublish: true` if you want to publish to the npm registry. You will also need to add an `NPM_TOKEN` secret to your repository.
110
113
111
114
## Available Scripts
112
115
@@ -124,27 +127,35 @@ In the project directory, you can run:
124
127
125
128
## How It Works
126
129
127
-
### Pre-commit Hooks
130
+
This template is built around a fully automated, commit-driven workflow.
128
131
129
-
This project uses `Husky` and `lint-staged` to run `eslint --fix`, `prettier --write` (for both code and Markdown), and `markdownlint --fix` on staged files every time you make a commit. This automated quality gate ensures that no code or documentation that violates the style guide ever gets into the codebase.
132
+
### Pre-commit and Commit Message Hooks
130
133
131
-
If a file has linting or formatting errors, the tools will attempt to fix them automatically. If they can, the fixed code is what gets committed. If they can't, the commit is aborted so you can fix the issues manually.
134
+
This project uses `Husky`, `lint-staged`, and `commitlint`to enforce code quality and consistent commit messages.
132
135
133
-
### CI/CD Pipelines
136
+
1.**On Staging:** When you stage files (`git add`), `lint-staged` runs formatters (`Prettier`) and linters (`ESLint`, `markdownlint`) on them. This ensures your code and documentation are clean _before_ you even write a commit message.
137
+
2.**On Commit:** When you write a commit message (`git commit`), `commitlint` validates it against the **Conventional Commits** specification. This is the most critical step, as these structured commit messages power the automated release process. If your message is not compliant (e.g., `git commit -m "updated stuff"`), the commit will be aborted.
134
138
135
-
This template includes one GitHub Action workflow located in the `.github/workflows` directory:
139
+
### Automated Release Generation
136
140
137
-
-**`ci.yml`**: This workflow runs on every push and pull request to the `main` branch. It acts as a final validation gate, ensuring that all tests, linting, and formatting checks pass before code is merged.
141
+
This template uses **`semantic-release`** to automate the entire release process. The manual step of deciding on a version number and creating a release is completely removed.
138
142
139
-
The workflow performs the following steps across multiple Node.js versions (18.x, 20.x):
143
+
The process is triggered every time a commit is merged into the `main` branch. Here’s what happens:
140
144
141
-
1.**Install dependencies** using `npm ci` for fast, reliable installs.
142
-
2.**Lint code** with `npm run lint`.
143
-
3.**Lint Markdown files** with `npm run lint:md`.
144
-
4.**Check code formatting** with `npm run format`.
145
-
5.**Check Markdown formatting** with `npm run format:md`.
146
-
6.**Audit for vulnerabilities** with `npm audit --production`.
147
-
7.**Run tests** with `npm test`.
145
+
1.**Trigger:** A push or merge to the `main` branch starts the `release.yml` GitHub Actions workflow.
146
+
2.**Analysis:**`semantic-release` analyzes the commit messages since the last release.
147
+
3.**Versioning:** It automatically determines the next version number based on the types of commits:
148
+
-`fix:` commits result in a **PATCH** release (e.g., `1.0.0` -> `1.0.1`).
149
+
-`feat:` commits result in a **MINOR** release (e.g., `1.0.1` -> `1.1.0`).
150
+
- Commits with `BREAKING CHANGE:` in the body result in a **MAJOR** release (e.g., `1.1.0` -> `2.0.0`).
151
+
4.**Release Generation:** If a release is warranted, `semantic-release` performs the following actions:
152
+
- Updates `CHANGELOG.md` with the new release notes.
153
+
- Updates the `version` in `package.json`.
154
+
- Creates a new Git tag for the new version.
155
+
- Creates a new GitHub Release with the generated notes.
156
+
- Commits the updated `package.json` and `CHANGELOG.md` files back to the `main` branch.
157
+
158
+
This means you no longer need to manually tag versions. Your release cycle is tied directly to the features and fixes you merge into your main branch.
148
159
149
160
## Customization
150
161
@@ -154,7 +165,7 @@ This template is a starting point. You can easily customize it to fit your proje
154
165
-**Formatting Options**: Adjust the `.prettierrc` file to change Prettier's formatting options.
155
166
-**Markdown Linting**: Customize `markdownlint` rules by editing the `.markdownlint.json` file.
156
167
-**Testing**: The `jest.config.js` file can be configured for more advanced testing scenarios.
157
-
-**CI/CD**: Edit the workflow files in `.github/workflows`to add new steps, such as deployment or notifications.
168
+
-**Release Configuration**: Edit the `.releaserc.js` file to customize the `semantic-release` plugins and behavior.
0 commit comments