diff --git a/.commitlintrc.js b/.commitlintrc.mjs similarity index 98% rename from .commitlintrc.js rename to .commitlintrc.mjs index ffe20cf6..b2bf0b9f 100644 --- a/.commitlintrc.js +++ b/.commitlintrc.mjs @@ -1,4 +1,4 @@ -module.exports = { +export default { extends: ['./packages/commitlint-config'], rules: { 'scope-enum': [ diff --git a/README.md b/README.md index 4ffcfcf3..1000f0d0 100644 --- a/README.md +++ b/README.md @@ -6,22 +6,20 @@ This monorepo contains shareable configurations for various coding-style/best pr ## Available Configurations -| Tool | Package | Version | -| ---------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| Browserslist | [@lmc-eu/browserslist-config](packages/browserslist-config) | [![@lmc-eu/browserslist-config][blc-badge]][blc-npm] | -| Commitlint | [@lmc-eu/commitlint-config](packages/commitlint-config) | [![@lmc-eu/commitlint-config][clc-badge]][clc-npm] | -| Conventional Changelog | [@lmc-eu/conventional-changelog-lmc-bitbucket](packages/conventional-changelog-lmc-bitbucket) | [![@lmc-eu/conventional-changelog-lmc-bitbucket][cc-bb-badge]][cc-bb-npm] | -| Conventional Changelog | [@lmc-eu/conventional-changelog-lmc-github](packages/conventional-changelog-lmc-github) | [![@lmc-eu/conventional-changelog-lmc-github][cc-gh-badge]][cc-gh-npm] | -| ESLint | [@lmc-eu/eslint-config-base](packages/eslint-config-base) | [![@lmc-eu/eslint-config-base][ec-base-badge]][ec-base-npm] | -| ESLint | [@lmc-eu/eslint-config-graphql](packages/eslint-config-graphql) | [![@lmc-eu/eslint-config-graphql][ec-gql-badge]][ec-gql-npm] | -| ESLint | [@lmc-eu/eslint-config-react](packages/eslint-config-react) | [![@lmc-eu/eslint-config-react][ec-react-badge]][ec-react-npm] | -| ESLint | [@lmc-eu/eslint-config-jest](packages/eslint-config-jest) | [![@lmc-eu/eslint-config-jest][ec-jest-badge]][ec-jest-npm] | -| ESLint | [@lmc-eu/eslint-config-typescript](packages/eslint-config-typescript) | [![@lmc-eu/eslint-config-typescript][ec-ts-badge]][ec-ts-npm] | -| Prettier | [@lmc-eu/prettier-config](packages/prettier-config) | [![@lmc-eu/prettier-config][pc-badge]][pc-npm] | -| Renovate | [@lmc-eu/renovate-config](packages/renovate-config) | [![@lmc-eu/renovate-config][rc-badge]][rc-npm] | -| Remark | [@almacareer/remark-config](packages/remark-config) | [![@almacareer/remark-config][rmc-badge]][rmc-npm] | -| Stylelint | [@almacareer/stylelint-config](packages/stylelint-config) | [![@almacareer/stylelint-config][slc-badge]][slc-npm] | -| Textlint | [@lmc-eu/textlint-rule-preset-lmc](packages/textlint-rule-preset-lmc) | [![@lmc-eu/textlint-rule-preset-lmc][tlc-badge]][tlc-npm] | +| Tool | Package | Version | +| ------------ | --------------------------------------------------------------------- | -------------------------------------------------------------- | +| Browserslist | [@lmc-eu/browserslist-config](packages/browserslist-config) | [![@lmc-eu/browserslist-config][blc-badge]][blc-npm] | +| Commitlint | [@lmc-eu/commitlint-config](packages/commitlint-config) | [![@lmc-eu/commitlint-config][clc-badge]][clc-npm] | +| ESLint | [@lmc-eu/eslint-config-base](packages/eslint-config-base) | [![@lmc-eu/eslint-config-base][ec-base-badge]][ec-base-npm] | +| ESLint | [@lmc-eu/eslint-config-graphql](packages/eslint-config-graphql) | [![@lmc-eu/eslint-config-graphql][ec-gql-badge]][ec-gql-npm] | +| ESLint | [@lmc-eu/eslint-config-react](packages/eslint-config-react) | [![@lmc-eu/eslint-config-react][ec-react-badge]][ec-react-npm] | +| ESLint | [@lmc-eu/eslint-config-jest](packages/eslint-config-jest) | [![@lmc-eu/eslint-config-jest][ec-jest-badge]][ec-jest-npm] | +| ESLint | [@lmc-eu/eslint-config-typescript](packages/eslint-config-typescript) | [![@lmc-eu/eslint-config-typescript][ec-ts-badge]][ec-ts-npm] | +| Prettier | [@lmc-eu/prettier-config](packages/prettier-config) | [![@lmc-eu/prettier-config][pc-badge]][pc-npm] | +| Renovate | [@lmc-eu/renovate-config](packages/renovate-config) | [![@lmc-eu/renovate-config][rc-badge]][rc-npm] | +| Remark | [@almacareer/remark-config](packages/remark-config) | [![@almacareer/remark-config][rmc-badge]][rmc-npm] | +| Stylelint | [@almacareer/stylelint-config](packages/stylelint-config) | [![@almacareer/stylelint-config][slc-badge]][slc-npm] | +| Textlint | [@lmc-eu/textlint-rule-preset-lmc](packages/textlint-rule-preset-lmc) | [![@lmc-eu/textlint-rule-preset-lmc][tlc-badge]][tlc-npm] | ## License @@ -34,10 +32,6 @@ We got a lot of inspiration from a similar project at [STRV][strv-github]. Thank [alma-home]: https://www.almacareer.com [blc-npm]: https://npmjs.org/package/%40lmc-eu/browserslist-config [blc-badge]: https://img.shields.io/npm/v/%40lmc-eu/browserslist-config.svg?style=flat-square -[cc-bb-npm]: https://npmjs.org/package/%40lmc-eu/conventional-changelog-lmc-bitbucket -[cc-bb-badge]: https://img.shields.io/npm/v/%40lmc-eu/conventional-changelog-lmc-bitbucket.svg?style=flat-square -[cc-gh-npm]: https://npmjs.org/package/%40lmc-eu/conventional-changelog-lmc-github -[cc-gh-badge]: https://img.shields.io/npm/v/%40lmc-eu/conventional-changelog-lmc-github.svg?style=flat-square [pc-npm]: https://www.npmjs.com/package/@lmc-eu/prettier-config [pc-badge]: https://img.shields.io/npm/v/%40lmc-eu/prettier-config.svg?style=flat-square [clc-npm]: https://www.npmjs.com/package/@lmc-eu/commitlint-config diff --git a/lerna.json b/lerna.json index 58f91c13..ded1209a 100644 --- a/lerna.json +++ b/lerna.json @@ -6,9 +6,10 @@ "version": { "allowBranch": ["release"], "conventionalCommits": true, - "changelogPreset": "./packages/conventional-changelog-lmc-github", + "changelogPreset": "conventional-changelog-conventionalcommits", + "createRelease": "github", "push": false, - "message": "Chore: Release [CI-SKIP]", + "message": "chore: release [CI-SKIP]", "ignoreChanges": ["test/**", "yarn.lock"] } } diff --git a/package.json b/package.json index 89c30b9e..916342da 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ }, "devDependencies": { "@commitlint/cli": "19.8.1", + "conventional-changelog-conventionalcommits": "^9.1.0", "eslint": "8.57.1", "eslint-config-prettier": "9.1.2", "eslint-import-resolver-node": "0.3.9", diff --git a/packages/commitlint-config/index.js b/packages/commitlint-config/index.js index 36d98ff0..2b96f7aa 100644 --- a/packages/commitlint-config/index.js +++ b/packages/commitlint-config/index.js @@ -1,34 +1,13 @@ -module.exports = { +import conventionalConfig from '@commitlint/config-conventional'; + +export default { extends: ['@commitlint/config-conventional'], - parserPreset: '@lmc-eu/conventional-changelog-lmc', ignores: [(commit) => commit.includes('[CI-SKIP]')], rules: { - 'type-case': [ - 1, - 'always', - // We are using `pascal-case` for every type but - // allowing `upper-case` only for use of `BREAKING CHANGE(S)` - // so this should not lead to define any other type in `upper-case` - ['pascal-case', 'upper-case'], - ], 'type-enum': [ 2, 'always', - [ - 'Feat', - 'Fix', - 'Docs', - 'Style', - 'Refactor', - 'Test', - 'Revert', - 'Perf', - 'Chore', - 'Deps', - 'BREAKING CHANGES', - 'BREAKING CHANGE', - ], + [...conventionalConfig.rules['type-enum'][2], 'deps', 'BREAKING CHANGES', 'BREAKING CHANGE'], ], - 'subject-case': [2, 'always', 'sentence-case'], }, }; diff --git a/packages/commitlint-config/package.json b/packages/commitlint-config/package.json index dda018c8..7114186f 100644 --- a/packages/commitlint-config/package.json +++ b/packages/commitlint-config/package.json @@ -1,28 +1,31 @@ { - "name": "@lmc-eu/commitlint-config", + "name": "@alma-oss/commitlint-config", "version": "2.0.3", - "description": "LMC's configuration for commitlint", + "description": "Alma's configuration for commitlint", "keywords": [ "commitlint", - "lmc", + "alma", "config" ], - "author": "Tomáš Litera ", - "license": "BSD-3-Clause", + "type": "module", + "author": "Tomáš Litera ", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/lmc-eu/code-quality-tools", "directory": "packages/commitlint-config" }, "main": "index.js", + "exports": { + ".": "./index.js" + }, "publishConfig": { "access": "public" }, "engines": { - "node": "^16 || ^18 || >=20" + "node": "^18 || >=20" }, "dependencies": { - "@commitlint/config-conventional": "^17.0.0", - "@lmc-eu/conventional-changelog-lmc": "^2.0.3" + "@commitlint/config-conventional": "^19.0.0" } } diff --git a/packages/conventional-changelog-lmc-bitbucket/CHANGELOG.md b/packages/conventional-changelog-lmc-bitbucket/CHANGELOG.md deleted file mode 100644 index 94ee33d7..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/CHANGELOG.md +++ /dev/null @@ -1,310 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - - - -## [3.0.3](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@3.0.2...@lmc-eu/conventional-changelog-lmc-bitbucket@3.0.3) (2024-08-07) - -### Styles - -- **repo:** Reformat markdown files base on remark-config ([7594cd7](https://github.com/lmc-eu/code-quality-tools/commit/7594cd7)), closes [#12](https://jira.int.lmc.cz/browse/12) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [3.0.2](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@3.0.1...@lmc-eu/conventional-changelog-lmc-bitbucket@3.0.2) (2024-06-18) - -### Dependencies - -- Update dependency conventional-changelog-core to v7 ([7f2287c](https://github.com/lmc-eu/code-quality-tools/commit/7f2287c)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [3.0.1](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@3.0.0...@lmc-eu/conventional-changelog-lmc-bitbucket@3.0.1) (2023-12-14) - -### Code Refactoring - -- **conventional-changelog:** Drop `q` from dependencies ([8df51e2](https://github.com/lmc-eu/code-quality-tools/commit/8df51e2)), closes [#135](https://jira.int.lmc.cz/browse/135) - -### Dependencies - -- Update all non-major dependencies ([85835d0](https://github.com/lmc-eu/code-quality-tools/commit/85835d0)) -- Update dependency conventional-changelog-core to v6 ([676d0bf](https://github.com/lmc-eu/code-quality-tools/commit/676d0bf)) -- Update dependency jest-extended to v4 ([d14a9fe](https://github.com/lmc-eu/code-quality-tools/commit/d14a9fe)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -# [3.0.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.3.2...@lmc-eu/conventional-changelog-lmc-bitbucket@3.0.0) (2023-10-06) - -### BREAKING CHANGES - -- **conventional-changelog:** Drop support for Node.js v14 ([d23674b](https://github.com/lmc-eu/code-quality-tools/commit/d23674b)), closes [#130](https://jira.int.lmc.cz/browse/130) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [2.3.2](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.3.1...@lmc-eu/conventional-changelog-lmc-bitbucket@2.3.2) (2023-10-06) - -### Dependencies - -- Update all non-major dependencies ([b625a8e](https://github.com/lmc-eu/code-quality-tools/commit/b625a8e)) -- Update all non-major dependencies ([d425fd9](https://github.com/lmc-eu/code-quality-tools/commit/d425fd9)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [2.3.1](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.3.0...@lmc-eu/conventional-changelog-lmc-bitbucket@2.3.1) (2023-01-16) - -### Dependencies - -- Update all non-major dependencies ([e3581b4](https://github.com/lmc-eu/code-quality-tools/commit/e3581b4)) -- Update all non-major dependencies ([f91dbaf](https://github.com/lmc-eu/code-quality-tools/commit/f91dbaf)) -- Update all non-major dependencies ([51d91a2](https://github.com/lmc-eu/code-quality-tools/commit/51d91a2)) -- Update all non-major dependencies ([0ba414f](https://github.com/lmc-eu/code-quality-tools/commit/0ba414f)) -- Update dependency jest to v29.3.1 ([c8fdb8a](https://github.com/lmc-eu/code-quality-tools/commit/c8fdb8a)) - -### Styles - -- **repo:** Rewrite documentation using Textlint ruleset ([22e19bd](https://github.com/lmc-eu/code-quality-tools/commit/22e19bd)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -# [2.3.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.2.0...@lmc-eu/conventional-changelog-lmc-bitbucket@2.3.0) (2022-11-03) - -### Dependencies - -- Update dependency jest to v29 ([f2b54a7](https://github.com/lmc-eu/code-quality-tools/commit/f2b54a7)) - -### Features - -- **conventional-changelog:** Allow `!` as breaking change indicator ([994e668](https://github.com/lmc-eu/code-quality-tools/commit/994e668)) - -### Tests - -- **conventional-changelog:** Fix extending of Jest tests ([f49fb6d](https://github.com/lmc-eu/code-quality-tools/commit/f49fb6d)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -# [2.2.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.1.0...@lmc-eu/conventional-changelog-lmc-bitbucket@2.2.0) (2022-10-03) - -### Bug Fixes - -- **conventional-changelog:** Output format of chnagelog main file ([49bea0a](https://github.com/lmc-eu/code-quality-tools/commit/49bea0a)) - -### Dependencies - -- Update all non-major dependencies ([85c6ce5](https://github.com/lmc-eu/code-quality-tools/commit/85c6ce5)) - -### Features - -- **conventional-changelog:** Introduce recommended bump options ([1347c5e](https://github.com/lmc-eu/code-quality-tools/commit/1347c5e)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [2.1.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.5...@lmc-eu/conventional-changelog-lmc-bitbucket@2.1.0) (2022-09-26) - -### BREAKING CHANGES - -- **conventional-changelog:** Introduce `conventional-changelog-lmc` ([43a17cf](https://github.com/lmc-eu/code-quality-tools/commit/43a17cf)) - -### Dependencies - -- Update all non-major dependencies ([06229f0](https://github.com/lmc-eu/code-quality-tools/commit/06229f0)) -- Update all non-major dependencies ([972a0da](https://github.com/lmc-eu/code-quality-tools/commit/972a0da)) -- Update dependency jest to v28 ([7f62139](https://github.com/lmc-eu/code-quality-tools/commit/7f62139)) -- Update dependency jest-extended to v3 ([c094516](https://github.com/lmc-eu/code-quality-tools/commit/c094516)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [2.0.5](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.4...@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.5) (2022-05-05) - -### Dependencies - -- Update dependency jest-extended to v2 ([898888f](https://github.com/lmc-eu/code-quality-tools/commit/898888f)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [2.0.4](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.3...@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.4) (2022-03-31) - -### Bug Fixes - -- **conventional-changelog:** Allow parsing `BREAKING CHANGES` as commit type (fixes [#52](https://jira.int.lmc.cz/browse/52), [#54](https://jira.int.lmc.cz/browse/54)) ([aaf0269](https://github.com/lmc-eu/code-quality-tools/commit/aaf0269)) - -### Dependencies - -- Update dependency jest to v27 ([939ff2b](https://github.com/lmc-eu/code-quality-tools/commit/939ff2b)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [2.0.3](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.2...@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.3) (2022-03-25) - -### Dependencies - -- Pin dependencies ([521e78c](https://github.com/lmc-eu/code-quality-tools/commit/521e78c)) -- Update all non-major dependencies ([51b245d](https://github.com/lmc-eu/code-quality-tools/commit/51b245d)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [2.0.2](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.1...@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.2) (2022-03-14) - -### Chores - -- **conventional-changelog:** Set max workers option for jest ([94890c8](https://github.com/lmc-eu/code-quality-tools/commit/94890c8)) - -### Tests - -- **conventional-changelog:** Use of eslint-config-jest for tests ([6dc7091](https://github.com/lmc-eu/code-quality-tools/commit/6dc7091)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [2.0.1](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.0...@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.1) (2022-03-08) - -Miscellaneous changes - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - -# Changelog - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines and [LMC GitHub preset](https://github.com/lmc-eu/code-quality-tools/tree/main/packages/conventional-changelog-lmc-github) for the list of supported change types. - - - -# [2.0.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.7...@lmc-eu/conventional-changelog-lmc-bitbucket@2.0.0) (2022-01-18) - -### BREAKING CHANGES - -- **conventional-changelog:** Switch from asterisk to hyphen #refs 48 ([c549e52](https://github.com/lmc-eu/code-quality-tools/commit/c549e52)) - - in unordered lists only - - for compatibility with prettier formatting - - also hyphen is is most used symbol for unordered lists - - @see: https://github.com/prettier/prettier/issues/4251 - -### Documetation - -- **conventional-changelog-lmc-bitbucket:** Include changelog ([d12bc0c](https://github.com/lmc-eu/code-quality-tools/commit/d12bc0c)) - - - -## [1.3.7](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.6...@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.7) (2021-12-17) - -### Chores - -- **conventional-changelog:** Ignore testing on CI server ([763df5e](https://github.com/lmc-eu/code-quality-tools/commit/763df5e)) - -- **conventional-changelog:** Make packages public ([332835d](https://github.com/lmc-eu/code-quality-tools/commit/332835d)) - - - -## [1.3.6](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.5...@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.6) (2021-12-16) - -**Note**: Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [1.3.5](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.4...@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.5) (2021-12-02) - -**Note**: Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [1.3.4](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.3...@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.4) (2021-11-25) - -**Note**: Version bump only for package @lmc-eu/conventional-changelog-lmc-bitbucket - - - -## [1.3.3](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.2...@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.3) (2021-11-12) - -### Chores - -- Properly declare paths to repositories in package.json ([a85199b](https://github.com/lmc-eu/code-quality-tools/commit/a85199b)) - - - -## [1.3.2](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.1...@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.2) (2021-11-02) - -### Documentation - -- Introduce lincense and add credit to strv for inspiration ([a2b5a9e](https://github.com/lmc-eu/code-quality-tools/commit/a2b5a9e)) - - - -## [1.3.1](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.0...@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.1) (2021-07-28) - -### Features - -- **browserslist-config:**: Introduce Browserslist config ([a7b5e1e](https://github.com/lmc-eu/code-quality-tools/commit/a7b5e1e)) - - - -# [1.3.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.2.0...@lmc-eu/conventional-changelog-lmc-bitbucket@1.3.0) (2021-01-18) - -### Features - -- Allow multiple refs in commit message ([bf970c8](https://github.com/lmc-eu/code-quality-tools/commit/bf970c8)) - - - -# [1.2.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.1.1...@lmc-eu/conventional-changelog-lmc-bitbucket@1.2.0) (2021-01-04) - -### Features - -- Remove port from host in conventional-changelog lmc preset ([50c6472](https://github.com/lmc-eu/code-quality-tools/commit/50c6472)) - - - -## [1.1.1](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.1.0...@lmc-eu/conventional-changelog-lmc-bitbucket@1.1.1) (2020-12-14) - -### Bug Fixes - -- Ignore pull request pattern in commit message ([bc245f6](https://github.com/lmc-eu/code-quality-tools/commit/bc245f6)) - - - -# [1.1.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-bitbucket@1.0.0...@lmc-eu/conventional-changelog-lmc-bitbucket@1.1.0) (2020-11-0č) - -### Chores - -- Set license to MIT for conventional-changelog-lmc-bitbucket package ([a88c98a](https://github.com/lmc-eu/code-quality-tools/commit/a88c98a)) - -### Documentation - -- Usage of @lmc-eu/conventional-changelog-lmc-bitbucket ([452c53e](https://github.com/lmc-eu/code-quality-tools/commit/452c53e)) - -### Tests - -- Add tests for conventional changelog preset ([d324228](https://github.com/lmc-eu/code-quality-tools/commit/d324228)) - - - -# 1.0.0 (2020-08-25) - -### Features - -- Add conventional-changelog-lmc-bitbucket package ([7bb57cc](https://github.com/lmc-eu/code-quality-tools/commit/7bb57cc)) diff --git a/packages/conventional-changelog-lmc-bitbucket/README.md b/packages/conventional-changelog-lmc-bitbucket/README.md deleted file mode 100644 index b499d6b7..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# @lmc-eu/conventional-changelog-lmc-bitbucket - -> LMC’s Conventional Changelog preset for BitBucket repositories - -## Usage - -### Installation - -NPM: - -```sh -npm i --dev @commitlint/cli @commitlint/config-conventional @lmc-eu/conventional-changelog-lmc-bitbucket -``` - -Yarn: - -```sh -yarn add --dev @commitlint/cli @commitlint/config-conventional @lmc-eu/conventional-changelog-lmc-bitbucket -``` - -### Configuration - -#### Linting - -Create a _commitlint.config.js_ file with the following contents: - -```javascript -'use strict'; - -module.exports = { - extends: ['@commitlint/config-conventional'], - parserPreset: '@lmc-eu/conventional-changelog-lmc-bitbucket', -}; -``` - -#### Changelog - -In a _package.json_ define following scripts: - -```json -{ - "scripts": { - "changelog": "conventional-changelog -p lmc-bitbucket -i CHANGELOG.md -s", - "changelog:origin": "conventional-changelog -p lmc-bitbucket -i CHANGELOG.md -s -r 0" - } -} -``` - -For example see [example changelog file][example-changelog] - -[example-changelog]: example-changelog.md diff --git a/packages/conventional-changelog-lmc-bitbucket/example-changelog.md b/packages/conventional-changelog-lmc-bitbucket/example-changelog.md deleted file mode 100644 index 88d937a3..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/example-changelog.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# [2.1.0](http://stash.int.lmc.cz/projects/CP/repos/capybara-snippet/compare/diff?targetBranch=refs%2Ftags%2Fv2.0.0&sourceBranch=refs%2Ftags%2Fv2.1.0) (2018-10-05) - -### Features - -- New info block html structure ([ee334bb](http://stash.int.lmc.cz/projects/CP/repos/capybara-snippet/commits/ee334bb)) - - - -# [2.0.0](http://stash.int.lmc.cz/projects/CP/repos/capybara-snippet/compare/diff?targetBranch=refs%2Ftags%2Fv1.2.5&sourceBranch=refs%2Ftags%2Fv2.0.0) (2018-10-05) - -### BREAKING CHANGES - -- New HTML structure and CSS for detail page ([f1390fb](http://stash.int.lmc.cz/projects/CP/repos/capybara-snippet/commits/f1390fb)) - - - -## [1.2.5](http://stash.int.lmc.cz/projects/CP/repos/capybara-snippet/compare/diff?targetBranch=refs%2Ftags%2Fv1.2.4&sourceBranch=refs%2Ftags%2Fv1.2.5) (2018-10-02) - -Miscellaneous changes: code refactoring, adding missing tests, changes to the build process or auxiliary tools and libraries such as documentation generation - - - -## [1.2.4](http://stash.int.lmc.cz/projects/CP/repos/capybara-snippet/compare/diff?targetBranch=refs%2Ftags%2Fv1.2.3&sourceBranch=refs%2Ftags%2Fv1.2.4) (2018-10-02) - -### Bug Fixes - -- Load GTM script using another library ([ec4211a](http://stash.int.lmc.cz/projects/CP/repos/capybara-snippet/commits/ec4211a)) diff --git a/packages/conventional-changelog-lmc-bitbucket/package.json b/packages/conventional-changelog-lmc-bitbucket/package.json deleted file mode 100644 index 6bdc6b2f..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "@lmc-eu/conventional-changelog-lmc-bitbucket", - "version": "3.0.3", - "description": "conventional-changelog LMC preset for BitBucket", - "keywords": [ - "lmc", - "bitbucket", - "changelog", - "conventional-changelog", - "preset" - ], - "repository": { - "type": "git", - "url": "https://github.com/lmc-eu/code-quality-tools", - "directory": "packages/conventional-changelog-lmc-bitbucket" - }, - "author": "Tomáš Litera ", - "license": "BSD-3-Clause", - "bugs": { - "url": "https://jira.int.lmc.cz/browse" - }, - "files": [ - "src" - ], - "main": "src/index.js", - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "is-ci || jest --maxWorkers=50%" - }, - "dependencies": { - "@lmc-eu/conventional-changelog-lmc": "^2.0.3" - }, - "devDependencies": { - "better-than-before": "1.0.0", - "conventional-changelog-core": "7.0.0", - "git-dummy-commit": "1.3.0", - "jest": "29.7.0", - "jest-extended": "4.0.2", - "shelljs": "0.10.0", - "through2": "4.0.2" - }, - "jest": { - "setupFilesAfterEnv": [ - "jest-extended/all" - ], - "testTimeout": 30000 - }, - "engines": { - "node": "^16 || ^18 || >=20" - } -} diff --git a/packages/conventional-changelog-lmc-bitbucket/src/conventional-changelog.js b/packages/conventional-changelog-lmc-bitbucket/src/conventional-changelog.js deleted file mode 100644 index eb08d419..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/src/conventional-changelog.js +++ /dev/null @@ -1,20 +0,0 @@ -const { readFile } = require('fs').promises; -const { resolve } = require('path'); -const { parserOpts, writerOpts } = require('@lmc-eu/conventional-changelog-lmc'); - -module.exports = Promise.all([ - readFile(resolve(__dirname, 'templates/template.hbs'), 'utf-8'), - readFile(resolve(__dirname, 'templates/header.hbs'), 'utf-8'), - readFile(resolve(__dirname, 'templates/commit.hbs'), 'utf-8'), - readFile(resolve(__dirname, 'templates/footer.hbs'), 'utf-8'), -]).then(([template, header, commit, footer]) => { - writerOpts.mainTemplate = template; - writerOpts.headerPartial = header; - writerOpts.commitPartial = commit; - writerOpts.footerPartial = footer; - - return { - parserOpts, - writerOpts, - }; -}); diff --git a/packages/conventional-changelog-lmc-bitbucket/src/index.js b/packages/conventional-changelog-lmc-bitbucket/src/index.js deleted file mode 100644 index 00a7532a..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/src/index.js +++ /dev/null @@ -1,14 +0,0 @@ -const conventionalChangelog = require(`./conventional-changelog`); -const { parserOpts, writerOpts, recommendedBumpOpts } = require('@lmc-eu/conventional-changelog-lmc'); - -module.exports = Promise.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]).then( - // Using same configuration as other configurations - // Did not find any documentation whether the output must be in this format - // eslint-disable-next-line no-shadow - ([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]) => ({ - conventionalChangelog, - parserOpts, - recommendedBumpOpts, - writerOpts, - }), -); diff --git a/packages/conventional-changelog-lmc-bitbucket/src/templates/commit.hbs b/packages/conventional-changelog-lmc-bitbucket/src/templates/commit.hbs deleted file mode 100644 index 5c52b8dc..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/src/templates/commit.hbs +++ /dev/null @@ -1,30 +0,0 @@ - --{{#if scope}} **{{scope}}:** -{{~/if}} {{#if subject}} - {{~subject}} -{{~else}} - {{~header}} -{{~/if}} - -{{~!-- commit link --}} {{#if @root.linkReferences~}} - ([{{hash}}]( - {{~#if @root.repository~}} - {{~#if @root.host}} - {{~@root.host}}/projects/ - {{~/if}} - {{~#if @root.owner~}} - {{~@root.owner}}/repos/ - {{~/if~}} - {{~@root.repository}}/ - {{~else}} - {{~@root.repoUrl}}/ - {{~/if~}} - commits/{{~hash}})) -{{~else}} - ({{~hash}}) -{{~/if}} - -{{~!-- commit references --}} -{{~#if references~}} - , closes {{references}} -{{~/if}} diff --git a/packages/conventional-changelog-lmc-bitbucket/src/templates/footer.hbs b/packages/conventional-changelog-lmc-bitbucket/src/templates/footer.hbs deleted file mode 100644 index 367bb138..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/src/templates/footer.hbs +++ /dev/null @@ -1,11 +0,0 @@ -{{#if noteGroups}} - {{#each noteGroups}} - - ### {{title}} - - {{#each notes}} - - {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}} - {{/each}} - {{/each}} - -{{/if}} diff --git a/packages/conventional-changelog-lmc-bitbucket/src/templates/header.hbs b/packages/conventional-changelog-lmc-bitbucket/src/templates/header.hbs deleted file mode 100644 index 5fcaeff9..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/src/templates/header.hbs +++ /dev/null @@ -1,27 +0,0 @@ - - -{{#if isPatch~}} - ## - {{~else~}} - # -{{~/if}} {{#if @root.linkCompare~}} - [{{version}}]( - {{~#if @root.repository~}} - {{~#if @root.host}} - {{~@root.host}}/projects/ - {{~/if}} - {{~#if @root.owner~}} - {{~@root.owner}}/repos/ - {{~/if~}} - {{~@root.repository}}/ - {{~else}} - {{~@root.repoUrl}}/ - {{~/if~}} - compare/diff?targetBranch=refs%2Ftags%2F{{previousTag}}&sourceBranch=refs%2Ftags%2F{{currentTag}}) -{{~else}} - {{~version}} -{{~/if}} -{{~#if title}} "{{title}}" -{{~/if}} -{{~#if date}} ({{date}}) -{{/if}} diff --git a/packages/conventional-changelog-lmc-bitbucket/src/templates/template.hbs b/packages/conventional-changelog-lmc-bitbucket/src/templates/template.hbs deleted file mode 100644 index 2e95e501..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/src/templates/template.hbs +++ /dev/null @@ -1,17 +0,0 @@ -{{> header}} - -{{#each commitGroups}} - - {{#if title}} -### {{title}} - {{/if}} - - {{#each commits}} -{{> commit root=@root}} - {{/each}} -{{/each}} -{{#unless commitGroups}} -Miscellaneous changes: code refactoring, adding missing tests, changes to the build process or auxiliary tools and libraries such as documentation generation -{{/unless}} - -{{> footer}} diff --git a/packages/conventional-changelog-lmc-bitbucket/tests/__fixtures/_unknown-host.json b/packages/conventional-changelog-lmc-bitbucket/tests/__fixtures/_unknown-host.json deleted file mode 100644 index a552f229..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/tests/__fixtures/_unknown-host.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "repository": "unknown", - "version": "v2.0.0" -} diff --git a/packages/conventional-changelog-lmc-bitbucket/tests/__fixtures/bitbucket-host.json b/packages/conventional-changelog-lmc-bitbucket/tests/__fixtures/bitbucket-host.json deleted file mode 100644 index dca820c8..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/tests/__fixtures/bitbucket-host.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": "v2.0.0", - "repository": { - "type": "git", - "url": "git+ssh://git@any.bbucket.host:7999/proj/repo-name.git" - } -} diff --git a/packages/conventional-changelog-lmc-bitbucket/tests/__fixtures/bitbucket-http-host.json b/packages/conventional-changelog-lmc-bitbucket/tests/__fixtures/bitbucket-http-host.json deleted file mode 100644 index ef029159..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/tests/__fixtures/bitbucket-http-host.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "version": "v2.0.0", - "repository": "https://bitbucket.example.com/projects/EX/repos/example-repo" -} diff --git a/packages/conventional-changelog-lmc-bitbucket/tests/index.test.js b/packages/conventional-changelog-lmc-bitbucket/tests/index.test.js deleted file mode 100644 index 61c8a982..00000000 --- a/packages/conventional-changelog-lmc-bitbucket/tests/index.test.js +++ /dev/null @@ -1,417 +0,0 @@ -// We are dealing with Streams here, not Promises -/* eslint-disable jest/no-done-callback */ -/* eslint-disable no-plusplus */ -/* eslint-disable no-undef */ -const conventionalChangelogCore = require('conventional-changelog-core'); -const gitDummyCommit = require('git-dummy-commit'); -const shell = require('shelljs'); -const through = require('through2'); -const betterThanBefore = require('better-than-before')(); -const path = require('path'); -const preset = require('..'); - -const { preparing } = betterThanBefore; - -betterThanBefore.setups([ - function () { - shell.config.silent = true; - shell.rm('-rf', 'tmp'); - shell.mkdir('tmp'); - shell.cd('tmp'); - shell.mkdir('git-templates'); - shell.exec('git init --template=./git-templates'); - - gitDummyCommit('Chore: first commit'); - gitDummyCommit('BREAKING CHANGE: Not so compatible change'); - gitDummyCommit('BREAKING CHANGES: Another big change that break things'); - gitDummyCommit(['Feat: amazing new module', 'BREAKING CHANGE: Not backward compatible.']); - gitDummyCommit(['Fix(compile): avoid a bug', 'BREAKING CHANGE: The Change is huge.']); - gitDummyCommit(['Perf(ngOptions): make it faster', ' closes #1, #2']); - gitDummyCommit('Revert(ngOptions): bad commit'); - gitDummyCommit('Fix(*): oops'); - }, - function () { - gitDummyCommit(['Feat(awesome): addresses the issue brought up in #133']); - gitDummyCommit(['Revert(ngOptions): bad commit', 'closes #24']); - }, - function () { - gitDummyCommit(['Feat(awesome): fix #88 #TR-55']); - }, - function () { - gitDummyCommit(['Feat(awesome): issue brought up by @bcoe! on Friday']); - }, - function () { - gitDummyCommit(['Docs(readme): make it clear', 'BREAKING CHANGE: The Change is huge.']); - gitDummyCommit(['Style(whitespace): make it easier to read', 'BREAKING CHANGE: The Change is huge.']); - gitDummyCommit(['Refactor(code): change a lot of code', 'BREAKING CHANGE: The Change is huge.']); - gitDummyCommit(['Test(*): more tests', 'BREAKING CHANGE: The Change is huge.']); - gitDummyCommit(['WIP: Just in the middle of something...']); - gitDummyCommit(['Chore(deps): bump', 'BREAKING CHANGE: The Change is huge.']); - }, - function () { - gitDummyCommit(['Feat(deps): bump', 'BREAKING CHANGE Also works :)']); - }, - function () { - shell.exec('git tag v1.0.0'); - gitDummyCommit('Feat: some more features'); - }, - function () { - gitDummyCommit(['Feat(foo): add thing', 'closes #1223 #OBG-23']); - }, - function () { - gitDummyCommit(['Revert: \\"Feat: bad feature\\"', 'This reverts commit 12345.'], false); - gitDummyCommit(['Revert: Feat: custom revert format', 'This reverts commit 5678.']); - }, - function () { - gitDummyCommit([ - 'Pull request #550: Deps: Update dependency eslint-config-prettier to v7', - 'FP-1174 FP-1135 Chore: Add comments to shell scripts', - 'Merge in FP/fp-admin from dependencies/major-eslint to master', - ]); - }, -]); - -describe('lmc bitbucket preset', () => { - it('should work if there is no semver tag', (done) => { - preparing(1); - - conventionalChangelogCore({ - config: preset, - pkg: { - path: path.join(__dirname, '/__fixtures/bitbucket-host.json'), - }, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - stringifiedChunk = chunk.toString(); - - expect(stringifiedChunk).toInclude('amazing new module'); - expect(stringifiedChunk).toInclude('**compile:** avoid a bug'); - expect(stringifiedChunk).toInclude('make it faster'); - expect(stringifiedChunk).toInclude(', closes #1, #2'); // Links are not created - expect(stringifiedChunk).toInclude('Not backward compatible.'); - expect(stringifiedChunk).toInclude('**compile:** The Change is huge.'); - expect(stringifiedChunk).toInclude('Features'); - expect(stringifiedChunk).toInclude('Bug Fixes'); - expect(stringifiedChunk).toInclude('Performance Improvements'); - expect(stringifiedChunk).toInclude('Reverts'); - expect(stringifiedChunk).toInclude('bad commit'); - expect(stringifiedChunk).toInclude('BREAKING CHANGE'); - expect(stringifiedChunk).toInclude('Not so compatible change'); - expect(stringifiedChunk).toInclude('Another big change that break things'); - - // expect(stringifiedChunk).not.toInclude('first commit'); - expect(stringifiedChunk).not.toInclude('feat'); - expect(stringifiedChunk).not.toInclude('fix'); - expect(stringifiedChunk).not.toInclude('perf'); - expect(stringifiedChunk).not.toInclude('revert'); - expect(stringifiedChunk).not.toInclude('***:**'); - expect(stringifiedChunk).not.toInclude(': Not backward compatible.'); - expect(stringifiedChunk).not.toInclude('Pull request'); - - expect(stringifiedChunk).toEqual( - expect.stringMatching( - /oops \(\[[0-9a-z]{7}\]\(http:\/\/any.bbucket.host\/projects\/proj\/repos\/repo-name\/commits\/[0-9a-z]{7}\)\)/, - ), - ); // commit hash is linked - - done(); - }), - ); - }); - - it('should generate issue links if package.json has a bugs URL', (done) => { - preparing(2); - - conventionalChangelogCore({ - config: preset, - // Default package data (this repo!) - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - stringifiedChunk = chunk.toString(); - expect(stringifiedChunk).toInclude('in [#133](https://jira.int.lmc.cz/browse/133)'); - done(); - }), - ); - }); - - it('should not generate issue links when package.json does NOT have a bugs URL', (done) => { - preparing(3); - - conventionalChangelogCore( - { - config: preset, - pkg: { - path: path.join(__dirname, '/fixtures/bitbucket-host.json'), - }, - }, - { - packageData: {}, // Empty package data - }, - ) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - stringifiedChunk = chunk.toString(); - expect(stringifiedChunk).toInclude('in #133'); - done(); - }), - ); - }); - - it('should not generate issue refs in-the-footer when the issue(s) appear in the subject line (the issues remain in the subject line)', (done) => { - preparing(3); - - conventionalChangelogCore({ - config: preset, - // Default package data (this repo!) - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - stringifiedChunk = chunk.toString(); - expect(stringifiedChunk).toInclude('**awesome:** fix [#88]('); - expect(stringifiedChunk).toInclude('88) [#TR-55]('); - expect(stringifiedChunk).not.toInclude('closes [#88]('); - done(); - }), - ); - }); - - it('should not replace @username with GitHub user URL as feature is not available on BitBucket', (done) => { - preparing(4); - - conventionalChangelogCore({ - config: preset, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - stringifiedChunk = chunk.toString(); - expect(stringifiedChunk).toInclude('issue brought up by @bcoe! on Friday'); - done(); - }), - ); - }); - - it('should not discard commit if there is BREAKING CHANGE', (done) => { - preparing(5); - - conventionalChangelogCore({ - config: preset, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - stringifiedChunk = chunk.toString(); - - expect(stringifiedChunk).toInclude('Documentation'); - expect(stringifiedChunk).toInclude('Styles'); - expect(stringifiedChunk).toInclude('Code Refactoring'); - expect(stringifiedChunk).toInclude('Tests'); - expect(stringifiedChunk).toInclude('Chores'); - - done(); - }), - ); - }); - - it('should render BREAKING CHANGES the same as BREAKING CHANGE', (done) => { - preparing(6); - - conventionalChangelogCore({ - config: preset, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - stringifiedChunk = chunk.toString(); - - expect(stringifiedChunk).toInclude('BREAKING CHANGE'); - expect(stringifiedChunk).toInclude('Also works :)'); - - done(); - }), - ); - }); - - it('should work if there is a semver tag', (done) => { - preparing(7); - let i = 0; - - conventionalChangelogCore({ - config: preset, - outputUnreleased: true, - pkg: { - path: path.join(__dirname, '/__fixtures/bitbucket-host.json'), - }, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through( - (chunk, enc, cb) => { - stringifiedChunk = chunk.toString(); - - expect(stringifiedChunk).toInclude('some more features'); - expect(stringifiedChunk).not.toInclude('BREAKING'); - - expect(stringifiedChunk).toInclude( - 'http://any.bbucket.host/projects/proj/repos/repo-name/compare/diff?targetBranch' + - '=refs%2Ftags%2Fv1.0.0&sourceBranch=refs%2Ftags%2Fv2.0.0', - ); - - i++; - cb(); - }, - () => { - expect(i).toBe(1); - done(); - }, - ), - ); - }); - - it('should work with unknown host', (done) => { - preparing(7); - let i = 0; - - conventionalChangelogCore({ - config: preset, - pkg: { - path: path.join(__dirname, '/__fixtures/_unknown-host.json'), - }, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through( - (chunk, enc, cb) => { - stringifiedChunk = chunk.toString(); - - expect(stringifiedChunk).toInclude('(http://unknown/compare'); - expect(stringifiedChunk).toMatch(/some more features \(.*\)/); // No commit hash! - - i++; - cb(); - }, - () => { - expect(i).toBe(1); - done(); - }, - ), - ); - }); - - it('should always output the repo URL using http/https even when the repo URL in package.json is some other protocol', (done) => { - preparing(8); - let i = 0; - - conventionalChangelogCore({ - config: preset, - pkg: { - path: path.join(__dirname, '/__fixtures/bitbucket-http-host.json'), - }, - }) - .on('error', done) - .pipe( - through( - (chunk, enc, cb) => { - stringifiedChunk = chunk.toString(); - - expect(stringifiedChunk).toInclude('https://bitbucket.example.com/projects/EX/repos/example-repo/compare/'); - expect(stringifiedChunk).toInclude('https://bitbucket.example.com/projects/EX/repos/example-repo/commits/'); - expect(stringifiedChunk).toMatch(/some more features \(.*\)/); - - i++; - cb(); - }, - () => { - expect(i).toBe(1); - done(); - }, - ), - ); - }); - - it('should render multiple issues that are in the footer without links when package.json does NOT have a bugs URL', (done) => { - preparing(9); - - conventionalChangelogCore({ - config: preset, - pkg: { - path: path.join(__dirname, '/__fixtures/bitbucket-host.json'), - }, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - stringifiedChunk = chunk.toString(); - expect(stringifiedChunk).toInclude('closes #1223, #OBG-23'); - done(); - }), - ); - }); - - it('should render multiple issues that are in the footer as links when package.json has a bugs URL', (done) => { - preparing(9); - - conventionalChangelogCore({ - config: preset, - // Default package data (this repo!) - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - stringifiedChunk = chunk.toString(); - - expect(stringifiedChunk).toInclude('closes [#1223]('); - expect(stringifiedChunk).toInclude('1223), [#OBG-23]'); - done(); - }), - ); - }); - - it('should render revert commit using standard Git revert message convention', (done) => { - preparing(10); - - conventionalChangelogCore({ - config: preset, - // Default package data (this repo!) - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - stringifiedChunk = chunk.toString(); - expect(stringifiedChunk).toInclude('Feat: bad feature'); - expect(stringifiedChunk).toInclude('Feat: custom revert format'); - done(); - }), - ); - }); -}); diff --git a/packages/conventional-changelog-lmc-github/CHANGELOG.md b/packages/conventional-changelog-lmc-github/CHANGELOG.md deleted file mode 100644 index 5c389bbb..00000000 --- a/packages/conventional-changelog-lmc-github/CHANGELOG.md +++ /dev/null @@ -1,235 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - - - -## [3.0.3](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@3.0.2...@lmc-eu/conventional-changelog-lmc-github@3.0.3) (2024-08-07) - -### Styles - -- **repo:** Reformat markdown files base on remark-config ([7594cd7](https://github.com/lmc-eu/code-quality-tools/commit/7594cd7)), closes [#12](https://github.com/lmc-eu/issues/12) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -## [3.0.2](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@3.0.1...@lmc-eu/conventional-changelog-lmc-github@3.0.2) (2024-06-18) - -### Dependencies - -- Update dependency conventional-changelog-core to v7 ([7f2287c](https://github.com/lmc-eu/code-quality-tools/commit/7f2287c)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -## [3.0.1](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@3.0.0...@lmc-eu/conventional-changelog-lmc-github@3.0.1) (2023-12-14) - -### Code Refactoring - -- **conventional-changelog:** Drop `q` from dependencies ([8df51e2](https://github.com/lmc-eu/code-quality-tools/commit/8df51e2)), closes [#135](https://github.com/lmc-eu/issues/135) - -### Dependencies - -- Update all non-major dependencies ([85835d0](https://github.com/lmc-eu/code-quality-tools/commit/85835d0)) -- Update dependency conventional-changelog-core to v6 ([676d0bf](https://github.com/lmc-eu/code-quality-tools/commit/676d0bf)) -- Update dependency jest-extended to v4 ([d14a9fe](https://github.com/lmc-eu/code-quality-tools/commit/d14a9fe)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -# [3.0.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.3.2...@lmc-eu/conventional-changelog-lmc-github@3.0.0) (2023-10-06) - -### BREAKING CHANGES - -- **conventional-changelog:** Drop support for Node.js v14 ([94f7805](https://github.com/lmc-eu/code-quality-tools/commit/94f7805)), closes [#130](https://github.com/lmc-eu/issues/130) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -## [2.3.2](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.3.1...@lmc-eu/conventional-changelog-lmc-github@2.3.2) (2023-10-06) - -### Dependencies - -- Update all non-major dependencies ([b625a8e](https://github.com/lmc-eu/code-quality-tools/commit/b625a8e)) -- Update all non-major dependencies ([d425fd9](https://github.com/lmc-eu/code-quality-tools/commit/d425fd9)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -## [2.3.1](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.3.0...@lmc-eu/conventional-changelog-lmc-github@2.3.1) (2023-01-16) - -### Dependencies - -- Update all non-major dependencies ([e3581b4](https://github.com/lmc-eu/code-quality-tools/commit/e3581b4)) -- Update all non-major dependencies ([f91dbaf](https://github.com/lmc-eu/code-quality-tools/commit/f91dbaf)) -- Update all non-major dependencies ([51d91a2](https://github.com/lmc-eu/code-quality-tools/commit/51d91a2)) -- Update all non-major dependencies ([0ba414f](https://github.com/lmc-eu/code-quality-tools/commit/0ba414f)) -- Update dependency jest to v29.3.1 ([c8fdb8a](https://github.com/lmc-eu/code-quality-tools/commit/c8fdb8a)) - -### Styles - -- **repo:** Rewrite documentation using Textlint ruleset ([22e19bd](https://github.com/lmc-eu/code-quality-tools/commit/22e19bd)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -# [2.3.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.2.0...@lmc-eu/conventional-changelog-lmc-github@2.3.0) (2022-11-03) - -### Dependencies - -- Update dependency jest to v29 ([f2b54a7](https://github.com/lmc-eu/code-quality-tools/commit/f2b54a7)) - -### Features - -- **conventional-changelog:** Allow `!` as breaking change indicator ([994e668](https://github.com/lmc-eu/code-quality-tools/commit/994e668)) - -### Tests - -- **conventional-changelog:** Fix extending of Jest tests ([f49fb6d](https://github.com/lmc-eu/code-quality-tools/commit/f49fb6d)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -# [2.2.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.1.0...@lmc-eu/conventional-changelog-lmc-github@2.2.0) (2022-10-03) - -### Bug Fixes - -- **conventional-changelog:** Output format of chnagelog main file ([49bea0a](https://github.com/lmc-eu/code-quality-tools/commit/49bea0a)) - -### Dependencies - -- Update all non-major dependencies ([85c6ce5](https://github.com/lmc-eu/code-quality-tools/commit/85c6ce5)) - -### Features - -- **conventional-changelog:** Introduce recommended bump options ([1347c5e](https://github.com/lmc-eu/code-quality-tools/commit/1347c5e)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -## [2.1.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.0.5...@lmc-eu/conventional-changelog-lmc-github@2.1.0) (2022-09-26) - -### BREAKING CHANGES - -- **conventional-changelog:** Introduce `conventional-changelog-lmc` ([43a17cf](https://github.com/lmc-eu/code-quality-tools/commit/43a17cf)) - -### Dependencies - -- Update all non-major dependencies ([06229f0](https://github.com/lmc-eu/code-quality-tools/commit/06229f0)) -- Update all non-major dependencies ([972a0da](https://github.com/lmc-eu/code-quality-tools/commit/972a0da)) -- Update dependency jest to v28 ([7f62139](https://github.com/lmc-eu/code-quality-tools/commit/7f62139)) -- Update dependency jest-extended to v3 ([c094516](https://github.com/lmc-eu/code-quality-tools/commit/c094516)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -## [2.0.5](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.0.4...@lmc-eu/conventional-changelog-lmc-github@2.0.5) (2022-05-05) - -### Dependencies - -- Update dependency jest-extended to v2 ([898888f](https://github.com/lmc-eu/code-quality-tools/commit/898888f)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -## [2.0.4](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.0.3...@lmc-eu/conventional-changelog-lmc-github@2.0.4) (2022-03-31) - -### Bug Fixes - -- **conventional-changelog:** Allow parsing `BREAKING CHANGES` as commit type (fixes [#52](https://github.com/lmc-eu/issues/52), [#54](https://github.com/lmc-eu/issues/54)) ([aaf0269](https://github.com/lmc-eu/code-quality-tools/commit/aaf0269)) - -### Dependencies - -- Update dependency jest to v27 ([939ff2b](https://github.com/lmc-eu/code-quality-tools/commit/939ff2b)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -## [2.0.3](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.0.2...@lmc-eu/conventional-changelog-lmc-github@2.0.3) (2022-03-25) - -### Dependencies - -- Pin dependencies ([521e78c](https://github.com/lmc-eu/code-quality-tools/commit/521e78c)) -- Update all non-major dependencies ([51b245d](https://github.com/lmc-eu/code-quality-tools/commit/51b245d)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -## [2.0.2](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.0.1...@lmc-eu/conventional-changelog-lmc-github@2.0.2) (2022-03-14) - -### Chores - -- **conventional-changelog:** Set max workers option for jest ([94890c8](https://github.com/lmc-eu/code-quality-tools/commit/94890c8)) - -### Tests - -- **conventional-changelog:** Use of eslint-config-jest for tests ([6dc7091](https://github.com/lmc-eu/code-quality-tools/commit/6dc7091)) - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - - - -## [2.0.1](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@2.0.0...@lmc-eu/conventional-changelog-lmc-github@2.0.1) (2022-03-08) - -Miscellaneous changes - -**Note:** Version bump only for package @lmc-eu/conventional-changelog-lmc-github - -# Changelog - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines and [LMC GitHub preset](https://github.com/lmc-eu/code-quality-tools/tree/main/packages/conventional-changelog-lmc-github) for the list of supported change types. - - - -# [2.0.0](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@1.3.7...@lmc-eu/conventional-changelog-lmc-github@2.0.0) (2022-01-18) - -### BREAKING CHANGES - -- **conventional-changelog:** Switch from asterisk to hyphen #refs 48 ([c549e52](https://github.com/lmc-eu/code-quality-tools/commit/c549e52)) - - in unordered lists only - - for compatibility with prettier formatting - - also hyphen is is most used symbol for unordered lists - - @see: https://github.com/prettier/prettier/issues/4251 - -### Documetation - -- **conventional-changelog-lmc-github:** Include changelog ([3d60e67](https://github.com/lmc-eu/code-quality-tools/commit/3d60e67)) - - - -## [1.0.1](https://github.com/lmc-eu/code-quality-tools/compare/@lmc-eu/conventional-changelog-lmc-github@1.0.0...@lmc-eu/conventional-changelog-lmc-github@1.0.1) (2021-12-17) - -### Bug Fixes - -- **conventional-changelog:** Github commit url and spaces between blocks ([084f529](https://github.com/lmc-eu/code-quality-tools/commit/084f529)) - -### Chores - -- **conventional-changelog:** Ignore testing on CI server ([763df5e](https://github.com/lmc-eu/code-quality-tools/commit/763df5e)) -- **conventional-changelog:** Make packages public ([332835d](https://github.com/lmc-eu/code-quality-tools/commit/332835d)) - - - -# 1.0.0 (2021-12-16) - -### Documentation - -- **conventional-changelog:** Introduce github changelog preset in README ([7a3d78a](https://github.com/lmc-eu/code-quality-tools/commit/7a3d78a)) - -### Features - -- **conventional-changelog:** Introduce GitHub conventional changelog ([d54d838](https://github.com/lmc-eu/code-quality-tools/commit/d54d838)) diff --git a/packages/conventional-changelog-lmc-github/README.md b/packages/conventional-changelog-lmc-github/README.md deleted file mode 100644 index 50ab2d11..00000000 --- a/packages/conventional-changelog-lmc-github/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# @lmc-eu/conventional-changelog-lmc-github - -> LMC’s Conventional Changelog preset for GitHub repositories - -## Usage - -### Installation - -NPM: - -```sh -npm i --dev @commitlint/cli @commitlint/config-conventional @lmc-eu/conventional-changelog-lmc-github -``` - -Yarn: - -```sh -yarn add --dev @commitlint/cli @commitlint/config-conventional @lmc-eu/conventional-changelog-lmc-github -``` - -### Configuration - -#### Linting - -Create a _commitlint.config.js_ file with the following contents: - -```javascript -'use strict'; - -module.exports = { - extends: ['@commitlint/config-conventional'], - parserPreset: '@lmc-eu/conventional-changelog-lmc-github', -}; -``` - -#### Changelog - -In a _package.json_ define following scripts: - -```json -{ - "scripts": { - "changelog": "conventional-changelog -p lmc-github -i CHANGELOG.md -s", - "changelog:origin": "conventional-changelog -p lmc-github -i CHANGELOG.md -s -r 0" - } -} -``` - -For example see [example changelog file][example-changelog] - -[example-changelog]: example-changelog.md diff --git a/packages/conventional-changelog-lmc-github/example-changelog.md b/packages/conventional-changelog-lmc-github/example-changelog.md deleted file mode 100644 index 7e36a04d..00000000 --- a/packages/conventional-changelog-lmc-github/example-changelog.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# [2.1.0](https://github.com/projects/lmc-eu/code-quality-tools/compare/v2.0.0...v2.1.0) (2018-10-05) - -### Features - -- New info block html structure ([ee334bb](https://github.com/lmc-eu/code-quality-tools/commit/ee334bb)) - - - -# [2.0.0](https://github.com/projects/lmc-eu/code-quality-tools/compare/v1.2.5...v2.0.0) (2018-10-05) - -### BREAKING CHANGES - -- New HTML structure and CSS for detail page ([f1390fb](https://github.com/lmc-eu/code-quality-tools/commit/f1390fb)) - - - -## [1.2.5](https://github.com/projects/lmc-eu/code-quality-tools/compare/v1.2.4...v1.2.5) (2018-10-02) - -Miscellaneous changes: code refactoring, adding missing tests, changes to the build process or auxiliary tools and libraries such as documentation generation - - - -## [1.2.4](https://github.com/projects/lmc-eu/code-quality-tools/compare/v1.2.3...v1.2.4) (2018-10-02) - -### Bug Fixes - -- Load GTM script using another library ([ec4211a](https://github.com/lmc-eu/code-quality-tools/commit/ec4211a)) diff --git a/packages/conventional-changelog-lmc-github/package.json b/packages/conventional-changelog-lmc-github/package.json deleted file mode 100644 index 48fb321d..00000000 --- a/packages/conventional-changelog-lmc-github/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "@lmc-eu/conventional-changelog-lmc-github", - "version": "3.0.3", - "description": "conventional-changelog LMC preset for GitHub", - "keywords": [ - "lmc", - "github", - "changelog", - "conventional-changelog", - "preset" - ], - "repository": { - "type": "git", - "url": "https://github.com/lmc-eu/code-quality-tools", - "directory": "packages/conventional-changelog-lmc-github" - }, - "author": "Tomáš Litera ", - "license": "BSD-3-Clause", - "bugs": { - "url": "https://github.com/lmc-eu/issues" - }, - "files": [ - "src" - ], - "main": "src/index.js", - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "is-ci || jest --maxWorkers=50%" - }, - "dependencies": { - "@lmc-eu/conventional-changelog-lmc": "^2.0.3" - }, - "devDependencies": { - "better-than-before": "1.0.0", - "conventional-changelog-core": "7.0.0", - "git-dummy-commit": "1.3.0", - "jest": "29.7.0", - "jest-extended": "4.0.2", - "shelljs": "0.10.0", - "through2": "4.0.2" - }, - "jest": { - "setupFilesAfterEnv": [ - "jest-extended/all" - ], - "testTimeout": 30000 - }, - "engines": { - "node": "^16 || ^18 || >=20" - } -} diff --git a/packages/conventional-changelog-lmc-github/src/conventional-changelog.js b/packages/conventional-changelog-lmc-github/src/conventional-changelog.js deleted file mode 100644 index eb08d419..00000000 --- a/packages/conventional-changelog-lmc-github/src/conventional-changelog.js +++ /dev/null @@ -1,20 +0,0 @@ -const { readFile } = require('fs').promises; -const { resolve } = require('path'); -const { parserOpts, writerOpts } = require('@lmc-eu/conventional-changelog-lmc'); - -module.exports = Promise.all([ - readFile(resolve(__dirname, 'templates/template.hbs'), 'utf-8'), - readFile(resolve(__dirname, 'templates/header.hbs'), 'utf-8'), - readFile(resolve(__dirname, 'templates/commit.hbs'), 'utf-8'), - readFile(resolve(__dirname, 'templates/footer.hbs'), 'utf-8'), -]).then(([template, header, commit, footer]) => { - writerOpts.mainTemplate = template; - writerOpts.headerPartial = header; - writerOpts.commitPartial = commit; - writerOpts.footerPartial = footer; - - return { - parserOpts, - writerOpts, - }; -}); diff --git a/packages/conventional-changelog-lmc-github/src/index.js b/packages/conventional-changelog-lmc-github/src/index.js deleted file mode 100644 index 00a7532a..00000000 --- a/packages/conventional-changelog-lmc-github/src/index.js +++ /dev/null @@ -1,14 +0,0 @@ -const conventionalChangelog = require(`./conventional-changelog`); -const { parserOpts, writerOpts, recommendedBumpOpts } = require('@lmc-eu/conventional-changelog-lmc'); - -module.exports = Promise.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]).then( - // Using same configuration as other configurations - // Did not find any documentation whether the output must be in this format - // eslint-disable-next-line no-shadow - ([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]) => ({ - conventionalChangelog, - parserOpts, - recommendedBumpOpts, - writerOpts, - }), -); diff --git a/packages/conventional-changelog-lmc-github/src/templates/commit.hbs b/packages/conventional-changelog-lmc-github/src/templates/commit.hbs deleted file mode 100644 index feada744..00000000 --- a/packages/conventional-changelog-lmc-github/src/templates/commit.hbs +++ /dev/null @@ -1,29 +0,0 @@ --{{#if scope}} **{{scope}}:** -{{~/if}} {{#if subject}} - {{~subject}} -{{~else}} - {{~header}} -{{~/if}} - -{{~!-- commit link --}} {{#if @root.linkReferences~}} - ([{{hash}}]( - {{~#if @root.repository~}} - {{~#if @root.host}} - {{~@root.host}}/ - {{~/if}} - {{~#if @root.owner~}} - {{~@root.owner}}/ - {{~/if~}} - {{~@root.repository}}/ - {{~else}} - {{~@root.repoUrl}}/ - {{~/if~}} - commit/{{~hash}})) -{{~else}} -({{~hash}}) -{{~/if}} - -{{~!-- commit references --}} -{{~#if references~}} - , closes {{references}} -{{~/if}} diff --git a/packages/conventional-changelog-lmc-github/src/templates/footer.hbs b/packages/conventional-changelog-lmc-github/src/templates/footer.hbs deleted file mode 100644 index 367bb138..00000000 --- a/packages/conventional-changelog-lmc-github/src/templates/footer.hbs +++ /dev/null @@ -1,11 +0,0 @@ -{{#if noteGroups}} - {{#each noteGroups}} - - ### {{title}} - - {{#each notes}} - - {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}} - {{/each}} - {{/each}} - -{{/if}} diff --git a/packages/conventional-changelog-lmc-github/src/templates/header.hbs b/packages/conventional-changelog-lmc-github/src/templates/header.hbs deleted file mode 100644 index 490588a5..00000000 --- a/packages/conventional-changelog-lmc-github/src/templates/header.hbs +++ /dev/null @@ -1,26 +0,0 @@ - -{{#if isPatch~}} - ## - {{~else~}} - # -{{~/if}} {{#if @root.linkCompare~}} - [{{version}}]( - {{~#if @root.repository~}} - {{~#if @root.host}} - {{~@root.host}}/ - {{~/if}} - {{~#if @root.owner~}} - {{~@root.owner}}/ - {{~/if~}} - {{~@root.repository}}/ - {{~else}} - {{~@root.repoUrl}}/ - {{~/if~}} - compare/{{previousTag}}...{{currentTag}}) -{{~else}} - {{~version}} -{{~/if}} -{{~#if title}} "{{title}}" -{{~/if}} -{{~#if date}} ({{date}}) -{{/if}} diff --git a/packages/conventional-changelog-lmc-github/src/templates/template.hbs b/packages/conventional-changelog-lmc-github/src/templates/template.hbs deleted file mode 100644 index 1f6ec0f2..00000000 --- a/packages/conventional-changelog-lmc-github/src/templates/template.hbs +++ /dev/null @@ -1,18 +0,0 @@ -{{> header}} -{{#each commitGroups}} - - {{#if title}} -### {{title}} - {{/if}} - {{#each commits}} - -{{> commit root=@root}} - {{/each}} - -{{/each}} - -{{#unless commitGroups}} -Miscellaneous changes -{{/unless}} - -{{> footer}} diff --git a/packages/conventional-changelog-lmc-github/tests/__fixtures/_unknown-host.json b/packages/conventional-changelog-lmc-github/tests/__fixtures/_unknown-host.json deleted file mode 100644 index a552f229..00000000 --- a/packages/conventional-changelog-lmc-github/tests/__fixtures/_unknown-host.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "repository": "unknown", - "version": "v2.0.0" -} diff --git a/packages/conventional-changelog-lmc-github/tests/__fixtures/github-host.json b/packages/conventional-changelog-lmc-github/tests/__fixtures/github-host.json deleted file mode 100644 index ef85d959..00000000 --- a/packages/conventional-changelog-lmc-github/tests/__fixtures/github-host.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": "v2.0.0", - "repository": { - "type": "git", - "url": "https://github.internal.example.com/owner/repo-name.git" - } -} diff --git a/packages/conventional-changelog-lmc-github/tests/__fixtures/github-http-host.json b/packages/conventional-changelog-lmc-github/tests/__fixtures/github-http-host.json deleted file mode 100644 index 65d7ff9c..00000000 --- a/packages/conventional-changelog-lmc-github/tests/__fixtures/github-http-host.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "version": "v2.0.0", - "repository": "https://github.internal.example.com/owner/repo-name" -} diff --git a/packages/conventional-changelog-lmc-github/tests/index.test.js b/packages/conventional-changelog-lmc-github/tests/index.test.js deleted file mode 100644 index 783ab8b1..00000000 --- a/packages/conventional-changelog-lmc-github/tests/index.test.js +++ /dev/null @@ -1,458 +0,0 @@ -// We are dealing with Streams here, not Promises -/* eslint-disable jest/no-done-callback */ -/* eslint-disable no-plusplus */ - -/* eslint-disable no-param-reassign */ -const conventionalChangelogCore = require('conventional-changelog-core'); -const gitDummyCommit = require('git-dummy-commit'); -const shell = require('shelljs'); -const through = require('through2'); -const betterThanBefore = require('better-than-before')(); -const path = require('path'); -const preset = require('..'); - -const { preparing } = betterThanBefore; - -betterThanBefore.setups([ - function () { - shell.config.silent = true; - shell.rm('-rf', 'tmp'); - shell.mkdir('tmp'); - shell.cd('tmp'); - shell.mkdir('git-templates'); - shell.exec('git init --template=./git-templates'); - - gitDummyCommit('Chore: first commit'); - gitDummyCommit(['Feat!: first build setup', 'BREAKING CHANGE: New build system.']); - gitDummyCommit('BREAKING CHANGE: Not so compatible change'); - gitDummyCommit('BREAKING CHANGES: Another big change that break things'); - gitDummyCommit(['Feat: amazing new module', 'BREAKING CHANGE: Not backward compatible.']); - gitDummyCommit(['Fix(compile): avoid a bug', 'BREAKING CHANGE: The Change is huge.']); - gitDummyCommit(['Perf(ngOptions): make it faster', ' closes #1, #2']); - gitDummyCommit('Revert(ngOptions): bad commit'); - gitDummyCommit('Fix(*): oops'); - }, - function () { - gitDummyCommit(['Feat(awesome): addresses the issue brought up in #133']); - gitDummyCommit(['Revert(ngOptions): bad commit', 'closes #24']); - }, - function () { - gitDummyCommit(['Feat(awesome): fix #88 #TR-55']); - }, - function () { - gitDummyCommit(['Feat(awesome): issue brought up by @bcoe! on Friday']); - }, - function () { - gitDummyCommit(['Docs(readme): make it clear', 'BREAKING CHANGE: The Change is huge.']); - gitDummyCommit(['Style(whitespace): make it easier to read', 'BREAKING CHANGE: The Change is huge.']); - gitDummyCommit(['Refactor(code): change a lot of code', 'BREAKING CHANGE: The Change is huge.']); - gitDummyCommit(['Test(*): more tests', 'BREAKING CHANGE: The Change is huge.']); - gitDummyCommit(['WIP: Just in the middle of something...']); - gitDummyCommit(['Chore(deps): bump', 'BREAKING CHANGE: The Change is huge.']); - }, - function () { - gitDummyCommit(['Feat(deps): bump', 'BREAKING CHANGES Also works :)']); - gitDummyCommit(['Test(*)!: more tests', 'BREAKING CHANGE: The Change is huge.']); - }, - function () { - shell.exec('git tag v1.0.0'); - gitDummyCommit('Feat: some more features'); - }, - function () { - gitDummyCommit(['Feat(foo): add thing', 'closes #1223 #OBG-23']); - }, - function () { - gitDummyCommit(['Revert: \\"Feat: bad feature\\"', 'This reverts commit 12345.'], false); - gitDummyCommit(['Revert: Feat: custom revert format', 'This reverts commit 5678.']); - }, - function () { - gitDummyCommit([ - 'Pull request #550: Deps: Update dependency eslint-config-prettier to v7', - 'FP-1174 FP-1135 Chore: Add comments to shell scripts', - 'Merge in FP/fp-admin from dependencies/major-eslint to master', - ]); - }, -]); - -describe('lmc github preset', () => { - it('should work if there is no semver tag', (done) => { - preparing(1); - - conventionalChangelogCore({ - config: preset, - pkg: { - path: path.join(__dirname, '/__fixtures/github-host.json'), - }, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - - expect(chunk).toInclude('first build setup'); - expect(chunk).toInclude('amazing new module'); - expect(chunk).toInclude('**compile:** avoid a bug'); - expect(chunk).toInclude('make it faster'); - expect(chunk).toInclude(', closes #1, #2'); // Links are not created - expect(chunk).toInclude('Not backward compatible.'); - expect(chunk).toInclude('**compile:** The Change is huge.'); - expect(chunk).toInclude('Features'); - expect(chunk).toInclude('Bug Fixes'); - expect(chunk).toInclude('Performance Improvements'); - expect(chunk).toInclude('Reverts'); - expect(chunk).toInclude('bad commit'); - expect(chunk).toInclude('BREAKING CHANGE'); - expect(chunk).toInclude('Not so compatible change'); - expect(chunk).toInclude('Another big change that break things'); - - // expect(chunk).not.toInclude('first commit'); - expect(chunk).not.toInclude('feat'); - expect(chunk).not.toInclude('fix'); - expect(chunk).not.toInclude('perf'); - expect(chunk).not.toInclude('revert'); - expect(chunk).not.toInclude('***:**'); - expect(chunk).not.toInclude(': Not backward compatible.'); - expect(chunk).not.toInclude('Pull request'); - - expect(chunk).toEqual( - expect.stringMatching( - /oops \(\[[0-9a-z]{7}\]\(https:\/\/github.internal.example.com\/owner\/repo-name\/commit\/[0-9a-z]{7}\)\)/, - ), - ); // commit hash is linked - - done(); - }), - ); - }); - - it('should not list breaking change twice if ! is used', (done) => { - preparing(1); - - conventionalChangelogCore({ - config: preset, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - expect(chunk).not.toMatch(/\* first build setup\r?\n/); - done(); - }), - ); - }); - - it('should generate issue links if package.json has a bugs URL', (done) => { - preparing(2); - - conventionalChangelogCore({ - config: preset, - // Default package data (this repo!) - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - expect(chunk).toInclude('in [#133](https://github.com/lmc-eu/issues/133)'); - done(); - }), - ); - }); - - it('should not generate issue links when package.json does NOT have a bugs URL', (done) => { - preparing(3); - - conventionalChangelogCore( - { - config: preset, - pkg: { - path: path.join(__dirname, '/fixtures/github-host.json'), - }, - }, - { - packageData: {}, // Empty package data - }, - ) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - expect(chunk).toInclude('in #133'); - done(); - }), - ); - }); - - it('should not generate issue refs in-the-footer when the issue(s) appear in the subject line (the issues remain in the subject line)', (done) => { - preparing(3); - - conventionalChangelogCore({ - config: preset, - // Default package data (this repo!) - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - expect(chunk).toInclude('**awesome:** fix [#88]('); - expect(chunk).toInclude('88) [#TR-55]('); - expect(chunk).not.toInclude('closes [#88]('); - done(); - }), - ); - }); - - it('should not replace @username with GitHub user URL as feature is not available on BitBucket', (done) => { - preparing(4); - - conventionalChangelogCore({ - config: preset, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - expect(chunk).toInclude('issue brought up by @bcoe! on Friday'); - done(); - }), - ); - }); - - it('should not discard commit if there is BREAKING CHANGE', (done) => { - preparing(5); - - conventionalChangelogCore({ - config: preset, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - - expect(chunk).toInclude('Documentation'); - expect(chunk).toInclude('Styles'); - expect(chunk).toInclude('Code Refactoring'); - expect(chunk).toInclude('Tests'); - expect(chunk).toInclude('Chores'); - - done(); - }), - ); - }); - - it('should render BREAKING CHANGES the same as BREAKING CHANGE', (done) => { - preparing(6); - - conventionalChangelogCore({ - config: preset, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - - expect(chunk).toInclude('BREAKING CHANGE'); - expect(chunk).toInclude('Also works :)'); - - done(); - }), - ); - }); - - it('should omit optional ! in breaking commit', (done) => { - preparing(6); - - conventionalChangelogCore({ - config: preset, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - - expect(chunk).toInclude('### Tests'); - expect(chunk).toInclude('more tests'); - - done(); - }), - ); - }); - - it('should work if there is a semver tag', (done) => { - preparing(7); - let i = 0; - - conventionalChangelogCore({ - config: preset, - outputUnreleased: true, - pkg: { - path: path.join(__dirname, '/__fixtures/github-host.json'), - }, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through( - (chunk, enc, cb) => { - chunk = chunk.toString(); - - expect(chunk).toInclude('some more features'); - expect(chunk).not.toInclude('BREAKING'); - - expect(chunk).toInclude('https://github.internal.example.com/owner/repo-name/compare/v1.0.0...v2.0.0'); - - i++; - cb(); - }, - () => { - expect(i).toBe(1); - done(); - }, - ), - ); - }); - - it('should work with unknown host', (done) => { - preparing(7); - let i = 0; - - conventionalChangelogCore({ - config: preset, - pkg: { - path: path.join(__dirname, '/__fixtures/_unknown-host.json'), - }, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through( - (chunk, enc, cb) => { - chunk = chunk.toString(); - - expect(chunk).toInclude('(/compare'); - expect(chunk).toMatch(/some more features \(.*\)/); // No commit hash! - - i++; - cb(); - }, - () => { - expect(i).toBe(1); - done(); - }, - ), - ); - }); - - it('should always output the repo URL using http/https even when the repo URL in package.json is some other protocol', (done) => { - preparing(8); - let i = 0; - - conventionalChangelogCore({ - config: preset, - pkg: { - path: path.join(__dirname, '/__fixtures/github-http-host.json'), - }, - }) - .on('error', done) - .pipe( - through( - (chunk, enc, cb) => { - chunk = chunk.toString(); - - expect(chunk).toInclude('https://github.internal.example.com/owner/repo-name/compare/'); - expect(chunk).toInclude('https://github.internal.example.com/owner/repo-name/commit/'); - expect(chunk).toMatch(/some more features \(.*\)/); - - i++; - cb(); - }, - () => { - expect(i).toBe(1); - done(); - }, - ), - ); - }); - - it('should render multiple issues that are in the footer without links when package.json does NOT have a bugs URL', (done) => { - preparing(9); - - conventionalChangelogCore({ - config: preset, - pkg: { - path: path.join(__dirname, '/__fixtures/github-host.json'), - }, - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - expect(chunk).toInclude('closes #1223, #OBG-23'); - done(); - }), - ); - }); - - it('should render multiple issues that are in the footer as links when package.json has a bugs URL', (done) => { - preparing(9); - - conventionalChangelogCore({ - config: preset, - // Default package data (this repo!) - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - - expect(chunk).toInclude('closes [#1223]('); - expect(chunk).toInclude('1223), [#OBG-23]'); - done(); - }), - ); - }); - - it('should render revert commit using standard Git revert message convention', (done) => { - preparing(10); - - conventionalChangelogCore({ - config: preset, - // Default package data (this repo!) - }) - .on('error', (err) => { - done(err); - }) - .pipe( - through((chunk) => { - chunk = chunk.toString(); - - expect(chunk).toInclude('Feat: bad feature'); - expect(chunk).toInclude('Feat: custom revert format'); - done(); - }), - ); - }); -}); diff --git a/yarn.lock b/yarn.lock index 84722181..ef092796 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,14 @@ __metadata: version: 8 cacheKey: 10c0 +"@alma-oss/commitlint-config@workspace:packages/commitlint-config": + version: 0.0.0-use.local + resolution: "@alma-oss/commitlint-config@workspace:packages/commitlint-config" + dependencies: + "@commitlint/config-conventional": "npm:^19.0.0" + languageName: unknown + linkType: soft + "@alma-oss/prettier-config@workspace:packages/prettier-config": version: 0.0.0-use.local resolution: "@alma-oss/prettier-config@workspace:packages/prettier-config" @@ -490,12 +498,13 @@ __metadata: languageName: node linkType: hard -"@commitlint/config-conventional@npm:^17.0.0": - version: 17.8.1 - resolution: "@commitlint/config-conventional@npm:17.8.1" +"@commitlint/config-conventional@npm:^19.0.0": + version: 19.8.1 + resolution: "@commitlint/config-conventional@npm:19.8.1" dependencies: - conventional-changelog-conventionalcommits: "npm:^6.1.0" - checksum: 10c0/70abdc9f1361386060b30620decc376bc33ff0c27c6f2f89511df1d53127d238af7c3409db22651282caa614d54b91b1f5e35905d12b1f5db70603c351f6e482 + "@commitlint/types": "npm:^19.8.1" + conventional-changelog-conventionalcommits: "npm:^7.0.2" + checksum: 10c0/654786e1acd64756e5c88838c19d9eb5d5ee7a6f314af65585dc18cc4002990e971614e7c69f49e5489be9430671aa5b39af005a2160c5a4f26391258d38febf languageName: node linkType: hard @@ -1519,46 +1528,7 @@ __metadata: languageName: unknown linkType: soft -"@lmc-eu/commitlint-config@workspace:packages/commitlint-config": - version: 0.0.0-use.local - resolution: "@lmc-eu/commitlint-config@workspace:packages/commitlint-config" - dependencies: - "@commitlint/config-conventional": "npm:^17.0.0" - "@lmc-eu/conventional-changelog-lmc": "npm:^2.0.3" - languageName: unknown - linkType: soft - -"@lmc-eu/conventional-changelog-lmc-bitbucket@workspace:packages/conventional-changelog-lmc-bitbucket": - version: 0.0.0-use.local - resolution: "@lmc-eu/conventional-changelog-lmc-bitbucket@workspace:packages/conventional-changelog-lmc-bitbucket" - dependencies: - "@lmc-eu/conventional-changelog-lmc": "npm:^2.0.3" - better-than-before: "npm:1.0.0" - conventional-changelog-core: "npm:7.0.0" - git-dummy-commit: "npm:1.3.0" - jest: "npm:29.7.0" - jest-extended: "npm:4.0.2" - shelljs: "npm:0.10.0" - through2: "npm:4.0.2" - languageName: unknown - linkType: soft - -"@lmc-eu/conventional-changelog-lmc-github@workspace:packages/conventional-changelog-lmc-github": - version: 0.0.0-use.local - resolution: "@lmc-eu/conventional-changelog-lmc-github@workspace:packages/conventional-changelog-lmc-github" - dependencies: - "@lmc-eu/conventional-changelog-lmc": "npm:^2.0.3" - better-than-before: "npm:1.0.0" - conventional-changelog-core: "npm:7.0.0" - git-dummy-commit: "npm:1.3.0" - jest: "npm:29.7.0" - jest-extended: "npm:4.0.2" - shelljs: "npm:0.10.0" - through2: "npm:4.0.2" - languageName: unknown - linkType: soft - -"@lmc-eu/conventional-changelog-lmc@npm:^2.0.3, @lmc-eu/conventional-changelog-lmc@workspace:packages/conventional-changelog-lmc": +"@lmc-eu/conventional-changelog-lmc@workspace:packages/conventional-changelog-lmc": version: 0.0.0-use.local resolution: "@lmc-eu/conventional-changelog-lmc@workspace:packages/conventional-changelog-lmc" dependencies: @@ -4518,6 +4488,7 @@ __metadata: resolution: "code-quality-tools@workspace:." dependencies: "@commitlint/cli": "npm:19.8.1" + conventional-changelog-conventionalcommits: "npm:^9.1.0" eslint: "npm:8.57.1" eslint-config-prettier: "npm:9.1.2" eslint-import-resolver-node: "npm:0.3.9" @@ -4704,12 +4675,21 @@ __metadata: languageName: node linkType: hard -"conventional-changelog-conventionalcommits@npm:^6.1.0": - version: 6.1.0 - resolution: "conventional-changelog-conventionalcommits@npm:6.1.0" +"conventional-changelog-conventionalcommits@npm:^7.0.2": + version: 7.0.2 + resolution: "conventional-changelog-conventionalcommits@npm:7.0.2" + dependencies: + compare-func: "npm:^2.0.0" + checksum: 10c0/3cb1eab35e37fc973cfb3aed0e159f54414e49b222988da1c2aa86cc8a87fe7531491bbb7657fe5fc4dc0e25f5b50e2065ba8ac71cc4c08eed9189102a2b81bd + languageName: node + linkType: hard + +"conventional-changelog-conventionalcommits@npm:^9.1.0": + version: 9.1.0 + resolution: "conventional-changelog-conventionalcommits@npm:9.1.0" dependencies: compare-func: "npm:^2.0.0" - checksum: 10c0/b313f5c0160d109f58d976566e1331ede3a25ab19fbf43f86763b280659195de00a68551f7f3930bf1cbf39a5e707d94f2a25b79996e59043fa9ee0bed68a79f + checksum: 10c0/b1dfbb8ce5983bb80837c35f089fb0f9603a1b067f34be680f88fde20871792e461e29d119d468bc293f38a1ca916c1c40a841f8c049a0a1efaa40582f4fecc9 languageName: node linkType: hard