From 6676659f06a92dce1d3d17318556fc4f0bca38cc Mon Sep 17 00:00:00 2001 From: wxzhang Date: Fri, 24 Mar 2023 21:53:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=9C=A8`@voerkai18n/cli`=E4=B8=AD?= =?UTF-8?q?=E5=BC=95=E5=85=A5`string.prototype.replaceAll`,=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E5=9C=A8`nodejs=2015`=E4=BB=A5=E4=B8=8B=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E5=B8=B8=E4=BD=BF=E7=94=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/src/guide/intro/history.md | 4 ++++ packages/cli/index.js | 4 +++- packages/cli/package.json | 1 + pnpm-lock.yaml | 13 +++++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/src/guide/intro/history.md b/docs/src/guide/intro/history.md index a475322..8910907 100644 --- a/docs/src/guide/intro/history.md +++ b/docs/src/guide/intro/history.md @@ -1,5 +1,9 @@ # 更新日志 +## 2023/3/24 + +- 在`@voerkai18n/cli`中引入`string.prototype.replaceAll`,解决在`nodejs 15`以下无法正常使用的问题 + ## 2023/2/13 - 修改`@voerkai18n/cli`命令入口文件的换行行为`lf` diff --git a/packages/cli/index.js b/packages/cli/index.js index 3adce4d..807c212 100644 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -5,7 +5,9 @@ const semver = require('semver') const logger = createLogger() const { t } = require("./i18nProxy") const { getPackageReleaseInfo } = require("@voerkai18n/utils"); - + +const replaceAll = require('string.prototype.replaceall'); +replaceAll.shim() const program = new Command(); program diff --git a/packages/cli/package.json b/packages/cli/package.json index 700529b..55c10ba 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -45,6 +45,7 @@ "qs": "^6.10.3", "semver": "^7.3.7", "shelljs": "^0.8.5", + "string.prototype.replaceall": "^1.0.7", "through2": "^4.0.2", "vinyl": "^2.2.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f7ff91..d9a6578 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -224,6 +224,7 @@ importers: qs: ^6.10.3 semver: ^7.3.7 shelljs: ^0.8.5 + string.prototype.replaceall: ^1.0.7 through2: ^4.0.2 vinyl: ^2.2.1 dependencies: @@ -244,6 +245,7 @@ importers: qs: 6.11.0 semver: 7.3.8 shelljs: 0.8.5 + string.prototype.replaceall: 1.0.7 through2: 4.0.2 vinyl: 2.2.1 @@ -15732,6 +15734,17 @@ packages: regexp.prototype.flags: 1.4.3 side-channel: 1.0.4 + /string.prototype.replaceall/1.0.7: + resolution: {integrity: sha512-xB2WV2GlSCSJT5dMGdhdH1noMPiAB91guiepwTYyWY9/0Vq/TZ7RPmnOSUGAEvry08QIK7EMr28aAii+9jC6kw==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.21.1 + get-intrinsic: 1.2.0 + has-symbols: 1.0.3 + is-regex: 1.1.4 + dev: false + /string.prototype.trimend/1.0.6: resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} dependencies: From 5e0030f2262357f1515d254c4b62c964e53dd2cd Mon Sep 17 00:00:00 2001 From: wxzhang Date: Fri, 24 Mar 2023 21:54:15 +0800 Subject: [PATCH 2/2] autopub release: @voerkai18n/cli(v1.0.65) --- packages/cli/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 55c10ba..cea01e0 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@voerkai18n/cli", - "version": "1.0.65", + "version": "1.0.66", "description": "命令行工具,用来初始化/提取/编译/自动翻译等工具链", "main": "index.js", "homepage": "https://gitee.com/zhangfisher/voerka-i18n", @@ -49,5 +49,5 @@ "through2": "^4.0.2", "vinyl": "^2.2.1" }, - "lastPublish": "2023-02-28T20:14:51+08:00" + "lastPublish": "2023-03-24T21:54:14+08:00" } \ No newline at end of file