Thanks for being interesting on Costro! Before submitting your contribution, be sure to take a moment and read the following guide.
- Make sure that Node.js version 16+ and npm are installed.
- After cloning the repository, run
npm installat the root of the repository. - To start the development server, run
npm run dev.
List of npm scripts available:
Development
# Run development server
npm run dev
# Watch while writing tests
npm run dev:unitTests
# Run unit tests (⚠️ needs npm run build before)
npm run test:unit
# Run fixtures tests (⚠️ needs npm run build before)
npm run test:fixtures
# Run all tests (unit, fixtures)
npm run testTypeScript
# Generate TypeScript declaration files
npm run tsc:d:onlyProduction
# Build code, generate TypeScript declaration files and run tests
npm run pre:publish
# Build the source code for distribution
npm run build./config- Contains configuration files for ESLint, Jest, Prettier and Rollup../src- Contains the source code. The codebase is written inES2015in TypeScript../tests/fixtures- Contains fixtures and a demo build with webpack../tests/unit- Contains all tests. The unit tests are written with Jest../types- Contains TypeScript type definitions.
You can learn how to work on your first pull request from this series of free video: How to contribute to an open source project on GitHub
To request a new feature or improvement, you can submit an issue with the feature template.
Keep the pull requests as small as possible, it's much easier to review. Make sure the PR only does one thing, otherwise please split it.
Make sure the following is done when submitting a pull request:
- Fork the repository and create your branch from
main. - Make sure to test your changes.
- Make sure test passes, run
npm run test.
All unit tests are located in the ./tests/unit folder.
# Watch while writing tests
npm run dev:unit
# Run the tests
npm run test:unit- Add comments JSDoc and annotations TypeScript on all functions.
- Use
camelCasefor the names and methods of public variables.
By contributing to Costro, you agree that your contributions will be licensed under its MIT license.