diff --git a/.github/workflows/test-wtih-vscode-build.yml b/.github/workflows/test-wtih-vscode-build.yml index 80a0efeed..f3bf9e120 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: [18.x] + node-version: [18.16.0] runs-on: ${{ matrix.os }} diff --git a/extensions/github1s/src/adapters/ossinsight/constants.ts b/extensions/github1s/src/adapters/ossinsight/constants.ts index 40a900819..85738cadf 100644 --- a/extensions/github1s/src/adapters/ossinsight/constants.ts +++ b/extensions/github1s/src/adapters/ossinsight/constants.ts @@ -16,7 +16,7 @@ export const RankingLanguages = [ 'PHP', 'C++', 'C#', - 'Typescript', + 'TypeScript', 'Shell', 'C', 'Ruby', diff --git a/extensions/github1s/src/adapters/ossinsight/interfaces.ts b/extensions/github1s/src/adapters/ossinsight/interfaces.ts index 5a312dd84..8fb38b93f 100644 --- a/extensions/github1s/src/adapters/ossinsight/interfaces.ts +++ b/extensions/github1s/src/adapters/ossinsight/interfaces.ts @@ -12,104 +12,82 @@ const resolveDataFromResponse = (response: Response) => { if (response.status < 200 || response.status >= 300) { return []; } - return response.json().then((body) => body?.data || []); + return response.json().then((body) => body?.data?.rows || []); }; export type RepoItem = { collection_names?: string; contributor_logins?: string; description?: string; - forks?: number; + forks: string; language?: string; repo_name: string; - stars?: number; - total_score?: number; + stars: string; + total_score: string; }; export const getTrendingRepos = (period: RankingPeriod, language: string): Promise => { const encodedLanguage = encodeURIComponent(language) || 'All'; const periodValue = period === RankingPeriod.Today ? 'past_24_hours' : RankingPeriod.ThisWeek ? 'past_week' : 'past_month'; - const requestUrl = `${OSSInsightEndpoint}/q/trending-repos?language=${encodedLanguage}&period=${periodValue}`; + const requestUrl = `${OSSInsightEndpoint}/v1/trends/repos/?language=${encodedLanguage}&period=${periodValue}`; return fetch(requestUrl).then(resolveDataFromResponse); }; export type RecentHotCollectionItem = { - id: number; - last_2nd_month_rank: number; - last_month_rank: number; + id: string; name: string; - rank: number; - rank_changes: number; - repo_id: number; + repos: string; + repo_id: string; repo_name: string; - repos: number; - visits: number; + repo_rank_changes: string; + repo_past_period_rank: string; + repo_current_period_rank: string; }; export const getRecentHotCollections = (): Promise => { - const requestUrl = `${OSSInsightEndpoint}/q/recent-hot-collections`; + const requestUrl = `${OSSInsightEndpoint}/v1/collections/hot/`; return fetch(requestUrl).then(resolveDataFromResponse); }; export type CollectionItem = { - id: number; + id: string; name: string; - public: number; }; export const getCollections = memorize((): Promise => { - const requestUrl = `${OSSInsightEndpoint}/collections`; + const requestUrl = `${OSSInsightEndpoint}/v1/collections/`; return fetch(requestUrl).then(resolveDataFromResponse); }); -export const getCollectionIdByName = async (collectionName: string): Promise => { +export const getCollectionIdByName = async (collectionName: string): Promise => { const collections = await getCollections(); return collections.find((item) => item.name === collectionName)?.id || null; }; export type Last28DaysRankItem = { - last_2nd_period_rank: number; - last_2nd_period_total: number; - last_period_rank: number; - last_period_total: number; - rank_pop: number; - repo_id: number; + repo_id: string; repo_name: string; - total: number; - total_pop: number; + current_period_growth: string; + past_period_growth: string; + growth_pop: string; + rank_pop: string; + total: string; + current_period_rank: string; + past_period_rank: string; }; -export const getCollectionStarsLast28DaysRank = (collectionId: number): Promise => { - const requestUrl = `${OSSInsightEndpoint}/q/collection-stars-last-28-days-rank?collectionId=${collectionId}`; +export const getCollectionStarsLast28DaysRank = (collectionId: string): Promise => { + const requestUrl = `${OSSInsightEndpoint}/v1/collections/${collectionId}/ranking_by_stars/`; return fetch(requestUrl).then(resolveDataFromResponse); }; -export const getCollectionPullRequestsLast28DaysRank = (collectionId: number): Promise => { - const requestUrl = `${OSSInsightEndpoint}/q/collection-pull-requests-last-28-days-rank?collectionId=${collectionId}`; +export const getCollectionPullRequestsLast28DaysRank = (collectionId: string): Promise => { + const requestUrl = `${OSSInsightEndpoint}/v1/collections/${collectionId}/ranking_by_issues/`; return fetch(requestUrl).then(resolveDataFromResponse); }; -export const getCollectionIssuesLast28DaysRank = (collectionId: number): Promise => { - const requestUrl = `${OSSInsightEndpoint}/q/collection-issues-last-28-days-rank?collectionId=${collectionId}`; - return fetch(requestUrl).then(resolveDataFromResponse); -}; - -export type CollectionStarsMonthRankItem = { - current_month: string; - current_month_rank: number; - current_month_total: number; - last_month: string; - last_month_rank: number; - last_month_total: number; - rank_mom: number; - repo_id: number; - repo_name: string; - total: number; - total_mom: number; -}; - -export const getCollectionStarsMonthRank = (collectionId: number) => { - const requestUrl = `https://api.ossinsight.io/q/collection-stars-last-28-days-rank?collectionId=${collectionId}`; +export const getCollectionIssuesLast28DaysRank = (collectionId: string): Promise => { + const requestUrl = `${OSSInsightEndpoint}/v1/collections/${collectionId}/ranking_by_prs/`; return fetch(requestUrl).then(resolveDataFromResponse); }; diff --git a/extensions/github1s/src/adapters/ossinsight/templates.ts b/extensions/github1s/src/adapters/ossinsight/templates.ts index 5b4bf4cd3..360654f23 100644 --- a/extensions/github1s/src/adapters/ossinsight/templates.ts +++ b/extensions/github1s/src/adapters/ossinsight/templates.ts @@ -34,8 +34,8 @@ const createRepoItemMarkdown = (repo: RepoItem, period: RankingPeriod) => { `[![LastCommit](https://img.shields.io/github/last-commit/${repo.repo_name})](https://github.com/${repo.repo_name}/commits)`, ]; - const increaseStarsText = (repo.stars || 0) >= 0 ? `+${repo.stars || 0}` : `-${repo.stars}`; - const increaseForksText = (repo.forks || 0) >= 0 ? `+${repo.forks || 0}` : `-${repo.forks}`; + const increaseStarsText = (+repo.stars || 0) >= 0 ? `+${repo.stars || 0}` : `-${repo.stars}`; + const increaseForksText = (+repo.forks || 0) >= 0 ? `+${repo.forks || 0}` : `-${repo.forks}`; const contributorsMarkdown = contributorAvatars.length ? '    Built by  ' + contributorAvatars.join('  ') : ''; @@ -43,7 +43,7 @@ const createRepoItemMarkdown = (repo: RepoItem, period: RankingPeriod) => { const fireThreshold = period === RankingPeriod.ThisWeek ? 5000 : period === RankingPeriod.ThisMonth ? 12000 : 1000; return ` -## ${(repo.total_score || 0) >= fireThreshold ? '🔥' : '🚀'} [${repo.repo_name}](${buildRepoLink(repo.repo_name)}) +## ${(+repo.total_score || 0) >= fireThreshold ? '🔥' : '🚀'} [${repo.repo_name}](${buildRepoLink(repo.repo_name)}) ${repo.description || ''} @@ -126,12 +126,23 @@ const getPopCountText = (pop_count: number, percentage = false) => { : ''; }; +const getRankChangeText = (rank_change: number) => { + const absValue = Math.abs(rank_change); + return rank_change > 0 + ? ` (↓${absValue})` + : rank_change < 0 + ? ` (↑${absValue})` + : ''; +}; + export const createCollectionsListPageMarkdown = async () => { const collectionReposMap = new Map(); const [hotCollections, allCollections] = await Promise.all([getRecentHotCollections(), getCollections()]); - const sortedCollections = hotCollections.sort((itemA, itemB) => itemA.rank - itemB.rank); + const sortedCollections = hotCollections.sort( + (itemA, itemB) => +itemA.repo_current_period_rank - +itemB.repo_current_period_rank + ); const uniqueCollections = sortedCollections.filter((collection) => { - const relativeRankText = getPopCountText(collection.last_2nd_month_rank - collection.last_month_rank); + const relativeRankText = getRankChangeText(+collection.repo_rank_changes); if (!collectionReposMap.has(collection.name)) { collectionReposMap.set(collection.name, [[collection.repo_name, relativeRankText]]); return true; @@ -192,24 +203,24 @@ export const createCollectionPageMarkdown = async (collectionName: string) => { ]); const starRankListMarkdown = starsData.map((item) => { - const rankMarkdown = ` ${item.last_period_rank}${getPopCountText(item.rank_pop)}`; + const rankMarkdown = ` ${item.current_period_rank}${getRankChangeText(+item.rank_pop)}`; const repoMarkdown = ` [${item.repo_name}](${buildRepoLink(item.repo_name)})`; - const starsMarkdown = ` ${item.last_period_total}${getPopCountText(item.total_pop, true)}`; - return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.last_2nd_period_total} | ${item.total} |`; + const starsMarkdown = ` ${item.current_period_growth}${getPopCountText(+item.growth_pop, true)}`; + return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.past_period_growth} | ${item.total} |`; }); const pullRankListMarkdown = pullsData.map((item) => { - const rankMarkdown = ` ${item.last_period_rank}${getPopCountText(item.rank_pop)}`; + const rankMarkdown = ` ${item.current_period_rank}${getRankChangeText(+item.rank_pop)}`; const repoMarkdown = ` [${item.repo_name}](${buildRepoLink(item.repo_name)})`; - const starsMarkdown = ` ${item.last_period_total}${getPopCountText(item.total_pop, true)}`; - return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.last_2nd_period_total} | ${item.total} |`; + const starsMarkdown = ` ${item.current_period_growth}${getPopCountText(+item.growth_pop, true)}`; + return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.past_period_growth} | ${item.total} |`; }); const issuesRankListMarkdown = issuesData.map((item) => { - const rankMarkdown = ` ${item.last_period_rank}${getPopCountText(item.rank_pop)}`; + const rankMarkdown = ` ${item.current_period_rank}${getRankChangeText(+item.rank_pop)}`; const repoMarkdown = ` [${item.repo_name}](${buildRepoLink(item.repo_name)})`; - const starsMarkdown = ` ${item.last_period_total}${getPopCountText(item.total_pop, true)}`; - return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.last_2nd_period_total} | ${item.total} |`; + const starsMarkdown = ` ${item.current_period_growth}${getPopCountText(+item.growth_pop, true)}`; + return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.past_period_growth} | ${item.total} |`; }); return ` diff --git a/package.json b/package.json index 04eb19fb2..8bec2aa4b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lib": "lib" }, "devDependencies": { - "@github1s/vscode-web": "0.13.0", + "@github1s/vscode-web": "0.14.0", "@typescript-eslint/eslint-plugin": "^5.40.1", "@typescript-eslint/parser": "^5.40.1", "chokidar": "^3.5.3", diff --git a/tests/yarn.lock b/tests/yarn.lock index f44e9ffa6..9c38ed1c2 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -17,6 +17,14 @@ dependencies: "@babel/highlight" "^7.16.7" +"@babel/code-frame@^7.22.13": + version "7.22.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" + integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== + dependencies: + "@babel/highlight" "^7.22.13" + chalk "^2.4.2" + "@babel/compat-data@^7.17.10": version "7.17.10" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab" @@ -52,6 +60,16 @@ "@jridgewell/gen-mapping" "^0.3.0" jsesc "^2.5.1" +"@babel/generator@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420" + integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g== + dependencies: + "@babel/types" "^7.23.0" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + "@babel/helper-compilation-targets@^7.18.2": version "7.18.2" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.2.tgz#67a85a10cbd5fc7f1457fec2e7f45441dc6c754b" @@ -62,25 +80,30 @@ browserslist "^4.20.2" semver "^6.3.0" -"@babel/helper-environment-visitor@^7.16.7", "@babel/helper-environment-visitor@^7.18.2": +"@babel/helper-environment-visitor@^7.16.7": version "7.18.2" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz#8a6d2dedb53f6bf248e31b4baf38739ee4a637bd" integrity sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ== -"@babel/helper-function-name@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz#136fcd54bc1da82fcb47565cf16fd8e444b1ff12" - integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== + +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== dependencies: - "@babel/template" "^7.16.7" - "@babel/types" "^7.17.0" + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" -"@babel/helper-hoist-variables@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" - integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== dependencies: - "@babel/types" "^7.16.7" + "@babel/types" "^7.22.5" "@babel/helper-module-imports@^7.16.7": version "7.16.7" @@ -122,11 +145,28 @@ dependencies: "@babel/types" "^7.16.7" +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + "@babel/helper-validator-identifier@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + "@babel/helper-validator-option@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" @@ -150,11 +190,25 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.22.13": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" + integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.18.0": version "7.18.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.4.tgz#6774231779dd700e0af29f6ad8d479582d7ce5ef" integrity sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow== +"@babel/parser@^7.22.15", "@babel/parser@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" + integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== + "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -248,23 +302,32 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.18.0", "@babel/traverse@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.2.tgz#b77a52604b5cc836a9e1e08dca01cba67a12d2e8" - integrity sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA== +"@babel/template@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.2" - "@babel/helper-environment-visitor" "^7.18.2" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.18.0" - "@babel/types" "^7.18.2" + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.18.0", "@babel/traverse@^7.18.2": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8" + integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw== + dependencies: + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.23.0" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.0" + "@babel/types" "^7.23.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.18.0", "@babel/types@^7.18.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3": +"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.18.0", "@babel/types@^7.18.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3": version "7.18.4" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.4.tgz#27eae9b9fd18e9dccc3f9d6ad051336f307be354" integrity sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw== @@ -272,6 +335,15 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" +"@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" + integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -501,21 +573,53 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.2": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/resolve-uri@^3.0.3": version "3.0.7" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz#30cd49820a962aff48c8fffc5cd760151fca61fe" integrity sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + "@jridgewell/set-array@^1.0.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.1.tgz#36a6acc93987adcf0ba50c66908bd0b70de8afea" integrity sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ== +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.13" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz#b6461fb0c2964356c469e115f504c95ad97ab88c" integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== +"@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.17": + version "0.3.20" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" + integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jridgewell/trace-mapping@^0.3.9": version "0.3.13" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" diff --git a/vscode-web/.VERSION b/vscode-web/.VERSION index c6e4b57f5..d860c4721 100644 --- a/vscode-web/.VERSION +++ b/vscode-web/.VERSION @@ -1 +1 @@ -1.82.2 \ No newline at end of file +1.83.1 \ No newline at end of file diff --git a/vscode-web/package.json b/vscode-web/package.json index 58ac743b7..e020d244e 100644 --- a/vscode-web/package.json +++ b/vscode-web/package.json @@ -1,6 +1,6 @@ { "name": "@github1s/vscode-web", - "version": "0.13.0", + "version": "0.14.0", "description": "VS Code web for GitHub1s", "author": "github1s", "license": "MIT", diff --git a/vscode-web/scripts/.patch b/vscode-web/scripts/.patch index a0ccd5c85..01178c81d 100644 --- a/vscode-web/scripts/.patch +++ b/vscode-web/scripts/.patch @@ -1,13 +1,13 @@ { "vs/code/browser/workbench/workbench.ts": "a954327b52b6ed462b3b7fbd2301c6ba11bf135ca7ba70c5f552214309492946", - "vs/editor/common/config/editorOptions.ts": "5dee522e65874effeb1d1a0a3637d8dedcfceb929892cf0c51c9cf29162f44da", - "vs/workbench/browser/parts/activitybar/activitybarActions.ts": "51c169706a121b1008f9173812cbc77d864255e24bfe78dfac53fec5dd6263da", - "vs/workbench/browser/parts/activitybar/activitybarPart.ts": "e202c8406f9c4c8dc998ecd8763a2753191d2a325d6fe28d6ab951966dc84d0e", - "vs/workbench/browser/parts/titlebar/media/titlebarpart.css": "e9a29c2d1a9ed11262667ce3433e03ca98e87e4a1d9cb591383333eb4988e50b", - "vs/workbench/browser/web.main.ts": "6faa17247fc0370a4262ebd38d92922eb199c75aa1c92bbd72bbdcfc3e93dac8", - "vs/workbench/contrib/files/browser/editors/fileEditorInput.ts": "d52aa1f962f1a0bdfc6d186762f6fa51c9aa35bb98667aead8d8e9ad75e45215", + "vs/editor/common/config/editorOptions.ts": "611f03be53deb2d1326e31b618da729a5c2660d647149e1452792dcfc63c1b64", + "vs/workbench/browser/parts/activitybar/activitybarActions.ts": "6f7e46ab77834e26c0cd6ef4bd31e0fb54d605b677d8e1746522e22ceebae1e5", + "vs/workbench/browser/parts/activitybar/activitybarPart.ts": "101b6d4d65a1efb478caf77159684f691f3075ec52c5cd35cef1fee521d4edac", + "vs/workbench/browser/parts/titlebar/media/titlebarpart.css": "26bf68e6e1b3acfcac13405eba2d2b54ce4771ede2e75e5788beb9e5fe5da569", + "vs/workbench/browser/web.main.ts": "3f41a99e744b80d161af5f9830b3394e4953d91ed38d282179e0f4bcc385c205", + "vs/workbench/contrib/files/browser/editors/fileEditorInput.ts": "27714e54f72edb805459d991c607d2867bd791e46d4c58eb4ab1a418f767e817", "vs/workbench/contrib/webview/browser/pre/index.html": "6dc11aefde8587732dba85116dac2718cef9287075c8d3a306663a7741e6910f", - "vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts": "b2c52e36c3d4122aa21b8f9a14fc9b14d45550f5a2251617e6d0e60685dde83c", + "vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts": "3cc4c831bcffc9b2837890d64c651ba5508af9e9693d6d2cf425305ff27cba9f", "vs/workbench/services/label/common/labelService.ts": "73237cce0f9496151ea8ae5079676bbdfa15ce49de9b05621d39fcd04e9c1f0d", "vs/workbench/services/textfile/browser/textFileService.ts": "514ae0a7922c9e0e63c1b50ef08936d0b900e4970c19ba219b73759d62bac1a4", "vs/workbench/services/editor/browser/editorResolverService.ts": "43cd774a4715e98afaf85b3d44f0381d0b83dc1b9cd75fc090553f84fa0f7e80" diff --git a/vscode-web/src/vs/editor/common/config/editorOptions.ts b/vscode-web/src/vs/editor/common/config/editorOptions.ts index 62547f280..0db5caa2f 100644 --- a/vscode-web/src/vs/editor/common/config/editorOptions.ts +++ b/vscode-web/src/vs/editor/common/config/editorOptions.ts @@ -13,7 +13,6 @@ import { Constants } from 'vs/base/common/uint'; import { FontInfo } from 'vs/editor/common/config/fontInfo'; import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults'; import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/core/wordHelper'; -import { IDocumentDiffProvider } from 'vs/editor/common/diff/documentDiffProvider'; import * as nls from 'vs/nls'; import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; import { IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry'; @@ -460,6 +459,11 @@ export interface IEditorOptions { * Defaults to language defined behavior. */ autoClosingBrackets?: EditorAutoClosingStrategy; + /** + * Options for auto closing comments. + * Defaults to language defined behavior. + */ + autoClosingComments?: EditorAutoClosingStrategy; /** * Options for auto closing quotes. * Defaults to language defined behavior. @@ -727,7 +731,7 @@ export interface IEditorOptions { pasteAs?: IPasteAsOptions; /** - * Controls whether the editor receives tabs or defers them to the workbench for navigation. + * Controls whether the editor / terminal receives tabs or defers them to the workbench for navigation. */ tabFocusMode?: boolean; @@ -817,7 +821,7 @@ export interface IDiffEditorBaseOptions { /** * Diff Algorithm */ - diffAlgorithm?: 'legacy' | 'advanced' | IDocumentDiffProvider; + diffAlgorithm?: 'legacy' | 'advanced'; /** * Whether the diff editor aria label should be verbose. @@ -2034,6 +2038,11 @@ export interface IEditorHoverOptions { * Defaults to true. */ sticky?: boolean; + /** + * Controls how long the hover is visible after you hovered out of it. + * Require sticky setting to be true. + */ + hidingDelay?: number; /** * Should the hover be shown above the line if possible? * Defaults to false. @@ -2052,6 +2061,7 @@ class EditorHover extends BaseEditorOption = new Set(); private initialized = false; - private sessionFromEmbedder = new Lazy>(() => getCurrentAuthenticationSessionInfo(this.credentialsService, this.secretStorageService, this.productService)); + private sessionFromEmbedder = new Lazy>(() => getCurrentAuthenticationSessionInfo(this.secretStorageService, this.productService)); constructor( action: ActivityAction, @@ -296,7 +296,6 @@ export class AccountsActivityActionViewItem extends MenuActivityActionViewItem { @IStorageService private readonly storageService: IStorageService, @IKeybindingService keybindingService: IKeybindingService, @ISecretStorageService private readonly secretStorageService: ISecretStorageService, - @ICredentialsService private readonly credentialsService: ICredentialsService, @ILogService private readonly logService: ILogService ) { super(MenuId.AccountsContext, action, contextMenuActionsProvider, true, colors, activityHoverOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); @@ -395,7 +394,7 @@ export class AccountsActivityActionViewItem extends MenuActivityActionViewItem { if (account.canSignOut) { const signOutAction = disposables.add(new Action('signOut', localize('signOut', "Sign Out"), undefined, true, async () => { const allSessions = await this.authenticationService.getSessions(providerId); - const sessionsForAccount = allSessions.filter(s => s.account.id === account.id); + const sessionsForAccount = allSessions.filter(s => s.account.label === account.label); return await this.authenticationService.removeAccountSessions(providerId, account.label, sessionsForAccount); })); providerSubMenuActions.push(signOutAction); @@ -443,34 +442,35 @@ export class AccountsActivityActionViewItem extends MenuActivityActionViewItem { private async addOrUpdateAccount(providerId: string, account: AuthenticationSessionAccount): Promise { let accounts = this.groupedAccounts.get(providerId); - if (accounts) { - const existingAccount = accounts.find(a => a.id === account.id); - if (existingAccount) { - // Update the label if it has changed - if (existingAccount.label !== account.label) { - existingAccount.label = account.label; - } - return; - } - } else { + if (!accounts) { accounts = []; this.groupedAccounts.set(providerId, accounts); } const sessionFromEmbedder = await this.sessionFromEmbedder.value; - // If the session stored from the embedder allows sign out, then we can treat it and all others as sign out-able - let canSignOut = !!sessionFromEmbedder?.canSignOut; - if (!canSignOut) { - if (sessionFromEmbedder?.id) { - const sessions = (await this.authenticationService.getSessions(providerId)).filter(s => s.account.id === account.id); - canSignOut = !sessions.some(s => s.id === sessionFromEmbedder.id); - } else { - // The default if we don't have a session from the embedder is to allow sign out - canSignOut = true; - } + let canSignOut = true; + if ( + sessionFromEmbedder // if we have a session from the embedder + && !sessionFromEmbedder.canSignOut // and that session says we can't sign out + && (await this.authenticationService.getSessions(providerId)) // and that session is associated with the account we are adding/updating + .some(s => + s.id === sessionFromEmbedder.id + && s.account.id === account.id + ) + ) { + canSignOut = false; } - accounts.push({ ...account, canSignOut }); + const existingAccount = accounts.find(a => a.label === account.label); + if (existingAccount) { + // if we have an existing account and we discover that we + // can't sign out of it, update the account to mark it as "can't sign out" + if (!canSignOut) { + existingAccount.canSignOut = canSignOut; + } + } else { + accounts.push({ ...account, canSignOut }); + } } private removeAccount(providerId: string, account: AuthenticationSessionAccount): void { @@ -536,7 +536,6 @@ export class GlobalActivityActionViewItem extends MenuActivityActionViewItem { @IKeybindingService keybindingService: IKeybindingService, ) { super(MenuId.GlobalActivity, action, contextMenuActionsProvider, true, colors, activityHoverOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); - this._register(this.userDataProfileService.onDidChangeCurrentProfile(() => this.updateProfileBadge())); } override render(container: HTMLElement): void { @@ -563,7 +562,12 @@ export class GlobalActivityActionViewItem extends MenuActivityActionViewItem { return; } - this.profileBadgeContent.textContent = this.userDataProfileService.currentProfile.name.substring(0, 2).toUpperCase(); + if (!this.userDataProfileService.currentProfile.icon || this.userDataProfileService.currentProfile.icon === DEFAULT_ICON.id) { + this.profileBadgeContent.classList.toggle('profile-text-overlay', true); + this.profileBadgeContent.classList.toggle('profile-icon-overlay', false); + this.profileBadgeContent.textContent = this.userDataProfileService.currentProfile.name.substring(0, 2).toUpperCase(); + } + show(this.profileBadge); } diff --git a/vscode-web/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/vscode-web/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index 1d503790f..d45f4ae38 100644 --- a/vscode-web/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/vscode-web/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -45,6 +45,8 @@ import { StringSHA1 } from 'vs/base/common/hash'; import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget'; import { GestureEvent } from 'vs/base/browser/touch'; import { IPaneCompositePart, IPaneCompositeSelectorPart } from 'vs/workbench/browser/parts/paneCompositePart'; +import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { DEFAULT_ICON } from 'vs/workbench/services/userDataProfile/common/userDataProfileIcons'; interface IPlaceholderViewContainer { readonly id: string; @@ -82,7 +84,6 @@ export class ActivitybarPart extends Part implements IPaneCompositeSelectorPart private static readonly ACTION_HEIGHT = 48; private static readonly ACCOUNTS_ACTION_INDEX = 0; - private static readonly GEAR_ICON = registerIcon('settings-view-bar-icon', Codicon.settingsGear, localize('settingsViewBarIcon', "Settings icon in the view bar.")); private static readonly ACCOUNTS_ICON = registerIcon('accounts-view-bar-icon', Codicon.account, localize('accountsViewBarIcon', "Accounts icon in the view bar.")); //#region IView @@ -136,6 +137,7 @@ export class ActivitybarPart extends Part implements IPaneCompositeSelectorPart @IContextKeyService private readonly contextKeyService: IContextKeyService, @IConfigurationService private readonly configurationService: IConfigurationService, @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService, + @IUserDataProfileService private readonly userDataProfileService: IUserDataProfileService, ) { super(Parts.ACTIVITYBAR_PART, { hasTitle: false }, themeService, storageService, layoutService); @@ -582,10 +584,11 @@ export class ActivitybarPart extends Part implements IPaneCompositeSelectorPart preventLoopNavigation: true })); - this.globalActivityAction = this._register(new ActivityAction({ - id: 'workbench.actions.manage', - name: localize('manage', "Manage"), - classNames: ThemeIcon.asClassNameArray(ActivitybarPart.GEAR_ICON), + this.globalActivityAction = this._register(new ActivityAction(this.createGlobalActivity())); + this._register(this.userDataProfileService.onDidChangeCurrentProfile(e => { + if (this.globalActivityAction) { + this.globalActivityAction.activity = this.createGlobalActivity(); + } })); if (this.accountsVisibilityPreference) { @@ -601,6 +604,14 @@ export class ActivitybarPart extends Part implements IPaneCompositeSelectorPart this.globalActivityActionBar.push(this.globalActivityAction); } + private createGlobalActivity(): IActivity { + return { + id: 'workbench.actions.manage', + name: localize('manage', "Manage"), + classNames: ThemeIcon.asClassNameArray(this.userDataProfileService.currentProfile.icon ? ThemeIcon.fromId(this.userDataProfileService.currentProfile.icon) : DEFAULT_ICON), + }; + } + private toggleAccountsActivity() { if (!!this.accountsActivityAction === this.accountsVisibilityPreference) { return; diff --git a/vscode-web/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css b/vscode-web/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css index 8f0bb6381..7f304713c 100644 --- a/vscode-web/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css +++ b/vscode-web/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css @@ -134,19 +134,19 @@ visibility: hidden; } -.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item > .action-label { +.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center > .monaco-toolbar > .monaco-action-bar > .actions-container > .action-item > .action-label { color: var(--vscode-titleBar-activeForeground); } -.monaco-workbench .part.titlebar.inactive > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item > .action-label { +.monaco-workbench .part.titlebar.inactive > .titlebar-container > .titlebar-center > .window-title > .command-center > .monaco-toolbar > .monaco-action-bar > .actions-container > .action-item > .action-label { color: var(--vscode-titleBar-inactiveForeground); } -.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .codicon { +.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center > .monaco-toolbar > .monaco-action-bar > .actions-container > .action-item > .action-label { color: inherit; } -.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center { +.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center { display: flex; align-items: stretch; color: var(--vscode-commandCenter-foreground); @@ -163,27 +163,40 @@ max-width: 600px; } -.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center:only-child { - margin-left: 0; /* no margin if there is only the command center, without nav buttons */ -} - -.monaco-workbench .part.titlebar.inactive > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center { - color: var(--vscode-titleBar-inactiveForeground); - border-color: var(--vscode-commandCenter-inactiveBorder) !important; +.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center .action-item.command-center-quick-pick { + display: flex; } -.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center .search-icon { +.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center .action-item.command-center-quick-pick .search-icon { font-size: 14px; opacity: .8; margin: auto 3px; } -.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center .search-label { +.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center .action-item.command-center-quick-pick .search-label { overflow: hidden; text-overflow: ellipsis; } -.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center:HOVER { +.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center.multiple { + justify-content: flex-start; + padding: 0 12px; +} + +.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center.multiple.active .action-label { + background-color: inherit; +} + +.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center:only-child { + margin-left: 0; /* no margin if there is only the command center, without nav buttons */ +} + +.monaco-workbench .part.titlebar.inactive > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center { + color: var(--vscode-titleBar-inactiveForeground); + border-color: var(--vscode-commandCenter-inactiveBorder) !important; +} + +.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center:HOVER { color: var(--vscode-commandCenter-activeForeground); background-color: var(--vscode-commandCenter-activeBackground); border-color: var(--vscode-commandCenter-activeBorder); diff --git a/vscode-web/src/vs/workbench/browser/web.main.ts b/vscode-web/src/vs/workbench/browser/web.main.ts index 7d88d86bb..569a515a2 100644 --- a/vscode-web/src/vs/workbench/browser/web.main.ts +++ b/vscode-web/src/vs/workbench/browser/web.main.ts @@ -62,9 +62,7 @@ import { IWorkspaceTrustEnablementService, IWorkspaceTrustManagementService } fr import { HTMLFileSystemProvider } from 'vs/platform/files/browser/htmlFileSystemProvider'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { mixin, safeStringify } from 'vs/base/common/objects'; -import { ICredentialsService } from 'vs/platform/credentials/common/credentials'; import { IndexedDB } from 'vs/base/browser/indexedDB'; -import { BrowserCredentialsService } from 'vs/workbench/services/credentials/browser/credentialsService'; import { IWorkspace } from 'vs/workbench/services/host/browser/browserHostService'; import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -189,7 +187,7 @@ export class BrowserMain extends Disposable { }, window: { withProgress: (options, task) => progressService.withProgress(options, task), - createTerminal: (options) => embedderTerminalService.createTerminal(options), + createTerminal: async (options) => embedderTerminalService.createTerminal(options), }, workspace: { openTunnel: async tunnelOptions => { @@ -317,7 +315,7 @@ export class BrowserMain extends Disposable { serviceCollection.set(IUserDataProfilesService, userDataProfilesService); const currentProfile = await this.getCurrentProfile(workspace, userDataProfilesService, environmentService); - const userDataProfileService = new UserDataProfileService(currentProfile, userDataProfilesService); + const userDataProfileService = new UserDataProfileService(currentProfile); serviceCollection.set(IUserDataProfileService, userDataProfileService); // Remote Agent @@ -389,10 +387,6 @@ export class BrowserMain extends Disposable { // // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // Credentials Service - const credentialsService = new BrowserCredentialsService(environmentService, remoteAgentService, productService); - serviceCollection.set(ICredentialsService, credentialsService); - const encryptionService = new EncryptionService(); serviceCollection.set(IEncryptionService, encryptionService); const secretStorageService = new BrowserSecretStorageService(storageService, encryptionService, environmentService, logService); @@ -400,7 +394,7 @@ export class BrowserMain extends Disposable { // Userdata Initialize Service const userDataInitializers: IUserDataInitializer[] = []; - userDataInitializers.push(new UserDataSyncInitializer(environmentService, secretStorageService, credentialsService, userDataSyncStoreManagementService, fileService, userDataProfilesService, storageService, productService, requestService, logService, uriIdentityService)); + userDataInitializers.push(new UserDataSyncInitializer(environmentService, secretStorageService, userDataSyncStoreManagementService, fileService, userDataProfilesService, storageService, productService, requestService, logService, uriIdentityService)); if (environmentService.options.profile) { userDataInitializers.push(new UserDataProfileInitializer(environmentService, fileService, userDataProfileService, storageService, logService, uriIdentityService, requestService)); } @@ -497,7 +491,6 @@ export class BrowserMain extends Disposable { const dialogService = accessor.get(IDialogService); const hostService = accessor.get(IHostService); const storageService = accessor.get(IStorageService); - const credentialsService = accessor.get(ICredentialsService); const logService = accessor.get(ILogService); const result = await dialogService.confirm({ message: localize('reset user data message', "Would you like to reset your data (settings, keybindings, extensions, snippets and UI State) and reload?") @@ -509,9 +502,6 @@ export class BrowserMain extends Disposable { if (storageService instanceof BrowserStorageService) { await storageService.clear(); } - if (typeof credentialsService.clear === 'function') { - await credentialsService.clear(); - } } catch (error) { logService.error(error); throw error; diff --git a/vscode-web/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.ts b/vscode-web/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.ts index 4326f0472..dc0c64119 100644 --- a/vscode-web/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.ts +++ b/vscode-web/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.ts @@ -436,8 +436,8 @@ export class FileEditorInput extends AbstractTextResourceEditorInput implements untypedInput.languageId = this.getLanguageId(); untypedInput.contents = (() => { const model = this.textFileService.files.get(this.resource); - if (model?.isDirty()) { - return model.textEditorModel.getValue(); // only if dirty + if (model?.isDirty() && !model.textEditorModel.isTooLargeForHeapOperation()) { + return model.textEditorModel.getValue(); // only if dirty and not too large } return undefined; diff --git a/vscode-web/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts b/vscode-web/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts index ef32ef478..d1be888a0 100644 --- a/vscode-web/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts +++ b/vscode-web/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts @@ -97,17 +97,17 @@ export class BuiltinExtensionsScannerService implements IBuiltinExtensionsScanne private async localizeManifest(extensionId: string, manifest: IExtensionManifest, fallbackTranslations: ITranslations): Promise { if (!this.nlsUrl) { - return localizeManifest(manifest, fallbackTranslations); + return localizeManifest(this.logService, manifest, fallbackTranslations); } // the `package` endpoint returns the translations in a key-value format similar to the package.nls.json file. const uri = URI.joinPath(this.nlsUrl, extensionId, 'package'); try { const res = await this.extensionResourceLoaderService.readExtensionResource(uri); const json = JSON.parse(res.toString()); - return localizeManifest(manifest, json, fallbackTranslations); + return localizeManifest(this.logService, manifest, json, fallbackTranslations); } catch (e) { this.logService.error(e); - return localizeManifest(manifest, fallbackTranslations); + return localizeManifest(this.logService, manifest, fallbackTranslations); } } } diff --git a/yarn.lock b/yarn.lock index c948ac9ec..6c4131438 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31,10 +31,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@github1s/vscode-web@0.13.0": - version "0.13.0" - resolved "https://registry.yarnpkg.com/@github1s/vscode-web/-/vscode-web-0.13.0.tgz#5a34f3adf44a91f0f897458cb162fe15e747c995" - integrity sha512-HC3/Aw8t3F/mTFUysVJVP+dDJCYxX+NKgLl6LAmrUteZCA9Bhl9HTRdJVwV3CX05Ksh2VFKGOCEMx8g+Nrn1Dg== +"@github1s/vscode-web@0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@github1s/vscode-web/-/vscode-web-0.14.0.tgz#a17761b468e6bd4fe6ad10952faab45d300e1bcc" + integrity sha512-8OUnxC77eD0iauRilEomlK2rduTzT0fK53J2R7ribHKTYqB+k6VWbpqF9QhZEc1Rw+0cHu2HShlgdmgOcIqObw== dependencies: "@vscode/iconv-lite-umd" "0.7.0" "@vscode/vscode-languagedetection" "1.0.21" @@ -2741,10 +2741,10 @@ multicast-dns@^7.2.5: dns-packet "^5.2.2" thunky "^1.0.2" -nanoid@^3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" - integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== +nanoid@^3.3.6: + version "3.3.6" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" + integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== natural-compare@^1.4.0: version "1.4.0" @@ -3158,11 +3158,11 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== postcss@^8.4.19: - version "8.4.21" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.21.tgz#c639b719a57efc3187b13a1d765675485f4134f4" - integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== + version "8.4.31" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d" + integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ== dependencies: - nanoid "^3.3.4" + nanoid "^3.3.6" picocolors "^1.0.0" source-map-js "^1.0.2"