Open rawwerks opened 11 months ago
95424b1a87
)Here are the sandbox execution logs prior to making any changes:
5975faf
pnpx prettier --write packages/create-llama/index.ts
1/3 ✓Progress: resolved 1, reused 0, downloaded 0, added 0 Packages: +1 + Progress: resolved 1, reused 1, downloaded 0, added 1, done packages/create-llama/index.ts 510ms (unchanged)
pnpm eslint --fix packages/create-llama/index.ts
2/3 ✓Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.
pnpx ts-node --type-check packages/create-llama/index.ts
3/3 ❌ (`1`)Progress: resolved 1, reused 0, downloaded 0, added 0 Packages: +20 ++++++++++++++++++++ Progress: resolved 20, reused 19, downloaded 0, added 13 Progress: resolved 20, reused 19, downloaded 1, added 19 Progress: resolved 20, reused 19, downloaded 1, added 20, done /root/.local/share/pnpm/store/v3/tmp/dlx-90/node_modules/.pnpm/ts-node@10.9.1_@types+node@20.9.2_typescript@5.2.2/node_modules/ts-node/dist/index.js:851 return old(m, filename); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module /repo/node_modules/.pnpm/terminal-link@3.0.0/node_modules/terminal-link/index.js from /repo/packages/create-llama/create-app.ts not supported. Instead change the require of index.js in /repo/packages/create-llama/create-app.ts to a dynamic import() which is available in all CommonJS modules. at require.extensions.[as .js] (/root/.local/share/pnpm/store/v3/tmp/dlx-90/node_modules/.pnpm/ts-node@10.9.1_@types+node@20.9.2_typescript@5.2.2/node_modules/ts-node/dist/index.js:851:20) at Object. (/repo/packages/create-llama/create-app.ts:16:41) at m._compile (/root/.local/share/pnpm/store/v3/tmp/dlx-90/node_modules/.pnpm/ts-node@10.9.1_@types+node@20.9.2_typescript@5.2.2/node_modules/ts-node/dist/index.js:857:29) at require.extensions. [as .ts] (/root/.local/share/pnpm/store/v3/tmp/dlx-90/node_modules/.pnpm/ts-node@10.9.1_@types+node@20.9.2_typescript@5.2.2/node_modules/ts-node/dist/index.js:859:16) at Object. (/repo/packages/create-llama/index.ts:16:22) at m._compile (/root/.local/share/pnpm/store/v3/tmp/dlx-90/node_modules/.pnpm/ts-node@10.9.1_@types+node@20.9.2_typescript@5.2.2/node_modules/ts-node/dist/index.js:857:29) at require.extensions. [as .ts] (/root/.local/share/pnpm/store/v3/tmp/dlx-90/node_modules/.pnpm/ts-node@10.9.1_@types+node@20.9.2_typescript@5.2.2/node_modules/ts-node/dist/index.js:859:16) at phase4 (/root/.local/share/pnpm/store/v3/tmp/dlx-90/node_modules/.pnpm/ts-node@10.9.1_@types+node@20.9.2_typescript@5.2.2/node_modules/ts-node/dist/bin.js:466:20) at bootstrap (/root/.local/share/pnpm/store/v3/tmp/dlx-90/node_modules/.pnpm/ts-node@10.9.1_@types+node@20.9.2_typescript@5.2.2/node_modules/ts-node/dist/bin.js:54:12) at main (/root/.local/share/pnpm/store/v3/tmp/dlx-90/node_modules/.pnpm/ts-node@10.9.1_@types+node@20.9.2_typescript@5.2.2/node_modules/ts-node/dist/bin.js:33:12) at Object. (/root/.local/share/pnpm/store/v3/tmp/dlx-90/node_modules/.pnpm/ts-node@10.9.1_@types+node@20.9.2_typescript@5.2.2/node_modules/ts-node/dist/bin.js:579:5) { code: 'ERR_REQUIRE_ESM' }
Sandbox failed, so all sandbox checks will be disabled for this issue.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
[X] Create packages/create-llama/templates/svelte
✓ https://github.com/run-llama/LlamaIndexTS/commit/a7437d6d6f800854c3100468fe9e39901a6477f4
Create packages/create-llama/templates/svelte with contents:
• Create a new directory named 'svelte' in the 'templates' directory. This will hold the template files for the Svelte frontend.
• Populate this directory with the necessary files for a basic Svelte application. This should include at least an 'index.html', 'main.js', and 'App.svelte' file, as well as any other files necessary for a basic Svelte application.
[X] Modify packages/create-llama/index.ts
✓ https://github.com/run-llama/LlamaIndexTS/commit/d5be895de8714763cd794950ae710797a42e07d7
Modify packages/create-llama/index.ts with contents:
• Locate the prompts for the frontend selection (lines 204-280 in the provided snippet).
• Add a new choice to the 'choices' array for the frontend selection prompt. The title should be "Svelte", and the value should also be "svelte".
• In the conditional logic that follows the frontend selection prompt, add a new condition for if the selected framework is "svelte". This should set up the necessary variables and preferences for a Svelte frontend.
[X] Modify packages/create-llama/create-app.ts
✓ https://github.com/run-llama/LlamaIndexTS/commit/aff5481fd1a1799be430673c4668a9587cb5a107
Modify packages/create-llama/create-app.ts with contents:
• Modify the 'createApp' function to handle the creation of a Svelte frontend. This will involve copying the necessary template files from the 'svelte' directory in 'templates' to the new application directory.
• Ensure that the necessary dependencies for a Svelte application are added to the 'package.json' file of the new application.
I have finished reviewing the code for completeness. I did not find errors for sweep/svelte-frontend-option
.
rope
library to refactor Python! Check out Large Language Models are Bad at Refactoring Code. To have Sweep refactor your code, try sweep: Refactor <your_file>.py
!💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord
Details
...because svelte(kit) is so amazing
Checklist
- [X] Create `packages/create-llama/templates/svelte` ✓ https://github.com/run-llama/LlamaIndexTS/commit/a7437d6d6f800854c3100468fe9e39901a6477f4 - [X] Modify `packages/create-llama/index.ts` ✓ https://github.com/run-llama/LlamaIndexTS/commit/d5be895de8714763cd794950ae710797a42e07d7 - [X] Modify `packages/create-llama/create-app.ts` ✓ https://github.com/run-llama/LlamaIndexTS/commit/aff5481fd1a1799be430673c4668a9587cb5a107 ![Flowchart](http://24.199.78.105:8082/public/ce0e5c7be1f17b9530403f695e2ee9762be7749c864638e990e2fb141aed7d3d_212_flowchart.svg)