You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: don't put sass.silenceDeprecations in the 'test' section of angular.json via our installation schematics (#19915)
In the PR #19878 we've added a logic to our schematics that puts `sass.silenceDeprecations` config into customers' `angular.json` - to both "architect" sections: `build` and `test`
This PR removes it from the `test` architect, becasue it's not supported there by Angular CLI
fixes https://jira.tools.sap/browse/CXSPA-9294
Copy file name to clipboardexpand all lines: feature-libs/estimated-delivery-date/schematics/add-estimated-delivery-date/__snapshots__/index_spec.ts.snap
Copy file name to clipboardexpand all lines: feature-libs/product-multi-dimensional/schematics/add-product-multi-dimensional/__snapshots__/index_spec.ts.snap
+2-12
Original file line number
Diff line number
Diff line change
@@ -131,12 +131,7 @@ exports[`Spartacus Product Multi-Dimensional schematics: ng-add list feature gen
Copy file name to clipboardexpand all lines: feature-libs/requested-delivery-date/schematics/add-requested-delivery-date/__snapshots__/index_spec.ts.snap
Copy file name to clipboardexpand all lines: projects/schematics/src/add-spartacus/index.ts
+45-31
Original file line number
Diff line number
Diff line change
@@ -359,6 +359,42 @@ Note: Since version 17, Angular's command "ng new" by default creates an app wit
359
359
};
360
360
}
361
361
362
+
functioncreateSassSilenceDeprecations(
363
+
context: SchematicContext,
364
+
originalStylePreprocessorOptions: {
365
+
sass?: {silenceDeprecations?: string[]};
366
+
[key: string]: any;
367
+
}={}
368
+
): {sass: {silenceDeprecations: string[]}}{
369
+
constDEFAULT_SILENCE_DEPRECATIONS=[
370
+
// We need to silence the deprecation warning for the `@import` directive
371
+
// because `@import` is used in the Spartacus styles and in the Bootstrap 4 styles
372
+
// (which are imported by the Spartacus styles).
373
+
// Otherwise, since Angular v19, all apps would have a wall of deprecation warnings
374
+
// in the console when running `ng serve`.
375
+
//
376
+
// CXSPA-447: Eventually we should remove all the `@import` directives from the Spartacus styles
377
+
// and drop the usage of Bootstrap 4, and then we can remove the `silenceDeprecations` option.
378
+
'import',
379
+
];
380
+
381
+
context.logger.warn(
382
+
`⚠️ Warnings about the Sass '@import' usage were silenced, because Sass '@import' is used in Spartacus and Bootstrap 4 styles. To enable warnings back, in your 'angular.json' file remove the item "import" from the array at section 'architect.build.options.stylePreprocessorOptions.sass.silenceDeprecations'. For more, see: https://sass-lang.com/blog/import-is-deprecated and https://angular.dev/reference/configs/workspace-config#style-preprocessor-options`
`⚠️ Warnings about the Sass '@import' usage were silenced, because Sass '@import' is used in Spartacus and Bootstrap 4 styles. To enable warnings back, in your angular.json remove the "import" value from the array at section 'architect.build.options.stylePreprocessorOptions.sass.silenceDeprecations'. For more, see: https://sass-lang.com/blog/import-is-deprecated and https://angular.dev/reference/configs/workspace-config#style-preprocessor-options`
397
-
);
398
-
399
439
constupdatedAngularJson={
400
440
...angularJson,
401
441
projects: {
@@ -427,13 +467,9 @@ export function createStylePreprocessorOptions(
0 commit comments