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

[v3] Move runtime to "dependencies", organize package.json files #4133

Open
wants to merge 8 commits into
base: v3-alpha
Choose a base branch
from

Conversation

IanVS
Copy link

@IanVS IanVS commented Mar 12, 2025

Description

This moves the @wailsio/runtime package to "dependencies" since it is referenced in the code itself, not just build tooling.

It also re-arranges things just slightly for consistency (dependencies before devDependencies, etc), removes the package-lock.json files from a few templates, and updates version references for the runtime to all be "latest".

Fixes #N/A

Type of change

Please select the option that is relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux

If you checked Linux, please specify the distro and version.

Test Configuration

Please paste the output of wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Chores
    • Streamlined dependency management across multiple project templates by ensuring that key runtime packages are now included in production builds.
    • Updated module configuration in select templates—such as SvelteKit—by refining module system declarations and adjusting adapter settings for a cleaner, more reliable production setup.

Copy link
Contributor

coderabbitai bot commented Mar 12, 2025

Walkthrough

This update modifies package configuration files across multiple frontend templates. The @wailsio/runtime dependency has been shifted from the devDependencies section to the dependencies section in nearly all package.json files, updating its role to a runtime requirement. Additionally, some template files have their dependency sections reordered. Two SvelteKit templates now include a "type": "module" declaration, add a new version of @wailsio/runtime, and update Svelte adapter settings.

Changes

File(s) Change Summary
v3/internal/templates/{lit(-ts), preact(-ts), react(-swc(-ts)?), solid(-ts), vanilla(-ts), vue(-ts)}/frontend/package.json Moved @wailsio/runtime: "latest" from devDependencies to dependencies; other dependencies (e.g., vite) remain unchanged.
v3/internal/templates/qwik(-ts)/frontend/package.json Reordered sections by moving devDependencies after dependencies without altering content.
v3/internal/templates/{svelte, svelte-ts}/frontend/package.json Shifted @wailsio/runtime: "latest" from devDependencies to dependencies while maintaining structure.
v3/internal/templates/{sveltekit, sveltekit-ts}/frontend/package.json Added "type": "module", introduced @wailsio/runtime: "^3.0.0-alpha.28" in dependencies, and updated the Svelte adapter (moved or replaced the existing adapter entry).

Suggested reviewers

  • leaanthony

Poem

I'm a little rabbit, hopping with glee,
Coding changes dancing like leaves on a tree.
Dependencies leap from dev to runtime in flight,
"Type: module" shines, so fresh and bright.
ASCII hops and cheers — bugs, take a back seat!
In this code garden, every update is sweet.
🐇✨

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bc94ce and bccff0f.

📒 Files selected for processing (1)
  • docs/src/content/docs/changelog.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/src/content/docs/changelog.mdx

🪧 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 generate docstrings to generate docstrings for this 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.

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

🧹 Nitpick comments (1)
v3/internal/templates/react/frontend/package.json (1)

1-11: File Structure and Module Type Declaration.
The overall file structure looks clean, with the "type": "module" declaration correctly set and scripts organized neatly.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe6635c and 3f2db13.

⛔ Files ignored due to path filters (2)
  • v3/internal/templates/sveltekit-ts/frontend/package-lock.json is excluded by !**/package-lock.json
  • v3/internal/templates/sveltekit/frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (20)
  • v3/internal/templates/lit-ts/frontend/package.json (1 hunks)
  • v3/internal/templates/lit/frontend/package.json (1 hunks)
  • v3/internal/templates/preact-ts/frontend/package.json (1 hunks)
  • v3/internal/templates/preact/frontend/package.json (1 hunks)
  • v3/internal/templates/qwik-ts/frontend/package.json (1 hunks)
  • v3/internal/templates/qwik/frontend/package.json (1 hunks)
  • v3/internal/templates/react-swc-ts/frontend/package.json (2 hunks)
  • v3/internal/templates/react-swc/frontend/package.json (1 hunks)
  • v3/internal/templates/react-ts/frontend/package.json (2 hunks)
  • v3/internal/templates/react/frontend/package.json (1 hunks)
  • v3/internal/templates/solid-ts/frontend/package.json (1 hunks)
  • v3/internal/templates/solid/frontend/package.json (1 hunks)
  • v3/internal/templates/svelte-ts/frontend/package.json (1 hunks)
  • v3/internal/templates/svelte/frontend/package.json (1 hunks)
  • v3/internal/templates/sveltekit-ts/frontend/package.json (2 hunks)
  • v3/internal/templates/sveltekit/frontend/package.json (2 hunks)
  • v3/internal/templates/vanilla-ts/frontend/package.json (1 hunks)
  • v3/internal/templates/vanilla/frontend/package.json (1 hunks)
  • v3/internal/templates/vue-ts/frontend/package.json (1 hunks)
  • v3/internal/templates/vue/frontend/package.json (1 hunks)
