- Node.js ^20.9.0 (check
.nvmrcfile for more information) - Angular CLI 17.3.11
- NPM 10.9.2
- Docker (optional, without Docker, you need to install
verdacciolocally)
- Run
verdaccioin Docker - it will expose a local registry athttp://localhost:4873- start at the root of this project
cd verdacciodocker compose up -d(ordocker-compose up -dfor older versions)
- Set up local registry
- check whether local registry is accessible http://localhost:4873
- create registry user -
npm adduser --registry http://localhost:4873and follow interactive commands - (optional) if the user already exists, you can login -
npm login --registry http://localhost:4873
- Set up Spartacus source code
- start at the root of this project
git clone https://github.com/SAP/spartacus.git spartacus-sourcecd spartacus-sourcegit checkout release-2211.32.1npm install && npm run build:libsnpm run start- visit
http://localhost:4200to check if Spartacus core works correctly - after confirming that Spartacus core works, you can close the terminal
- Publish Spartacus source code to local registry
- start inside of
spartacus-source/folder npm i -g ts-nodets-node ./tools/schematics/testing- select
publish
- start inside of
- Prepare Angular application
- start at the root of this project
- (optional)
npm i -g @angular/[email protected] ng new spartacus-app --style=scss --routing=false --standalone=false- select
nofor SSR cd spartacus-app
- Configure local registry
- create
.npmrcfile (inspartacus-appdirectory) - add configuration -
@spartacus:registry=http://localhost:4873
- create
- Install Spartacus
ng add @spartacus/schematics- press
enterwhen asked for libraries to install npm i- change
baseUrlinspartacus-app/src/app/spartacus/spartacus-configuration.module.tstohttps://composable-storefront-demo.eastus.cloudapp.azure.com:8443(Spartacus demo instance) npm start
- For Windows users:
- You might need to replace
../../node_modules/.bin/with''(empty string), because Windows is not recognizing relative paths to npm packages - There might be an issue with styles, because of forward/backward slash - check
/styles/spartacus/*.scssfiles - Installation might fail if you have spaces in your folder names
- You might need to replace
- Verdaccio unpublishing:
- In case of any issues, you can remove published packages, like so:
npm unpublish --force [package_name] --registry http://localhost:4873
- In case of any issues, you can remove published packages, like so:
This project uses components licensed under the Apache License 2.0.
- Spartacus - Used for setting up a sandbox environment for training purposes