Git Product home page Git Product logo

desktop's Introduction

TurboWarp Desktop

TurboWarp as a desktop app.

If you're looking for downloads, head to: https://desktop.turbowarp.org/

Licensed under the GPLv3.0. See LICENSE for more information.

Parts of this repository are based on LLK/scratch-desktop.

Website

The website source code is in the docs folder.

Development

We use submodules, so clone using:

git clone --recursive https://github.com/TurboWarp/desktop turbowarp-desktop

or run this after cloning:

git submodule init
git submodule update

Install dependencies using:

npm ci

Then fetch extra library, packager, and extension files using:

npm run fetch

Repeat the three previous sets of commands every time you pull changes from GitHub.

Due to the security requirements mandated by custom extensions existing, our desktop app is significantly more complicated than Scratch's.

  • src-main is what runs in Electron's main process. There is no build step; this code is included as-is. src-main/entrypoint.js is the entry point to the entire app.
  • src-renderer-webpack runs in an Electron renderer process to make the editor work. This is built by webpack as dist-renderer-webpack.
  • src-renderer also runs in an Electron renderer process, but without webpack. This is used for things like the privacy policy window.
  • src-preload runs as preload scripts in an Electron renderer process. They export glue functions to allow renderer and main to talk to each other in a somewhat controlled manner.
  • dist-library-files and dist-extensions contain additional static resources managed by npm run fetch

To build the webpack portions in src-renderer-webpack for development builds, run this:

npm run webpack:compile

You can also run this instead for source file changes to immediately trigger rebuilds:

npm run webpack:watch

Once you have everything compiled and fetched, you are ready to package it up for Electron. For development, start a development Electron instance with:

npm run electron:start

In Linux, The app icon won't work in the development version, but it will work in the packaged version.

We've found that development can work pretty well if you open two terminals side-by-side and run npm run webpack:watch in one and npm run electron:start in the other. You can refresh the windows with ctrl+R or cmd+R for renderer file changes to apply, and manually restart the app for main file changes to apply.

Linux sandbox helper error

On some Linux distributions, Electron will crash with the message The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /home/.../turbowarp-desktop/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.. Notably we have seen this happen on Debian 10 and earlier and Ubuntu 24.04 and later.

For development, you can run these commands to enable unprivileged user namespaces until you reboot:

# Enable unprivileged user namespaces.
sudo sysctl -w kernel.unprivileged_userns_clone=1

# Stop AppArmor from preventing unprivileged user namespace creation by default.
# If your distribution does not use AppArmor then you can ignore the error.
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

There are ways to make this permanent, but we don't think you should be making permanent kernel configuration changes just to develop this app. This error won't happen in the final .deb package, Flathub, or Snap Store releases.

Final production-ready builds

The development version of the app will be larger and slower than the final release builds.

Build an optimized version of the webpack portions with:

npm run webpack:prod

Then to package up the final Electron binaries, use either our build script release-automation/build.js (see release-automation/README.md) or the electron-builder CLI. Either way the final builds are saved in the dist folder. Here are some examples using the electron-builder CLI directly:

# You can also do manual builds with electron-builder's CLI, for example:
# Windows installer
npx electron-builder --windows nsis --x64
# macOS DMG
npx electron-builder --mac dmg --universal
# Linux Debian
npx electron-builder --linux deb

You can typically only package for a certain operating system while on that operating system.

Advanced customizations

TurboWarp Desktop lets you configure custom JS and CSS without rebuilding the app.

Find TurboWarp Desktop's data path by using the list below or by clicking "?" in the top right corner, then "Desktop Settings", then "Open User Data", then opening the highlighted folder, or refer to this list:

  • Windows (except Microsoft Store): %APPDATA%/turbowarp-desktop
  • Microsoft Store: Open %LOCALAPPDATA%/Packages, find the folder with the word TurboWarpDesktop in it, then open LocalCache/Roaming/turbowarp-desktop
  • macOS (except Mac App Store): ~/Library/Application Support/turbowarp-desktop
  • Mac App Store: ~/Library/Containers/org.turbowarp.desktop/Data/Library/Application Support/turbowarp-desktop (note that the org.turbowarp.desktop part may appear as TurboWarp in Finder)
  • Linux (except Flatpak and Snap): ~/.config/turbowarp-desktop
  • Linux (Flatpak): ~/.var/app/org.turbowarp.TurboWarp/config/turbowarp-desktop
  • Linux (Snap): ~/snap/turbowarp-desktop/current/.config/turbowarp-desktop

Create the file userscript.js in this folder to configure custom JS. Create the file userstyle.css in this folder to configure custom CSS. Completely restart TurboWarp Desktop (including all windows) to apply.

Uninstall

See https://desktop.turbowarp.org/uninstall

desktop's People

Contributors

cubesteryt avatar dependabot[bot] avatar garbomuffin avatar sitiom avatar techboyg5 avatar xaspirus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

desktop's Issues

Arch PKGBUILD and AUR

The Arch Linux people have PKGBUILDs and the AUR, see if we can get ourselves on there?

MACOSX and Linux

If you are using electron to package the windows app
It should be easy to build it for MACOSX or Linux

0.0.2

