Skip to content

Commit

Permalink
Merge pull request #272 from conwnet/master
Browse files Browse the repository at this point in the history
release 0.0.12
  • Loading branch information
conwnet authored Apr 2, 2021
2 parents 50f6005 + 6609cfa commit 9c91e5c
Show file tree
Hide file tree
Showing 68 changed files with 1,754 additions and 351 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/codacy-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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@master

- 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
max-allowed-issues: 2147483647

# 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
42 changes: 42 additions & 0 deletions .github/workflows/test-wtih-vscode-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build & Test with VS Code build

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04]
node-version: [14.x, 15.x]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
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
- uses: microsoft/playwright-github-action@v1
- run: yarn test:ci
46 changes: 33 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,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 [email protected]: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.
```

#### 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
yarn build:vscode
```

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

```bash
$ git clone [email protected]: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
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.
```

### ... or ... VS Code + Docker Development
Expand All @@ -84,10 +104,10 @@ You can use the VS Code plugin [Remote-Containers](https://marketplace.visualstu
5. Open a new VS Code Terminal, then you can run the `yarn` 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.
yarn
yarn watch
yarn serve # in another shell
# Then visit http://localhost:5000 or http://localhost:5000/conwnet/github1s once the build is completed.
```

### Format all codes
Expand All @@ -101,8 +121,8 @@ It uses `prettier` to format all possible codes.
## Build

```bash
$ yarn
$ yarn build
yarn
yarn build
```

## Feedback
Expand Down
12 changes: 8 additions & 4 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ Now you can visit http://localhost:5000 in the browser. If you get a 404 error f

## Watch Mode

What happens after you run `yarn watch`?
What happens after you run `yarn watch-with-vscode`?

1. Copy some necessary resources (`index.html`, extensions config, libraries, 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. 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.

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. 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.

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)
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)

5. Go to `extensions/github1s` and run `yarn watch`, it will trigger a new build if something has been changed.

Expand All @@ -59,6 +59,10 @@ Note that since we have modified the source code of VS Code, it may get into tro

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`?

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.

## 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).
Expand Down
61 changes: 55 additions & 6 deletions extensions/github1s/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,21 @@
"category": "GitHub1s",
"icon": "$(globe)"
},
{
"command": "github1s.editor-view-open-changes",
"title": "Open Changes",
"category": "GitHub1s",
"icon": "$(compare-changes)"
},
{
"command": "github1s.diff-view-open-left-file",
"title": "Open Left File",
"category": "GitHub1s",
"icon": {
"dark": "assets/icons/dark/open-left-file.svg",
"light": "assets/icons/light/open-left-file.svg"
}
},
"enablement": "isInDiffEditor && resourceScheme =~ /^github1s/ && resource =~ /^(?![^?]*\\?[^#]*(%26|\\b)base(=|%3D|%3d)github1s-empty-file)/"
},
{
"command": "github1s.diff-view-open-right-file",
Expand All @@ -144,7 +151,22 @@
"icon": {
"dark": "assets/icons/dark/open-right-file.svg",
"light": "assets/icons/light/open-right-file.svg"
}
},
"enablement": "isInDiffEditor && resourceScheme =~ /^github1s/ && resource =~ /^(?![^?]*\\?[^#]*(%26|\\b)head(=|%3D|%3d)github1s-empty-file)/"
},
{
"command": "github1s.editor-view-open-prev-revision",
"title": "Open Previous Revision",
"category": "GitHub1s",
"icon": "$(arrow-left)",
"enablement": "resourceScheme =~ /^github1s$/ && resource =~ /^(?![^?]*\\?[^#]*(%26|\\b)base(=|%3D|%3d)github1s-empty-file)/"
},
{
"command": "github1s.editor-view-open-next-revision",
"title": "Open Next Revision",
"category": "GitHub1s",
"icon": "$(arrow-right)",
"enablement": "resource =~ /^[^?]*\\?[^#]*(%26|\\b)hasNextRevision(=|%3D|%3d)true/"
}
],
"colors": [
Expand Down Expand Up @@ -220,13 +242,25 @@
"command": "github1s.commit-view-item-open-on-github",
"when": "false"
},
{
"command": "github1s.editor-view-open-changes",
"when": "false"
},
{
"command": "github1s.diff-view-open-left-file",
"when": "false"
},
{
"command": "github1s.diff-view-open-right-file",
"when": "false"
},
{
"command": "github1s.editor-view-open-prev-revision",
"when": "false"
},
{
"command": "github1s.editor-view-open-next-revision",
"when": "false"
}
],
"view/title": [
Expand Down Expand Up @@ -275,14 +309,29 @@
],
"editor/title": [
{
"command": "github1s.diff-view-open-left-file",
"when": "isInDiffEditor && resourceScheme =~ /^github1s/ && resource =~ /^[^?]*\\?[^#]*status(=|%3D|%3d)(?!added)/",
"command": "github1s.editor-view-open-changes",
"when": "!isInDiffEditor && github1s.context.showOpenChangesInEditorTitle",
"group": "navigation@1"
},
{
"command": "github1s.diff-view-open-right-file",
"when": "isInDiffEditor && resourceScheme =~ /^github1s/ && resource =~ /^[^?]*\\?[^#]*status(=|%3D|%3d)(?!removed)/",
"command": "github1s.diff-view-open-left-file",
"when": "isInDiffEditor",
"group": "navigation@2"
},
{
"command": "github1s.diff-view-open-right-file",
"when": "isInDiffEditor",
"group": "navigation@3"
},
{
"command": "github1s.editor-view-open-prev-revision",
"when": "resourceScheme =~ /^github1s/",
"group": "navigation@98"
},
{
"command": "github1s.editor-view-open-next-revision",
"when": "resourceScheme =~ /^github1s/",
"group": "navigation@99"
}
]
}
Expand Down
Loading

1 comment on commit 9c91e5c

@vercel
Copy link

@vercel vercel bot commented on 9c91e5c Apr 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.