diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 000000000..43eb59fe9
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,18 @@
+# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.158.0/containers/typescript-node/.devcontainer/base.Dockerfile
+
+# [Choice] Node.js version: 14, 12, 10
+ARG VARIANT="14-buster"
+FROM mcr.microsoft.com/devcontainers/typescript-node:${VARIANT}
+
+RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
+ && apt-get -y install --no-install-recommends libx11-dev libxkbfile-dev libsecret-1-dev rsync
+
+# copied from https://github.com/microsoft/vscode-oniguruma/blob/main/.devcontainer/Dockerfile
+RUN mkdir -p /opt/dev \
+ && cd /opt/dev \
+ && git clone https://github.com/emscripten-core/emsdk.git \
+ && cd /opt/dev/emsdk \
+ && ./emsdk install 3.1.21 \
+ && ./emsdk activate 3.1.21
+
+ENV PATH="/opt/dev/emsdk:/opt/dev/emsdk/node/14.18.2_64bit/bin:/opt/dev/emsdk/upstream/emscripten:${PATH}"
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 000000000..eef260001
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,31 @@
+// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
+// https://github.com/microsoft/vscode-dev-containers/tree/v0.158.0/containers/typescript-node
+{
+ "name": "Node.js & TypeScript",
+ "build": {
+ "dockerfile": "Dockerfile",
+ // Update 'VARIANT' to pick a Node version: 10, 12, 14
+ "args": {
+ "VARIANT": "20-bullseye"
+ }
+ },
+
+ // Set *default* container specific settings.json values on container create.
+ "settings": {
+ "terminal.integrated.shell.linux": "/bin/bash"
+ },
+
+ // Add the IDs of extensions you want installed when the container is created.
+ "extensions": [
+ "dbaeumer.vscode-eslint"
+ ],
+
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
+ "forwardPorts": [8080],
+
+ // Use 'postCreateCommand' to run commands after the container is created.
+ //"postCreateCommand": "npm install",
+
+ // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
+ "remoteUser": "node"
+}
\ No newline at end of file
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index 977df0242..000000000
--- a/.eslintignore
+++ /dev/null
@@ -1,3 +0,0 @@
-**/node_modules/**
-**/lib/vscode/**
-**/dist/**
diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index 847676303..000000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "root": true,
- "parser": "@typescript-eslint/parser",
- "parserOptions": {
- "ecmaVersion": 6,
- "sourceType": "module"
- },
- "plugins": [
- "@typescript-eslint",
- "jsdoc"
- ],
- "rules": {
- "constructor-super": "warn",
- "curly": "warn",
- "eqeqeq": "warn",
- "no-buffer-constructor": "warn",
- "no-caller": "warn",
- "no-debugger": "warn",
- "no-duplicate-case": "warn",
- "no-duplicate-imports": "warn",
- "no-eval": "warn",
- "no-extra-semi": "warn",
- "no-new-wrappers": "warn",
- "no-redeclare": "off",
- "no-sparse-arrays": "warn",
- "no-throw-literal": "warn",
- "no-unsafe-finally": "warn",
- "no-unused-labels": "warn",
- "no-restricted-globals": [
- "warn",
- "name",
- "length",
- "event",
- "closed",
- "external",
- "status",
- "origin",
- "orientation",
- "context"
- ], // non-complete list of globals that are easy to access unintentionally
- "no-var": "warn",
- "jsdoc/no-types": "warn",
- "semi": "off",
- "@typescript-eslint/semi": "warn",
- "@typescript-eslint/naming-convention": [
- "warn",
- {
- "selector": "class",
- "format": [
- "PascalCase"
- ]
- }
- ]
- },
- "overrides": [
- {
- "files": [
- "*.js"
- ],
- "rules": {
- "jsdoc/no-types": "off"
- }
- }
- ]
-}
diff --git a/.github/config.yml b/.github/config.yml
new file mode 100644
index 000000000..513c48947
--- /dev/null
+++ b/.github/config.yml
@@ -0,0 +1,21 @@
+# Configuration for welcome - https://github.com/behaviorbot/welcome
+
+# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
+# Comment to be posted to on first time issues
+
+newIssueWelcomeComment: >
+ Hello there!π Welcome to the project!π
+ Thank you and congratsπfor opening your very first issue in this project.Be patient while we get back to you.π
+
+# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
+# Comment to be posted to on PRs from first time contributors in your repository
+
+newPRWelcomeComment: >
+ Hello there!π Welcome to the project!π
+ Thank you and congratsπ for opening your first pull requestβ¨ π.We will get back to you as soon as we can.π
+
+# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
+# Comment to be posted to on pull requests merged by a first time user
+
+firstPRMergeComment: >
+ Congrats on merging your first pull request! πππ We here at github1s are proud of you!
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..ed83fe6ef
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,32 @@
+name: Build & Test
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ os: [macos-14]
+ node-version: [24.x]
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v4
+ with:
+ cache: 'npm'
+ node-version: ${{ matrix.node-version }}
+
+ - run: npm install
+ - run: npm run eslint
+ - run: npm run build
+ - uses: microsoft/playwright-github-action@v1
+ - run: npm run test:ci
diff --git a/.github/workflows/codacy-analysis.yaml b/.github/workflows/codacy-analysis.yaml
new file mode 100644
index 000000000..7abad0aae
--- /dev/null
+++ b/.github/workflows/codacy-analysis.yaml
@@ -0,0 +1,37 @@
+name: Codacy Security Scan
+
+on:
+ push:
+ branches: ['master', 'main']
+ pull_request:
+ branches: ['master', 'main']
+
+jobs:
+ codacy-security-scan:
+ name: Codacy Security Scan
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Run Codacy Analysis CLI
+ uses: codacy/codacy-analysis-cli-action@master
+ with:
+ # Run analysis without SARIF output to avoid GitHub Code Scanning integration issues
+ # See: https://github.com/codacy/codacy-analysis-cli-action/issues/142
+ # The Codacy tool generates multiple SARIF runs which is incompatible with
+ # GitHub's new policy as of July 2025
+ verbose: true
+ # Force 0 exit code to prevent workflow failures
+ max-allowed-issues: 2147483647
+ # only scan the github1s directory
+ directory: $GITHUB_WORKSPACE/extensions/github1s
+
+ # SARIF upload is temporarily disabled due to incompatibility
+ # See: https://github.com/codacy/codacy-analysis-cli-action/issues/142
+ # TODO: Re-enable when Codacy fixes the multiple runs issue
+ # - name: Upload SARIF results file
+ # uses: github/codeql-action/upload-sarif@v4
+ # with:
+ # sarif_file: results.sarif
+ # category: codacy-security-scan
diff --git a/.github/workflows/test-wtih-vscode-build.yml b/.github/workflows/test-wtih-vscode-build.yml
new file mode 100644
index 000000000..d04876a72
--- /dev/null
+++ b/.github/workflows/test-wtih-vscode-build.yml
@@ -0,0 +1,41 @@
+name: Build & Test with VS Code build
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ build-with-vscode-build:
+ permissions:
+ contents: read
+
+ strategy:
+ matrix:
+ os: [macos-14]
+ node-version: [24.x]
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v4
+ with:
+ cache: 'npm'
+ node-version: ${{ matrix.node-version }}
+
+ - run: npm install && cd vscode-web && npm install
+ - name: Build VS Code web
+ working-directory: vscode-web
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: npm run build
+ - run: npm run link && npm run build
+ - uses: microsoft/playwright-github-action@v1
+ - run: npm run test:ci
diff --git a/.github/workflows/welcome-first-time-contributors.yml b/.github/workflows/welcome-first-time-contributors.yml
new file mode 100644
index 000000000..09741ee73
--- /dev/null
+++ b/.github/workflows/welcome-first-time-contributors.yml
@@ -0,0 +1,37 @@
+name: Welcome first time contributors
+
+on:
+ pull_request_target:
+ types:
+ - opened
+ issues:
+ types:
+ - opened
+
+jobs:
+ welcome:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/first-interaction@v1
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ issue-message: |
+ Hello there ${{ github.actor }} π
+
+ Welcome to github1s !!ππ₯³
+
+ Thank you and congratulations π for opening your very first issue in this project. github1s fosters an open and welcoming environment for all our contributors.πΈ
+
+ Incase you want to claim this issue, please comment down below! We will try to get back to you as soon as we can.π
+
+ Feel free to visit [github1s.com](https://github1s.com/). π©βπ» If you have any interesting ideas, just open an issue. We would love to hear you and engage in discussions.
+
+ pr-message: |
+ Hello there ${{ github.actor }} π
+
+ Thank you and congrats π for opening your first PR on this project.β¨
+
+ We will review it soon!
+
+ github1s fosters an open and welcoming environment for all our contributors.πΈ
+
diff --git a/.gitignore b/.gitignore
index 9a28bffee..7f61e2ee3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ lib
dist
out
node_modules
+.worktrees/
diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile
new file mode 100644
index 000000000..0a913357c
--- /dev/null
+++ b/.gitpod.Dockerfile
@@ -0,0 +1,6 @@
+FROM gitpod/workspace-full
+
+RUN sudo apt-get update \
+ && sudo apt-get install -y \
+ g++ gcc make python2.7 pkg-config libx11-dev libxkbfile-dev libsecret-1-dev python-is-python3 rsync \
+ && sudo rm -rf /var/lib/apt/lists/*
\ No newline at end of file
diff --git a/.gitpod.yml b/.gitpod.yml
new file mode 100644
index 000000000..f5a3e68c5
--- /dev/null
+++ b/.gitpod.yml
@@ -0,0 +1,35 @@
+image:
+ file: .gitpod.Dockerfile
+tasks:
+ - init: |
+ npm install
+ npm run build
+ command: |
+ echo "======================="
+ echo "Please run 'npm run watch'"
+ echo "======================="
+ - command: |
+ echo "==========================================================================="
+ echo "Please wait for 'npm run watch' to complete compilation"
+ echo "==========================================================================="
+ports:
+ - port: 8080
+ onOpen: open-browser
+github:
+ prebuilds:
+ # enable for the master/default branch (defaults to true)
+ master: true
+ # enable for all branches in this repo (defaults to false)
+ branches: true
+ # enable for pull requests coming from this repo (defaults to true)
+ pullRequests: true
+ # enable for pull requests coming from forks (defaults to false)
+ pullRequestsFromForks: true
+ # add a check to pull requests (defaults to true)
+ addCheck: true
+ # add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
+ addComment: true
+ # add a "Review in Gitpod" button to the pull request's description (defaults to false)
+ addBadge: false
+ # add a label once the prebuild is ready to pull requests (defaults to false)
+ addLabel: false
diff --git a/.husky/pre-commit b/.husky/pre-commit
index d2ae35e84..2312dc587 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,4 +1 @@
-#!/bin/sh
-. "$(dirname "$0")/_/husky.sh"
-
-yarn lint-staged
+npx lint-staged
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 000000000..b26157438
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,10 @@
+lib
+dist
+out
+node_modules
+vscode-web/src/vs
+vscode-web/extensions
+htm.module.js
+preact.module.js
+preact-hooks.module.js
+index.html
diff --git a/.prettierrc.js b/.prettierrc.js
new file mode 100644
index 000000000..aa5eda3cd
--- /dev/null
+++ b/.prettierrc.js
@@ -0,0 +1,15 @@
+export default {
+ tabWidth: 2,
+ useTabs: true,
+ semi: true,
+ singleQuote: true,
+ printWidth: 120,
+ overrides: [
+ {
+ files: ['*.yml', '*.yaml', '*.json'],
+ options: {
+ useTabs: false,
+ },
+ },
+ ],
+};
diff --git a/README.md b/README.md
index 773aee9c1..1f4960174 100644
--- a/README.md
+++ b/README.md
@@ -1,47 +1,198 @@
-
+
+
# github1s
One second to read GitHub code with VS Code.
-[Chrome Extension](https://chrome.google.com/webstore/detail/github1s/lodjfmkfbfkpdhnhkcdcoonghhghbkhe/)
+## Usage
+
+Just add `1s` after `github` and press `Enter` in the browser address bar for any repository you want to read.
+
+For example, try it on the VS Code repo:
+
+[https://github1s.com/microsoft/vscode](https://github1s.com/microsoft/vscode)
+
+
+
+You can also use [https://gitlab1s.com](https://gitlab1s.com) or [https://npmjs1s.com](https://npmjs1s.com) in the same way.
-Or Save as a bookmarklet (GitHub markdown doesn't allow js links, just copy it into a bookmark)
+For browser extensions, see [Third-party Related Projects](https://github.com/conwnet/github1s#third-party-related-projects).
+
+Or save the following code snippet as a bookmarklet, you can use it to quickly switch between github.com and github1s.com (GitHub markdown doesn't allow js links, so just copy it into a bookmark).
```
-javascript: window.location.href = window.location.href.replace('github.com', 'github1s.com')
+javascript: window.location.href = window.location.href.replace(/github(1s)?.com/, function(match, p1) { return p1 ? 'github.com' : 'github1s.com' })
```
-## Usage
+### Develop in the cloud
-Just add `1s` after `github` and press `Enter` in browser address bar for any repository you want to read.
+To edit files, run Docker containers, create pull requests and more, click the "Develop your project on [Gitpod](https://www.gitpod.io)" button in the status bar. You can also open the Command Palette (default shortcut `Ctrl+Shift+P`) and choose `GitHub1s: Edit files in Gitpod`.
-For Example VS Code:
+
-[https://github1s.com/microsoft/vscode](https://github1s.com/microsoft/vscode)
+## Documentation
-
+- [How it works](https://github.com/conwnet/github1s/blob/master/docs/guide.md)
+- [Roadmap](https://github.com/conwnet/github1s/projects/1)
+
+## Enabling Private Repositories
+
+If you want to view non-public repositories, you need to add an OAuth token. The token is stored only in your browser, and only send to GitHub when fetching your repository's files. Click on the icon near the bottom of the left-hand row of icons, and the dialog box will prompt you for it, and even take you to your GitHub settings page to generate one, if needed.
+
+
+
+## Screenshots
-## Demo
+

## Development
-You need [these prerequisites as same as VS Code](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for development.
+### Cloud-based development
+
+You can start an online development environment with [Gitpod](https://www.gitpod.io) by clicking the following button:
+
+[](https://gitpod.io/#https://github.com/conwnet/github1s)
+
+### Local development
+
+```bash
+git clone git@github.com:conwnet/github1s.git
+cd github1s
+npm install
+npm run watch
+# The cli will automatically open http://localhost:8080 once the build is completed.
+# You can visit http://localhost:8080/conwnet/github1s if it doesn't.
+```
+
+#### Local development with full VS Code build
+
+You need [these prerequisites (the same ones as for VS Code)](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for development with full VS Code build.
+Please make sure you could build VS Code locally before the watch mode.
+
+To verify the build:
+
+```bash
+cd github1s
+npm run build:vscode
+```
+
+After the initial successful build, you could use the watch mode:
```bash
-$ git clone git@github.com:conwnet/github1s.git
-$ cd github1s
-$ yarn
-$ yarn watch
-$ yarn serve # in another shell
-$ # Then visit http://localhost:5000 or http://localhost:5000/conwnet/github1s once the build is completed.
+cd github1s
+npm install
+npm run watch-with-vscode
+# The cli will automatically open http://localhost:8080 once the build is completed.
+# You can visit http://localhost:8080/conwnet/github1s if it doesn't.
```
+### ... or ... VS Code + Docker Development
+
+You can use the VS Code plugin [Remote-Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) `Dev Container` to use a Docker container as a development environment.
+
+1. Install the Remote-Containers plugin in VS Code & Docker
+2. Open the Command Palette (default shortcut `Ctrl+Shift+P`) and choose `Remote-Containers: Clone Repository in Container Volume...`
+3. Enter the repo, in this case `https://github.com/conwnet/github1s.git` or your forked repo
+4. Pick either, `Create a unique volume` or `Create a new volume`
+
+ - Now VS Code will create the docker container and connect to the new container so you can use this as a fully setup environment!
+
+5. Open a new VS Code Terminal, then you can run the `npm install` commands listed above.
+
+```bash
+npm install
+npm run watch
+# The cli will automatically open http://localhost:8080 once the build is completed.
+# You can visit http://localhost:8080/conwnet/github1s if it doesn't.
+```
+
+### Format all codes
+
+```bash
+npm run format
+```
+
+It uses `prettier` to format all possible codes.
+
## Build
```bash
-$ yarn
-$ yarn build
+npm install
+npm run build
```
+## Feedback
+
+- If something is not working, [create an issue](https://github.com/conwnet/github1s/issues/new)
+
+## Sponsors
+
+The continued development and maintenance of GitHub1s is made possible by these generous sponsors:
+
+
|
+ |
+
+
+ |
+
netcon π» π |
+ xcv58 π» π |
+ Siddhant Khare π» π |
+