From 5e2e5087a7825f010f33600510d16552351aacd7 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 21 Jul 2024 23:53:39 +0200 Subject: [PATCH] chore: update sources --- packages/tm-themes/NOTICE | 2 +- packages/tm-themes/README.md | 4 +-- packages/tm-themes/index.js | 12 ++++---- packages/tm-themes/themes/dracula-soft.json | 2 +- packages/tm-themes/themes/dracula.json | 2 +- scripts/shared/github.ts | 4 +-- sources-themes.ts | 34 ++++++++++++++------- 7 files changed, 36 insertions(+), 24 deletions(-) diff --git a/packages/tm-themes/NOTICE b/packages/tm-themes/NOTICE index 0eadde8..8986c72 100644 --- a/packages/tm-themes/NOTICE +++ b/packages/tm-themes/NOTICE @@ -120,7 +120,7 @@ SOFTWARE. ========================================================================================================= Files: dracula.json, dracula-soft.json -License: https://raw.githubusercontent.com/dracula/visual-studio-code/master/LICENSE +License: https://raw.githubusercontent.com/dracula/visual-studio-code/main/LICENSE SPDX: MIT --------------------------------------------------------------------------------------------------------- The MIT License (MIT) diff --git a/packages/tm-themes/README.md b/packages/tm-themes/README.md index 3fe368a..3604bca 100644 --- a/packages/tm-themes/README.md +++ b/packages/tm-themes/README.md @@ -46,8 +46,8 @@ import { themes } from 'tm-themes' | Catppuccin Macchiato | `catppuccin-macchiato` | [catppuccin/vscode](https://github.com/catppuccin/vscode/blob/94e2135389b52eff1b372473d0676537393fbf9a/packages/catppuccin-vsc/package.json) | [MIT](https://raw.githubusercontent.com/catppuccin/vscode/main/LICENSE) | 44.37 kB | | Catppuccin Mocha | `catppuccin-mocha` | [catppuccin/vscode](https://github.com/catppuccin/vscode/blob/94e2135389b52eff1b372473d0676537393fbf9a/packages/catppuccin-vsc/package.json) | [MIT](https://raw.githubusercontent.com/catppuccin/vscode/main/LICENSE) | 44.36 kB | | Dark Plus | `dark-plus` | [microsoft/vscode](https://github.com/microsoft/vscode/blob/cc4775f55aff152db2417dfaaddc643ee90b31f9/extensions/theme-defaults/themes/dark_plus.json) | [MIT](https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt) | 8.64 kB | -| Dracula | `dracula` | [dracula/visual-studio-code](https://github.com/dracula/visual-studio-code/blob/61743d6ea21cde34d9ad1009ec784ffe6f5e457c/src/dracula.yml) | [MIT](https://raw.githubusercontent.com/dracula/visual-studio-code/master/LICENSE) | 20.51 kB | -| Dracula Soft | `dracula-soft` | [dracula/visual-studio-code](https://github.com/dracula/visual-studio-code/blob/61743d6ea21cde34d9ad1009ec784ffe6f5e457c/src/dracula.yml) | [MIT](https://raw.githubusercontent.com/dracula/visual-studio-code/master/LICENSE) | 20.52 kB | +| Dracula Theme | `dracula` | [dracula/visual-studio-code](https://github.com/dracula/visual-studio-code/blob/61743d6ea21cde34d9ad1009ec784ffe6f5e457c/src/dracula.yml) | [MIT](https://raw.githubusercontent.com/dracula/visual-studio-code/main/LICENSE) | 20.51 kB | +| Dracula Theme Soft | `dracula-soft` | [dracula/visual-studio-code](https://github.com/dracula/visual-studio-code/blob/61743d6ea21cde34d9ad1009ec784ffe6f5e457c/src/dracula.yml) | [MIT](https://raw.githubusercontent.com/dracula/visual-studio-code/main/LICENSE) | 20.52 kB | | GitHub Dark | `github-dark` | [primer/github-vscode-theme](https://github.com/primer/github-vscode-theme/blob/f47b83f1acebb7fba4a3ec0bdb9385f85e6e8aa1/src/theme.js) | [MIT](https://raw.githubusercontent.com/primer/github-vscode-theme/main/LICENSE) | 11.08 kB | | GitHub Dark Default | `github-dark-default` | [primer/github-vscode-theme](https://github.com/primer/github-vscode-theme/blob/f47b83f1acebb7fba4a3ec0bdb9385f85e6e8aa1/src/theme.js) | [MIT](https://raw.githubusercontent.com/primer/github-vscode-theme/main/LICENSE) | 14.00 kB | | GitHub Dark Dimmed | `github-dark-dimmed` | [primer/github-vscode-theme](https://github.com/primer/github-vscode-theme/blob/f47b83f1acebb7fba4a3ec0bdb9385f85e6e8aa1/src/theme.js) | [MIT](https://raw.githubusercontent.com/primer/github-vscode-theme/main/LICENSE) | 14.00 kB | diff --git a/packages/tm-themes/index.js b/packages/tm-themes/index.js index a7d651e..b90077c 100644 --- a/packages/tm-themes/index.js +++ b/packages/tm-themes/index.js @@ -91,22 +91,22 @@ export const themes = [ type: 'dark', }, { - byteSize: 21000, - displayName: 'Dracula', + byteSize: 21006, + displayName: 'Dracula Theme', lastUpdate: '2023-07-15T21:35:24Z', license: 'MIT', - licenseUrl: 'https://raw.githubusercontent.com/dracula/visual-studio-code/master/LICENSE', + licenseUrl: 'https://raw.githubusercontent.com/dracula/visual-studio-code/main/LICENSE', name: 'dracula', sha: '61743d6ea21cde34d9ad1009ec784ffe6f5e457c', source: 'https://github.com/dracula/visual-studio-code/blob/61743d6ea21cde34d9ad1009ec784ffe6f5e457c/src/dracula.yml', type: 'dark', }, { - byteSize: 21010, - displayName: 'Dracula Soft', + byteSize: 21016, + displayName: 'Dracula Theme Soft', lastUpdate: '2023-07-15T21:35:24Z', license: 'MIT', - licenseUrl: 'https://raw.githubusercontent.com/dracula/visual-studio-code/master/LICENSE', + licenseUrl: 'https://raw.githubusercontent.com/dracula/visual-studio-code/main/LICENSE', name: 'dracula-soft', sha: '61743d6ea21cde34d9ad1009ec784ffe6f5e457c', source: 'https://github.com/dracula/visual-studio-code/blob/61743d6ea21cde34d9ad1009ec784ffe6f5e457c/src/dracula.yml', diff --git a/packages/tm-themes/themes/dracula-soft.json b/packages/tm-themes/themes/dracula-soft.json index 50a60d9..6ae317b 100644 --- a/packages/tm-themes/themes/dracula-soft.json +++ b/packages/tm-themes/themes/dracula-soft.json @@ -196,7 +196,7 @@ "titleBar.inactiveForeground": "#7b7f8b", "walkThrough.embeddedEditorBackground": "#262626" }, - "displayName": "Dracula Soft", + "displayName": "Dracula Theme Soft", "name": "dracula-soft", "semanticHighlighting": true, "tokenColors": [ diff --git a/packages/tm-themes/themes/dracula.json b/packages/tm-themes/themes/dracula.json index 2c23a1b..2172cba 100644 --- a/packages/tm-themes/themes/dracula.json +++ b/packages/tm-themes/themes/dracula.json @@ -196,7 +196,7 @@ "titleBar.inactiveForeground": "#6272A4", "walkThrough.embeddedEditorBackground": "#21222C" }, - "displayName": "Dracula", + "displayName": "Dracula Theme", "name": "dracula", "semanticHighlighting": true, "tokenColors": [ diff --git a/scripts/shared/github.ts b/scripts/shared/github.ts index e0cefdb..31a86f1 100644 --- a/scripts/shared/github.ts +++ b/scripts/shared/github.ts @@ -14,7 +14,7 @@ const _cacheGetCommit = new Map>() function _getLicenseUrl(repo: string) { return octokit.request('GET /repos/{owner}/{repo}/license', { owner: repo.split('/')[0], repo: repo.split('/')[1] }) - .then((r) => { + .then((r: any) => { return r.data }) } @@ -24,7 +24,7 @@ function _getCommit(repo: string, branch: string, path: string): Promise { + .then((r: any) => { if (!r.data.length) { console.error(r, path) throw new Error(`Failed to resolve sha for ${JSON.stringify({ repo, branch, path })}}`) diff --git a/sources-themes.ts b/sources-themes.ts index 6e611f4..4f86da3 100644 --- a/sources-themes.ts +++ b/sources-themes.ts @@ -171,8 +171,8 @@ export const sourcesMarketplace: ThemeSource[] = [ 'dracula-theme.theme-dracula', 'https://github.com/dracula/visual-studio-code/blob/main/src/dracula.yml', [ - 'Dracula', - 'Dracula Soft', + ['Dracula Theme', 'dracula'], + ['Dracula Theme Soft', 'dracula-soft'], ], ), ...generateMarketplaceSource( @@ -204,14 +204,26 @@ export const sources = [ ...sourcesMarketplace, ] -function generateMarketplaceSource(name: string, source: string, themes: string[]): ThemeSource[] { - return themes.map(theme => ({ - name: theme.toLowerCase().normalize('NFD').replace(/[\u0300-\u036F]/g, '').trim().replace(/\s+/g, '-'), - displayName: theme, - source, - marketplace: { +function generateMarketplaceSource( + pkg: string, + source: string, + themes: (string | [string, string])[], +): ThemeSource[] { + return themes.map((theme): ThemeSource => { + const name = Array.isArray(theme) + ? theme[1] + : theme.toLowerCase().normalize('NFD').replace(/[\u0300-\u036F]/g, '').trim().replace(/\s+/g, '-') + const themeName = Array.isArray(theme) + ? theme[0] + : theme + return { name, - theme, - }, - })) + displayName: themeName, + source, + marketplace: { + name: pkg, + theme: themeName, + }, + } + }) }