Giter VIP home page Giter VIP logo

cz-customizable's People

Contributors

bblackwo avatar chinesedfan avatar creabine avatar den-dp avatar dependabot[bot] avatar dmwelch avatar dudekaa avatar guria avatar jimthedev avatar jvanbruegge avatar leonardoanalista avatar manudeli avatar maple-leaf avatar mauricekleine avatar mlix8hoblc avatar moperacz avatar politician avatar promet99 avatar robpre avatar romanminkin avatar rylek90 avatar smollweide avatar storageddd avatar tibebejs avatar trodi avatar vfonic avatar webdevian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cz-customizable's Issues

Add possibility to leave subject capitilized

Since, there's a rule https://conventional-changelog.github.io/commitlint/#/reference-rules?id=subject-case to enforce subject's case.

For people using cz-customizable along with commitlint it'd be nice to have possibility to leave subject as is (do not make it lowercase).

AC:

  • Add { lowerCaseSubject } with default true to configuration.
  • When loweCaseSubject === false do not transform subject from This is subject to this is subject

I can push a PR for this soon if no one will pick this.

Add Typescript Support

I recently used cz-customizable in a Typescript project. Instead of writing the config in javascript, I opted to write it in Typescript. I wrote the corresponding definition typings file to get type safety. Ideally these files live with and thus synced with their project, therefore I'd like to make a pull request to add them to cz-customizable. If your config object changed going forward, we'd update these typing at the same time.

Changes would include:

  • typings property added to the package.json
  • new d.ts file at root

If this is outside the scope of your project, I'll add them to the official typings repo: DefinitelyTyped. This would just require consumers to add an additional dependency when consuming cz-customizable with Typescript.

display better message when there is no semantic tag

When you run corp-semantic-release the first time in drymode, message is not very clear about what is going on.

Message should say it is the first time and a new tag will be created with version v1.0.0.

This aligns with our father semantic-release as the initial release should be always v1.0.0

@uglow thanks for the feedback

Add Typescript support

We would like to explore Typescript and this project is open for suggestion on how to improve the code with types.

Add option to ask for breaking change as first question

Rob @rpocklin,

What do you think could be the default answer when option askForBreakingChangeFirst is set to true?

If we think that a breaking change is not going to happen very often, a sensible default answer would be in my opinion 'no'. This way, you get the question for breaking changes and if you hit enter, it assumes 'no' and go to next question. Do you think this is a good behaviour?

Leonardo

Custom order of messages in commit

Is there a way to change the order of how the messages are put into the commit message?
For example if I want the appendBranchNameToCommitMessage right in the first line?

add verification when scopeOverrides is not specified in config

app should nicely handle when user doesn't specify this variable on .cz-config.js. E.g.:

module.exports = {

  types: [
    {value: 'feat',     name: 'feat:     A new feature'},
    {value: 'fix',      name: 'fix:      A bug fix'},
    {value: 'docs',     name: 'docs:     Documentation only changes'},
    {value: 'style',    name: 'style:    Changes that do not affect the meaning of the code\n            (white-space, formatting, missing semi-colons, etc)'},
    {value: 'refactor', name: 'refactor: A code change that neither fixes a bug nor adds a feature'},
    {value: 'perf',     name: 'perf:     A code change that improves performance'},
    {value: 'test',     name: 'test:     Adding missing tests'},
    {value: 'chore',    name: 'chore:    Changes to the build process or auxiliary tools\n            and libraries such as documentation generation'},
    {value: 'revert',   name: 'revert:   Revert to a commit'},
    {value: 'WIP',      name: 'WIP:      Work in progress'}
  ],

  scopes: [
    {name: 'whatever'},
  ],

 // scopeOverrides: {
 // }

}

create symlink on postinstall script

The symlink is a way to getting around the require(../../.cz-config).

If you know a better way please let me know. I definitelly want to learn how to do this better

Linux ln -nsf ../../.cz-config.js node_modules/cz-customizable/.cz-config.js
Windows (something like this): mklink /D node_modules\cz-customizable\.cz-config.js ..\..\.cz-config.js

eat own dog food

We can use cz-customizable instead cz-conventional-changelog. I will prepare a PR but I need list of scopes

automatically add word "closes" when appropriated

Propose change prompted question from:
List any ISSUES CLOSED by this change (optional):,
to
``List any ISSUES CLOSED by this change. E.g.: #[number], #[n] and #[z] (optional):`

If user enters anything on close issues, this tool should automatically add the word "Closes:".

According to the changelog specs, footer is composed by 'breaking changes' and 'closed issues' in this order.

