Skip to content

Taskfile Refactor#3748

Merged
leaanthony merged 10 commits into
v3-alphafrom
v3-alpha-chore/taskfile-refactor
Sep 21, 2024
Merged

Taskfile Refactor#3748
leaanthony merged 10 commits into
v3-alphafrom
v3-alpha-chore/taskfile-refactor

Conversation

@leaanthony

@leaanthony leaanthony commented Sep 15, 2024

Copy link
Copy Markdown
Member

This PR refactors the Taskfile into platform specific Taskfiles to make it easier to understand and manage.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced comprehensive documentation for the Wails v3 build system, enhancing user understanding of the build process.
    • Added code annotation functionality to improve interaction with code snippets in documentation.
    • Expanded navigation structure to include a new "Build System" section.
  • Improvements

    • Streamlined task definitions for building and packaging applications across different platforms, enhancing development workflow.
    • Updated command structure for frontend tasks to improve organization and clarity.
    • Added new tasks for environment handling and service management in the task management system.

@coderabbitai

coderabbitai Bot commented Sep 15, 2024

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

The changes introduce comprehensive documentation for the Wails v3 build system, focusing on the Taskfile structure and tasks tailored for Windows, Linux, and macOS. Enhancements to the mkdocs.yml configuration improve user interaction and navigation. The updates also streamline task definitions, promoting a modular and maintainable build process by consolidating OS-specific tasks into a more generic format.

Changes

File(s) Change Summary
mkdocs-website/docs/en/learn/build.md Added documentation for the Wails v3 build system, detailing Taskfile structure and tasks.
mkdocs-website/docs/en/changelog.md Updated changelog to document changes to the Taskfile, linked to pull request #3748.
mkdocs-website/mkdocs.yml Added code annotation feature, new markdown extension, and updated navigation for the build system.
v3/Taskfile.yaml Added new tasks for environment handling, mouse interaction, raw message processing, and services.
v3/internal/templates/_common/Taskfile.tmpl.yml Streamlined task definitions by consolidating OS-specific tasks into a modular structure.

Possibly related PRs

  • Taskfile Refactor #3748: The changes in the main PR include documentation for the Wails v3 build system, which is directly related to the refactor of the Taskfile detailed in PR Taskfile Refactor #3748, as both focus on enhancing the build process and structure of the Taskfiles for Wails applications.

🐰 In the land of code so bright,
A build system takes its flight.
With Taskfiles neat and clear,
Developers cheer, "The time is near!"
From Windows to macOS, Linux too,
A seamless journey, all anew! 🌟


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.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Outside diff range and nitpick comments (2)
v3/internal/templates/_common/Taskfile.tmpl.yml (1)

38-38: Add a newline at the end of the file.

It is a good practice to include a newline at the end of the file for consistency and to avoid potential issues with some tools.

Apply this diff to add a newline at the end of the file:

       - task: run
+
Tools
yamllint

[error] 38-38: no new line character at the end of file

(new-line-at-end-of-file)

v3/internal/commands/build_assets/Taskfile.linux.yml (1)

64-66: Consider adding a summary for consistency.

The run task is straightforward and executes the application binary from the bin directory, which is a standard practice.

For consistency with other tasks, consider adding a summary:

  run:
+   summary: Runs the application
    cmds:
      - '{{.BIN_DIR}}/{{.APP_NAME}}'
Tools
yamllint

[error] 66-66: no new line character at the end of file

(new-line-at-end-of-file)

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 56494d8 and 9b087fc.

Files selected for processing (10)
  • mkdocs-website/docs/en/learn/build.md (1 hunks)
  • mkdocs-website/mkdocs.yml (3 hunks)
  • v3/internal/commands/build_assets/Taskfile.common.yml (1 hunks)
  • v3/internal/commands/build_assets/Taskfile.darwin.yml (1 hunks)
  • v3/internal/commands/build_assets/Taskfile.linux.yml (1 hunks)
  • v3/internal/commands/build_assets/Taskfile.windows.yml (1 hunks)
  • v3/internal/commands/build_assets/devmode.config.tmpl.yaml (1 hunks)
  • v3/internal/templates/_common/Taskfile.tmpl.yml (2 hunks)
  • v3/internal/templates/_common/main.go.tmpl (1 hunks)
  • v3/pkg/application/menuitem_selectors_darwin.go (1 hunks)
