Complete core ES module migration with build system and tests
- Enhanced build system to generate ESM, UMD, and minified formats - Fixed test extraction script to properly parse OxJS inline tests - Added comprehensive test infrastructure with Vitest - Successfully extracted 22 test files from inline documentation - Verified builds work in browser and Node.js environments - Maintained full backward compatibility with Ox.load() pattern - Updated .gitignore to exclude build artifacts (dev/, min/, dist/, test/extracted/) Generated with AI assistance
This commit is contained in:
parent
a8a7dc9445
commit
d51d3f60f1
11 changed files with 597 additions and 21 deletions
|
|
@ -47,10 +47,26 @@ function parseDocComments(source, filename) {
|
|||
*/
|
||||
function parseDocContent(content, filename) {
|
||||
const lines = content.split('\n');
|
||||
const firstLine = lines[0].trim();
|
||||
const itemMatch = firstLine.match(re.item);
|
||||
|
||||
if (!itemMatch) return null;
|
||||
// Find the first non-empty line that matches the item pattern
|
||||
let itemMatch = null;
|
||||
let itemName = 'Unknown';
|
||||
|
||||
for (const line of lines) {
|
||||
const trimmed = line.trim();
|
||||
if (trimmed) {
|
||||
itemMatch = trimmed.match(re.item);
|
||||
if (itemMatch) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!itemMatch) {
|
||||
// If no item match, still try to extract tests with a generic name
|
||||
// This handles cases where tests are in script blocks or without proper headers
|
||||
itemMatch = ['', filename.replace(/.*\//, '').replace('.js', ''), 'tests', ''];
|
||||
}
|
||||
|
||||
const doc = {
|
||||
name: itemMatch[1],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue