diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e49d9314d..43eb59fe9 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,9 +2,8 @@ # [Choice] Node.js version: 14, 12, 10 ARG VARIANT="14-buster" -FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT} +FROM mcr.microsoft.com/devcontainers/typescript-node:${VARIANT} -# same package list from github1s/scripts/pre-install.sh RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends libx11-dev libxkbfile-dev libsecret-1-dev rsync @@ -13,7 +12,7 @@ RUN mkdir -p /opt/dev \ && cd /opt/dev \ && git clone https://github.com/emscripten-core/emsdk.git \ && cd /opt/dev/emsdk \ - && ./emsdk install 2.0.6 \ - && ./emsdk activate 2.0.6 + && ./emsdk install 3.1.21 \ + && ./emsdk activate 3.1.21 -ENV PATH="/opt/dev/emsdk:/opt/dev/emsdk/node/12.9.1_64bit/bin:/opt/dev/emsdk/upstream/emscripten:${PATH}" +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 index d0cddbe37..eef260001 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ "dockerfile": "Dockerfile", // Update 'VARIANT' to pick a Node version: 10, 12, 14 "args": { - "VARIANT": "12" + "VARIANT": "20-bullseye" } }, @@ -21,11 +21,11 @@ ], // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [5000], + "forwardPorts": [8080], // Use 'postCreateCommand' to run commands after the container is created. - //"postCreateCommand": "yarn", + //"postCreateCommand": "npm install", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "node", + "remoteUser": "node" } \ No newline at end of file diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 431d8b13d..000000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -**/node_modules/** -**/lib/vscode/** -**/dist/** -**/src/vs/** diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index e347ebdd3..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, - "extends": ["plugin:prettier/recommended"], - "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/workflows/build.yml b/.github/workflows/build.yml index 3ba06aca4..ed83fe6ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,31 +12,21 @@ jobs: build: strategy: matrix: - os: [ubuntu-20.04] - node-version: [14.x, 15.x] + os: [macos-14] + node-version: [24.x] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: + cache: 'npm' node-version: ${{ matrix.node-version }} - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn-${{ matrix.node-version }} - - - run: yarn --frozen-lockfile - - run: yarn eslint - - run: yarn build + - run: npm install + - run: npm run eslint + - run: npm run build - uses: microsoft/playwright-github-action@v1 - - run: yarn test:ci + - 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.yml b/.gitpod.yml index 13fb20587..f5a3e68c5 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -2,21 +2,18 @@ image: file: .gitpod.Dockerfile tasks: - init: | - yarn - yarn build - mkdir -p lib/vscode/out - sed -i 's/The Web Worker Extension Host did not start in 10s/The Web Worker Extension Host did not start in 60s/g' ./lib/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts - sed -i 's/}, 10000);/}, 60000);/g' ./lib/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts + npm install + npm run build command: | echo "=======================" - echo "Please run 'yarn watch'" + echo "Please run 'npm run watch'" echo "=======================" - command: | echo "===========================================================================" - echo "Please wait for 'yarn watch' to complete compilation, then run 'yarn serve'" + echo "Please wait for 'npm run watch' to complete compilation" echo "===========================================================================" ports: - - port: 5000 + - port: 8080 onOpen: open-browser github: prebuilds: 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 index 4fbb5a0a7..b26157438 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,4 +2,9 @@ lib dist out node_modules -**/src/vs/** +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 index 7779ecf43..aa5eda3cd 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,8 +1,9 @@ -module.exports = { +export default { tabWidth: 2, useTabs: true, semi: true, singleQuote: true, + printWidth: 120, overrides: [ { files: ['*.yml', '*.yaml', '*.json'], diff --git a/README.md b/README.md index 42aca6c96..1f4960174 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ For example, try it on the VS Code repo: ![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). @@ -24,11 +26,7 @@ javascript: window.location.href = window.location.href.replace(/github(1s)?.com ### Develop in the cloud -To edit files, run Docker containers, create pull requests and more, click the "[Gitpod](https://www.gitpod.io) ready-to-code" button at the bottom of your browser once you open your project with github1s. - -![Gitpod Notification](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/gitpod-notification.png) - -_Note_: If you already closed the notification, you can find a "Develop your project on Gitpod" button in the status bar. You can also open the Command Palette (default shortcut `Ctrl+Shift+P`) and choose `GitHub1s: Edit files in Gitpod`. +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) @@ -59,15 +57,35 @@ You can start an online development environment with [Gitpod](https://www.gitpod ### Local development -You need [these prerequisites (the same ones as for VS Code)](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for 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 @@ -81,19 +99,19 @@ You can use the VS Code plugin [Remote-Containers](https://marketplace.visualstu - 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 `yarn` commands listed above. +5. Open a new VS Code Terminal, then you can run the `npm install` commands listed above. ```bash -$ yarn -$ yarn watch -$ yarn serve # in another shell -$ # Then visit http://localhost:5000 or http://localhost:5000/conwnet/github1s once the build is completed. +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 -yarn format +npm run format ``` It uses `prettier` to format all possible codes. @@ -101,17 +119,15 @@ 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) -- If you have a question, [discuss on gitter](https://gitter.im/conwnet/github1s) - -## Project Sponsors +## Sponsors The continued development and maintenance of GitHub1s is made possible by these generous sponsors: @@ -119,50 +135,64 @@ The continued development and maintenance of GitHub1s is made possible by these - - + + +## 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). + + +
+
-## Third-party Related Projects +## Maintainers! :blush: -### Chrome Extensions + + + + + + +

