diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index e2347e3..96ee0ce 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -25,6 +25,23 @@ runs: git clone --depth 1 https://github.com/singi-labs/barazo-lexicons.git ../barazo-lexicons cd ../barazo-lexicons && pnpm install --ignore-scripts && pnpm run build + - name: Clone and build barazo-plugins (frontend only) + shell: bash + run: | + git clone --depth 1 https://github.com/singi-labs/barazo-plugins.git ../barazo-plugins + cd ../barazo-plugins && pnpm install --ignore-scripts + cd packages/plugin-signatures && npx tsc -p tsconfig.frontend.json + - name: Install dependencies shell: bash run: pnpm install --frozen-lockfile + + - name: Replace plugin symlinks for Turbopack compatibility + shell: bash + run: | + LINK=node_modules/@barazo/plugin-signatures + if [ -L "$LINK" ]; then + TARGET=$(realpath "$LINK") + rm "$LINK" + cp -r "$TARGET" "$LINK" + fi diff --git a/src/lib/plugins/loader.ts b/src/lib/plugins/loader.ts index a4275d5..3249677 100644 --- a/src/lib/plugins/loader.ts +++ b/src/lib/plugins/loader.ts @@ -20,25 +20,12 @@ function createRegistryAdapter(pluginName: string): PluginComponentRegistry { } } -// Map of bundled plugin names to their frontend register module paths. -// Dynamic import uses a variable so TypeScript doesn't statically resolve the -// module — this lets CI pass without the workspace plugin packages checked out. -const BUNDLED_PLUGIN_PATHS: Record = { - '@barazo/plugin-signatures': '@barazo/plugin-signatures/frontend/register', -} - -function pluginLoader( - modulePath: string -): () => Promise<{ register: (r: PluginComponentRegistry) => void }> { - return () => import(/* webpackIgnore: true */ modulePath) -} - const BUNDLED_PLUGINS: Record< string, () => Promise<{ register: (r: PluginComponentRegistry) => void }> -> = Object.fromEntries( - Object.entries(BUNDLED_PLUGIN_PATHS).map(([name, path]) => [name, pluginLoader(path)]) -) +> = { + '@barazo/plugin-signatures': () => import('@barazo/plugin-signatures/frontend/register'), +} let loaded = false