@anolilab/semantic-release-preset 3.1.3 → 4.0.1

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,29 @@
1
+ ## @anolilab/semantic-release-preset [4.0.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@4.0.0...@anolilab/semantic-release-preset@4.0.1) (2023-06-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added missing presetConfig to @semantic-release/release-notes-generator ([f39883d](https://github.com/anolilab/javascript-style-guide/commit/f39883df22a9980698ed5822d8be81c9bf5fb778))
7
+
8
+ ## @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)
9
+
10
+
11
+ ### ⚠ BREAKING CHANGES
12
+
13
+ * removed commitlint from semantic-releases and added all rules to the new commitlint-config package
14
+
15
+ Signed-off-by: prisis <d.bannert@anolilab.de>
16
+
17
+ ### Features
18
+
19
+ * removed commitlint from semantic-releases ([ee2cda1](https://github.com/anolilab/javascript-style-guide/commit/ee2cda12d7d8c9f12c3dc2a3a1070babb4b81f5c))
20
+
21
+
22
+
23
+ ### Dependencies
24
+
25
+ * **@anolilab/package-json-utils:** upgraded to 1.5.0
26
+
1
27
  ## @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)
2
28
 
3
29
 
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,23 +19,35 @@ 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
- - [@semantic-release/changelog][3]
34
- - [@semantic-release/commit-analyzer][1]
35
- - [@semantic-release/exec][5]
36
- - [@semantic-release/git][6]
37
- - [@semantic-release/github][4]
38
- - [@semantic-release/npm][7] (optional)
39
- - [@semantic-release/release-notes-generator][2]
44
+ - [@semantic-release/changelog][3]
45
+ - [@semantic-release/commit-analyzer][1]
46
+ - [@semantic-release/exec][5]
47
+ - [@semantic-release/git][6]
48
+ - [@semantic-release/github][4]
49
+ - [@semantic-release/npm][7] (optional)
50
+ - [@semantic-release/release-notes-generator][2]
40
51
 
41
52
  ## Summary
42
53
 
@@ -52,13 +63,17 @@ 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
 
59
74
  ```json
60
75
  {
61
- "extends": "@anolilab/semantic-release-preset/npm"
76
+ "extends": "@anolilab/semantic-release-preset/npm"
62
77
  }
63
78
  ```
64
79
 
@@ -66,77 +81,123 @@ Without npm:
66
81
 
67
82
  ```json
68
83
  {
69
- "extends": "@anolilab/semantic-release-preset"
84
+ "extends": "@anolilab/semantic-release-preset"
70
85
  }
71
86
  ```
72
87
 
73
- File content:
88
+ <details>
89
+ <summary>File content of the extended preset</summary>
74
90
 
75
- ```json
91
+ ```json5
76
92
  {
77
- "branches": [
93
+ branches: [
78
94
  "+([0-9])?(.{+([0-9]),x}).x",
79
95
  "main",
80
96
  "next",
81
97
  "next-major",
82
98
  {
83
- "name": "beta",
84
- "prerelease": true
99
+ name: "beta",
100
+ prerelease: true,
85
101
  },
86
102
  {
87
- "name": "alpha",
88
- "prerelease": true
89
- }
103
+ name: "alpha",
104
+ prerelease: true,
105
+ },
90
106
  ],
91
- "plugins": [
107
+ plugins: [
92
108
  [
93
109
  "@semantic-release/commit-analyzer",
94
110
  {
95
- "preset": "conventionalcommits"
96
- }
111
+ preset: "conventionalcommits",
112
+ },
97
113
  ],
98
114
  [
99
115
  "@semantic-release/release-notes-generator",
100
116
  {
101
- "preset": "conventionalcommits"
102
- }
117
+ preset: "conventionalcommits",
118
+ },
103
119
  ],
104
120
  "@semantic-release/changelog",
105
- "@semantic-release/npm",
121
+ "@semantic-release/npm", // optional
106
122
  [
107
123
  "@semantic-release/git",
108
124
  {
109
- "message": "chore(release): ${nextRelease.gitTag} [skip ci]\\n\\n${nextRelease.notes}"
110
- }
125
+ message: "chore(release): ${nextRelease.gitTag} [skip ci]\\n\\n${nextRelease.notes}",
126
+ },
111
127
  ],
112
128
  [
113
129
  "@semantic-release/github",
114
130
  {
115
- "successComment": false,
116
- "failComment": false
117
- }
118
- ]
119
- ]
131
+ successComment: false,
132
+ failComment: false,
133
+ },
134
+ ],
135
+ ],
120
136
  }
