@frsource/release-it-config 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.
package/index.cjs ADDED
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ monorepoIndependent: require("./monorepoIndependent.cjs"),
3
+ };
@@ -0,0 +1,59 @@
1
+ const nodePath = require("path");
2
+
3
+ /**
4
+ * Configuration for independent package in monorepo workspace
5
+ * @param {Object} options
6
+ * @param {string} options.name name of the package in the monorepo, e.g. `my-package`
7
+ * @param {string} [options.path=`packages/${options.name}`] path of the package relative to the monorepo root, without starting slash. Always use "/" as delimiter. Will default to `packages/${options.name}`
8
+ * @param {string} [options.buildCmd="pnpm build"] command that should be used to build the package, defaults to `pnpm build`
9
+ */
10
+ module.exports = ({
11
+ name,
12
+ path = `packages/${name}`,
13
+ buildCmd = "pnpm build",
14
+ }) => {
15
+ if (path.startsWith("/")) path = path.substring(1);
16
+ const nestingLevel = path.split("/").length;
17
+ if (nodePath.sep !== "/") path = path.replaceAll("/", nodePath.sep);
18
+
19
+ return {
20
+ npm: {
21
+ publishPath: "package-pack.tgz",
22
+ },
23
+ git: {
24
+ requireBranch: "main",
25
+ requireCommits: true,
26
+ requireCommitsFail: false, // if there are no new commits release-it will stop the release process, but without throwing and error
27
+ requireCleanWorkingDir: true,
28
+ commitsPath: ".",
29
+ commitMessage: "chore: release ${npm.name} ${version}",
30
+ tagName: "${npm.name}-v${version}",
31
+ tagMatch: "${npm.name}-v[0-9]*.[0-9]*.[0-9]*",
32
+ getLatestTagFromAllRefs: false, // https://github.com/release-it/release-it/blob/main/docs/git.md#use-all-refs-to-determine-latest-tag
33
+ },
34
+ github: {
35
+ release: true,
36
+ comments: {
37
+ submit: true,
38
+ issue:
39
+ ":rocket: _This issue has been resolved in ${npm.name}@${version}. See [${releaseName}](${releaseUrl}) for release notes._",
40
+ pr: ":rocket: _This pull request is included in ${npm.name}@${version}. See [${releaseName}](${releaseUrl}) for release notes._",
41
+ },
42
+ },
43
+ plugins: {
44
+ "@release-it/conventional-changelog": {
45
+ gitRawCommitsOpts: {
46
+ path,
47
+ },
48
+ },
49
+ },
50
+ hooks: {
51
+ "before:bump": buildCmd,
52
+ "after:bump": `pnpm install && git add ${"../".repeat(
53
+ nestingLevel
54
+ )}pnpm-lock.yaml`,
55
+ "before:npm:release": "mv $(pnpm pack) package-pack.tgz",
56
+ "after:npm:release": "rm package-pack.tgz",
57
+ },
58
+ };
59
+ };
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@frsource/release-it-config",
3
+ "version": "1.0.0",
4
+ "main": "index.cjs",
5
+ "type": "module",
6
+ "dependencies": {
7
+ "@release-it/conventional-changelog": "^8.0.1"
8
+ },
9
+ "devDependencies": {
10
+ "release-it": "^17.2.0"
11
+ },
12
+ "peerDependencies": {
13
+ "release-it": ">= 17"
14
+ },
15
+ "homepage": "https://github.com/FRSOURCE/toolkit/",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/FRSOURCE/toolkit.git",
19
+ "directory": "packages/release-it-config"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/FRSOURCE/toolkit/issues"
23
+ },
24
+ "author": "Jakub Freisler <jakub@frsource.org>",
25
+ "license": "MIT",
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "packageManager": "pnpm@8.14.1",
30
+ "keywords": [
31
+ "release-it",
32
+ "release-it config"
33
+ ],
34
+ "scripts": {
35
+ "release": "release-it"
36
+ }
37
+ }