Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions packages/cli-framework/src/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export async function runDev(argv: string[]): Promise<void> {
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,
Expand Down
16 changes: 9 additions & 7 deletions packages/i18n/src/bun-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@ 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,
configFile: false,
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 };
});
},
};
Loading