@theholocron/semantic-release-config 6.1.1 → 7.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,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": "6.1.1",
3
+ "version": "7.0.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",
@@ -11,14 +11,21 @@
11
11
  "license": "GPL-3.0",
12
12
  "author": "Newton Koumantzelis",
13
13
  "type": "module",
14
+ "devDependencies": {
15
+ "tsdown": "^0.22.8",
16
+ "typescript": "^5.9.3",
17
+ "@theholocron/tsconfig": "7.0.0"
18
+ },
14
19
  "exports": {
15
20
  ".": {
16
- "import": "./index.js",
17
- "default": "./index.js"
18
- }
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/index.js",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "./package.json": "./package.json"
19
26
  },
20
27
  "files": [
21
- "index.js"
28
+ "dist/"
22
29
  ],
23
30
  "peerDependencies": {
24
31
  "@semantic-release/changelog": "^6",
@@ -39,5 +46,8 @@
39
46
  "access": "public"
40
47
  },
41
48
  "releases": "https://github.com/theholocron/configs/releases",
42
- "wiki": "https://github.com/theholocron/configs/wiki"
49
+ "wiki": "https://github.com/theholocron/configs/wiki",
50
+ "scripts": {
51
+ "build": "tsdown"
52
+ }
43
53
  }
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
- }