121
137
  ```
122
138
 
123
- ### Add [Commitizen](https://github.com/commitizen/cz-cli)
124
- Add `cz` to your `package.json scripts`
139
+ </details>
140
+
141
+ ### deprecation
142
+
143
+ You want deprecate old versions of your package?
144
+
145
+ #### Install
146
+
147
+ ```bash
148
+ npm install --dev-save semantic-release-npm-deprecate-old-versions
149
+ ```
150
+
151
+ ```sh
152
+ pnpm add -D semantic-release-npm-deprecate-old-versions
153
+ ```
154
+
155
+ ```sh
156
+ yarn add -D semantic-release-npm-deprecate-old-versions
157
+ ```
158
+
159
+ No problem, just add the following to your `.releaserc.json`:
125
160
 
126
161
  ```json
127
162
  {
128
- "scripts": {
129
- "commit": "cz"
130
- }
163
+ "extends": "@anolilab/semantic-release-preset/npm",
164
+ "plugins": [
165
+ [
166
+ "semantic-release-npm-deprecate-old-versions",
167
+ {
168
+ "rules": [
169
+ {
170
+ "rule": "supportLatest",
171
+ "options": {
172
+ "numberOfMajorReleases": 1,
173
+ "numberOfMinorReleases": 1,
174
+ "numberOfPatchReleases": 1
175
+ }
176
+ },
177
+ {
178
+ "rule": "supportPreReleaseIfNotReleased",
179
+ "options": {
180
+ "numberOfPreReleases": 1
181
+ }
182
+ },
183
+ "deprecateAll"
184
+ ]
185
+ }
186
+ ]
187
+ ]
131
188
  }
132
189
  ```
133
190
 
134
- ### Environment Variables Configuration
191
+ Find out how to configure the plugin [here](https://github.com/ghusse/semantic-release-npm-deprecate-old-versions).
192
+
193
+ ## Environment Variables Configuration
135
194
 
136
195
  Ensure that your CI configuration has the following environment variables set:
137
196
 
138
- - GITHUB_TOKEN: [A GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
139
- - NPM_TOKEN: [A npm personal access token](https://www.npmjs.com/package/settings)
197
+ - GITHUB_TOKEN: [A GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
198
+ - 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.
199
+ - NPM_TOKEN: [A npm personal access token](https://www.npmjs.com/package/settings)
200
+ - A NPM token so the package can be published to NPM (a .npmrc file with extra configuration can also be used)
140
201
 
141
202
  You can test your config with a dry run:
142
203
 
@@ -144,7 +205,10 @@ You can test your config with a dry run:
144
205
  npx semantic-release --dry-run
145
206
  ```
146
207
 
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.
208
+ ## GitHub workflows
209
+
210
+ 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.
211
+ The following will do just that, immediately after something is merged into `main`.
148
212
 
149
213
  Here’s an example workflow configuration that runs your tests and publishes a new version for new commits on `main` branch:
150
214
 
@@ -189,7 +253,7 @@ jobs:
189
253
 
190
254
  - name: "Get yarn cache directory path"
191
255
  id: "yarn-cache-dir-path"
192
- run: "echo \"::set-output name=dir::$(yarn config get cacheFolder)\""
256
+ run: 'echo "::set-output name=dir::$(yarn config get cacheFolder)"'
193
257
 
194
258
  - uses: "actions/cache@v2"
195
259
  id: "yarn-cache" # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -232,7 +296,7 @@ jobs:
232
296
 
233
297
  - name: "Get yarn cache directory path"
234
298
  id: "yarn-cache-dir-path"
235
- run: "echo \"::set-output name=dir::$(yarn config get cacheFolder)\""
299
+ run: 'echo "::set-output name=dir::$(yarn config get cacheFolder)"'
236
300
 
237
301
  - uses: "actions/cache@v2"
238
302
  id: "yarn-cache" # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -246,19 +310,21 @@ jobs:
246
310
  run: "yarn install --immutable"
247
311
 
248
312
  - name: "Build packages"
313
+ if: "success()"
249
314
  run: "yarn build"
250
315
 
251
316
  - name: "Semantic Release"
252
317
  if: "success()"
253
318
  env:
254
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
255
- NPM_TOKEN: "${{ secrets.NPM_AUTH_TOKEN }}"
256
- GIT_AUTHOR_NAME: "github-actions-shell"
257
- GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
258
- GIT_COMMITTER_NAME: "github-actions-shell"
259
- GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
260
- run: "yarn semantic-release"
319
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
320
+ NPM_TOKEN: "${{ secrets.NPM_AUTH_TOKEN }}"
321
+ GIT_AUTHOR_NAME: "github-actions-shell"
322
+ GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
323
+ GIT_COMMITTER_NAME: "github-actions-shell"
324
+ GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
325
+ run: "npx semantic-release"
261
326
  ```
327
+
262
328
  </details>
263
329
 
264
330
  To release multi package repositories, you need to install `@qiwi/multi-semantic-release` and `semantic-release`.
@@ -427,6 +493,7 @@ jobs:
427
493
  commit_user_name: "prisis"
428
494
  branch: "${{ github.head_ref }}"
429
495
  ```