netcon

💻 🖋

xcv58

💻 🖋

Siddhant Khare

💻 🖋
-- [chouglesaud/](https://github.com/chouglesaud)[repositree](https://github.com/chouglesaud/repositree) - [Chrome Web Store](https://chrome.google.com/webstore/detail/repositree/lafjldoccjnjlcmdhmniholdpjkbgajo) +## Stargazers over time -- [zulhfreelancer](https://github.com/zulhfreelancer)[Open in VS Code](https://chrome.google.com/webstore/detail/open-in-vs-code-github1sc/neloiopjjeflfnecdlajhopdlojlkhll) +[![Stargazers over time](https://api.star-history.com/svg?repos=conwnet/github1s&type=Date)](https://star-history.com/#conwnet/github1s&Date) -- [fhefh2015/GitHub1s_chrome_extension](https://github.com/fhefh2015/GitHub1s_chrome_extension) - [Chrome Web Store](https://chrome.google.com/webstore/detail/github1s/lodjfmkfbfkpdhnhkcdcoonghhghbkhe) +
+Third-party Related Projects +
-- [febaoshan/edge-extensions-github-code-viewer](https://github.com/febaoshan/edge-extensions-github-code-viewer) - [Chrome Web Store](https://chrome.google.com/webstore/detail/github-code-viewer/ecddapgifccgblebfibdgkagfbdagjfn) +### Chrome Extensions -- [Darkempire78/GitHub1s-Extension](https://github.com/Darkempire78/GitHub1s-Extension) -- [zvizvi/GitHub Web IDE](https://github.com/zvizvi/github-web-ide) - [Chrome Web Store](https://chrome.google.com/webstore/detail/adjiklnjodbiaioggfpbpkhbfcnhgkfe) -- [katsuhisa91/github1s-shortcut](https://github.com/katsuhisa91/github1s-shortcut) - [Chrome Web Store](https://chrome.google.com/webstore/detail/shortcut-to-github1s/gfcdbodapcbfckbfpmgeldfkkgjknceo) +- [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 -- [chouglesaud/](https://github.com/chouglesaud)[repositree](https://github.com/chouglesaud/repositree) - [Firefox Browser Addons](https://addons.mozilla.org/en-US/firefox/addon/repositree/) - -- [Darkempire78/GitHub1s-Extension](https://github.com/Darkempire78/GitHub1s-Extension) - [Firefox Browser Addons](https://addons.mozilla.org/firefox/addon/github1s-extension) -- [mcherifi/github1s-firefox-addon](https://github.com/mcherifi/github1s-firefox-addon) - [Firefox Browser Addons](https://addons.mozilla.org/firefox/addon/github1s/) -- [zvizvi/GitHub Web IDE](https://github.com/zvizvi/github-web-ide) - [Firefox Browser Addons](https://addons.mozilla.org/firefox/addon/github-web-ide/) +- [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 -- [febaoshan/edge-extensions-github-code-viewer](https://github.com/febaoshan/edge-extensions-github-code-viewer) -- [zvizvi/GitHub Web IDE](https://github.com/zvizvi/github-web-ide) - [Edge Add-ons Store](https://microsoftedge.microsoft.com/addons/detail/akjbkjciknacicbnkfjbnlaeednpadcf) +- [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)) -### Tampermonkey scripts +### Safari Extension -- [Mr-B0b/TamperMonkeyScripts/vscode.js](https://github.com/Mr-B0b/TamperMonkeyScripts/blob/main/vscode.js) +- [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)) -### Maintainers! :blush: +### Tampermonkey scripts - - - - - - -

netcon

💻 🖋

xcv58

💻 🖋

Siddhant Khare

💻 🖋
+- [Mr-B0b/TamperMonkeyScripts/vscode.js](https://github.com/Mr-B0b/TamperMonkeyScripts/blob/main/vscode.js) +
diff --git a/docs/guide.md b/docs/guide.md index 505eac4fc..4c30e8934 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -1,6 +1,6 @@ # How it works -GitHub1s is based on [VS Code 1.52.1](https://github.com/microsoft/vscode/tree/1.52.1) 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). +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. @@ -12,7 +12,7 @@ _We may switch to the GitHub GraphQL API for more friendly user experience in th ~~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 [Vercel](https://vercel.com/) now for minimize delays in loading and better developer experience. Thanks for the wonderful service provide by Vercel. +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 @@ -26,39 +26,49 @@ So, if you meet some problems when you use GitHub1s, even if you are using newer 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 -$ yarn -$ yarn watch # or yarn build, it may take minutes, wait please +$ npm install +$ npm run watch ``` -Then, there will be a new directory named `dist` generated in the project root. You can run `yarn serve` in another shell, and it will create a static file server for the `dist` directory. +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. -Now you can visit http://localhost:5000 in the browser. If you get a 404 error for some static files, please wait a minute for the building to complete. +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 `yarn watch`? +What happens after you run `npm run watch-with-vscode`? -1. Copy some necessary resources (`index.html`, extensions config, libraries, etc.) to the `dist` directory. +1. Copy some necessary resources (`index.html`, `favicons.ico`, etc.) to the `dist` directory. -2. Go to `lib/vscode` and run `yarn gulp compile-web` to build the necessary extensions, then copy it to the `dist/extensions` 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. Go to `lib/vscode` and run `yarn watch` (the native watch of vscode), it will trigger a new build if something in it has been changed. +3. Redirect vscode-web static requests (vscode, extensisions, dependencies) to `vscode-web/lib/vscode` which should be generated by vscode compile process. -4. Watch the `src` directory, merge it in to `lib/vscode/src` if something in it has been changed. (When a new file is merged into `lib/vscode/src`, it will trigger the watcher that is described in Step 3) +You should also compile the vscode manually in another terminal. -5. Go to `extensions/github1s` and run `yarn watch`, it will trigger a new build if something has been changed. +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. -6. Watch the `extensions` directory and the `lib/vscode/out` directory, merge them into the `dist` directory if something changed in them. +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). @@ -69,6 +79,8 @@ Put simply, we build the necessary code and do a minify. The minify script is mo - `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. diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..0cc42d3dd --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,17 @@ +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', + }, + }, +]; diff --git a/extensions/dart-web/LICENSE b/extensions/dart-web/LICENSE deleted file mode 100644 index 1a4f6b68c..000000000 --- a/extensions/dart-web/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Danny Tuppeny - -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. \ No newline at end of file diff --git a/extensions/dart-web/README.md b/extensions/dart-web/README.md deleted file mode 100644 index ee961bf05..000000000 --- a/extensions/dart-web/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[![Discord Chat](https://img.shields.io/badge/chat-discord-blue.svg)](https://discord.gg/xSTPEqm) -[![Gitter Chat](https://img.shields.io/badge/chat-gitter-blue.svg)](https://gitter.im/dart-code/Dart-Code) -[![Follow on Twitter](https://img.shields.io/badge/twitter-dartcode-blue.svg)](https://twitter.com/DartCode) -[![Contribute to Dart Code](https://img.shields.io/badge/help-contribute-551A8B.svg)](https://github.com/Dart-Code/Dart-Code/blob/master/CONTRIBUTING.md) - -# This extension is a fork from [Dart-Code](https://github.com/Dart-Code/Dart-Code) for github1s. - -# At present only languages features is reserved - -# I have deleted some files and only reserved the necessary code - -## Introduction - -Dart Code extends [VS Code](https://code.visualstudio.com/) with support for the -[Dart](https://www.dartlang.org/) programming language and for [Flutter](https://flutter.dev/) -mobile apps, and [AngularDart](https://angulardart.org) web apps. - -## Installation - -Dart Code can be [installed from the Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code) or by [searching within VS Code](https://code.visualstudio.com/docs/editor/extension-gallery#_search-for-an-extension). - -## Features - -- Syntax highlighting -- Workspace symbol search -- Document symbol search -- Snippets - -## Release Notes - -For full release notes, see [the changelog](https://dartcode.org/releases/). diff --git a/extensions/dart-web/media/dart.png b/extensions/dart-web/media/dart.png deleted file mode 100755 index d091c28f0..000000000 Binary files a/extensions/dart-web/media/dart.png and /dev/null differ diff --git a/extensions/dart-web/package.json b/extensions/dart-web/package.json deleted file mode 100644 index e0dc7cca3..000000000 --- a/extensions/dart-web/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "dart-code", - "displayName": "Dart", - "description": "Dart language support and debugger for Visual Studio Code.", - "version": "3.20.0-dev", - "publisher": "Dart-Code", - "engines": { - "vscode": "^1.52.0" - }, - "license": "SEE LICENSE IN LICENSE", - "bugs": { - "url": "https://github.com/Dart-Code/Dart-Code/issues" - }, - "homepage": "https://dartcode.org/", - "repository": { - "type": "git", - "url": "https://github.com/Dart-Code/Dart-Code.git" - }, - "categories": [ - "Programming Languages", - "Snippets", - "Linters", - "Formatters", - "Debuggers" - ], - "keywords": [ - "dart", - "flutter", - "fuchsia", - "multi-root ready" - ], - "icon": "media/dart.png", - "activationEvents": [ - "onLanguage:dart" - ], - "contributes": { - "languages": [ - { - "id": "dart", - "extensions": [ - ".dart" - ], - "aliases": [ - "Dart" - ], - "configuration": "./syntaxes/dart-language-configuration.json" - } - ], - "grammars": [ - { - "language": "dart", - "scopeName": "source.dart", - "path": "./syntaxes/dart.json" - } - ], - "colors": [ - { - "id": "dart.closingLabels", - "description": "The color of the 'closing label' annotations shown against constructor, method invocations and lists that span multiple lines. If not supplied, the color for 'tab.inactiveForeground' will be used.", - "defaults": { - "dark": "tab.inactiveForeground", - "light": "tab.inactiveForeground", - "highContrast": "tab.inactiveForeground" - } - } - ], - "semanticTokenScopes": [ - { - "language": "dart", - "scopes": { - "keyword": [ - "keyword" - ], - "keyword.control": [ - "keyword.control" - ], - "property.declaration": [ - "entity.name.function.member" - ] - } - } - ], - "configurationDefaults": { - "[dart]": { - "editor.tabSize": 2, - "editor.insertSpaces": true, - "editor.detectIndentation": false, - "editor.suggest.insertMode": "replace" - } - } - }, - "scripts": { - "compile": "echo done", - "watch": "echo done" - } -} diff --git a/extensions/dart-web/snippets/dart.json b/extensions/dart-web/snippets/dart.json deleted file mode 100644 index 7e2541e3c..000000000 --- a/extensions/dart-web/snippets/dart.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - ".source.dart": { - "main": { - "prefix": "main", - "description": "Insert a main function, used as an entry point.", - "body": ["main(List args) {", " $0", "}"] - }, - "try": { - "prefix": "try", - "description": "Insert a try/catch block.", - "body": ["try {", " $0", "} catch (${1:e}) {", "}"] - }, - "if": { - "prefix": "if", - "description": "Insert an if statement.", - "body": ["if ($1) {", " $0", "}"] - }, - "if else": { - "prefix": "ife", - "description": "Insert an if statement with an else block.", - "body": ["if ($1) {", " $0", "} else {", "}"] - }, - "switch case": { - "prefix": "switch", - "description": "Insert a switch statement.", - "body": [ - "switch ($1) {", - " case $2:", - " $0", - " break;", - " default:", - "}" - ] - }, - "for": { - "prefix": "for", - "description": "Insert a for loop.", - "body": ["for (var i = 0; i < ${1:count}; i++) {", " $0", "}"] - }, - "for in": { - "prefix": "fori", - "description": "Insert a for-in loop.", - "body": ["for (var ${1:item} in ${2:items}) {", " $0", "}"] - }, - "while": { - "prefix": "while", - "description": "Insert a while loop.", - "body": ["while ($1) {", " $0", "}"] - }, - "do while": { - "prefix": "do", - "description": "Insert a do-while loop.", - "body": ["do {", " $0", "} while ($1);"] - }, - "fun": { - "prefix": "fun", - "description": "Insert a function definition.", - "body": ["${3:void} ${1:name}(${2:args}) {", " $0", "}"] - }, - "class": { - "prefix": "class", - "description": "Insert a class definition.", - "body": ["class ${1:Name} {", " $0", "}"] - }, - "typedef": { - "prefix": "typedef", - "description": "Insert a typedef.", - "body": "typedef ${1:Type} ${2:Name}(${3:params});" - }, - "test": { - "prefix": "test", - "description": "Insert a test block.", - "body": ["test('$1', () {", " $0", "});"] - }, - "group": { - "prefix": "group", - "description": "Insert a test group block.", - "body": ["group('$1', () {", " $0", "});"] - } - } -} diff --git a/extensions/dart-web/snippets/flutter.json b/extensions/dart-web/snippets/flutter.json deleted file mode 100644 index 3c09049c3..000000000 --- a/extensions/dart-web/snippets/flutter.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - ".source.dart": { - "Flutter stateless widget": { - "prefix": "stless", - "description": "Insert a StatelessWidget", - "body": [ - "class $1 extends StatelessWidget {", - " @override", - " Widget build(BuildContext context) {", - " return Container(", - " $2", - " );", - " }", - "}" - ] - }, - "Flutter stateful widget": { - "prefix": "stful", - "description": "Insert a StatefulWidget", - "body": [ - "class $1 extends StatefulWidget {", - " @override", - " _$1State createState() => _$1State();", - "}", - "", - "class _$1State extends State<$1> {", - " @override", - " Widget build(BuildContext context) {", - " return Container(", - " $2", - " );", - " }", - "}" - ] - }, - "Flutter widget with AnimationController": { - "prefix": "stanim", - "description": "Insert a StatefulWidget with an AnimationController", - "body": [ - "class $1 extends StatefulWidget {", - " @override", - " _$1State createState() => _$1State();", - "}", - "", - "class _$1State extends State<$1>", - " with SingleTickerProviderStateMixin {", - " AnimationController _controller;", - "", - " @override", - " void initState() {", - " super.initState();", - " _controller = AnimationController(vsync: this);", - " }", - "", - " @override", - " void dispose() {", - " super.dispose();", - " _controller.dispose();", - " }", - "", - " @override", - " Widget build(BuildContext context) {", - " return Container(", - " $2", - " );", - " }", - "}" - ] - } - } -} diff --git a/extensions/dart-web/syntaxes/dart-language-configuration.json b/extensions/dart-web/syntaxes/dart-language-configuration.json deleted file mode 100644 index 171fa5beb..000000000 --- a/extensions/dart-web/syntaxes/dart-language-configuration.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "comments": { - "lineComment": "//", - "blockComment": ["/*", "*/"] - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - "autoClosingPairs": [{ - "open": "{", - "close": "}" - }, - { - "open": "[", - "close": "]" - }, - { - "open": "(", - "close": ")" - }, - { - "open": "'", - "close": "'", - "notIn": ["string", "comment"] - }, - { - "open": "\"", - "close": "\"", - "notIn": ["string"] - }, - { - "open": "`", - "close": "`", - "notIn": ["string", "comment"] - }, - { - "open": "/**", - "close": " */", - "notIn": ["string"] - } - ], - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["<", ">"], - ["'", "'"], - ["\"", "\""], - ["`", "`"] - ] -} \ No newline at end of file diff --git a/extensions/dart-web/syntaxes/dart.json b/extensions/dart-web/syntaxes/dart.json deleted file mode 100644 index d8b255cd1..000000000 --- a/extensions/dart-web/syntaxes/dart.json +++ /dev/null @@ -1,436 +0,0 @@ -{ - "fileTypes": ["dart"], - "foldingStartMarker": "\\{\\s*$", - "foldingStopMarker": "^\\s*\\}", - "name": "Dart", - "patterns": [ - { - "match": "^(#!.*)$", - "name": "meta.preprocessor.script.dart" - }, - { - "begin": "^\\w*\\b(library|import|part of|part|export)\\b", - "beginCaptures": { - "0": { - "name": "keyword.other.import.dart" - } - }, - "end": ";", - "endCaptures": { - "0": { - "name": "punctuation.terminator.dart" - } - }, - "name": "meta.declaration.dart", - "patterns": [ - { - "include": "#strings" - }, - { - "include": "#comments" - }, - { - "match": "\\b(as|show|hide)\\b", - "name": "keyword.other.import.dart" - } - ] - }, - { - "include": "#comments" - }, - { - "include": "#punctuation" - }, - { - "include": "#annotations" - }, - { - "include": "#keywords" - }, - { - "include": "#constants-and-special-vars" - }, - { - "include": "#strings" - } - ], - "repository": { - "dartdoc": { - "patterns": [ - { - "match": "(\\[.*?\\])", - "captures": { - "0": { - "name": "variable.name.source.dart" - } - } - }, - { - "match": "^ {4,}(?![ \\*]).*", - "captures": { - "0": { - "name": "variable.name.source.dart" - } - } - }, - { - "begin": "```.*?$", - "end": "```", - "contentName": "variable.other.source.dart" - }, - { - "match": "(`.*?`)", - "captures": { - "0": { - "name": "variable.other.source.dart" - } - } - }, - { - "match": "(`.*?`)", - "captures": { - "0": { - "name": "variable.other.source.dart" - } - } - }, - { - "match": "(\\* (( ).*))$", - "captures": { - "2": { - "name": "variable.other.source.dart" - } - } - }, - { - "match": "(\\* .*)$" - } - ] - }, - "comments": { - "patterns": [ - { - "captures": { - "0": { - "name": "punctuation.definition.comment.dart" - } - }, - "match": "/\\*\\*/", - "name": "comment.block.empty.dart" - }, - { - "include": "#comments-doc-oldschool" - }, - { - "include": "#comments-doc" - }, - { - "include": "#comments-inline" - } - ] - }, - "comments-doc-oldschool": { - "patterns": [ - { - "begin": "/\\*\\*", - "end": "\\*/", - "name": "comment.block.documentation.dart", - "patterns": [ - { - "include": "#comments-doc-oldschool" - }, - { - "include": "#comments-block" - }, - { - "include": "#dartdoc" - } - ] - } - ] - }, - "comments-doc": { - "patterns": [ - { - "begin": "///", - "while": "^\\s*///", - "patterns": [ - { - "include": "#dartdoc" - } - ], - "name": "comment.block.documentation.dart" - } - ] - }, - "comments-inline": { - "patterns": [ - { - "include": "#comments-block" - }, - { - "captures": { - "1": { - "name": "comment.line.double-slash.dart" - } - }, - "match": "((//).*)$" - } - ] - }, - "comments-block": { - "patterns": [ - { - "begin": "/\\*", - "end": "\\*/", - "name": "comment.block.dart", - "patterns": [ - { - "include": "#comments-block" - } - ] - } - ] - }, - "annotations": { - "patterns": [ - { - "match": "@[a-zA-Z]+", - "name": "storage.type.annotation.dart" - } - ] - }, - "constants-and-special-vars": { - "patterns": [ - { - "match": "(?)", - "captures": { - "1": { - "name": "entity.name.function.dart" - } - } - } - ] - }, - "keywords": { - "patterns": [ - { - "match": "(?>>?|~|\\^|\\||&)", - "name": "keyword.operator.bitwise.dart" - }, - { - "match": "((&|\\^|\\||<<|>>>?)=)", - "name": "keyword.operator.assignment.bitwise.dart" - }, - { - "match": "(=>)", - "name": "keyword.operator.closure.dart" - }, - { - "match": "(==|!=|<=?|>=?)", - "name": "keyword.operator.comparison.dart" - }, - { - "match": "(([+*/%-]|\\~)=)", - "name": "keyword.operator.assignment.arithmetic.dart" - }, - { - "match": "(=)", - "name": "keyword.operator.assignment.dart" - }, - { - "match": "(\\-\\-|\\+\\+)", - "name": "keyword.operator.increment-decrement.dart" - }, - { - "match": "(\\-|\\+|\\*|\\/|\\~\\/|%)", - "name": "keyword.operator.arithmetic.dart" - }, - { - "match": "(!|&&|\\|\\|)", - "name": "keyword.operator.logical.dart" - }, - { - "match": "(? \ No newline at end of file diff --git a/extensions/github1s/assets/icons/dark/open-blame.svg b/extensions/github1s/assets/icons/dark/open-blame.svg new file mode 100644 index 000000000..4f3790514 --- /dev/null +++ b/extensions/github1s/assets/icons/dark/open-blame.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/extensions/github1s/assets/icons/light/close-blame.svg b/extensions/github1s/assets/icons/light/close-blame.svg new file mode 100644 index 000000000..b7dc9c026 --- /dev/null +++ b/extensions/github1s/assets/icons/light/close-blame.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/extensions/github1s/assets/icons/light/open-blame.svg b/extensions/github1s/assets/icons/light/open-blame.svg new file mode 100644 index 000000000..00300397b --- /dev/null +++ b/extensions/github1s/assets/icons/light/open-blame.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/extensions/github1s/assets/pages/assets/github.svg b/extensions/github1s/assets/pages/assets/github.svg new file mode 100644 index 000000000..db1ebe1be --- /dev/null +++ b/extensions/github1s/assets/pages/assets/github.svg @@ -0,0 +1,4 @@ + + diff --git a/extensions/github1s/assets/pages/assets/gitlab.svg b/extensions/github1s/assets/pages/assets/gitlab.svg new file mode 100644 index 000000000..8cca7d76f --- /dev/null +++ b/extensions/github1s/assets/pages/assets/gitlab.svg @@ -0,0 +1,7 @@ + + diff --git a/extensions/github1s/assets/pages/components.css b/extensions/github1s/assets/pages/components.css new file mode 100644 index 000000000..4932fc33d --- /dev/null +++ b/extensions/github1s/assets/pages/components.css @@ -0,0 +1,202 @@ +.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; +} diff --git a/extensions/github1s/assets/pages/components.js b/extensions/github1s/assets/pages/components.js new file mode 100644 index 000000000..ad73142b2 --- /dev/null +++ b/extensions/github1s/assets/pages/components.js @@ -0,0 +1,74 @@ +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`