From 74ec6a25f394065ad9ac136b3e8da6e2ff88843d Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 20 Nov 2020 13:54:14 +0800 Subject: [PATCH] Remove changelog filename `pr-` prefix (#9667) --- changelog_unreleased/TEMPLATE.md | 2 +- scripts/draft-blog-post.js | 2 +- scripts/lint-changelog.js | 4 ++-- scripts/release/steps/update-changelog.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/changelog_unreleased/TEMPLATE.md b/changelog_unreleased/TEMPLATE.md index 4700d04e1..4e961c104 100644 --- a/changelog_unreleased/TEMPLATE.md +++ b/changelog_unreleased/TEMPLATE.md @@ -6,7 +6,7 @@ - For TypeScript specific syntax, choose `typescript/`. - If your PR applies to multiple languages, such as TypeScript/Flow, choose one folder and mention which languages it applies to. -2. In your chosen folder, create a file with your PR number: `pr-XXXX.md`. For example: `typescript/pr-6728.md`. +2. In your chosen folder, create a file with your PR number: `XXXX.md`. For example: `typescript/6728.md`. 3. Copy the content below and paste it in your new file. diff --git a/scripts/draft-blog-post.js b/scripts/draft-blog-post.js index 2a3daad2a..b71290e35 100644 --- a/scripts/draft-blog-post.js +++ b/scripts/draft-blog-post.js @@ -65,7 +65,7 @@ for (const dir of dirs) { category.entries = fs .readdirSync(dirPath) - .filter((fileName) => /^pr-\d+\.md$/.test(fileName)) + .filter((fileName) => /^\d+\.md$/.test(fileName)) .map((fileName) => { const [title, ...rest] = fs .readFileSync(path.join(dirPath, fileName), "utf8") diff --git a/scripts/lint-changelog.js b/scripts/lint-changelog.js index 401cbf494..f7548a247 100644 --- a/scripts/lint-changelog.js +++ b/scripts/lint-changelog.js @@ -79,12 +79,12 @@ for (const category of CHANGELOG_CATEGORIES) { continue; } - const match = prFile.match(/^pr-(\d{4,})\.md$/); + const match = prFile.match(/^(\d{4,})\.md$/); const displayPath = `${CHANGELOG_DIR}/${category}/${prFile}`; if (!match) { showErrorMessage( - `[${displayPath}]: Filename is not in form of "pr-{PR_NUMBER}.md".` + `[${displayPath}]: Filename is not in form of "{PR_NUMBER}.md".` ); continue; } diff --git a/scripts/release/steps/update-changelog.js b/scripts/release/steps/update-changelog.js index 76cfad53a..3f8adf195 100644 --- a/scripts/release/steps/update-changelog.js +++ b/scripts/release/steps/update-changelog.js @@ -56,7 +56,7 @@ module.exports = async function ({ version, previousVersion }) { outdentString(chalk` {yellow.bold A manual step is necessary.} - You can copy the entries from {bold changelog_unreleased/*/pr-*.md} to {bold CHANGELOG.md} + You can copy the entries from {bold changelog_unreleased/*/*.md} to {bold CHANGELOG.md} and update it accordingly. You don't need to commit the file, the script will take care of that.