From 6237398af95397c7c2d4f32eb4d800bf8bf3bfb5 Mon Sep 17 00:00:00 2001 From: xiaodemen Date: Mon, 17 Jan 2022 15:58:23 +0800 Subject: [PATCH] chore: add date in changelog Change-Id: I91502c88852ff3ae61ba45c835d76bd21ec1e8ce --- one/build/changelog.js | 9 +++++---- one/docs/changelog.vue | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/one/build/changelog.js b/one/build/changelog.js index 491e8d2..8211663 100644 --- a/one/build/changelog.js +++ b/one/build/changelog.js @@ -1,13 +1,13 @@ import { readFileSync } from 'fs' import cheerio from 'cheerio' import { render } from './page' -const VERSION_RE = /^(\d+\.\d+\.\d+(?:-[a-z]+(?:\.\d+)?)?)(?:\s+"([^"]+)")?$/i +const VERSION_RE = /^(\d+\.\d+\.\d+(?:-[a-z]+(?:\.\d+)?)?)(?:\s+"([^"]+)")?(?:\s+\((\d{4}-\d{2}-\d{2})\))?$/i function getVersion (title = '') { - const [, version, codeName] = title.trim().match(VERSION_RE) || [] + const [, version, codeName, date] = title.trim().match(VERSION_RE) || [] if (!version) { return null } - return [version, codeName] + return [version, codeName, date] } const TYPE_MAP = { @@ -65,10 +65,11 @@ function extract (html) { $versions.each((_, el) => { const $version = $(el) - const [version, codeName] = getVersion($(el).text()) || [] + const [version, codeName, date] = getVersion($(el).text()) || [] const versionLog = { version, codeName, + date, changeset: [] } diff --git a/one/docs/changelog.vue b/one/docs/changelog.vue index e963fcc..6a4bbaf 100644 --- a/one/docs/changelog.vue +++ b/one/docs/changelog.vue @@ -75,7 +75,7 @@
- {{ version }}{{ codeName }} + {{ version }}{{ codeName }}{{ date }}