Skip to content

Commit 348ca73

Browse files
committed
support common-runtime
1 parent 818e49d commit 348ca73

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./common_runtime.js";

typescript/packages/lookslike-high-level/bundle-type-defs.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const modules = [
1313
'@commontools/common-html',
1414
'@commontools/common-builder',
1515
'@commontools/common-runner',
16+
'@commontools/common-runtime',
1617
'@commontools/common-propagator',
1718
];
1819

@@ -33,17 +34,22 @@ const moduleTypeDefs = {};
3334

3435
modules.forEach(async (module) => {
3536
let dtsPath;
36-
if (module.startsWith('@commontools/')) {
37+
if (module === '@commontools/common-runtime') {
38+
dtsPath = path.resolve(__dirname, '..', 'common-runtime');
39+
} else if (module.startsWith('@commontools/')) {
3740
dtsPath = path.resolve(__dirname, '..', module.replace('@commontools/', ''), 'lib');
3841
} else if (module.startsWith('../') || module.startsWith('./')) {
3942
dtsPath = path.resolve(__dirname, module.replace('.js', '.d.ts'));
4043
}
4144

42-
glob.sync('*.d.ts', { cwd: dtsPath }).forEach((file) => {
45+
const dtsFiles = module === '@commontools/common-runtime'
46+
? ['common_runtime.d.ts', 'common_runtime_bg.wasm.d.ts', 'index.d.ts']
47+
: glob.sync('*.d.ts', { cwd: dtsPath });
48+
49+
dtsFiles.forEach((file) => {
4350
console.log('file', file);
4451
moduleTypeDefs[`node_modules/${module}/${file}`] = fs.readFileSync(path.join(dtsPath, file), 'utf-8');
4552
});
46-
4753
});
4854

4955
const libFiles = glob.sync('lib.*.d.ts', { cwd: tsLibDir });

typescript/packages/lookslike-high-level/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"scripts": {
1010
"dev": "npm run build && npx vite",
1111
"test": "npm run build && vitest",
12-
"bundle-type-defs": "node bundle-type-defs.js",
1312
"build": "wireit",
1413
"clean": "wireit"
1514
},
@@ -38,10 +37,14 @@
3837
"../common-frp:build",
3938
"../common-html:build",
4039
"../lookslike-sagas:build",
41-
"../llm-client:build"
40+
"../llm-client:build",
41+
"bundle-type-defs"
4242
],
4343
"command": "vite build"
4444
},
45+
"bundle-type-defs": {
46+
"command": "node bundle-type-defs.js"
47+
},
4548
"clean": {
4649
"command": "rm -rf ./lib ./dist ./.wireit ./node_modules"
4750
}

0 commit comments

Comments
 (0)