This is a possible breaking change as it changes the way uses enter footer info.

Permit refactor/chore/docs to be versionable

Currently, adding a refactor commit will not allow for a release. I don't like this behaviour, as it makes the assumption there are no bugs or other benefits in the refactor, which may be true, but you may need or want to bump the version.

This should be customisable so that the user can release a version even though it only has a 'refactor' commit in it.

Can you add a License?

Hello,

I found this project really useful and hope to use it at my day job. I noticed that you don’t have any open source license in your repo. Any chance you’d consider adding one? MIT or Apache2 would likely be perfect.

Thanks so much!"

How can you use this adapter alongside another?

I’m also using cz-conventional-changelog. Is it possible to use both alongside each other? This is my package.json config:

"config": {
  "commitizen": {
    "path": "cz-conventional-changelog"
  },
  "cz-customizable": {
    "config": "internals/scripts/commitizen/commitizen-customizable.js"
  }
},

Make it possible to specify location of config file via package.json

It would be great if the location of the config could be customised. E.g.

//package.json
  ...
  "config": {
    "commitizen": {
      "path": "node_modules/cz-customizable"
    },
    "cz-customizable": {
      "config": "config/path/to/my/config.js"
    }
  }
  ...

This helps keep the project root directory less cluttered with config files.

Support multiple repositories

I usually work in a vscode workspace and there's always multiple repository folders that I am navigating. If you try to commit from a workspace, it will give you an error:

screenshot 2018-03-17 20 14 44

Logs the devtools:

Command failed: git commit -m build(fail): This will fail fatal: Not a git repository (or any of the parent directories): .git

If you use the standard commit package from vscode, the first thing it does is to ask for the repository. This might be a good additional feature to add to this project to support working in workspaces.

Error when trying to run for the first time

Hy,

I'm having a problem using cz-customizable. I followed the README but I'm receiving the following error:

[email protected], [email protected]



Line 1 will be cropped at 100 characters. All other lines will be wrapped after 100 characters.

(node:69005) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: You must provide a `choices` parameter
(node:69005) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

With configuration as:

package.json

"scripts": {
    ...,
    "commit": "npx git-cz"
  },
 "devDependencies": {
   ...,
    "commitizen": "^3.1.1",
    "cz-conventional-changelog": "^2.1.0",
    "cz-customizable": "^6.0.0",
  },
"config": {
    "commitizen": {
      "path": "node_modules/cz-customizable"
    }
  }

.cz-config.js

module.exports = {
  typePrefix: '[',
  typeSuffix: ']'
};

Question mark prefix is on a different line than the question itself

cz-cli displays the '?' and the question on the same line so I assume you intended to keep that behavior. Because your menu config has newlines as the first character, it leaves the '?' on its own line and looks funny.

Otherwise, nice job. I think this project deserves a little more attention because it's definitely helpful.

screen shot 2016-03-07 at 6 41 03 pm

Unable to find configuration file.

I’ve gone with the local install of commitizen for my project. It runs fine when I use the pure version, but when installing and implementing cz-customizable I get error messages regarding my configuration file.

[email protected], [email protected]

warn: Unable to find a configuration file. Please refer to documentation to learn how to ser up: https://github.com/leonardoanalista/cz-customizable#steps "
info:

Line 1 will be cropped at 100 characters. All other lines will be wrapped after 100 characters.

/Users/durham/Sites/hco-web-frontend/node_modules/cz-customizable/questions.js:17
    config.scopeOverrides = config.scopeOverrides || {};
                                  ^

TypeError: Cannot read property 'scopeOverrides' of undefined
    at Object.getQuestions (/Users/durham/Sites/hco-web-frontend/node_modules/cz-customizable/questions.js:17:35)
    at prompter (/Users/durham/Sites/hco-web-frontend/node_modules/cz-customizable/index.js:42:44)
    at /Users/durham/Sites/hco-web-frontend/node_modules/commitizen/dist/commitizen/commit.js:73:9
    at /Users/durham/Sites/hco-web-frontend/node_modules/commitizen/node_modules/fs-extra/lib/mkdirs/mkdirs.js:54:16
    at FSReqWrap.oncomplete (fs.js:123:15)
error Command failed with exit code 1.

I pasted the example config from this project into my project:

