PakePlus (PacBao)

repository·main·Indexed 10 days ago

https://github.com/sjj1024/pakeplus

A lightweight alternative to Electron for packaging web applications, Vue projects, or React projects into desktop and mobile apps. Built with Rust and Tauri, it produces binaries under 5MB and supports Mac, Windows, Linux, Android, and iOS. It features cloud-based packaging via GitHub Actions to remove local dependency requirements and supports custom JavaScript injection for app automation.

Tokens
17.3K
Snippets
40
Records
107
Agent score
91%

What's inside PakePlus

  1. Overview of PacBao (PakePlus)

    main

    PacBao (also known as PakePlus) is a tool that allows you to convert any webpage into a desktop or mobile application in approximately 9 minutes. It is built on Rust and Tauri, making it significantly lighter (under 5MB) and faster than Electron-based alternatives.

    Key Features:

    • Cross-Platform: Supports Mac, Windows, and Linux. Android and iOS support are planned.
    • Cloud Packaging: Uses GitHub Actions for automated packaging via a GitHub Token, eliminating the need for complex local dependency installations.
    • Customization: Supports injecting custom JavaScript, handling static files (like Vue/React dist folders), and calling system-level APIs (file downloads, command execution, etc.) via JS.
    • Lightweight: Approximately 20x smaller than Electron and 10x faster.
    • Web Version: A web-based version is available at https://pakeplus.pages.dev.
  2. Overview of PakePlus features and capabilities

    main

    PakePlus is a lightweight packaging tool built on Tauri2 and GitHub Actions that converts websites, Vue/React projects, or static HTML files into cross-platform desktop and mobile applications.

    Key Capabilities:

    • Lightweight Packaging: Produces desktop packages smaller than 5MB (up to 20x smaller than Electron) and mobile apps using native frameworks.
    • Cloud-Based Builds: Uses GitHub Actions to package applications in the cloud, eliminating the need for a complex local development environment or heavy dependencies.
    • Static File Support: Directly packages the dist folder of Vue/React projects or a single index.html file into a standalone app.
    • Customization: Supports custom JS injection to add features, automate tasks, or block ads, and offers immersive window modes and shortcuts.
    • Security: Projects are stored in your own Git repositories, and tokens are stored locally to ensure data privacy.
    • Cross-Platform: Supports desktop (via Tauri) and mobile (Android and iOS) builds.
  3. Overview of PakePlus (PacBao)

    main

    PakePlus (also known as PacBao) is a lightweight tool designed to turn any webpage, Vue project, or React project into a desktop or mobile application.

    Key characteristics:

    • Extremely Lightweight: Produces apps under 5MB (approximately 20x smaller than Electron) and is significantly faster.
    • Cross-Platform: Supports Mac, Windows, Linux, Android, and iOS.
    • Technology Stack: Built with Rust and Tauri for desktop, and uses native frameworks for mobile.
    • Cloud-Based Packaging: Uses GitHub Actions to handle compilation, meaning you don't need to install complex dependencies like Rust or Tauri locally.
    • Customization: Supports custom JavaScript injection to automate tasks, hide ads, or add custom features to the packaged site.
  4. Overview of PakePlus features

    main

    PakePlus is a tool designed to package HTML, Web, Vue, or React projects into desktop and mobile applications quickly.

    Key Capabilities:

    • Cross-Platform Support: Package apps for Windows, macOS, Linux, Android, and iOS.
    • Small Footprint: Produces packages significantly smaller than Electron (often less than 5MB).
    • Mobile Support: Uses native frameworks for Android and iOS to ensure speed and small size.
    • Customization: Allows users to customize application icons, application names, and inject custom JavaScript code.
    • Static File Support: Supports packaging static HTML files or compiled dist folders from Vue/React projects.
    • System API Access: Supports calling system APIs (e.g., downloading files) via JavaScript scripts.
    • Local Packaging: Supports local builds that do not require a token or complex development environments.
    • Legacy Windows Support: Supports packaging for Windows 7 and XP, including green (no-install) versions.
    • Electron Option: Provides an Electron-based packaging option for users requiring specific uniformity and stability.
  5. Sponsor Rewards and Privileges

    main

    Sponsoring PakePlus development unlocks several advanced features and privileges. These include:

    • Private projects: Packaged content is stored in your private GitHub repository, accessible only by you.
    • Increased project limits: Higher capacity for project management.
    • Removal of time restrictions.
    • iOS signing-free packaging: Allows packaging for iOS without manual signing (supports online websites only).
    • Shareable downloads.
    • Legacy/Special OS Support: Support for Windows 7, Windows XP, and portable (no-install) versions.
    • Customization: Support for configuring app splash screens and more.

    Note: Users who contribute to PakePlus repositories or promote the project via videos/articles may also be eligible for these privileges by contacting the maintainers.

  6. Common use cases for PakePlus

    main

    PakePlus is designed for several specific workflows:

    • Website to Desktop: Instantly turn any URL into a professional-looking desktop application.
    • Frontend Framework Packaging: Package Vue, React, or Cocos/Unity projects as cross-platform clients without requiring a web server.
    • URL Obfuscation: Hide your website URL within a packaged app to prevent unauthorized sharing or web scraping.
    • Private Intranet Tools: Package company tools as desktop clients to keep the underlying URL private and restricted to the app.
    • Feature Augmentation: Use custom JS injection to add automation or modify existing website behavior (e.g., blocking ads).
    • Environment Optimization: Use PakePlus to avoid the disk space and complexity required to set up a local Tauri2 development environment.
  7. Understand the core concepts of script development

    main

    Script development in PakePlus relies on manipulating the three core components of a website:

    1. HTML: The structure (the "body").
    2. CSS: The styling (the "clothes").
    3. JavaScript: The interaction and logic (the "body movements").

    Since PakePlus scripts are written in JavaScript, your primary goal is to interact with the DOM (HTML) and styles (CSS) to modify how the application behaves and looks.

  8. Platform-specific limitations for window configuration

    main

    When using advanced window configurations, be aware of the following platform behaviors:

    • Windows: Certain visual effects may require workarounds when using window decorations.
    • Linux: Support for shadows and advanced visual effects is limited.
    • Mobile (iOS/Android): Many advanced window features are unavailable on mobile platforms.
    • macOS: Enabling transparent windows requires a private-api flag.
  9. Access Desktop APIs via Vanilla JavaScript

    main

    In a standard JavaScript environment within PakePlus, all Tauri 2 and PakePlus custom APIs are exposed via the window.__TAURI__ object. The object is organized into several namespaces:

    • window.__TAURI__.core: Core functions like invoke, listen, emit, and permission management.
    • window.__TAURI__.app: Application lifecycle and metadata (e.g., getName, getVersion, show, hide).
    • window.__TAURI__.event: Event handling (emit, listen, once).
    • window.__TAURI__.dpi: Display and scaling utilities (LogicalSize, PhysicalPosition, etc.).
    • window.__TAURI__.image: Image processing (Image, transformImage).
    • window.__TAURI__.menu: Native menu construction (Menu, MenuItem, Submenu).
    • window.__TAURI__.path: Filesystem path resolution (join, homeDir, downloadDir, etc.).
    • window.__TAURI__.webviewWindow: Window management (WebviewWindow).
    • window.__TAURI__.fs: Filesystem operations (e.g., writeTextFile).
    // Example of accessing core and app namespaces
    const { invoke } = window.__TAURI__.core;
    const { getName } = window.__TAURI__.app;
    
    const appName = await getName();
    console.log(`Running ${appName}`);
  10. Install iOS Apps via Webclip (Signature-free)

    main

    iOS devices can install apps using a signature-free solution by utilizing an installation descriptor file (Webclip).

    Advantages:

    • No signature required.
    • Works on any iOS device.

    Requirements:

    • Currently, this method only supports the online URL packaging solution. Users simply need to download the packaged descriptor file to install the app.
  11. Important note on GitHub Token usage

    main
    When you add a GitHub Token to PacBao, the tool will fork a PacBao repository into your GitHub account. All your future projects will depend on this fork for creation and compilation. Do not delete your PacBao repository, as it is required for your projects to build.