Probably releases this weekened Sunday Monday

  • added macOS build (tentative)
  • added file association for sb3 files (lets you double click file to open)
  • added ctrl+s to save project
  • fixed sprite, costume, backdrop, and sound libraries when offline
  • fixed developer tools keyboard shortcuts (ctrl+f, ctrl+space, etc.)
  • display project title in window title
  • exit confirmation is only shown when project is changed
  • added in-app "About" screen with license text and addon credits
  • added a splash screen before the real loading screen appears
  • added standard electron menu bar and shortcuts
  • removed some things that don't make sense in TurboWarp Desktop: progress bar, privacy policy, embedding instructions, URL parameters
  • improved update checker: versions can be ignored and security updates get a special message (and can not be ignored)
  • other minor bug fixes, improvements
  • updated TurboWarp

Linux support

As we are an electron app, this isn't terribly difficult. However, we still have to answer:

  • What distributions and formats should be supported?
  • Have snap/flatpak/AppImage seen significant adoption yet?

I'll most likely just make a .deb for Debian and *buntu and maybe a tarball for everyone else. Would that be enough?

I don't want to do anything more than that because Linux (ignoring Chrome OS and Android, those don't count) is ~2% of the userbase.

32-bit support

Is it worth making builds specifically for 32-bit systems?

Code signing

  • Windows: need to buy a certificate from a reseller, >$100 per year. We are on the Microsoft Store so this is less of a concern, but a lot of our users still use the non-Microsoft Store version
  • macOS: need to pay Apple $99 per year for a developer account (we do not have this money)
  • Linux: don't think code signing even exists over there yet, so not a concern

0.0.4

Tentative release date: Wednesday

  • Update TW: addons, dark mode, bug fixes
  • Significant internal cleanup to streamline releases
  • Atomic file saving (#33)
  • ARM support for Linux (#34)

Autosave?

Autosave would be cool. Also, I love the idea of Turbowarp Desktop!

Flatpak build for linux

Flatpak is another way to package things for linux.

electron-builder does not appear to natively support this.

Snap store

Apparently the snap store exists

Consider publishing builds on there, shouldn't be hard now that we use GH actions for handling this. electron-builder appears to support that.

0.1.0

  • warp timer is now enabled by default
  • translations
  • get an icon
  • build icon for mac
  • build icon for windows
  • build icon for linux
  • use the new onClickAbout mechanism from upstream?
  • in-app privacy policy (again, using Scratch's mechanism)
  • linux: fix icon (#35)
  • linux: snap build (#32)
  • linux: appimage build (#57)
  • remove normal help menu
  • waiting for GUI and addon updates to stabilize
  • update homepage
  • update privacy.html
  • update update_available.html

Tentative release: Tuesday

AppImage build for linux

Apparently AppImage is one of the 40 methods for packaging things for linux.

electron-builder seems to support it, so it shouldn't be hard.

File saves are not atomic

If the user closes the program while it is saving, it's possible that the save could be corrupted. Saving should be made atomic so that this can't happen.

Addon management

SA lets you turn on/off addons and change their settings, we should too

Frameless window

Use a frameless window. Make the red header blank space the draggable region. Add window controls to the right side of the red header.

0.0.3

Tentative release date: Monday? Monday.

Changes since v0.0.2:

  • Addons!
    • TurboWarp now has a mostly complete reimplementation of the internals of that one browser extension, which makes porting addons trivial.
    • Addons can be enabled or disabled and have their settings changed from the new "Addons" button.
    • Addons can now be translated.
    • Imported addon: Onion skinning
    • Imported addon: Hex color picker (enabled by default)
    • Imported addon: Data category tweaks
    • Imported addon: Bitmap images copying (enabled by default)
    • Imported addon: Display stage on left side
    • Imported addon: Confirm sprite deletion
    • Imported addon: Record project video
    • Imported addon: Customizable block colors
    • Imported addon: Auto-hide block palette
    • Imported addon: Colored context menus
    • Imported addon: Clone counter
    • Imported addon: Mouse position
    • Imported addon: ๐Ÿ˜บ
    • These will soon find their way into the turbowarp.org website as well :)
  • Fix automatic restore points
  • Fix fullscreen resizing
  • Various bug fixes
  • Windows: removed menu bar. Developer tools can still be accessed with Ctrl+Shift+I
  • macOS: You can now open multiple windows through File (macOS menu bar, not Scratch) > New Window or with Command+N

Add DevTools keyboard shortcut

Electron has the full Chromium DevTools, but they're currently inaccessible because there is no keyboard shortcut to invoke them.

DevTools should open when Ctrl+Shift+I is pressed, just like Chromium and everything using it.

0.2.1

Some addon issues were found, there will be a 0.2.1 released probably on Wednesday

0.2.0

  • Improved sandboxing and security
  • Slightly revised privacy policy #70 (Primary change is documenting that the app may make requests to Scratch)
  • Simple context menus #25
  • Fixed music extension #72
  • Fixed Text to Speech extension
  • Fixed splash screen dark mode #78
  • Improved file pickers when exporting costumes, sounds, sprites, and video
  • Updated TW GUI: interpolation, addons, l10n
  • Updated Electron to 12
  • Linux: Fixed crash on startup in some distros (Debian 10) #60
  • Some parts of the app renamed from "TurboWarp Desktop" to "TurboWarp"

Tentative release: March 9th

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.