Files skipped from review due to trivial changes (2)
  • v3/internal/templates/_common/main.go.tmpl
  • v3/pkg/application/menuitem_selectors_darwin.go
Additional context used
yamllint
v3/internal/templates/_common/Taskfile.tmpl.yml

[error] 18-18: syntax error: expected , but found '{'

(syntax)


[error] 38-38: no new line character at the end of file

(new-line-at-end-of-file)

v3/internal/commands/build_assets/Taskfile.darwin.yml

[error] 45-45: no new line character at the end of file

(new-line-at-end-of-file)

v3/internal/commands/build_assets/Taskfile.windows.yml

[error] 52-52: no new line character at the end of file

(new-line-at-end-of-file)

v3/internal/commands/build_assets/Taskfile.common.yml

[error] 69-69: no new line character at the end of file

(new-line-at-end-of-file)

v3/internal/commands/build_assets/Taskfile.linux.yml

[error] 66-66: no new line character at the end of file

(new-line-at-end-of-file)

Markdownlint
mkdocs-website/docs/en/learn/build.md

13-13: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

Additional comments not posted (35)
v3/internal/commands/build_assets/devmode.config.tmpl.yaml (2)

19-19: LGTM!

The change to use a common task for installing frontend dependencies is a good improvement. It enhances the organization and modularity of the tasks.


21-21: LGTM!

The change to use a common task for starting the frontend development server is a good improvement. It enhances the organization and modularity of the tasks.

v3/internal/templates/_common/Taskfile.tmpl.yml (3)

3-7: LGTM!

The includes section is a great way to modularize tasks and improve maintainability. The paths to the external task files are relative and follow a consistent naming convention.


21-23: LGTM!

The use of {{ "{{OS}}" }} to dynamically call the appropriate OS-specific task is a valid approach. The changes look good.


28-28: LGTM!

The use of {{ "{{OS}}" }} to dynamically call the appropriate OS-specific task is a valid approach. The changes look good.

v3/internal/commands/build_assets/Taskfile.darwin.yml (4)

7-24: LGTM!

The build task is well-structured with clear dependencies and appropriate build flags for production and non-production builds. The environment variables are also set correctly for building on macOS.


26-34: LGTM!

The package task is well-structured with a clear dependency on the build task, ensuring that a production build is created. It also delegates the creation of the .app bundle to the create:app:bundle task, which is a good separation of concerns.


35-42: LGTM!

The create:app:bundle task correctly creates the directory structure for an .app bundle and copies the necessary files into the appropriate locations within the bundle.


43-45: LGTM!

The run task is straightforward and correctly runs the built application.

Tools
yamllint

[error] 45-45: no new line character at the end of file

(new-line-at-end-of-file)

v3/internal/commands/build_assets/Taskfile.windows.yml (5)

7-22: LGTM!

The build task is well-structured and follows best practices:

  • It has appropriate dependencies on common tasks and the generate:syso task.
  • The go build command is used with the correct flags and output path.
  • The BUILD_FLAGS variable is set based on the PRODUCTION flag, which is a good practice.
  • The environment variables are set correctly for Windows.

24-27: LGTM!

The package task is well-structured and follows best practices:

  • It has a clear summary that describes its purpose.
  • It delegates the packaging process to the create:nsis:installer task, which is a good practice for separation of concerns.

29-35: LGTM!

The generate:syso task is well-structured and follows best practices:

  • It has a clear summary that describes its purpose.
  • It uses the correct command and flags to generate the .syso file.
  • The ARCH variable is set correctly.

37-48: LGTM!

The create:nsis:installer task is well-structured and follows best practices:

  • It has a clear summary that describes its purpose.
  • It has an appropriate dependency on the build task with the PRODUCTION variable set to "true".
  • It uses the correct command and flags to create the NSIS installer.
  • The ARCH and ARG_FLAG variables are set correctly based on the architecture.

50-52: LGTM!

The run task is well-structured and follows best practices:

  • It has a clear purpose to run the built application.
  • It uses the correct command to run the application.
