# Contributing This package is primarily maintained by [Prismic](https://prismic.io)[^1]. External contributions are welcome. Ask for help by [opening an issue](https://github.com/prismicio-community/imgix-url-builder/issues/new/choose), or request a review by opening a pull request. ## :gear: Setup The following setup is required to work on this project: - Node.js 20 or later - npm CLI ## :memo: Project-specific notes This package provides JavaScript/TypeScript Imgix URL builders for browsers and Node.js. It has two entry points: - `imgix-url-builder` — browser-safe utilities (no Node.js crypto) - `imgix-url-builder/node` — includes signed URL utilities using Node.js crypto The `src/types.generated.ts` file is generated from `imgix-url-params`. Run `node --run gen` to regenerate it. ## :construction_worker: Develop > [!NOTE] > It's highly recommended to discuss your changes with the Prismic team before starting by [opening an issue](https://github.com/prismicio-community/imgix-url-builder/issues/new/choose).[^2] > > A short discussion can accellerate your work and ship it faster. ```sh # Clone and prepare the project. git clone git@github.com:prismicio-community/imgix-url-builder.git cd imgix-url-builder npm install # Create a new branch for your changes (e.g. lh/fix-win32-paths). git checkout -b / # Start the development watcher. # Run this command while you are working on your changes. node --run dev # Build the project for production. # Run this command when you want to see the production version. node --run build # Lint your changes before requesting a review. No errors are allowed. node --run lint # Some errors can be fixed automatically: node --run lint -- --fix # Format your changes before requesting a review. No errors are allowed. node --run format # Test your changes before requesting a review. # All changes should be tested. No failing tests are allowed. node --run test # Run only unit tests (optionally in watch mode): node --run unit node --run unit:watch # Run only type tests node --run types ``` ## :building_construction: Submit a pull request > [!NOTE] > Code will be reviewed by the Prismic team before merging.[^3] > > Request a review by opening a pull request. ```sh # Open a pull request. This example uses the GitHub CLI. gh pr create # Someone from the Prismic team will review your work. This review will at # least consider the PR's general direction, code style, and test coverage. # Prereleases are published to npm automatically to upon pushing commits. # Install the prerelease using the `pr-${number}` tag. npm install imgix-url-builder@pr-101 # When ready, PRs should be merged using the "Squash and merge" option. ``` ## :rocket: Publish > [!CAUTION] > Publishing is restricted to the Prismic team.[^4] This repository uses [Release Please](https://github.com/googleapis/release-please). To publish changes in `main`, merge [the pending Release Please PR](https://github.com/prismicio-community/imgix-url-builder/pulls?q=is%3Apr+is%3Aopen+label%3A%22autorelease%3A+pending%22). If you don't see a pending PR, there are no changes to publish from `main`. [^1]: This package is maintained by the DevX team. Prismic employees can ask for help or a review in the [#team-devx](https://prismic-team.slack.com/archives/C014VAACCQL) Slack channel. [^2]: Prismic employees are highly encouraged to discuss changes with the DevX team in the [#team-devx](https://prismic-team.slack.com/archives/C014VAACCQL) Slack channel before starting. [^3]: Code should be reviewed by the DevX team before merging. Prismic employees can request a review in the [#team-devx](https://prismic-team.slack.com/archives/CPG31MDL1) Slack channel. [^4]: Prismic employees can ask the DevX team for [npm](https://www.npmjs.com) publish access.