When contributing to this repository, please first discuss the change you wish to make with the owners of this repository via issue, email, or any other method before making a change.
Please note that we have a code of conduct and code guidelines. Please follow it in all your interactions regarding the project.
In order to test your changes without having them published on master, you
can use yarn link
feature:
- Ensure you have uninstalled existing
generator-liferay-fragments
from global Yarn and NPM dependencies. cd yourToolkitProjectDirectory
.yarn link
(this only has to be runned once, runyarn unlink
to undo).yarn build
(to generate files needed to create the project in next step).- Create a new fragments project by typing
yo ./yourToolkitProjectDirectory/generators/app
where you want to create it. cd yourFragmentsProjectDirectory
yarn link generator-liferay-fragments
- Now you can use Yeoman and Yarn commands normally, it will use your local toolkit project.
In order to test your changes, you have to compile your typescript code with
yarn build
. You can also doyarn build --watch
so it listens any change and compiles each time you change something your code.
Sometimes, when using multiple NodeJS environments (ex. nvm), Yeoman
might resolve a different version of the Toolkit that is installed globaly.
To be sure about which generator is being executed, you can pass
--show-debug-info
flag to any command, and it will output the generator
information and received arguments.
If you are still having unexpected issues, double check that you are using the
correct version of Yeoman. You can check global dependencies using
npm list -g -d 0
or yarn global list
, and uninstall them with
npm uninstall -g yo
and yarn global remove yo
. Also you can find which
Yeoman binary is being used with which yo
and following the corresponding
symlinks. To prevent issues with the global Yeoman dependency, ensure you
always know where it has been installed.
We use semver for every release, but we may publish more requests at once. Currently we are trying to publish new versions just before Liferay Portal GA releases, but new releases can be published if we need some fix or feature to be available.
All CLI features must be compatible with all Liferay Portal versions: if they depend on some portal feature (API call ,service), they should fail gracefully and so a nice error, but never break anything.
- Create a new branch and add changes if needed:
docs: x
update outdated documentation.build: Update/Remove x
update dependencies (yarn audit
,yarn outdated
, etc.).test: x
fix tests if neccesary.fix: x
fix something if needed.build: Prepare release vX.X.X
updatepackage.json
.
- Create a pull request and merge into master.
- Create a new release:
- Create
vX.X.X
tag format (same for release title). - Write the changelog in the release description (an initial draft can be
generated with
npx conventional-changelog-cli -p angular -r 2
.
- Create
- Checkout created tag locally (
git fetch origin && git checkout vX.X.X
). yarn publish
release tonpmjs.com
.
In case of publishing a pre-release in order to test some new functionallity, the steps are the same than publishing a regular release, except:
- The package version and tag name will be
vX.X.X-rcY
, beingX.X.X
the future stable version (ex.2.12.1
) andY
an incremental number starting from 1 (v2.12.1-rc1
,v2.12.1-rc2
...). yarn publish --tag next
should be run instead ofyarn publish
, to avoid overriding existing stable release.
When you create your contribution, please keep this list in mind:
- Start from the existing master branch and add your changes. Use conventional commits to write your commit messages.
- Create your contribution.
- Ensure any install or build dependencies are removed before the end of the layer when doing a build.
- Add tests if necessary.
- Ensure that it passes all tests and linting process and includes JSDocs.
- Update the README.md with details of changes to the interface, this including new parameters, behaviour or even generators.
- Do not change the version number manually (see Release Cycle).
- Create your pull request against master branch and resolve any conflicts if necessary.