From 326c953cdf2cf25ca8946347da38e7a627990be8 Mon Sep 17 00:00:00 2001 From: yi_Xu Date: Wed, 24 Mar 2021 16:06:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(prompt):=20=F0=9F=90=9B=20fix=20the=20promp?= =?UTF-8?q?t=20context=20retaining=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close #100 --- .vscode/settings.json | 4 +--- src/lib/commit-message.ts | 2 -- src/lib/prompts.ts | 3 ++- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7819390..793b02f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,5 @@ "out": true }, "typescript.tsc.autoDetect": "off", - "svg.preview.background": "black", - "conventionalCommits.promptScopes": false, - "conventionalCommits.promptBreakingChange": false + "svg.preview.background": "black" } diff --git a/src/lib/commit-message.ts b/src/lib/commit-message.ts index d946dc9..b81d708 100644 --- a/src/lib/commit-message.ts +++ b/src/lib/commit-message.ts @@ -67,8 +67,6 @@ export class CommitMessage { } } -export default new CommitMessage(); - export function serializeSubject(partialCommitMessage: { gitmoji: string; subject: string; diff --git a/src/lib/prompts.ts b/src/lib/prompts.ts index 9ad7300..dec0980 100644 --- a/src/lib/prompts.ts +++ b/src/lib/prompts.ts @@ -16,7 +16,7 @@ const gitmojis: { import * as configuration from './configuration'; import promptTypes, { PROMPT_TYPES, Prompt } from './prompts/prompt-types'; import * as keys from '../configs/keys'; -import commitMessage, { +import { CommitMessage, serializeSubject, serializeHeader, @@ -54,6 +54,7 @@ export default async function prompts({ detectBreakingChange: boolean; breakingChangeFormat: boolean; }): Promise { + const commitMessage = new CommitMessage(); const conventionalCommitsTypes: ConventionalCommitsTypes = getConventionalCommitsTypesByLocale( locale, ).types;