How conwnet/github1s works
Purpose and Runtime
GitHub1s is a browser-hosted, read-oriented VS Code experience for repositories addressed through github1s.com, with parallel GitLab and npm URL modes. The primary runtime is TypeScript/JavaScript in the browser, bundling a customized VS Code web workbench plus the GitHub1s extension. Static hosting starts from public/index.html; application bootstrap is src/index.ts.
Browser Bootstrap and Product Shell
The root app configures the page, product identity, notifications, and OAuth handoff before loading the VS Code web application.
• src/index.ts
• src/config.ts
• src/product.ts
• src/github-auth.ts
• src/gitlab-auth.ts
• public/index.html
Customized VS Code Web Workbench
vscode-web is a maintained subset/patch layer around VS Code’s browser workbench. It provides the editor UI, explorer, service contracts, extension host integration, and browser-oriented file/text services that GitHub1s consumes.
• vscode-web/src/vs/workbench/browser/web.main.ts
• vscode-web/src/vs/workbench/services/textfile/browser/textFileService.ts
• vscode-web/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts
Build scripts clone, patch, package, and watch this runtime; a normal build can use the bundled version, while the full build rebuilds VS Code assets.
• vscode-web/scripts/clone.js
• vscode-web/scripts/patch.js
• vscode-web/scripts/build/vscode.js
GitHub1s Extension Entry and Orchestration
The core product behavior is a VS Code web extension. Its activation entry wires adapters, route and VS Code listeners, providers, commands, status bar elements, repository managers, and views. This is the principal control boundary between the workbench APIs and repository-specific behavior.
• extensions/github1s/src/extension.ts
• extensions/github1s/src/listeners/index.ts
• extensions/github1s/src/providers/index.ts
• extensions/github1s/src/commands/index.ts
URL Routing and Repository Context
Browser location determines host/provider, owner/project/package identity, revision, path, and UI intent. Router listeners react to navigation and synchronize explorer/editor state; repository managers retain branch/tag, commit, and review context.
• extensions/github1s/src/router/index.ts
• extensions/github1s/src/listeners/router/index.ts
• extensions/github1s/src/adapters/manager.ts
• extensions/github1s/src/repository/index.ts
Provider Adapter and Remote Data Boundary
A provider-adapter layer normalizes routing and data access across GitHub, GitLab, Bitbucket, npm, OSS Insight, and Sourcegraph. GitHub/GitLab adapters own REST/GraphQL fetching, authentication settings, token handling, and repository path parsing. Sourcegraph supplies code-intelligence operations such as definitions, hover, references, blame, and search.
• extensions/github1s/src/adapters/github1s/index.ts
• extensions/github1s/src/adapters/github1s/graphql.ts
• extensions/github1s/src/adapters/gitlab1s/data-source.ts
• extensions/github1s/src/adapters/sourcegraph/data-source.ts
OAuth callbacks are serverless API endpoints; browser-held tokens are used for private repository fetches.
• functions/api/github-auth-callback.ts
• functions/api/gitlab-auth-callback.ts
Virtual Repository and Editor Features
Remote adapter data is exposed as VS Code providers: virtual filesystem reads, file/text search, definitions, hovers, and references. Change handling adds quick diffs and source-control decorations. Commands and views surface commits, blame, ref switching, review, and Gitpod handoff.
• extensions/github1s/src/providers/file-system/index.ts
• extensions/github1s/src/providers/text-search.ts
• extensions/github1s/src/changes/quick-diff.ts
• extensions/github1s/src/commands/code-review.ts
Packaging and Built-in Language Support
Webpack and repository scripts assemble public assets, VS Code web artifacts, and extensions for deployment. The core GitHub1s extension is accompanied by lightweight language/syntax extensions for Elm, Nim, OCaml, and V.
• webpack.config.js
• scripts/build.js
• extensions/github1s/webpack.config.js
• extensions/ocaml-web/package.json
Main entry points: extension.ts Extension activation · web.main.ts Web workbench · manager.ts Provider adapters · index.ts App bootstrap
Components 22
Browser App
- Static entry page
public/index.html - App bootstrap · Configures the shell and loads the web workbench.
src/index.ts - Product and auth shell
src/config.ts - OAuth browser flows
src/github-auth.ts
VS Code Web Runtime
- Web workbench · Customized editor, explorer, service, and extension-host runtime.
vscode-web/src/vs/workbench/browser/web.main.ts - Browser text files
vscode-web/src/vs/workbench/services/textfile/browser/textFileService.ts - Built-in extensions
vscode-web/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts
GitHub1s Extension
- Extension activation · Principal boundary between workbench APIs and repository behavior.
extensions/github1s/src/extension.ts - URL routing · Derives provider, repository identity, revision, path, and UI intent.
extensions/github1s/src/router/index.ts - Navigation sync · Synchronizes route changes with explorer and editor state.
extensions/github1s/src/listeners/router/index.ts - Repository context · Retains branch, tag, commit, and review context.
extensions/github1s/src/repository/index.ts - Virtual repository providers · Exposes remote files, search, and code-intelligence results to VS Code.
extensions/github1s/src/providers/index.ts - Quick diff
extensions/github1s/src/changes/quick-diff.ts - Repository commands · Surfaces review, refs, blame, commits, and Gitpod actions.
extensions/github1s/src/commands/index.ts
Remote Services
- Provider adapters · Normalizes GitHub, GitLab, Bitbucket, npm, OSS Insight, and Sourcegraph.
extensions/github1s/src/adapters/manager.ts - GitHub data access
extensions/github1s/src/adapters/github1s/graphql.ts - GitLab data access
extensions/github1s/src/adapters/gitlab1s/data-source.ts - Code intelligence · Provides definitions, hover, references, blame, and search.
extensions/github1s/src/adapters/sourcegraph/data-source.ts - OAuth callbacks · Exchanges OAuth callbacks for browser authentication flows.
functions/api/github-auth-callback.ts
Build & Packaging
- Deployment build · Assembles public assets, VS Code artifacts, and extensions.
scripts/build.js - VS Code asset build · Clones, patches, packages, and rebuilds VS Code web assets.
vscode-web/scripts/build/vscode.js - Webpack assembly
webpack.config.js
Connections 24
- Static entry page → App bootstrap: loads
- App bootstrap → Product and auth shell: configures
- Product and auth shell → OAuth browser flows: starts auth
- App bootstrap → Web workbench: loads
- Web workbench → Browser text files: uses
- Web workbench → Built-in extensions: discovers
- Web workbench → Extension activation: activates
- Extension activation → URL routing: initializes
- Extension activation → Navigation sync: registers
- Extension activation → Virtual repository providers: registers
- Extension activation → Repository commands: registers
- URL routing → Repository context: selects context
- Navigation sync → URL routing: reacts to navigation
- Repository context → Provider adapters: uses
- Virtual repository providers → Provider adapters: fetches through
- Virtual repository providers → Quick diff: supplies changes
- Provider adapters → GitHub data access: GitHub mode
- Provider adapters → GitLab data access: GitLab mode
- Provider adapters → Code intelligence: intelligence queries
- OAuth browser flows → OAuth callbacks: OAuth callback
- Deployment build → Webpack assembly: runs
- Deployment build → VS Code asset build: optionally rebuilds
- VS Code asset build → Web workbench: produces runtime assets
- Webpack assembly → Static entry page: emits deployable assets