semantic-release-config-kuzzle 1.7.2 → 1.7.3
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/README.md +13 -0
- package/dist/plugins.d.ts +4 -0
- package/dist/plugins.js +17 -34
- package/dist/plugins.js.map +1 -1
- package/package.json +3 -2
- package/presets/conventionalcommits.mjs +42 -0
package/README.md
CHANGED
|
@@ -35,6 +35,19 @@ Override those defaults with environment variables:
|
|
|
35
35
|
- `SEMANTIC_RELEASE_RELEASE_BRANCH` (default: `main`)
|
|
36
36
|
- `SEMANTIC_RELEASE_DEVELOP_BRANCH` (default: `develop`)
|
|
37
37
|
|
|
38
|
+
## Commit convention
|
|
39
|
+
|
|
40
|
+
Commits are parsed with the [`conventionalcommits`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits)
|
|
41
|
+
preset, extended so that `chore(deps):` commits land in a `Dependencies`
|
|
42
|
+
section of the release notes instead of being hidden with the other chores.
|
|
43
|
+
|
|
44
|
+
The preset is shipped with this package (`presets/conventionalcommits.mjs`) and
|
|
45
|
+
pinned by path, so you do not have to install it in your own project. Earlier
|
|
46
|
+
versions named it through the plugins' `preset` option instead, which only
|
|
47
|
+
resolved when your package manager happened to hoist it to your root
|
|
48
|
+
`node_modules/` and otherwise failed with `Cannot find module
|
|
49
|
+
'conventional-changelog-conventionalcommits'`.
|
|
50
|
+
|
|
38
51
|
## Changelog behavior
|
|
39
52
|
|
|
40
53
|
Changelogs are written to `changelogs/CHANGELOG_<channel>.md`.
|
package/dist/plugins.d.ts
CHANGED
package/dist/plugins.js
CHANGED
|
@@ -1,58 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.plugins = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
4
8
|
const branches_1 = require("./branches");
|
|
5
9
|
const release_channel_1 = require("./release-channel");
|
|
6
10
|
const workspaces_1 = require("./workspaces");
|
|
7
11
|
const workspacePkgFiles = (0, workspaces_1.getWorkspacePackageJsonFiles)();
|
|
8
12
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
13
|
+
* Absolute path to the pre-configured `conventionalcommits` preset shipped with
|
|
14
|
+
* this package. Passing it through the plugins' `config` option, rather than
|
|
15
|
+
* naming the preset through `preset`, keeps the preset resolvable from this
|
|
16
|
+
* package instead of from the consumer's `node_modules/` layout. See
|
|
17
|
+
* `presets/conventionalcommits.mjs` for the full reasoning.
|
|
18
|
+
*
|
|
19
|
+
* `lib/` and `dist/` both sit one level below the package root, so the same
|
|
20
|
+
* relative path works from the sources and from the build.
|
|
11
21
|
*/
|
|
22
|
+
const conventionalCommitsPreset = node_path_1.default.join(__dirname, "..", "presets", "conventionalcommits.mjs");
|
|
12
23
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* therefore ships a minor whose notes say nothing about it, and a release made
|
|
16
|
-
* only of dependency work gets an empty changelog entry.
|
|
17
|
-
*
|
|
18
|
-
* Two constraints shape the list below. `findTypeEntry` returns the first
|
|
19
|
-
* match and only compares `scope` when the entry declares one, so the scoped
|
|
20
|
-
* entry has to come before the bare `chore` one. And passing `types` replaces
|
|
21
|
-
* the preset's list instead of extending it, which is why the defaults are
|
|
22
|
-
* restated: the preset is ESM-only, so its DEFAULT_COMMIT_TYPES cannot be
|
|
23
|
-
* imported from this CommonJS build.
|
|
24
|
+
* Default plugins configuration.
|
|
25
|
+
* Main thing here is to use a different changelog file depending on the release channel.
|
|
24
26
|
*/
|
|
25
|
-
const commitTypes = [
|
|
26
|
-
{ scope: "deps", section: "Dependencies", type: "chore" },
|
|
27
|
-
{ section: "Features", type: "feat" },
|
|
28
|
-
{ section: "Features", type: "feature" },
|
|
29
|
-
{ section: "Bug Fixes", type: "fix" },
|
|
30
|
-
{ section: "Performance Improvements", type: "perf" },
|
|
31
|
-
{ section: "Reverts", type: "revert" },
|
|
32
|
-
{ hidden: true, section: "Documentation", type: "docs" },
|
|
33
|
-
{ hidden: true, section: "Styles", type: "style" },
|
|
34
|
-
{ hidden: true, section: "Miscellaneous Chores", type: "chore" },
|
|
35
|
-
{ hidden: true, section: "Code Refactoring", type: "refactor" },
|
|
36
|
-
{ hidden: true, section: "Tests", type: "test" },
|
|
37
|
-
{ hidden: true, section: "Build System", type: "build" },
|
|
38
|
-
{ hidden: true, section: "Continuous Integration", type: "ci" },
|
|
39
|
-
];
|
|
40
27
|
const plugins = [
|
|
41
28
|
[
|
|
42
29
|
"@semantic-release/commit-analyzer",
|
|
43
30
|
{
|
|
44
|
-
|
|
31
|
+
config: conventionalCommitsPreset,
|
|
45
32
|
releaseRules: [{ type: "chore", scope: "deps", release: "minor" }],
|
|
46
33
|
},
|
|
47
34
|
],
|
|
48
35
|
[
|
|
49
36
|
"@semantic-release/release-notes-generator",
|
|
50
37
|
{
|
|
51
|
-
|
|
52
|
-
// Only the notes generator is configured: the commit analyzer keeps its
|
|
53
|
-
// own preset and releaseRules, so how the version is computed is
|
|
54
|
-
// untouched.
|
|
55
|
-
presetConfig: { types: commitTypes },
|
|
38
|
+
config: conventionalCommitsPreset,
|
|
56
39
|
},
|
|
57
40
|
],
|
|
58
41
|
[
|
package/dist/plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../lib/plugins.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../lib/plugins.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAI7B,yCAA+C;AAC/C,uDAAmD;AACnD,6CAA4D;AAE5D,MAAM,iBAAiB,GAAG,IAAA,yCAA4B,GAAE,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,y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AAc,KAAK,4BAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,gCAAc,CAAC;IACnE,OAAO,CAAC,IAAI,CAAC;QACX,wBAAwB;QACxB;YACE,UAAU,EAAE,gBAAgB;YAC5B,UAAU,EAAE,kBAAkB;gBAC5B,CAAC,CAAC,+CAA+C,MAAM,EAAE;gBACzD,CAAC,CAAC,SAAS;SACd;KACF,CAAC,CAAC;AACL,CAAC;AAED,IAAI,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC;QACX,4BAA4B;QAC5B;YACE,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,IAAI;YACrB,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,8BAA8B;SACzD;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,OAAO,CAAC,IAAI,CAAC;IACX,uBAAuB;IACvB;QACE,MAAM,EAAE;YACN,wBAAwB,gCAAc,KAAK;YAC3C,cAAc;YACd,mBAAmB;YACnB,gBAAgB;YAChB,WAAW;YACX,GAAG,iBAAiB;SACrB;KACF;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semantic-release-config-kuzzle",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "The semantic-release shareable config we use for Kuzzle projects.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
48
48
|
"CHANGELOG.md",
|
|
49
|
-
"dist"
|
|
49
|
+
"dist",
|
|
50
|
+
"presets"
|
|
50
51
|
]
|
|
51
52
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `conventionalcommits` preset, pre-configured and resolved from *this*
|
|
3
|
+
* package instead of from the consumer project.
|
|
4
|
+
*
|
|
5
|
+
* `@semantic-release/commit-analyzer` and `@semantic-release/release-notes-generator`
|
|
6
|
+
* both load a preset named through their `preset` option from only two places:
|
|
7
|
+
* their own directory, and the consumer's `cwd`. Neither plugin depends on
|
|
8
|
+
* `conventional-changelog-conventionalcommits`, so `preset: "conventionalcommits"`
|
|
9
|
+
* only ever worked because npm happened to hoist our dependency to the
|
|
10
|
+
* consumer's root `node_modules/`. When it nested it under this package
|
|
11
|
+
* instead, both lookups failed with `Cannot find module`.
|
|
12
|
+
*
|
|
13
|
+
* Their `config` option goes through the same loader, but a `config` value that
|
|
14
|
+
* looks like a path is imported as a file rather than resolved through
|
|
15
|
+
* `node_modules`. Pointing it at this file therefore pins the preset to this
|
|
16
|
+
* package: the bare specifier below resolves from `presets/`, walking up into
|
|
17
|
+
* our own dependencies, hoisted or not.
|
|
18
|
+
*
|
|
19
|
+
* Note that the `config` branch calls the preset with no arguments, so
|
|
20
|
+
* `presetConfig` is silently ignored and the commit types have to be baked in
|
|
21
|
+
* here.
|
|
22
|
+
*/
|
|
23
|
+
import preset, {
|
|
24
|
+
DEFAULT_COMMIT_TYPES,
|
|
25
|
+
} from "conventional-changelog-conventionalcommits";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The preset hides `chore` from the release notes, while this config promotes
|
|
29
|
+
* `chore(deps)` to a minor release. A dependency bump would otherwise ship a
|
|
30
|
+
* minor whose notes say nothing about it, and a release made only of dependency
|
|
31
|
+
* work would get an empty changelog entry.
|
|
32
|
+
*
|
|
33
|
+
* `findTypeEntry` returns the first match and only compares `scope` when the
|
|
34
|
+
* entry declares one, so the scoped entry has to come before the preset's bare
|
|
35
|
+
* `chore` one.
|
|
36
|
+
*/
|
|
37
|
+
const types = [
|
|
38
|
+
{ scope: "deps", section: "Dependencies", type: "chore" },
|
|
39
|
+
...DEFAULT_COMMIT_TYPES,
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
export default () => preset({ types });
|