History

fix migration

Rhys Sullivan committed 8 months ago

Commit 329cc411 parent 8f435d93 files · +36 −72Browse files

Unified · Split

3 files
  1. .changeset/brave-baths-itch.md +5 −0
  2. .executor/executor.jsonc +0 −72
  3. apps/executor/src/distribution/artifact.ts +31 −0
.changeset/brave-baths-itch.md+5−0
@@ -0,0 +1,5 @@
1---
2"executor": minor
3---
4
5fix migration
.executor/executor.jsonc+0−72
@@ -1,72 +0,0 @@
1{
2 "sources": {
3 "google-calendar": {
4 "name": "Google Calendar",
5 "namespace": "google.calendar",
6 "connection": {
7 "endpoint": "https://calendar-json.googleapis.com/$discovery/rest?version=v3"
8 },
9 "kind": "google_discovery",
10 "binding": {
11 "service": "calendar",
12 "version": "v3",
13 "discoveryUrl": "https://calendar-json.googleapis.com/$discovery/rest?version=v3",
14 "defaultHeaders": null,
15 "scopes": []
16 }
17 },
18 "google-drive": {
19 "name": "Google Drive",
20 "namespace": "google.drive",
21 "connection": {
22 "endpoint": "https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"
23 },
24 "kind": "google_discovery",
25 "binding": {
26 "service": "drive",
27 "version": "v3",
28 "discoveryUrl": "https://www.googleapis.com/discovery/v1/apis/drive/v3/rest",
29 "defaultHeaders": null,
30 "scopes": []
31 }
32 },
33 "google-tasks": {
34 "name": "Google Tasks",
35 "namespace": "google.tasks",
36 "connection": {
37 "endpoint": "https://tasks.googleapis.com/$discovery/rest?version=v1"
38 },
39 "kind": "google_discovery",
40 "binding": {
41 "service": "tasks",
42 "version": "v1",
43 "discoveryUrl": "https://tasks.googleapis.com/$discovery/rest?version=v1",
44 "defaultHeaders": null,
45 "scopes": []
46 }
47 },
48 "axiom": {
49 "name": "Axiom MCP",
50 "connection": {
51 "endpoint": "https://mcp.axiom.co/mcp"
52 },
53 "kind": "mcp",
54 "binding": {
55 "transport": "auto",
56 "queryParams": null,
57 "headers": null
58 }
59 },
60 "vercel": {
61 "kind": "openapi",
62 "name": "Vercel API",
63 "connection": {
64 "endpoint": "https://api.vercel.com/"
65 },
66 "binding": {
67 "specUrl": "https://openapi.vercel.sh/",
68 "defaultHeaders": null
69 }
70 }
71 }
72}
apps/executor/src/distribution/artifact.ts+31−0
@@ -90,6 +90,34 @@ const resolveQuickJsWasmPath = (): string => { · 89 unmodified lines
90 return wasmPath;90 return wasmPath;
91};91};
92 92
93const resolvePGliteAssetPaths = (): {
94 dataPath: string;
95 wasmPath: string;
96} => {
97 const requireFromControlPlane = createRequire(
98 join(repoRoot, "packages/control-plane/package.json"),
99 );
100 const pglitePackagePath = requireFromControlPlane.resolve(
101 "@electric-sql/pglite/package.json",
102 );
103 const pgliteDistDir = join(dirname(pglitePackagePath), "dist");
104 const dataPath = join(pgliteDistDir, "pglite.data");
105 const wasmPath = join(pgliteDistDir, "pglite.wasm");
106
107 if (!existsSync(dataPath)) {
108 throw new Error(`Unable to locate PGlite data asset at ${dataPath}`);
109 }
110
111 if (!existsSync(wasmPath)) {
112 throw new Error(`Unable to locate PGlite wasm asset at ${wasmPath}`);
113 }
114
115 return {
116 dataPath,
117 wasmPath,
118 };
119};
120
93const createPackageJson = (input: {121const createPackageJson = (input: {
94 packageName: string;122 packageName: string;
95 packageVersion: string;123 packageVersion: string;
@@ -150,6 +178,7 @@ export const buildDistributionPackage = async ( · 54 unmodified lines
150 const bundlePath = join(binDir, "executor.mjs");178 const bundlePath = join(binDir, "executor.mjs");
151 const launcherPath = join(binDir, "executor.js");179 const launcherPath = join(binDir, "executor.js");
152 const quickJsWasmPath = resolveQuickJsWasmPath();180 const quickJsWasmPath = resolveQuickJsWasmPath();
181 const pgliteAssets = resolvePGliteAssetPaths();
153 const webDistDir = join(repoRoot, "apps/web/dist");182 const webDistDir = join(repoRoot, "apps/web/dist");
154 const readmePath = join(repoRoot, "README.md");183 const readmePath = join(repoRoot, "README.md");
155 const packageName = options.packageName ?? defaults.name;184 const packageName = options.packageName ?? defaults.name;
@@ -185,6 +214,8 @@ export const buildDistributionPackage = async ( · 29 unmodified lines
185 214
186 await cp(webDistDir, webDir, { recursive: true });215 await cp(webDistDir, webDir, { recursive: true });
187 await cp(quickJsWasmPath, join(binDir, "emscripten-module.wasm"));216 await cp(quickJsWasmPath, join(binDir, "emscripten-module.wasm"));
217 await cp(pgliteAssets.dataPath, join(binDir, "pglite.data"));
218 await cp(pgliteAssets.wasmPath, join(binDir, "pglite.wasm"));
188 await mkdir(join(binDir, "openapi-extractor-wasm"), { recursive: true });219 await mkdir(join(binDir, "openapi-extractor-wasm"), { recursive: true });
189 await cp(220 await cp(
190 join(repoRoot, "packages/codemode-openapi/src/openapi-extractor-wasm/openapi_extractor_bg.wasm"),221 join(repoRoot, "packages/codemode-openapi/src/openapi-extractor-wasm/openapi_extractor_bg.wasm"),