Repository: conwnet/github1s Branch: master Commit: 71ac760cb1ca Files: 240 Total size: 1.0 MB Directory structure: gitextract_hk2wqped/ ├── .devcontainer/ │ ├── Dockerfile │ └── devcontainer.json ├── .editorconfig ├── .github/ │ ├── config.yml │ └── workflows/ │ ├── build.yml │ ├── codacy-analysis.yaml │ ├── test-wtih-vscode-build.yml │ └── welcome-first-time-contributors.yml ├── .gitignore ├── .gitpod.Dockerfile ├── .gitpod.yml ├── .husky/ │ ├── .gitignore │ └── pre-commit ├── .prettierignore ├── .prettierrc.js ├── LICENSE ├── README.md ├── docs/ │ └── guide.md ├── eslint.config.js ├── extensions/ │ ├── elm-web/ │ │ ├── LICENSE │ │ ├── README.md │ │ ├── language-configuration.json │ │ ├── package.json │ │ └── syntaxes/ │ │ ├── codeblock.json │ │ └── elm-syntax.json │ ├── github1s/ │ │ ├── assets/ │ │ │ └── pages/ │ │ │ ├── components.css │ │ │ ├── components.js │ │ │ ├── github1s-authentication.css │ │ │ ├── github1s-authentication.js │ │ │ ├── github1s-settings.css │ │ │ ├── github1s-settings.js │ │ │ └── libraries/ │ │ │ ├── htm.module.js │ │ │ ├── preact-hooks.module.js │ │ │ └── preact.module.js │ │ ├── package.json │ │ ├── src/ │ │ │ ├── adapters/ │ │ │ │ ├── bitbucket1s/ │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── parse-path.ts │ │ │ │ │ └── router-parser.ts │ │ │ │ ├── github1s/ │ │ │ │ │ ├── authentication.ts │ │ │ │ │ ├── data-source.ts │ │ │ │ │ ├── fetcher.ts │ │ │ │ │ ├── graphql.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── parse-path.ts │ │ │ │ │ ├── router-parser.ts │ │ │ │ │ ├── settings.ts │ │ │ │ │ └── token.ts │ │ │ │ ├── gitlab1s/ │ │ │ │ │ ├── authentication.ts │ │ │ │ │ ├── data-source.ts │ │ │ │ │ ├── fetcher.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── parse-path.ts │ │ │ │ │ ├── router-parser.ts │ │ │ │ │ ├── settings.ts │ │ │ │ │ └── token.ts │ │ │ │ ├── index.ts │ │ │ │ ├── manager.ts │ │ │ │ ├── npmjs1s/ │ │ │ │ │ ├── data-source.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── router-parser.ts │ │ │ │ ├── ossinsight/ │ │ │ │ │ ├── constants.ts │ │ │ │ │ ├── data-source.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interfaces.ts │ │ │ │ │ ├── router-parser.ts │ │ │ │ │ └── templates.ts │ │ │ │ ├── sourcegraph/ │ │ │ │ │ ├── blame.ts │ │ │ │ │ ├── commit.ts │ │ │ │ │ ├── common.ts │ │ │ │ │ ├── comparison.ts │ │ │ │ │ ├── data-source.ts │ │ │ │ │ ├── definition.ts │ │ │ │ │ ├── file.ts │ │ │ │ │ ├── hover.ts │ │ │ │ │ ├── position.ts │ │ │ │ │ ├── ref.ts │ │ │ │ │ ├── reference.ts │ │ │ │ │ ├── repository.ts │ │ │ │ │ └── search.ts │ │ │ │ └── types.ts │ │ │ ├── changes/ │ │ │ │ ├── files.ts │ │ │ │ ├── index.ts │ │ │ │ └── quick-diff.ts │ │ │ ├── commands/ │ │ │ │ ├── blame.ts │ │ │ │ ├── code-review.ts │ │ │ │ ├── commit.ts │ │ │ │ ├── editor.ts │ │ │ │ ├── global.ts │ │ │ │ ├── index.ts │ │ │ │ └── ref.ts │ │ │ ├── extension.ts │ │ │ ├── global.d.ts │ │ │ ├── helpers/ │ │ │ │ ├── async.ts │ │ │ │ ├── context.ts │ │ │ │ ├── date.ts │ │ │ │ ├── func.ts │ │ │ │ ├── page.ts │ │ │ │ ├── submodule.ts │ │ │ │ ├── urls.ts │ │ │ │ ├── util.ts │ │ │ │ └── vscode.ts │ │ │ ├── listeners/ │ │ │ │ ├── index.ts │ │ │ │ ├── router/ │ │ │ │ │ ├── changes.ts │ │ │ │ │ ├── explorer.ts │ │ │ │ │ └── index.ts │ │ │ │ └── vscode.ts │ │ │ ├── messages.ts │ │ │ ├── providers/ │ │ │ │ ├── decorations/ │ │ │ │ │ ├── changed-file.ts │ │ │ │ │ ├── source-control.ts │ │ │ │ │ └── submodule.ts │ │ │ │ ├── definition.ts │ │ │ │ ├── file-search.ts │ │ │ │ ├── file-system/ │ │ │ │ │ ├── index.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── hover.ts │ │ │ │ ├── index.ts │ │ │ │ ├── reference.ts │ │ │ │ └── text-search.ts │ │ │ ├── repository/ │ │ │ │ ├── branch-tag-manager.ts │ │ │ │ ├── code-review-manager.ts │ │ │ │ ├── commit-manager.ts │ │ │ │ └── index.ts │ │ │ ├── router/ │ │ │ │ ├── events.ts │ │ │ │ └── index.ts │ │ │ ├── statusbar/ │ │ │ │ ├── checkout.ts │ │ │ │ ├── index.ts │ │ │ │ └── sponsors.ts │ │ │ ├── views/ │ │ │ │ ├── code-review-list.ts │ │ │ │ ├── commit-list.ts │ │ │ │ └── index.ts │ │ │ └── vscode.proposed.d.ts │ │ ├── tsconfig.json │ │ └── webpack.config.js │ ├── nim-web/ │ │ ├── LICENSE │ │ ├── README.md │ │ ├── nimcfg.json │ │ ├── package.json │ │ ├── snippets/ │ │ │ └── nim.json │ │ └── syntaxes/ │ │ ├── nim.json │ │ └── nimble.json │ ├── ocaml-web/ │ │ ├── LICENSE │ │ ├── README.md │ │ ├── languages/ │ │ │ ├── META.json │ │ │ ├── dune.json │ │ │ ├── menhir.json │ │ │ ├── oasis.json │ │ │ ├── ocaml.json │ │ │ ├── ocamlbuild.json │ │ │ ├── ocamlformat.json │ │ │ ├── ocamllex.json │ │ │ ├── opam-install.json │ │ │ ├── opam.json │ │ │ └── reason.json │ │ ├── package.json │ │ ├── snippets/ │ │ │ ├── dune-project.json │ │ │ ├── dune.json │ │ │ ├── ocaml.json │ │ │ └── ocamllex.json │ │ └── syntaxes/ │ │ ├── META.json │ │ ├── atd.json │ │ ├── cram.json │ │ ├── dune-project.json │ │ ├── dune-workspace.json │ │ ├── dune.json │ │ ├── menhir-action.json │ │ ├── menhir.json │ │ ├── merlin.json │ │ ├── oasis.json │ │ ├── ocaml-markdown-codeblock.json │ │ ├── ocaml.interface.json │ │ ├── ocaml.json │ │ ├── ocamlbuild.json │ │ ├── ocamldoc.json │ │ ├── ocamlformat.json │ │ ├── ocamllex.json │ │ ├── opam-install.json │ │ ├── opam.json │ │ ├── reason-markdown-codeblock.json │ │ └── reason.json │ └── vlang-web/ │ ├── LICENSE │ ├── README.md │ ├── language-configuration.json │ ├── package.json │ ├── snippets/ │ │ └── snippets.json │ └── syntaxes/ │ └── v.tmLanguage.json ├── functions/ │ ├── api/ │ │ ├── github-auth-callback.ts │ │ └── gitlab-auth-callback.ts │ └── tsconfig.json ├── package.json ├── public/ │ ├── index.html │ ├── manifest.json │ ├── page-title.js │ ├── robots.txt │ └── spinner.css ├── scripts/ │ ├── build.js │ ├── link.js │ ├── postinstall.js │ ├── utils.js │ └── webpack.js ├── src/ │ ├── config.ts │ ├── github-auth.ts │ ├── gitlab-auth.ts │ ├── global.d.ts │ ├── index.ts │ ├── notification.css │ ├── notification.ts │ └── product.ts ├── tests/ │ ├── __tests__/ │ │ └── index.test.ts │ ├── jest.config.js │ ├── package.json │ ├── tsconfig.json │ └── typings.d.ts ├── tsconfig.json ├── vscode-web/ │ ├── .VERSION │ ├── README.md │ ├── index.html │ ├── package.json │ ├── scripts/ │ │ ├── .patch │ │ ├── build/ │ │ │ ├── nls.js │ │ │ ├── package.js │ │ │ └── vscode.js │ │ ├── clone.js │ │ ├── patch.js │ │ ├── utils.js │ │ └── watch/ │ │ ├── extensions.js │ │ ├── source.js │ │ └── vscode.js │ ├── src/ │ │ ├── setup.d.ts │ │ └── vs/ │ │ ├── base/ │ │ │ └── common/ │ │ │ └── network.ts │ │ └── workbench/ │ │ ├── browser/ │ │ │ ├── parts/ │ │ │ │ ├── activitybar/ │ │ │ │ │ └── activitybarPart.ts │ │ │ │ └── titlebar/ │ │ │ │ └── media/ │ │ │ │ └── titlebarpart.css │ │ │ └── web.main.ts │ │ ├── contrib/ │ │ │ ├── files/ │ │ │ │ └── browser/ │ │ │ │ └── editors/ │ │ │ │ └── fileEditorInput.ts │ │ │ └── webview/ │ │ │ └── browser/ │ │ │ └── pre/ │ │ │ ├── index-no-csp.html │ │ │ └── index.html │ │ └── services/ │ │ ├── extensionManagement/ │ │ │ └── browser/ │ │ │ └── builtinExtensionsScannerService.ts │ │ ├── label/ │ │ │ └── common/ │ │ │ └── labelService.ts │ │ └── textfile/ │ │ └── browser/ │ │ └── textFileService.ts │ └── tsconfig.json └── webpack.config.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .devcontainer/Dockerfile ================================================ # 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}" ================================================ FILE: .devcontainer/devcontainer.json ================================================ // 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" } ================================================ FILE: .editorconfig ================================================ # EditorConfig is awesome: https://EditorConfig.org # top-most EditorConfig file root = true # Tab indentation [*] indent_style = tab trim_trailing_whitespace = true # The indent size used in the `package.json` file cannot be changed # https://github.com/npm/npm/pull/3180#issuecomment-16336516 [{*.yml,*.yaml,*.json}] indent_style = space indent_size = 2 ================================================ FILE: .github/config.yml ================================================ # 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! ================================================ FILE: .github/workflows/build.yml ================================================ name: Build & Test on: push: branches: - master pull_request: branches: - master jobs: build: strategy: matrix: os: [macos-14] node-version: [20.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: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} npm run test:ci ================================================ FILE: .github/workflows/codacy-analysis.yaml ================================================ 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 ================================================ FILE: .github/workflows/test-wtih-vscode-build.yml ================================================ name: Build & Test with VS Code build on: push: branches: - master pull_request: branches: - master jobs: build: strategy: matrix: os: [macos-14] node-version: [22.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 && cd vscode-web && npm install - run: cd vscode-web && npm run build - run: npm run link && npm run build - uses: microsoft/playwright-github-action@v1 - run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} npm run test:ci ================================================ FILE: .github/workflows/welcome-first-time-contributors.yml ================================================ 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.🌸 ================================================ FILE: .gitignore ================================================ .DS_Store lib dist out node_modules ================================================ FILE: .gitpod.Dockerfile ================================================ 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/* ================================================ FILE: .gitpod.yml ================================================ 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 ================================================ FILE: .husky/.gitignore ================================================ _ ================================================ FILE: .husky/pre-commit ================================================ #!/bin/sh . "$(dirname "$0")/_/husky.sh" npx lint-staged ================================================ FILE: .prettierignore ================================================ lib dist out node_modules vscode-web/src/vs vscode-web/extensions htm.module.js preact.module.js preact-hooks.module.js index.html ================================================ FILE: .prettierrc.js ================================================ export default { tabWidth: 2, useTabs: true, semi: true, singleQuote: true, printWidth: 120, overrides: [ { files: ['*.yml', '*.yaml', '*.json'], options: { useTabs: false, }, }, ], }; ================================================ FILE: LICENSE ================================================ MIT License Copyright conwnet and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ ![GitHub1s](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/logo.svg) # github1s One second to read GitHub code with VS Code. ## 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) ![VS Code - GitHub1s](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/vs-code-github1s.png) You can also use [https://gitlab1s.com](https://gitlab1s.com) or [https://npmjs1s.com](https://npmjs1s.com) in the same way. 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(1s)?.com/, function(match, p1) { return p1 ? 'github.com' : 'github1s.com' }) ``` ### Develop in the cloud 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`. ![Gitpod Status Bar](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/gitpod-statusbar.png) ## 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 ![VS Code - GitHub1s](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/GitHub1sDemo1.gif) ![VS Code - GitHub1s](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/demo.png) ## Development ### Cloud-based development You can start an online development environment with [Gitpod](https://www.gitpod.io) by clicking the following button: [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](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 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 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:
## Partners We are partnered with [OSS Insight](https://ossinsight.io/?utm_source=github1s&utm_medium=github&utm_campaign=ghtrending) to get the Trending Repositories & some more Interesting Analytics. [OSS Insight](https://ossinsight.io/?utm_source=github1s&utm_medium=github&utm_campaign=ghtrending) provides deep insights into GitHub repos, developers, and curated repo lists from billions of GitHub events. It’s built with [TiDB Cloud](https://www.pingcap.com/tidb-cloud/?utm_source=github1s&utm_medium=github&utm_campaign=ghtrending).
## Maintainers! :blush:

