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 index e755360c4..7abad0aae 100644 --- a/.github/workflows/codacy-analysis.yaml +++ b/.github/workflows/codacy-analysis.yaml @@ -12,23 +12,26 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@master + uses: actions/checkout@v4 - name: Run Codacy Analysis CLI uses: codacy/codacy-analysis-cli-action@master with: - output: results.sarif - format: sarif - # Adjust severity of non-security issues - gh-code-scanning-compat: true - # Force 0 exit code to allow SARIF file generation - # This will handover control about PR rejection to the GitHub side + # 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 - # Upload the SARIF file generated in the previous step - - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@main - with: - sarif_file: results.sarif + # 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 index 8fa811d6b..d04876a72 100644 --- a/.github/workflows/test-wtih-vscode-build.yml +++ b/.github/workflows/test-wtih-vscode-build.yml @@ -9,34 +9,33 @@ on: - master jobs: - build: + build-with-vscode-build: + permissions: + contents: read + 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 + with: + persist-credentials: false - 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 build:vscode - - run: yarn yalc && yarn build + - 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: yarn test:ci + - 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 e784cce0b..f5a3e68c5 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -2,18 +2,18 @@ image: file: .gitpod.Dockerfile tasks: - init: | - yarn - yarn build + 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 e7d0610c2..b26157438 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,5 +2,9 @@ lib dist out node_modules -vscode-web-github1s/src/vs -vscode-web-github1s/extensions +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 3c2b905ab..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). @@ -58,10 +60,10 @@ You can start an online development environment with [Gitpod](https://www.gitpod ```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. +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 @@ -73,17 +75,17 @@ To verify the build: ```bash cd github1s -yarn build:vscode +npm run build:vscode ``` -After the inital successful build, you could use the watch mode: +After the initial successful build, you could use the watch mode: ```bash cd github1s -yarn -yarn watch-with-vscode -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-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 @@ -97,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. @@ -117,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: @@ -135,23 +135,46 @@ 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: + + + + + + + +

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)) -- [Open in VS Code](https://chrome.google.com/webstore/detail/open-in-vs-code-github1sc/neloiopjjeflfnecdlajhopdlojlkhll) by [zulhfreelancer](https://github.com/zulhfreelancer) -- [GitHub1s](https://chrome.google.com/webstore/detail/github1s/lodjfmkfbfkpdhnhkcdcoonghhghbkhe) ([fhefh2015/GitHub1s_chrome_extension](https://github.com/fhefh2015/GitHub1s_chrome_extension)) - [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) +- [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 @@ -172,17 +195,4 @@ The continued development and maintenance of GitHub1s is made possible by these ### Tampermonkey scripts - [Mr-B0b/TamperMonkeyScripts/vscode.js](https://github.com/Mr-B0b/TamperMonkeyScripts/blob/main/vscode.js) - -## Maintainers! :blush: - - - - - - - -

netcon

💻 🖋

xcv58

💻 🖋

Siddhant Khare

💻 🖋
- -## Stargazers over time - -[![Stargazers over time](https://starchart.cc/conwnet/github1s.svg)](https://starchart.cc/conwnet/github1s) +
diff --git a/api/github-auth-callback/index.js b/api/github-auth-callback/index.js deleted file mode 100644 index a1db0ebcf..000000000 --- a/api/github-auth-callback/index.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file github auth callback - * @author netcon - */ - -const got = require('got'); - -const CLIENT_ID = process.env.GITHUB_OAUTH_ID || ''; -const CLIENT_SECRET = process.env.GITHUB_OAUTH_SECRET || ''; -// allow origins should split by ',' -const ALLOWED_ORIGINS = process.env.ALLOWED_ORIGINS || ''; - -// return the data to the opener window by postMessage API, -// and close current window then -const getResponseHtml = (dataStr) => ` - -`; - -const MISSING_CODE_ERROR = { - error: 'request_invalid', - error_description: 'Missing code', -}; -const UNKNOWN_ERROR = { - error: 'internal_error', - error_description: 'Unknown error', -}; - -module.exports = async (req, res) => { - const code = req.query.code; - const sendResponseHtml = (status, data) => { - res.status(status); - const responseData = { type: 'authorizing', payload: data }; - res.send(getResponseHtml(JSON.stringify(responseData))); - }; - - if (!code) { - return sendResponseHtml(401, MISSING_CODE_ERROR); - } - - try { - // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github - const response = await got.post( - 'https://github.com/login/oauth/access_token', - { - json: { client_id: CLIENT_ID, client_secret: CLIENT_SECRET, code }, - responseType: 'json', - } - ); - return sendResponseHtml(response.statusCode, response.body); - } catch (e) { - // the error is responded by GitHub - if (e.response) { - return sendResponseHtml(e.response.statusCode, e.response.body); - } - return sendResponseHtml(500, UNKNOWN_ERROR); - } -}; diff --git a/api/github-auth-callback/package.json b/api/github-auth-callback/package.json deleted file mode 100644 index 3b69c9330..000000000 --- a/api/github-auth-callback/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "github-auth-callback", - "version": "0.0.0", - "main": "index.js", - "license": "MIT", - "private": true, - "dependencies": { - "got": "^11.8.2" - } -} diff --git a/api/github-auth-callback/yarn.lock b/api/github-auth-callback/yarn.lock deleted file mode 100644 index b0648e453..000000000 --- a/api/github-auth-callback/yarn.lock +++ /dev/null @@ -1,204 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@sindresorhus/is@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.0.1.tgz#d26729db850fa327b7cacc5522252194404226f5" - integrity sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g== - -"@szmarczak/http-timer@^4.0.5": - version "4.0.5" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.5.tgz#bfbd50211e9dfa51ba07da58a14cdfd333205152" - integrity sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ== - dependencies: - defer-to-connect "^2.0.0" - -"@types/cacheable-request@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.1.tgz#5d22f3dded1fd3a84c0bbeb5039a7419c2c91976" - integrity sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ== - dependencies: - "@types/http-cache-semantics" "*" - "@types/keyv" "*" - "@types/node" "*" - "@types/responselike" "*" - -"@types/http-cache-semantics@*": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" - integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A== - -"@types/keyv@*": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7" - integrity sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw== - dependencies: - "@types/node" "*" - -"@types/node@*": - version "15.0.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.2.tgz#51e9c0920d1b45936ea04341aa3e2e58d339fb67" - integrity sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA== - -"@types/responselike@*", "@types/responselike@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" - integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== - dependencies: - "@types/node" "*" - -cacheable-lookup@^5.0.3: - version "5.0.4" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" - integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== - -cacheable-request@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.1.tgz#062031c2856232782ed694a257fa35da93942a58" - integrity sha512-lt0mJ6YAnsrBErpTMWeu5kl/tg9xMAWjavYTN6VQXM1A/teBITuNcccXsCxF0tDQQJf9DfAaX5O4e0zp0KlfZw== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^4.0.0" - lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^2.0.0" - -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= - dependencies: - mimic-response "^1.0.0" - -decompress-response@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" - integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== - dependencies: - mimic-response "^3.1.0" - -defer-to-connect@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" - integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== - -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -got@^11.8.2: - version "11.8.2" - resolved "https://registry.yarnpkg.com/got/-/got-11.8.2.tgz#7abb3959ea28c31f3576f1576c1effce23f33599" - integrity sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ== - dependencies: - "@sindresorhus/is" "^4.0.0" - "@szmarczak/http-timer" "^4.0.5" - "@types/cacheable-request" "^6.0.1" - "@types/responselike" "^1.0.0" - cacheable-lookup "^5.0.3" - cacheable-request "^7.0.1" - decompress-response "^6.0.0" - http2-wrapper "^1.0.0-beta.5.2" - lowercase-keys "^2.0.0" - p-cancelable "^2.0.0" - responselike "^2.0.0" - -http-cache-semantics@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - -http2-wrapper@^1.0.0-beta.5.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" - integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== - dependencies: - quick-lru "^5.1.1" - resolve-alpn "^1.0.0" - -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - -keyv@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.0.3.tgz#4f3aa98de254803cafcd2896734108daa35e4254" - integrity sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA== - dependencies: - json-buffer "3.0.1" - -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - -mimic-response@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - -mimic-response@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" - integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== - -normalize-url@^4.1.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" - integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== - -once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -p-cancelable@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" - integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -quick-lru@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" - integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== - -resolve-alpn@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.1.2.tgz#30b60cfbb0c0b8dc897940fe13fe255afcdd4d28" - integrity sha512-8OyfzhAtA32LVUsJSke3auIyINcwdh5l3cvYKdKO0nvsYSKuiLfTM5i78PJswFPT8y6cPW+L1v6/hE95chcpDA== - -responselike@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723" - integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw== - dependencies: - lowercase-keys "^2.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= diff --git a/api/static-fallback/index.js b/api/static-fallback/index.js deleted file mode 100644 index 32c04b7c3..000000000 --- a/api/static-fallback/index.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @file static files not found fallback - * According to the config in vercel.json, we cached the - * static files with `max-age=X` header, but we may get 404 - * response durning deploying, the default behavior for vercel - * would add the cache header to this 404 response, which caused - * the user can not get right resources anymore. so we should - * fallback to here and clear the cache header for such 404 requests. - * See also: https://github.com/conwnet/github1s/issues/299 - * @author netcon - */ - -module.exports = async (req, res) => { - res.status(404); - res.setHeader('Cache-Control', 'no-store'); - res.send('Not Found'); -}; diff --git a/docs/guide.md b/docs/guide.md index 3c559620c..4c30e8934 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -1,6 +1,6 @@ # How it works -GitHub1s is based on [VS Code 1.55.0](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,42 +26,48 @@ 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-with-vscode`? +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 `vscode-web-github1s/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 `vscode-web-github1s/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 `vscode-web-github1s/src` directory, merge it in to `vscode-web-github1s/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 `yarn watch`? +What happens after you run `npm run watch`? -It's the same procedure as `yarn watch-with-vscode` without the step 2, 3, and 4. Instead of the local VS Code, it uses the prebuilt [@github1s/vscode-web](https://www.npmjs.com/package/@github1s/vscode-web) version. +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 @@ -73,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": "(? + 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`