diff --git a/src/presets/semver-workflow.ts b/src/presets/semver-workflow.ts index 4f2ca0f1..99307c67 100644 --- a/src/presets/semver-workflow.ts +++ b/src/presets/semver-workflow.ts @@ -15,7 +15,12 @@ import path from 'path' import {readFile, writeFile} from '../util/files' import {errorToUndefined} from '../util/errorToUndefined' import {PackageJson} from '../actions/verify/types' -import {developTestSnippet, getLicenseText, installationSnippet} from '../util/readme' +import { + developTestSnippet, + getLicenseText, + installationSnippet, + v3BannerNotice, +} from '../util/readme' import {getUserInfo} from '../util/user' export const semverWorkflowPreset: Preset = { @@ -95,14 +100,6 @@ async function readmeSnippets(options: InjectOptions) { const bestEffortUrl = readmeBaseurl(pkg) - const v3Banner = outdent` - > **NOTE** - > - > This is the **Sanity Studio v3 version** of ${pkg.name}. - > - > For the v2 version, please refer to the [v2-branch](${bestEffortUrl}). - ` - const install = installationSnippet(pkg.name ?? 'unknown') const usage = outdent` @@ -121,7 +118,7 @@ async function readmeSnippets(options: InjectOptions) { ` return { - v3Banner, + v3Banner: v3BannerNotice(), install, usage, license, diff --git a/src/util/readme.ts b/src/util/readme.ts index 2ca5f1f3..f8282d4f 100644 --- a/src/util/readme.ts +++ b/src/util/readme.ts @@ -10,6 +10,8 @@ export function generateReadme(data: PackageData) { return outdent` # ${pluginName} + ${v3BannerNotice()} + ${installationSnippet(pluginName ?? 'unknown')} ## Usage @@ -31,6 +33,10 @@ export function generateReadme(data: PackageData) { ` } +export function v3BannerNotice() { + return `> This is a **Sanity Studio v3** plugin.` +} + export function installationSnippet(packageName: string) { return outdent` ## Installation