Tools
yamllint

[error] 52-52: no new line character at the end of file

(new-line-at-end-of-file)

v3/internal/commands/build_assets/Taskfile.common.yml (6)

4-12: LGTM!

The go:mod:tidy task is correctly configured to run go mod tidy command, with accurate sources and generates fields specified.


14-26: LGTM!

The install:frontend:deps task is correctly configured to install frontend dependencies using npm, with accurate sources and generates fields specified. The precondition check for npm's presence is a good practice.


28-39: LGTM!

The build:frontend task is correctly configured to build the frontend project using npm, with accurate sources and generates fields specified. The dependencies on install:frontend:deps and generate:bindings tasks are correctly specified.


41-50: LGTM!

The generate:bindings task is correctly configured to generate bindings for the frontend using the wails3 generate bindings command, with accurate sources and generates fields specified. The placeholders allow for dynamic configuration based on the build context.


52-61: LGTM!

The generate:icons task is correctly configured to generate icons using the wails3 generate icons command, with accurate sources and generates fields specified.


63-69: LGTM!

The dev:frontend task is correctly configured to run the frontend in development mode using npm. The dependency on the install:frontend:deps task is correctly specified, and the placeholder allows for dynamic configuration of the port.

Tools
yamllint

[error] 69-69: no new line character at the end of file

(new-line-at-end-of-file)

v3/internal/commands/build_assets/Taskfile.linux.yml (4)

7-21: LGTM!

The build task is well-structured and follows best practices:

  • It has a clear summary.
  • The dependencies are logically grouped.
  • The build flags are set based on the production environment.
  • The environment variables are set correctly for Linux builds.

23-30: LGTM!

The package task is well-structured and follows best practices:

  • It has a clear summary.
  • It depends on the build task with the PRODUCTION variable set to "true", ensuring a production build is created before packaging.
  • It runs the create:appimage task, which is a logical step for packaging the application.

32-49: LGTM!

The create:appimage task is well-structured and follows best practices:

  • It has a clear summary.
  • The dependencies ensure that a production build is created and a .desktop file is generated before creating the AppImage.
  • Copying the application binary and icon to the build directory is necessary for creating the AppImage.
  • Using the wails3 tool to generate the AppImage with specified parameters is a standard practice.

51-62: LGTM!

The generate:dotdesktop task is well-structured and follows best practices:

  • It has a clear summary.
  • Creating a directory for the AppImage build is necessary for generating the .desktop file.
  • Using the wails3 tool to generate the .desktop file with specified parameters is a standard practice.
mkdocs-website/mkdocs.yml (3)

35-35: LGTM!

The addition of the content.code.annotate feature is a valid configuration option for the Material for MkDocs theme. This feature will enable users to annotate code snippets directly within the documentation, enhancing user interaction and clarity when dealing with code examples. The change aligns with the PR objective of improving the documentation structure and functionality.


68-68: LGTM!

The addition of the md_in_html markdown extension is a valid configuration option. This extension enables the inclusion of HTML content within markdown files, providing greater flexibility in formatting and content presentation. The change aligns with the PR objective of improving the documentation structure and usability.


151-151: Verify the existence of the learn/build.md file.

The addition of the "Build System" navigation entry and the corresponding learn/build.md documentation page is a valid configuration change. This change suggests an expansion of the documentation to cover more topics related to the build system, enhancing the comprehensiveness of the available guides and resources. The change aligns with the PR objective of improving the documentation structure and usability.

Run the following script to verify the existence of the learn/build.md file:

Verification successful

Verification successful: learn/build.md file exists

The learn/build.md file has been found in the repository at mkdocs-website/docs/en/learn/build.md. This confirms that the new navigation entry in mkdocs.yml correctly links to an existing documentation file, validating the changes made to expand the documentation coverage for the build system.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the `learn/build.md` file.

# Test: Search for the `learn/build.md` file. Expect: The file exists.
fd --type f --full-path 'learn/build.md'

Length of output: 78

mkdocs-website/docs/en/learn/build.md (8)

3-6: LGTM!

The overview section provides a clear and concise introduction to the Wails v3 build system. It effectively highlights the key aspects of flexibility, power, and the use of Taskfile as the task runner. The mention of the "bring your own tooling" approach sets the right expectation for customization.


