File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 66
66
"prepare" : " husky install" ,
67
67
"husky:commit-msg" : " commitlint -e" ,
68
68
"husky:pre-push" : " npm-run-all --sequential husky:commit-msg" ,
69
- "postinstall" : " patch-package "
69
+ "postinstall" : " node scripts/clean-theming-css.cjs "
70
70
},
71
71
"devDependencies" : {
72
72
"@commitlint/cli" : " ^16.2.3" ,
Original file line number Diff line number Diff line change
1
+ const fs = require ( "fs" ) ;
2
+ const path = require ( "path" ) ;
3
+ const glob = require ( "glob" ) ;
4
+
5
+ // Pattern to match CSS variable definitions with JSON objects
6
+ const invalidLinePattern = / - - s a p T h e m e M e t a D a t a - [ ^ : ] + : \{ [ ^ ; ] + } ; / g;
7
+
8
+ // Find all matching CSS files
9
+ const cssFiles = glob . sync ( "node_modules/@sap-theming/theming-base-content/content/Base/baseLib/*/css_variables.css" ) ;
10
+
11
+ cssFiles . forEach ( file => {
12
+ let content = fs . readFileSync ( file , "utf8" ) ;
13
+ // Remove all invalid lines
14
+ const cleaned = content . replace ( invalidLinePattern , "" ) ;
15
+ if ( content !== cleaned ) {
16
+ fs . writeFileSync ( file , cleaned , "utf8" ) ;
17
+ console . log ( `Cleaned: ${ file } ` ) ;
18
+ }
19
+ } ) ;
You can’t perform that action at this time.
0 commit comments