🔇 Additional comments (35)
v3/internal/templates/react/frontend/package.json (2)

12-16: Runtime Dependency Placement.
The addition of "@wailsio/runtime": "latest" in the dependencies block confirms the runtime requirement, in line with the PR objectives. This change ensures that the package is available during production rather than solely during development.


17-22: DevDependencies Section Verification.
The devDependencies section now only contains build and tooling packages. It no longer includes @wailsio/runtime, which is correctly positioned in the runtime dependencies.

v3/internal/templates/qwik-ts/frontend/package.json (3)

1-11: Consistent Package Structure and Script Configuration.
The file retains a tidy structure with scripts defined appropriately. The "type": "module" attribute and version field remain consistent with project conventions.


12-15: Runtime Dependency Placement Confirmed.
The dependencies section now includes both "@builder.io/qwik" and "@wailsio/runtime": "latest", aligning with the new runtime classification for the latter.


16-19: DevDependencies Reordering.
The devDependencies block now follows the dependencies section, ensuring a clearer separation between production and development packages.

v3/internal/templates/vue-ts/frontend/package.json (3)

1-11: Module Configuration and Script Integrity.
The basic configuration—module type, scripts, and version—is maintained correctly. The file reads well and is consistent with the overall template style.


12-15: Runtime Dependency Reclassification.
Adding "@wailsio/runtime": "latest" into the dependencies section is appropriate. This change correctly reflects its use as a runtime requirement rather than as a development-only dependency.


16-23: Overall Configuration Consistency.
The devDependencies section lists only development tools (e.g., @vitejs/plugin-vue, typescript, vite, and vue-tsc), which is now distinct from runtime dependencies.

v3/internal/templates/qwik/frontend/package.json (3)

1-11: Clean File Layout and Script Definitions.
The file remains well-organized, with a clear "type": "module" declaration and sensible script commands, ensuring consistency across templates.


12-15: Runtime Dependency Update.
The dependency "@wailsio/runtime": "latest" is correctly placed under dependencies alongside "@builder.io/qwik", promoting uniformity with similar template files updated in this PR.


16-19: DevDependencies Section Order Confirmed.
Moving the devDependencies block to follow the dependencies section clarifies the separation between production and build tooling packages.

v3/internal/templates/react-swc/frontend/package.json (3)

1-11: Validation of Script and Module Configuration.
The file’s module declaration and scripts are maintained as expected. The clear segregation of sections supports the overall organization improvements outlined in the PR.


12-16: Runtime Dependency Reclassification.
The movement of "@wailsio/runtime": "latest" into the dependencies section ensures that runtime requirements are addressed properly. This change aligns with the project's updated dependency management strategy.


17-22: Correct Grouping of Development Dependencies.
The devDependencies correctly include only development-related packages (e.g., type definitions and build plugins), with no lingering runtime packages.

v3/internal/templates/svelte/frontend/package.json (1)

12-14: Correctly Relocated Dependency for Svelte Template
The move of @wailsio/runtime into the "dependencies" section (lines 12-14) is correctly implemented. This ensures the package is present in production environments, and the ordering of keys (with dependencies before devDependencies) remains consistent.

v3/internal/templates/react-ts/frontend/package.json (1)

12-16: Proper Dependency Update in React-TS Template
The shift of @wailsio/runtime to the "dependencies" section (notably at line 13) aligns with the PR objectives. The change is accurate, and the rest of the dependency structure remains well-organized.

v3/internal/templates/svelte-ts/frontend/package.json (1)

13-15: Accurate Dependency Reclassification for Svelte-TS Template
Adding @wailsio/runtime with version "latest" in the "dependencies" section (lines 13-15) is correctly executed. This update maintains consistency with other templates and confirms that the runtime package is classified appropriately.

v3/internal/templates/solid/frontend/package.json (1)

12-15: Consistent Update in Solid Template
The solid template now correctly includes @wailsio/runtime in the "dependencies" section (line 13) with the version "latest", while ensuring it is removed from "devDependencies". This update is consistent with the overall changes across templates.

v3/internal/templates/lit-ts/frontend/package.json (1)

12-20: Accurate Dependency Adjustment for Lit-TS Template
In this file, the addition of @wailsio/runtime in the "dependencies" section (line 13) and its removal from "devDependencies" are implemented correctly. The overall structure remains organized, aligning with the PR’s objective to clearly distinguish runtime dependencies.