496
+
430
497
  </details>
431
498
 
432
499
  ## Note on GitHub protected branches
@@ -445,21 +512,18 @@ Libraries in this ecosystem make the best effort to track
445
512
  [Node.js’ release schedule](https://nodejs.org/en/about/releases/). Here’s [a
446
513
  post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
447
514
 
448
- Contributing
449
- ------------
515
+ ## Contributing
450
516
 
451
517
  If you would like to help take a look at the [list of issues](https://github.com/anolilab/javascript-style-guide/issues) and check our [Contributing](.github/CONTRIBUTING.md) guild.
452
518
 
453
519
  > **Note:** please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
454
520
 
455
- Credits
456
- -------------
521
+ ## Credits
457
522
 
458
- - [Daniel Bannert](https://github.com/prisis)
459
- - [All Contributors](https://github.com/anolilab/javascript-style-guide/graphs/contributors)
523
+ - [Daniel Bannert](https://github.com/prisis)
524
+ - [All Contributors](https://github.com/anolilab/javascript-style-guide/graphs/contributors)
460
525
 
461
- License
462
- -------------
526
+ ## License
463
527
 
464
528
  The anolilab javascript-style-guide is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT)
465
529
 
@@ -470,7 +534,6 @@ The anolilab javascript-style-guide is open-sourced software licensed under the
470
534
  [5]: https://github.com/semantic-release/exec
471
535
  [6]: https://github.com/semantic-release/git
472
536
  [7]: https://github.com/semantic-release/npm
473
-
474
537
  [license-image]: https://img.shields.io/npm/l/@anolilab/semantic-release-preset?color=blueviolet&style=for-the-badge
475
538
  [license-url]: LICENSE.md "license"
476
539
  [npm-image]: https://img.shields.io/npm/v/@anolilab/semantic-release-preset/latest.svg?style=for-the-badge&logo=npm
@@ -23,7 +23,23 @@
23
23
  [
24
24
  "@semantic-release/release-notes-generator",
25
25
  {
26
- "preset": "conventionalcommits"
26
+ "preset": "conventionalcommits",
27
+ "presetConfig": {
28
+ "types": [
29
+ { "type": "feat", "section": "Features" },
30
+ { "type": "feature", "section": "Features" },
31
+ { "type": "fix", "section": "Bug Fixes" },
32
+ { "type": "perf", "section": "Performance Improvements" },
33
+ { "type": "revert", "section": "Reverts" },
34
+ { "type": "docs", "section": "Documentation", "hidden": false },
35
+ { "type": "style", "section": "Styles", "hidden": false },
36
+ { "type": "chore", "section": "Miscellaneous Chores", "hidden": false },
37
+ { "type": "refactor", "section": "Code Refactoring", "hidden": false },
38
+ { "type": "test", "section": "Tests", "hidden": false },
39
+ { "type": "build", "section": "Build System", "hidden": false },
40
+ { "type": "ci", "section": "Continuous Integration", "hidden": false }
41
+ ]
42
+ }
27
43
  }
28
44
  ],
29
45
  "@semantic-release/changelog",
@@ -23,7 +23,23 @@
23
23
  [
24
24
  "@semantic-release/release-notes-generator",
25
25
  {
26
- "preset": "conventionalcommits"
26
+ "preset": "conventionalcommits",
27
+ "presetConfig": {
28
+ "types": [
29
+ { "type": "feat", "section": "Features" },
30
+ { "type": "feature", "section": "Features" },
31
+ { "type": "fix", "section": "Bug Fixes" },
32
+ { "type": "perf", "section": "Performance Improvements" },
33
+ { "type": "revert", "section": "Reverts" },
34
+ { "type": "docs", "section": "Documentation", "hidden": false },
35
+ { "type": "style", "section": "Styles", "hidden": false },
36
+ { "type": "chore", "section": "Miscellaneous Chores", "hidden": false },
37
+ { "type": "refactor", "section": "Code Refactoring", "hidden": false },
38
+ { "type": "test", "section": "Tests", "hidden": false },
39
+ { "type": "build", "section": "Build System", "hidden": false },
40
+ { "type": "ci", "section": "Continuous Integration", "hidden": false }
41
+ ]
42
+ }
27
43
  }
28
44
  ],
29
45
  "@semantic-release/changelog",
@@ -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.3",
3
+ "version": "4.0.1",
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.1",
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"