diff --git a/AGENTS.md b/AGENTS.md index 99dd0131b65..ff847646234 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,9 @@ Superset is an agent-first development platform, with an Electron desktop IDE, Next.js web apps, and an Expo mobile app as the main customer-facing surfaces. It's a Turborepo monorepo, deployed apps are in apps/ and supporting packages are in packages/, and we use tRPC for the api. -You're working inside a Superset workspace, an isolated git-worktree copy of this repo. "Workspace" in a user message means that, not an editor workspace. +You're working inside a Superset workspace, an isolated checkout of this repo — a git worktree on a +machine someone owns, a plain clone at `/workspace` in a cloud workspace. "Workspace" in a user +message means that, not an editor workspace. ## Project Structure diff --git a/packages/cli-framework/src/dev.ts b/packages/cli-framework/src/dev.ts index ca837b2f8bd..4cda5c6bbca 100644 --- a/packages/cli-framework/src/dev.ts +++ b/packages/cli-framework/src/dev.ts @@ -9,6 +9,8 @@ export async function runDev(argv: string[]): Promise { const { config, root } = await loadConfig(process.cwd()); const commandsDir = resolve(root, config.commandsDir); + for (const plugin of config.plugins ?? []) Bun.plugin(plugin); + const commandFiles = Array.from( new Glob("**/command.ts").scanSync({ cwd: commandsDir, diff --git a/packages/i18n/src/bun-plugin.ts b/packages/i18n/src/bun-plugin.ts index 9ff61409d68..65dda3af255 100644 --- a/packages/i18n/src/bun-plugin.ts +++ b/packages/i18n/src/bun-plugin.ts @@ -9,9 +9,15 @@ export const linguiMacroPlugin: BunPlugin = { name: "lingui-macro", setup(build) { build.onLoad({ filter: /\.tsx?$/ }, async ({ path }) => { - if (path.includes("/node_modules/")) return undefined; + // Returning undefined is a pass-through for Bun.build but an error + // under Bun.plugin, so every branch hands back contents. + const loader = path.endsWith(".tsx") ? "tsx" : "ts"; const code = await Bun.file(path).text(); - if (!code.includes("@lingui/core/macro")) return undefined; + if ( + path.includes("/node_modules/") || + !code.includes("@lingui/core/macro") + ) + return { contents: code, loader }; const result = await transformAsync(code, { filename: path, babelrc: false, @@ -19,11 +25,7 @@ export const linguiMacroPlugin: BunPlugin = { parserOpts: { plugins: ["typescript"] }, plugins: [linguiMacro], }); - if (!result?.code) return undefined; - return { - contents: result.code, - loader: path.endsWith(".tsx") ? "tsx" : "ts", - }; + return { contents: result?.code ?? code, loader }; }); }, };