Contributing
Contributions are welcome! ResourceLoader.js is an MIT-licensed open-source project hosted on GitHub.
Getting Started
Section titled “Getting Started”Prerequisites
Section titled “Prerequisites”- Node.js v18 or later
- npm v9 or later
Clone and Install
Section titled “Clone and Install”git clone https://github.com/peterbenoit/ResourceLoader.js.gitcd ResourceLoader.jsnpm installRun the Tests
Section titled “Run the Tests”npm testTo run tests in watch mode during development:
npm run test:watchTests use Vitest with jsdom for DOM simulation.
Project Structure
Section titled “Project Structure”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└── LICENSEMaking Changes
Section titled “Making Changes”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.
- Make your change in
resourceLoader.js - Add or update tests in
tests/resourceLoader.test.js - Run
npm testto verify nothing broke - Open a pull request on GitHub
Release Process
Section titled “Release Process”Maintainers use the release script to publish new versions:
# Bump version and publish interactivelynpm 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 npmnpm run release:publishThe release script:
- Checks that the git working tree is clean
- Verifies npm authentication
- Runs all tests
- Performs a dry-run npm pack to validate the package
- Bumps the version in
package.json - Creates a git commit and tag
- Pushes to GitHub
- Optionally publishes to npm
- Displays CDN URLs for the new version
Reporting Bugs
Section titled “Reporting Bugs”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
License
Section titled “License”ResourceLoader.js is released under the MIT License. By contributing, you agree that your contributions will be licensed under the same terms.