Import ISA Project Format 1.1.0

This commit is contained in:
Peter Willemsen
2026-11-30 12:07:49 +00:00
commit 563d1992a2
32 changed files with 2308 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import {readdir,readFile} from 'node:fs/promises';
import {fileURLToPath} from 'node:url';
import {execFileSync} from 'node:child_process';
import {compile} from 'svelte/compiler';
const root=new URL('../',import.meta.url);
async function validate(directory) {
for(const entry of await readdir(directory,{withFileTypes:true})) {
const path=new URL(entry.name,directory);
if(entry.isDirectory()){await validate(new URL(`${entry.name}/`,directory));continue;}
if(entry.name.endsWith('.js')&&!fileURLToPath(path).includes('/components/index.js'))execFileSync(process.execPath,['--check',fileURLToPath(path)]);
if(entry.name.endsWith('.svelte'))compile(await readFile(path,'utf8'),{filename:fileURLToPath(path),generate:'client'});
}
}
await validate(new URL('src/',root));
console.log('ESM and Svelte components validated');