{"id":17242759,"url":"https://github.com/imcuttle/cc-init","last_synced_at":"2025-03-26T03:44:20.154Z","repository":{"id":32932761,"uuid":"146841380","full_name":"imcuttle/cc-init","owner":"imcuttle","description":"set commitlint \u0026 conventional-changelog quickly","archived":false,"fork":false,"pushed_at":"2022-01-07T14:02:38.000Z","size":121,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T02:33:59.176Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imcuttle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-31T04:22:16.000Z","updated_at":"2018-10-23T11:04:33.000Z","dependencies_parsed_at":"2022-08-07T18:16:38.588Z","dependency_job_id":null,"html_url":"https://github.com/imcuttle/cc-init","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fcc-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fcc-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fcc-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fcc-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcuttle","download_url":"https://codeload.github.com/imcuttle/cc-init/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245585797,"owners_count":20639671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T06:14:00.233Z","updated_at":"2025-03-26T03:44:20.132Z","avatar_url":"https://github.com/imcuttle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cc-init\n\n\u003c!--\n[![build status](https://img.shields.io/travis/imcuttle/cc-init/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/cc-init)\n[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/cc-init.svg?style=flat-square)](https://codecov.io/github/imcuttle/cc-init?branch=master)\n--\u003e\n\n[![NPM version](https://img.shields.io/npm/v/cc-init.svg?style=flat-square)](https://www.npmjs.com/package/cc-init)\n[![NPM Downloads](https://img.shields.io/npm/dm/cc-init.svg?style=flat-square\u0026maxAge=43200)](https://www.npmjs.com/package/cc-init)\n\nSet commitlint \u0026 conventional-changelog quickly\n\n## Why?\n\nI need to write and install lots of works when I want to use [`commitlint`](https://github.com/marionebl/commitlint) with [`@moyuyc/husky`](https://github.com/imcuttle/husky) and [`conventional-changelog`](https://github.com/conventional-changelog/conventional-changelog), [commitizen](https://github.com/commitizen/cz-cli) for conventional changelog.\n\n```json\n{\n  \"scripts\": {\n    \"version\": \"npm run changelog\",\n    \"changelog\": \"conventional-changelog -p angular -i CHANGELOG.md -s -r 0 \u0026\u0026 git add CHANGELOG.md\"\n  },\n  \"husky\": {\n    \"hooks\": {\n      \"commit-msg\": \"commitlint -e $HUSKY_GIT_PARAMS\"\n    }\n  },\n  \"commitlint\": {\n    \"extends\": [\"@commitlint/config-conventional\"]\n  },\n  \"config\": {\n    \"commitizen\": {\n      \"path\": \"./node_modules/foo\"\n    }\n  }\n  \"devDependencies\": {\n    \"@commitlint/cli\": \"^7.1.1\",\n    \"@commitlint/config-conventional\": \"^7.1.1\",\n    \"conventional-changelog-cli\": \"^2.0.5\",\n    \"@moyuyc/husky\": \"^1.1.1\"\n  }\n}\n```\n\nSo the package can help you setting commitlint \u0026 conventional-changelog quickly.\n\n## Usage\n\n### CLI\n\n```bash\nnpm install cc-init -g\n# or use yarn\nyarn global add cc-init\ncc-init -h\n```\n\n### Package\n\n```javascript\nimport ccInit from 'cc-init'\nccInit(cwd, {\n  // ...options\n})\n```\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### cli\n\n[bin.js:32-41](https://github.com/imcuttle/cc-init/blob/43ab0cb7f675ecd0c88ab37001752f7b93981af9/bin.js#L32-L41 'Source code on GitHub')\n\n```bash\nexport CHANGELOG_PRESET=@baidu/befe\nexport CHANGELOG_PRESET_PKGNAME=@baidu/conventional-changelog-befe\nexport COMMITIZEN_ADAPATOR=@baidu/cz-conventional-changelog-befe\nexport NPM_REGISTRY=http://registry.npm.baidu-int.com\nexport COMMITLINT_PRESET=@baidu/commitlint-config-befe\n# Preset the default values\ncc-init\n```\n\n### ccInit\n\n[index.js:36-166](https://github.com/imcuttle/cc-init/blob/43ab0cb7f675ecd0c88ab37001752f7b93981af9/index.js#L36-L166 'Source code on GitHub')\n\nmake commitlint, husky and conventional-changelog getting along harmoniously together.\n\n#### Parameters\n\n- `cwd` {string} - the project's root path\n- `opts` {{}}\n  - `opts.commitizenAdaptor` {string|null} (optional, default `null`)\n  - `opts.commitizenInGlobal` {boolean} (optional, default `true`)\n  - `opts.changelogPresetPkgName` {string}\n    the custom changelog preset package's name should be installed\n    like `@scoped/conventional-changelog-foo` (optional, default `''`)\n  - `opts.changelogPreset` {string}\n    [conventional-changelog](https://github.com/conventional-changelog)'s preset\n    like `@scoped/foo` (optional, default `'angular'`)\n  - `opts.registry` {string} the npm's registry (optional, default `''`)\n  - `opts.commitlintPreset` {string}\n    the [commitlint](https://github.com/marionebl/commitlint)'s preset config (optional, default `'@commitlint/config-conventional'`)\n  - `opts.force` {boolean} - overwrite the existed config and devDependencies in `package.json`\n  - `opts.stdio` {string}\n    the [stdio](https://nodejs.org/dist/latest-v7.x/docs/api/child_process.html#child_process_options_stdio) of npm install process (optional, default `'inherit'`)\n\nReturns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fcc-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcuttle%2Fcc-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fcc-init/lists"}