From 155ce18392b9013d370ddf1900a069006f6ff5b7 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 28 Jun 2023 03:06:08 +0000 Subject: [PATCH 1/2] chore(release): 1.16.0 [skip ci] # [1.16.0](https://github.com/liuweiGL/vite-plugin-mkcert/compare/v1.15.0...v1.16.0) (2023-06-28) ### Features * Support more platforms and architectures ([0cb9571](https://github.com/liuweiGL/vite-plugin-mkcert/commit/0cb9571734db5daafe281a8da81f9c427ff51935)), closes [#68](https://github.com/liuweiGL/vite-plugin-mkcert/issues/68) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f303b1..59d0728 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.16.0](https://github.com/liuweiGL/vite-plugin-mkcert/compare/v1.15.0...v1.16.0) (2023-06-28) + + +### Features + +* Support more platforms and architectures ([0cb9571](https://github.com/liuweiGL/vite-plugin-mkcert/commit/0cb9571734db5daafe281a8da81f9c427ff51935)), closes [#68](https://github.com/liuweiGL/vite-plugin-mkcert/issues/68) + # [1.15.0](https://github.com/liuweiGL/vite-plugin-mkcert/compare/v1.14.1...v1.15.0) (2023-05-04) diff --git a/package.json b/package.json index 9062698..62054da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vite-plugin-mkcert", - "version": "1.15.0", + "version": "1.16.0", "description": "Provide certificates for vite's https dev service", "repository": { "type": "git", From 5ea7391104282f05ce0f9785b50a08b18121b3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=93=E8=89=AF?= <1204183885@qq.com> Date: Sun, 19 Nov 2023 22:36:11 -0300 Subject: [PATCH 2/2] fix typos and use filter(Boolean) to simplified Code (#71) * fix: typos * chore: use filter(Boolean) --- plugin/index.ts | 2 +- plugin/mkcert/index.ts | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/plugin/index.ts b/plugin/index.ts index e849f77..36b4f2d 100644 --- a/plugin/index.ts +++ b/plugin/index.ts @@ -40,7 +40,7 @@ const plugin = (options: MkcertPluginOptions = {}): PluginOption => { allHosts.push(server.host) } - const uniqueHosts = Array.from(new Set(allHosts)).filter(item => !!item) + const uniqueHosts = Array.from(new Set(allHosts)).filter(Boolean) const certificate = await mkcert.install(uniqueHosts) const httpsConfig = { diff --git a/plugin/mkcert/index.ts b/plugin/mkcert/index.ts index 100cf72..34fda04 100644 --- a/plugin/mkcert/index.ts +++ b/plugin/mkcert/index.ts @@ -129,12 +129,12 @@ class Mkcert { this.config = new Config({ savePath: this.savePath }) } - private async getMkcertBinnary() { - let binnary + private async getMkcertBinary() { + let binary if (this.localMkcert) { if (await exists(this.localMkcert)) { - binnary = this.localMkcert + binary = this.localMkcert } else { this.logger.error( pc.red( @@ -143,9 +143,9 @@ class Mkcert { ) } } else if (await exists(this.savedMkcert)) { - binnary = this.savedMkcert + binary = this.savedMkcert } - return binnary ? escape(binnary) : undefined + return binary ? escape(binary) : undefined } private async checkCAExists() { @@ -158,8 +158,8 @@ class Mkcert { return } - const mkcertBinnary = await this.getMkcertBinnary() - const commandStatement = `${mkcertBinnary} -CAROOT` + const mkcertBinary = await this.getMkcertBinary() + const commandStatement = `${mkcertBinary} -CAROOT` debug(`Exec ${commandStatement}`) @@ -193,9 +193,9 @@ class Mkcert { private async createCertificate(hosts: string[]) { const names = hosts.join(' ') - const mkcertBinnary = await this.getMkcertBinnary() + const mkcertBinary = await this.getMkcertBinary() - if (!mkcertBinnary) { + if (!mkcertBinary) { debug( `Mkcert does not exist, unable to generate certificate for ${names}` ) @@ -204,7 +204,7 @@ class Mkcert { await ensureDirExist(this.savePath) await this.retainExistedCA() - const cmd = `${mkcertBinnary} -install -key-file ${escape( + const cmd = `${mkcertBinary} -install -key-file ${escape( this.keyFilePath )} -cert-file ${escape(this.certFilePath)} ${names}` @@ -240,9 +240,9 @@ class Mkcert { await ensureDirExist(this.savePath) await this.config.init() - const mkcertBinnary = await this.getMkcertBinnary() + const mkcertBinary = await this.getMkcertBinary() - if (!mkcertBinnary) { + if (!mkcertBinary) { await this.initMkcert() } else if (this.autoUpgrade) { await this.upgradeMkcert()