spec-up-t 1.2.5 → 1.2.7

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.
Files changed (37) hide show
  1. package/assets/compiled/body.js +9 -9
  2. package/assets/compiled/head.css +6 -5
  3. package/assets/css/collapse-definitions.css +41 -0
  4. package/assets/css/create-pdf.css +339 -0
  5. package/assets/css/horizontal-scroll-hint.css +6 -0
  6. package/assets/css/image-full-size.css +1 -5
  7. package/assets/css/index.css +5 -0
  8. package/assets/css/search.css +8 -8
  9. package/assets/css/terms-and-definitions.css +3 -3
  10. package/assets/js/add-bootstrap-classes-to-images.js +2 -5
  11. package/assets/js/collapse-definitions.js +260 -34
  12. package/assets/js/collapse-meta-info.js +37 -10
  13. package/assets/js/collapsibleMenu.js +0 -24
  14. package/assets/js/create-term-filter.js +36 -18
  15. package/assets/js/hide-show-utility-container.js +0 -1
  16. package/assets/js/horizontal-scroll-hint.js +2 -2
  17. package/assets/js/image-full-size.js +0 -2
  18. package/assets/js/insert-trefs.js +135 -49
  19. package/assets/js/search.js +34 -20
  20. package/{src → config}/asset-map.json +1 -0
  21. package/gulpfile.js +1 -1
  22. package/index.js +3 -3
  23. package/jest.config.js +20 -0
  24. package/package.json +3 -2
  25. package/src/collectExternalReferences/fetchTermsFromIndex.1.js +340 -0
  26. package/src/collectExternalReferences/fetchTermsFromIndex.js +1 -1
  27. package/src/collectExternalReferences/processXTrefsData.js +1 -1
  28. package/src/create-pdf.js +330 -21
  29. package/src/health-check/{output-gitignore-checker.js → destination-gitignore-checker.js} +40 -25
  30. package/src/health-check.js +38 -38
  31. package/src/markdown-it-extensions.js +2 -2
  32. package/src/utils/README.md +35 -0
  33. package/src/utils/file-opener.js +89 -0
  34. package/assets/css/pdf-styles.css +0 -170
  35. package/branches.md +0 -17
  36. package/src/README.md +0 -98
  37. /package/{src/config → config}/paths.js +0 -0
@@ -2,16 +2,15 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
- const http = require('http');
6
5
  const https = require('https');
7
- const { execSync } = require('child_process');
6
+ const fileOpener = require('./utils/file-opener');
8
7
 
9
8
  // Import modules from the health-check directory
10
9
  const externalSpecsChecker = require('./health-check/external-specs-checker');
11
10
  const termReferencesChecker = require('./health-check/term-references-checker');
12
11
  const specsConfigurationChecker = require('./health-check/specs-configuration-checker');
13
12
  const termsIntroChecker = require('./health-check/terms-intro-checker');
14
- const outputGitignoreChecker = require('./health-check/output-gitignore-checker');
13
+ const destinationGitignoreChecker = require('./health-check/destination-gitignore-checker');
15
14
  const trefTermChecker = require('./health-check/tref-term-checker');
16
15
 
17
16
  // Configuration
@@ -23,7 +22,7 @@ if (!fs.existsSync(OUTPUT_DIR)) {
23
22
  }
24
23
 
25
24
  // Helper function to read specs.json file
