-
Notifications
You must be signed in to change notification settings - Fork 393
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
chore: add migration scripts for bootstrap dependency removal #19926
Conversation
…into feature/CXSPA-9283
export function uninstallBootstrap(): Rule { | ||
return (tree: Tree, context: SchematicContext) => { | ||
// Execute the npm uninstall command | ||
exec('npm uninstall bootstrap', (error, stdout, stderr) => { | ||
if (error) { | ||
context.logger.error(`Error uninstalling Bootstrap: ${error.message}`); | ||
return; | ||
} | ||
if (stderr) { | ||
context.logger.warn(`Warnings during uninstall: ${stderr}`); | ||
} | ||
context.logger.info(`Bootstrap uninstalled successfully:\n${stdout}`); | ||
}); | ||
|
||
return tree; | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MEDIUM]
- Some customers might be using yarn or pnpm. So we should not execute the
npm
command directly, but instead rely on some more universal mechanisms for dependency management. - Don't we already have a logic for removing Bootstrap in this file:
.../2212_32/dependency-management/dependency-management.ts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried using dependecy-management but it doesnt remove bootstrap and as far as I remember, the code I think doesnt have any functions that would remove bootstrap. All it does is show a message about bootstrap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After second look it does filter out the libraries from the package json and runs installation. However, in my testing it never removed bootstrap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that the dependency manager is aimed only at spartacus libraries
projects/schematics/src/migrations/2212_32/bootstrap/bootstrap.ts
Outdated
Show resolved
Hide resolved
projects/schematics/src/migrations/2212_32/bootstrap/replace-bootstrap-imports.ts
Outdated
Show resolved
Hide resolved
projects/schematics/src/migrations/2212_32/bootstrap/replace-bootstrap-imports.ts
Outdated
Show resolved
Hide resolved
projects/schematics/src/migrations/2212_32/bootstrap/add-imports-in-libraries.ts
Outdated
Show resolved
Hide resolved
…ootstrap-imports.ts Co-authored-by: Krzysztof Platis <[email protected]>
…ootstrap-imports.ts Co-authored-by: Krzysztof Platis <[email protected]>
Co-authored-by: Krzysztof Platis <[email protected]>
Co-authored-by: Krzysztof Platis <[email protected]>
…into feature/CXSPA-9283
…into feature/CXSPA-9283
Merge Checks Failed
|
spartacus Run #46950
Run Properties:
|
Project |
spartacus
|
Branch Review |
feature/CXSPA-9283
|
Run status |
Passed #46950
|
Run duration | 12m 00s |
Commit |
c592740b6d ℹ️: Merge 6e5088ed5d0bd86508aa9f15428fd949226fd622 into 397395fa34802b247c97f655112a...
|
Committer | kpawelczak |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
3
|
Pending |
2
|
Skipped |
0
|
Passing |
125
|
Upgrade your plan to view test results. | |
View all changes introduced in this branch ↗︎ |
closes: CXSPA-9283
The
migration.json
file will likely need to be updated. Currently, the changes made are only intended to enable testing.QA (installation script):
npm run config:update
and thennpm run generate:deps
ts-node ./tools/schematics/testing.ts
in the SPA root folderng add @spartacus/schematics
, e.g. from RBSC (.npmrc is needed)ng update @spartacus/schematics