Skip to content

Commit

Permalink
chore: bump vscode to 1.96.2 (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
conwnet authored Jan 11, 2025
1 parent 2b2ab3c commit 9b593c6
Show file tree
Hide file tree
Showing 118 changed files with 22,303 additions and 12,959 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"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"
Expand Down
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

69 changes: 0 additions & 69 deletions .eslintrc.json

This file was deleted.

26 changes: 8 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,21 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04]
os: [macos-14]
node-version: [20.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: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} yarn test:ci
- run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} npm run test:ci
29 changes: 9 additions & 20 deletions .github/workflows/test-wtih-vscode-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,21 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04]
node-version: [20.16.0]
os: [macos-14]
node-version: [20.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: sudo apt update && sudo apt install -y libkrb5-dev
- run: yarn --frozen-lockfile
- run: yarn build:vscode
- run: yarn yalc && yarn build
- run: npm install && cd vscode-web && npm install
- run: cd vscode-web && npm run clone && npm run build
- run: npm run link & npm run build
- uses: microsoft/playwright-github-action@v1
- run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} yarn test:ci
- run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} npm run test:ci
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ lib
dist
out
node_modules
.yalc
yalc.lock
yarn-error.log
8 changes: 4 additions & 4 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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: 8080
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
npx lint-staged
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ vscode-web/extensions
htm.module.js
preact.module.js
preact-hooks.module.js
index.html
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
tabWidth: 2,
useTabs: true,
semi: true,
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ 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
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.
```
Expand All @@ -75,15 +75,15 @@ To verify the build:

```bash
cd github1s
yarn build:vscode
npm run build:vscode
```

After the initial successful build, you could use the watch mode:

```bash
cd github1s
yarn
yarn watch-with-vscode
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.
```
Expand All @@ -99,28 +99,28 @@ 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
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.

## Build

```bash
yarn
yarn build
npm install
npm run build
```

## Feedback
Expand Down
32 changes: 20 additions & 12 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. The `yarn watch:dev-server` (part of `yarn watch` command) will automatically open http://localhost:8080 in the browser.
Then, there will be a new directory named `dist` generated in the project root. The `npm run watch:dev-server` (part of `npm run watch` command) will automatically open http://localhost:8080 in the browser.

If you get a 404 error for some static files, please wait a minute for the building to complete.

## Watch Mode

What happens after you run `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/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/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/src` directory, merge it in to `vscode-web/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

Expand All @@ -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.
17 changes: 17 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -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',
},
},
];
7 changes: 4 additions & 3 deletions extensions/github1s/assets/pages/github1s-authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const AuthenticationFeatures = () => {
return html`
<ul class="authentication-features">
${(pageConfig.authenticationFeatures || []).map(
(feature) => html`<li class="feature-item">
<a class="link" href=${feature.link} target="_blank" rel="noopener noreferrer">${feature.text}</a>
</li>`
(feature) =>
html`<li class="feature-item">
<a class="link" href=${feature.link} target="_blank" rel="noopener noreferrer">${feature.text}</a>
</li>`,
)}
</ul>
`;
Expand Down
Loading

0 comments on commit 9b593c6

Please sign in to comment.