@skspwork/config-doc 2.2.0 → 2.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250),n=e.i(59756),i=e.i(61916),o=e.i(74677),s=e.i(69741),l=e.i(16795),c=e.i(87718),d=e.i(95169),p=e.i(47587),f=e.i(66012),h=e.i(70101),u=e.i(26937),g=e.i(10372),m=e.i(93695);e.i(52474);var y=e.i(220),b=e.i(89171),P=e.i(27637),v=e.i(21127);function x(e){return e.replace(/\|/g,"\\|").replace(/\n/g,"<br>").replace(/\r/g,"").replace(/\$/g,"\\$")}function w(e){return e.replace(/\$/g,"\\$")}function
|
|
1
|
+
module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250),n=e.i(59756),i=e.i(61916),o=e.i(74677),s=e.i(69741),l=e.i(16795),c=e.i(87718),d=e.i(95169),p=e.i(47587),f=e.i(66012),h=e.i(70101),u=e.i(26937),g=e.i(10372),m=e.i(93695);e.i(52474);var y=e.i(220),b=e.i(89171),P=e.i(27637),v=e.i(21127);function x(e){return e.replace(/\|/g,"\\|").replace(/\n/g,"<br>").replace(/\r/g,"").replace(/\$/g,"\\$")}function w(e){return e.replace(/\$/g,"\\$")}function j(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\$/g,"$")}function D(e,t){let a=t.split(/(?=\[)|:/),r=e;for(let e of a){if(null==r)return;if(e.startsWith("[")&&e.endsWith("]")){let t=parseInt(e.slice(1,-1),10);if(!Array.isArray(r))return;r=r[t]}else if(e&&"object"==typeof r&&e in r)r=r[e];else if(e)return}return r}class k{fsService;storageService;constructor(e){this.fsService=new P.FileSystemService(e),this.storageService=new v.StorageService(this.fsService)}async generateHtml(){let e=await this.fsService.loadProjectSettings();if(!e||!e.configFiles||0===e.configFiles.length)return this.generateEmptyHtml();let t=e.fields?Object.keys(e.fields):[],a=e.availableTags||[],r=[];for(let t of e.configFiles)try{let e=t.split(/[/\\]/).pop()||"config.json",a=this.storageService.getDocsFileName(t),n=await this.fsService.loadConfigFile(t),i=await this.fsService.loadConfigDocs(a);r.push({filePath:t,fileName:e,configData:n,docs:i||{configFilePath:t,lastModified:new Date().toISOString(),properties:{}}})}catch(e){console.error(`Failed to load config: ${t}`,e)}let n={projectName:e.projectName,createdAt:"",lastModified:new Date().toISOString(),configFiles:[]};return this.generateFullHtml(n,r,t,a)}generateEmptyHtml(){return`<!DOCTYPE html>
|
|
2
2
|
<html lang="ja">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
@@ -22,24 +22,25 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
22
22
|
<head>
|
|
23
23
|
<meta charset="UTF-8">
|
|
24
24
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
25
|
-
<title>${
|
|
25
|
+
<title>${j(e.projectName)} - ConfigDoc</title>
|
|
26
26
|
${this.getStyles()}
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
|
29
29
|
<div class="container">
|
|
30
30
|
<header>
|
|
31
31
|
<div class="header-content">
|
|
32
|
-
<h1>${
|
|
32
|
+
<h1>${j(e.projectName)}</h1>
|
|
33
33
|
<p class="meta">最終更新: ${new Date(e.lastModified).toLocaleString("ja-JP")}</p>
|
|
34
34
|
</div>
|
|
35
35
|
</header>
|
|
36
36
|
|
|
37
|
+
<div class="config-tabs" id="configTabs"></div>
|
|
38
|
+
|
|
37
39
|
<div class="content">
|
|
38
40
|
<aside class="sidebar">
|
|
39
41
|
<div class="search-box">
|
|
40
|
-
<input type="text" id="searchInput" placeholder="
|
|
42
|
+
<input type="text" id="searchInput" placeholder="現在のファイル内を検索..." />
|
|
41
43
|
</div>
|
|
42
|
-
<div class="config-tabs" id="configTabs"></div>
|
|
43
44
|
<div class="tree-container" id="treeContainer"></div>
|
|
44
45
|
</aside>
|
|
45
46
|
<main class="main-content">
|
|
@@ -445,33 +446,42 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
445
446
|
}
|
|
446
447
|
|
|
447
448
|
.config-tabs {
|
|
448
|
-
|
|
449
|
-
|
|
449
|
+
background: white;
|
|
450
|
+
border-radius: 8px;
|
|
451
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
452
|
+
margin-bottom: 20px;
|
|
453
|
+
padding: 15px;
|
|
450
454
|
display: flex;
|
|
451
|
-
flex-direction:
|
|
452
|
-
gap:
|
|
455
|
+
flex-direction: row;
|
|
456
|
+
gap: 10px;
|
|
457
|
+
overflow-x: auto;
|
|
458
|
+
flex-wrap: wrap;
|
|
453
459
|
}
|
|
454
460
|
|
|
455
461
|
.config-tab {
|
|
456
|
-
display: flex;
|
|
457
|
-
|
|
458
|
-
gap:
|
|
459
|
-
padding: 10px
|
|
462
|
+
display: inline-flex;
|
|
463
|
+
align-items: center;
|
|
464
|
+
gap: 8px;
|
|
465
|
+
padding: 10px 20px;
|
|
460
466
|
background: #f9fafb;
|
|
461
|
-
border:
|
|
462
|
-
border-radius:
|
|
467
|
+
border: 2px solid #e5e7eb;
|
|
468
|
+
border-radius: 8px;
|
|
463
469
|
cursor: pointer;
|
|
464
470
|
transition: all 0.2s;
|
|
471
|
+
white-space: nowrap;
|
|
472
|
+
min-width: fit-content;
|
|
465
473
|
}
|
|
466
474
|
|
|
467
475
|
.config-tab:hover {
|
|
468
476
|
background: #f3f4f6;
|
|
477
|
+
border-color: #d1d5db;
|
|
469
478
|
}
|
|
470
479
|
|
|
471
480
|
.config-tab.active {
|
|
472
481
|
background: #2563eb;
|
|
473
482
|
color: white;
|
|
474
483
|
border-color: #2563eb;
|
|
484
|
+
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
|
|
475
485
|
}
|
|
476
486
|
|
|
477
487
|
.config-tab.active .config-tab-path {
|
|
@@ -483,17 +493,14 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
483
493
|
}
|
|
484
494
|
|
|
485
495
|
.config-tab-filename {
|
|
486
|
-
font-weight:
|
|
487
|
-
font-size: 0.
|
|
496
|
+
font-weight: 600;
|
|
497
|
+
font-size: 0.95rem;
|
|
488
498
|
}
|
|
489
499
|
|
|
490
500
|
.config-tab-path {
|
|
491
|
-
font-size: 0.
|
|
501
|
+
font-size: 0.8rem;
|
|
492
502
|
color: #9ca3af;
|
|
493
|
-
|
|
494
|
-
text-overflow: ellipsis;
|
|
495
|
-
white-space: nowrap;
|
|
496
|
-
max-width: 100%;
|
|
503
|
+
font-family: 'Courier New', monospace;
|
|
497
504
|
}
|
|
498
505
|
|
|
499
506
|
.tree-container {
|
|
@@ -890,7 +897,7 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
890
897
|
}
|
|
891
898
|
|
|
892
899
|
// 設定タブを描画
|
|
893
|
-
function renderConfigTabs(
|
|
900
|
+
function renderConfigTabs() {
|
|
894
901
|
const tabsEl = document.getElementById('configTabs');
|
|
895
902
|
tabsEl.innerHTML = '';
|
|
896
903
|
|
|
@@ -902,24 +909,20 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
902
909
|
className += ' active';
|
|
903
910
|
}
|
|
904
911
|
|
|
905
|
-
// 検索中で、マッチしない設定ファイルは非表示
|
|
906
|
-
if (matchedConfigIndexes !== null && !matchedConfigIndexes.includes(index)) {
|
|
907
|
-
className += ' hidden';
|
|
908
|
-
}
|
|
909
|
-
|
|
910
912
|
tab.className = className;
|
|
911
913
|
tab.innerHTML = \`
|
|
912
|
-
<
|
|
913
|
-
<
|
|
914
|
+
<span class="config-tab-filename">\${escapeHtml(config.fileName)}</span>
|
|
915
|
+
<span class="config-tab-path" title="\${escapeHtml(config.filePath)}">\${escapeHtml(config.filePath)}</span>
|
|
914
916
|
\`;
|
|
915
917
|
tab.addEventListener('click', () => {
|
|
916
918
|
activeConfigIndex = index;
|
|
917
|
-
renderConfigTabs(
|
|
919
|
+
renderConfigTabs();
|
|
918
920
|
renderCurrentConfig();
|
|
919
|
-
//
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
921
|
+
// タブ切り替え後、検索フィルタをクリア
|
|
922
|
+
const searchInput = document.getElementById('searchInput');
|
|
923
|
+
searchInput.value = '';
|
|
924
|
+
currentSearchQuery = '';
|
|
925
|
+
applySearchFilter('');
|
|
923
926
|
});
|
|
924
927
|
tabsEl.appendChild(tab);
|
|
925
928
|
});
|
|
@@ -980,7 +983,7 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
980
983
|
});
|
|
981
984
|
}
|
|
982
985
|
|
|
983
|
-
//
|
|
986
|
+
// 検索機能(現在選択中のファイル内のみ)
|
|
984
987
|
function setupSearch() {
|
|
985
988
|
const searchInput = document.getElementById('searchInput');
|
|
986
989
|
searchInput.addEventListener('input', (e) => {
|
|
@@ -988,67 +991,16 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
988
991
|
currentSearchQuery = query;
|
|
989
992
|
|
|
990
993
|
if (!query.trim()) {
|
|
991
|
-
//
|
|
992
|
-
|
|
993
|
-
renderCurrentConfig();
|
|
994
|
+
// 検索クエリが空の場合、すべてのツリー項目を表示
|
|
995
|
+
applySearchFilter('');
|
|
994
996
|
return;
|
|
995
997
|
}
|
|
996
998
|
|
|
997
|
-
// 全設定ファイルから検索してマッチした項目を収集
|
|
998
|
-
let foundInConfigs = [];
|
|
999
|
-
configs.forEach((config, index) => {
|
|
1000
|
-
const tree = buildTree(config.configData, '', config.docs, config.configData);
|
|
1001
|
-
const hasMatch = searchInTreeForConfig(tree, query, config);
|
|
1002
|
-
if (hasMatch) {
|
|
1003
|
-
foundInConfigs.push(index);
|
|
1004
|
-
}
|
|
1005
|
-
});
|
|
1006
|
-
|
|
1007
|
-
// マッチした設定ファイルのタブのみ表示
|
|
1008
|
-
renderConfigTabs(foundInConfigs);
|
|
1009
|
-
|
|
1010
|
-
// マッチした最初の設定ファイルに切り替え(現在のタブがマッチしていない場合)
|
|
1011
|
-
if (foundInConfigs.length > 0 && !foundInConfigs.includes(activeConfigIndex)) {
|
|
1012
|
-
activeConfigIndex = foundInConfigs[0];
|
|
1013
|
-
renderConfigTabs(foundInConfigs);
|
|
1014
|
-
renderCurrentConfig();
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
999
|
// 現在表示中のツリー項目をフィルタリング
|
|
1018
1000
|
applySearchFilter(query);
|
|
1019
1001
|
});
|
|
1020
1002
|
}
|
|
1021
1003
|
|
|
1022
|
-
// ツリー内を検索してマッチするか判定(特定の設定ファイル用)
|
|
1023
|
-
function searchInTreeForConfig(nodes, query, config) {
|
|
1024
|
-
for (const node of nodes) {
|
|
1025
|
-
const text = node.key.toLowerCase();
|
|
1026
|
-
const path = node.path.toLowerCase();
|
|
1027
|
-
|
|
1028
|
-
// プロパティ名とパスで検索
|
|
1029
|
-
if (text.includes(query) || path.includes(query)) {
|
|
1030
|
-
return true;
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
// ドキュメント(フィールド内容)でも検索
|
|
1034
|
-
const doc = config.docs.properties && config.docs.properties[node.path];
|
|
1035
|
-
if (doc && doc.fields) {
|
|
1036
|
-
for (const [label, value] of Object.entries(doc.fields)) {
|
|
1037
|
-
if (value && value.toLowerCase().includes(query)) {
|
|
1038
|
-
return true;
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
if (node.children && node.children.length > 0) {
|
|
1044
|
-
if (searchInTreeForConfig(node.children, query, config)) {
|
|
1045
|
-
return true;
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
return false;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
1004
|
// HTML エスケープ($記号もエスケープしてKaTeX/MathJax数式解釈を防止)
|
|
1053
1005
|
function escapeHtml(text) {
|
|
1054
1006
|
const div = document.createElement('div');
|
|
@@ -1062,7 +1014,7 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
1062
1014
|
renderCurrentConfig();
|
|
1063
1015
|
setupSearch();
|
|
1064
1016
|
}
|
|
1065
|
-
`}}class
|
|
1017
|
+
`}}class A{static flattenConfig(e,t=""){let a={};for(let r in e){let n=t?`${t}:${r}`:r,i=e[r];i&&"object"==typeof i?Array.isArray(i)?i.some(e=>e&&"object"==typeof e&&!Array.isArray(e))?i.forEach((e,t)=>{e&&"object"==typeof e&&!Array.isArray(e)&&Object.assign(a,this.flattenConfig(e,`${n}[${t}]`))}):a[n]=i:Object.assign(a,this.flattenConfig(i,n)):a[n]=i}return a}static getAllPropertyPaths(e,t=""){let a=[];for(let r in e){let n=t?`${t}:${r}`:r,i=e[r];a.push(n),i&&"object"==typeof i&&(Array.isArray(i)?i.some(e=>e&&"object"==typeof e&&!Array.isArray(e))&&i.forEach((e,t)=>{if(e&&"object"==typeof e&&!Array.isArray(e)){let r=`${n}[${t}]`;a.push(r),a.push(...this.getAllPropertyPaths(e,r))}}):a.push(...this.getAllPropertyPaths(i,n)))}return a}static buildTree(e,t=""){let a=[];for(let r in e){let n=t?`${t}:${r}`:r,i=e[r];if(i&&"object"==typeof i)if(Array.isArray(i))if(i.some(e=>e&&"object"==typeof e&&!Array.isArray(e))){let e=[];i.forEach((t,a)=>{t&&"object"==typeof t&&!Array.isArray(t)&&e.push({key:`[${a}]`,fullPath:`${n}[${a}]`,value:t,children:this.buildTree(t,`${n}[${a}]`),hasDocumentation:!1,type:"object"})}),a.push({key:r,fullPath:n,value:i,children:e.length>0?e:void 0,hasDocumentation:!1,type:"array"})}else a.push({key:r,fullPath:n,value:i,hasDocumentation:!1,type:"array"});else a.push({key:r,fullPath:n,value:i,children:this.buildTree(i,n),hasDocumentation:!1,type:"object"});else a.push({key:r,fullPath:n,value:i,hasDocumentation:!1,type:typeof i})}return a}}function C(e,t){return[...e].sort((e,a)=>{let r=t.indexOf(e),n=t.indexOf(a);return -1!==r&&-1!==n?r-n:-1===r?1:-1===n?-1:0})}var $=e.i(61958);class S{rootPath;constructor(e){this.rootPath=e}async generateMarkdownForFile(e){let t=new P.FileSystemService(this.rootPath),a=new v.StorageService(t),r=await t.loadProjectSettings(),n=r?.fields?Object.keys(r.fields):[],i=r?.availableTags||[],o=e.split(/[/\\]/).pop()||"config.json",s=await a.loadAllDocs(e),l=await t.loadConfigFile(e),c=s.associativeArrays||[],d=`# ${o}
|
|
1066
1018
|
|
|
1067
1019
|
`;d+=`**ファイルパス:** \`${e}\`
|
|
1068
1020
|
|
|
@@ -1070,13 +1022,13 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
1070
1022
|
|
|
1071
1023
|
---
|
|
1072
1024
|
|
|
1073
|
-
`;let p=
|
|
1025
|
+
`;let p=A.getAllPropertyPaths(l);if(0===p.length)d+="*プロパティがありません。*\n\n";else for(let e of(d+="## プロパティ一覧\n\n",p)){let t=(0,$.findAndMergeDocumentation)(e,s.properties,c,l),a=D(l,e);if(d+=`### \`${e}\`
|
|
1074
1026
|
|
|
1075
1027
|
`,null!=a){let e=typeof a,t=Array.isArray(a),r="object"===e&&!t;t?a.length>0&&a.every(e=>"object"!=typeof e||null===e)&&(d+=`**値:** \`${w(JSON.stringify(a))}\`
|
|
1076
1028
|
|
|
1077
1029
|
`):r||(d+=`**値:** \`${w(String(a))}\`
|
|
1078
1030
|
|
|
1079
|
-
`)}if(t){if(t.tags&&t.tags.length>0){let e=
|
|
1031
|
+
`)}if(t){if(t.tags&&t.tags.length>0){let e=C(t.tags,i);d+=`**タグ:** ${e.map(e=>`\`${e}\``).join(", ")}
|
|
1080
1032
|
|
|
1081
1033
|
`}if(t.fields)for(let e of n){let a=t.fields[e];a&&(d+=`**${e}:**
|
|
1082
1034
|
|
|
@@ -1094,13 +1046,13 @@ ${w(a)}
|
|
|
1094
1046
|
|
|
1095
1047
|
**ファイルパス:** \`${o}\`
|
|
1096
1048
|
|
|
1097
|
-
`;let c=
|
|
1049
|
+
`;let c=A.getAllPropertyPaths(l);if(0===c.length){i+="*プロパティがありません。*\n\n";continue}i+="### プロパティ一覧\n\n";let d=s.associativeArrays||[];for(let e of c){let t=(0,$.findAndMergeDocumentation)(e,s.properties,d,l),a=D(l,e);if(i+=`#### \`${e}\`
|
|
1098
1050
|
|
|
1099
1051
|
`,null!=a){let e=typeof a,t=Array.isArray(a),r="object"===e&&!t;t?a.length>0&&a.every(e=>"object"!=typeof e||null===e)&&(i+=`**値:** \`${w(JSON.stringify(a))}\`
|
|
1100
1052
|
|
|
1101
1053
|
`):r||(i+=`**値:** \`${w(String(a))}\`
|
|
1102
1054
|
|
|
1103
|
-
`)}if(t){if(t.tags&&t.tags.length>0){let e=
|
|
1055
|
+
`)}if(t){if(t.tags&&t.tags.length>0){let e=C(t.tags,n);i+=`**タグ:** ${e.map(e=>`\`${e}\``).join(", ")}
|
|
1104
1056
|
|
|
1105
1057
|
`}if(t.fields)for(let e of r){let a=t.fields[e];a&&(i+=`**${e}:**
|
|
1106
1058
|
|
|
@@ -1116,7 +1068,7 @@ ${w(a)}
|
|
|
1116
1068
|
|
|
1117
1069
|
---
|
|
1118
1070
|
|
|
1119
|
-
`;let p=
|
|
1071
|
+
`;let p=A.getAllPropertyPaths(c);if(0===p.length)d+="*プロパティがありません。*\n\n";else{for(let e of(d+="| プロパティ名 | タグ | 値 |",n.forEach(e=>{d+=` ${e} |`}),d+="\n|-------------|------|-----|",n.forEach(()=>{d+="------|"}),d+="\n",p)){let t=(0,$.findAndMergeDocumentation)(e,s.properties,l,c),a=x(e),r=t&&t.tags&&t.tags.length>0?C(t.tags,i):[],o=r.length>0?x(r.map(e=>`\`${e}\``).join(", ")):"-",p=x(this.getPropertyValue(c,e));d+=`| ${a} | ${o} | ${p} |`,n.forEach(e=>{let a=t&&t.fields&&t.fields[e]||"-";d+=` ${x(a)} |`}),d+="\n"}d+="\n"}return d+=`
|
|
1120
1072
|
*このドキュメントは ConfigDoc により自動生成されました。*
|
|
1121
1073
|
`}async generateMarkdownTable(){let e=new P.FileSystemService(this.rootPath),t=new v.StorageService(e),a=await e.loadProjectSettings();if(!a||0===a.configFiles.length)return"# 設定ファイルドキュメント\n\nドキュメント化された設定ファイルがありません。\n";let r=a.fields?Object.keys(a.fields):[],n=a.availableTags||[],i="# 設定ファイルドキュメント\n\n";for(let o of(i+=`プロジェクト: **${a.projectName}**
|
|
1122
1074
|
|
|
@@ -1128,8 +1080,8 @@ ${w(a)}
|
|
|
1128
1080
|
|
|
1129
1081
|
**ファイルパス:** \`${o}\`
|
|
1130
1082
|
|
|
1131
|
-
`;let c=
|
|
1083
|
+
`;let c=A.getAllPropertyPaths(l);if(0===c.length){i+="*プロパティがありません。*\n\n";continue}i+="| プロパティ名 | タグ | 値 |",r.forEach(e=>{i+=` ${e} |`}),i+="\n|-------------|------|-----|",r.forEach(()=>{i+="------|"}),i+="\n";let d=s.associativeArrays||[];for(let e of c){let t=(0,$.findAndMergeDocumentation)(e,s.properties,d,l),a=x(e),o=t&&t.tags&&t.tags.length>0?C(t.tags,n):[],c=o.length>0?x(o.map(e=>`\`${e}\``).join(", ")):"-",p=x(this.getPropertyValue(l,e));i+=`| ${a} | ${c} | ${p} |`,r.forEach(e=>{let a=t&&t.fields&&t.fields[e]||"-";i+=` ${x(a)} |`}),i+="\n"}i+="\n"}return i+=`
|
|
1132
1084
|
*このドキュメントは ConfigDoc により自動生成されました。*
|
|
1133
|
-
`}getPropertyValue(e,t){var a=D(e,t);if(null==a)return"-";let r=typeof a,n=Array.isArray(a);return n?a.length>0&&a.every(e=>"object"!=typeof e||null===e)?JSON.stringify(a):"-":"object"!==r||n?String(a):"-"}}var
|
|
1085
|
+
`}getPropertyValue(e,t){var a=D(e,t);if(null==a)return"-";let r=typeof a,n=Array.isArray(a);return n?a.length>0&&a.every(e=>"object"!=typeof e||null===e)?JSON.stringify(a):"-":"object"!==r||n?String(a):"-"}}var O=e.i(10720),T=e.i(14747),F=e.i(24868);async function N(e){try{let t,a=(0,O.getRootPath)();try{t=await e.json()}catch{t={}}let{format:r="html"}=t,n=t.fileName?.trim()||"config-doc",i=t.outputDir?.trim()||"",o=new P.FileSystemService(a);await o.ensureConfigDocDir();let s=i?T.default.join(a,i):a;if(await F.default.mkdir(s,{recursive:!0}),"markdown"===r){let e=await o.loadProjectSettings();if(!e||0===e.configFiles.length)return b.NextResponse.json({success:!1,error:"ドキュメント化された設定ファイルがありません"},{status:400});let t=new S(a),r=[];for(let a of e.configFiles){let e=(a.split(/[/\\]/).pop()||"config.json").replace(/\.json$/i,".md"),n=T.default.join(s,e),i=await t.generateMarkdownForFile(a);await F.default.writeFile(n,i,"utf-8"),r.push(n)}return b.NextResponse.json({success:!0,message:`Markdownファイルを${r.length}件生成しました`,outputPaths:r})}if("markdown-table"===r){let e=await o.loadProjectSettings();if(!e||0===e.configFiles.length)return b.NextResponse.json({success:!1,error:"ドキュメント化された設定ファイルがありません"},{status:400});let t=new E(a),r=[];for(let a of e.configFiles){let e=(a.split(/[/\\]/).pop()||"config.json").replace(/\.json$/i,".md"),n=T.default.join(s,e),i=await t.generateMarkdownTableForFile(a);await F.default.writeFile(n,i,"utf-8"),r.push(n)}return b.NextResponse.json({success:!0,message:`Markdownテーブルファイルを${r.length}件生成しました`,outputPaths:r})}let l=new k(a),c=await l.generateHtml(),d=`${n}.html`,p=T.default.join(s,d);return await F.default.writeFile(p,c,"utf-8"),b.NextResponse.json({success:!0,message:"HTMLファイルを生成しました",outputPath:p})}catch(e){return console.error("API Error:",e),b.NextResponse.json({success:!1,error:e instanceof Error?e.message:"Unknown error"},{status:500})}}e.s(["POST",()=>N],49588);var I=e.i(49588);let R=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/export/route",pathname:"/api/export",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/export/route.ts",nextConfigOutput:"standalone",userland:I}),{workAsyncStorage:M,workUnitAsyncStorage:H,serverHooks:z}=R;function B(){return(0,r.patchFetch)({workAsyncStorage:M,workUnitAsyncStorage:H})}async function L(e,t,r){R.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let b="/api/export/route";b=b.replace(/\/index$/,"")||"/";let P=await R.prepare(e,t,{srcPage:b,multiZoneDraftMode:!1});if(!P)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:v,params:x,nextConfig:w,parsedUrl:j,isDraftMode:D,prerenderManifest:k,routerServerContext:A,isOnDemandRevalidate:C,revalidateOnlyGenerated:$,resolvedPathname:S,clientReferenceManifest:E,serverActionsManifest:O}=P,T=(0,s.normalizeAppPath)(b),F=!!(k.dynamicRoutes[T]||k.routes[S]),N=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,j,!1):t.end("This page could not be found"),null);if(F&&!D){let e=!!k.routes[S],t=k.dynamicRoutes[T];if(t&&!1===t.fallback&&!e){if(w.experimental.adapterPath)return await N();throw new m.NoFallbackError}}let I=null;!F||R.isDev||D||(I="/index"===(I=S)?"/":I);let M=!0===R.isDev||!F,H=F&&!M;O&&E&&(0,o.setManifestsSingleton)({page:b,clientReferenceManifest:E,serverActionsManifest:O});let z=e.method||"GET",B=(0,i.getTracer)(),L=B.getActiveScopeSpan(),U={params:x,prerenderManifest:k,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:M,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:w.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,n)=>R.onRequestError(e,t,r,n,A)},sharedContext:{buildId:v}},q=new l.NodeNextRequest(e),K=new l.NodeNextResponse(t),_=c.NextRequestAdapter.fromNodeNextRequest(q,(0,c.signalFromNodeResponse)(t));try{let o=async e=>R.handle(_,U).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let a=B.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route");if(r){let t=`${z} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":t}),e.updateName(t)}else e.updateName(`${z} ${b}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var i,l;let c=async({previousCacheEntry:a})=>{try{if(!s&&C&&$&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await o(n);e.fetchMetrics=U.renderOpts.fetchMetrics;let l=U.renderOpts.pendingWaitUntil;l&&r.waitUntil&&(r.waitUntil(l),l=void 0);let c=U.renderOpts.collectedTags;if(!F)return await (0,f.sendResponse)(q,K,i,U.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);c&&(t[g.NEXT_CACHE_TAGS_HEADER]=c),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,r=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await R.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:C})},!1,A),t}},d=await R.handleResponse({req:e,nextConfig:w,cacheKey:I,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:$,responseGenerator:c,waitUntil:r.waitUntil,isMinimalMode:s});if(!F)return null;if((null==d||null==(i=d.value)?void 0:i.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",C?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),D&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return s&&F||m.delete(g.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,u.getCacheControlHeader)(d.cacheControl)),await (0,f.sendResponse)(q,K,new Response(d.value.body,{headers:m,status:d.value.status||200})),null};L?await l(L):await B.withPropagatedContext(e.headers,()=>B.trace(d.BaseServerSpan.handleRequest,{spanName:`${z} ${b}`,kind:i.SpanKind.SERVER,attributes:{"http.method":z,"http.target":e.url}},l))}catch(t){if(t instanceof m.NoFallbackError||await R.onRequestError(e,t,{routerKind:"App Router",routePath:T,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:C})},!1,A),F)throw t;return await (0,f.sendResponse)(q,K,new Response(null,{status:500})),null}}e.s(["handler",()=>L,"patchFetch",()=>B,"routeModule",()=>R,"serverHooks",()=>z,"workAsyncStorage",()=>M,"workUnitAsyncStorage",()=>H],47482)}];
|
|
1134
1086
|
|
|
1135
1087
|
//# sourceMappingURL=node_modules_next_dist_esm_build_templates_app-route_d09de205.js.map
|