From acde3d1c04c38d60a774bbf9fbc5b36f2fc47729 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Mon, 19 May 2025 01:41:39 +0200 Subject: [PATCH] Release notes for 1.12.6b --- .github/workflows/ci-pipeline.yml | 2 +- biome.json | 15 +- package-lock.json | 2 +- package.json | 2 +- scripts/twilight-to-stable.py | 1 - src/components/ReleaseNoteItem.astro | 234 +++++++++--------- src/components/ReleaseNoteListItem.astro | 50 ++++ src/i18n/en/translation.json | 28 +-- .../[...locale]/release-notes/index.astro | 29 +-- src/release-notes.ts | 3 +- src/release-notes/stable.json | 183 ++++++++------ src/release-notes/twilight.json | 3 +- src/tests/components/PlatformDownload.test.ts | 20 +- 13 files changed, 324 insertions(+), 248 deletions(-) create mode 100644 src/components/ReleaseNoteListItem.astro diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index e979d69..74889ac 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -108,4 +108,4 @@ jobs: name: build path: dist - name: Run Playwright tests - run: npx playwright test \ No newline at end of file + run: npx playwright test diff --git a/biome.json b/biome.json index 1f2f33b..4da3470 100644 --- a/biome.json +++ b/biome.json @@ -41,5 +41,18 @@ "defaultBranch": "main", "root": ".", "useIgnoreFile": true - } + }, + "overrides": [ + { + "include": ["*.astro"], + "linter": { + "rules": { + "style": { + "useConst": "off", + "useImportType": "off" + } + } + } + } + ] } diff --git a/package-lock.json b/package-lock.json index 1a9c8f2..fa9c529 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "autoprefixer": "10.4.14", "clsx": "^2.1.1", "date-fns": "^4.1.0", - "free-astro-components": "^1.1.1", + "free-astro-components": "^1.2.0", "lucide-astro": "^0.460.0", "lucide-react": "^0.475.0", "motion": "^11.13.5", diff --git a/package.json b/package.json index 6a1cdfa..810ed4e 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "autoprefixer": "10.4.14", "clsx": "^2.1.1", "date-fns": "^4.1.0", - "free-astro-components": "^1.1.1", + "free-astro-components": "^1.2.0", "lucide-astro": "^0.460.0", "lucide-react": "^0.475.0", "motion": "^11.13.5", diff --git a/scripts/twilight-to-stable.py b/scripts/twilight-to-stable.py index 3870d70..bc35e93 100644 --- a/scripts/twilight-to-stable.py +++ b/scripts/twilight-to-stable.py @@ -44,7 +44,6 @@ def main(): with open(TWILIGHT_RELEASE_NOTES, "w") as f: json.dump({ "version": "xxx", - "image": False, "extra": "", "fixes": [], "features": [], diff --git a/src/components/ReleaseNoteItem.astro b/src/components/ReleaseNoteItem.astro index af6b715..ebe47e2 100644 --- a/src/components/ReleaseNoteItem.astro +++ b/src/components/ReleaseNoteItem.astro @@ -1,10 +1,10 @@ --- -import { Accordion, AccordionItem } from 'free-astro-components' import InfoIcon from '~/icons/InfoIcon.astro' import { releaseNotes as releaseNotesData } from '~/release-notes' import { getLocale, getPath, getUI } from '~/utils/i18n' -import { type BreakingChange, type ReleaseNote, getReleaseNoteFirefoxVersion } from '../release-notes' +import { type ReleaseNote, getReleaseNoteFirefoxVersion } from '../release-notes' +import ReleaseNoteListItem from './ReleaseNoteListItem.astro' export type Props = ReleaseNote const { isTwilight, ...props } = Astro.props @@ -31,13 +31,76 @@ let compareLink = '' if (prevReleaseNote && !isTwilight) { compareLink = `https://github.com/zen-browser/desktop/compare/${prevReleaseNote.version}...${props.version}` } + +const isLatest = currentReleaseIndex === 0 + +const listItems = {} +// biome-ignore lint/suspicious/noExplicitAny: +const generateItems = (items: any, type: string) => { + if (!items) return + if (!listItems[type]) { + listItems[type] = [] + } + // biome-ignore lint/complexity/noForEach: + items.forEach((item) => { + switch (type) { + case 'feature': + listItems[type].push({ + type: 'feature', + content: item, + }) + break + case 'fix': + listItems[type].push({ + type: 'fix', + content: item.description ?? item, + ...(item.issue + ? { + link: { + text: `Issue #${item.issue}`, + href: `https://github.com/zen-browser/desktop/issues/${item.issue}`, + }, + } + : {}), + }) + break + case 'security': + listItems[type].push({ + type: 'security', + link: { + text: 'Security Advisory', + href: item, + }, + }) + break + case 'theme': + listItems[type].push({ + type: 'theme', + content: item, + }) + break + case 'break': + listItems[type].push({ + type: 'break', + content: item, + }) + break + } + }) +} +generateItems(props.security ? [props.security] : null, 'security') +generateItems(props.fixes, 'fix') +generateItems(props.features, 'feature') +generateItems(props.themeChanges, 'theme') +generateItems(props.breakingChanges, 'break') +generateItems(props.knownIssues, 'known') ---
-
+
{ isTwilight ? ( ) : null } -

+

- {date && date.toLocaleDateString('en-US', { dateStyle: 'long' })} - -
+
+ {date && date.toLocaleDateString('en-US', { dateStyle: 'long' })} +
+
+ { + props.extra?.length ? ( +

+ ')} /> +

+ ) : null + } + {isTwilight || isLatest ? ( + +
{isTwilight ? : null}

{isTwilight ? <>{releaseNoteItem.twilightWarning} : null}

- + ) : null} +
{ - props.extra ? ( -

- ')} /> -

- ) : null - } -
- - { - props.fixes?.length ? ( - -
- - ) : null - } - { - props.features?.length ? ( - -
    - {props.features.map((feature: string) => ( -
  • {feature}
  • - ))} -
-
- ) : null - } - { - props.themeChanges?.length ? ( - -
    - {props.themeChanges.map((themeChange: string) => ( -
  • {themeChange}
  • - ))} -
-
- ) : null - } - { - props.breakingChanges?.length ? ( - -
    - {props.breakingChanges.map((breakingChange: BreakingChange) => ( -
  • - {typeof breakingChange === 'string' ? ( - - ) : ( - <> - {breakingChange.description} - - {releaseNoteItem.learnMore} - - - )} -
  • - ))} -
-
- ) : null - } - + Object.keys(listItems).map((type) => { + const items = listItems[type]; + if (items.length === 0) return null; + return ( +
    + {items.map((item: any) => ( + + ))} +
+ ); +
+ }) + }