module.exports = {
	types: [
		{ value: 'feat', name: 'feat: A new feature' },
		{ value: 'fix', name: 'fix: A bug fix' },
		{ value: 'docs', name: 'docs: Documentation only changes' },
		{ value: 'style', name: 'style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)' },
		{ value: 'refactor', name: 'refactor: A code change that neither fixes a bug nor adds a feature' },
		{ value: 'perf', name: 'perf: A code change that improves performance' },
		{ value: 'test', name: 'test: Adding missing tests' },
		{ value: 'chore', name: 'chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation' },
		{ value: 'revert', name: 'revert: Revert to a commit' },
		{ value: 'WIP', name: 'WIP:  Work in progress' }
	],

	scopes: [
		{ name: 'accounts' },
		{ name: 'admin' },
		{ name: 'exampleScope' },
		{ name: 'changeMe' }
	],

	// it needs to match the value for field type. Eg.: 'fix'
	/*
	scopeOverrides: {
		fix: [
			{ name: 'merge' },
			{ name: 'style' },
			{ name: 'e2eTest' },
			{ name: 'unitTest' }
		]
	},
	*/
	allowCustomScopes: true,
	allowBreakingChanges: ['feat', 'fix']
};

This is located in an internals directory just inside the root of the project.

then this is the config in my package.json file:

  "config": {
    "commitizen": {
      "path": "./node_modules/cz-customizable"
    }
  },
  "cz-customizable": {
    "config": "./internals/cz-config.js"
  }

Is there anything I’m doing wrong?

Feature request: Ask for ticket-number

In many projects jira or something similar is used.
It would be great to ask the user for the ticket number.
The result could be: fix(scope): Ticket-1234 subject

Thanks for this project 👍

postinstall in dev env

postinstall script in dev environment tries to create config file on 2 levels up. Seems it supposed to be a project root. But in dev environment (git clone [email protected]:leonardoanalista/cz-customizable.git + npm i) it is not true since current folder is top level project. In my case it tries to write file at /home/.cz-config.js and fails.

allow breaking changes only for feat

This up for a discussion so your opinion is important:

As we know, semantic-release will detect the word BREAKING CHANGE and bump version to major.

Maybe cz-customizable should not allow the words BREAKING CHANGE on footer if commit type is for example refactor or docs.

I think word closes should be allowed but not BREAKING CHANGE.

What do you guys think?

stop being a fork

There are some issues when project is fork on github:

  • forked repositories are not currently searchable
  • when creating PR it uses commitizen/cz-conventional-changelog as base for merge

Prefill ticket number answer automatically

Hi,

I created a script that adds ticketNumberPrefix and ticketNumber automatically but ticketNumber is required otherwise the final commit appears to be empty.

cz-customizable standalone version


Line 1 will be cropped at 100 characters. All other lines will be wrapped after 100 characters.

? Select the type of change that you're committing: feat:     A new feature
? 
Choose the SCOPE of this change (optional): my-component
? Enter the ticket number:
 
? Write a SHORT, IMPERATIVE tense description of the change:
 
? List any BREAKING CHANGES (optional):
 
? List any ISSUES CLOSED by this change (optional). E.g.: #31, #34:
 

###--------------------------------------------------------###
feat(my-component): 
###--------------------------------------------------------###

? Are you sure you want to proceed with the commit above? (Yneh) 

In the buildCommit.js the if condition returns ''

const addTicketNumber = (ticketNumber, config) => {
  if (!ticketNumber) {
    return '';
  }
  ...
};

Is it possible to have some sort of 'ticketNumberValue' that doesn't ask anything but instantiate the variable ticketNumber?

standalone version of cz-customizable

This project started as an adapter to commitizen. There is a possibility to run the same adapter in a stantd-alone version - without installing commitizen.

Here are requirements:

  • additional command line option to run in standalone mode
  • no changes to the way it currently runs as commitzen adapter
  • possibly way to run as npm script:
  ...
  "build": "your build script"
  "commit": "./node_modules/cz-customizable/standalone"

I think the newer version of conventional-changelog has changed the footerPrefix

Hi @leonardoanalista , I've noticed that for a commit like this:

fix(radar): reimplement add blip function while in RFC mode

ISSUES CLOSED: #RAD-658

... the latest version of corp-semantic-release does not create a link in the changelog (when using conventional-changelog-angular-bitbucket, and I suspect, other presets)

If you see here, the keywords for detecting issues do not include 'ISSUES CLOSED:'.

After amending the commit to:

fix(radar): reimplement add blip function while in RFC mode

Closes #RAD-658

... I get the correct(?) output in the changelog:

* **radar:** reimplement add blip function while in RFC mode ([ab8fed2](https://repo.com.au/projects/in/repos/repo-name/commits/ab8fed2)), closes [#RAD-658](https://www.atlassian.net/browse/RAD-658)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.