still don't have modules. instead will load all source in /cg/ dir, in alpha filename order
This commit is contained in:
parent
0deb8f6307
commit
559191c65e
8 changed files with 8 additions and 58 deletions
14
src/main.ts
14
src/main.ts
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue