-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update svelte CLI command #3912
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe pull request updates the documentation for integrating SvelteKit with Wails. Key changes include modifying installation instructions to use the Svelte CLI for project creation, clarifying the configuration of the Changes
Assessment against linked issues
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (4)
website/docs/guides/sveltekit.mdx (4)
17-18
: LGTM! Consider adding a note about the command change.The updated command is correct and includes the necessary project directory parameter. Consider adding a brief note mentioning that this is the new recommended way to create SvelteKit projects, replacing the older
npm create svelte@latest
command.##### While in the Wails project root. Use the Svelte CLI to create a SvelteKit project as the new frontend. Follow the prompts, nothing Wails specific is needed here. +# Note: This command replaces the older `npm create svelte@latest` method - `npx sv create frontend`
Line range hint
64-64
: Update script to use the new Svelte CLI command.The script is still using the old command format (
$manager create svelte@latest frontend
) while the documentation above uses the new format (npx sv create frontend
). This inconsistency should be addressed.-$manager create svelte@latest frontend +npx sv create frontend
Line range hint
48-49
: Add a note about package manager compatibility.Consider adding a note about potential compatibility issues when using different package managers with the script, especially since the script allows for package manager selection.
##### This Bash Script does the steps listed above. Make sure to read over the script and understand what the script is doing on your computer. + +> **Note:** While the script supports different package managers, some commands might need adjustment depending on your chosen package manager. Please verify the commands are compatible with your setup.
Line range hint
108-116
: Enhance error handling documentation.The error handling section could benefit from more context about when to use each approach. Consider adding brief examples or scenarios where each error handling strategy would be most appropriate.
##### Error Handling +There are two main approaches to handling errors in a Wails + SvelteKit application: + - Expected errors using Throw error works in +page.ts/+page.js with a +error.svelte page. https://kit.svelte.dev/docs/errors#expected-errors + Use this approach for handling known error conditions such as validation errors or expected API failures. + - Unexpected errors will cause the application to become unusable. Only recovery option (known so far) from unexpected errors is to reload the app. To do this create a file myapp/frontend/src/hooks.client.ts then add the below code to the file. + Use this approach as a last resort for handling unexpected runtime errors that could corrupt the application state.
Thanks for this! |
Description
The command to create a Svelte project (previously
npm create svelte@latest
) should now benpx sv create
.This fixes #3911.
Type of change
Documentation change.
How Has This Been Tested?
The command is a modified one from the official Svelte docs.
Summary by CodeRabbit
wails.json
file, including the addition of the"wailsjsdir"
field.