Skip to content

πŸš€ GrayJay Source Plugin Generator - Create production-ready TypeScript plugins with modular architecture, RSA signing, automated publishing, and more!

License

Notifications You must be signed in to change notification settings

grayjay-sources/source-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

@grayjay-sources/source-generator

Generate GrayJay source plugin projects with TypeScript/JavaScript, integrated testing, and automatic signing.

Quick Start

# Run interactively (recommended)
npx @grayjay-sources/source-generator

# Or with options
npx @grayjay-sources/source-generator \
  --name "YouTube" \
  --platform-url "https://youtube.com" \
  --repository-url "https://github.com/user/grayjay-youtube" \
  --base-url "https://www.googleapis.com/youtube/v3" \
  --uses-api --uses-search

Workflow

cd my-platform && npm install
npm run build          # Build plugin
npm test               # Unit tests (Node.js test runner)
npm run test:integration  # Test on Android device
npm run sign           # RSA sign (auto-generates keys)
npm run publish        # Build, sign, publish to GitHub
npm run submit         # Submit to grayjay-sources.github.io

Testing

Unit Tests (npm test): Fast isolated tests using Node.js test runner + GrayJay polyfill

Integration Tests (npm run test:integration): Test on real Android device via Dev Portal (requires Dev Portal enabled in GrayJay app, same network)

Generated Structure

my-platform/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ script.ts         # Main plugin
β”‚   β”œβ”€β”€ types.ts          # Custom platform types
β”‚   β”œβ”€β”€ constants.ts      # Platform constants
β”‚   β”œβ”€β”€ utils.ts          # Helper functions
β”‚   β”œβ”€β”€ api.ts            # API client wrapper
β”‚   └── utils/
β”‚       β”œβ”€β”€ network.ts    # Unified network utilities
β”‚       └── graphql.ts    # GraphQL utilities (if --uses-graphql)
β”œβ”€β”€ test/
β”‚   └── script.test.ts    # Unit tests
β”œβ”€β”€ scripts/              # Build, sign, publish, test scripts
β”œβ”€β”€ dist/                 # Build output (config.json, script.js)
└── config.json           # Plugin configuration

Features

  • Unified Network System: fetch(), fetchJson(), fetchHtml(), fetchGraphQL() with automatic retries
  • Node.js Test Runner: Unit tests with @kaidelorenzo/grayjay-polyfill
  • Dev Portal Integration: Test on Android via @grayjay-sources/dev-portal-client
  • Auto Signing: RSA-2048 + SHA512 (requires OpenSSL)
  • Type Definitions: Uses @types/grayjay-source from npm
  • Modular Structure: Network utilities, API client, mappers, pagers, state management
  • Auto QR Code: For easy plugin installation

Requirements

  • Node.js >= 14, npm >= 6.14.4
  • OpenSSL (for signing)
  • GrayJay Dev Portal (for integration tests)

Links

About

πŸš€ GrayJay Source Plugin Generator - Create production-ready TypeScript plugins with modular architecture, RSA signing, automated publishing, and more!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •