Skip to content

Latest commit

 

History

History
196 lines (139 loc) · 6.79 KB

File metadata and controls

196 lines (139 loc) · 6.79 KB

Contributing to PayPal SDK Logos

We welcome contributions to improve the PayPal SDK Logos module. Whether it's adding features, fixing bugs, or improving documentation, your contributions help make this project better for everyone.

Getting Started

  1. Create your own fork of this repository.
# Clone your fork
$ git clone git@github.com:<your-username>/paypal-sdk-logos.git

# Change directory
$ cd paypal-sdk-logos

# Add the upstream repo
$ git remote add upstream git://github.com/paypal/paypal-sdk-logos.git

# Get the latest upstream changes
$ git pull upstream main

# Install dependencies
$ npm install

# Run scripts to verify installation
$ npm test
$ npm run lint
$ npm run flow

Branch Naming Convention

All branches should follow the naming convention feature/<branch-name> to ensure consistency across the repository.

Commit Messages

This repository uses standard-version for versioning and changelog generation. All commit messages must include a subject and follow the conventional commit format. Below is an example of a properly formatted commit message:

feat: add support for new logo variant

- Added a new logo variant for PayPal branding.
- Updated tests to cover the new logo.

Commit Types

The following commit types are supported and will be reflected in the changelog:

  • feat: Features
  • fix: Bug Fixes
  • chore: Maintenance tasks
  • docs: Documentation updates
  • style: Code style changes (e.g., formatting)
  • refactor: Code refactoring
  • perf: Performance improvements
  • test: Adding or updating tests

Refer to the standard-version configuration in the package.json for more details.

Building

To build the project, run:

$ npm run build

Making Changes

  1. Follow the coding conventions used throughout the project (e.g., indentation, comments, etc.).
  2. Lint your code regularly and ensure it passes before submitting a PR:
    $ npm run lint
  3. Ensure all existing tests pass:
    $ npm test
  4. Add new tests for your changes. Ensure your tests fail without your changes and pass with them.

Testing

  • Run the test suite:
    $ npm test
  • Test in multiple browsers using Karma:
    $ npm run karma -- --browser=Chrome,Firefox,Safari

Submitting Changes

  1. Ensure no errors are generated by ESLint or Flow:
    $ npm run lint
    $ npm run flow
  2. Commit your changes in logical chunks with clear commit messages following the conventional commit format.
  3. Rebase your branch with the latest changes from the upstream main branch:
    $ git pull upstream main --rebase
  4. Push your branch to your fork:
    $ git push origin feature/<branch-name>
  5. Open a Pull Request with a clear title and description.

Publishing

Publishing for this repository is handled via a GitHub Action that automates the process using the scripts/publish.sh script. This action runs the buildLogos script, generates a new version of the package, and outputs the updated logos in the cdn directory.

Steps to Publish

  1. Alpha Release:
    To generate an alpha release, push your changes to a feature/<branch-name> branch and trigger the GitHub Action off that branch. The action will create a prerelease version (e.g., alpha-<commit-sha>) and publish it to npm under the alpha dist-tag.

  2. Main Branch Release:
    When changes are merged into the main branch, the GitHub Action will automatically create a new patch version and publish it to npm under the latest dist-tag.

Manual Publishing (Optional)

If you need to manually trigger the publishing process, you can use the following commands:

  1. Update the version in package.json using npm run release (e.g., patch, minor, or major).
  2. Build the project:
    $ npm run build
  3. Push the changes and publish:
    $ npm run postrelease

For more details, refer to the publish.yml GitHub Action.

Deploying Logos to the CDN

The repository is configured to upload the cdn folder to the PayPal CDN using the PayPal Web CLI. Follow these steps to deploy the logos:

  1. Pull the latest changes
    Before deploying, ensure you have the latest changes that were made after publishing the package. If you are working on the main branch, pull the latest changes from the upstream repository:

    $ git pull upstream main

    If you are working on a feature/<branch-name> branch (e.g., for an alpha release), pull the latest changes from your feature branch:

    $ git pull origin feature/<branch-name>
  2. Log in to the PayPal Web CLI
    Use the web login command to authenticate with the PayPal Web CLI. This step ensures you have the necessary permissions to upload files to the CDN.

    $ web login
  3. Stage the cdn folder for deployment
    Use the web stage command to upload the cdn folder to the CDN:

    $ web stage
  4. Get the bundle approved
    After staging the bundle, it must be approved by someone on the SDK team. Reach out to the SDK team via the Slack channel #js-sdk-dev using the appropriate workflow to request approval and deployment. Once approved, proceed to the deployment step.

  5. Deploy the bundle
    Once the bundle is approved, deploy it to the CDN. You can do this using the PayPal Web CLI or the UI:

    • Using the CLI:

      $ web deploy
    • Using the UI:
      Navigate to the CDN Deploys UI.
      The namespace for this repository is js-sdk-logos. Locate the staged bundle and click Deploy to complete the deployment.
      You can also find the staged bundle and deployment history in the CDN Deploys UI.

  6. Verify the deployment
    After deployment, verify that the files have been uploaded correctly by checking the CDN URL or using the PayPal Web CLI's verification tools.

For more details on using the PayPal Web CLI, refer to the official documentation.

If you encounter any issues during deployment, feel free to open an issue or contact us via GitHub.


Copyright 2025, PayPal under the Apache 2.0 license.