get npm build to somehow work
This commit is contained in:
parent
d51d3f60f1
commit
b2056d4e2b
18 changed files with 3174 additions and 320 deletions
45
scripts/debug-extract.js
Normal file
45
scripts/debug-extract.js
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Test with a known file that has tests
|
||||
const testFile = path.join(__dirname, '../source/Ox/js/Array.js');
|
||||
const source = fs.readFileSync(testFile, 'utf-8');
|
||||
|
||||
// Regular expressions from Ox.doc
|
||||
const re = {
|
||||
multiline: /\/\*@([\w\W]+?)@?\*\//g,
|
||||
singleline: /\/\/@\s*(.*?)\s*$/gm,
|
||||
test: /^\s*>\s+(.+)$/,
|
||||
expected: /^\s*([^>].*)$/,
|
||||
item: /^(.+?)\s+<(.+?)>\s+(.+?)$/,
|
||||
};
|
||||
|
||||
// Find all multiline comments
|
||||
let match;
|
||||
let found = 0;
|
||||
console.log('Searching for /*@ comments in Array.js...\n');
|
||||
|
||||
while ((match = re.multiline.exec(source)) !== null) {
|
||||
found++;
|
||||
const content = match[1];
|
||||
const lines = content.split('\n');
|
||||
const firstLine = lines[0].trim();
|
||||
|
||||
console.log(`Found comment #${found}:`);
|
||||
console.log('First line:', firstLine);
|
||||
|
||||
// Look for tests
|
||||
let testCount = 0;
|
||||
for (const line of lines) {
|
||||
if (line.match(re.test)) {
|
||||
testCount++;
|
||||
console.log(' Test:', line);
|
||||
}
|
||||
}
|
||||
console.log(` Total tests in this block: ${testCount}`);
|
||||
console.log('');
|
||||
}
|
||||
|
||||
console.log(`\nTotal doc blocks found: ${found}`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue