Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 2, 2025

Implements a static React SPA for submitting plugins to the Karin marketplace. Users authenticate via GitHub OAuth (or PAT for testing), select repositories to submit, with automatic detection of already-submitted plugins and npm package validation.

Core Features

Authentication

  • GitHub OAuth flow with fallback to Personal Access Token
  • Dedicated token-setup.html helper page for PAT configuration
  • OAuth callbacks redirect to token setup for simplified testing

Repository Selection

  • Fetches user's GitHub repos, filters for package.json presence
  • Auto-selects repos already in marketplace via package.json name matching against plugins.json
  • Visual indicators for submitted plugins

Validation

  • npm registry validation for npm-type plugins
  • Intelligent type detection: checks exports, main, module, type fields
  • Skips validation for app-type plugins (single JS files)

Implementation

Tech Stack: React 19, Vite 7, GitHub API v3, npm Registry API

Structure:

web/
├── src/components/
│   ├── LoginPage.jsx          # OAuth initiation + feature showcase
│   └── SubmissionPage.jsx     # Repo list, selection, validation
├── token-setup.html           # PAT setup UI with GitHub API validation
└── .github/workflows/deploy-web.yml  # Auto-deploy to GitHub Pages

Type Detection Logic:

// Determines plugin type for validation
const isAppType = !packageName.startsWith('@') && 
                 !packageJson.main && 
                 !packageJson.module && 
                 !packageJson.exports &&
                 packageJson.type !== 'module';

UI

Login Page
Login

Token Setup
Token Setup

Deployment

GitHub Actions workflow deploys to Pages on push. Vite config sets base: '/plugins-list/' for proper routing.

Production setup requires:

  • GitHub OAuth App creation (optional, PAT works for testing)
  • VITE_GITHUB_CLIENT_ID environment variable
  • Backend service for OAuth token exchange (not included - client secret cannot be exposed in frontend)

Build output: 201.66 KB JS (63.89 KB gzipped), 4.05 KB CSS

Original prompt

请帮我创建一个分支。
我想使用github托管一个静态网页,要求用户登录github。

要求用户选择提交到插件市场的仓库。
自动勾选已经提交到插件市场的仓库。使用package.json 的name进行判断。

用户勾选提交之后,需要检查npm上是否存在这个包,暂时仅支持npm包和单js,js这个不需要检查npm。

注意使用react实现~


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link

coderabbitai bot commented Nov 2, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/implement-github-login-feature

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 4 commits November 2, 2025 22:25
- Created React app with Vite for plugin marketplace submission
- Implemented GitHub OAuth login flow
- Added repository selection with auto-detection of submitted plugins
- Implemented npm package validation
- Added support for app type plugins (single JS files)
- Created GitHub Actions workflow for deployment
- Updated README with web app information

Co-authored-by: sj817 <74231782+sj817@users.noreply.github.com>
- Created token-setup.html for easy testing with Personal Access Token
- Added comprehensive DEPLOYMENT.md documentation
- Updated index.html with proper metadata
- Fixed ESLint errors
- Verified build and linting passes

Co-authored-by: sj817 <74231782+sj817@users.noreply.github.com>
- Created comprehensive IMPLEMENTATION_SUMMARY.md
- Documented all features and implementation details
- Added usage instructions and testing methods
- Verified all requirements are met
- Application ready for production deployment

Co-authored-by: sj817 <74231782+sj817@users.noreply.github.com>
- Removed unnecessary onChange handler in checkbox (use readOnly instead)
- Improved plugin type detection logic (check exports, type, scoped packages)
- Replaced alert() with redirect to token-setup.html for better UX
- All linting and build checks pass

Co-authored-by: sj817 <74231782+sj817@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub login for static web page Add React web app for plugin marketplace submission with GitHub OAuth Nov 2, 2025
Copilot AI requested a review from sj817 November 2, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants