|
| 1 | +const path = require('path'); |
| 2 | +const { execSync } = require('child_process'); |
| 3 | + |
| 4 | + |
| 5 | +const commands = [ |
| 6 | + 'rm -rf ./integrations', |
| 7 | + 'rm -rf ./middlewares', |
| 8 | + 'rm -rf ./sdks/typescript', |
| 9 | + 'rm -rf ./sdks/python', |
| 10 | + // Move apps out as it is |
| 11 | + 'mv ./typescript-sdk/apps ./apps', |
| 12 | + |
| 13 | + // rename community to community-managed |
| 14 | + 'mv ./sdks/community ./sdks/community-managed', |
| 15 | + |
| 16 | + |
| 17 | + // A2A Middleware |
| 18 | + 'mkdir -p ./middlewares/a2a-middleware', |
| 19 | + 'mv ./typescript-sdk/integrations/a2a-middleware ./middlewares/a2a-middleware', |
| 20 | + |
| 21 | + // ADK Middleware |
| 22 | + 'mkdir -p ./integrations/adk-middleware', |
| 23 | + 'mv ./typescript-sdk/integrations/adk-middleware/python ./integrations/adk-middleware/python', |
| 24 | + 'mv ./typescript-sdk/integrations/adk-middleware ./integrations/adk-middleware/typescript', |
| 25 | + |
| 26 | + // Agno |
| 27 | + 'mkdir -p ./integrations/agno/python', |
| 28 | + 'mv ./typescript-sdk/integrations/agno/examples ./integrations/agno/python/examples', |
| 29 | + 'mv ./typescript-sdk/integrations/agno ./integrations/agno/typescript', |
| 30 | + |
| 31 | + // Crew AI |
| 32 | + 'mkdir -p ./integrations/crew-ai', |
| 33 | + 'mv ./typescript-sdk/integrations/crewai/python ./integrations/crew-ai/python', |
| 34 | + // TODO: move examples to inside python, fix project structure using uv |
| 35 | + 'mv ./typescript-sdk/integrations/crewai ./integrations/crew-ai/typescript', |
| 36 | + |
| 37 | + // Langgraph |
| 38 | + 'mkdir -p ./integrations/langgraph/', |
| 39 | + 'mv ./typescript-sdk/integrations/langgraph/examples ./integrations/langgraph/examples-temp', |
| 40 | + 'mv ./typescript-sdk/integrations/langgraph/python ./integrations/langgraph/python', |
| 41 | + 'mv ./typescript-sdk/integrations/langgraph/ ./integrations/langgraph/typescript', |
| 42 | + 'mv ./integrations/langgraph/examples-temp/python ./integrations/langgraph/python/examples', |
| 43 | + 'mv ./integrations/langgraph/examples-temp/typescript ./integrations/langgraph/typescript/examples', |
| 44 | + 'rm -rf ./integrations/langgraph/examples-temp', |
| 45 | + |
| 46 | + // Llama Index |
| 47 | + 'mkdir -p ./integrations/llamaindex/python', |
| 48 | + 'mv ./typescript-sdk/integrations/llamaindex/server-py ./integrations/llamaindex/python/examples', |
| 49 | + 'mv ./typescript-sdk/integrations/llamaindex ./integrations/llamaindex/typescript', |
| 50 | + |
| 51 | + // Mastra |
| 52 | + 'mkdir -p ./integrations/mastra', |
| 53 | + 'mv ./typescript-sdk/integrations/mastra ./integrations/mastra/typescript', |
| 54 | + 'mv ./integrations/mastra/typescript/example ./integrations/mastra/typescript/examples', |
| 55 | + |
| 56 | + // Middleware Starter |
| 57 | + 'mv ./typescript-sdk/integrations/middleware-starter ./middlewares/middleware-starter', |
| 58 | + |
| 59 | + // Pydantic AI |
| 60 | + 'mkdir -p ./integrations/pydantic-ai/python', |
| 61 | + 'mv ./typescript-sdk/integrations/pydantic-ai/examples ./integrations/pydantic-ai/python/examples', |
| 62 | + 'mv ./typescript-sdk/integrations/pydantic-ai ./integrations/pydantic-ai/typescript', |
| 63 | + |
| 64 | + // Server Starter |
| 65 | + 'mkdir -p ./integrations/server-starter/python', |
| 66 | + 'mv ./typescript-sdk/integrations/server-starter/server ./integrations/server-starter/python/examples', |
| 67 | + 'mv ./typescript-sdk/integrations/server-starter ./integrations/server-starter/typescript', |
| 68 | + |
| 69 | + // Server Starter All Features |
| 70 | + 'mkdir -p ./integrations/server-starter-all-features/python', |
| 71 | + 'mv ./typescript-sdk/integrations/server-starter-all-features/server ./integrations/server-starter-all-features/python/examples', |
| 72 | + 'mv ./typescript-sdk/integrations/server-starter-all-features ./integrations/server-starter-all-features/typescript', |
| 73 | + |
| 74 | + // Spring AI |
| 75 | + 'mkdir -p ./integrations/community-managed/spring-ai', |
| 76 | + 'mv ./typescript-sdk/integrations/spring-ai ./integrations/community-managed/spring-ai/typescript', |
| 77 | + // TODO: add readme to community-managed/spring-ai about finding the example. |
| 78 | + |
| 79 | + // Vercel AI SDK |
| 80 | + 'mkdir -p ./integrations/vercel-ai-sdk', |
| 81 | + 'mv ./typescript-sdk/integrations/vercel-ai-sdk ./integrations/vercel-ai-sdk/typescript', |
| 82 | + |
| 83 | + // typescript-sdk |
| 84 | + 'mkdir -p ./sdks/typescript', |
| 85 | + 'mv ./typescript-sdk/packages ./sdks/typescript/packages', |
| 86 | + 'mv ./typescript-sdk/.cursor ./sdks/typescript/.cursor', |
| 87 | + 'mv ./typescript-sdk/.vscode ./sdks/typescript/.vscode', |
| 88 | + 'mv ./typescript-sdk/.gitignore ./sdks/typescript/.gitignore', |
| 89 | + 'mv ./typescript-sdk/.npmrc ./sdks/typescript/.npmrc', |
| 90 | + 'mv ./typescript-sdk/.prettierrc ./sdks/typescript/.prettierrc', |
| 91 | + 'mv ./typescript-sdk/package.json ./sdks/typescript/package.json', |
| 92 | + 'mv ./typescript-sdk/pnpm-lock.yaml ./sdks/typescript/pnpm-lock.yaml', |
| 93 | + 'mv ./typescript-sdk/README.md ./sdks/typescript/README.md', |
| 94 | + 'mv ./typescript-sdk/tsconfig.json ./sdks/typescript/tsconfig.json', |
| 95 | + 'mv ./typescript-sdk/pnpm-workspace.yaml ./sdks/typescript/pnpm-workspace.yaml', |
| 96 | + 'mv ./typescript-sdk/LICENSE ./sdks/typescript/LICENSE', |
| 97 | + |
| 98 | + // Turbo.json gets moved to the root |
| 99 | + 'mv ./typescript-sdk/turbo.json ./turbo.json', |
| 100 | + // move create-integration.ts to scripts |
| 101 | + 'mkdir -p ./sdks/typescript/scripts', |
| 102 | + 'mv ./typescript-sdk/create-integration.ts ./sdks/typescript/scripts/create-integration.ts', |
| 103 | + |
| 104 | + // python-sdk |
| 105 | + 'mv ./python-sdk ./sdks/python', |
| 106 | + |
| 107 | + // poc cleanup |
| 108 | + 'rmdir ./typescript-sdk/integrations', |
| 109 | + 'rmdir ./typescript-sdk', |
| 110 | +]; |
| 111 | + |
| 112 | +function runCommand(command) { |
| 113 | + console.log(`Running command: ${command}`); |
| 114 | + execSync(command, { stdio: 'inherit' }); |
| 115 | +} |
| 116 | + |
| 117 | +for (const command of commands) { |
| 118 | + runCommand(command); |
| 119 | +} |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | +// NOTES OF MANUAL CHANGES AFTERWARDS |
| 124 | +// mv sdks/typescript/pnpm-workspace.yaml ./ |
| 125 | +// mv sdks/typescript/package.json ./ |
| 126 | + |
| 127 | +// mv ./middlewares/a2a-middleware/a2a-middleware/* ./middlewares/a2a-middleware/ |
| 128 | +// mv ./middlewares/a2a-middleware/a2a-middleware/.??* ./middlewares/a2a-middleware/ |
| 129 | +// rmdir ./middlewares/a2a-middleware/a2a-middleware |
| 130 | + |
| 131 | +// mv integrations/server-starter/python/examples/python/* integrations/server-starter/python/examples/ |
| 132 | +// mv integrations/server-starter/python/examples/python/.??* integrations/server-starter/python/examples/ |
| 133 | +// rmdir integrations/server-starter/python/examples/python |
| 134 | + |
| 135 | +// mv integrations/server-starter-all-features/python/examples/python/* integrations/server-starter-all-features/python/examples/ |
| 136 | +// mv integrations/server-starter-all-features/python/examples/python/.??* integrations/server-starter-all-features/python/examples/ |
| 137 | +// rmdir integrations/server-starter-all-features/python/examples/python |
0 commit comments