@anolilab/semantic-release-preset 3.1.2 → 4.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/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## @anolilab/semantic-release-preset [4.0.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@3.1.3...@anolilab/semantic-release-preset@4.0.0) (2023-06-23)
2
+
3
+
4
+ ### ⚠ BREAKING CHANGES
5
+
6
+ * removed commitlint from semantic-releases and added all rules to the new commitlint-config package
7
+
8
+ Signed-off-by: prisis <d.bannert@anolilab.de>
9
+
10
+ ### Features
11
+
12
+ * removed commitlint from semantic-releases ([ee2cda1](https://github.com/anolilab/javascript-style-guide/commit/ee2cda12d7d8c9f12c3dc2a3a1070babb4b81f5c))
13
+
14
+
15
+
16
+ ### Dependencies
17
+
18
+ * **@anolilab/package-json-utils:** upgraded to 1.5.0
19
+
20
+ ## @anolilab/semantic-release-preset [3.1.3](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@3.1.2...@anolilab/semantic-release-preset@3.1.3) (2023-06-22)
21
+
22
+
23
+
24
+ ### Dependencies
25
+
26
+ * **@anolilab/package-json-utils:** upgraded to 1.4.1
27
+
1
28
  ## @anolilab/semantic-release-preset [3.1.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@3.1.1...@anolilab/semantic-release-preset@3.1.2) (2023-06-22)
2
29
 
3
30
 
package/README.md CHANGED
@@ -1,8 +1,7 @@
1
- # Semantic-release shareable configuration
2
-
3
- Semantic-release shareable configuration to publish GitHub projects.
4
-
5
1
  <div align="center">
2
+ <h1>Shareable semantic-release configuration</h1>
3
+
4
+ A shareable [semantic-release](https://github.com/semantic-release/semantic-release) configuration, for enforcing consistent GitHub/NPM releases in your projects.
6
5
 
7
6
  [![npm-image]][npm-url] [![license-image]][license-url]
8
7
 
@@ -20,15 +19,27 @@ Semantic-release shareable configuration to publish GitHub projects.
20
19
 
21
20
  ---
22
21
 
22
+ ## Purpose
23
+
24
+ - This configuration also includes a semantic-release configuration, which enables automated GitHub/NPM releases based on your commit messages.
25
+
23
26
  ## Install
24
27
 
25
28
  ```bash
26
- npm install --dev-save @anolilab/semantic-release-preset
29
+ npm install --dev-save semantic-release @anolilab/semantic-release-preset
30
+ ```
31
+
32
+ ```sh
33
+ yarn add -D semantic-release @anolilab/semantic-release-preset
34
+ ```
35
+
36
+ ```sh
37
+ pnpm add -D semantic-release @anolilab/semantic-release-preset
27
38
  ```
28
39
 
29
40
  ## Plugins
30
41
 
31
- This shareable configuration uses the following plugins:
42
+ We use the following plugins within the Semantic Release ecosystem:
32
43
 
33
44
  - [@semantic-release/changelog][3]
34
45
  - [@semantic-release/commit-analyzer][1]
@@ -52,7 +63,11 @@ This shareable configuration performs the following actions:
52
63
 
53
64
  ## Usage
54
65
 
55
- When installing this package for the first time, the following shareable configuration (.releaserc.json) is automatically added to your project root folder:
66
+ When installing this package for the first time, the following shareable configuration `.releaserc.json` is automatically added to your project folder:
67
+
68
+ > Note: If the script detects an existing `.releaserc.json` file, it will not overwrite it.
69
+
70
+ > Note: It can happen that the postinstall script dont run, then you have to add the `.releaserc.json` manually.
56
71
 
57
72
  With npm:
58
73
 
@@ -69,10 +84,10 @@ Without npm:
69
84
  "extends": "@anolilab/semantic-release-preset"
70
85
  }
71
86
  ```
87
+ <details>
88
+ <summary>File content of the extended preset</summary>
72
89
 
73
- File content:
74
-
75
- ```json
90
+ ```json5
76
91
  {
77
92
  "branches": [
78
93
  "+([0-9])?(.{+([0-9]),x}).x",
@@ -102,7 +117,7 @@ File content:
102
117
  }
103
118
  ],
104
119
  "@semantic-release/changelog",
105
- "@semantic-release/npm",
120
+ "@semantic-release/npm", // optional
106
121
  [
107
122
  "@semantic-release/git",
108
123
  {
@@ -119,24 +134,17 @@ File content:
119
134
  ]
120
135
  }
121
136
  ```
137
+ </details>
122
138
 
123
- ### Add [Commitizen](https://github.com/commitizen/cz-cli)
124
- Add `cz` to your `package.json scripts`
125
-
126
- ```json
127
- {
128
- "scripts": {
129
- "commit": "cz"
130
- }
131
- }
132
- ```
133
139
 
134
- ### Environment Variables Configuration
140
+ ## Environment Variables Configuration
135
141
 
136
142
  Ensure that your CI configuration has the following environment variables set:
137
143
 
138
144
  - GITHUB_TOKEN: [A GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
145
+ - When a new release is published, this plugin will try to commit and push into the released branch. Ensure that the user that is running the release has push rights and can bypass branch protection rules.
139
146
  - NPM_TOKEN: [A npm personal access token](https://www.npmjs.com/package/settings)
147
+ - A NPM token so the package can be published to NPM (a .npmrc file with extra configuration can also be used)
140
148
 
141
149
  You can test your config with a dry run:
142
150
 
@@ -144,7 +152,10 @@ You can test your config with a dry run:
144
152
  npx semantic-release --dry-run
145
153
  ```
146
154
 
147
- What you’ll want to do next is configure a [GitHub workflow](https://docs.github.com/en/actions/quickstart) to run your tests and publish new versions automatically.
155
+ ## GitHub workflows
156
+
157
+ If you're [configuring a GitHub workflow](https://help.github.com/en/articles/configuring-a-workflow) you might want to do a test build matrix first and then publish only if those tests succeed across all environments.
158
+ The following will do just that, immediately after something is merged into `main`.
148
159
 
149
160
  Here’s an example workflow configuration that runs your tests and publishes a new version for new commits on `main` branch:
150
161
 
@@ -246,6 +257,7 @@ jobs:
246
257
  run: "yarn install --immutable"
247
258
 
248
259
  - name: "Build packages"
260
+ if: "success()"
249
261
  run: "yarn build"
250
262
 
251
263
  - name: "Semantic Release"
@@ -257,7 +269,7 @@ jobs:
257
269
  GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
258
270
  GIT_COMMITTER_NAME: "github-actions-shell"
259
271
  GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
260
- run: "yarn semantic-release"
272
+ run: "npx semantic-release"
261
273
  ```
262
274
  </details>
263
275
 
@@ -5,19 +5,11 @@ var fs = require('fs');
5
5
  var path = require('path');
6
6
  var util = require('util');
7
7
 
8
- process.env.CI&&process.exit(0);var r=util.promisify(fs.writeFile);console.log("Configuring @anolilab/semantic-release-preset",packageJsonUtils.projectPath,`
9
- `);var p=()=>{if(packageJsonUtils.pkg&&(packageJsonUtils.hasDevelopmentDep(["multi-semantic-release","@qiwi/multi-semantic-release"])||packageJsonUtils.hasDep(["multi-semantic-release","@qiwi/multi-semantic-release"])))return console.warn("\u26A0\uFE0F found use of multi-semantic-release;"),Promise.resolve();let e=path.join(packageJsonUtils.projectPath,".releaserc.json");return fs.existsSync(e)?(console.warn("\u26A0\uFE0F .releaserc.json already exists;"),Promise.resolve()):r(e,`{
8
+ process.env.CI&&process.exit(0);var c=util.promisify(fs.writeFile);console.log("Configuring @anolilab/semantic-release-preset",packageJsonUtils.projectPath,`
9
+ `);var m=()=>{if(packageJsonUtils.pkg&&(packageJsonUtils.hasDevelopmentDep(["multi-semantic-release","@qiwi/multi-semantic-release"])||packageJsonUtils.hasDep(["multi-semantic-release","@qiwi/multi-semantic-release"])))return console.warn("\u26A0\uFE0F found use of multi-semantic-release;"),Promise.resolve();let e=path.join(packageJsonUtils.projectPath,".releaserc.json");return fs.existsSync(e)?(console.warn("\u26A0\uFE0F .releaserc.json already exists;"),Promise.resolve()):c(e,`{
10
10
  "extends": "@anolilab/semantic-release-preset/npm"
11
11
  }
12
12
 
13
- `,"utf-8")},u=()=>{let e=path.join(packageJsonUtils.projectPath,"commitlint.config.js");return fs.existsSync(e)?(console.warn("\u26A0\uFE0F commitlint.config.js already exists;"),Promise.resolve()):r(e,`${packageJsonUtils.packageIsTypeModule?"export default":"module.exports ="} {
14
- extends: ["@commitlint/config-conventional"],
15
- };
16
-
17
- `,"utf-8")},w=()=>{let e=path.join(packageJsonUtils.projectPath,".czrc");return fs.existsSync(e)?(console.warn("\u26A0\uFE0F .czrc already exists;"),Promise.resolve()):r(e,`{
18
- "path": "cz-conventional-changelog"
19
- }
20
-
21
- `,"utf-8")};(async()=>{try{await p(),await u(),await w(),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
13
+ `,"utf-8")};(async()=>{try{await m(),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
22
14
  //# sourceMappingURL=out.js.map
23
15
  //# sourceMappingURL=postinstall.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall.ts"],"names":["hasDep","hasDevelopmentDep","packageIsTypeModule","pkg","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writeReleaseRc","releaseRcPath","writeCommitLintConfig","commitlintPath","writeCzrc","filePath","error"],"mappings":"AAAA,OACC,UAAAA,EAAQ,qBAAAC,EAAmB,uBAAAC,EAAqB,OAAAC,EAAK,eAAAC,MAC/C,+BACP,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAEtB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,gDAAiDF,EAAa;AAAA,CAAI,EAK9E,IAAMM,EAAiB,IAAM,CACzB,GACIP,IACIF,EAAkB,CAAC,yBAA0B,8BAA8B,CAAC,GAAKD,EAAO,CAAC,yBAA0B,8BAA8B,CAAC,GAEtJ,eAAQ,KAAK,oDAA0C,EAEhD,QAAQ,QAAQ,EAG3B,IAAMW,EAAgBJ,EAAKH,EAAa,iBAAiB,EAEzD,OAAIC,EAAWM,CAAa,GACxB,QAAQ,KAAK,+CAAqC,EAE3C,QAAQ,QAAQ,GASpBF,EAAeE,EANN;AAAA;AAAA;AAAA;AAAA,EAM8B,OAAO,CACzD,EAKMC,EAAwB,IAAM,CAChC,IAAMC,EAAiBN,EAAKH,EAAa,sBAAsB,EAE/D,OAAIC,EAAWQ,CAAc,GACzB,QAAQ,KAAK,oDAA0C,EAEhD,QAAQ,QAAQ,GASpBJ,EAAeI,EANN,GAAGX,EAAsB,iBAAmB;AAAA;AAAA;AAAA;AAAA,EAMb,OAAO,CAC1D,EAKMY,EAAY,IAAM,CACpB,IAAMC,EAAWR,EAAKH,EAAa,OAAO,EAE1C,OAAIC,EAAWU,CAAQ,GACnB,QAAQ,KAAK,qCAA2B,EAEjC,QAAQ,QAAQ,GASpBN,EAAeM,EANN;AAAA;AAAA;AAAA;AAAA,EAMyB,OAAO,CACpD,GAGC,SAAY,CACT,GAAI,CACA,MAAML,EAAe,EACrB,MAAME,EAAsB,EAC5B,MAAME,EAAU,EAEhB,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASE,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import {\n hasDep, hasDevelopmentDep, packageIsTypeModule, pkg, projectPath\n} from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/semantic-release-preset\", projectPath, \"\\n\");\n\n/**\n * Writes .releaserc.json if it doesn't exist. Warns if it exists.\n */\nconst writeReleaseRc = () => {\n if (\n pkg\n && (hasDevelopmentDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]) || hasDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]))\n ) {\n console.warn(\"⚠️ found use of multi-semantic-release;\");\n\n return Promise.resolve();\n }\n\n const releaseRcPath = join(projectPath, \".releaserc.json\");\n\n if (existsSync(releaseRcPath)) {\n console.warn(\"⚠️ .releaserc.json already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `{\n \"extends\": \"@anolilab/semantic-release-preset/npm\"\n}\n\n`;\n\n return writeFileAsync(releaseRcPath, content, \"utf-8\");\n};\n\n/**\n * Writes commitlint.config.js if it doesn't exist. Warns if it exists.\n */\nconst writeCommitLintConfig = () => {\n const commitlintPath = join(projectPath, \"commitlint.config.js\");\n\n if (existsSync(commitlintPath)) {\n console.warn(\"⚠️ commitlint.config.js already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n extends: [\"@commitlint/config-conventional\"],\n};\n\n`;\n\n return writeFileAsync(commitlintPath, content, \"utf-8\");\n};\n\n/**\n * Writes .czrc if it doesn't exist. Warns if it exists.\n */\nconst writeCzrc = () => {\n const filePath = join(projectPath, \".czrc\");\n\n if (existsSync(filePath)) {\n console.warn(\"⚠️ .czrc already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `{\n \"path\": \"cz-conventional-changelog\"\n}\n\n`;\n\n return writeFileAsync(filePath, content, \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n await writeReleaseRc();\n await writeCommitLintConfig();\n await writeCzrc();\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
1
+ {"version":3,"sources":["../src/postinstall.ts"],"names":["hasDep","hasDevelopmentDep","pkg","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writeReleaseRc","releaseRcPath","error"],"mappings":"AAAA,OACC,UAAAA,EAAQ,qBAAAC,EAAmB,OAAAC,EAAK,eAAAC,MAC1B,+BACP,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAEtB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,gDAAiDF,EAAa;AAAA,CAAI,EAK9E,IAAMM,EAAiB,IAAM,CACzB,GACIP,IACID,EAAkB,CAAC,yBAA0B,8BAA8B,CAAC,GAAKD,EAAO,CAAC,yBAA0B,8BAA8B,CAAC,GAEtJ,eAAQ,KAAK,oDAA0C,EAEhD,QAAQ,QAAQ,EAG3B,IAAMU,EAAgBJ,EAAKH,EAAa,iBAAiB,EAEzD,OAAIC,EAAWM,CAAa,GACxB,QAAQ,KAAK,+CAAqC,EAE3C,QAAQ,QAAQ,GASpBF,EAAeE,EANN;AAAA;AAAA;AAAA;AAAA,EAM8B,OAAO,CACzD,GAGC,SAAY,CACT,GAAI,CACA,MAAMD,EAAe,EAErB,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASE,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import {\n hasDep, hasDevelopmentDep, pkg, projectPath\n} from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/semantic-release-preset\", projectPath, \"\\n\");\n\n/**\n * Writes .releaserc.json if it doesn't exist. Warns if it exists.\n */\nconst writeReleaseRc = () => {\n if (\n pkg\n && (hasDevelopmentDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]) || hasDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]))\n ) {\n console.warn(\"⚠️ found use of multi-semantic-release;\");\n\n return Promise.resolve();\n }\n\n const releaseRcPath = join(projectPath, \".releaserc.json\");\n\n if (existsSync(releaseRcPath)) {\n console.warn(\"⚠️ .releaserc.json already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `{\n \"extends\": \"@anolilab/semantic-release-preset/npm\"\n}\n\n`;\n\n return writeFileAsync(releaseRcPath, content, \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n await writeReleaseRc();\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
@@ -1,21 +1,13 @@
1
- import { projectPath, pkg, hasDevelopmentDep, hasDep, packageIsTypeModule } from '@anolilab/package-json-utils';
1
+ import { projectPath, pkg, hasDevelopmentDep, hasDep } from '@anolilab/package-json-utils';
2
2
  import { writeFile, existsSync } from 'fs';
3
3
  import { join } from 'path';
4
4
  import { promisify } from 'util';
5
5
 
6
- process.env.CI&&process.exit(0);var r=promisify(writeFile);console.log("Configuring @anolilab/semantic-release-preset",projectPath,`
7
- `);var p=()=>{if(pkg&&(hasDevelopmentDep(["multi-semantic-release","@qiwi/multi-semantic-release"])||hasDep(["multi-semantic-release","@qiwi/multi-semantic-release"])))return console.warn("\u26A0\uFE0F found use of multi-semantic-release;"),Promise.resolve();let e=join(projectPath,".releaserc.json");return existsSync(e)?(console.warn("\u26A0\uFE0F .releaserc.json already exists;"),Promise.resolve()):r(e,`{
6
+ process.env.CI&&process.exit(0);var c=promisify(writeFile);console.log("Configuring @anolilab/semantic-release-preset",projectPath,`
7
+ `);var m=()=>{if(pkg&&(hasDevelopmentDep(["multi-semantic-release","@qiwi/multi-semantic-release"])||hasDep(["multi-semantic-release","@qiwi/multi-semantic-release"])))return console.warn("\u26A0\uFE0F found use of multi-semantic-release;"),Promise.resolve();let e=join(projectPath,".releaserc.json");return existsSync(e)?(console.warn("\u26A0\uFE0F .releaserc.json already exists;"),Promise.resolve()):c(e,`{
8
8
  "extends": "@anolilab/semantic-release-preset/npm"
9
9
  }
10
10
 
11
- `,"utf-8")},u=()=>{let e=join(projectPath,"commitlint.config.js");return existsSync(e)?(console.warn("\u26A0\uFE0F commitlint.config.js already exists;"),Promise.resolve()):r(e,`${packageIsTypeModule?"export default":"module.exports ="} {
12
- extends: ["@commitlint/config-conventional"],
13
- };
14
-
15
- `,"utf-8")},w=()=>{let e=join(projectPath,".czrc");return existsSync(e)?(console.warn("\u26A0\uFE0F .czrc already exists;"),Promise.resolve()):r(e,`{
16
- "path": "cz-conventional-changelog"
17
- }
18
-
19
- `,"utf-8")};(async()=>{try{await p(),await u(),await w(),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
11
+ `,"utf-8")};(async()=>{try{await m(),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
20
12
  //# sourceMappingURL=out.js.map
21
13
  //# sourceMappingURL=postinstall.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall.ts"],"names":["hasDep","hasDevelopmentDep","packageIsTypeModule","pkg","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writeReleaseRc","releaseRcPath","writeCommitLintConfig","commitlintPath","writeCzrc","filePath","error"],"mappings":"AAAA,OACC,UAAAA,EAAQ,qBAAAC,EAAmB,uBAAAC,EAAqB,OAAAC,EAAK,eAAAC,MAC/C,+BACP,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAEtB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,gDAAiDF,EAAa;AAAA,CAAI,EAK9E,IAAMM,EAAiB,IAAM,CACzB,GACIP,IACIF,EAAkB,CAAC,yBAA0B,8BAA8B,CAAC,GAAKD,EAAO,CAAC,yBAA0B,8BAA8B,CAAC,GAEtJ,eAAQ,KAAK,oDAA0C,EAEhD,QAAQ,QAAQ,EAG3B,IAAMW,EAAgBJ,EAAKH,EAAa,iBAAiB,EAEzD,OAAIC,EAAWM,CAAa,GACxB,QAAQ,KAAK,+CAAqC,EAE3C,QAAQ,QAAQ,GASpBF,EAAeE,EANN;AAAA;AAAA;AAAA;AAAA,EAM8B,OAAO,CACzD,EAKMC,EAAwB,IAAM,CAChC,IAAMC,EAAiBN,EAAKH,EAAa,sBAAsB,EAE/D,OAAIC,EAAWQ,CAAc,GACzB,QAAQ,KAAK,oDAA0C,EAEhD,QAAQ,QAAQ,GASpBJ,EAAeI,EANN,GAAGX,EAAsB,iBAAmB;AAAA;AAAA;AAAA;AAAA,EAMb,OAAO,CAC1D,EAKMY,EAAY,IAAM,CACpB,IAAMC,EAAWR,EAAKH,EAAa,OAAO,EAE1C,OAAIC,EAAWU,CAAQ,GACnB,QAAQ,KAAK,qCAA2B,EAEjC,QAAQ,QAAQ,GASpBN,EAAeM,EANN;AAAA;AAAA;AAAA;AAAA,EAMyB,OAAO,CACpD,GAGC,SAAY,CACT,GAAI,CACA,MAAML,EAAe,EACrB,MAAME,EAAsB,EAC5B,MAAME,EAAU,EAEhB,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASE,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import {\n hasDep, hasDevelopmentDep, packageIsTypeModule, pkg, projectPath\n} from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/semantic-release-preset\", projectPath, \"\\n\");\n\n/**\n * Writes .releaserc.json if it doesn't exist. Warns if it exists.\n */\nconst writeReleaseRc = () => {\n if (\n pkg\n && (hasDevelopmentDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]) || hasDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]))\n ) {\n console.warn(\"⚠️ found use of multi-semantic-release;\");\n\n return Promise.resolve();\n }\n\n const releaseRcPath = join(projectPath, \".releaserc.json\");\n\n if (existsSync(releaseRcPath)) {\n console.warn(\"⚠️ .releaserc.json already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `{\n \"extends\": \"@anolilab/semantic-release-preset/npm\"\n}\n\n`;\n\n return writeFileAsync(releaseRcPath, content, \"utf-8\");\n};\n\n/**\n * Writes commitlint.config.js if it doesn't exist. Warns if it exists.\n */\nconst writeCommitLintConfig = () => {\n const commitlintPath = join(projectPath, \"commitlint.config.js\");\n\n if (existsSync(commitlintPath)) {\n console.warn(\"⚠️ commitlint.config.js already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n extends: [\"@commitlint/config-conventional\"],\n};\n\n`;\n\n return writeFileAsync(commitlintPath, content, \"utf-8\");\n};\n\n/**\n * Writes .czrc if it doesn't exist. Warns if it exists.\n */\nconst writeCzrc = () => {\n const filePath = join(projectPath, \".czrc\");\n\n if (existsSync(filePath)) {\n console.warn(\"⚠️ .czrc already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `{\n \"path\": \"cz-conventional-changelog\"\n}\n\n`;\n\n return writeFileAsync(filePath, content, \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n await writeReleaseRc();\n await writeCommitLintConfig();\n await writeCzrc();\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
1
+ {"version":3,"sources":["../src/postinstall.ts"],"names":["hasDep","hasDevelopmentDep","pkg","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writeReleaseRc","releaseRcPath","error"],"mappings":"AAAA,OACC,UAAAA,EAAQ,qBAAAC,EAAmB,OAAAC,EAAK,eAAAC,MAC1B,+BACP,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAEtB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,gDAAiDF,EAAa;AAAA,CAAI,EAK9E,IAAMM,EAAiB,IAAM,CACzB,GACIP,IACID,EAAkB,CAAC,yBAA0B,8BAA8B,CAAC,GAAKD,EAAO,CAAC,yBAA0B,8BAA8B,CAAC,GAEtJ,eAAQ,KAAK,oDAA0C,EAEhD,QAAQ,QAAQ,EAG3B,IAAMU,EAAgBJ,EAAKH,EAAa,iBAAiB,EAEzD,OAAIC,EAAWM,CAAa,GACxB,QAAQ,KAAK,+CAAqC,EAE3C,QAAQ,QAAQ,GASpBF,EAAeE,EANN;AAAA;AAAA;AAAA;AAAA,EAM8B,OAAO,CACzD,GAGC,SAAY,CACT,GAAI,CACA,MAAMD,EAAe,EAErB,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASE,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import {\n hasDep, hasDevelopmentDep, pkg, projectPath\n} from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/semantic-release-preset\", projectPath, \"\\n\");\n\n/**\n * Writes .releaserc.json if it doesn't exist. Warns if it exists.\n */\nconst writeReleaseRc = () => {\n if (\n pkg\n && (hasDevelopmentDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]) || hasDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]))\n ) {\n console.warn(\"⚠️ found use of multi-semantic-release;\");\n\n return Promise.resolve();\n }\n\n const releaseRcPath = join(projectPath, \".releaserc.json\");\n\n if (existsSync(releaseRcPath)) {\n console.warn(\"⚠️ .releaserc.json already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `{\n \"extends\": \"@anolilab/semantic-release-preset/npm\"\n}\n\n`;\n\n return writeFileAsync(releaseRcPath, content, \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n await writeReleaseRc();\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/semantic-release-preset",
3
- "version": "3.1.2",
3
+ "version": "4.0.0",
4
4
  "description": "Anolilab Coding Standard for semantic-release.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -62,10 +62,7 @@
62
62
  "postinstall": "node ./skip.js || node ./dist/postinstall.js"
63
63
  },
64
64
  "dependencies": {
65
- "@anolilab/package-json-utils": "1.4.0",
66
- "@commitlint/cli": "^17.6.5",
67
- "@commitlint/config-conventional": "^17.6.5",
68
- "@commitlint/core": "^17.6.5",
65
+ "@anolilab/package-json-utils": "1.5.0",
69
66
  "@semantic-release/changelog": "^6.0.3",
70
67
  "@semantic-release/commit-analyzer": "^10.0.1",
71
68
  "@semantic-release/exec": "^6.0.3",
@@ -73,10 +70,7 @@
73
70
  "@semantic-release/github": "^9.0.3",
74
71
  "@semantic-release/npm": "^10.0.4",
75
72
  "@semantic-release/release-notes-generator": "^11.0.3",
76
- "commitizen": "^4.3.0",
77
- "conventional-changelog-conventionalcommits": "^6.0.0",
78
- "cz-conventional-changelog": "^3.3.0",
79
- "semantic-release-conventional-commits": "^3.0.0"
73
+ "conventional-changelog-conventionalcommits": "^6.0.0"
80
74
  },
81
75
  "devDependencies": {
82
76
  "semantic-release": "^21.0.5"