Skip to content
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

Merged
merged 3 commits into from
Nov 25, 2024
Merged

Conversation

pernydev
Copy link
Contributor

@pernydev pernydev commented Nov 24, 2024

Description

The command to create a Svelte project (previously npm create svelte@latest) should now be npx 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

  • Documentation
    • Updated installation instructions for integrating SvelteKit with Wails.
    • Clarified modifications needed for the wails.json file, including the addition of the "wailsjsdir" field.
    • Revised Bash script to reflect new project creation commands and adjustments to file handling.
    • Expanded guidance on handling form submissions and error management, including new notes on preventing build failures.

Copy link
Contributor

coderabbitai bot commented Nov 24, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The 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 wails.json file, and updating file paths in the main.go and .gitignore files. Additionally, the Bash script section is revised to reflect these changes, and further details on handling server files and form submissions are added to enhance the setup process.

Changes

Files Change Summary
website/docs/guides/sveltekit.mdx Updated installation instructions, changed project creation command, clarified wails.json setup, modified paths in main.go and .gitignore, revised Bash script, and expanded notes on server files and form handling.

Assessment against linked issues

Objective Addressed Explanation
Update Svelte project creation command in guide (#3911)

Possibly related PRs

  • defualt to embed all:frontend/dist #3887: The change to embed all files in frontend/dist is directly related to the updates in the main PR, which also modifies the main.go file to reflect changes in the embedded path for SvelteKit integration.

🐰 In the garden where we play,
SvelteKit blooms in a brand new way.
With commands updated, paths aligned,
Our docs now clearer, perfectly designed!
Hop along, let’s build and cheer,
Wails and Svelte, the future’s here! 🌼


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e5be3c5 and c002c02.

📒 Files selected for processing (1)
  • website/docs/guides/sveltekit.mdx (2 hunks)

@leaanthony leaanthony merged commit 93b4939 into wailsapp:master Nov 25, 2024
9 of 11 checks passed
@leaanthony
Copy link
Member

Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore: outdated svelte project creation command in guide
2 participants