refactor(runtime): compose consumers over fs and subprocess

This commit is contained in:
Tianyi Cui
2026-07-28 23:00:00 +08:00
parent 987d477cfc
commit 8917ff8ef4
116 changed files with 2828 additions and 1122 deletions

View File

@@ -1,9 +1,10 @@
import { defineConfig } from 'tsdown'
/**
* Build the index and worker as separate single-entry bundles. The sibling `worker.cjs` is loaded
* by file and must be CommonJS for pkg's VFS Worker hook. A multi-entry build emits an unlisted
* shared chunk omitted by the package's exact `files` whitelist; separate builds inline it.
* Build the plugin, reusable runtime host, and worker as separate bundles. The
* sibling `worker.cjs` is loaded by file and must be CommonJS for pkg's VFS
* Worker hook. Separate builds inline shared implementation instead of
* emitting an unlisted chunk outside the exact `files` whitelist.
*/
export default defineConfig([
{
@@ -16,6 +17,16 @@ export default defineConfig([
dts: false,
clean: false,
},
{
entry: ['lib/types/runtime-host.js'],
outDir: 'lib',
format: ['esm'],
platform: 'node',
target: 'es2024',
fixedExtension: false,
dts: false,
clean: false,
},
{
entry: ['lib/types/worker.js'],
outDir: 'lib',