still don't have modules. instead will load all source in /cg/ dir, in alpha filename order

This commit is contained in:
Dustin Swan 2026-02-09 14:04:26 -07:00
parent 0deb8f6307
commit 559191c65e
No known key found for this signature in database
GPG key ID: 30D46587E2100467
8 changed files with 8 additions and 58 deletions

View file

@ -4,19 +4,15 @@ import { Parser } from './parser'
import { runAppCompiled } from './runtime-compiled'
import { _rt } from './runtime-js'
import stdlibCode from './cg/stdlib.cg?raw';
import designTokensCode from './cg/design-tokens.cg?raw';
import uiComponentsCode from './cg/ui-components.cg?raw';
import osCode from './cg/os.cg?raw';
const modules = import.meta.glob('./cg/*.cg', { as: 'raw', eager: true });
const cgCode = Object.keys(modules)
.sort()
.map(key => modules[key])
.join('\n');
const canvas = document.createElement('canvas') as HTMLCanvasElement;
document.body.appendChild(canvas);
const cgCode = stdlibCode + '\n' +
designTokensCode + '\n' +
uiComponentsCode + '\n' +
osCode + '\n'
try {
const tokens = tokenize(cgCode);
const parser = new Parser(tokens, cgCode);