Generate GrayJay source plugin projects with TypeScript/JavaScript, integrated testing, and automatic signing.
# 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-searchcd 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.ioUnit 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)
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
- 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-sourcefrom npm - Modular Structure: Network utilities, API client, mappers, pagers, state management
- Auto QR Code: For easy plugin installation
- Node.js >= 14, npm >= 6.14.4
- OpenSSL (for signing)
- GrayJay Dev Portal (for integration tests)