History

fix circlular deps

Rhys Sullivan committed 7 months ago

Commit 2c75d0e1 parent a3cd17b12 files · +64 −58Browse files

Unified · Split

12 files
  1. apps/cloud/package.json +1 −0
  2. apps/cloud/src/routes/index.tsx +12 −1
  3. apps/cloud/src/routes/secrets.tsx +4 −1
  4. apps/cloud/src/routes/sources.add.$pluginKey.tsx +12 −1
  5. apps/local/src/routes/index.tsx +12 −1
  6. apps/local/src/routes/secrets.tsx +4 −1
  7. apps/local/src/routes/sources.add.$pluginKey.tsx +12 −1
  8. bun.lock +1 −5
  9. packages/react/package.json +0 −5
  10. packages/react/src/pages/secrets.tsx +2 −10
  11. packages/react/src/pages/sources-add.tsx +2 −16
  12. packages/react/src/pages/sources.tsx +2 −16
apps/cloud/package.json+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 "@executor/plugin-google-discovery": "workspace:*",
1212 "@executor/plugin-graphql": "workspace:*",
1313 "@executor/plugin-mcp": "workspace:*",
14+ "@executor/plugin-onepassword": "workspace:*",
1415 "@executor/plugin-openapi": "workspace:*",
1516 "@executor/react": "workspace:*",
1617 "@executor/sdk": "workspace:*",
apps/cloud/src/routes/index.tsx+12−1
@@ -1,6 +1,17 @@
11 import { createFileRoute } from "@tanstack/react-router";
22 import { SourcesPage } from "@executor/react/pages/sources";
3+import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
4+import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
5+import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
6+import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";
7+
8+const sourcePlugins = [
9+ openApiSourcePlugin,
10+ mcpSourcePlugin,
11+ googleDiscoverySourcePlugin,
12+ graphqlSourcePlugin,
13+];
314
415 export const Route = createFileRoute("/")({
5− component: SourcesPage,
16+ component: () => <SourcesPage sourcePlugins={sourcePlugins} />,
617 });
apps/cloud/src/routes/secrets.tsx+4−1
@@ -1,6 +1,9 @@
11 import { createFileRoute } from "@tanstack/react-router";
22 import { SecretsPage } from "@executor/react/pages/secrets";
3+import { onePasswordSecretProviderPlugin } from "@executor/plugin-onepassword/react";
4+
5+const secretProviderPlugins = [onePasswordSecretProviderPlugin];
36
47 export const Route = createFileRoute("/secrets")({
5− component: SecretsPage,
8+ component: () => <SecretsPage secretProviderPlugins={secretProviderPlugins} />,
69 });
apps/cloud/src/routes/sources.add.$pluginKey.tsx+12−1
@@ -1,6 +1,17 @@
11 import { Schema } from "effect";
22 import { createFileRoute } from "@tanstack/react-router";
33 import { SourcesAddPage } from "@executor/react/pages/sources-add";
4+import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
5+import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
6+import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
7+import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";
8+
9+const sourcePlugins = [
10+ openApiSourcePlugin,
11+ mcpSourcePlugin,
12+ googleDiscoverySourcePlugin,
13+ graphqlSourcePlugin,
14+];
415
516 const SearchParams = Schema.standardSchemaV1(
617 Schema.Struct({
@@ -14,6 +25,6 @@ export const Route = createFileRoute("/sources/add/$pluginKey")({ · 7 unmodified lines
1425 component: () => {
1526 const { pluginKey } = Route.useParams();
1627 const { url, preset } = Route.useSearch();
17− return <SourcesAddPage pluginKey={pluginKey} url={url} preset={preset} />;
28+ return <SourcesAddPage pluginKey={pluginKey} url={url} preset={preset} sourcePlugins={sourcePlugins} />;
1829 },
1930 });
apps/local/src/routes/index.tsx+12−1
@@ -1,6 +1,17 @@
11 import { createFileRoute } from "@tanstack/react-router";
22 import { SourcesPage } from "@executor/react/pages/sources";
3+import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
4+import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
5+import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
6+import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";
7+
8+const sourcePlugins = [
9+ openApiSourcePlugin,
10+ mcpSourcePlugin,
11+ googleDiscoverySourcePlugin,
12+ graphqlSourcePlugin,
13+];
314
415 export const Route = createFileRoute("/")({
5− component: SourcesPage,
16+ component: () => <SourcesPage sourcePlugins={sourcePlugins} />,
617 });
apps/local/src/routes/secrets.tsx+4−1
@@ -1,6 +1,9 @@
11 import { createFileRoute } from "@tanstack/react-router";
22 import { SecretsPage } from "@executor/react/pages/secrets";
3+import { onePasswordSecretProviderPlugin } from "@executor/plugin-onepassword/react";
4+
5+const secretProviderPlugins = [onePasswordSecretProviderPlugin];
36
47 export const Route = createFileRoute("/secrets")({
5− component: SecretsPage,
8+ component: () => <SecretsPage secretProviderPlugins={secretProviderPlugins} />,
69 });
apps/local/src/routes/sources.add.$pluginKey.tsx+12−1
@@ -1,6 +1,17 @@
11 import { Schema } from "effect";
22 import { createFileRoute } from "@tanstack/react-router";
33 import { SourcesAddPage } from "@executor/react/pages/sources-add";
4+import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
5+import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
6+import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
7+import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";
8+
9+const sourcePlugins = [
10+ openApiSourcePlugin,
11+ mcpSourcePlugin,
12+ googleDiscoverySourcePlugin,
13+ graphqlSourcePlugin,
14+];
415
516 const SearchParams = Schema.standardSchemaV1(
617 Schema.Struct({
@@ -14,6 +25,6 @@ export const Route = createFileRoute("/sources/add/$pluginKey")({ · 7 unmodified lines
1425 component: () => {
1526 const { pluginKey } = Route.useParams();
1627 const { url, preset } = Route.useSearch();
17− return <SourcesAddPage pluginKey={pluginKey} url={url} preset={preset} />;
28+ return <SourcesAddPage pluginKey={pluginKey} url={url} preset={preset} sourcePlugins={sourcePlugins} />;
1829 },
1930 });
bun.lock+1−5
@@ -50,6 +50,7 @@ · 49 unmodified lines
5050 "@executor/plugin-google-discovery": "workspace:*",
5151 "@executor/plugin-graphql": "workspace:*",
5252 "@executor/plugin-mcp": "workspace:*",
53+ "@executor/plugin-onepassword": "workspace:*",
5354 "@executor/plugin-openapi": "workspace:*",
5455 "@executor/react": "workspace:*",
5556 "@executor/sdk": "workspace:*",
@@ -515,11 +516,6 @@ · 459 unmodified lines
515516 "@effect-atom/atom-react": "^0.5.0",
516517 "@effect/platform": "catalog:",
517518 "@executor/api": "workspace:*",
518− "@executor/plugin-google-discovery": "workspace:*",
519− "@executor/plugin-graphql": "workspace:*",
520− "@executor/plugin-mcp": "workspace:*",
521− "@executor/plugin-onepassword": "workspace:*",
522− "@executor/plugin-openapi": "workspace:*",
523519 "@executor/sdk": "workspace:*",
524520 "@shikijs/langs": "^4.0.2",
525521 "@shikijs/themes": "^4.0.2",
packages/react/package.json+0−5
@@ -17,11 +17,6 @@ · 16 unmodified lines
1717 "@effect/platform": "catalog:",
1818 "@effect-atom/atom-react": "^0.5.0",
1919 "@executor/api": "workspace:*",
20− "@executor/plugin-google-discovery": "workspace:*",
21− "@executor/plugin-graphql": "workspace:*",
22− "@executor/plugin-mcp": "workspace:*",
23− "@executor/plugin-onepassword": "workspace:*",
24− "@executor/plugin-openapi": "workspace:*",
2520 "@executor/sdk": "workspace:*",
2621 "@tanstack/react-router": "catalog:",
2722 "@shikijs/langs": "^4.0.2",
packages/react/src/pages/secrets.tsx+2−10
@@ -4,7 +4,6 @@ import { secretsAtom, setSecret, removeSecret } from "../api/atoms"; · 3 unmodified lines
44 import type { SecretProviderPlugin } from "../plugins/secret-provider-plugin";
55 import { SecretId } from "@executor/sdk";
66 import { useScope } from "../hooks/use-scope";
7−import { onePasswordSecretProviderPlugin } from "@executor/plugin-onepassword/react";
87 import {
98 Dialog,
109 DialogContent,
@@ -256,19 +255,12 @@ function SecretRow(props: { · 245 unmodified lines
256255 );
257256 }
258257
259−// ---------------------------------------------------------------------------
260−// Secret provider plugins
261−// ---------------------------------------------------------------------------
262−
263−const secretProviderPlugins: SecretProviderPlugin[] = [
264− onePasswordSecretProviderPlugin,
265−];
266−
267258 // ---------------------------------------------------------------------------
268259 // Page
269260 // ---------------------------------------------------------------------------
270261
271−export function SecretsPage() {
262+export function SecretsPage(props: { secretProviderPlugins: readonly SecretProviderPlugin[] }) {
263+ const { secretProviderPlugins } = props;
272264 const [addOpen, setAddOpen] = useState(false);
273265 const scopeId = useScope();
274266 const secrets = useAtomValue(secretsAtom(scopeId));
packages/react/src/pages/sources-add.tsx+2−16
@@ -4,21 +4,6 @@ import type { SourcePlugin } from "../plugins/source-plugin"; · 3 unmodified lines
44 import { useAtomRefresh } from "@effect-atom/atom-react";
55 import { sourcesAtom } from "../api/atoms";
66 import { useScope } from "../hooks/use-scope";
7−import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
8−import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
9−import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
10−import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";
11−
12−// ---------------------------------------------------------------------------
13−// Registered source plugins
14−// ---------------------------------------------------------------------------
15−
16−const sourcePlugins: SourcePlugin[] = [
17− openApiSourcePlugin,
18− mcpSourcePlugin,
19− googleDiscoverySourcePlugin,
20− graphqlSourcePlugin,
21−];
227
238 // ---------------------------------------------------------------------------
249 // Page
@@ -28,8 +13,9 @@ export function SourcesAddPage(props: { · 3 unmodified lines
2813 pluginKey: string;
2914 url?: string;
3015 preset?: string;
16+ sourcePlugins: readonly SourcePlugin[];
3117 }) {
32− const { pluginKey, url, preset } = props;
18+ const { pluginKey, url, preset, sourcePlugins } = props;
3319 const scopeId = useScope();
3420 const refreshSources = useAtomRefresh(sourcesAtom(scopeId));
3521 const navigate = useNavigate();
packages/react/src/pages/sources.tsx+2−16
@@ -4,23 +4,8 @@ import { Result, useAtomValue, useAtomSet } from "@effect-atom/atom-react"; · 3 unmodified lines
44 import { sourcesAtom, detectSource } from "../api/atoms";
55 import { useScope } from "../hooks/use-scope";
66 import type { SourcePlugin, SourcePreset } from "../plugins/source-plugin";
7−import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
8−import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
9−import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
10−import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";
117 import { McpInstallCard } from "../components/mcp-install-card";
128
13−// ---------------------------------------------------------------------------
14−// Registered source plugins
15−// ---------------------------------------------------------------------------
16−
17−const sourcePlugins: SourcePlugin[] = [
18− openApiSourcePlugin,
19− mcpSourcePlugin,
20− googleDiscoverySourcePlugin,
21− graphqlSourcePlugin,
22−];
23−
249 const KIND_TO_PLUGIN_KEY: Record<string, string> = {
2510 openapi: "openapi",
2611 mcp: "mcp",
@@ -32,7 +17,8 @@ const KIND_TO_PLUGIN_KEY: Record<string, string> = { · 5 unmodified lines
3217 // Page
3318 // ---------------------------------------------------------------------------
3419
35−export function SourcesPage() {
20+export function SourcesPage(props: { sourcePlugins: readonly SourcePlugin[] }) {
21+ const { sourcePlugins } = props;
3622 const [url, setUrl] = useState("");
3723 const [detecting, setDetecting] = useState(false);
3824 const [error, setError] = useState<string | null>(null);