11import path from "path" ;
2- import { fileURLToPath } from "url" ;
2+ import { fileURLToPath } from "node: url" ;
33import { Application } from "typedoc" ;
44import getArgs from "./get-args.mjs" ;
55
66const product = "ignite-ui-angular" ;
77const { localize, jsonExport, jsonImport } = getArgs ( ) ;
88const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
9- const DEST = path . join . bind (
10- null ,
11- path . resolve ( __dirname , "../dist/igniteui-angular/docs" ) ,
12- ) ;
9+ const toPosix = ( p ) => String ( p ) . replace ( / \\ / g, "/" ) ;
10+ const ROOT = ( ...segments ) => toPosix ( path . resolve ( __dirname , ".." , ...segments ) ) ;
1311
1412/*
1513 * Determines the entry points for the documentation generation.
1614 */
1715function entryPoints ( ) {
1816 if ( localize === "jp" ) {
19- return path . resolve (
20- __dirname ,
21- "../i18nRepo/typedoc/ja/igniteui-angular.json" ,
22- ) ;
17+ return ROOT ( "i18nRepo" , "typedoc" , "ja" , "igniteui-angular.json" ) ;
2318 }
2419
2520 if ( jsonImport ) {
26- return path . resolve (
27- __dirname ,
28- "../dist/igniteui-angular/docs/typescript-exported/igniteui-angular.json" ,
29- ) ;
21+ return ROOT ( "dist" , "igniteui-angular" , "docs" , "typescript-exported" , "igniteui-angular.json" ) ;
3022 }
3123
32- return path . resolve (
33- __dirname ,
34- "../projects/igniteui-angular/src/public_api.ts" ,
35- ) ;
24+ return ROOT ( "projects" , "igniteui-angular" , "src" , "public_api.ts" ) ;
3625}
3726
3827/*
3928 * The output directory for the static site or json generation.
4029 */
4130const OUT_DIR = jsonExport
42- ? DEST ( "/ typescript-exported/ igniteui-angular.json")
43- : DEST ( "/ typescript") ;
31+ ? ROOT ( "dist" , "igniteui-angular" , "docs" , " typescript-exported" , " igniteui-angular.json")
32+ : ROOT ( "dist" , "igniteui-angular" , "docs" , " typescript") ;
4433
4534/*
4635 * The Typedoc configuration object.
@@ -50,19 +39,18 @@ const CONFIG = {
5039 entryPoints : entryPoints ( ) ,
5140 entryPointStrategy : jsonImport || localize === "jp" ? "merge" : "resolve" ,
5241 plugin : [
53- path . resolve (
54- __dirname ,
55- "../node_modules/typedoc-plugin-localization/dist/index.js" ,
56- ) ,
57- path . resolve ( __dirname , "../node_modules/ig-typedoc-theme/dist/index.js" ) ,
42+ ROOT ( "node_modules" , "typedoc-plugin-localization" , "dist" , "index.js" ) ,
43+ ROOT ( "node_modules" , "ig-typedoc-theme" , "dist" , "index.js" ) ,
5844 ] ,
5945 theme : "igtheme" ,
6046 excludePrivate : true ,
6147 excludeProtected : true ,
6248 name : "Ignite UI for Angular" ,
6349 readme : "none" ,
6450 out : OUT_DIR ,
65- tsconfig : path . resolve ( __dirname , "../tsconfig.typedoc.json" ) ,
51+ router : "structure" ,
52+ logLevel : "Verbose" ,
53+ tsconfig : ROOT ( "tsconfig.typedoc.json" )
6654} ;
6755
6856async function main ( ) {
@@ -73,10 +61,7 @@ async function main() {
7361 app . options . setValue ( 'versioning' , true ) ;
7462
7563 if ( localize === "jp" ) {
76- const jpTemplateStrings = path . resolve (
77- __dirname ,
78- "../extras/template/strings/shell-strings.json" ,
79- ) ;
64+ const jpTemplateStrings = ROOT ( "extras" , "template" , "strings" , "shell-strings.json" ) ;
8065 app . options . setValue ( "templateStrings" , jpTemplateStrings ) ;
8166 }
8267
0 commit comments