@anolilab/semantic-release-preset 3.1.0 → 3.1.2
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 +16 -0
- package/README.md +11 -0
- package/dist/postinstall.d.ts +2 -1
- package/dist/postinstall.js +3 -4
- package/dist/postinstall.js.map +1 -1
- package/dist/postinstall.mjs +3 -4
- package/dist/postinstall.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## @anolilab/semantic-release-preset [3.1.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@3.1.1...@anolilab/semantic-release-preset@3.1.2) (2023-06-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Dependencies
|
|
6
|
+
|
|
7
|
+
* **@anolilab/package-json-utils:** upgraded to 1.4.0
|
|
8
|
+
|
|
9
|
+
## @anolilab/semantic-release-preset [3.1.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@3.1.0...@anolilab/semantic-release-preset@3.1.1) (2023-06-15)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
* **@anolilab/package-json-utils:** upgraded to 1.3.0
|
|
16
|
+
|
|
1
17
|
## @anolilab/semantic-release-preset [3.1.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@3.0.0...@anolilab/semantic-release-preset@3.1.0) (2023-06-11)
|
|
2
18
|
|
|
3
19
|
|
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Semantic-release shareable configuration to publish GitHub projects.
|
|
4
4
|
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
[![npm-image]][npm-url] [![license-image]][license-url]
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
|
|
5
11
|
---
|
|
6
12
|
|
|
7
13
|
<div align="center">
|
|
@@ -464,3 +470,8 @@ The anolilab javascript-style-guide is open-sourced software licensed under the
|
|
|
464
470
|
[5]: https://github.com/semantic-release/exec
|
|
465
471
|
[6]: https://github.com/semantic-release/git
|
|
466
472
|
[7]: https://github.com/semantic-release/npm
|
|
473
|
+
|
|
474
|
+
[license-image]: https://img.shields.io/npm/l/@anolilab/semantic-release-preset?color=blueviolet&style=for-the-badge
|
|
475
|
+
[license-url]: LICENSE.md "license"
|
|
476
|
+
[npm-image]: https://img.shields.io/npm/v/@anolilab/semantic-release-preset/latest.svg?style=for-the-badge&logo=npm
|
|
477
|
+
[npm-url]: https://www.npmjs.com/package/@anolilab/semantic-release-preset/v/latest "npm"
|
package/dist/postinstall.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
export { }
|
package/dist/postinstall.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
'use strict';
|
|
3
2
|
|
|
4
3
|
var packageJsonUtils = require('@anolilab/package-json-utils');
|
|
@@ -7,11 +6,11 @@ var path = require('path');
|
|
|
7
6
|
var util = require('util');
|
|
8
7
|
|
|
9
8
|
process.env.CI&&process.exit(0);var r=util.promisify(fs.writeFile);console.log("Configuring @anolilab/semantic-release-preset",packageJsonUtils.projectPath,`
|
|
10
|
-
`);var
|
|
9
|
+
`);var p=()=>{if(packageJsonUtils.pkg&&(packageJsonUtils.hasDevelopmentDep(["multi-semantic-release","@qiwi/multi-semantic-release"])||packageJsonUtils.hasDep(["multi-semantic-release","@qiwi/multi-semantic-release"])))return console.warn("\u26A0\uFE0F found use of multi-semantic-release;"),Promise.resolve();let e=path.join(packageJsonUtils.projectPath,".releaserc.json");return fs.existsSync(e)?(console.warn("\u26A0\uFE0F .releaserc.json already exists;"),Promise.resolve()):r(e,`{
|
|
11
10
|
"extends": "@anolilab/semantic-release-preset/npm"
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
`,"utf-8")},
|
|
13
|
+
`,"utf-8")},u=()=>{let e=path.join(packageJsonUtils.projectPath,"commitlint.config.js");return fs.existsSync(e)?(console.warn("\u26A0\uFE0F commitlint.config.js already exists;"),Promise.resolve()):r(e,`${packageJsonUtils.packageIsTypeModule?"export default":"module.exports ="} {
|
|
15
14
|
extends: ["@commitlint/config-conventional"],
|
|
16
15
|
};
|
|
17
16
|
|
|
@@ -19,6 +18,6 @@ process.env.CI&&process.exit(0);var r=util.promisify(fs.writeFile);console.log("
|
|
|
19
18
|
"path": "cz-conventional-changelog"
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
`,"utf-8")};(async()=>{try{await
|
|
21
|
+
`,"utf-8")};(async()=>{try{await p(),await u(),await w(),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
|
|
23
22
|
//# sourceMappingURL=out.js.map
|
|
24
23
|
//# sourceMappingURL=postinstall.js.map
|
package/dist/postinstall.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/postinstall.ts"],"names":["hasDep","hasDevelopmentDep","packageIsTypeModule","pkg","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writeReleaseRc","releaseRcPath","writeCommitLintConfig","commitlintPath","writeCzrc","filePath","error"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/postinstall.ts"],"names":["hasDep","hasDevelopmentDep","packageIsTypeModule","pkg","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writeReleaseRc","releaseRcPath","writeCommitLintConfig","commitlintPath","writeCzrc","filePath","error"],"mappings":"AAAA,OACC,UAAAA,EAAQ,qBAAAC,EAAmB,uBAAAC,EAAqB,OAAAC,EAAK,eAAAC,MAC/C,+BACP,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,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@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/semantic-release-preset\", projectPath, \"\\n\");\n\n/**\n * Writes .releaserc.json if it doesn't exist. Warns if it exists.\n */\nconst writeReleaseRc = () => {\n if (\n pkg\n && (hasDevelopmentDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]) || hasDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]))\n ) {\n console.warn(\"⚠️ found use of multi-semantic-release;\");\n\n return Promise.resolve();\n }\n\n const releaseRcPath = join(projectPath, \".releaserc.json\");\n\n if (existsSync(releaseRcPath)) {\n console.warn(\"⚠️ .releaserc.json already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `{\n \"extends\": \"@anolilab/semantic-release-preset/npm\"\n}\n\n`;\n\n return writeFileAsync(releaseRcPath, content, \"utf-8\");\n};\n\n/**\n * Writes commitlint.config.js if it doesn't exist. Warns if it exists.\n */\nconst writeCommitLintConfig = () => {\n const commitlintPath = join(projectPath, \"commitlint.config.js\");\n\n if (existsSync(commitlintPath)) {\n console.warn(\"⚠️ commitlint.config.js already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n extends: [\"@commitlint/config-conventional\"],\n};\n\n`;\n\n return writeFileAsync(commitlintPath, content, \"utf-8\");\n};\n\n/**\n * Writes .czrc if it doesn't exist. Warns if it exists.\n */\nconst writeCzrc = () => {\n const filePath = join(projectPath, \".czrc\");\n\n if (existsSync(filePath)) {\n console.warn(\"⚠️ .czrc already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `{\n \"path\": \"cz-conventional-changelog\"\n}\n\n`;\n\n return writeFileAsync(filePath, content, \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n await writeReleaseRc();\n await writeCommitLintConfig();\n await writeCzrc();\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
|
package/dist/postinstall.mjs
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import { projectPath, pkg, hasDevelopmentDep, hasDep, packageIsTypeModule } from '@anolilab/package-json-utils';
|
|
3
2
|
import { writeFile, existsSync } from 'fs';
|
|
4
3
|
import { join } from 'path';
|
|
5
4
|
import { promisify } from 'util';
|
|
6
5
|
|
|
7
6
|
process.env.CI&&process.exit(0);var r=promisify(writeFile);console.log("Configuring @anolilab/semantic-release-preset",projectPath,`
|
|
8
|
-
`);var
|
|
7
|
+
`);var p=()=>{if(pkg&&(hasDevelopmentDep(["multi-semantic-release","@qiwi/multi-semantic-release"])||hasDep(["multi-semantic-release","@qiwi/multi-semantic-release"])))return console.warn("\u26A0\uFE0F found use of multi-semantic-release;"),Promise.resolve();let e=join(projectPath,".releaserc.json");return existsSync(e)?(console.warn("\u26A0\uFE0F .releaserc.json already exists;"),Promise.resolve()):r(e,`{
|
|
9
8
|
"extends": "@anolilab/semantic-release-preset/npm"
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
`,"utf-8")},
|
|
11
|
+
`,"utf-8")},u=()=>{let e=join(projectPath,"commitlint.config.js");return existsSync(e)?(console.warn("\u26A0\uFE0F commitlint.config.js already exists;"),Promise.resolve()):r(e,`${packageIsTypeModule?"export default":"module.exports ="} {
|
|
13
12
|
extends: ["@commitlint/config-conventional"],
|
|
14
13
|
};
|
|
15
14
|
|
|
@@ -17,6 +16,6 @@ process.env.CI&&process.exit(0);var r=promisify(writeFile);console.log("Configur
|
|
|
17
16
|
"path": "cz-conventional-changelog"
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
`,"utf-8")};(async()=>{try{await
|
|
19
|
+
`,"utf-8")};(async()=>{try{await p(),await u(),await w(),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
|
|
21
20
|
//# sourceMappingURL=out.js.map
|
|
22
21
|
//# sourceMappingURL=postinstall.mjs.map
|
package/dist/postinstall.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/postinstall.ts"],"names":["hasDep","hasDevelopmentDep","packageIsTypeModule","pkg","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writeReleaseRc","releaseRcPath","writeCommitLintConfig","commitlintPath","writeCzrc","filePath","error"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/postinstall.ts"],"names":["hasDep","hasDevelopmentDep","packageIsTypeModule","pkg","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writeReleaseRc","releaseRcPath","writeCommitLintConfig","commitlintPath","writeCzrc","filePath","error"],"mappings":"AAAA,OACC,UAAAA,EAAQ,qBAAAC,EAAmB,uBAAAC,EAAqB,OAAAC,EAAK,eAAAC,MAC/C,+BACP,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAEtB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,gDAAiDF,EAAa;AAAA,CAAI,EAK9E,IAAMM,EAAiB,IAAM,CACzB,GACIP,IACIF,EAAkB,CAAC,yBAA0B,8BAA8B,CAAC,GAAKD,EAAO,CAAC,yBAA0B,8BAA8B,CAAC,GAEtJ,eAAQ,KAAK,oDAA0C,EAEhD,QAAQ,QAAQ,EAG3B,IAAMW,EAAgBJ,EAAKH,EAAa,iBAAiB,EAEzD,OAAIC,EAAWM,CAAa,GACxB,QAAQ,KAAK,+CAAqC,EAE3C,QAAQ,QAAQ,GASpBF,EAAeE,EANN;AAAA;AAAA;AAAA;AAAA,EAM8B,OAAO,CACzD,EAKMC,EAAwB,IAAM,CAChC,IAAMC,EAAiBN,EAAKH,EAAa,sBAAsB,EAE/D,OAAIC,EAAWQ,CAAc,GACzB,QAAQ,KAAK,oDAA0C,EAEhD,QAAQ,QAAQ,GASpBJ,EAAeI,EANN,GAAGX,EAAsB,iBAAmB;AAAA;AAAA;AAAA;AAAA,EAMb,OAAO,CAC1D,EAKMY,EAAY,IAAM,CACpB,IAAMC,EAAWR,EAAKH,EAAa,OAAO,EAE1C,OAAIC,EAAWU,CAAQ,GACnB,QAAQ,KAAK,qCAA2B,EAEjC,QAAQ,QAAQ,GASpBN,EAAeM,EANN;AAAA;AAAA;AAAA;AAAA,EAMyB,OAAO,CACpD,GAGC,SAAY,CACT,GAAI,CACA,MAAML,EAAe,EACrB,MAAME,EAAsB,EAC5B,MAAME,EAAU,EAEhB,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASE,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["import {\n hasDep, hasDevelopmentDep, packageIsTypeModule, pkg, projectPath\n} from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/semantic-release-preset\", projectPath, \"\\n\");\n\n/**\n * Writes .releaserc.json if it doesn't exist. Warns if it exists.\n */\nconst writeReleaseRc = () => {\n if (\n pkg\n && (hasDevelopmentDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]) || hasDep([\"multi-semantic-release\", \"@qiwi/multi-semantic-release\"]))\n ) {\n console.warn(\"⚠️ found use of multi-semantic-release;\");\n\n return Promise.resolve();\n }\n\n const releaseRcPath = join(projectPath, \".releaserc.json\");\n\n if (existsSync(releaseRcPath)) {\n console.warn(\"⚠️ .releaserc.json already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `{\n \"extends\": \"@anolilab/semantic-release-preset/npm\"\n}\n\n`;\n\n return writeFileAsync(releaseRcPath, content, \"utf-8\");\n};\n\n/**\n * Writes commitlint.config.js if it doesn't exist. Warns if it exists.\n */\nconst writeCommitLintConfig = () => {\n const commitlintPath = join(projectPath, \"commitlint.config.js\");\n\n if (existsSync(commitlintPath)) {\n console.warn(\"⚠️ commitlint.config.js already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n extends: [\"@commitlint/config-conventional\"],\n};\n\n`;\n\n return writeFileAsync(commitlintPath, content, \"utf-8\");\n};\n\n/**\n * Writes .czrc if it doesn't exist. Warns if it exists.\n */\nconst writeCzrc = () => {\n const filePath = join(projectPath, \".czrc\");\n\n if (existsSync(filePath)) {\n console.warn(\"⚠️ .czrc already exists;\");\n\n return Promise.resolve();\n }\n\n const content = `{\n \"path\": \"cz-conventional-changelog\"\n}\n\n`;\n\n return writeFileAsync(filePath, content, \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n await writeReleaseRc();\n await writeCommitLintConfig();\n await writeCzrc();\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/semantic-release-preset",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Anolilab Coding Standard for semantic-release.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"postinstall": "node ./skip.js || node ./dist/postinstall.js"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@anolilab/package-json-utils": "1.
|
|
65
|
+
"@anolilab/package-json-utils": "1.4.0",
|
|
66
66
|
"@commitlint/cli": "^17.6.5",
|
|
67
67
|
"@commitlint/config-conventional": "^17.6.5",
|
|
68
68
|
"@commitlint/core": "^17.6.5",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"semantic-release-conventional-commits": "^3.0.0"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"semantic-release": "^21.0.
|
|
82
|
+
"semantic-release": "^21.0.5"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"semantic-release": "^21.0.0"
|