netcon

💻 🖋

xcv58

💻 🖋

Siddhant Khare

💻 🖋
## Stargazers over time [![Stargazers over time](https://api.star-history.com/svg?repos=conwnet/github1s&type=Date)](https://star-history.com/#conwnet/github1s&Date)
Third-party Related Projects
### Chrome Extensions - [Repositree](https://chrome.google.com/webstore/detail/repositree/lafjldoccjnjlcmdhmniholdpjkbgajo) ([chouglesaud/repositree](https://github.com/chouglesaud/repositree)) - [github-code-viewer](https://chrome.google.com/webstore/detail/github-code-viewer/ecddapgifccgblebfibdgkagfbdagjfn) ([febaoshan/edge-extensions-github-code-viewer](https://github.com/febaoshan/edge-extensions-github-code-viewer)) - Github1s Extension ([Darkempire78/GitHub1s-Extension](https://github.com/Darkempire78/GitHub1s-Extension)) - [Github Web IDE](https://chrome.google.com/webstore/detail/adjiklnjodbiaioggfpbpkhbfcnhgkfe) ([zvizvi/Github-Web-IDE](https://github.com/zvizvi/Github-Web-IDE)) - [shortcut to github1s](https://chrome.google.com/webstore/detail/shortcut-to-github1s/gfcdbodapcbfckbfpmgeldfkkgjknceo) ([katsuhisa91/github1s-shortcut](https://github.com/katsuhisa91/github1s-shortcut)) - [Github1s Shortut - Open source](https://github.com/Fauzdar1/Github1s) - [⚡️ 1s to GitHub1s!](https://github.com/holazz/webext-github1s) - [github1s Google Chrome Extensions](https://github.com/Lonely-Mr-zhang/github_1s_vscode) ### Firefox Extensions - [Repositree](https://addons.mozilla.org/en-US/firefox/addon/repositree/) ([chouglesaud/repositree](https://github.com/chouglesaud/repositree)) - [Github1s Extension](https://addons.mozilla.org/firefox/addon/github1s-extension) ([Darkempire78/GitHub1s-Extension](https://github.com/Darkempire78/GitHub1s-Extension)) - [Github1s](https://addons.mozilla.org/firefox/addon/github1s/) ([mcherifi/github1s-firefox-addon](https://github.com/mcherifi/github1s-firefox-addon)) - [Github Web IDE](https://addons.mozilla.org/firefox/addon/github-web-ide/) ([zvizvi/Github-Web-IDE](https://github.com/zvizvi/Github-Web-IDE)) ### Microsoft Edge Extensions - [github-code-viewer](https://microsoftedge.microsoft.com/addons/detail/githubcodeviewer/jaaaapanahkknbgdbglnlchbjfhhjlpi) ([febaoshan/edge-extensions-github-code-viewer](https://github.com/febaoshan/edge-extensions-github-code-viewer)) - [Github Web IDE](https://microsoftedge.microsoft.com/addons/detail/akjbkjciknacicbnkfjbnlaeednpadcf) ([zvizvi/Github-Web-IDE](https://github.com/zvizvi/Github-Web-IDE)) ### Safari Extension - [GitHub1s-For-Safari-Extension](https://apps.apple.com/us/app/readcodeonline/id1569026520?mt=12) ([code4you2021/GitHub1s-For-Safari-Extension](https://github.com/code4you2021/GitHub1s-For-Safari-Extension)) ### Tampermonkey scripts - [Mr-B0b/TamperMonkeyScripts/vscode.js](https://github.com/Mr-B0b/TamperMonkeyScripts/blob/main/vscode.js)
================================================ FILE: docs/guide.md ================================================ # How it works GitHub1s is based on [VS Code 1.66.2](https://github.com/microsoft/vscode/tree/1.66.2) now. VS Code can be built for a browser version officially. I also used the code and got inspired by [Code Server](https://github.com/cdr/code-server). Thanks to the very powerful and flexible extensibility of VS Code, we can easily implement a VS Code extension that provides the custom File IO ability using [FileSystemProvider API](https://code.visualstudio.com/api/references/vscode-api#FileSystemProvider). There is an official demo named [vscode-web-playground](https://github.com/microsoft/vscode-web-playground) which shows how it is used. On the other hand, GitHub provides the powerful [REST API](https://docs.github.com/en/rest) that can be used for a variety of tasks which includes reading directories and files for sure. According to the above, obviously, the core concept of GitHub1s is to implement a VS Code Extension (includes FileSystemProvider) using GitHub REST API. _We may switch to the GitHub GraphQL API for more friendly user experience in the future, thanks to @xcv58 and @kanhegaonkarsaurabh. See details at [Issue 12](https://github.com/conwnet/github1s/issues/12)._ ~~GitHub1s is a purely static web app (because it really doesn't need a backend service, does it?). So we just deploy it on [GitHub Pages](https://pages.github.com/) now (the `gh-pages` branch of this repository), and it is free. The service of GitHub1s could be reliable (GitHub is very reliable) because nobody needs to pay the web hosting bills.~~ We deploy GitHub1s on [Cloudflare Pages](https://cloudflare.com/) now for minimize delays in loading and better developer experience. Thanks for the wonderful service provide by Cloudflare. # Rate Limit Another thing that needs attention is [Rate Limit](https://docs.github.com/en/rest/reference/rate-limit): > For unauthenticated requests, the rate limit allows for up to 60 requests per hour. Unauthenticated requests are associated with the originating IP address, and not the user making requests. > For API requests using Basic Authentication or OAuth, you can make up to 5,000 requests per hour. So, if you meet some problems when you use GitHub1s, even if you are using newer browsers, you could try to set a [GitHub OAuth Token](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#oauth2-token-sent-in-a-header). Don't worry, we cannot see your token. It is only stored in your browser [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) with [VS Code Extension globalState API](https://code.visualstudio.com/api/references/vscode-api#ExtensionContext) (Actually we don't have a server, do we?). But this does not mean the token is absolutely safe, **don't forget to clean it while you are using a device that doesn't belong to you**. # Sourcegraph API Due to the potential RateLimit of the GitHub API, we will prioritize the use of the [Sourcegraph API](https://sourcegraph.com/docs) for public repositories, with the exception of the Read interface, the code search capability is also provided by the Sourcegraph API. By default, GitHub1s will only try to use the GitHub API when the Sourcegraph API request fails, and you can adjust this option in the settings. # Development As you see, running GitHub1s locally is not difficult. After cloning the repository, just run these commands: ```shell $ npm install $ npm run watch ``` Then, there will be a new directory named `dist` generated in the project root. The `npm run watch:dev-server` (part of `npm run watch` command) will automatically open http://localhost:8080 in the browser. If you get a 404 error for some static files, please wait a minute for the building to complete. ## Watch Mode What happens after you run `npm run watch-with-vscode`? 1. Copy some necessary resources (`index.html`, `favicons.ico`, etc.) to the `dist` directory. 2. This command will compile the codes in `src` and generate application entry script (see `webpack.config.js`). This command also compile the custom extensions (for example `github1s`) in `extensions` directory. 3. Redirect vscode-web static requests (vscode, extensisions, dependencies) to `vscode-web/lib/vscode` which should be generated by vscode compile process. You should also compile the vscode manually in another terminal. 1. Go to `vscode-web` and run `npm install && npm run watch` (the native watch of vscode), it will trigger a new build if something in it has been changed. 2. This command will alose watch the `vscode-web/src` and `vscode-web/extensions` directory, merge it in to `vscode-web/lib/vscode` if something in it has been changed. (When a new file is merged into `lib/vscode`, it will trigger the watcher that is described in Step 3) Note that since we have modified the source code of VS Code, it may get into trouble when merging a newer version VS Code. It is a little laborious to complete the watch process, but I didn't think of a better solution. What happens after you run `npm run watch`? It's the same procedure as `` without the step 3. Instead of the local VS Code, it uses the prebuilt [@github1s/vscode-web](https://www.npmjs.com/package/@github1s/vscode-web) version. ## Build mode Put simply, we build the necessary code and do a minify. The minify script is modified from [Code Server](https://github.com/cdr/code-server). ## Directory Structure - `extensions` - custom VS Code extensions that don't come with VS Code natively. - `src` - the code in here will be patched into VS Code source. - `vscode-web` - This contains the code to patch VS Code. - `scripts` - some scripts for build, watch, package, etc. - `resources` - some resource files such as templates, pictures, configuration files, etc. ================================================ FILE: eslint.config.js ================================================ import jsdoc from 'eslint-plugin-jsdoc'; import tseslint from 'typescript-eslint'; import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; export default [ { ignores: ['**/dist', '**/assets', 'vscode-web/lib', '**/vs', '**/vscode.proposed.d.ts'] }, ...tseslint.configs.recommended, jsdoc.configs['flat/recommended-typescript'], eslintPluginPrettierRecommended, { rules: { '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-unused-expressions': 'off', '@typescript-eslint/no-unused-vars': 'off', }, }, ]; ================================================ FILE: extensions/elm-web/LICENSE ================================================ MIT License Copyright (c) 2019 Kolja Lampe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: extensions/elm-web/README.md ================================================ # This extension is a fork from [elm-language-client-vscode](https://github.com/elm-tooling/elm-language-client-vscode) for github1s. # At present only languages features is reserved # I have deleted some files and only reserved the necessary code # Elm Plugin for Visual Studio Code (VSCode) [![Version](https://vsmarketplacebadge.apphb.com/version/Elmtooling.elm-ls-vscode.svg)](https://marketplace.visualstudio.com/items?itemName=Elmtooling.elm-ls-vscode) [![Downloads](https://vsmarketplacebadge.apphb.com/downloads-short/Elmtooling.elm-ls-vscode.svg)](https://marketplace.visualstudio.com/items?itemName=Elmtooling.elm-ls-vscode) [![Rating](https://vsmarketplacebadge.apphb.com/rating-star/Elmtooling.elm-ls-vscode.svg)](https://marketplace.visualstudio.com/items?itemName=Elmtooling.elm-ls-vscode) ![Compile](https://github.com/elm-tooling/elm-language-client-vscode/workflows/Compile/badge.svg) Supports elm 0.19 and up ## Highlighted Features - Syntax Highlighting ================================================ FILE: extensions/elm-web/language-configuration.json ================================================ { "comments": { "lineComment": "--", "blockComment": ["{-", "-}"] }, "brackets": [ ["{", "}"], ["[", "]"], ["(", ")"] ], "surroundingPairs": [ ["{", "}"], ["[", "]"], ["(", ")"], ["\"", "\""], ["'", "'"] ], "autoClosingPairs": [ ["(", ")"], ["{", "}"], ["[", "]"], { "open": "\"\"\"", "close": "\"\"\"", "notIn": ["comment"] }, { "open": "\"", "close": "\"", "notIn": ["string"] }, { "open": "'", "close": "'", "notIn": ["string", "comment"] } ], "folding": { "offSide": true } } ================================================ FILE: extensions/elm-web/package.json ================================================ { "name": "elm-ls-vscode", "displayName": "Elm", "description": "Improving your Elm experience since 2019", "publisher": "elmTooling", "icon": "images/elm.png", "author": "Kolja Lampe", "license": "MIT", "version": "2.0.3", "repository": { "type": "git", "url": "https://github.com/elm-tooling/elm-language-client-vscode" }, "categories": [ "Linters", "Snippets", "Programming Languages" ], "keywords": [ "elm" ], "engines": { "vscode": "^1.52.0" }, "activationEvents": [ "onLanguage:elm" ], "contributes": { "languages": [ { "id": "elm", "aliases": [ "Elm", "elm" ], "extensions": [ ".elm" ], "configuration": "./language-configuration.json" } ], "grammars": [ { "scopeName": "markdown.elm.codeblock", "path": "./syntaxes/codeblock.json", "injectTo": [ "text.html.markdown" ], "embeddedLanguages": { "meta.embedded.block.elm": "elm", "meta.embedded.block.glsl": "glsl" } }, { "language": "elm", "scopeName": "source.elm", "path": "./syntaxes/elm-syntax.json" } ] }, "scripts": { "compile": "echo done", "watch": "echo done" } } ================================================ FILE: extensions/elm-web/syntaxes/codeblock.json ================================================ { "fileTypes": [], "injectionSelector": "L:text.html.markdown", "patterns": [ { "include": "#fenced_code_block_elm" } ], "repository": { "fenced_code_block_elm": { "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(elm)(\\s+[^`~]*)?$)", "name": "markup.fenced_code.block.markdown", "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", "beginCaptures": { "3": { "name": "punctuation.definition.markdown" }, "5": { "name": "fenced_code.block.language" }, "6": { "name": "fenced_code.block.language.attributes" } }, "endCaptures": { "3": { "name": "punctuation.definition.markdown" } }, "patterns": [ { "begin": "(^|\\G)(\\s*)(.*)", "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", "contentName": "meta.embedded.block.elm", "patterns": [ { "include": "source.elm" } ] } ] } }, "scopeName": "markdown.elm.codeblock" } ================================================ FILE: extensions/elm-web/syntaxes/elm-syntax.json ================================================ { "fileTypes": ["elm"], "name": "Elm", "scopeName": "source.elm", "patterns": [ { "include": "#import" }, { "include": "#module" }, { "include": "#debug" }, { "include": "#comments" }, { "match": "\\b(_)\\b", "name": "keyword.unused.elm" }, { "include": "#type-signature" }, { "include": "#type-declaration" }, { "include": "#type-alias-declaration" }, { "include": "#string-triple" }, { "include": "#string-quote" }, { "include": "#char" }, { "comment": "Floats are always decimal", "match": "\\b([0-9]+\\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\\b", "name": "constant.numeric.float.elm" }, { "match": "\\b([0-9]+)\\b", "name": "constant.numeric.elm" }, { "match": "\\b(0x[0-9a-fA-F]+)\\b", "name": "constant.numeric.elm" }, { "include": "#glsl" }, { "include": "#record-prefix" }, { "include": "#module-prefix" }, { "include": "#constructor" }, { "name": "meta.record.field.update.elm", "match": "(\\{)\\s+([a-z][a-zA-Z0-9_]*)\\s+(\\|)\\s+([a-z][a-zA-Z0-9_]*)", "captures": { "1": { "name": "punctuation.bracket.elm" }, "2": { "name": "record.name.elm" }, "3": { "name": "keyword.pipe.elm" }, "4": { "name": "entity.name.record.field.elm" } } }, { "name": "meta.record.field.update.elm", "match": "(\\|)\\s+([a-z][a-zA-Z0-9_]*)\\s+(\\=)", "captures": { "1": { "name": "keyword.pipe.elm" }, "2": { "name": "entity.name.record.field.elm" }, "3": { "name": "keyword.operator.assignment.elm" } } }, { "name": "meta.record.field.update.elm", "match": "(\\{)\\s+([a-z][a-zA-Z0-9_]*)\\s+$", "captures": { "1": { "name": "punctuation.bracket.elm" }, "2": { "name": "record.name.elm" } } }, { "name": "meta.record.field.elm", "match": "(\\{)\\s+([a-z][a-zA-Z0-9_]*)\\s+(\\=)", "captures": { "1": { "name": "punctuation.bracket.elm" }, "2": { "name": "entity.name.record.field.elm" }, "3": { "name": "keyword.operator.assignment.elm" } } }, { "name": "meta.record.field.elm", "match": "(,)\\s+([a-z][a-zA-Z0-9_]*)\\s+(\\=)", "captures": { "1": { "name": "punctuation.separator.comma.elm" }, "2": { "name": "entity.name.record.field.elm" }, "3": { "name": "keyword.operator.assignment.elm" } } }, { "match": "(\\}|\\{)", "name": "punctuation.bracket.elm" }, { "include": "#unit" }, { "include": "#comma" }, { "include": "#parens" }, { "match": "(->)", "name": "keyword.operator.arrow.elm" }, { "include": "#infix_op" }, { "match": "(\\=|\\:|\\||\\\\)", "name": "keyword.other.elm" }, { "match": "\\b(type|as|port|exposing|alias|infixl|infixr|infix)\\s+", "name": "keyword.other.elm" }, { "match": "\\b(if|then|else|case|of|let|in)\\s+", "name": "keyword.control.elm" }, { "include": "#record-accessor" }, { "include": "#top_level_value" }, { "include": "#value" }, { "include": "#period" }, { "include": "#square_brackets" } ], "repository": { "comma": { "match": "(,)", "name": "punctuation.separator.comma.elm" }, "parens": { "match": "(\\(|\\))", "name": "punctuation.parens.elm" }, "block_comment": { "applyEndPatternLast": 1, "begin": "\\{-(?!#)", "captures": { "0": { "name": "punctuation.definition.comment.elm" } }, "end": "-\\}", "name": "comment.block.elm", "patterns": [ { "include": "#block_comment" } ] }, "comments": { "patterns": [ { "captures": { "1": { "name": "punctuation.definition.comment.elm" } }, "begin": "--", "end": "$", "name": "comment.line.double-dash.elm" }, { "include": "#block_comment" } ] }, "import": { "name": "meta.import.elm", "begin": "^\\b(import)\\s+", "beginCaptures": { "1": { "name": "keyword.control.import.elm" } }, "end": "\\n(?!\\s)", "patterns": [ { "match": "(as|exposing)", "name": "keyword.control.elm" }, { "include": "#module_chunk" }, { "include": "#period" }, { "match": "\\s+", "name": "punctuation.spaces.elm" }, { "include": "#module-exports" } ] }, "module": { "begin": "^\\b((port |effect )?module)\\s+", "beginCaptures": { "1": { "name": "keyword.other.elm" } }, "end": "\\n(?!\\s)", "endCaptures": { "1": { "name": "keyword.other.elm" } }, "name": "meta.declaration.module.elm", "patterns": [ { "include": "#module_chunk" }, { "include": "#period" }, { "match": "(exposing)", "name": "keyword.other.elm" }, { "match": "\\s+", "name": "punctuation.spaces.elm" }, { "include": "#module-exports" } ] }, "string-triple": { "name": "string.quoted.triple.elm", "begin": "\"\"\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.elm" } }, "end": "\"\"\"", "endCaptures": { "0": { "name": "punctuation.definition.string.end.elm" } }, "patterns": [ { "match": "\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&]|x[0-9a-fA-F]{1,5})", "name": "constant.character.escape.elm" }, { "match": "\\^[A-Z@\\[\\]\\\\\\^_]", "name": "constant.character.escape.control.elm" } ] }, "string-quote": { "name": "string.quoted.double.elm", "begin": "\"", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.elm" } }, "end": "\"", "endCaptures": { "0": { "name": "punctuation.definition.string.end.elm" } }, "patterns": [ { "match": "\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&]|x[0-9a-fA-F]{1,5})", "name": "constant.character.escape.elm" }, { "match": "\\^[A-Z@\\[\\]\\\\\\^_]", "name": "constant.character.escape.control.elm" } ] }, "char": { "name": "string.quoted.single.elm", "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.char.begin.elm" } }, "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.char.end.elm" } }, "patterns": [ { "match": "\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&]|x[0-9a-fA-F]{1,5})", "name": "constant.character.escape.elm" }, { "match": "\\^[A-Z@\\[\\]\\\\\\^_]", "name": "constant.character.escape.control.elm" } ] }, "debug": { "match": "\\b(Debug)\\b", "name": "invalid.illegal.debug.elm" }, "module-exports": { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.parens.module-export.elm" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.parens.module-export.elm" } }, "name": "meta.declaration.exports.elm", "patterns": [ { "match": "\\b[a-z][a-zA-Z_'0-9]*", "name": "entity.name.function.elm" }, { "match": "\\b[A-Z][A-Za-z_'0-9]*", "name": "storage.type.elm" }, { "match": ",", "name": "punctuation.separator.comma.elm" }, { "match": "\\s+", "name": "punctuation.spaces.elm" }, { "include": "#comma" }, { "match": "\\(\\.\\.\\)", "name": "punctuation.parens.ellipses.elm" }, { "match": "\\.\\.", "name": "punctuation.parens.ellipses.elm" }, { "include": "#infix_op" }, { "comment": "So named because I don't know what to call this.", "match": "\\(.*?\\)", "name": "meta.other.unknown.elm" } ] }, "module_chunk": { "match": "[A-Z][a-zA-Z0-9_]*", "name": "support.module.elm" }, "period": { "match": "[.]", "name": "keyword.other.period.elm" }, "square_brackets": { "match": "[\\[\\]]", "name": "punctuation.definition.list.elm" }, "record-prefix": { "match": "([a-z][a-zA-Z0-9_]*)(\\.)([a-z][a-zA-Z0-9_]*)", "name": "record.accessor.elm", "captures": { "1": { "name": "record.name.elm" }, "2": { "name": "keyword.other.period.elm" }, "3": { "name": "entity.name.record.field.accessor.elm" } } }, "module-prefix": { "match": "([A-Z][a-zA-Z0-9_]*)(\\.)", "name": "meta.module.name.elm", "captures": { "1": { "name": "support.module.elm" }, "2": { "name": "keyword.other.period.elm" } } }, "constructor": { "match": "\\b[A-Z][a-zA-Z0-9_]*\\b", "name": "constant.type-constructor.elm" }, "value": { "match": "\\b[a-z][a-zA-Z0-9_]*\\b", "name": "meta.value.elm" }, "unit": { "match": "\\(\\)", "name": "constant.unit.elm" }, "top_level_value": { "match": "^[a-z][a-zA-Z0-9_]*\\b", "name": "entity.name.function.top_level.elm" }, "record-accessor": { "match": "(\\.)([a-z][a-zA-Z0-9_]*)", "name": "meta.record.accessor", "captures": { "1": { "name": "keyword.other.period.elm" }, "2": { "name": "entity.name.record.field.accessor.elm" } } }, "infix_op": { "match": "(|<\\?>|<\\||<=|\\|\\||&&|>=|\\|>|\\|=|\\|\\.|\\+\\+|::|/=|==|//|>>|<<|<|>|\\^|\\+|-|/|\\*)", "name": "keyword.operator.elm" }, "type-declaration": { "begin": "^(type\\s+)([A-Z][a-zA-Z0-9_']*)\\s+", "beginCaptures": { "1": { "name": "keyword.type.elm" }, "2": { "name": "storage.type.elm" } }, "end": "^(?=\\S)", "name": "meta.function.type-declaration.elm", "patterns": [ { "name": "meta.record.field.elm", "match": "^\\s*([A-Z][a-zA-Z0-9_]*)\\b", "captures": { "1": { "name": "constant.type-constructor.elm" } } }, { "match": "\\s+", "name": "punctuation.spaces.elm" }, { "name": "meta.record.field.elm", "match": "(\\=|\\|)\\s+([A-Z][a-zA-Z0-9_]*)\\b", "captures": { "1": { "name": "keyword.operator.assignment.elm" }, "2": { "name": "constant.type-constructor.elm" } } }, { "match": "\\=", "name": "keyword.operator.assignment.elm" }, { "match": "\\-\\>", "name": "keyword.operator.arrow.elm" }, { "include": "#module-prefix" }, { "match": "\\b[a-z][a-zA-Z0-9_]*\\b", "name": "variable.type.elm" }, { "match": "\\b[A-Z][a-zA-Z0-9_]*\\b", "name": "storage.type.elm" }, { "include": "#comments" }, { "include": "#type-record" } ] }, "type-alias-declaration": { "begin": "^(type\\s+)(alias\\s+)([A-Z][a-zA-Z0-9_']*)\\s+", "beginCaptures": { "1": { "name": "keyword.type.elm" }, "2": { "name": "keyword.type-alias.elm" }, "3": { "name": "storage.type.elm" } }, "end": "^(?=\\S)", "name": "meta.function.type-declaration.elm", "patterns": [ { "match": "\\n\\s+", "name": "punctuation.spaces.elm" }, { "match": "\\=", "name": "keyword.operator.assignment.elm" }, { "include": "#module-prefix" }, { "match": "\\b[A-Z][a-zA-Z0-9_]*\\b", "name": "storage.type.elm" }, { "match": "\\b[a-z][a-zA-Z0-9_]*\\b", "name": "variable.type.elm" }, { "include": "#comments" }, { "include": "#type-record" } ] }, "type-record": { "begin": "(\\{)", "beginCaptures": { "1": { "name": "punctuation.section.braces.begin" } }, "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.section.braces.end" } }, "name": "meta.function.type-record.elm", "patterns": [ { "match": "\\s+", "name": "punctuation.spaces.elm" }, { "match": "->", "name": "keyword.operator.arrow.elm" }, { "name": "meta.record.field.elm", "match": "([a-z][a-zA-Z0-9_]*)\\s+(\\:)", "captures": { "1": { "name": "entity.name.record.field.elm" }, "2": { "name": "keyword.other.elm" } } }, { "match": "\\,", "name": "punctuation.separator.comma.elm" }, { "include": "#module-prefix" }, { "match": "\\b[a-z][a-zA-Z0-9_]*\\b", "name": "variable.type.elm" }, { "match": "\\b[A-Z][a-zA-Z0-9_]*\\b", "name": "storage.type.elm" }, { "include": "#comments" }, { "include": "#type-record" } ] }, "type-signature": { "begin": "^(port\\s+)?([a-z_][a-zA-Z0-9_']*)\\s+(\\:)", "beginCaptures": { "1": { "name": "keyword.other.port.elm" }, "2": { "name": "entity.name.function.elm" }, "3": { "name": "keyword.other.colon.elm" } }, "end": "((^(?=[a-z]))|^$)", "name": "meta.function.type-declaration.elm", "patterns": [ { "include": "#type-signature-chunk" } ] }, "type-signature-chunk": { "patterns": [ { "match": "->", "name": "keyword.operator.arrow.elm" }, { "match": "\\s+", "name": "punctuation.spaces.elm" }, { "include": "#module-prefix" }, { "match": "\\b[a-z][a-zA-Z0-9_]*\\b", "name": "variable.type.elm" }, { "match": "\\b[A-Z][a-zA-Z0-9_]*\\b", "name": "storage.type.elm" }, { "match": "\\(\\)", "name": "constant.unit.elm" }, { "include": "#comma" }, { "include": "#parens" }, { "include": "#comments" }, { "include": "#type-record" } ] }, "glsl": { "begin": "(\\[)(glsl)(\\|)", "beginCaptures": { "1": { "name": "entity.glsl.bracket.elm" }, "2": { "name": "entity.glsl.name.elm" }, "3": { "name": "entity.glsl.bracket.elm" } }, "end": "(\\|\\])", "endCaptures": { "1": { "name": "entity.glsl.bracket.elm" } }, "name": "meta.embedded.block.glsl", "patterns": [ { "include": "source.glsl" } ] } } } ================================================ FILE: extensions/github1s/assets/pages/components.css ================================================ .vscode-button { border: none; display: inline-block; padding: 0 10px; height: 26px; line-height: 26px; font-size: 14px; outline: 1px solid transparent; outline-offset: 2px !important; color: var(--vscode-button-foreground); background: var(--vscode-button-background); cursor: pointer; } .vscode-button.loading { opacity: .5; } .vscode-button.size-mini { padding: 0 8px; height: 22px; line-height: 22px; font-size: 12px; } .vscode-button.size-middle { padding: 0 12px; height: 30px; line-height: 30px; font-size: 14px; } .vscode-button.size-large { padding: 0 14px; height: 34px; line-height: 34px; font-size: 18px; } .vscode-button:not([disabled]):hover { background: var(--vscode-button-hoverBackground); } .vscode-button:not([disabled]):focus { outline-color: var(--vscode-focusBorder); } .vscode-input { border: none; display: inline-block; padding: 0 4px; height: 26px; line-height: 26px; font-size: 13px; outline: 1px solid transparent; font-family: var(--vscode-font-family); color: var(--vscode-input-foreground); border: 1px solid var(--vscode-input-border, var(--vscode-widget-border)); background-color: var(--vscode-input-background); } .vscode-input.size-mini { padding: 0 2px; height: 22px; line-height: 22px; font-size: 12px; } .vscode-input.size-middle { padding: 0 4px; height: 30px; line-height: 30px; font-size: 13px; } .vscode-input.size-large { padding: 0 6px; height: 34px; line-height: 34px; font-size: 18px; } .vscode-input:not([disabled]):focus { outline-color: var(--vscode-focusBorder); outline: 1px solid -webkit-focus-ring-color; outline-offset: -1px; } .vscode-textarea { border: none; display: inline-block; outline: 1px solid transparent; font-family: var(--vscode-font-family); color: var(--vscode-input-foreground); border: 1px solid var(--vscode-input-background); background-color: var(--vscode-input-background); } .vscode-textarea:not([disabled]):focus { outline-color: var(--vscode-focusBorder); outline: 1px solid -webkit-focus-ring-color; outline-offset: -1px; } .vscode-loading { width: 100%; text-align: center; height: 26px; } .vscode-loading.align-left { text-align: left; } .vscode-loading.align-right { text-align: right; } .vscode-loading > span { height: 100%; width: 5px; display: inline-block; margin-right: 4px; background: var(--vscode-button-background); animation: vscodeLoading 1.2s infinite ease-in-out; } .vscode-loading > span:nth-child(2) { animation-delay: -1s; } .vscode-loading > span:nth-child(3) { animation-delay: -0.9s; } .vscode-loading > span:nth-child(4) { animation-delay: -0.8s; } .vscode-loading > span:nth-child(5) { animation-delay: -0.7s; } .vscode-loading > span:nth-child(6) { animation-delay: -0.6s; } .vscode-loading > span:nth-child(7) { animation-delay: -0.5s; } .vscode-loading > span:nth-child(8) { animation-delay: -0.4s; } .vscode-loading > span:nth-child(9) { animation-delay: -0.3s; } .vscode-loading > span:last-child { margin-right: 0 !important; } @keyframes vscodeLoading { 0% { transform: scaleY(0.4); } 25% { transform: scaleY(1); } 50% { transform: scaleY(0.4); } 75% { transform: scaleY(0.4); } 100% { transform: scaleY(0.4); } } .vscode-link { cursor: pointer; color: var(--vscode-textLink-foreground); text-decoration: underline; } .vscode-link:hover { color: var(--vscode-textLink-activeForeground); } .success-text { color: #89d185; } .warning-text { color: #cca700; } .error-text { color: #f48771; } ================================================ FILE: extensions/github1s/assets/pages/components.js ================================================ import { h } from './libraries/preact.module.js'; import htm from './libraries/htm.module.js'; export const html = htm.bind(h); export const VscodeButton = ({ size, loading, ...props }) => { const sizeClass = `size-${size || 'small'}`; const loadingClass = loading ? 'loading' : ''; const classes = `vscode-button ${sizeClass} ${loadingClass}`; return html`