@@ -8,29 +8,11 @@ const getSourceDir = (packageName) => {
88 const currFileDir = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
99 const dsDir = path . join ( currFileDir , '..' ) ;
1010
11- return path . join ( dsDir , 'packages' , packageName , 'src' ) ;
11+ return path . join ( dsDir , 'packages' , packageName ) ;
1212}
1313const createSymlink = ( source , target ) => {
1414 execSync ( `mkdir -p ${ target } && rm -rf ${ target } && ln -s ${ source } ${ target } ` ) ;
1515}
16- const updateIbexaTSConfigFile = ( ) => {
17- const tsConfigFilePath = path . resolve ( 'ibexa.tsconfig.json' ) ;
18- const tsConfigContent = JSON . parse ( fs . readFileSync ( tsConfigFilePath , 'utf-8' ) ) ;
19-
20- tsConfigContent . compilerOptions ??= { } ;
21- tsConfigContent . compilerOptions . paths ??= { } ;
22- tsConfigContent . compilerOptions . paths [ '@ids-assets/*' ] = [
23- `${ getSourceDir ( 'assets' ) } /*` ,
24- ] ;
25- tsConfigContent . compilerOptions . paths [ '@ids-components/*' ] = [
26- `${ getSourceDir ( 'components' ) } /*` ,
27- ] ;
28- tsConfigContent . compilerOptions . paths [ '@ids-core/*' ] = [
29- `${ getSourceDir ( 'core' ) } /*` ,
30- ] ;
31-
32- fs . writeFileSync ( tsConfigFilePath , JSON . stringify ( tsConfigContent , null , 4 ) ) ;
33- }
3416const createSymlinks = ( ) => {
3517 const composerJsonFilePath = path . resolve ( 'composer.json' ) ;
3618 const composerJsonContent = JSON . parse ( fs . readFileSync ( composerJsonFilePath , 'utf-8' ) ) ;
@@ -40,14 +22,35 @@ const createSymlinks = () => {
4022 const componentsSourcePath = getSourceDir ( 'components' ) ;
4123 const coreSourcePath = getSourceDir ( 'core' ) ;
4224 const assetsSourcePath = getSourceDir ( 'assets' ) ;
43- const componentsSymlinkPath = path . join ( assetsDirPath , 'ids-components/dist ' ) ;
44- const coreSymlinkPath = path . join ( assetsDirPath , 'ids-core/dist ' ) ;
45- const assetsSymlinkPath = path . join ( assetsDirPath , 'ids-assets/dist ' ) ;
25+ const componentsSymlinkPath = path . join ( assetsDirPath , 'ids-components' ) ;
26+ const coreSymlinkPath = path . join ( assetsDirPath , 'ids-core' ) ;
27+ const assetsSymlinkPath = path . join ( assetsDirPath , 'ids-assets' ) ;
4628
4729 createSymlink ( assetsSourcePath , assetsSymlinkPath ) ;
4830 createSymlink ( componentsSourcePath , componentsSymlinkPath ) ;
4931 createSymlink ( coreSourcePath , coreSymlinkPath ) ;
5032}
5133
52- updateIbexaTSConfigFile ( ) ;
5334createSymlinks ( ) ;
35+
36+ /* eslint-disable no-console */
37+ console . log (
38+ '\x1b[32m%s\x1b[0m' ,
39+ '+-----------------------------------------------------------------+' ,
40+ ) ;
41+ console . log (
42+ '\x1b[32m%s\x1b[0m' ,
43+ '| Symlinks created successfully. |' ,
44+ ) ;
45+ console . log (
46+ '\x1b[32m%s\x1b[0m' ,
47+ '| Go to admin-ui-assets/src/bundle/Resources/public/vendors |' ,
48+ ) ;
49+ console . log (
50+ '\x1b[32m%s\x1b[0m' ,
51+ '| and double check if directories ids-X are properly symlinked. |' ,
52+ ) ;
53+ console . log (
54+ '\x1b[32m%s\x1b[0m' ,
55+ '+-----------------------------------------------------------------+' ,
56+ ) ;
0 commit comments