Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Bootstrap dependency #19810

Merged
merged 63 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
8b4da66
[POC] Remove bootstrap from Spartacus
pawelfras Sep 30, 2024
7021c7c
chore: Upgrade to Angular 18 - NX Migration
pawelfras Nov 25, 2024
1aab1a4
chore: Upgrade to Angular 18 - Angular CLI migration
pawelfras Nov 25, 2024
da09c85
chore: Upgrade to Angular 18 - Angular packages migration
pawelfras Nov 25, 2024
09fed9b
chore: Upgrade to Angular 18 - update ng-packagr to 18.2.1
pawelfras Nov 25, 2024
3a08381
chore: Upgrade to Angular 18 - NgRx upgrade
pawelfras Nov 25, 2024
bb3dfb5
chore: Upgrade to Angular 18 - Upgrade Angular-related libraries
pawelfras Nov 26, 2024
a3efbbc
chore: Upgrade to Angular 18 - Linting
pawelfras Oct 16, 2024
09def4a
chore: Upgrade to Angular 18 - Fix build issues
pawelfras Oct 10, 2024
36d1d73
chore: Upgrade TypeScript ESLint packages
pawelfras Nov 26, 2024
0d87021
chore: Prettier fix
pawelfras Nov 26, 2024
9a4c7e9
fix: Issues raised by unit tests
pawelfras Oct 14, 2024
ea7caf7
Add license header
github-actions[bot] Nov 26, 2024
fae4573
fix typo
pawelfras Nov 26, 2024
5734b1b
chore: update dependencies
pawelfras Nov 26, 2024
1518aee
fix: Issues raised by schematics unit tests
pawelfras Nov 26, 2024
d0a6754
fix: Issues raised by schematics unit tests
pawelfras Nov 26, 2024
d657d33
chore: Upgrade to Angular 18 - Linter For Styles
pawelfras Oct 28, 2024
2c0b621
fix: Issues raised by E2E tests
pawelfras Nov 27, 2024
c860074
chore: Upgrade to Angular 18 - Replace deprecated TSESLint.RuleTester
pawelfras Nov 18, 2024
41ff83e
fix: Schematics issues
pawelfras Nov 15, 2024
5a38094
chore: Upgrade to Angular 18 - Replace deprecated RouterTestingModule
pawelfras Nov 15, 2024
9a2cbef
chore: Migration docs
pawelfras Nov 28, 2024
5a15804
refactor after review
pawelfras Dec 9, 2024
aa18bcd
update package-lock file
pawelfras Dec 9, 2024
880b121
Merge branch 'develop-next-major' into epic/upgrade-to-angular-18
pawelfras Dec 9, 2024
ca64f33
Merge branch 'develop-next-major' into epic/upgrade-to-angular-18
pawelfras Dec 9, 2024
97a7ad8
fix stylelint issue
pawelfras Dec 10, 2024
b4865a5
Merge remote-tracking branch 'origin/poc-remove-bootstrap' into chore…
kpawelczak Dec 10, 2024
be03907
Update extra-webpack.config.js
kpawelczak Dec 11, 2024
2244194
Update bootstrap.scss
kpawelczak Dec 11, 2024
5389096
Merge branch 'develop-next-major' into chore/CXSPA-9094-remove-bootsrap
kpawelczak Dec 17, 2024
6bdbab6
- Added Bootstrap SCSS imports in `styles.scss`
Platonn Dec 17, 2024
0decd69
Refactor modal dialogs to use Bootstrap in HTML instead custom CSS cl…
Platonn Dec 17, 2024
5f26018
Import '@spartacus/styles/scss/core' in the storefrontapp BEFORE impo…
Platonn Dec 17, 2024
7f46595
package-lock.json
kpawelczak Dec 19, 2024
fda646d
prettier fix
kpawelczak Dec 20, 2024
2cc93dd
Add license header
github-actions[bot] Jan 2, 2025
b0afc4d
Revert "Add license header"
kpawelczak Jan 2, 2025
dcf31e6
Merge branch 'develop-next-major' into bootstrap-spa-copy-headers
kpawelczak Jan 2, 2025
010afb9
test and fix dialogs affected by the removal of extended bootstrap cl…
Pio-Bar Jan 7, 2025
0daa7ed
fix package-lock
kpawelczak Jan 7, 2025
894804b
Merge branch 'epic/CXSPA-9094-bootstrap' of https://github.com/SAP/sp…
kpawelczak Jan 7, 2025
64abdfb
move to vendor
kpawelczak Jan 7, 2025
3850b1e
update deps
kpawelczak Jan 7, 2025
bd7b987
Create bootstrap.md
kpawelczak Jan 7, 2025
7840e87
Update _image.scss
kpawelczak Jan 7, 2025
d64c33a
Update _image.scss
kpawelczak Jan 7, 2025
f94b44c
fix style errors
kpawelczak Jan 7, 2025
2f39a22
Update index_spec.ts.snap
kpawelczak Jan 7, 2025
7e87602
no bootstrap spartacus installation (#19797)
kpawelczak Jan 8, 2025
d0b289e
add bootstrap license (#19801)
kpawelczak Jan 9, 2025
0689bfd
rm imports
kpawelczak Jan 9, 2025
f554f79
Update project.json
kpawelczak Jan 9, 2025
ceb3fa2
Fix failing e2e b2b-user-register (#19855)
kpawelczak Jan 16, 2025
0b99010
Merge branch 'develop-next-major' into epic/CXSPA-9094-bootstrap
kpawelczak Jan 16, 2025
fd138eb
Fix organization styles after removal of @extend btn (#19849)
kpawelczak Jan 16, 2025
b1a08b4
Remove bootstrap imports from feature libs (#19853)
kpawelczak Jan 16, 2025
92c4197
Merge branch 'develop-next-major' into epic/CXSPA-9094-bootstrap
kpawelczak Jan 17, 2025
acc7fe9
Update package-lock.json
kpawelczak Jan 17, 2025
5b17dc0
Update bootstrap.md
kpawelczak Jan 17, 2025
3619283
Merge branch 'develop-next-major' into epic/CXSPA-9094-bootstrap
kpawelczak Jan 20, 2025
abd3317
Update package-lock.json
kpawelczak Jan 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ feature-libs/smartedit/assets/webApplicationInjector.js
coverage

/.nx/cache
/.nx/workspace-data
/.nx/workspace-data
projects/storefrontstyles/vendor/**/*.scss
10 changes: 8 additions & 2 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@
"margin-inline"
],
"declaration-property-value-disallowed-list": {
"text-align": ["right", "left"]
"text-align": [
"right",
"left"
]
},
"scss/comment-no-loud": true
}
},
"ignoreFiles": [
"projects/storefrontstyles/vendor/**/*.scss"
]
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,3 @@ Many improvements are coming! All tasks will be posted to our GitHub issue track

Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE](LICENSE) file.

76 changes: 76 additions & 0 deletions docs/migration/2211_ng18/bootstrap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Spartacus migration - Bootstrap

1. Uninstall Bootstrap
If the bootstrap package is still installed in your project, uninstall it to avoid conflicts. Use
the following command:
```npm uninstall bootstrap```
2. Update `styles.scss`
Modify the `styles.scss` file to integrate Spartacus styles along with Bootstrap. Proper import order is critical for
styles to be applied correctly.
### Steps to Update:
1. Place the following import for styles-config at the top of the file:
```@import 'styles-config';```
2. Add Spartacus core styles first. Importing Spartacus styles before Bootstrap ensures core styles load as a
priority.
3. Follow this by importing Bootstrap styles using the Bootstrap copy provided by Spartacus. Ensure the order of
Bootstrap imports matches the sequence below for consistency.
4. Conclude with the Spartacus index styles.


Final file structure should look like this:

```styles.scss
// ORDER IMPORTANT: Spartacus core first
@import '@spartacus/styles/scss/core';

// ORDER IMPORTANT: Bootstrap next
@import '@spartacus/styles/vendor/bootstrap/scss/reboot';
@import '@spartacus/styles/vendor/bootstrap/scss/type';
@import '@spartacus/styles/vendor/bootstrap/scss/grid';
@import '@spartacus/styles/vendor/bootstrap/scss/utilities';
@import '@spartacus/styles/vendor/bootstrap/scss/transitions';
@import '@spartacus/styles/vendor/bootstrap/scss/dropdown';
@import '@spartacus/styles/vendor/bootstrap/scss/card';
@import '@spartacus/styles/vendor/bootstrap/scss/nav';
@import '@spartacus/styles/vendor/bootstrap/scss/buttons';
@import '@spartacus/styles/vendor/bootstrap/scss/forms';
@import '@spartacus/styles/vendor/bootstrap/scss/custom-forms';
@import '@spartacus/styles/vendor/bootstrap/scss/modal';
@import '@spartacus/styles/vendor/bootstrap/scss/close';
@import '@spartacus/styles/vendor/bootstrap/scss/alert';
@import '@spartacus/styles/vendor/bootstrap/scss/tooltip';

@import '@spartacus/styles/index';
```
3. Individual imports.
If your application directly imports specific Bootstrap classes in any of your stylesheets, replace those imports with the corresponding Spartacus imports. For example:
```
// Original import
@import '~bootstrap/scss/reboot';

// Replace with
@import '@spartacus/styles/vendor/bootstrap/scss/reboot';
```

4. Some libraries have stopped importing Bootstrap-related styles. Instead, these styles should now be imported directly within the application. For example, the lib-cart.scss file should include the following imports:
```scss
// original imports
@import '../styles-config';
@import '@spartacus/cart';
// new imports
@import '@spartacus/styles/vendor/bootstrap/scss/functions';
@import '@spartacus/styles/vendor/bootstrap/scss/variables';
@import '@spartacus/styles/vendor/bootstrap/scss/_mixins';
```
Affected libraries:
- cart
- checkout
- organization
- pick-up-in-store
- product
- product-multi-dimensional
- qualtrics
- quote
- storefinder
- epd-visualization
- opf
4 changes: 0 additions & 4 deletions feature-libs/cart/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
@import '@spartacus/styles/scss/cxbase/blocks/modal';
@import '@spartacus/styles/scss/misc/table';

@import 'bootstrap/scss/functions';
@import 'bootstrap/scss/variables';
@import 'bootstrap/scss/_mixins';

@mixin visible-focus {
outline-style: solid;
outline-color: var(--cx-color-visual-focus);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div
[cxFocus]="focusConfig"
(esc)="close('Escape clicked')"
class="cx-clear-cart-dialog"
class="modal-dialog modal-dialog-centered cx-clear-cart-dialog"
role="dialog"
aria-labelledby="dialogTitle"
>
<div class="cx-clear-cart-container">
<div class="modal-content cx-clear-cart-container">
<ng-container *ngIf="!isClearing; else loading">
<div
*cxFeature="'!a11yRemoveStatusLoadedRole'"
Expand Down Expand Up @@ -43,7 +43,7 @@
</div>

<!-- Modal Body -->
<div class="cx-clear-cart-body">
<div class="modal-body cx-clear-cart-body">
<div class="clear-cart-msg">
{{ 'clearCart.allItemsWillBeRemoved' | cxTranslate }}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
background-color: rgba(0, 0, 0, 0.5);

.cx-clear-cart-dialog {
@extend .modal-dialog;
@extend .modal-dialog-centered;

.cx-clear-cart-container {
@extend .modal-content;

.cx-clear-cart-header {
.cx-clear-cart-title {
font-size: var(--cx-font-size, 1.375rem);
Expand All @@ -17,8 +12,6 @@
}

.cx-clear-cart-body {
@extend .modal-body;

.clear-cart-msg {
margin-bottom: 1.5rem;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div
[cxFocus]="focusConfig"
(esc)="close('Escape clicked')"
class="cx-import-entries-dialog"
class="modal-dialog modal-dialog-centered cx-import-entries-dialog"
role="dialog"
aria-labelledby="dialogTitle"
>
<div class="cx-import-entries-container">
<div class="modal-content cx-import-entries-container">
<!-- Modal Header -->
<div class="modal-header cx-import-entries-header">
<ng-container>
Expand Down Expand Up @@ -43,12 +43,14 @@
<ng-container *ngIf="context$ | async as context">
<ng-container *ngIf="formState; else importSummary">
<cx-import-to-new-saved-cart-form
class="modal-body"
*ngIf="isNewCartForm(context); else reducedForm"
[type]="context.type"
(submitEvent)="importProducts(context, $event)"
></cx-import-to-new-saved-cart-form>
<ng-template #reducedForm>
<cx-import-entries-form
class="modal-body"
[type]="context.type"
(submitEvent)="importProducts(context, $event)"
></cx-import-entries-form>
Expand All @@ -57,6 +59,7 @@

<ng-template #importSummary>
<cx-import-entries-summary
class="modal-body"
[summary]="summary$ | async"
[type]="context.type"
(closeEvent)="close('Close Import Products Dialog')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ cx-import-entries-dialog {
background-color: rgba(0, 0, 0, 0.5);

.cx-import-entries-dialog {
@extend .modal-dialog;
@extend .modal-dialog-centered;

.cx-import-entries-container {
@extend .modal-content;
pointer-events: none;

button,
Expand All @@ -32,7 +28,6 @@ cx-import-entries-dialog {

cx-import-entries-form,
cx-import-to-new-saved-cart-form {
@extend .modal-body;
background-color: var(--cx-color-inverse);
.cx-import-entries-subtitle {
font-weight: var(--cx-font-weight-bold);
Expand Down Expand Up @@ -95,8 +90,6 @@ cx-import-entries-dialog {
}

cx-import-entries-summary {
@extend .modal-body;

ul {
margin: -0.75rem 0 1.5rem;
overflow: auto;
Expand Down
1 change: 0 additions & 1 deletion feature-libs/cart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"@spartacus/storefront": "2211.32.0",
"@spartacus/styles": "2211.32.0",
"@spartacus/user": "2211.32.0",
"bootstrap": "^4.6.2",
"rxjs": "^7.8.0"
},
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<div
[cxFocus]="focusConfig"
(esc)="close('Escape clicked')"
class="cx-saved-cart-form-dialog"
class="modal-dialog modal-dialog-centered cx-saved-cart-form-dialog"
role="dialog"
aria-labelledby="dialogTitle"
>
<form [formGroup]="form" class="cx-saved-cart-form-container">
<form [formGroup]="form" class="modal-content cx-saved-cart-form-container">
<!-- Modal Header -->
<div class="modal-header cx-saved-cart-form-header">
<ng-container [ngSwitch]="layoutOption">
Expand Down Expand Up @@ -63,7 +63,7 @@
</div>

<!-- Modal Body -->
<div class="cx-saved-cart-form-body">
<div class="modal-body cx-saved-cart-form-body">
<!-- start DELETE and RESTORE form -->
<ng-container
*ngIf="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ cx-saved-cart-form-dialog {
background-color: rgba(0, 0, 0, 0.5);

.cx-saved-cart-form-dialog {
@extend .modal-dialog;
@extend .modal-dialog-centered;

.cx-saved-cart-form-container {
@extend .modal-content;

.cx-saved-cart-form-header {
.cx-saved-cart-form-title {
font-size: var(--cx-font-size, 1.375rem);
Expand All @@ -17,8 +12,6 @@ cx-saved-cart-form-dialog {
}

.cx-saved-cart-form-body {
@extend .modal-body;

.cx-saved-cart-form-row {
margin-bottom: 1.5rem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export class CartBaseFeatureModule { }
exports[`Spartacus Cart schematics: ng-add Cart Base feature general setup styling should create a proper scss file 1`] = `
"@import "../../styles-config";
@import "@spartacus/cart";
@import "@spartacus/styles/vendor/bootstrap/scss/functions";
@import "@spartacus/styles/vendor/bootstrap/scss/variables";
@import "@spartacus/styles/vendor/bootstrap/scss/_mixins";
"
`;

Expand Down Expand Up @@ -263,6 +266,9 @@ export class CartImportExportFeatureModule { }
exports[`Spartacus Cart schematics: ng-add Cart Import Export feature general setup styling should create a proper scss file 1`] = `
"@import "../../styles-config";
@import "@spartacus/cart";
@import "@spartacus/styles/vendor/bootstrap/scss/functions";
@import "@spartacus/styles/vendor/bootstrap/scss/variables";
@import "@spartacus/styles/vendor/bootstrap/scss/_mixins";
"
`;

Expand Down Expand Up @@ -448,6 +454,9 @@ export class CartQuickOrderFeatureModule { }
exports[`Spartacus Cart schematics: ng-add Quick Order feature general setup styling should create a proper scss file 1`] = `
"@import "../../styles-config";
@import "@spartacus/cart";
@import "@spartacus/styles/vendor/bootstrap/scss/functions";
@import "@spartacus/styles/vendor/bootstrap/scss/variables";
@import "@spartacus/styles/vendor/bootstrap/scss/_mixins";
"
`;

Expand Down Expand Up @@ -633,6 +642,9 @@ export class CartSavedCartFeatureModule { }
exports[`Spartacus Cart schematics: ng-add Saved Cart feature general setup styling should create a proper scss file 1`] = `
"@import "../../styles-config";
@import "@spartacus/cart";
@import "@spartacus/styles/vendor/bootstrap/scss/functions";
@import "@spartacus/styles/vendor/bootstrap/scss/variables";
@import "@spartacus/styles/vendor/bootstrap/scss/_mixins";
"
`;

Expand Down Expand Up @@ -828,6 +840,9 @@ export class WishListFeatureModule { }
exports[`Spartacus Cart schematics: ng-add Wish List feature general setup styling should create a proper scss file 1`] = `
"@import "../../styles-config";
@import "@spartacus/cart";
@import "@spartacus/styles/vendor/bootstrap/scss/functions";
@import "@spartacus/styles/vendor/bootstrap/scss/variables";
@import "@spartacus/styles/vendor/bootstrap/scss/_mixins";
"
`;

Expand Down
4 changes: 0 additions & 4 deletions feature-libs/checkout/_index.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
@import '@spartacus/styles/scss/core';

@import 'bootstrap/scss/functions';
@import 'bootstrap/scss/variables';
@import 'bootstrap/scss/mixins';

@import './base/index';
@import './b2b/index';
@import './scheduled-replenishment/index';
1 change: 0 additions & 1 deletion feature-libs/checkout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"@spartacus/storefront": "2211.32.0",
"@spartacus/styles": "2211.32.0",
"@spartacus/user": "2211.32.0",
"bootstrap": "^4.6.2",
"rxjs": "^7.8.0"
},
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export class CheckoutWrapperModule { }
exports[`Spartacus Checkout schematics: ng-add Checkout feature b2b general setup styling should create a proper scss file 1`] = `
"@import "../../styles-config";
@import "@spartacus/checkout";
@import "@spartacus/styles/vendor/bootstrap/scss/functions";
@import "@spartacus/styles/vendor/bootstrap/scss/variables";
@import "@spartacus/styles/vendor/bootstrap/scss/_mixins";
"
`;

Expand Down Expand Up @@ -315,6 +318,9 @@ export class CheckoutFeatureModule { }
exports[`Spartacus Checkout schematics: ng-add Checkout feature base general setup styling should create a proper scss file 1`] = `
"@import "../../styles-config";
@import "@spartacus/checkout";
@import "@spartacus/styles/vendor/bootstrap/scss/functions";
@import "@spartacus/styles/vendor/bootstrap/scss/variables";
@import "@spartacus/styles/vendor/bootstrap/scss/_mixins";
"
`;

Expand Down Expand Up @@ -594,6 +600,9 @@ export class CheckoutWrapperModule { }
exports[`Spartacus Checkout schematics: ng-add Checkout feature scheduled replenishment general setup styling should create a proper scss file 1`] = `
"@import "../../styles-config";
@import "@spartacus/checkout";
@import "@spartacus/styles/vendor/bootstrap/scss/functions";
@import "@spartacus/styles/vendor/bootstrap/scss/variables";
@import "@spartacus/styles/vendor/bootstrap/scss/_mixins";
"
`;

Expand Down
Loading
Loading