26
- function getRepoInfo() {
25
+ async function getRepoInfo() {
27
26
  try {
28
27
  // Path to the default boilerplate specs.json
29
28
  const defaultSpecsPath = path.join(
@@ -90,7 +89,7 @@ function getRepoInfo() {
90
89
  }
91
90
 
92
91
  // If values have changed, verify the repository exists
93
- const repoExists = checkRepositoryExists(
92
+ const repoExists = await checkRepositoryExists(
94
93
  sourceInfo.host,
95
94
  sourceInfo.account,
96
95
  sourceInfo.repo
@@ -135,34 +134,33 @@ function getRepoInfo() {
135
134
 
136
135
  // Helper function to check if a repository exists
137
136
  function checkRepositoryExists(host, account, repo) {
138
- try {
139
- // For synchronous checking, we'll use a simple HTTP HEAD request
137
+ return new Promise((resolve) => {
140
138
  const url = `https://${host}.com/${account}/${repo}`;
141
139
 
142
- // Simple synchronous HTTP request using execSync
143
- const cmd = process.platform === 'win32'
144
- ? `curl -s -o /nul -w "%{http_code}" -I ${url}`
145
- : `curl -s -o /dev/null -w "%{http_code}" -I ${url}`;
140
+ try {
141
+ const request = https.request(url, { method: 'HEAD', timeout: 10000 }, (response) => {
142
+ // 200, 301, 302 status codes indicate the repo exists
143
+ const exists = [200, 301, 302].includes(response.statusCode);
144
+ resolve(exists);
145
+ });
146
146
 
147
- const statusCode = execSync(cmd).toString().trim();
148
-
149
- // 200, 301, 302 status codes indicate the repo exists
150
- return ['200', '301', '302'].includes(statusCode);
151
- } catch (error) {
152
- console.error('Error checking repository existence:', error);
153
- return false;
154
- }
155
- }
156
-
157
- // Helper function to get the appropriate file open command based on platform
158
- function getOpenCommand() {
159
- if (process.platform === 'win32') {
160
- return 'start';
161
- } else if (process.platform === 'darwin') {
162
- return 'open';
163
- } else {
164
- return 'xdg-open';
165
- }
147
+ request.on('error', (error) => {
148
+ console.error('Error checking repository existence:', error.message);
149
+ resolve(false);
150
+ });
151
+
152
+ request.on('timeout', () => {
153
+ console.error('Timeout checking repository existence');
154
+ request.destroy();
155
+ resolve(false);
156
+ });
157
+
158
+ request.end();
159
+ } catch (error) {
160
+ console.error('Error checking repository existence:', error.message);
161
+ resolve(false);
162
+ }
163
+ });
166
164
  }
167
165
 
168
166
  // Helper function to format current time for the filename
@@ -249,17 +247,17 @@ async function runHealthCheck() {
249
247
  results: termsIntroResults
250
248
  });
251
249
 
252
- // Run output directory gitignore check
253
- const outputGitignoreResults = await outputGitignoreChecker.checkOutputDirGitIgnore(process.cwd());
250
+ // Run destination directory gitignore check
251
+ const destinationGitignoreResults = await destinationGitignoreChecker.checkDestinationGitIgnore(process.cwd());
254
252
  results.push({
255
253
  title: 'Check <code>.gitignore</code>',
256
- results: outputGitignoreResults
254
+ results: destinationGitignoreResults
257
255
  });
258
256
 
259
257
  // Add more checks here in the future
260
258
 
261
259
  // Generate and open the report
262
- generateReport(results);
260
+ await generateReport(results);
263
261
  } catch (error) {
264
262
  console.error('Error running health checks:', error);
265
263
  process.exit(1);
@@ -267,10 +265,10 @@ async function runHealthCheck() {
267
265
  }
268
266
 
269
267
  // Generate HTML report
270
- function generateReport(checkResults) {
268
+ async function generateReport(checkResults) {
271
269
  const timestamp = getFormattedTimestamp();
272
270
  // Get repository information from specs.json
273
- const repoInfo = getRepoInfo();
271
+ const repoInfo = await getRepoInfo();
274
272
  const reportFileName = `health-check-${timestamp}-${repoInfo.account}-${repoInfo.repo}.html`;
275
273
  const reportPath = path.join(OUTPUT_DIR, reportFileName);
276
274
 
@@ -282,8 +280,10 @@ function generateReport(checkResults) {
282
280
 
283
281
  // Open the report in the default browser
284
282
  try {
285
- const openCommand = getOpenCommand();
286
- execSync(`${openCommand} "${reportPath}"`);
283
+ const success = fileOpener.openHtmlFile(reportPath);
284
+ if (!success) {
285
+ console.error('Failed to open the report in browser');
286
+ }
287
287
  } catch (error) {
288
288
  console.error('Failed to open the report:', error);
289
289
  }
@@ -47,7 +47,7 @@ module.exports = function (md, templates = {}) {
47
47
  }
48
48
 
49
49
  // Add the responsive wrapper div before the table
50
- return '<div class="table-responsive">' + originalTableRender(tokens, idx, options, env, self);
50
+ return '<div class="table-responsive-md">' + originalTableRender(tokens, idx, options, env, self);
51
51
  };
52
52
 
53
53
  // Override table_close to close the wrapper div
@@ -256,7 +256,7 @@ module.exports = function (md, templates = {}) {
256
256
  * @return {String} The rendered HTML output
257
257
  */
258
258
  md.renderer.rules.dl_open = function (tokens, idx, options, env, self) {
259
- const targetHtml = 'terminology-section-start-h7vc6omi2hr2880';
259
+ const targetHtml = 'terminology-section-start';
260
260
  let targetIndex = findTargetIndex(tokens, targetHtml);
261
261
 
262
262
  // Add class to the first <dl> only if it comes after the target HTML
@@ -0,0 +1,35 @@
1
+ # Utils Module
2
+
3
+ This directory contains utility modules that provide cross-platform functionality for the Spec-Up-T health check system.
4
+
5
+ ## file-opener.js
6
+
7
+ Provides secure, cross-platform file opening functionality with proper command path resolution.
8
+
9
+ ### Features:
10
+ - **Cross-platform support**: Handles Windows (`start`), macOS (`open`), and Linux (`xdg-open`)
11
+ - **Secure path resolution**: Uses absolute command paths instead of relying on PATH environment variable
12
+ - **Error handling**: Graceful fallback when commands cannot be located
13
+
14
+ ### Functions:
15
+ - `getCommandPath(command)` - Resolves absolute path for a given command
16
+ - `getOpenCommand()` - Returns the platform-specific file opening command path
17
+ - `openFile(filePath)` - Opens any file in its default application
18
+ - `openHtmlFile(htmlFilePath)` - Specifically opens HTML files in the default browser
19
+
20
+ ### Security:
21
+ This module was created to address SonarQube security issues by:
22
+ 1. Eliminating shell injection vulnerabilities through proper argument separation
23
+ 2. Avoiding PATH hijacking by using absolute command paths
24
+ 3. Providing controlled, sanitized command execution
25
+
26
+ ### Usage:
27
+ ```javascript
28
+ const fileOpener = require('./utils/file-opener');
29
+
30
+ // Open an HTML report
31
+ const success = fileOpener.openHtmlFile('/path/to/report.html');
32
+
33
+ // Get absolute path for a command
34
+ const gitPath = fileOpener.getCommandPath('git');
35
+ ```
@@ -0,0 +1,89 @@
1
+ const fs = require('fs');
2
+ const { spawnSync } = require('child_process');
3
+
4
+ /**
5
+ * Helper function to get the absolute path of a command
6
+ * @param {string} command - The command to find
7
+ * @returns {string} - The absolute path to the command or the command name as fallback
8
+ */
9
+ function getCommandPath(command) {
10
+ // Define common system paths where commands are typically located
11
+ const commonPaths = [
12
+ `/usr/bin/${command}`,
13
+ `/bin/${command}`,
14
+ `/usr/local/bin/${command}`,
15
+ `/opt/homebrew/bin/${command}`, // For Homebrew on Apple Silicon Macs
16
+ `/opt/local/bin/${command}`, // For MacPorts
17
+ ];
18
+
19
+ // For Windows, add common Windows paths
20
+ if (process.platform === 'win32') {
21
+ commonPaths.unshift(
22
+ `C:\\Windows\\System32\\${command}.exe`,
23
+ `C:\\Windows\\${command}.exe`,
24
+ `C:\\Program Files\\Git\\bin\\${command}.exe`, // Git for Windows
25
+ `C:\\Program Files (x86)\\Git\\bin\\${command}.exe`
26
+ );
27
+ }
28
+
29
+ // Check each path to see if the command exists
30
+ for (const cmdPath of commonPaths) {
31
+ if (fs.existsSync(cmdPath)) {
32
+ return cmdPath;
33
+ }
34
+ }
35
+
36
+ // If we can't find the absolute path, return the command name as fallback
37
+ // This maintains functionality while logging the issue
38
+ console.warn(`Warning: Could not find absolute path for command '${command}', using relative path as fallback`);
39
+ return command;
40
+ }
41
+
42
+ /**
43
+ * Get the appropriate file open command based on platform
44
+ * @returns {string} - The absolute path to the platform-specific open command
45
+ */
46
+ function getOpenCommand() {
47
+ let command;
48
+ if (process.platform === 'win32') {
49
+ command = 'start';
50
+ } else if (process.platform === 'darwin') {
51
+ command = 'open';
52
+ } else {
53
+ command = 'xdg-open';
54
+ }
55
+
56
+ return getCommandPath(command);
57
+ }
58
+
59
+ /**
60
+ * Open a file in the default application for the current platform
61
+ * @param {string} filePath - The path to the file to open
62
+ * @returns {boolean} - True if the file was opened successfully, false otherwise
63
+ */
64
+ function openFile(filePath) {
65
+ try {
66
+ const openCommand = getOpenCommand();
67
+ const result = spawnSync(openCommand, [filePath], { stdio: 'ignore' });
68
+ return result.status === 0;
69
+ } catch (error) {
70
+ console.error('Failed to open file:', error);
71
+ return false;
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Open an HTML file in the default web browser
77
+ * @param {string} htmlFilePath - The path to the HTML file to open
78
+ * @returns {boolean} - True if the file was opened successfully, false otherwise
79
+ */
80
+ function openHtmlFile(htmlFilePath) {
81
+ return openFile(htmlFilePath);
82
+ }
83
+
84
+ module.exports = {
85
+ getCommandPath,
86
+ getOpenCommand,
87
+ openFile,
88
+ openHtmlFile
89
+ };
@@ -1,170 +0,0 @@
1
- /* PDF Styling for optimized print layout */
2
-
3
- /* Target the pdf-document class that's added during PDF generation */
4
-
5
- /* Reset all margins and paddings */
6
- .pdf-document * {
7
- box-sizing: border-box !important;
8
- }
9
-
10
- /* Body and main container styling */
11
- body.pdf-document {
12
- max-width: 100% !important;
13
- width: 100% !important;
14
- margin: 0 !important;
15
- padding: 0 !important;
16
- overflow-x: hidden !important;
17
- }
18
-
19
- /* Extremely aggressive content width adjustment */
20
- .pdf-document .container,
21
- .pdf-document main,
22
- .pdf-document section,
23
- .pdf-document article,
24
- .pdf-document .content,
25
- .pdf-document div[class*="container"],
26
- .pdf-document div[class*="col-"],
27
- .pdf-document .row {
28
- max-width: 95% !important;
29
- width: 95% !important;
30
- margin-left: auto !important;
31
- margin-right: auto !important;
32
- padding-left: 0 !important;
33
- padding-right: 0 !important;
34
- }
35
-
36
- /* Override any Bootstrap container constraints */
37
- .pdf-document .container,
38
- .pdf-document .container-sm,
39
- .pdf-document .container-md,
40
- .pdf-document .container-lg,
41
- .pdf-document .container-xl {
42
- max-width: 95% !important;
43
- }
44
-
45
- /* Table adjustments */
46
- .pdf-document table {
47
- width: 100% !important;
48
- max-width: 100% !important;
49
- margin-bottom: 1rem;
50
- table-layout: fixed !important;
51
- }
52
-
53
- /* Header styling */
54
- .pdf-document .pdf-title {
55
- font-size: 24pt !important;
56
- margin-bottom: 0.5rem !important;
57
- }
58
-
59
- /* Images in PDF */
60
- .pdf-document img {
61
- max-width: 100% !important;
62
- height: auto !important;
63
- }
64
-
65
- /* Code blocks */
66
- .pdf-document pre,
67
- .pdf-document code {
68
- white-space: pre-wrap !important;
69
- word-break: break-word !important;
70
- max-width: 100% !important;
71
- overflow: visible !important;
72
- }
73
-
74
- /* Ensure proper page breaks */
75
- .pdf-document h1,
76
- .pdf-document h2,
77
- .pdf-document h3,
78
- .pdf-document h4 {
79
- page-break-after: avoid;
80
- page-break-inside: avoid;
81
- }
82
-
83
- .pdf-document table,
84
- .pdf-document figure {
85
- page-break-inside: avoid;
86
- }
87
-
88
- /* Force any fixed-position elements to static */
89
- .pdf-document .fixed-top,
90
- .pdf-document .fixed-bottom,
91
- .pdf-document .sticky-top,
92
- .pdf-document .position-fixed,
93
- .pdf-document .position-sticky {
94
- position: static !important;
95
- }
96
-
97
- /* Aggressively set all columns to take up more space */
98
- .pdf-document .col,
99
- .pdf-document [class*="col-"] {
100
- flex: 0 0 100% !important;
101
- max-width: 100% !important;
102
- padding-left: 0 !important;
103
- padding-right: 0 !important;
104
- }
105
-
106
- /* ====== DEFINITION LIST STYLING FOR PDF ====== */
107
- /* Remove background and borders from terms and definitions in PDF */
108
- .pdf-document dl.terms-and-definitions-list>dt,
109
- .pdf-document dl.terms-and-definitions-list>dd {
110
- background-color: transparent !important;
111
- border: none !important;
112
- border-radius: 0 !important;
113
- padding: 0.5rem 0 !important;
114
- color: #000 !important;
115
- /* Ensure good page breaks in definition lists */
116
- page-break-inside: avoid !important;
117
- }
118
-
119
- /* Fix spacing between terms */
120
- .pdf-document dl.terms-and-definitions-list>dt {
121
- margin-top: 1em !important;
122
- font-weight: bold !important;
123
- page-break-after: avoid !important;
124
- }
125
-
126
- /* Hide toggle buttons in PDF output */
127
- .pdf-document .meta-info-toggle-button {
128
- display: none !important;
129
- }
130
-
131
- /* Always show meta-info content in PDF */
132
- .pdf-document dl>dd.meta-info-content-wrapper,
133
- .pdf-document dl>dd.collapsed.meta-info-content-wrapper {
134
- display: block !important;
135
- max-height: none !important;
136
- height: auto !important;
137
- overflow: visible !important;
138
- padding: 0.5rem 0 !important;
139
- margin: 0 !important;
140
- line-height: normal !important;
141
- }
142
-
143
- /* Transclusion styling for PDF */
144
- .pdf-document dt.transcluded-xref-term,
145
- .pdf-document dd.transcluded-xref-term {
146
- background: transparent !important;
147
- background-color: transparent !important;
148
- }
149
-
150
- /* Remove any other visual indicators that aren't needed in PDF */
151
- .pdf-document dl.terms-and-definitions-list>dt::before,
152
- .pdf-document dl.terms-and-definitions-list>dd::before {
153
- display: none !important;
154
- }
155
-
156
- /* Ensure all definition content is visible in PDF */
157
- .pdf-document dl.terms-and-definitions-list dd p {
158
- padding-left: 0 !important;
159
- }
160
-
161
- /* Improve table display in definitions for PDF */
162
- .pdf-document dl.terms-and-definitions-list dd table {
163
- margin: 0.5em 0 !important;
164
- border-collapse: collapse !important;
165
- }
166
-
167
- .pdf-document dl.terms-and-definitions-list dd table th,
168
- .pdf-document dl.terms-and-definitions-list dd table td {
169
- border: 0.5pt solid #888 !important;
170
- }
package/branches.md DELETED
@@ -1,17 +0,0 @@
1
- # Beschrijving van de branches
2
-
3
- ## improve/compact-terms
4
-
5
- Maak de termen weergave meer compact
6
- Filters
7
-
8
-
9
- ## various
10
-
11
-
12
- ## test/xtrefnew
13
-
14
- Lokaal Bewaren
15
- Lijkt goed te werken.
16
- Met AI gebouwde oplossing waarbij ik probeer iets aan de API limieten te doen. Ik heb twee belangrijke bestanden weggedaan en AI ze opnieuw laten bouwen op basis van een prompt en de bestanden die ik had. Het lijkt te werken, maar ik heb geen idee of het goed is. Het is een beetje een experiment.
17
-
package/src/README.md DELETED
@@ -1,98 +0,0 @@
1
- <h1>Spec-Up-T External References Collection Workflow</h1>
2
- <p>This codebase implements a system for collecting and processing cross-specification references from markdown files. Here's a workflow diagram of what happens when <a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collect-external-references.js#37%2C10" data-keybinding-context="1187"><span class="icon-label">collectExternalReferences()</span></a> is called:</p>
3
- <h2>Workflow Overview</h2>
4
- <ol>
5
- <li>
6
- <p><strong>Initialization &amp; Configuration</strong></p>
7
- <ul>
8
- <li>Loads environment variables using dotenv</li>
9
- <li>Reads <a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collect-external-references.js#42%2C39" data-keybinding-context="1188"><span class="icon-label">specs.json</span></a> configuration file</li>
10
- <li>Obtains GitHub Personal Access Token (PAT) from options or environment variables</li>
11
- </ul>
12
- </li>
13
- <li>
14
- <p><strong>Validation Checks</strong></p>
15
- <ul>
16
- <li>Verifies GitHub PAT is available, stops with instructions if missing</li>
17
- <li>Confirms external repositories are configured in specs.json</li>
18
- <li>Validates repository URLs using <a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/utils/doesUrlExist.js#8%2C16" data-keybinding-context="1189"><span class="icon-label">doesUrlExist.js</span></a></li>
19
- </ul>
20
- </li>
21
- <li>
22
- <p><strong>Content Collection</strong></p>
23
- <ul>
24
- <li>Creates necessary output directories</li>
25
- <li>Reads all markdown files from specified term directories</li>
26
- <li>Concatenates content into a single string for processing</li>
27
- </ul>
28
- </li>
29
- <li>
30
- <p><strong>Cross-Reference Extraction</strong></p>
31
- <ul>
32
- <li>Uses regex to find <code>[[xref:...]]</code> and <code>[[tref:...]]</code> patterns in markdown</li>
33
- <li>Processes these patterns into structured objects with <a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collect-external-references.js#158%2C58" data-keybinding-context="1190"><span class="icon-label">externalSpec</span></a> and <a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collect-external-references.js#186%2C64" data-keybinding-context="1191"><span class="icon-label">term</span></a> properties</li>
34
- <li>Filters out duplicates and keeps only references found in current markdown content</li>
35
- </ul>
36
- </li>
37
- <li>
38
- <p><strong>Metadata Enhancement</strong></p>
39
- <ul>
40
- <li>Extends each reference with additional repository information:
41
- <ul>
42
- <li>Repository URL</li>
43
- <li>Owner/repo names</li>
44
- <li>Terms directory path</li>
45
- <li>Avatar URL</li>
46
- </ul>
47
- </li>
48
- </ul>
49
- </li>
50
- <li>
51
- <p><strong>GitHub API Interaction</strong></p>
52
- <ul>
53
- <li>For each reference, calls <a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collectExternalReferences/fetchTermsFromGitHubRepository.js#16%2C16" data-keybinding-context="1192"><span class="icon-label">fetchTermsFromGitHubRepository</span></a> which:
54
- <ul>
55
- <li>Uses Octokit to interface with GitHub API</li>
56
- <li>Implements caching to minimize API requests</li>
57
- <li>Handles rate limiting with throttling and retries</li>
58
- <li>Searches for terms within specified repositories/directories</li>
59
- </ul>
60
- </li>
61
- </ul>
62
- </li>
63
- <li>
64
- <p><strong>Term Content Processing</strong></p>
65
- <ul>
66
- <li>When terms are found, retrieves:
67
- <ul>
68
- <li>File content</li>
69
- <li>Latest commit hash</li>
70
- <li>Repository metadata</li>
71
- </ul>
72
- </li>
73
- <li>Uses <a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collectExternalReferences/matchTerm.js#3%2C10" data-keybinding-context="1193"><span class="icon-label">matchTerm.js</span></a> to validate the term within content</li>
74
- </ul>
75
- </li>
76
- <li>
77
- <p><strong>Output Generation</strong></p>
78
- <ul>
79
- <li>Creates three output files:
80
- <ul>
81
- <li><code>.cache/xtrefs-data.json</code> - JSON data file</li>
82
- <li><code>.cache/xtrefs-data.js</code> - JavaScript module file</li>
83
- <li><code>.cache/xtrefs-history/xtrefs-data-[timestamp].js</code> - Historical record</li>
84
- </ul>
85
- </li>
86
- </ul>
87
- </li>
88
- </ol>
89
- <h2>Key Functions</h2>
90
- <ul>
91
- <li><a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collect-external-references.js#37%2C10" data-keybinding-context="1194"><span class="icon-label">collectExternalReferences()</span></a>: Main orchestration function</li>
92
- <li><a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collect-external-references.js#143%2C18" data-keybinding-context="1195"><span class="icon-label">extendXTrefs()</span></a>: Adds repository metadata to references</li>
93
- <li><a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collect-external-references.js#192%2C18" data-keybinding-context="1196"><span class="icon-label">processXTref()</span></a>: Parses reference syntax into structured objects</li>
94
- <li><a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collect-external-references.js#184%2C18" data-keybinding-context="1197"><span class="icon-label">isXTrefInMarkdown()</span></a>: Validates references against current content</li>
95
- <li><a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collectExternalReferences/fetchTermsFromGitHubRepository.js#16%2C16" data-keybinding-context="1198"><span class="icon-label">fetchTermsFromGitHubRepository()</span></a>: Interacts with GitHub API to find terms</li>
96
- <li><a class="chat-inline-anchor-widget show-file-icons" title="" draggable="true" href="vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html" data-href="file:///Users/kor/webdev/Blockchain-Bird/KERI/Spec-Up/active-bcb/spec-up-t/spec-up-t/src/collectExternalReferences/processXTrefsData.js#9%2C16" data-keybinding-context="1199"><span class="icon-label">processXTrefsData()</span></a>: Processes the data and generates output files</li>
97
- </ul>
98
- <p>This system enables cross-specification linking by fetching and maintaining references to terms defined in external GitHub repositories, ensuring that documentation can link to canonical definitions maintained elsewhere.</p>
File without changes