@anolilab/commitlint-config 5.0.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.md +5 -5
- package/dist/bin.mjs +15 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +20 -0
- package/dist/index.mjs +1 -5
- package/package.json +28 -31
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/postinstall.d.mts +0 -2
- package/dist/postinstall.d.ts +0 -2
- package/dist/postinstall.js +0 -23
- package/dist/postinstall.js.map +0 -1
- package/dist/postinstall.mjs +0 -21
- package/dist/postinstall.mjs.map +0 -1
- package/skip.js +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
## @anolilab/commitlint-config [6.0.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/commitlint-config@5.0.3...@anolilab/commitlint-config@6.0.0) (2025-05-26)
|
|
2
|
+
|
|
3
|
+
### ⚠ BREAKING CHANGES
|
|
4
|
+
|
|
5
|
+
* **commitlint-config:** changed post-install script to a bin command call
|
|
6
|
+
Signed-off-by: prisis <d.bannert@anolilab.de>
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **commitlint-config:** removed post-install script, updated dependencies, allowed node 23 ([35f4f31](https://github.com/anolilab/javascript-style-guide/commit/35f4f318cab3df9d76dd91e96f175dc9764b3b02))
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **commitlint-config:** removed @anolilab/package-json-utils ([c4df0ab](https://github.com/anolilab/javascript-style-guide/commit/c4df0ab17cd3682dbd5f02b494e50744fd7d7d06))
|
|
15
|
+
* **commitlint-config:** updated commitlint dependencies and dev dependencies ([7549010](https://github.com/anolilab/javascript-style-guide/commit/75490101685b03cf63bfdf6deac1bd7acf0b9405))
|
|
16
|
+
|
|
17
|
+
### Miscellaneous Chores
|
|
18
|
+
|
|
19
|
+
* **deps:** update commitlint monorepo to ^18.4.4 (patch) ([#812](https://github.com/anolilab/javascript-style-guide/issues/812)) ([c3a8140](https://github.com/anolilab/javascript-style-guide/commit/c3a8140da4a8b5b21453172c8a07bedc9c1f0b1f))
|
|
20
|
+
* remove deprecated ESLint and Prettier configurations, update project structure and dependencies ([7b269ed](https://github.com/anolilab/javascript-style-guide/commit/7b269eda93e7dbede5fbdb536dec518dab2bc54b))
|
|
21
|
+
* update commitlint-config dependencies to latest versions ([3ea318f](https://github.com/anolilab/javascript-style-guide/commit/3ea318ffa52ee17147213caba02944e9158fa3bd))
|
|
22
|
+
* update node engine compatibility across multiple packages ([8755783](https://github.com/anolilab/javascript-style-guide/commit/8755783d4be3199bd602ede7d83628f83be3f358))
|
|
23
|
+
* updated dev dependencies ([89cb5c7](https://github.com/anolilab/javascript-style-guide/commit/89cb5c72b14fc27041783804f1098c2ecfc3cc33))
|
|
24
|
+
|
|
25
|
+
### Continuous Integration
|
|
26
|
+
|
|
27
|
+
* fixed build workflow ([622591f](https://github.com/anolilab/javascript-style-guide/commit/622591f129fea0d30129d45346e49795169accd2))
|
|
28
|
+
|
|
29
|
+
## @anolilab/commitlint-config [5.0.3](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/commitlint-config@5.0.2...@anolilab/commitlint-config@5.0.3) (2023-12-22)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* dep update ([5f6245c](https://github.com/anolilab/javascript-style-guide/commit/5f6245c1dd9a66b487887bb801ef823b07f0f8f3))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Dependencies
|
|
39
|
+
|
|
40
|
+
* **@anolilab/semantic-release-preset:** upgraded to 8.0.3
|
|
41
|
+
|
|
1
42
|
## @anolilab/commitlint-config [5.0.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/commitlint-config@5.0.1...@anolilab/commitlint-config@5.0.2) (2023-11-02)
|
|
2
43
|
|
|
3
44
|
|
package/README.md
CHANGED
|
@@ -43,11 +43,13 @@ pnpm add -D @commitlint/cli @anolilab/commitlint-config
|
|
|
43
43
|
|
|
44
44
|
## Usage
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
If you don’t have a `commitlint.config.js` or the other supported names, we can create the file for you after installing `@anolilab/commitlint-config`, call `pnpm commitlint-config:install`.
|
|
47
47
|
|
|
48
|
-
>
|
|
48
|
+
> Alternatively the configuration can be defined in a `commitlint.config.js`, `.commitlintrc.js`, `.commitlintrc`, `.commitlintrc.json`, `.commitlintrc.yml` file
|
|
49
|
+
|
|
50
|
+
If you already have a `commitlint.config.js`, then you can extend the `commitlint.config.js`, with `@anolilab/commitlint-config`.
|
|
49
51
|
|
|
50
|
-
> Note:
|
|
52
|
+
> Note: If the script detects an existing `commitlint.config.js` file, it will not overwrite it.
|
|
51
53
|
|
|
52
54
|
```js
|
|
53
55
|
module.exports = {
|
|
@@ -72,8 +74,6 @@ export default {
|
|
|
72
74
|
|
|
73
75
|
This extends the `@anolilab/commitlint-config` and uses its pre-defined configuration.
|
|
74
76
|
|
|
75
|
-
> Alternatively the configuration can be defined in a `commitlint.config.js`, `.commitlintrc.js`, `.commitlintrc`, `.commitlintrc.json`, `.commitlintrc.yml` file
|
|
76
|
-
|
|
77
77
|
## Commitlint Rules
|
|
78
78
|
|
|
79
79
|
The following customized rules are included in this configuration:
|
package/dist/bin.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var m=Object.defineProperty;var l=(e,t)=>m(e,"name",{value:t,configurable:!0});import{existsSync as c}from"node:fs";import{readFile as g,writeFile as f}from"node:fs/promises";import{join as i}from"node:path";import n from"node:process";var u=Object.defineProperty,a=l((e,t)=>u(e,"name",{value:t,configurable:!0}),"e");const w=a(e=>c(e)?(console.warn(`⚠️ ${e} already exists;`),!0):!1,"checkIfFileExists"),$=a(async(e,t)=>{const o="commitlint";for(const s of[o,`.${o}rc`,`.${o}.json`,`.${o}.yaml`,`.${o}.yml`,`.${o}.js`,`.${o}.cjs`,`.${o}.mjs`,`.${o}.ts`,`.${o}.cts`,`.${o}.config.js`,`.${o}.config.cjs`,`.${o}.config.mjs`,`.${o}.config.ts`,`.${o}.config.cts`])if(w(i(e,s))){console.warn(`⚠️ ${s} already exists;`);return}const r=i(e,"commitlint.config.js");await f(r,`${t?"export default":"module.exports ="} {
|
|
3
|
+
extends: ["@anolilab/commitlint-config"],
|
|
4
|
+
rules: {
|
|
5
|
+
// overwrite rules here
|
|
6
|
+
// or extend rules
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
`,"utf-8")},"writeCommitLintConfig"),d=a(async e=>{const t=i(e,".czrc");if(c(t)){console.warn("⚠️ .czrc already exists;");return}await f(t,`{
|
|
11
|
+
"path": "cz-conventional-changelog"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
`,"utf-8")},"writeCzrc");(async()=>{const e=n.cwd(),t=i(e,"package.json");c(t)||(console.error("No package.json found in the current directory. You need to run this command in a directory with a package.json file."),n.exit(1));const o=JSON.parse(await g(t,"utf-8"));console.log("Configuring @anolilab/commitlint-config",e,`
|
|
15
|
+
`);try{await $(e,o.type==="module"),await d(e),console.log("Everything went well, have fun!"),n.exit(0)}catch(r){console.error("Something went wrong:",r),n.exit(1)}})();
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=/^chore\(release\):.*\[skip ci\]/u,s={extends:["@commitlint/config-conventional"],ignores:[e=>a.test(e)],rules:{"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"scope-case":[2,"always","lower-case"],"subject-case":[2,"never",["sentence-case","start-case","pascal-case","upper-case"]],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","deps","docs","feat","fix","perf","refactor","revert","security","style","test","translation"]]}};module.exports=s;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const config: {
|
|
2
|
+
extends: string[];
|
|
3
|
+
ignores: ((commitMessage: string) => boolean)[];
|
|
4
|
+
rules: {
|
|
5
|
+
"body-leading-blank": (string | number)[];
|
|
6
|
+
"body-max-line-length": (string | number)[];
|
|
7
|
+
"footer-leading-blank": (string | number)[];
|
|
8
|
+
"footer-max-line-length": (string | number)[];
|
|
9
|
+
"header-max-length": (string | number)[];
|
|
10
|
+
"scope-case": (string | number)[];
|
|
11
|
+
"subject-case": (string | number | string[])[];
|
|
12
|
+
"subject-empty": (string | number)[];
|
|
13
|
+
"subject-full-stop": (string | number)[];
|
|
14
|
+
"type-case": (string | number)[];
|
|
15
|
+
"type-empty": (string | number)[];
|
|
16
|
+
"type-enum": (string | number | string[])[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { config as default };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { s as default };
|
|
4
|
-
//# sourceMappingURL=out.js.map
|
|
5
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
const a=/^chore\(release\):.*\[skip ci\]/u,s={extends:["@commitlint/config-conventional"],ignores:[e=>a.test(e)],rules:{"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"scope-case":[2,"always","lower-case"],"subject-case":[2,"never",["sentence-case","start-case","pascal-case","upper-case"]],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","deps","docs","feat","fix","perf","refactor","revert","security","style","test","translation"]]}};export{s as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/commitlint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Anolilab´s shareable coding standard config for commitlint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -28,57 +28,54 @@
|
|
|
28
28
|
"name": "Daniel Bannert",
|
|
29
29
|
"email": "d.bannert@anolilab.de"
|
|
30
30
|
},
|
|
31
|
+
"type": "module",
|
|
31
32
|
"exports": {
|
|
32
33
|
".": {
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
"require": {
|
|
35
|
+
"types": "./dist/index.d.cts",
|
|
36
|
+
"default": "./dist/index.cjs"
|
|
37
|
+
},
|
|
38
|
+
"import": {
|
|
39
|
+
"types": "./dist/index.d.mts",
|
|
40
|
+
"default": "./dist/index.mjs"
|
|
41
|
+
}
|
|
36
42
|
},
|
|
37
43
|
"./package.json": "./package.json"
|
|
38
44
|
},
|
|
39
|
-
"main": "dist/index.
|
|
45
|
+
"main": "dist/index.cjs",
|
|
40
46
|
"module": "dist/index.mjs",
|
|
41
47
|
"types": "dist/index.d.ts",
|
|
48
|
+
"typesVersions": {
|
|
49
|
+
">=5.0": {
|
|
50
|
+
".": [
|
|
51
|
+
"./dist/index.d.ts"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"bin": {
|
|
56
|
+
"commitlint-config:install": "./dist/bin.mjs"
|
|
57
|
+
},
|
|
42
58
|
"files": [
|
|
43
59
|
"dist",
|
|
44
|
-
"skip.js",
|
|
45
60
|
"README.md",
|
|
46
61
|
"CHANGELOG.md",
|
|
47
62
|
"LICENSE.md"
|
|
48
63
|
],
|
|
49
|
-
"scripts": {
|
|
50
|
-
"build": "cross-env NODE_ENV=development tsup",
|
|
51
|
-
"build:prod": "cross-env NODE_ENV=production tsup",
|
|
52
|
-
"clean": "rimraf node_modules dist",
|
|
53
|
-
"postinstall": "node ./skip.js || node ./dist/postinstall.js"
|
|
54
|
-
},
|
|
55
64
|
"dependencies": {
|
|
56
|
-
"@
|
|
57
|
-
"@commitlint/
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"conventional-changelog-conventionalcommits": "7.0.2",
|
|
65
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
66
|
+
"@commitlint/core": "^19.8.1",
|
|
67
|
+
"commitizen": "^4.3.1",
|
|
68
|
+
"conventional-changelog-conventionalcommits": "9.0.0",
|
|
61
69
|
"cz-conventional-changelog": "^3.3.0"
|
|
62
70
|
},
|
|
63
|
-
"devDependencies": {
|
|
64
|
-
"@anolilab/semantic-release-preset": "8.0.2",
|
|
65
|
-
"@commitlint/cli": "^18.2.0",
|
|
66
|
-
"rimraf": "^5.0.5",
|
|
67
|
-
"tsup": "^7.2.0",
|
|
68
|
-
"vitest": "^0.34.6"
|
|
69
|
-
},
|
|
70
71
|
"peerDependencies": {
|
|
71
|
-
"@commitlint/cli": "^17.6.5 || ^18.
|
|
72
|
+
"@commitlint/cli": "^17.6.5 || ^18.x || ^19.x"
|
|
72
73
|
},
|
|
73
74
|
"engines": {
|
|
74
|
-
"node": ">=18.* <=
|
|
75
|
+
"node": ">=20.18.* <=24.*"
|
|
75
76
|
},
|
|
76
77
|
"publishConfig": {
|
|
77
78
|
"access": "public",
|
|
78
79
|
"provenance": true
|
|
79
|
-
}
|
|
80
|
-
"sources": [
|
|
81
|
-
"src/index.ts",
|
|
82
|
-
"src/postinstall.ts"
|
|
83
|
-
]
|
|
80
|
+
}
|
|
84
81
|
}
|
package/dist/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var a=/^chore\(release\):.*\[skip ci\]/u,t={extends:["@commitlint/config-conventional"],ignores:[e=>a.test(e)],rules:{"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"scope-case":[2,"always","lower-case"],"subject-case":[2,"never",["sentence-case","start-case","pascal-case","upper-case"]],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","deps","docs","feat","fix","perf","refactor","revert","security","style","test","translation"]]}},s=t;
|
|
4
|
-
|
|
5
|
-
module.exports = s;
|
|
6
|
-
//# sourceMappingURL=out.js.map
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["automaticCommitPattern","config","commitMessage","src_default"],"mappings":"AAAA,IAAMA,EAAyB,mCAEzBC,EAAS,CACX,QAAS,CAAC,iCAAiC,EAM3C,QAAS,CAAEC,GAAmCF,EAAuB,KAAKE,CAAa,CAAC,EACxF,MAAO,CACH,qBAAsB,CAAC,EAAG,QAAQ,EAClC,uBAAwB,CAAC,EAAG,SAAU,GAAG,EACzC,uBAAwB,CAAC,EAAG,QAAQ,EACpC,yBAA0B,CAAC,EAAG,SAAU,GAAG,EAC3C,oBAAqB,CAAC,EAAG,SAAU,GAAG,EACtC,aAAc,CAAC,EAAG,SAAU,YAAY,EACxC,eAAgB,CAAC,EAAG,QAAS,CAAC,gBAAiB,aAAc,cAAe,YAAY,CAAC,EACzF,gBAAiB,CAAC,EAAG,OAAO,EAC5B,oBAAqB,CAAC,EAAG,QAAS,GAAG,EACrC,YAAa,CAAC,EAAG,SAAU,YAAY,EACvC,aAAc,CAAC,EAAG,OAAO,EACzB,YAAa,CACT,EACA,SACA,CAAC,QAAS,QAAS,KAAM,OAAQ,OAAQ,OAAQ,MAAO,OAAQ,WAAY,SAAU,WAAY,QAAS,OAAQ,aAAa,CACpI,CACJ,CACJ,EAEOC,EAAQF","sourcesContent":["const automaticCommitPattern = /^chore\\(release\\):.*\\[skip ci\\]/u;\n\nconst config = {\n extends: [\"@commitlint/config-conventional\"],\n /**\n * This resolves a linting conflict between commitlint's body-max-line-length\n * due to @semantic-release/git putting release notes in the commit body\n * https://github.com/semantic-release/git/issues/331\n */\n ignores: [(commitMessage: string): boolean => automaticCommitPattern.test(commitMessage)],\n rules: {\n \"body-leading-blank\": [1, \"always\"],\n \"body-max-line-length\": [2, \"always\", 100],\n \"footer-leading-blank\": [1, \"always\"],\n \"footer-max-line-length\": [2, \"always\", 100],\n \"header-max-length\": [2, \"always\", 100],\n \"scope-case\": [2, \"always\", \"lower-case\"],\n \"subject-case\": [2, \"never\", [\"sentence-case\", \"start-case\", \"pascal-case\", \"upper-case\"]],\n \"subject-empty\": [2, \"never\"],\n \"subject-full-stop\": [2, \"never\", \".\"],\n \"type-case\": [2, \"always\", \"lower-case\"],\n \"type-empty\": [2, \"never\"],\n \"type-enum\": [\n 2,\n \"always\",\n [\"build\", \"chore\", \"ci\", \"deps\", \"docs\", \"feat\", \"fix\", \"perf\", \"refactor\", \"revert\", \"security\", \"style\", \"test\", \"translation\"],\n ],\n },\n};\n\nexport default config;\n"]}
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["automaticCommitPattern","config","commitMessage","src_default"],"mappings":"AAAA,IAAMA,EAAyB,mCAEzBC,EAAS,CACX,QAAS,CAAC,iCAAiC,EAM3C,QAAS,CAAEC,GAAmCF,EAAuB,KAAKE,CAAa,CAAC,EACxF,MAAO,CACH,qBAAsB,CAAC,EAAG,QAAQ,EAClC,uBAAwB,CAAC,EAAG,SAAU,GAAG,EACzC,uBAAwB,CAAC,EAAG,QAAQ,EACpC,yBAA0B,CAAC,EAAG,SAAU,GAAG,EAC3C,oBAAqB,CAAC,EAAG,SAAU,GAAG,EACtC,aAAc,CAAC,EAAG,SAAU,YAAY,EACxC,eAAgB,CAAC,EAAG,QAAS,CAAC,gBAAiB,aAAc,cAAe,YAAY,CAAC,EACzF,gBAAiB,CAAC,EAAG,OAAO,EAC5B,oBAAqB,CAAC,EAAG,QAAS,GAAG,EACrC,YAAa,CAAC,EAAG,SAAU,YAAY,EACvC,aAAc,CAAC,EAAG,OAAO,EACzB,YAAa,CACT,EACA,SACA,CAAC,QAAS,QAAS,KAAM,OAAQ,OAAQ,OAAQ,MAAO,OAAQ,WAAY,SAAU,WAAY,QAAS,OAAQ,aAAa,CACpI,CACJ,CACJ,EAEOC,EAAQF","sourcesContent":["const automaticCommitPattern = /^chore\\(release\\):.*\\[skip ci\\]/u;\n\nconst config = {\n extends: [\"@commitlint/config-conventional\"],\n /**\n * This resolves a linting conflict between commitlint's body-max-line-length\n * due to @semantic-release/git putting release notes in the commit body\n * https://github.com/semantic-release/git/issues/331\n */\n ignores: [(commitMessage: string): boolean => automaticCommitPattern.test(commitMessage)],\n rules: {\n \"body-leading-blank\": [1, \"always\"],\n \"body-max-line-length\": [2, \"always\", 100],\n \"footer-leading-blank\": [1, \"always\"],\n \"footer-max-line-length\": [2, \"always\", 100],\n \"header-max-length\": [2, \"always\", 100],\n \"scope-case\": [2, \"always\", \"lower-case\"],\n \"subject-case\": [2, \"never\", [\"sentence-case\", \"start-case\", \"pascal-case\", \"upper-case\"]],\n \"subject-empty\": [2, \"never\"],\n \"subject-full-stop\": [2, \"never\", \".\"],\n \"type-case\": [2, \"always\", \"lower-case\"],\n \"type-empty\": [2, \"never\"],\n \"type-enum\": [\n 2,\n \"always\",\n [\"build\", \"chore\", \"ci\", \"deps\", \"docs\", \"feat\", \"fix\", \"perf\", \"refactor\", \"revert\", \"security\", \"style\", \"test\", \"translation\"],\n ],\n },\n};\n\nexport default config;\n"]}
|
package/dist/postinstall.d.mts
DELETED
package/dist/postinstall.d.ts
DELETED
package/dist/postinstall.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var fs = require('fs');
|
|
4
|
-
var path = require('path');
|
|
5
|
-
var util = require('util');
|
|
6
|
-
var packageJsonUtils = require('@anolilab/package-json-utils');
|
|
7
|
-
|
|
8
|
-
process.env.CI&&process.exit(0);var i=util.promisify(fs.writeFile);console.log("Configuring @anolilab/commitlint-config",packageJsonUtils.projectPath,`
|
|
9
|
-
`);var a=async()=>{let o=path.join(packageJsonUtils.projectPath,"commitlint.config.js");if(fs.existsSync(o)){console.warn("\u26A0\uFE0F commitlint.config.js already exists;");return}await i(o,`${packageJsonUtils.packageIsTypeModule?"export default":"module.exports ="} {
|
|
10
|
-
extends: ["@anolilab/commitlint-config"],
|
|
11
|
-
rules: {
|
|
12
|
-
// overwrite rules here
|
|
13
|
-
// or extend rules
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
`,"utf-8");},m=async()=>{let o=path.join(packageJsonUtils.projectPath,".czrc");if(fs.existsSync(o)){console.warn("\u26A0\uFE0F .czrc already exists;");return}await i(o,`{
|
|
18
|
-
"path": "cz-conventional-changelog"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
`,"utf-8");};(async()=>{try{await a(),await m(),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(o){console.log("\u{1F62C} something went wrong:"),console.error(o),process.exit(1);}})();
|
|
22
|
-
//# sourceMappingURL=out.js.map
|
|
23
|
-
//# sourceMappingURL=postinstall.js.map
|
package/dist/postinstall.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/postinstall.ts"],"names":["existsSync","writeFile","join","promisify","packageIsTypeModule","projectPath","writeFileAsync","writeCommitLintConfig","commitlintPath","writeCzrc","filePath","error"],"mappings":"AAAA,OAAS,cAAAA,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAE1B,OAAS,uBAAAC,EAAqB,eAAAC,MAAmB,+BAE7C,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBH,EAAUF,CAAS,EAE1C,QAAQ,IAAI,0CAA2CI,EAAa;AAAA,CAAI,EAKxE,IAAME,EAAwB,SAAY,CACtC,IAAMC,EAAiBN,EAAKG,EAAa,sBAAsB,EAG/D,GAAIL,EAAWQ,CAAc,EAAG,CAC5B,QAAQ,KAAK,oDAA0C,EAEvD,MACJ,CAYA,MAAMF,EAAeE,EAVL,GAAGJ,EAAsB,iBAAmB,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUhC,OAAO,CACzD,EAKMK,EAAY,SAAY,CAC1B,IAAMC,EAAWR,EAAKG,EAAa,OAAO,EAG1C,GAAIL,EAAWU,CAAQ,EAAG,CACtB,QAAQ,KAAK,qCAA2B,EAExC,MACJ,CAQA,MAAMJ,EAAeI,EANL;AAAA;AAAA;AAAA;AAAA,EAMwB,OAAO,CACnD,GAGC,SAAY,CACT,GAAI,CACA,MAAMH,EAAsB,EAC5B,MAAME,EAAU,EAEhB,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASE,EAAO,CACZ,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\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/commitlint-config\", projectPath, \"\\n\");\n\n/**\n * Writes commitlint.config.js if it doesn't exist. Warns if it exists.\n */\nconst writeCommitLintConfig = async () => {\n const commitlintPath = join(projectPath, \"commitlint.config.js\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(commitlintPath)) {\n console.warn(\"⚠️ commitlint.config.js already exists;\");\n\n return;\n }\n\n const content = `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n extends: [\"@anolilab/commitlint-config\"],\n rules: {\n // overwrite rules here\n // or extend rules\n },\n};\n\n`;\n\n await writeFileAsync(commitlintPath, content, \"utf-8\");\n};\n\n/**\n * Writes .czrc if it doesn't exist. Warns if it exists.\n */\nconst writeCzrc = async () => {\n const filePath = join(projectPath, \".czrc\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(filePath)) {\n console.warn(\"⚠️ .czrc already exists;\");\n\n return;\n }\n\n const content = `{\n \"path\": \"cz-conventional-changelog\"\n}\n\n`;\n\n await writeFileAsync(filePath, content, \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\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"]}
|
package/dist/postinstall.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { writeFile, existsSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { promisify } from 'util';
|
|
4
|
-
import { projectPath, packageIsTypeModule } from '@anolilab/package-json-utils';
|
|
5
|
-
|
|
6
|
-
process.env.CI&&process.exit(0);var i=promisify(writeFile);console.log("Configuring @anolilab/commitlint-config",projectPath,`
|
|
7
|
-
`);var a=async()=>{let o=join(projectPath,"commitlint.config.js");if(existsSync(o)){console.warn("\u26A0\uFE0F commitlint.config.js already exists;");return}await i(o,`${packageIsTypeModule?"export default":"module.exports ="} {
|
|
8
|
-
extends: ["@anolilab/commitlint-config"],
|
|
9
|
-
rules: {
|
|
10
|
-
// overwrite rules here
|
|
11
|
-
// or extend rules
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
`,"utf-8");},m=async()=>{let o=join(projectPath,".czrc");if(existsSync(o)){console.warn("\u26A0\uFE0F .czrc already exists;");return}await i(o,`{
|
|
16
|
-
"path": "cz-conventional-changelog"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
`,"utf-8");};(async()=>{try{await a(),await m(),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(o){console.log("\u{1F62C} something went wrong:"),console.error(o),process.exit(1);}})();
|
|
20
|
-
//# sourceMappingURL=out.js.map
|
|
21
|
-
//# sourceMappingURL=postinstall.mjs.map
|
package/dist/postinstall.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/postinstall.ts"],"names":["existsSync","writeFile","join","promisify","packageIsTypeModule","projectPath","writeFileAsync","writeCommitLintConfig","commitlintPath","writeCzrc","filePath","error"],"mappings":"AAAA,OAAS,cAAAA,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAE1B,OAAS,uBAAAC,EAAqB,eAAAC,MAAmB,+BAE7C,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBH,EAAUF,CAAS,EAE1C,QAAQ,IAAI,0CAA2CI,EAAa;AAAA,CAAI,EAKxE,IAAME,EAAwB,SAAY,CACtC,IAAMC,EAAiBN,EAAKG,EAAa,sBAAsB,EAG/D,GAAIL,EAAWQ,CAAc,EAAG,CAC5B,QAAQ,KAAK,oDAA0C,EAEvD,MACJ,CAYA,MAAMF,EAAeE,EAVL,GAAGJ,EAAsB,iBAAmB,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUhC,OAAO,CACzD,EAKMK,EAAY,SAAY,CAC1B,IAAMC,EAAWR,EAAKG,EAAa,OAAO,EAG1C,GAAIL,EAAWU,CAAQ,EAAG,CACtB,QAAQ,KAAK,qCAA2B,EAExC,MACJ,CAQA,MAAMJ,EAAeI,EANL;AAAA;AAAA;AAAA;AAAA,EAMwB,OAAO,CACnD,GAGC,SAAY,CACT,GAAI,CACA,MAAMH,EAAsB,EAC5B,MAAME,EAAU,EAEhB,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASE,EAAO,CACZ,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\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/commitlint-config\", projectPath, \"\\n\");\n\n/**\n * Writes commitlint.config.js if it doesn't exist. Warns if it exists.\n */\nconst writeCommitLintConfig = async () => {\n const commitlintPath = join(projectPath, \"commitlint.config.js\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(commitlintPath)) {\n console.warn(\"⚠️ commitlint.config.js already exists;\");\n\n return;\n }\n\n const content = `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n extends: [\"@anolilab/commitlint-config\"],\n rules: {\n // overwrite rules here\n // or extend rules\n },\n};\n\n`;\n\n await writeFileAsync(commitlintPath, content, \"utf-8\");\n};\n\n/**\n * Writes .czrc if it doesn't exist. Warns if it exists.\n */\nconst writeCzrc = async () => {\n const filePath = join(projectPath, \".czrc\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(filePath)) {\n console.warn(\"⚠️ .czrc already exists;\");\n\n return;\n }\n\n const content = `{\n \"path\": \"cz-conventional-changelog\"\n}\n\n`;\n\n await writeFileAsync(filePath, content, \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\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"]}
|