Contribution Guidelines
Relevant source files
The following files were used as context for generating this wiki page:This document outlines the guidelines and procedures for contributing to the Node.js News Feeder project. The project's goal is to aggregate news, releases, and other relevant content for the Node.js community, making it easier to track ongoing developments. Contributions are welcome, and support is available for those new to open-source.
The primary ways to contribute are by creating issues, submitting pull requests, or adding content manually. All contributions are subject to the project's Code of Conduct and require agreement to the Developer's Certificate of Origin.
Sources: README.md:10-15, CONTRIBUTING.md:1-5
Code of Conduct
All contributors must adhere to the Node.js Code of Conduct. This ensures a respectful and collaborative environment for everyone involved in the project. Please review the full Code of Conduct before participating.
Sources: CONTRIBUTING.md:7-11, CODE_OF_CONDUCT.md
Development Setup
To contribute code, you first need to set up the development environment on your local machine. The project requires specific versions of Node.js and npm.
- Clone the repository:
git clone https://github.com/nodejs/nodejs-news-feeder - Navigate into the project directory:
cd nodejs-news-feeder - Use the correct Node.js version (the project specifies
nvm use):nvm use - Install the dependencies:
npm install
The required engine versions are specified in package.json.
| Engine | Version |
|---|---|
node | >=22.0.0 |
npm | >=9.6.4 |
Sources: README.md:52-57, package.json:29-32
Ways to Contribute
There are several ways to contribute to the project, from reporting bugs to adding new content.
Issues
GitHub Issues are the primary channel for communication and tracking tasks. You can use issues for the following purposes:
- Asking for general help.
- Discussing non-technical topics.
- Submitting a bug report.
Sources: CONTRIBUTING.md:13-18
Pull Requests
If you see an area for improvement, feel free to submit a pull request (PR). The project team will provide support, especially for newcomers. All contributions are made under the Developer's Certificate of Origin.
Sources: CONTRIBUTING.md:20-22
Developer's Certificate of Origin 1.1
By making a contribution, you certify that you agree to the following:
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Sources: CONTRIBUTING.md:26-48
Manual Post Addition
The project includes a feature for adding posts manually via a local web server. This is useful for adding news items that are not automatically collected by the scripts.
To use this feature, start the local server:
npm run start
This command runs server.js and starts an Express server on http://localhost:3000. Navigating to this URL will open a form (add-post.html) to submit a new post.
The following diagram illustrates the flow of adding a manual post.
The POST /api/posts endpoint accepts a JSON object with the following fields from the form. The server adds an id and a standardized published_at timestamp.
| Field | Type | Description | Required |
|---|---|---|---|
title | string | The title of the post. | Yes |
description | string | The content of the post (supports Markdown). | Yes |
link | string | A URL to the original source. | Yes |
published_at | string | The publication date (optional). | No |
Sources: server.js:37-45, add-post.html:18-31
Contribution Workflow and Scripts
The general workflow for updating the news feed is automated but allows for manual curation.
This diagram shows the high-level process of how content is collected and published.
Source: README.md:33-48
NPM Scripts
The package.json file contains several scripts to aid in development and contribution. These scripts handle tasks like linting, testing, and building the RSS feed.
| Script | Description |
|---|---|
npm run collect:* | A set of scripts (collect:releases, collect:issues, etc.) to gather new content from various sources. |
npm run start | Starts the local Express server for adding manual posts. |
npm run rss:validate | Validates the feed.xml file against the W3C feed validator. |
npm run rss:build | Updates the feed.xml file with the latest news and updates the lastBuildDate. |
npm run rss:format | Sorts and formats the items in feed.xml. |
npm run website:build | Generates the index.html website from the feed content. |
npm run lint | Runs the standard linter to check for code style issues. |
npm run lint:fix | Automatically fixes linting issues. |
npm run test | Executes the test suite. |
npm run test:watch | Runs tests in watch mode. |
npm run test:coverage | Runs tests and generates a code coverage report. |
Sources: package.json:7-24, README.md:61-86