From 4ba1725cf23820851bd184d46a469ead41a0d289 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jan 2022 23:04:16 +0800 Subject: [PATCH 1/8] chore(deps): bump follow-redirects from 1.14.3 to 1.14.7 (#382) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.3 to 1.14.7. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.3...v1.14.7) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b52d2b244..35fcb8ff0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -858,9 +858,9 @@ flatted@^3.1.0: integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== follow-redirects@^1.0.0, follow-redirects@^1.14.0: - version "1.14.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.3.tgz#6ada78118d8d24caee595595accdc0ac6abd022e" - integrity sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw== + version "1.14.7" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" + integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== from@~0: version "0.1.7" From bf20e117c9dd5f2153433dd51ecd10bd9d94d5d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jan 2022 22:33:10 +0530 Subject: [PATCH 2/8] chore(deps): bump follow-redirects from 1.14.3 to 1.14.7 in /tests (#383) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.3 to 1.14.7. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.3...v1.14.7) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tests/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/yarn.lock b/tests/yarn.lock index c2bb0806b..22dfb9bc8 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -1723,9 +1723,9 @@ find-up@^4.0.0, find-up@^4.1.0: path-exists "^4.0.0" follow-redirects@^1.14.0: - version "1.14.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.3.tgz#6ada78118d8d24caee595595accdc0ac6abd022e" - integrity sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw== + version "1.14.7" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" + integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== for-in@^1.0.2: version "1.0.2" From ad105e2350e0a18f5d12ed56fb8ea724333ec0e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 13 Feb 2022 00:23:35 +0800 Subject: [PATCH 3/8] chore(deps): bump follow-redirects from 1.14.7 to 1.14.8 (#385) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 35fcb8ff0..4c2f1ef43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -858,9 +858,9 @@ flatted@^3.1.0: integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== follow-redirects@^1.0.0, follow-redirects@^1.14.0: - version "1.14.7" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" - integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== + version "1.14.8" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" + integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== from@~0: version "0.1.7" From 602c64a5a15c22950724950171cdc02d021580ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Feb 2022 13:57:08 +0800 Subject: [PATCH 4/8] chore(deps): bump follow-redirects from 1.14.7 to 1.14.8 in /tests (#386) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tests/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/yarn.lock b/tests/yarn.lock index 22dfb9bc8..1cb396aa9 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -1723,9 +1723,9 @@ find-up@^4.0.0, find-up@^4.1.0: path-exists "^4.0.0" follow-redirects@^1.14.0: - version "1.14.7" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" - integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== + version "1.14.8" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" + integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== for-in@^1.0.2: version "1.0.2" From 76dc9e50c12072b14c4811c95c3370249467b17c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 21:56:52 +0800 Subject: [PATCH 5/8] chore(deps): bump minimist from 1.2.5 to 1.2.6 in /tests (#394) Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tests/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/yarn.lock b/tests/yarn.lock index 1cb396aa9..e81da3ab9 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -3031,9 +3031,9 @@ minimatch@^3.0.4: brace-expansion "^1.1.7" minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== mixin-deep@^1.2.0: version "1.3.2" From 32b7ce832e264f6ea1b583e2cb51303354efb3f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 17:58:25 +0800 Subject: [PATCH 6/8] chore(deps): bump minimist from 1.2.5 to 1.2.6 (#395) Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4c2f1ef43..59f04e63b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1396,9 +1396,9 @@ minimatch@3.0.4, minimatch@^3.0.4: brace-expansion "^1.1.7" minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== ms@2.1.2: version "2.1.2" From 4838578600c902975340a877300692e9f015b136 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 17:58:51 +0800 Subject: [PATCH 7/8] chore(deps): bump minimist from 1.2.5 to 1.2.6 in /extensions/github1s (#392) Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- extensions/github1s/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/github1s/yarn.lock b/extensions/github1s/yarn.lock index f34d01257..c8310a024 100644 --- a/extensions/github1s/yarn.lock +++ b/extensions/github1s/yarn.lock @@ -799,9 +799,9 @@ mimic-fn@^2.1.0: integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== neo-async@^2.6.2: version "2.6.2" From 712c726264c59c09e9af161be28309b15f1d58c4 Mon Sep 17 00:00:00 2001 From: netcon Date: Fri, 13 May 2022 22:43:03 +0800 Subject: [PATCH 8/8] refactor github1s for supporting other scm * chore: add type definations * chore: add type definations * chore: add type definations * chore: add type definations * chore: add type definations * chore: add github1s adapter * chore: implements adapter * chore: add github1s adapter * refactor: refact file system provider * refactor: refact fileSystemProvider * refactor: fill github datasource * refactor: fill github datasource * refactor: fill github datasource * refactor: fill github datasource * refactor: text search provider * refactor: definitions and references * refactor: move settings code to adapters * feat: add github1s adapter * refactor: refactor pull list view * refactor: refactor commit list view * refactor: changed file provider * refactor: definination provider and reference provider * refactor: hover provider * refactor: text search provider and file search provider * refactor: update provider files * refactor: extension listeners * refactor: editor and ref commands * refactor: rename constants * refactor: use singleton repository * refactor: blame commands * refactor: global commands * refactor: optimize file system provider * reafactor: clean entry files * reafactor: fix ts errors * reafactor: fix read submodule file * rafactor: optimize director structure & fix chnaged files decoration * feat: upgrade vscode to 1.66.2 * feat: update initialize rule * feat: update vscode deps and add workspace identifier * feat: update proload css * feat: add auth command * feat: github oauth token * feat: remove unused files * feat: update adapter context * feat: preload file structures * fix: css preload typo * fix: connect to github and set token * refactor: remove vscode loader.js modification * fix: invalid token status & localize webview libraries * feat: update dependencies & fix commit diff * fix: token changed create wrong octokit * fix: data source types * feat: add notifications & platform logos * feat: use sourcegraph api * feat: update github1s fetcher retry rule * feat: remove prebuilt vscode-anycode * feat: remove prebuilt vscode-anycode * feat: add sourcegraph api * feat: change settings page * feat: auto switch github api * chore: update datasource & fix user avatar url * feat: fix vercel build script * fix: commit list refresh lost data * feat: commit list paginations * fix: commit manager load data * feat: increase text search count * feat: add list file recursively limit * feat: add gitlab support * feat: add bitbucket support * fix: parse router path * default: use default branch for router parser in gitlab1s * feat: update default page title * feat: update logo link path * test: update test cases * chore: update logo icon * ci: fix ci error * feat: update use sourcegraph api strategy --- .eslintignore | 3 + .eslintrc.json | 10 + .github/workflows/build.yml | 2 +- .github/workflows/test-wtih-vscode-build.yml | 2 +- .gitignore | 2 + .prettierignore | 7 +- .prettierrc.js | 1 + api/github-auth-callback/index.js | 11 +- api/vscode-unpkg/index.js | 5 +- docs/guide.md | 6 +- .../github1s/assets/pages/components.css | 164 + .../github1s/assets/pages/components.js | 58 + .../assets/pages/github1s-authentication.css | 227 + .../assets/pages/github1s-authentication.js | 230 + .../assets/pages/github1s-settings.css | 75 + .../assets/pages/github1s-settings.js | 219 + .../github1s/assets/pages/htm.module.js | 2 + .../assets/pages/preact-hooks.module.js | 2 + .../github1s/assets/pages/preact.module.js | 2 + .../github1s/extension.webpack.config.js | 4 +- extensions/github1s/package.json | 388 +- .../src/adapters/bitbucket1s/index.ts | 31 + .../src/adapters/bitbucket1s/parse-path.ts | 69 + .../src/adapters/bitbucket1s/router-parser.ts | 51 + .../src/adapters/github1s/authentication.ts | 108 + .../src/adapters/github1s/data-source.ts | 400 + .../github1s/src/adapters/github1s/fetcher.ts | 157 + .../github1s/src/adapters/github1s/graphql.ts | 32 + .../github1s/src/adapters/github1s/index.ts | 47 + .../src/adapters/github1s/parse-path.ts | 123 + .../src/adapters/github1s/router-parser.ts | 51 + .../src/adapters/github1s/settings.ts | 89 + .../github1s/src/adapters/github1s/token.ts | 60 + .../github1s/src/adapters/gitlab1s/index.ts | 31 + .../src/adapters/gitlab1s/parse-path.ts | 103 + .../src/adapters/gitlab1s/router-parser.ts | 51 + extensions/github1s/src/adapters/index.ts | 19 + extensions/github1s/src/adapters/manager.ts | 63 + .../src/adapters/sourcegraph/blame.ts | 71 + .../src/adapters/sourcegraph/commit.ts | 99 + .../src/adapters/sourcegraph/common.ts | 51 + .../src/adapters/sourcegraph/comparison.ts | 56 + .../src/adapters/sourcegraph/data-source.ts | 251 + .../sourcegraph/definition.ts | 81 +- .../github1s/src/adapters/sourcegraph/file.ts | 78 + .../sourcegraph/hover.ts | 29 +- .../sourcegraph/position.ts | 70 +- .../github1s/src/adapters/sourcegraph/ref.ts | 52 + .../sourcegraph/reference.ts | 75 +- .../src/adapters/sourcegraph/repository.ts | 29 + .../src/adapters/sourcegraph/search.ts | 119 + extensions/github1s/src/adapters/types.ts | 400 + extensions/github1s/src/changes/files.ts | 149 + extensions/github1s/src/changes/index.ts | 30 + extensions/github1s/src/changes/quick-diff.ts | 84 + extensions/github1s/src/commands/blame.ts | 150 +- .../github1s/src/commands/code-review.ts | 147 + extensions/github1s/src/commands/commit.ts | 114 +- extensions/github1s/src/commands/editor.ts | 171 +- extensions/github1s/src/commands/gitpod.ts | 19 - extensions/github1s/src/commands/global.ts | 35 +- extensions/github1s/src/commands/index.ts | 125 +- extensions/github1s/src/commands/pull.ts | 110 - extensions/github1s/src/commands/ref.ts | 48 +- extensions/github1s/src/commands/token.ts | 154 - extensions/github1s/src/extension.ts | 93 +- extensions/github1s/src/helpers/async.ts | 3 +- extensions/github1s/src/helpers/constants.ts | 6 - extensions/github1s/src/helpers/context.ts | 12 +- extensions/github1s/src/helpers/date.ts | 3 +- extensions/github1s/src/helpers/fetch.ts | 126 - extensions/github1s/src/helpers/func.ts | 29 +- extensions/github1s/src/helpers/page.ts | 54 + extensions/github1s/src/helpers/submodule.ts | 25 +- extensions/github1s/src/helpers/urls.ts | 11 +- extensions/github1s/src/helpers/util.ts | 24 +- extensions/github1s/src/helpers/vscode.ts | 3 +- extensions/github1s/src/interfaces/client.ts | 32 - .../github1s/src/interfaces/github-api-gql.ts | 126 - .../src/interfaces/github-api-rest.ts | 214 - .../src/interfaces/sourcegraph/common.ts | 65 - .../src/interfaces/sourcegraph/search.ts | 105 - .../github1s/src/listeners/router/changes.ts | 26 + .../github1s/src/listeners/router/explorer.ts | 47 +- .../github1s/src/listeners/router/index.ts | 2 +- .../src/listeners/router/source-control.ts | 27 - extensions/github1s/src/listeners/vscode.ts | 96 +- extensions/github1s/src/messages.ts | 29 +- .../changedFileDecorationProvider.ts | 125 - .../src/providers/decorations/changed-file.ts | 118 + .../source-control.ts} | 37 +- .../src/providers/decorations/submodule.ts | 61 + .../github1s/src/providers/definition.ts | 74 + .../src/providers/definitionProvider.ts | 69 - .../{fileSearchProvider.ts => file-search.ts} | 54 +- .../index.ts | 231 +- .../types.ts | 10 +- .../src/providers/fileSystemProvider/util.ts | 102 - extensions/github1s/src/providers/hover.ts | 122 + .../github1s/src/providers/hoverProvider.ts | 117 - extensions/github1s/src/providers/index.ts | 84 +- .../{referenceProvider.ts => reference.ts} | 55 +- .../providers/submoduleDecorationProvider.ts | 56 - .../github1s/src/providers/text-search.ts | 62 + .../src/providers/textSearchProvider.ts | 85 - .../src/repository/branch-tag-manager.ts | 116 + .../src/repository/code-review-manager.ts | 154 + .../github1s/src/repository/commit-manager.ts | 259 + .../src/repository/github-commit-manager.ts | 182 - .../src/repository/github-pull-manager.ts | 97 - extensions/github1s/src/repository/index.ts | 189 +- .../github1s/src/repository/linked-list.ts | 67 - extensions/github1s/src/repository/types.ts | 102 - extensions/github1s/src/router/index.ts | 92 +- extensions/github1s/src/router/parser/blob.ts | 29 - .../github1s/src/router/parser/commit.ts | 14 - .../github1s/src/router/parser/commits.ts | 19 - .../github1s/src/router/parser/index.ts | 54 - extensions/github1s/src/router/parser/pull.ts | 22 - .../github1s/src/router/parser/pulls.ts | 20 - extensions/github1s/src/router/parser/tree.ts | 52 - extensions/github1s/src/router/types.ts | 65 - .../github1s/src/source-control/changes.ts | 178 - .../github1s/src/source-control/index.ts | 12 - .../src/source-control/quickDiffProviders.ts | 106 - .../status-bar.ts => statusbar/checkout.ts} | 11 +- .../github1s/src/{ => statusbar}/gitpod.ts | 17 +- extensions/github1s/src/statusbar/index.ts | 14 + .../github1s/src/{ => statusbar}/sponsors.ts | 14 +- .../github1s/src/views/code-review-list.ts | 195 + .../github1s/src/views/commit-list-view.ts | 137 - extensions/github1s/src/views/commit-list.ts | 149 + extensions/github1s/src/views/index.ts | 41 +- .../github1s/src/views/pull-list-view.ts | 170 - .../github1s/src/views/settings-view.ts | 463 - extensions/github1s/src/vscode.proposed.d.ts | 192 +- extensions/github1s/tsconfig.json | 4 +- extensions/github1s/yarn.lock | 2074 +- extensions/vscode-anycode/README.md | 5 - extensions/vscode-anycode/package.json | 101 - .../prebuilt/anycode.extension.js | 27868 ---------------- .../vscode-anycode/prebuilt/anycode.server.js | 15546 --------- .../vscode-anycode/server/tree-sitter-c.wasm | Bin 327556 -> 0 bytes .../server/tree-sitter-c_sharp.wasm | Bin 2987883 -> 0 bytes .../server/tree-sitter-cpp.wasm | Bin 1187722 -> 0 bytes .../vscode-anycode/server/tree-sitter-go.wasm | Bin 180028 -> 0 bytes .../server/tree-sitter-java.wasm | Bin 232273 -> 0 bytes .../server/tree-sitter-php.wasm | Bin 352603 -> 0 bytes .../server/tree-sitter-python.wasm | Bin 191411 -> 0 bytes .../server/tree-sitter-rust.wasm | Bin 638448 -> 0 bytes .../server/tree-sitter-typescript.wasm | Bin 1389235 -> 0 bytes .../server/tree-sitter/tree-sitter.wasm | Bin 171876 -> 0 bytes package.json | 10 +- resources/bitbucket.svg | 5 + resources/github.svg | 2 + resources/gitlab.svg | 5 + resources/index-dev-vscode.html | 67 +- resources/index-hash.html | 178 +- resources/index.html | 177 +- resources/initialize.js | 232 + scripts/package/copy-node_modules.sh | 6 +- scripts/package/generate-config.js | 90 +- scripts/postinstall.sh | 2 +- scripts/serve-dist.js | 20 +- scripts/watch/watch-dist.js | 3 +- ...est-ts-should-load-successfully-1-snap.png | Bin 189480 -> 183878 bytes ...t-ts-should-open-file-correctly-1-snap.png | Bin 164108 -> 163707 bytes ...est-ts-should-show-commit-files-1-snap.png | Bin 0 -> 90561 bytes ...dex-test-ts-should-show-pr-list-1-snap.png | Bin 51708 -> 0 bytes ...dex-test-ts-should-show-pr-list-2-snap.png | Bin 54504 -> 0 bytes tests/__tests__/index.test.ts | 46 +- tests/package.json | 5 +- tests/yarn.lock | 158 +- tsconfig.json | 4 +- .../resources/gulp-github1s.js | 65 - .../scripts/copy-extensions.js | 30 - .../scripts/watch/watch-src.js | 19 - .../src/vs/base/worker/workerMain.ts | 101 - .../vs/code/browser/workbench/workbench.ts | 576 - .../src/vs/github1s/authorizing-github.ts | 60 - .../src/vs/github1s/authorizing-overlay.css | 269 - .../src/vs/github1s/authorizing-overlay.ts | 247 - .../src/vs/github1s/notification.css | 85 - .../src/vs/github1s/notification.ts | 68 - vscode-web-github1s/src/vs/github1s/util.ts | 31 - .../src/vs/github1s/welcomePage.css | 295 - .../src/vs/github1s/welcomePage.ts | 193 - vscode-web-github1s/src/vs/loader.js | 1907 -- .../telemetry/common/telemetryService.ts | 234 - .../api/worker/extHostExtensionService.ts | 252 - .../parts/titlebar/media/titlebarpart.css | 176 - .../browser/parts/titlebar/titlebarPart.ts | 569 - .../browser/workbench.contribution.ts | 537 - .../common/editor/resourceEditorInput.ts | 199 - .../files/browser/views/explorerView.ts | 940 - .../gettingStarted/browser/gettingStarted.ts | 1619 - .../page/browser/welcomePage.contribution.ts | 38 - .../services/workspaces/browser/workspaces.ts | 44 - vscode-web/.VERSION | 1 + {vscode-web-github1s => vscode-web}/README.md | 4 +- .../package.json | 23 +- .../resources/builtin-extensions.json | 0 .../scripts/build-vscode.sh | 8 +- .../scripts/clone-vscode.sh | 2 +- .../scripts/copy-extensions.sh | 7 +- .../scripts/copy-vscode.sh | 2 +- .../scripts/sync-code.sh | 3 + .../scripts/watch/watch-dist.js | 2 +- vscode-web/scripts/watch/watch-src.js | 27 + .../src/vs/base/common/platform.ts | 52 +- .../vs/code/browser/workbench/workbench.ts | 54 + .../vs/editor/common/config/editorOptions.ts | 907 +- .../src/vs/platform/product/common/product.ts | 58 +- .../telemetry/common/telemetryService.ts | 327 + .../parts/activitybar/activitybarActions.ts | 82 +- .../parts/activitybar/activitybarPart.ts | 135 +- .../parts/titlebar/media/titlebarpart.css | 234 + .../src/vs/workbench/browser/web.main.ts | 307 +- .../contrib/webview/browser/pre/main.js | 1117 + .../browser/gettingStarted.contribution.ts | 318 + .../builtinExtensionsScannerService.ts | 79 + .../services/label/common/labelService.ts | 355 + .../textfile/browser/textFileService.ts | 802 + .../themes/browser/workbenchThemeService.ts | 349 +- .../themes/common/themeConfiguration.ts | 26 +- .../tsconfig.json | 0 {vscode-web-github1s => vscode-web}/yarn.lock | 85 +- yarn.lock | 114 +- 228 files changed, 13328 insertions(+), 58868 deletions(-) create mode 100644 extensions/github1s/assets/pages/components.css create mode 100644 extensions/github1s/assets/pages/components.js create mode 100644 extensions/github1s/assets/pages/github1s-authentication.css create mode 100644 extensions/github1s/assets/pages/github1s-authentication.js create mode 100644 extensions/github1s/assets/pages/github1s-settings.css create mode 100644 extensions/github1s/assets/pages/github1s-settings.js create mode 100644 extensions/github1s/assets/pages/htm.module.js create mode 100644 extensions/github1s/assets/pages/preact-hooks.module.js create mode 100644 extensions/github1s/assets/pages/preact.module.js create mode 100644 extensions/github1s/src/adapters/bitbucket1s/index.ts create mode 100644 extensions/github1s/src/adapters/bitbucket1s/parse-path.ts create mode 100644 extensions/github1s/src/adapters/bitbucket1s/router-parser.ts create mode 100644 extensions/github1s/src/adapters/github1s/authentication.ts create mode 100644 extensions/github1s/src/adapters/github1s/data-source.ts create mode 100644 extensions/github1s/src/adapters/github1s/fetcher.ts create mode 100644 extensions/github1s/src/adapters/github1s/graphql.ts create mode 100644 extensions/github1s/src/adapters/github1s/index.ts create mode 100644 extensions/github1s/src/adapters/github1s/parse-path.ts create mode 100644 extensions/github1s/src/adapters/github1s/router-parser.ts create mode 100644 extensions/github1s/src/adapters/github1s/settings.ts create mode 100644 extensions/github1s/src/adapters/github1s/token.ts create mode 100644 extensions/github1s/src/adapters/gitlab1s/index.ts create mode 100644 extensions/github1s/src/adapters/gitlab1s/parse-path.ts create mode 100644 extensions/github1s/src/adapters/gitlab1s/router-parser.ts create mode 100644 extensions/github1s/src/adapters/index.ts create mode 100644 extensions/github1s/src/adapters/manager.ts create mode 100644 extensions/github1s/src/adapters/sourcegraph/blame.ts create mode 100644 extensions/github1s/src/adapters/sourcegraph/commit.ts create mode 100644 extensions/github1s/src/adapters/sourcegraph/common.ts create mode 100644 extensions/github1s/src/adapters/sourcegraph/comparison.ts create mode 100644 extensions/github1s/src/adapters/sourcegraph/data-source.ts rename extensions/github1s/src/{interfaces => adapters}/sourcegraph/definition.ts (52%) create mode 100644 extensions/github1s/src/adapters/sourcegraph/file.ts rename extensions/github1s/src/{interfaces => adapters}/sourcegraph/hover.ts (67%) rename extensions/github1s/src/{interfaces => adapters}/sourcegraph/position.ts (51%) create mode 100644 extensions/github1s/src/adapters/sourcegraph/ref.ts rename extensions/github1s/src/{interfaces => adapters}/sourcegraph/reference.ts (57%) create mode 100644 extensions/github1s/src/adapters/sourcegraph/repository.ts create mode 100644 extensions/github1s/src/adapters/sourcegraph/search.ts create mode 100644 extensions/github1s/src/adapters/types.ts create mode 100644 extensions/github1s/src/changes/files.ts create mode 100644 extensions/github1s/src/changes/index.ts create mode 100644 extensions/github1s/src/changes/quick-diff.ts create mode 100644 extensions/github1s/src/commands/code-review.ts delete mode 100644 extensions/github1s/src/commands/gitpod.ts delete mode 100644 extensions/github1s/src/commands/pull.ts delete mode 100644 extensions/github1s/src/commands/token.ts delete mode 100644 extensions/github1s/src/helpers/constants.ts delete mode 100644 extensions/github1s/src/helpers/fetch.ts create mode 100644 extensions/github1s/src/helpers/page.ts delete mode 100644 extensions/github1s/src/interfaces/client.ts delete mode 100644 extensions/github1s/src/interfaces/github-api-gql.ts delete mode 100644 extensions/github1s/src/interfaces/github-api-rest.ts delete mode 100644 extensions/github1s/src/interfaces/sourcegraph/common.ts delete mode 100644 extensions/github1s/src/interfaces/sourcegraph/search.ts create mode 100644 extensions/github1s/src/listeners/router/changes.ts delete mode 100644 extensions/github1s/src/listeners/router/source-control.ts delete mode 100644 extensions/github1s/src/providers/changedFileDecorationProvider.ts create mode 100644 extensions/github1s/src/providers/decorations/changed-file.ts rename extensions/github1s/src/providers/{sourceControlDecorationProvider.ts => decorations/source-control.ts} (51%) create mode 100644 extensions/github1s/src/providers/decorations/submodule.ts create mode 100644 extensions/github1s/src/providers/definition.ts delete mode 100644 extensions/github1s/src/providers/definitionProvider.ts rename extensions/github1s/src/providers/{fileSearchProvider.ts => file-search.ts} (57%) rename extensions/github1s/src/providers/{fileSystemProvider => file-system}/index.ts (53%) rename extensions/github1s/src/providers/{fileSystemProvider => file-system}/types.ts (84%) delete mode 100644 extensions/github1s/src/providers/fileSystemProvider/util.ts create mode 100644 extensions/github1s/src/providers/hover.ts delete mode 100644 extensions/github1s/src/providers/hoverProvider.ts rename extensions/github1s/src/providers/{referenceProvider.ts => reference.ts} (50%) delete mode 100644 extensions/github1s/src/providers/submoduleDecorationProvider.ts create mode 100644 extensions/github1s/src/providers/text-search.ts delete mode 100644 extensions/github1s/src/providers/textSearchProvider.ts create mode 100644 extensions/github1s/src/repository/branch-tag-manager.ts create mode 100644 extensions/github1s/src/repository/code-review-manager.ts create mode 100644 extensions/github1s/src/repository/commit-manager.ts delete mode 100644 extensions/github1s/src/repository/github-commit-manager.ts delete mode 100644 extensions/github1s/src/repository/github-pull-manager.ts delete mode 100644 extensions/github1s/src/repository/linked-list.ts delete mode 100644 extensions/github1s/src/repository/types.ts delete mode 100644 extensions/github1s/src/router/parser/blob.ts delete mode 100644 extensions/github1s/src/router/parser/commit.ts delete mode 100644 extensions/github1s/src/router/parser/commits.ts delete mode 100644 extensions/github1s/src/router/parser/index.ts delete mode 100644 extensions/github1s/src/router/parser/pull.ts delete mode 100644 extensions/github1s/src/router/parser/pulls.ts delete mode 100644 extensions/github1s/src/router/parser/tree.ts delete mode 100644 extensions/github1s/src/router/types.ts delete mode 100644 extensions/github1s/src/source-control/changes.ts delete mode 100644 extensions/github1s/src/source-control/index.ts delete mode 100644 extensions/github1s/src/source-control/quickDiffProviders.ts rename extensions/github1s/src/{source-control/status-bar.ts => statusbar/checkout.ts} (52%) rename extensions/github1s/src/{ => statusbar}/gitpod.ts (56%) create mode 100644 extensions/github1s/src/statusbar/index.ts rename extensions/github1s/src/{ => statusbar}/sponsors.ts (71%) create mode 100644 extensions/github1s/src/views/code-review-list.ts delete mode 100644 extensions/github1s/src/views/commit-list-view.ts create mode 100644 extensions/github1s/src/views/commit-list.ts delete mode 100644 extensions/github1s/src/views/pull-list-view.ts delete mode 100644 extensions/github1s/src/views/settings-view.ts delete mode 100644 extensions/vscode-anycode/README.md delete mode 100644 extensions/vscode-anycode/package.json delete mode 100644 extensions/vscode-anycode/prebuilt/anycode.extension.js delete mode 100644 extensions/vscode-anycode/prebuilt/anycode.server.js delete mode 100755 extensions/vscode-anycode/server/tree-sitter-c.wasm delete mode 100755 extensions/vscode-anycode/server/tree-sitter-c_sharp.wasm delete mode 100755 extensions/vscode-anycode/server/tree-sitter-cpp.wasm delete mode 100755 extensions/vscode-anycode/server/tree-sitter-go.wasm delete mode 100755 extensions/vscode-anycode/server/tree-sitter-java.wasm delete mode 100755 extensions/vscode-anycode/server/tree-sitter-php.wasm delete mode 100755 extensions/vscode-anycode/server/tree-sitter-python.wasm delete mode 100755 extensions/vscode-anycode/server/tree-sitter-rust.wasm delete mode 100755 extensions/vscode-anycode/server/tree-sitter-typescript.wasm delete mode 100755 extensions/vscode-anycode/server/tree-sitter/tree-sitter.wasm create mode 100644 resources/bitbucket.svg create mode 100644 resources/github.svg create mode 100644 resources/gitlab.svg create mode 100644 resources/initialize.js create mode 100644 tests/__tests__/__image_snapshots__/index-test-ts-should-show-commit-files-1-snap.png delete mode 100644 tests/__tests__/__image_snapshots__/index-test-ts-should-show-pr-list-1-snap.png delete mode 100644 tests/__tests__/__image_snapshots__/index-test-ts-should-show-pr-list-2-snap.png delete mode 100644 vscode-web-github1s/resources/gulp-github1s.js delete mode 100755 vscode-web-github1s/scripts/copy-extensions.js delete mode 100755 vscode-web-github1s/scripts/watch/watch-src.js delete mode 100644 vscode-web-github1s/src/vs/base/worker/workerMain.ts delete mode 100644 vscode-web-github1s/src/vs/code/browser/workbench/workbench.ts delete mode 100644 vscode-web-github1s/src/vs/github1s/authorizing-github.ts delete mode 100644 vscode-web-github1s/src/vs/github1s/authorizing-overlay.css delete mode 100644 vscode-web-github1s/src/vs/github1s/authorizing-overlay.ts delete mode 100644 vscode-web-github1s/src/vs/github1s/notification.css delete mode 100644 vscode-web-github1s/src/vs/github1s/notification.ts delete mode 100644 vscode-web-github1s/src/vs/github1s/util.ts delete mode 100644 vscode-web-github1s/src/vs/github1s/welcomePage.css delete mode 100644 vscode-web-github1s/src/vs/github1s/welcomePage.ts delete mode 100644 vscode-web-github1s/src/vs/loader.js delete mode 100644 vscode-web-github1s/src/vs/platform/telemetry/common/telemetryService.ts delete mode 100644 vscode-web-github1s/src/vs/workbench/api/worker/extHostExtensionService.ts delete mode 100644 vscode-web-github1s/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css delete mode 100644 vscode-web-github1s/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts delete mode 100644 vscode-web-github1s/src/vs/workbench/browser/workbench.contribution.ts delete mode 100644 vscode-web-github1s/src/vs/workbench/common/editor/resourceEditorInput.ts delete mode 100644 vscode-web-github1s/src/vs/workbench/contrib/files/browser/views/explorerView.ts delete mode 100644 vscode-web-github1s/src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts delete mode 100644 vscode-web-github1s/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts delete mode 100644 vscode-web-github1s/src/vs/workbench/services/workspaces/browser/workspaces.ts create mode 100644 vscode-web/.VERSION rename {vscode-web-github1s => vscode-web}/README.md (93%) rename {vscode-web-github1s => vscode-web}/package.json (67%) rename {vscode-web-github1s => vscode-web}/resources/builtin-extensions.json (100%) rename {vscode-web-github1s => vscode-web}/scripts/build-vscode.sh (50%) rename vscode-web-github1s/scripts/clone.sh => vscode-web/scripts/clone-vscode.sh (76%) rename {vscode-web-github1s => vscode-web}/scripts/copy-extensions.sh (73%) rename {vscode-web-github1s => vscode-web}/scripts/copy-vscode.sh (77%) rename {vscode-web-github1s => vscode-web}/scripts/sync-code.sh (81%) rename {vscode-web-github1s => vscode-web}/scripts/watch/watch-dist.js (92%) create mode 100755 vscode-web/scripts/watch/watch-src.js rename {vscode-web-github1s => vscode-web}/src/vs/base/common/platform.ts (69%) create mode 100644 vscode-web/src/vs/code/browser/workbench/workbench.ts rename {vscode-web-github1s => vscode-web}/src/vs/editor/common/config/editorOptions.ts (86%) rename {vscode-web-github1s => vscode-web}/src/vs/platform/product/common/product.ts (61%) create mode 100644 vscode-web/src/vs/platform/telemetry/common/telemetryService.ts rename {vscode-web-github1s => vscode-web}/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts (87%) rename {vscode-web-github1s => vscode-web}/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts (90%) create mode 100644 vscode-web/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css rename {vscode-web-github1s => vscode-web}/src/vs/workbench/browser/web.main.ts (56%) create mode 100644 vscode-web/src/vs/workbench/contrib/webview/browser/pre/main.js create mode 100644 vscode-web/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts create mode 100644 vscode-web/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts create mode 100644 vscode-web/src/vs/workbench/services/label/common/labelService.ts create mode 100644 vscode-web/src/vs/workbench/services/textfile/browser/textFileService.ts rename {vscode-web-github1s => vscode-web}/src/vs/workbench/services/themes/browser/workbenchThemeService.ts (68%) rename {vscode-web-github1s => vscode-web}/src/vs/workbench/services/themes/common/themeConfiguration.ts (91%) rename {vscode-web-github1s => vscode-web}/tsconfig.json (100%) rename {vscode-web-github1s => vscode-web}/yarn.lock (89%) diff --git a/.eslintignore b/.eslintignore index 431d8b13d..2468ce197 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,3 +2,6 @@ **/lib/vscode/** **/dist/** **/src/vs/** +htm.module.js +preact.module.js +preact-hooks.module.js diff --git a/.eslintrc.json b/.eslintrc.json index e347ebdd3..dba469150 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,6 +8,16 @@ "extends": ["plugin:prettier/recommended"], "plugins": ["@typescript-eslint", "jsdoc"], "rules": { + "max-len": [ + "error", + { + "code": 120, + "ignoreStrings": true, + "ignoreUrls": true, + "ignoreTemplateLiterals": true, + "ignoreComments": true + } + ], "constructor-super": "warn", "curly": "warn", "eqeqeq": "warn", diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 610e76de6..994951d61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - node-version: [14.x, 15.x] + node-version: [14.x, 16.x] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/test-wtih-vscode-build.yml b/.github/workflows/test-wtih-vscode-build.yml index 2dc9acd3b..e30e22087 100644 --- a/.github/workflows/test-wtih-vscode-build.yml +++ b/.github/workflows/test-wtih-vscode-build.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - node-version: [14.x, 15.x] + node-version: [14.x, 16.x] runs-on: ${{ matrix.os }} diff --git a/.gitignore b/.gitignore index 9a28bffee..f91e599aa 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ lib dist out node_modules +.yalc +yalc.lock diff --git a/.prettierignore b/.prettierignore index e7d0610c2..ba16b14aa 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,5 +2,8 @@ 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 diff --git a/.prettierrc.js b/.prettierrc.js index 7779ecf43..de719df67 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -3,6 +3,7 @@ module.exports = { useTabs: true, semi: true, singleQuote: true, + printWidth: 120, overrides: [ { files: ['*.yml', '*.yaml', '*.json'], diff --git a/api/github-auth-callback/index.js b/api/github-auth-callback/index.js index a1db0ebcf..dadd68d1c 100644 --- a/api/github-auth-callback/index.js +++ b/api/github-auth-callback/index.js @@ -44,13 +44,10 @@ module.exports = async (req, res) => { 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', - } - ); + 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 diff --git a/api/vscode-unpkg/index.js b/api/vscode-unpkg/index.js index be274d790..f0e8c24a8 100644 --- a/api/vscode-unpkg/index.js +++ b/api/vscode-unpkg/index.js @@ -20,10 +20,7 @@ module.exports = async (req, res) => { const requestUrl = `https://${publisher}.vscode-unpkg.net/${publisher}/${restPartsPath}`; const responsePromise = got(requestUrl); const bufferPromise = responsePromise.buffer(); - const [response, buffer] = await Promise.all([ - responsePromise, - bufferPromise, - ]); + const [response, buffer] = await Promise.all([responsePromise, bufferPromise]); res.status(response.statusCode); res.setHeader('cache-control', response.headers['cache-control']); diff --git a/docs/guide.md b/docs/guide.md index f88a867e5..b30400a8e 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -45,11 +45,11 @@ 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 `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. 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. -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. 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. -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) +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) 5. Go to `extensions/github1s` and run `yarn watch`, it will trigger a new build if something has been changed. diff --git a/extensions/github1s/assets/pages/components.css b/extensions/github1s/assets/pages/components.css new file mode 100644 index 000000000..8c0b5219a --- /dev/null +++ b/extensions/github1s/assets/pages/components.css @@ -0,0 +1,164 @@ +.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-background); + 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 > 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) { + margin-right: 0 !important; + animation-delay: -0.7s; +} + +@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); +} + diff --git a/extensions/github1s/assets/pages/components.js b/extensions/github1s/assets/pages/components.js new file mode 100644 index 000000000..405685e5b --- /dev/null +++ b/extensions/github1s/assets/pages/components.js @@ -0,0 +1,58 @@ +import { h } from './preact.module.js'; +import htm from './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`