Pull requests, bug reports, and all other forms of contribution are welcomed and highly encouraged!
This guide serves to set clear expectations for everyone involved with the project so that we can improve it together while also creating a welcoming space for everyone to participate. Following these guidelines will help ensure a positive experience for contributors and maintainers.
Please review our Code of Conduct. By participating, you are expected to uphold this code.
If you have any question that does not relate to a bug or a feature request, please use GitHub Discussions instead of GitHub issues.
If you encounter a problem with this library or if you have a new feature you'd like to see in this project, please create a new issue.
- Clone the repository
- Make sure, you use the same node version for your project and the spartacus-mock, to make npm link work
- Make sure, you have the compiled spartacus libraries somewhere available (SAP RBSC via S-User Token) or self hosted on a Gitlab Private Repo
- Add an
.npmrc
file containing the credentials - Run
npm install
in the root of this project to install the angular lib dependencies
- Do your changes in the mock-data
- Go to the dist folder of the package
cd dist/spartacus-mock
- Run
npm link
in the dist folder to be able to use the current dev version of the library in your spartacus project - Go back to the project root
cd ../..
- Run
npm run watch
to start the watch mode - When you're done, make a pull request with your changes
- Do your changes in the schematics in
projects/spartacus-mock/schematics
- Run
npm run build
inprojects/spartacus-mock
to build the schematics - When you're done, make a pull request with your changes
- Make sure, the build (or watch) tasks have been run for both the lib and the schematics
- For the schematics, the build task needs to be run once to copy the
collection.json
to the dist folder
- For the schematics, the build task needs to be run once to copy the
- Make sure to use the same node versions for spartacus-mock and your test project to make npm link work
- Make sure to remove "@valantic/spartacus-mock" from the package.json of your test project since it get's linked via symlink
- Run
npm link
in the folderdist/spartacus-mock
of this library to be able to use the current dev version of the library in your spartacus project - Run
npm link @valantic/spartacus-mock
in your spartacus project's root folder to link the dev version of the library - Run
ng add @valantic/spartacus-mock
in your spartacus project's root folder to add the library and run the schematics - Run
npm link @valantic/spartacus-mock
again, since runningng add
seems to delete the link
- Follow the steps in the page https://update.angular.io/?l=3&v=14.0-15.0 to update the angular version
- Test if it still works with the current demo electronics store of spartacus
- Run
npm run build
in the root of this project to build the angular lib - Run
npm run build
inprojects/spartacus-mock
to build the schematics
- Switch to the current Release branch
- Merge the current main branch into the release branch
- Describe your changes in the file CHANGELOG.md
- Move all changes in the file CHANGELOG.md from below
## Next
below a new Paragraph with the to be released version - Change the Version in the package.json of the angular lib
- If new files within the docs folder have been added or changed, make sure, they are listed in the SUMMARY.md, see here
- Build the library and the schematics according to the steps above at
## Build the library
- Create a Git Tag with the to be released version number
git tag x.x.x
- Commit and Push the changes to the remote (Make sure to also push Tags
git push origin --tags
) - Open the terminal and go to the folder
dist/spartacus-mock
- Login to NPM
npm login
if you not already are logged in - Push the Release
npm publish --access public
- Create the Release on the github repo with the changes from the CHANGELOG.md
- Attach the zip file from the dist folder to the release in github
- Test if the release works with the spartacus demo project
- Check if the Gitbook pages have updated correctly
- If sync did not happen automatically, go to app.gitbook.com
- Click on the 3 dots next to the edit button in the top bar
- Click Synchronize with git
- Scroll down and click Sync