Welcome! We're thrilled that you are interested in contributing to our project. By participating in this project, you agree to abide by the Code of Conduct.
Before submitting a bug report, please check the existing issues to see if the problem has already been reported. If not, create a new issue with a clear title and description.
- Fork the repository and create a new branch from
main
. - Make your changes, ensuring to follow our coding conventions and commit message guidelines.
- Test your changes locally.
- Push your branch to your fork and submit a pull request to the
main
branch of the main repository. - Provide a clear description of your pull request and link to any related issues.
- Follow the template provided when submitting pull requests (PULL_REQUEST_TEMPLATE.md).
- Ensure all tests pass before submitting the pull request.
- If your pull request relates to an issue, reference it in the description using "Fixes #issue_number" or "Resolves #issue_number".
Help us keep this project open and inclusive. Please read and follow our Code of Conduct.
- Git
- Node: any 18.x version or greater
- Yarn: See Yarn website for installation instructions (
npm install yarn -g
)
git clone https://github.com/spencerlepine/printful-sdk-js-v2.git
cd printful-sdk-js-v2
yarn install
The REST API schema is defined in openapi.json
. Edit that specification to reflect the endpoints/responses of the production Printful API. This is used to auto-generate the
src/
code.
{
"openapi": "3.0.0",
"info": {
"version": "2.0.0",
"title": "API Documentation v2 | Printful",
"description": "# About ....",
"contact": {
"name": "Printful developer support",
"url": "https://www.printful.com/docs/support",
"email": "[email protected]"
}
}
"paths": {
"/v2/oauth-scopes": {
// ...
}
}
}
After making edits to the openapi.json
schema, validate and re-generate the src/
TypeScript files.
$ yarn run generate-sdk
$ yarn run release
If any TypeScript errors occur, make manual edits:
// index.ts
export { Placement } from './models/Placement';
- export type { Placement } from './models/Placement';
+ export type { Placement as PlacementType } from './models/Placement';
# (optional) test the bundle locally
cd examples/typescript && yarn && cd ../../
yarn
rm -rf examples/typescript/node_modules/printful-sdk-js-v2/dist && mv dist examples/typescript/node_modules/printful-sdk-js-v2
cd examples/typescript
yarn start
- SDK Generator:
- Source API:
- Documentation: https://developers.printful.com/docs/v2-beta (as of Aug 2024)