Skip to content

Latest commit

 

History

History
237 lines (162 loc) · 6.69 KB

File metadata and controls

237 lines (162 loc) · 6.69 KB

Contributing to G-SSO SDK

Thank you for your interest in contributing to G-SSO! This guide will help you get started.

📋 Table of Contents


Code of Conduct

By participating in this project, you agree to treat all contributors with respect and maintain a welcoming, inclusive environment. See CODE_OF_CONDUCT.md for details.


Getting Started

G-SSO SDK is a universal multi-chain wallet authentication SDK for decentralised Single Sign-On. It's built with TypeScript, bundled with Rollup, and supports vanilla JS, React, Vue, and WordPress integrations.

Before contributing, please:

  1. Check existing issues to avoid duplicating work
  2. For new features: Open an issue first to discuss your approach before writing code
  3. For small fixes (typos, docs improvements): You can go straight to a PR

Development Setup

Prerequisites

  • Node.js >= 18.x
  • npm (included with Node.js)
  • Git

Clone and Install

# Fork the repo on GitHub, then clone your fork
git clone https://github.com/<your-username>/g-sso-client.git
cd g-sso-client

# Add the upstream remote
git remote add upstream https://github.com/go2gloryltd/g-sso-client.git

# Install dependencies
npm install

# Copy environment config
cp .env.example .env
# Edit .env with your local settings

Project Structure

g-sso-client/
├── src/              # Source code (TypeScript)
├── cdn/              # CDN distribution files
├── demo/             # Demo applications
├── scripts/          # Build and utility scripts
├── .github/
│   └── workflows/    # GitHub Actions CI/CD
├── rollup.config.js  # Rollup bundler configuration
├── tsconfig.json     # TypeScript configuration
└── package.json

Build

# Build the SDK
npm run build

Branching Strategy (Git Flow)

We follow Git Flow:

main          ← Production releases only (tagged versions)
  └── develop ← Active development (PRs merge here)
        ├── feature/xxx  ← New features
        ├── fix/xxx      ← Bug fixes
        └── docs/xxx     ← Documentation changes

Key Rules

  • main is the stable release branch. Only release merges go here. Never commit directly.
  • develop is the active development branch. All PRs target develop.
  • Feature/fix branches are created from develop and merged back into develop.
  • Releases are cut from develop → merged into main and tagged.

Creating Your Branch

# Always start from develop
git checkout develop
git pull upstream develop
git checkout -b feature/your-feature-name

# For bug fixes
git checkout -b fix/describe-the-bug

# For documentation
git checkout -b docs/what-you-changed

Making Changes

Commit Messages

We follow Conventional Commits. This format enables automated changelogs and clear history.

type: short description

Optional longer explanation of what and why.

Types:

Prefix Use for
feat: New feature
fix: Bug fix
docs: Documentation only
chore: Maintenance, dependencies, CI/CD
refactor: Code restructuring (no new feature or fix)

Examples:

feat: add Ledger hardware wallet support
fix: resolve token refresh race condition
docs: update React integration example
chore: update rollup to v4.x

Pull Request Process

Before Submitting

  1. Build must pass — run npm run build with zero errors
  2. No TypeScript errors — the build will catch these
  3. If you changed an API, update the README or relevant documentation
  4. Target the develop branch — not main

Submitting a PR

  1. Push your branch to your fork
  2. Open a PR from your branch → go2gloryltd/g-sso-client:develop
  3. Fill out the PR template completely
  4. Link any related issues (use "Closes #123")

Review Process

  • A maintainer will review your PR, usually within a few days
  • One approval required from a maintainer to merge
  • Be responsive to feedback — we may request changes
  • Once approved, a maintainer will merge your PR

Quality Standards

These are the checks your PR must pass:

Check Required Notes
npm run build succeeds ✅ Yes Non-negotiable
No TypeScript errors ✅ Yes Caught by the build
Conventional Commits format ✅ Yes For all commit messages
Documentation updated Recommended Required if you changed any public API

We're actively working on adding automated testing and linting. These will become required checks once implemented.


Reporting Bugs

Found a bug? Please open an issue with:

  1. Description — what happened vs. what you expected
  2. Steps to reproduce — minimal steps to trigger the bug
  3. Environment — browser, OS, Node.js version, SDK version
  4. Code sample — minimal reproduction if possible
  5. Screenshots/logs — if applicable

Security vulnerabilities should be reported privately. See SECURITY.md.


Requesting Features

Have an idea? Open an issue with:

  1. Problem — what use case are you trying to solve?
  2. Proposed solution — how do you think it should work?
  3. Alternatives considered — any other approaches you thought of?

Please open an issue and get feedback before building a large feature. This saves everyone's time.


Getting Help


License

By contributing to G-SSO SDK, you agree that your contributions will be licensed under the same MIT License as the project.


Thank you for helping make G-SSO better! 🚀