@@ -10,8 +10,9 @@ const { execSync } = require("node:child_process");
1010
1111const generateIndex = require ( "./build/generateIndex" ) ;
1212const createEntryEndpoint = require ( "./build/createEntryEndpoint" ) ;
13+ const fixDtsOutputFlexible = require ( "./build/fixDtsOutputFlexible" ) ;
1314const checkIllegalStrings = require ( "./build/checkIllegalStrings" ) ;
14- const generateMdClass = require ( "./build/generateMdClass " ) ;
15+ const GenerateJsdocMd = require ( "./build/GenerateJsdocMd " ) ;
1516const CL = require ( "./libs/ColorLogger" ) ;
1617
1718const script_name = "JavaLibraryScript" ;
@@ -127,46 +128,10 @@ async function buildRollup() {
127128 } ) ;
128129}
129130
130- function fixDtsOutputFlexible ( filePath , log = false ) {
131- let code = fs . readFileSync ( filePath , "utf8" ) ;
132-
133- const regList = [
134- // 修正をここに追加
135- [
136- `declare\\s+namespace\\s+(__(?:[a-z]+_)+[A-Za-z]+_js)\\s+{\\s+export\\s+{[\\s\\S]*?\\s+};\\s+}\\s+` ,
137- ( a , b ) => {
138- if ( log ) console . log ( `┃┃ namespace ${ b } : ${ CL . cyan ( "削除" ) } ` ) ;
139- return "" ;
140- } ,
141- ] ,
142- [
143- `(\\s+)(__(?:[a-z]+_)+([A-Za-z]+)_js)` ,
144- ( a , b , c , d ) => {
145- if ( log ) console . log ( `┃┃ ${ c } -> ${ d } : ${ CL . cyan ( "統合" ) } ` ) ;
146- return `${ b } ${ d } ` ;
147- } ,
148- ] ,
149- [
150- `([A-Za-z][A-Za-z0-9]*)_forceRep` ,
151- ( a , b ) => {
152- if ( log ) console . log ( `┃┃ ${ b } : ${ CL . cyan ( "強制変更" ) } ` ) ;
153- return b ;
154- } ,
155- ] ,
156- ] ;
157-
158- for ( const [ reg , rep ] of regList ) {
159- const re = new RegExp ( reg , "gm" ) ;
160- code = code . replace ( re , rep ) ;
161- }
162-
163- fs . writeFileSync ( filePath , code ) ;
164- }
165-
166131( async ( ) => {
167132 const debug = true ;
168133 // 動作確認用 ログ表示
169- const logView = true ;
134+ const logView = false ;
170135 //
171136 const start = performance . now ( ) ;
172137 try {
@@ -219,7 +184,9 @@ function fixDtsOutputFlexible(filePath, log = false) {
219184 }
220185
221186 console . log ( `┣ℹ️ ${ CL . brightWhite ( "mdのコンテンツ生成中..." ) } ` ) ;
222- generateMdClass ( entryDir , mdCodeDocsPath ) ;
187+ GenerateJsdocMd . isDebug = logView ;
188+ GenerateJsdocMd . endPointName = script_name ;
189+ GenerateJsdocMd . generate ( entryDir , mdCodeDocsPath ) ;
223190 console . log ( `┃┗✅ ${ CL . brightWhite ( "mdのコンテンツ生成完了" ) } : ${ mdCodeDocsPath } ` ) ;
224191
225192 const end = performance . now ( ) - start ;
0 commit comments