v3/internal/templates/vanilla/frontend/package.json (1)

12-14: Reclassify @wailsio/runtime as a Production Dependency.
The addition of "@wailsio/runtime": "latest" under the "dependencies" section (and its removal from devDependencies) correctly reflects its runtime usage per the PR objectives. This change will ensure that the package is bundled in production environments.

v3/internal/templates/preact-ts/frontend/package.json (1)

13-13: Properly Moved @wailsio/runtime to Dependencies.
The inclusion of "@wailsio/runtime": "latest" in the "dependencies" section (with its prior removal from devDependencies) is consistent with the intended runtime requirements outlined in the PR.

v3/internal/templates/solid-ts/frontend/package.json (1)

12-15: Consistent Dependency Reclassification.
Adding "@wailsio/runtime": "latest" into the "dependencies" section ensures that the runtime package is available in production builds. This aligns well with the overall PR intent across multiple templates.

v3/internal/templates/react-swc-ts/frontend/package.json (2)

13-16: Runtime Dependency Reclassification.
Moving "@wailsio/runtime": "latest" to the "dependencies" section appropriately categorizes it as a production dependency, addressing the primary objective of the PR.


22-22: Vite Version Update Confirmation.
The update of the "vite" version in devDependencies to "^5.0.8" is consistent with changes in other templates and helps maintain uniform tooling across projects.

v3/internal/templates/lit/frontend/package.json (1)

12-15: Correct Dependency Adjustment for Runtime.
The addition of "@wailsio/runtime": "latest" to the "dependencies" section confirms its necessity at runtime rather than solely during development, in line with the PR objectives.

v3/internal/templates/vue/frontend/package.json (2)

12-15: Correct Runtime Dependency Placement in Vue Template.
The addition of "@wailsio/runtime": "latest" to the "dependencies" section correctly reclassifies it as a runtime dependency rather than a build-only tool. This aligns with the PR objectives.


5-11: Good ES Module Declaration & Script Organization.
The inclusion of "type": "module" and the clear separation of scripts help maintain consistency across templates.

v3/internal/templates/preact/frontend/package.json (1)

12-15: Accurate Reclassification for Preact Template.
Moving @wailsio/runtime into the "dependencies" section with version "latest" correctly reflects its runtime usage. The rest of the file remains well organized, with scripts and module type clearly defined.

v3/internal/templates/sveltekit/frontend/package.json (3)

5-6: ES Module Declaration in SvelteKit Template.
The addition of "type": "module" (line 5) ensures proper module handling and aligns with the overall project conventions.


14-16: Runtime Dependency Version Notice.
The dependency "@wailsio/runtime": "^3.0.0-alpha.28" is added here; however, note that unlike the Vue and Preact templates using "latest", this template specifies an alpha version. Please confirm that the alpha release is intentional for SvelteKit compatibility.


17-23: DevDependencies Organization and Adapter Update.
Moving @sveltejs/adapter-static into the "devDependencies" provides a cleaner separation between runtime and build tools. Double-check that this change fits the intended SvelteKit configuration.

v3/internal/templates/vanilla-ts/frontend/package.json (1)

12-14: Proper Runtime Dependency Update for Vanilla-TS.
The introduction of the "dependencies" section with "@wailsio/runtime": "latest" appropriately reclassifies the runtime requirement. The rest of the configuration, including "type": "module" and scripts, is consistent and well organized.

v3/internal/templates/sveltekit-ts/frontend/package.json (3)

5-6: Consistent ES Module Usage in SvelteKit-TS Template.
Adding "type": "module" ensures that the project leverages ECMAScript modules correctly—this is in line with the modifications seen in other templates.


14-16: Runtime Dependency Version Alert.
The dependency here is set to "@wailsio/runtime": "^3.0.0-alpha.28". As with the SvelteKit (JS) template, please verify if using an alpha version is deliberate or if the overall project should standardize on "latest" for consistency.


17-25: Well-Organized DevDependencies.
The separation of development dependencies (including the adapter moved to devDependencies) is clear and adheres to the intended project organization.

fbbdev
fbbdev previously approved these changes Mar 13, 2025
@fbbdev fbbdev enabled auto-merge (squash) March 13, 2025 07:14
@leaanthony
Copy link
Member

Thanks 🙏 Please could you add an entry to the changelog located at docs/src/content/docs/changelog.mdx? Thanks!

auto-merge was automatically disabled March 18, 2025 20:21

Head branch was pushed to by a user without write access

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.

3 participants