From 2047e0dc1251465ea2035eeca62131b42bb872df Mon Sep 17 00:00:00 2001 From: Xiyuan Chen <52963600+GareArc@users.noreply.github.com> Date: Thu, 25 Jun 2026 17:49:42 -0700 Subject: [PATCH] fix(cli): use a(n) article in difyctl prerelease warning (#37976) --- cli/src/commands/version/version.test.ts | 2 +- cli/src/version/render.test.ts | 10 +++++----- cli/src/version/render.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/src/commands/version/version.test.ts b/cli/src/commands/version/version.test.ts index 60512e01d04..33b7c17b769 100644 --- a/cli/src/commands/version/version.test.ts +++ b/cli/src/commands/version/version.test.ts @@ -158,6 +158,6 @@ describe('Version command', () => { if (output?.kind !== 'formatted') throw new Error('expected formatted output') - expect(output.data.text()).toContain('WARNING: This build is a rc release') + expect(output.data.text()).toContain('WARNING: This build is a(n) rc release') }) }) diff --git a/cli/src/version/render.test.ts b/cli/src/version/render.test.ts index c88ce998b9c..2543ebf7748 100644 --- a/cli/src/version/render.test.ts +++ b/cli/src/version/render.test.ts @@ -60,7 +60,7 @@ describe('renderVersionText', () => { } const text = renderVersionText(report) - expect(text).toContain('WARNING: This build is a rc release') + expect(text).toContain('WARNING: This build is a(n) rc release') expect(text).toContain('install or wait for the stable channel') }) @@ -72,7 +72,7 @@ describe('renderVersionText', () => { } const text = renderVersionText(report) - expect(text).toContain('WARNING: This build is a alpha release') + expect(text).toContain('WARNING: This build is a(n) alpha release') expect(text).toContain('install or wait for the stable channel') }) @@ -84,7 +84,7 @@ describe('renderVersionText', () => { } const text = renderVersionText(report) - expect(text).toContain('WARNING: This build is a edge release') + expect(text).toContain('WARNING: This build is a(n) edge release') expect(text).toContain('install or wait for the stable channel') }) @@ -140,7 +140,7 @@ describe('renderVersionText', () => { // RC warning) ran, yet the output is byte-clean. expect(plain).not.toMatch(ANSI_RE) expect(plain).toContain('Compatibility: incompatible') - expect(plain).toContain('WARNING: This build is a rc release') + expect(plain).toContain('WARNING: This build is a(n) rc release') }) describe('with picocolors stubbed to always emit ANSI', () => { @@ -183,7 +183,7 @@ describe('renderVersionText', () => { expect(colored).toMatch(ANSI_RE) expect(colored).toContain('Compatibility: incompatible') // prerelease warning lines also routed through yellow. - expect(colored).toContain('WARNING: This build is a rc release') + expect(colored).toContain('WARNING: This build is a(n) rc release') }) }) diff --git a/cli/src/version/render.ts b/cli/src/version/render.ts index fa8ee721202..44dded18e28 100644 --- a/cli/src/version/render.ts +++ b/cli/src/version/render.ts @@ -4,7 +4,7 @@ import { colorScheme } from '@/sys/io/color' function prereleaseWarning(channel: Channel): readonly string[] { return [ - `WARNING: This build is a ${channel} release. It is not stable`, + `WARNING: This build is a(n) ${channel} release. It is not stable`, ' and may have bugs. For production use, install or wait for the stable channel.', ] }