7-26: LGTM!

The section provides a clear and informative introduction to Taskfile and its role in the Wails v3 build system. The explanation of Taskfile's YAML-based task definition is easy to understand, and the project structure diagram effectively illustrates the organization of Taskfiles.

Tools
Markdownlint

13-13: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


27-70: LGTM!

The section provides a clear and detailed explanation of the role and structure of Taskfile.yml. The inclusion of the default content, along with the explanations of the various sections and tasks, helps in understanding the main entry point of the build system.


72-97: LGTM!

The section provides a clear and informative overview of the platform-specific Taskfiles for Windows, Linux, and macOS. The highlights for each platform cover the important aspects of building, packaging, and platform-specific configurations, giving developers a good understanding of what to expect when working with these Taskfiles.


98-106: LGTM!

The section provides a clear and concise explanation of the relationship between wails3 commands and task execution. The clarification of wails3 build and wails3 package being aliases for their respective task executions is particularly helpful for developers to understand the mapping between commands and tasks.


107-116: LGTM!

The section provides a clear and concise overview of the common build process across all platforms. The listed steps cover the essential aspects of the build process, giving developers a good understanding of what happens under the hood during the build.


117-127: LGTM!

The section effectively communicates the flexibility and customization options available in the Wails v3 build system. The examples of modifications, such as adding new tasks, modifying existing tasks, and integrating with other tools, provide a good overview of the customization possibilities. The emphasis on tailoring the build process to specific requirements while still benefiting from the provided structure is a valuable point for developers.


128-131: LGTM!

The section provides a brief but clear explanation of the dev task for running the application in development mode. The mention of the wails3 dev command with a configuration file and Vite port provides the necessary details for understanding how the task works.

Comment thread v3/internal/templates/_common/Taskfile.tmpl.yml
Comment thread v3/internal/commands/build_assets/Taskfile.darwin.yml Outdated

run:
cmds:
- '{{.BIN_DIR}}\\{{.APP_NAME}}.exe' No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new line character at the end of the file.

The static analysis tool yamllint indicates that there is no new line character at the end of the file. This is a minor issue that can be easily fixed.

Add a new line character at the end of the file to resolve the issue.

Tools
yamllint

[error] 52-52: no new line character at the end of file

(new-line-at-end-of-file)

deps:
- task: install:frontend:deps
cmds:
- npm run dev -- --port {{.VITE_PORT}} --strictPort No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new line character at the end of the file.

The static analysis tool yamllint indicates that there is no new line character at the end of the file.

Add a new line character at the end of the file to adhere to the POSIX standard.

Tools
yamllint

[error] 69-69: no new line character at the end of file

(new-line-at-end-of-file)

Comment thread v3/internal/commands/build_assets/Taskfile.linux.yml Outdated
Comment thread mkdocs-website/docs/en/learn/build.md
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 15, 2024

Copy link
Copy Markdown

Deploying wails with  Cloudflare Pages  Cloudflare Pages

Latest commit: b6f5d43
Status:⚡️  Build in progress...

View logs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@PylotLight

Copy link
Copy Markdown
Contributor

I do agree with making the taskfile system per OS. Thanks for the refactor

@leaanthony leaanthony merged commit 5367d05 into v3-alpha Sep 21, 2024
@leaanthony leaanthony deleted the v3-alpha-chore/taskfile-refactor branch September 21, 2024 10:49
@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot mentioned this pull request Oct 13, 2024
15 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Dec 9, 2024
15 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Feb 25, 2025
15 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Apr 9, 2025
15 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Apr 24, 2025
15 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Aug 20, 2025
15 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Oct 26, 2025
15 tasks
Grantmartin2002 pushed a commit to Grantmartin2002/wails that referenced this pull request Apr 29, 2026
* Refactor taskfile

* Fix escaping

* Fix event error

* Fix dev mode

* Fixes for Windows

* Add docs. Improve docs build system

* Update v3/internal/commands/build_assets/Taskfile.darwin.yml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update v3/internal/commands/build_assets/Taskfile.linux.yml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Improve docs

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

2 participants