@tarsilla/commit-wizard 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var commitAnalyzer = require('@semantic-release/commit-analyzer');
|
|
4
|
+
var git = require('@semantic-release/git');
|
|
5
|
+
var npm = require('@semantic-release/npm');
|
|
6
|
+
var releaseNotesGenerator = require('@semantic-release/release-notes-generator');
|
|
7
|
+
|
|
8
|
+
//@ts-ignore
|
|
9
|
+
const analyzerConfig = {
|
|
10
|
+
preset: 'conventionalcommits',
|
|
11
|
+
parserOpts: {
|
|
12
|
+
headerPattern: RegExp("^(?<type>\\w+)(?<exclamation1>!?)(?:\\((?<scope>[^)]+)\\)(?<exclamation2>!?))?: (?<subject>.+)$"),
|
|
13
|
+
headerCorrespondence: [
|
|
14
|
+
'type',
|
|
15
|
+
'exclamation1',
|
|
16
|
+
'scope',
|
|
17
|
+
'exclamation2',
|
|
18
|
+
'subject'
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
releaseRules: [
|
|
22
|
+
{
|
|
23
|
+
type: 'feat',
|
|
24
|
+
exclamation1: '!',
|
|
25
|
+
release: 'major'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: 'feat',
|
|
29
|
+
exclamation2: '!',
|
|
30
|
+
release: 'major'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'feat',
|
|
34
|
+
release: 'minor'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: 'fix',
|
|
38
|
+
release: 'patch'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: 'docs',
|
|
42
|
+
release: 'patch'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: 'style',
|
|
46
|
+
release: 'patch'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 'refactor',
|
|
50
|
+
release: 'patch'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: 'perf',
|
|
54
|
+
release: 'patch'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: 'test',
|
|
58
|
+
release: 'patch'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: 'build',
|
|
62
|
+
release: 'patch'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: 'ci',
|
|
66
|
+
release: 'patch'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: 'chore',
|
|
70
|
+
release: 'patch'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'revert',
|
|
74
|
+
release: 'patch'
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
};
|
|
78
|
+
const npmConfig = {
|
|
79
|
+
tag: 'latest',
|
|
80
|
+
npmPublish: true,
|
|
81
|
+
optional: false
|
|
82
|
+
};
|
|
83
|
+
const gitConfig = {
|
|
84
|
+
assets: [
|
|
85
|
+
'package.json',
|
|
86
|
+
'package-lock.json'
|
|
87
|
+
],
|
|
88
|
+
message: 'chore(release): ${nextRelease.version}'
|
|
89
|
+
};
|
|
90
|
+
const plugin = {
|
|
91
|
+
addChannel: async (_pluginConfig, context)=>{
|
|
92
|
+
if (npm.addChannel) {
|
|
93
|
+
await npm.addChannel(npmConfig, context);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
verifyConditions: async (_pluginConfig, context)=>{
|
|
97
|
+
if (npm.verifyConditions) {
|
|
98
|
+
await npm.verifyConditions(npmConfig, context);
|
|
99
|
+
}
|
|
100
|
+
if (git.verifyConditions) {
|
|
101
|
+
await git.verifyConditions(gitConfig, context);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
analyzeCommits: async (_pluginConfig, context)=>{
|
|
105
|
+
return commitAnalyzer.analyzeCommits(analyzerConfig, context);
|
|
106
|
+
},
|
|
107
|
+
generateNotes: async (_pluginConfig, context)=>{
|
|
108
|
+
return releaseNotesGenerator.generateNotes({}, context);
|
|
109
|
+
},
|
|
110
|
+
prepare: async (_pluginConfig, context)=>{
|
|
111
|
+
if (npm.prepare) {
|
|
112
|
+
await npm.prepare(npmConfig, context);
|
|
113
|
+
}
|
|
114
|
+
if (git.prepare) {
|
|
115
|
+
await git.prepare(gitConfig, context);
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
publish: async (_pluginConfig, context)=>{
|
|
119
|
+
if (npm.publish) {
|
|
120
|
+
await npm.publish(npmConfig, context);
|
|
121
|
+
}
|
|
122
|
+
/*if (gitPublish) {
|
|
123
|
+
await gitPublish(gitConfig, context);
|
|
124
|
+
}*/ },
|
|
125
|
+
success: async (_pluginConfig, _context)=>{
|
|
126
|
+
/*if (gitSuccess) {
|
|
127
|
+
await gitSuccess(gitConfig, context);
|
|
128
|
+
}*/ },
|
|
129
|
+
fail: async (_pluginConfig, _context)=>{
|
|
130
|
+
/*if (gitFail) {
|
|
131
|
+
await gitFail(gitConfig, context);
|
|
132
|
+
}*/ }
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
module.exports = plugin;
|
|
136
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/semantic-release/index.ts"],"sourcesContent":["//@ts-ignore\nimport { analyzeCommits } from '@semantic-release/commit-analyzer';\nimport {\n prepare as gitPrepare,\n verifyConditions as gitVerifyConditions,\n //@ts-ignore\n} from '@semantic-release/git';\nimport {\n addChannel as npmAddChannel,\n prepare as npmPrepare,\n publish as npmPublish,\n verifyConditions as npmVerifyConditions,\n //@ts-ignore\n} from '@semantic-release/npm';\n//@ts-ignore\nimport { generateNotes } from '@semantic-release/release-notes-generator';\nimport {\n AddChannelContext,\n AnalyzeCommitsContext,\n FailContext,\n GenerateNotesContext,\n PrepareContext,\n PublishContext,\n SuccessContext,\n VerifyConditionsContext,\n} from 'semantic-release';\n\n// This interface describes the hooks exposed by a semantic-release plugin.\nexport type SemanticReleasePlugin = {\n addChannel?(pluginConfig: unknown, context: AddChannelContext): Promise<void>;\n analyzeCommits?(pluginConfig: unknown, context: AnalyzeCommitsContext): Promise<string | false>;\n fail?(pluginConfig: unknown, context: FailContext): Promise<void>;\n generateNotes?(pluginConfig: unknown, context: GenerateNotesContext): Promise<string>;\n prepare?(pluginConfig: unknown, context: PrepareContext): Promise<void>;\n publish?(pluginConfig: unknown, context: PublishContext): Promise<unknown>;\n success?(pluginConfig: unknown, context: SuccessContext): Promise<void>;\n verifyConditions?(pluginConfig: unknown, context: VerifyConditionsContext): Promise<void>;\n};\n\nconst analyzerConfig = {\n preset: 'conventionalcommits',\n parserOpts: {\n headerPattern: /^(?<type>\\w+)(?<exclamation1>!?)(?:\\((?<scope>[^)]+)\\)(?<exclamation2>!?))?: (?<subject>.+)$/,\n headerCorrespondence: ['type', 'exclamation1', 'scope', 'exclamation2', 'subject'],\n },\n releaseRules: [\n { type: 'feat', exclamation1: '!', release: 'major' },\n { type: 'feat', exclamation2: '!', release: 'major' },\n { type: 'feat', release: 'minor' },\n { type: 'fix', release: 'patch' },\n { type: 'docs', release: 'patch' },\n { type: 'style', release: 'patch' },\n { type: 'refactor', release: 'patch' },\n { type: 'perf', release: 'patch' },\n { type: 'test', release: 'patch' },\n { type: 'build', release: 'patch' },\n { type: 'ci', release: 'patch' },\n { type: 'chore', release: 'patch' },\n { type: 'revert', release: 'patch' },\n ],\n};\n\nconst npmConfig = {\n tag: 'latest',\n npmPublish: true,\n optional: false,\n};\n\nconst gitConfig = {\n assets: ['package.json', 'package-lock.json'],\n message: 'chore(release): ${nextRelease.version}',\n};\n\nconst plugin: SemanticReleasePlugin = {\n addChannel: async (_pluginConfig, context) => {\n if (npmAddChannel) {\n await npmAddChannel(npmConfig, context);\n }\n },\n verifyConditions: async (_pluginConfig, context) => {\n if (npmVerifyConditions) {\n await npmVerifyConditions(npmConfig, context);\n }\n if (gitVerifyConditions) {\n await gitVerifyConditions(gitConfig, context);\n }\n },\n\n analyzeCommits: async (_pluginConfig, context) => {\n return analyzeCommits(analyzerConfig, context);\n },\n\n generateNotes: async (_pluginConfig, context) => {\n return generateNotes({}, context);\n },\n\n prepare: async (_pluginConfig, context) => {\n if (npmPrepare) {\n await npmPrepare(npmConfig, context);\n }\n if (gitPrepare) {\n await gitPrepare(gitConfig, context);\n }\n },\n\n publish: async (_pluginConfig, context) => {\n if (npmPublish) {\n await npmPublish(npmConfig, context);\n }\n /*if (gitPublish) {\n await gitPublish(gitConfig, context);\n }*/\n },\n\n success: async (_pluginConfig, _context) => {\n /*if (gitSuccess) {\n await gitSuccess(gitConfig, context);\n }*/\n },\n\n fail: async (_pluginConfig, _context) => {\n /*if (gitFail) {\n await gitFail(gitConfig, context);\n }*/\n },\n};\n\nexport default plugin;\n"],"names":["analyzerConfig","preset","parserOpts","headerPattern","headerCorrespondence","releaseRules","type","exclamation1","release","exclamation2","npmConfig","tag","npmPublish","optional","gitConfig","assets","message","plugin","addChannel","_pluginConfig","context","npmAddChannel","verifyConditions","npmVerifyConditions","gitVerifyConditions","analyzeCommits","generateNotes","prepare","npmPrepare","gitPrepare","publish","success","_context","fail"],"mappings":";;;;;;;AAAA;AAuCA,MAAMA,cAAiB,GAAA;IACrBC,MAAQ,EAAA,qBAAA;IACRC,UAAY,EAAA;QACVC,aAAe,EAAA,MAAA,CAAA,iGAAA,CAAA;QACfC,oBAAsB,EAAA;AAAC,YAAA,MAAA;AAAQ,YAAA,cAAA;AAAgB,YAAA,OAAA;AAAS,YAAA,cAAA;AAAgB,YAAA;AAAU;AACpF,KAAA;IACAC,YAAc,EAAA;AACZ,QAAA;YAAEC,IAAM,EAAA,MAAA;YAAQC,YAAc,EAAA,GAAA;YAAKC,OAAS,EAAA;AAAQ,SAAA;AACpD,QAAA;YAAEF,IAAM,EAAA,MAAA;YAAQG,YAAc,EAAA,GAAA;YAAKD,OAAS,EAAA;AAAQ,SAAA;AACpD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EAAAA,OAAAA,GAAAA;AACtC,QAAA,IAAIG,oBAAqB,EAAA;AACvB,YAAA,MAAMA,qBAAoBb,SAAWU,EAAAA,OAAAA,CAAAA;AACvC;AACA,QAAA,IAAII,oBAAqB,EAAA;AACvB,YAAA,MAAMA,qBAAoBV,SAAWM,EAAAA,OAAAA,CAAAA;AACvC;AACF,KAAA;AAEAK,IAAAA,cAAAA,EAAgB,OAAON,aAAeC,EAAAA,OAAAA,GAAAA;AACpC,QAAA,OAAOK,8BAAezB,cAAgBoB,EAAAA,OAAAA,CAAAA;AACxC,KAAA;AAEAM,IAAAA,aAAAA,EAAe,OAAOP,aAAeC,EAAAA,OAAAA,GAAAA;QACnC,OAAOM,mCAAAA,CAAc,EAAIN,EAAAA,OAAAA,CAAAA;AAC3B,KAAA;AAEAO,IAAAA,OAAAA,EAAS,OAAOR,aAAeC,EAAAA,OAAAA,GAAAA;AAC7B,QAAA,IAAIQ,WAAY,EAAA;AACd,YAAA,MAAMA,YAAWlB,SAAWU,EAAAA,OAAAA,CAAAA;AAC9B;AACA,QAAA,IAAIS,WAAY,EAAA;AACd,YAAA,MAAMA,YAAWf,SAAWM,EAAAA,OAAAA,CAAAA;AAC9B;AACF,KAAA;AAEAU,IAAAA,OAAAA,EAAS,OAAOX,aAAeC,EAAAA,OAAAA,GAAAA;AAC7B,QAAA,IAAIR,WAAY,EAAA;AACd,YAAA,MAAMA,YAAWF,SAAWU,EAAAA,OAAAA,CAAAA;AAC9B;AACA;;SAGF;AAEAW,IAAAA,OAAAA,EAAS,OAAOZ,aAAea,EAAAA,QAAAA,GAAAA;AAC7B;;SAGF;AAEAC,IAAAA,IAAAA,EAAM,OAAOd,aAAea,EAAAA,QAAAA,GAAAA;AAC1B;;;AAIJ;;;;"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { analyzeCommits } from '@semantic-release/commit-analyzer';
|
|
2
|
+
import { prepare as prepare$1, verifyConditions as verifyConditions$1 } from '@semantic-release/git';
|
|
3
|
+
import { publish, prepare, verifyConditions, addChannel } from '@semantic-release/npm';
|
|
4
|
+
import { generateNotes } from '@semantic-release/release-notes-generator';
|
|
5
|
+
|
|
6
|
+
//@ts-ignore
|
|
7
|
+
const analyzerConfig = {
|
|
8
|
+
preset: 'conventionalcommits',
|
|
9
|
+
parserOpts: {
|
|
10
|
+
headerPattern: RegExp("^(?<type>\\w+)(?<exclamation1>!?)(?:\\((?<scope>[^)]+)\\)(?<exclamation2>!?))?: (?<subject>.+)$"),
|
|
11
|
+
headerCorrespondence: [
|
|
12
|
+
'type',
|
|
13
|
+
'exclamation1',
|
|
14
|
+
'scope',
|
|
15
|
+
'exclamation2',
|
|
16
|
+
'subject'
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
releaseRules: [
|
|
20
|
+
{
|
|
21
|
+
type: 'feat',
|
|
22
|
+
exclamation1: '!',
|
|
23
|
+
release: 'major'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'feat',
|
|
27
|
+
exclamation2: '!',
|
|
28
|
+
release: 'major'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'feat',
|
|
32
|
+
release: 'minor'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'fix',
|
|
36
|
+
release: 'patch'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 'docs',
|
|
40
|
+
release: 'patch'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: 'style',
|
|
44
|
+
release: 'patch'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: 'refactor',
|
|
48
|
+
release: 'patch'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'perf',
|
|
52
|
+
release: 'patch'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 'test',
|
|
56
|
+
release: 'patch'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: 'build',
|
|
60
|
+
release: 'patch'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: 'ci',
|
|
64
|
+
release: 'patch'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'chore',
|
|
68
|
+
release: 'patch'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: 'revert',
|
|
72
|
+
release: 'patch'
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
};
|
|
76
|
+
const npmConfig = {
|
|
77
|
+
tag: 'latest',
|
|
78
|
+
npmPublish: true,
|
|
79
|
+
optional: false
|
|
80
|
+
};
|
|
81
|
+
const gitConfig = {
|
|
82
|
+
assets: [
|
|
83
|
+
'package.json',
|
|
84
|
+
'package-lock.json'
|
|
85
|
+
],
|
|
86
|
+
message: 'chore(release): ${nextRelease.version}'
|
|
87
|
+
};
|
|
88
|
+
const plugin = {
|
|
89
|
+
addChannel: async (_pluginConfig, context)=>{
|
|
90
|
+
if (addChannel) {
|
|
91
|
+
await addChannel(npmConfig, context);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
verifyConditions: async (_pluginConfig, context)=>{
|
|
95
|
+
if (verifyConditions) {
|
|
96
|
+
await verifyConditions(npmConfig, context);
|
|
97
|
+
}
|
|
98
|
+
if (verifyConditions$1) {
|
|
99
|
+
await verifyConditions$1(gitConfig, context);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
analyzeCommits: async (_pluginConfig, context)=>{
|
|
103
|
+
return analyzeCommits(analyzerConfig, context);
|
|
104
|
+
},
|
|
105
|
+
generateNotes: async (_pluginConfig, context)=>{
|
|
106
|
+
return generateNotes({}, context);
|
|
107
|
+
},
|
|
108
|
+
prepare: async (_pluginConfig, context)=>{
|
|
109
|
+
if (prepare) {
|
|
110
|
+
await prepare(npmConfig, context);
|
|
111
|
+
}
|
|
112
|
+
if (prepare$1) {
|
|
113
|
+
await prepare$1(gitConfig, context);
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
publish: async (_pluginConfig, context)=>{
|
|
117
|
+
if (publish) {
|
|
118
|
+
await publish(npmConfig, context);
|
|
119
|
+
}
|
|
120
|
+
/*if (gitPublish) {
|
|
121
|
+
await gitPublish(gitConfig, context);
|
|
122
|
+
}*/ },
|
|
123
|
+
success: async (_pluginConfig, _context)=>{
|
|
124
|
+
/*if (gitSuccess) {
|
|
125
|
+
await gitSuccess(gitConfig, context);
|
|
126
|
+
}*/ },
|
|
127
|
+
fail: async (_pluginConfig, _context)=>{
|
|
128
|
+
/*if (gitFail) {
|
|
129
|
+
await gitFail(gitConfig, context);
|
|
130
|
+
}*/ }
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export { plugin as default };
|
|
134
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/semantic-release/index.ts"],"sourcesContent":["//@ts-ignore\nimport { analyzeCommits } from '@semantic-release/commit-analyzer';\nimport {\n prepare as gitPrepare,\n verifyConditions as gitVerifyConditions,\n //@ts-ignore\n} from '@semantic-release/git';\nimport {\n addChannel as npmAddChannel,\n prepare as npmPrepare,\n publish as npmPublish,\n verifyConditions as npmVerifyConditions,\n //@ts-ignore\n} from '@semantic-release/npm';\n//@ts-ignore\nimport { generateNotes } from '@semantic-release/release-notes-generator';\nimport {\n AddChannelContext,\n AnalyzeCommitsContext,\n FailContext,\n GenerateNotesContext,\n PrepareContext,\n PublishContext,\n SuccessContext,\n VerifyConditionsContext,\n} from 'semantic-release';\n\n// This interface describes the hooks exposed by a semantic-release plugin.\nexport type SemanticReleasePlugin = {\n addChannel?(pluginConfig: unknown, context: AddChannelContext): Promise<void>;\n analyzeCommits?(pluginConfig: unknown, context: AnalyzeCommitsContext): Promise<string | false>;\n fail?(pluginConfig: unknown, context: FailContext): Promise<void>;\n generateNotes?(pluginConfig: unknown, context: GenerateNotesContext): Promise<string>;\n prepare?(pluginConfig: unknown, context: PrepareContext): Promise<void>;\n publish?(pluginConfig: unknown, context: PublishContext): Promise<unknown>;\n success?(pluginConfig: unknown, context: SuccessContext): Promise<void>;\n verifyConditions?(pluginConfig: unknown, context: VerifyConditionsContext): Promise<void>;\n};\n\nconst analyzerConfig = {\n preset: 'conventionalcommits',\n parserOpts: {\n headerPattern: /^(?<type>\\w+)(?<exclamation1>!?)(?:\\((?<scope>[^)]+)\\)(?<exclamation2>!?))?: (?<subject>.+)$/,\n headerCorrespondence: ['type', 'exclamation1', 'scope', 'exclamation2', 'subject'],\n },\n releaseRules: [\n { type: 'feat', exclamation1: '!', release: 'major' },\n { type: 'feat', exclamation2: '!', release: 'major' },\n { type: 'feat', release: 'minor' },\n { type: 'fix', release: 'patch' },\n { type: 'docs', release: 'patch' },\n { type: 'style', release: 'patch' },\n { type: 'refactor', release: 'patch' },\n { type: 'perf', release: 'patch' },\n { type: 'test', release: 'patch' },\n { type: 'build', release: 'patch' },\n { type: 'ci', release: 'patch' },\n { type: 'chore', release: 'patch' },\n { type: 'revert', release: 'patch' },\n ],\n};\n\nconst npmConfig = {\n tag: 'latest',\n npmPublish: true,\n optional: false,\n};\n\nconst gitConfig = {\n assets: ['package.json', 'package-lock.json'],\n message: 'chore(release): ${nextRelease.version}',\n};\n\nconst plugin: SemanticReleasePlugin = {\n addChannel: async (_pluginConfig, context) => {\n if (npmAddChannel) {\n await npmAddChannel(npmConfig, context);\n }\n },\n verifyConditions: async (_pluginConfig, context) => {\n if (npmVerifyConditions) {\n await npmVerifyConditions(npmConfig, context);\n }\n if (gitVerifyConditions) {\n await gitVerifyConditions(gitConfig, context);\n }\n },\n\n analyzeCommits: async (_pluginConfig, context) => {\n return analyzeCommits(analyzerConfig, context);\n },\n\n generateNotes: async (_pluginConfig, context) => {\n return generateNotes({}, context);\n },\n\n prepare: async (_pluginConfig, context) => {\n if (npmPrepare) {\n await npmPrepare(npmConfig, context);\n }\n if (gitPrepare) {\n await gitPrepare(gitConfig, context);\n }\n },\n\n publish: async (_pluginConfig, context) => {\n if (npmPublish) {\n await npmPublish(npmConfig, context);\n }\n /*if (gitPublish) {\n await gitPublish(gitConfig, context);\n }*/\n },\n\n success: async (_pluginConfig, _context) => {\n /*if (gitSuccess) {\n await gitSuccess(gitConfig, context);\n }*/\n },\n\n fail: async (_pluginConfig, _context) => {\n /*if (gitFail) {\n await gitFail(gitConfig, context);\n }*/\n },\n};\n\nexport default plugin;\n"],"names":["analyzerConfig","preset","parserOpts","headerPattern","headerCorrespondence","releaseRules","type","exclamation1","release","exclamation2","npmConfig","tag","npmPublish","optional","gitConfig","assets","message","plugin","addChannel","_pluginConfig","context","npmAddChannel","verifyConditions","npmVerifyConditions","gitVerifyConditions","analyzeCommits","generateNotes","prepare","npmPrepare","gitPrepare","publish","success","_context","fail"],"mappings":";;;;;AAAA;AAuCA,MAAMA,cAAiB,GAAA;IACrBC,MAAQ,EAAA,qBAAA;IACRC,UAAY,EAAA;QACVC,aAAe,EAAA,MAAA,CAAA,iGAAA,CAAA;QACfC,oBAAsB,EAAA;AAAC,YAAA,MAAA;AAAQ,YAAA,cAAA;AAAgB,YAAA,OAAA;AAAS,YAAA,cAAA;AAAgB,YAAA;AAAU;AACpF,KAAA;IACAC,YAAc,EAAA;AACZ,QAAA;YAAEC,IAAM,EAAA,MAAA;YAAQC,YAAc,EAAA,GAAA;YAAKC,OAAS,EAAA;AAAQ,SAAA;AACpD,QAAA;YAAEF,IAAM,EAAA,MAAA;YAAQG,YAAc,EAAA,GAAA;YAAKD,OAAS,EAAA;AAAQ,SAAA;AACpD,QAAA;YAAEF,IAAM,EAAA,MAAA;YAAQE,OAAS,EAAA;AAAQ,SAAA;AACjC,QAAA;YAAEF,IAAM,EAAA,KAAA;YAAOE,OAAS,EAAA;AAAQ,SAAA;AAChC,QAAA;YAAEF,IAAM,EAAA,MAAA;YAAQE,OAAS,EAAA;AAAQ,SAAA;AACjC,QAAA;YAAEF,IAAM,EAAA,OAAA;YAASE,OAAS,EAAA;AAAQ,SAAA;AAClC,QAAA;YAAEF,IAAM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AA,OAAOK,eAAezB,cAAgBoB,EAAAA,OAAAA,CAAAA;AACxC,KAAA;AAEAM,IAAAA,aAAAA,EAAe,OAAOP,aAAeC,EAAAA,OAAAA,GAAAA;QACnC,OAAOM,aAAAA,CAAc,EAAIN,EAAAA,OAAAA,CAAAA;AAC3B,KAAA;AAEAO,IAAAA,OAAAA,EAAS,OAAOR,aAAeC,EAAAA,OAAAA,GAAAA;AAC7B,QAAA,IAAIQ,OAAY,EAAA;AACd,YAAA,MAAMA,QAAWlB,SAAWU,EAAAA,OAAAA,CAAAA;AAC9B;AACA,QAAA,IAAIS,SAAY,EAAA;AACd,YAAA,MAAMA,UAAWf,SAAWM,EAAAA,OAAAA,CAAAA;AAC9B;AACF,KAAA;AAEAU,IAAAA,OAAAA,EAAS,OAAOX,aAAeC,EAAAA,OAAAA,GAAAA;AAC7B,QAAA,IAAIR,OAAY,EAAA;AACd,YAAA,MAAMA,QAAWF,SAAWU,EAAAA,OAAAA,CAAAA;AAC9B;AACA;;SAGF;AAEAW,IAAAA,OAAAA,EAAS,OAAOZ,aAAea,EAAAA,QAAAA,GAAAA;AAC7B;;SAGF;AAEAC,IAAAA,IAAAA,EAAM,OAAOd,aAAea,EAAAA,QAAAA,GAAAA;AAC1B;;;AAIJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarsilla/commit-wizard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@commitlint/cli": "^19",
|
|
41
41
|
"@commitlint/config-conventional": "^19",
|
|
42
|
+
"@semantic-release/commit-analyzer": "^13",
|
|
43
|
+
"@semantic-release/git": "^10",
|
|
44
|
+
"@semantic-release/npm": "^12",
|
|
45
|
+
"@semantic-release/release-notes-generator": "^14",
|
|
42
46
|
"commitizen": "^4"
|
|
43
47
|
},
|
|
44
48
|
"dependencies": {
|
|
@@ -51,11 +55,6 @@
|
|
|
51
55
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
52
56
|
"@rollup/plugin-swc": "^0.4.0",
|
|
53
57
|
"@rollup/plugin-terser": "^0.4.4",
|
|
54
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
55
|
-
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
56
|
-
"@semantic-release/git": "^10.0.1",
|
|
57
|
-
"@semantic-release/npm": "^12.0.1",
|
|
58
|
-
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
59
58
|
"@types/inquirer": "^8.2.10",
|
|
60
59
|
"eslint": "^9.22.0",
|
|
61
60
|
"eslint-config-prettier": "^10.1.1",
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
//@ts-ignore
|
|
2
|
+
import { analyzeCommits } from '@semantic-release/commit-analyzer';
|
|
3
|
+
import {
|
|
4
|
+
prepare as gitPrepare,
|
|
5
|
+
verifyConditions as gitVerifyConditions,
|
|
6
|
+
//@ts-ignore
|
|
7
|
+
} from '@semantic-release/git';
|
|
8
|
+
import {
|
|
9
|
+
addChannel as npmAddChannel,
|
|
10
|
+
prepare as npmPrepare,
|
|
11
|
+
publish as npmPublish,
|
|
12
|
+
verifyConditions as npmVerifyConditions,
|
|
13
|
+
//@ts-ignore
|
|
14
|
+
} from '@semantic-release/npm';
|
|
15
|
+
//@ts-ignore
|
|
16
|
+
import { generateNotes } from '@semantic-release/release-notes-generator';
|
|
17
|
+
import {
|
|
18
|
+
AddChannelContext,
|
|
19
|
+
AnalyzeCommitsContext,
|
|
20
|
+
FailContext,
|
|
21
|
+
GenerateNotesContext,
|
|
22
|
+
PrepareContext,
|
|
23
|
+
PublishContext,
|
|
24
|
+
SuccessContext,
|
|
25
|
+
VerifyConditionsContext,
|
|
26
|
+
} from 'semantic-release';
|
|
27
|
+
|
|
28
|
+
// This interface describes the hooks exposed by a semantic-release plugin.
|
|
29
|
+
export type SemanticReleasePlugin = {
|
|
30
|
+
addChannel?(pluginConfig: unknown, context: AddChannelContext): Promise<void>;
|
|
31
|
+
analyzeCommits?(pluginConfig: unknown, context: AnalyzeCommitsContext): Promise<string | false>;
|
|
32
|
+
fail?(pluginConfig: unknown, context: FailContext): Promise<void>;
|
|
33
|
+
generateNotes?(pluginConfig: unknown, context: GenerateNotesContext): Promise<string>;
|
|
34
|
+
prepare?(pluginConfig: unknown, context: PrepareContext): Promise<void>;
|
|
35
|
+
publish?(pluginConfig: unknown, context: PublishContext): Promise<unknown>;
|
|
36
|
+
success?(pluginConfig: unknown, context: SuccessContext): Promise<void>;
|
|
37
|
+
verifyConditions?(pluginConfig: unknown, context: VerifyConditionsContext): Promise<void>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const analyzerConfig = {
|
|
41
|
+
preset: 'conventionalcommits',
|
|
42
|
+
parserOpts: {
|
|
43
|
+
headerPattern: /^(?<type>\w+)(?<exclamation1>!?)(?:\((?<scope>[^)]+)\)(?<exclamation2>!?))?: (?<subject>.+)$/,
|
|
44
|
+
headerCorrespondence: ['type', 'exclamation1', 'scope', 'exclamation2', 'subject'],
|
|
45
|
+
},
|
|
46
|
+
releaseRules: [
|
|
47
|
+
{ type: 'feat', exclamation1: '!', release: 'major' },
|
|
48
|
+
{ type: 'feat', exclamation2: '!', release: 'major' },
|
|
49
|
+
{ type: 'feat', release: 'minor' },
|
|
50
|
+
{ type: 'fix', release: 'patch' },
|
|
51
|
+
{ type: 'docs', release: 'patch' },
|
|
52
|
+
{ type: 'style', release: 'patch' },
|
|
53
|
+
{ type: 'refactor', release: 'patch' },
|
|
54
|
+
{ type: 'perf', release: 'patch' },
|
|
55
|
+
{ type: 'test', release: 'patch' },
|
|
56
|
+
{ type: 'build', release: 'patch' },
|
|
57
|
+
{ type: 'ci', release: 'patch' },
|
|
58
|
+
{ type: 'chore', release: 'patch' },
|
|
59
|
+
{ type: 'revert', release: 'patch' },
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const npmConfig = {
|
|
64
|
+
tag: 'latest',
|
|
65
|
+
npmPublish: true,
|
|
66
|
+
optional: false,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const gitConfig = {
|
|
70
|
+
assets: ['package.json', 'package-lock.json'],
|
|
71
|
+
message: 'chore(release): ${nextRelease.version}',
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const plugin: SemanticReleasePlugin = {
|
|
75
|
+
addChannel: async (_pluginConfig, context) => {
|
|
76
|
+
if (npmAddChannel) {
|
|
77
|
+
await npmAddChannel(npmConfig, context);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
verifyConditions: async (_pluginConfig, context) => {
|
|
81
|
+
if (npmVerifyConditions) {
|
|
82
|
+
await npmVerifyConditions(npmConfig, context);
|
|
83
|
+
}
|
|
84
|
+
if (gitVerifyConditions) {
|
|
85
|
+
await gitVerifyConditions(gitConfig, context);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
analyzeCommits: async (_pluginConfig, context) => {
|
|
90
|
+
return analyzeCommits(analyzerConfig, context);
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
generateNotes: async (_pluginConfig, context) => {
|
|
94
|
+
return generateNotes({}, context);
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
prepare: async (_pluginConfig, context) => {
|
|
98
|
+
if (npmPrepare) {
|
|
99
|
+
await npmPrepare(npmConfig, context);
|
|
100
|
+
}
|
|
101
|
+
if (gitPrepare) {
|
|
102
|
+
await gitPrepare(gitConfig, context);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
publish: async (_pluginConfig, context) => {
|
|
107
|
+
if (npmPublish) {
|
|
108
|
+
await npmPublish(npmConfig, context);
|
|
109
|
+
}
|
|
110
|
+
/*if (gitPublish) {
|
|
111
|
+
await gitPublish(gitConfig, context);
|
|
112
|
+
}*/
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
success: async (_pluginConfig, _context) => {
|
|
116
|
+
/*if (gitSuccess) {
|
|
117
|
+
await gitSuccess(gitConfig, context);
|
|
118
|
+
}*/
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
fail: async (_pluginConfig, _context) => {
|
|
122
|
+
/*if (gitFail) {
|
|
123
|
+
await gitFail(gitConfig, context);
|
|
124
|
+
}*/
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export default plugin;
|