@theholocron/semantic-release-config 6.1.1 → 7.1.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.
- package/dist/index.d.ts +49 -0
- package/dist/index.js +101 -0
- package/package.json +31 -6
- package/index.js +0 -59
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//#region index.d.ts
|
|
2
|
+
interface ExecOptions {
|
|
3
|
+
prepareCmd?: string;
|
|
4
|
+
publishCmd?: string;
|
|
5
|
+
}
|
|
6
|
+
interface Options {
|
|
7
|
+
branches?: Array<string | Record<string, unknown>>;
|
|
8
|
+
exec?: ExecOptions;
|
|
9
|
+
assets?: string[];
|
|
10
|
+
}
|
|
11
|
+
declare const commitAnalyzer: (string | {
|
|
12
|
+
preset: string;
|
|
13
|
+
releaseRules: ({
|
|
14
|
+
type: string;
|
|
15
|
+
release: string;
|
|
16
|
+
scope?: undefined;
|
|
17
|
+
breaking?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
type: string;
|
|
20
|
+
scope: string;
|
|
21
|
+
release: string;
|
|
22
|
+
breaking?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
breaking: boolean;
|
|
25
|
+
release: string;
|
|
26
|
+
type?: undefined;
|
|
27
|
+
scope?: undefined;
|
|
28
|
+
})[];
|
|
29
|
+
})[];
|
|
30
|
+
declare const releaseNotesGenerator: (string | {
|
|
31
|
+
preset: string;
|
|
32
|
+
presetConfig: {
|
|
33
|
+
types: ({
|
|
34
|
+
type: string;
|
|
35
|
+
section: string;
|
|
36
|
+
hidden?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
type: string;
|
|
39
|
+
section: string;
|
|
40
|
+
hidden: boolean;
|
|
41
|
+
})[];
|
|
42
|
+
};
|
|
43
|
+
})[];
|
|
44
|
+
/**
|
|
45
|
+
* @see https://semantic-release.gitbook.io/semantic-release/usage/configuration
|
|
46
|
+
*/
|
|
47
|
+
declare function defineConfig({ branches, exec, assets }?: Options): object;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { commitAnalyzer, defineConfig, releaseNotesGenerator };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
//#region index.ts
|
|
2
|
+
const releaseRules = [
|
|
3
|
+
{
|
|
4
|
+
type: "feat",
|
|
5
|
+
release: "minor"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
type: "fix",
|
|
9
|
+
release: "patch"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
type: "perf",
|
|
13
|
+
release: "patch"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: "refactor",
|
|
17
|
+
release: "patch"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: "chore",
|
|
21
|
+
scope: "deps",
|
|
22
|
+
release: "patch"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
breaking: true,
|
|
26
|
+
release: "major"
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
const types = [
|
|
30
|
+
{
|
|
31
|
+
type: "feat",
|
|
32
|
+
section: "Features"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: "fix",
|
|
36
|
+
section: "Bug Fixes"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "perf",
|
|
40
|
+
section: "Performance"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: "refactor",
|
|
44
|
+
section: "Refactoring"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: "docs",
|
|
48
|
+
section: "Documentation",
|
|
49
|
+
hidden: false
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: "chore",
|
|
53
|
+
section: "Chores",
|
|
54
|
+
hidden: false
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: "ci",
|
|
58
|
+
section: "CI",
|
|
59
|
+
hidden: true
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: "test",
|
|
63
|
+
section: "Tests",
|
|
64
|
+
hidden: true
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
const commitAnalyzer = ["@semantic-release/commit-analyzer", {
|
|
68
|
+
preset: "conventionalcommits",
|
|
69
|
+
releaseRules
|
|
70
|
+
}];
|
|
71
|
+
const releaseNotesGenerator = ["@semantic-release/release-notes-generator", {
|
|
72
|
+
preset: "conventionalcommits",
|
|
73
|
+
presetConfig: { types }
|
|
74
|
+
}];
|
|
75
|
+
const defaultAssets = [
|
|
76
|
+
"CHANGELOG.md",
|
|
77
|
+
"package.json",
|
|
78
|
+
"packages/*/package.json"
|
|
79
|
+
];
|
|
80
|
+
const defaultMessage = "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}\n\nSigned-off-by: Newton <5769156+iamnewton@users.noreply.github.com>";
|
|
81
|
+
/**
|
|
82
|
+
* @see https://semantic-release.gitbook.io/semantic-release/usage/configuration
|
|
83
|
+
*/
|
|
84
|
+
function defineConfig({ branches = ["main"], exec, assets = defaultAssets } = {}) {
|
|
85
|
+
return {
|
|
86
|
+
branches,
|
|
87
|
+
plugins: [
|
|
88
|
+
commitAnalyzer,
|
|
89
|
+
releaseNotesGenerator,
|
|
90
|
+
"@semantic-release/changelog",
|
|
91
|
+
...exec ? [["@semantic-release/exec", exec]] : [],
|
|
92
|
+
["@semantic-release/git", {
|
|
93
|
+
assets,
|
|
94
|
+
message: defaultMessage
|
|
95
|
+
}],
|
|
96
|
+
"@semantic-release/github"
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { commitAnalyzer, defineConfig, releaseNotesGenerator };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/semantic-release-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "A semantic-release configuration for automated versioning and publishing.",
|
|
5
5
|
"homepage": "https://github.com/theholocron/configs/tree/main/packages/semantic-release-config#readme",
|
|
6
6
|
"bugs": "https://github.com/theholocron/configs/issues",
|
|
@@ -10,15 +10,32 @@
|
|
|
10
10
|
},
|
|
11
11
|
"license": "GPL-3.0",
|
|
12
12
|
"author": "Newton Koumantzelis",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"semantic-release",
|
|
15
|
+
"release",
|
|
16
|
+
"versioning",
|
|
17
|
+
"changelog",
|
|
18
|
+
"config",
|
|
19
|
+
"theholocron"
|
|
20
|
+
],
|
|
13
21
|
"type": "module",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"tsdown": "^0.22.8",
|
|
24
|
+
"typescript": "^5.9.3",
|
|
25
|
+
"vitest": "^4.0.0",
|
|
26
|
+
"@theholocron/tsconfig": "7.1.0",
|
|
27
|
+
"@theholocron/vitest-config": "7.1.0"
|
|
28
|
+
},
|
|
14
29
|
"exports": {
|
|
15
30
|
".": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
19
36
|
},
|
|
20
37
|
"files": [
|
|
21
|
-
"
|
|
38
|
+
"dist/"
|
|
22
39
|
],
|
|
23
40
|
"peerDependencies": {
|
|
24
41
|
"@semantic-release/changelog": "^6",
|
|
@@ -35,9 +52,17 @@
|
|
|
35
52
|
"optional": true
|
|
36
53
|
}
|
|
37
54
|
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=22.0.0"
|
|
57
|
+
},
|
|
38
58
|
"publishConfig": {
|
|
39
59
|
"access": "public"
|
|
40
60
|
},
|
|
41
61
|
"releases": "https://github.com/theholocron/configs/releases",
|
|
42
|
-
"wiki": "https://github.com/theholocron/configs/wiki"
|
|
62
|
+
"wiki": "https://github.com/theholocron/configs/wiki",
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "tsdown",
|
|
65
|
+
"typecheck": "tsc --noEmit",
|
|
66
|
+
"test": "vitest run"
|
|
67
|
+
}
|
|
43
68
|
}
|
package/index.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
const releaseRules = [
|
|
2
|
-
{ type: "feat", release: "minor" },
|
|
3
|
-
{ type: "fix", release: "patch" },
|
|
4
|
-
{ type: "perf", release: "patch" },
|
|
5
|
-
{ type: "refactor", release: "patch" },
|
|
6
|
-
{ type: "chore", scope: "deps", release: "patch" },
|
|
7
|
-
{ breaking: true, release: "major" },
|
|
8
|
-
];
|
|
9
|
-
|
|
10
|
-
const types = [
|
|
11
|
-
{ type: "feat", section: "Features" },
|
|
12
|
-
{ type: "fix", section: "Bug Fixes" },
|
|
13
|
-
{ type: "perf", section: "Performance" },
|
|
14
|
-
{ type: "refactor", section: "Refactoring" },
|
|
15
|
-
{ type: "docs", section: "Documentation", hidden: false },
|
|
16
|
-
{ type: "chore", section: "Chores", hidden: false },
|
|
17
|
-
{ type: "ci", section: "CI", hidden: true },
|
|
18
|
-
{ type: "test", section: "Tests", hidden: true },
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
export const commitAnalyzer = [
|
|
22
|
-
"@semantic-release/commit-analyzer",
|
|
23
|
-
{ preset: "conventionalcommits", releaseRules },
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
export const releaseNotesGenerator = [
|
|
27
|
-
"@semantic-release/release-notes-generator",
|
|
28
|
-
{ preset: "conventionalcommits", presetConfig: { types } },
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
const defaultAssets = [
|
|
32
|
-
"CHANGELOG.md",
|
|
33
|
-
"package.json",
|
|
34
|
-
"packages/*/package.json",
|
|
35
|
-
];
|
|
36
|
-
const defaultMessage =
|
|
37
|
-
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}\n\nSigned-off-by: Newton <5769156+iamnewton@users.noreply.github.com>";
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @see https://semantic-release.gitbook.io/semantic-release/usage/configuration
|
|
41
|
-
* @param {{ branches?: Array<string|object>, exec?: { prepareCmd?: string, publishCmd?: string }, assets?: string[] }} [options]
|
|
42
|
-
*/
|
|
43
|
-
export function defineConfig({
|
|
44
|
-
branches = ["main"],
|
|
45
|
-
exec,
|
|
46
|
-
assets = defaultAssets,
|
|
47
|
-
} = {}) {
|
|
48
|
-
return {
|
|
49
|
-
branches,
|
|
50
|
-
plugins: [
|
|
51
|
-
commitAnalyzer,
|
|
52
|
-
releaseNotesGenerator,
|
|
53
|
-
"@semantic-release/changelog",
|
|
54
|
-
...(exec ? [["@semantic-release/exec", exec]] : []),
|
|
55
|
-
["@semantic-release/git", { assets, message: defaultMessage }],
|
|
56
|
-
"@semantic-release/github",
|
|
57
|
-
],
|
|
58
|
-
};
|
|
59
|
-
}
|