Skip to content

Contributing

Contributions are welcome! ResourceLoader.js is an MIT-licensed open-source project hosted on GitHub.

  • Node.js v18 or later
  • npm v9 or later
Terminal window
git clone https://github.com/peterbenoit/ResourceLoader.js.git
cd ResourceLoader.js
npm install
Terminal window
npm test

To run tests in watch mode during development:

Terminal window
npm run test:watch

Tests use Vitest with jsdom for DOM simulation.


ResourceLoader.js/
├── resourceLoader.js # The library (single file)
├── tests/
│ └── resourceLoader.test.js # Test suite
├── scripts/
│ └── release.js # Release automation script
├── docs/ # This documentation site
├── package.json
├── README.md
└── LICENSE

The entire library lives in a single file: resourceLoader.js. There is no build step — the file you edit is the file that ships to npm and CDNs.

  1. Make your change in resourceLoader.js
  2. Add or update tests in tests/resourceLoader.test.js
  3. Run npm test to verify nothing broke
  4. Open a pull request on GitHub

Maintainers use the release script to publish new versions:

Terminal window
# Bump version and publish interactively
npm run release
# Bump patch version (no publish)
npm run release:patch
# Bump minor version (no publish)
npm run release:minor
# Bump patch and publish to npm
npm run release:publish

The release script:

  1. Checks that the git working tree is clean
  2. Verifies npm authentication
  3. Runs all tests
  4. Performs a dry-run npm pack to validate the package
  5. Bumps the version in package.json
  6. Creates a git commit and tag
  7. Pushes to GitHub
  8. Optionally publishes to npm
  9. Displays CDN URLs for the new version

Please open an issue on the GitHub Issues page with:

  • A clear description of the problem
  • The URL(s) you were trying to load
  • The options you passed to include()
  • The browser and version
  • A minimal reproducible example if possible

ResourceLoader.js is released under the MIT License. By contributing, you agree that your contributions will be licensed under the same terms.