First of all, thank you for taking the time to contribute to this project. We've tried to make a stable project and try to fix bugs and add new features continuously. You can help us do more.
- Node.js >= 12.0.0
- npm >= 6.0.0
-
Fork and clone the repository:
git clone https://github.com/your-username/notice.js.git cd notice.js -
Install dependencies:
npm install
-
Build the project:
npm run build
This will generate the
dist/notice.jsanddist/noticejs.cssfiles. -
Test your changes:
- Open
examples/demo.htmlin your browser - Or use a local server:
python3 -m http.server 8000 # Then visit http://localhost:8000/examples/demo.html
- Open
npm run build- Build for productionnpm run build:dev- Build for development (with source maps)npm run dev- Build in watch mode for development
Before you post any issue or pull request, search the issues and the pull requests to see if it has already been addressed.
Here are some best practices that will help us accept/address pull requests and issues:
- Outline one, and only one, specific problem/feature that you are trying to address.
- Write a good title that summarizes the specific problem.
- Introduce the problem before you write any code.
- Help us reproduce the problem if applicable with a jsfiddle/codepen showcasing the need for a solution.
- Follow the existing code style and patterns.
- Make sure your changes build successfully (
npm run build). - Test your changes in the demo file.
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes:
- Follow the existing code style
- Make sure to run
npm run buildbefore committing - Test your changes in
examples/demo.html
-
Commit your changes:
git add . git commit -m "feat: description of your changes"
Use conventional commit messages:
feat:for new featuresfix:for bug fixesdocs:for documentation changeschore:for maintenance tasks
-
Push to your fork:
git push origin feature/your-feature-name
-
Submit a pull request:
- Go to GitHub Pull Requests
- Click "New Pull Request"
- Select your branch
- Fill out the PR template
- Link any related issues
At this point you're waiting on us. We may suggest some changes or improvements or alternatives.
notice.js/
βββ src/ # Source files
β βββ js/ # JavaScript source
β βββ sass/ # Styles source
βββ dist/ # Built files (generated)
βββ examples/ # Demo and examples
βββ .github/ # GitHub workflows and templates
βββ docs/ # Documentation
- Use ES6+ features
- Follow existing naming conventions
- Comment complex logic
- Keep functions focused and small
- Maintain backward compatibility when possible