@@ -14,17 +14,19 @@ import type { Icon } from "./css_to_ts";
1414import type { Equals } from "tsafe" ;
1515
1616( async ( ) => {
17- const dsfrProjectRoot = getProjectRoot ( ) ;
18-
19- const dsfrDistDirPath = pathJoin ( dsfrProjectRoot , "dsfr" ) ;
17+ const packageName = JSON . parse (
18+ fs . readFileSync ( pathJoin ( getProjectRoot ( ) , "package.json" ) ) . toString ( "utf8" )
19+ ) [ "name" ] ;
2020
2121 const cwd = process . cwd ( ) ;
2222
23+ const nodeModulesDirPath = pathJoin ( cwd , "node_modules" ) ;
24+
25+ const dsfrDistDirPath = pathJoin ( ...[ nodeModulesDirPath , ...packageName . split ( "/" ) , "dsfr" ] ) ;
26+
2327 const icons = await collectIcons ( {
2428 "dsfrDistDirPath" : dsfrDistDirPath ,
2529 "remixiconDirPath" : ( ( ) => {
26- const nodeModulesDirPath = pathJoin ( cwd , "node_modules" ) ;
27-
2830 at_the_root: {
2931 const remixiconDirPath = pathJoin ( nodeModulesDirPath , "remixicon" ) ;
3032
@@ -36,11 +38,7 @@ import type { Equals } from "tsafe";
3638 }
3739
3840 const remixiconDirPath = pathJoin (
39- nodeModulesDirPath ,
40- JSON . parse (
41- fs . readFileSync ( pathJoin ( dsfrProjectRoot , "package.json" ) ) . toString ( "utf8" )
42- ) [ "name" ] ,
43- "remixicon"
41+ ...[ nodeModulesDirPath , ...packageName . split ( "/" ) , "remixicon" ]
4442 ) ;
4543
4644 assert ( fs . existsSync ( remixiconDirPath ) ) ;
0 commit comments