• Stars
    star
    110
  • Rank 307,917 (Top 7 %)
  • Language
    Nim
  • License
    MIT License
  • Created over 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Why Is It So Hard (to make a cross-platform app)?

Tests

Docs | Changelog

Wiish (Why Is It So Hard) GUI framework might one day make it easy to develop, package and deploy auto-updating, cross-platform applications for desktop and mobile. If it succeeds, maybe the name will have to change :)

Wiish is currently ALPHA quality software. Don't make anything with it unless you're willing to rewrite it when this package changes.

Screenshots of macOS, iPhone simulator and Android emulator

Quickstart

  1. Install Nim and nimble

  2. Install Wiish:

    nimble install https://github.com/iffy/wiish.git
  3. Find out what other dependencies you need:

    wiish doctor
  4. Create a project and run it:

    wiish init somedir
    cd somedir
    wiish run

See wiish --help for more, but here are other examples. Some only work within a Wiish project:

wiish run --os ios-simulator
wiish run --os android
wiish build

Features

Wiish provides:

  1. A wiish command line tool for running, building and packaging apps.
  2. A wiish Nim library (i.e. import wiish/...) for app-specific helpers (e.g. auto-updating, asset-access, etc...)
  3. Plugins for different GUI frameworks: import wiish/plugins/...

Plugins

Wiish uses a plugin system to support various GUI frameworks:

  • wiish/plugins/webview - For webview apps based on oskca/webview.

The GUI component is designed to work separately from other features (e.g. auto-updating, packaging, etc...) so that different GUI libraries can be swapped in/out.

It is hoped that more plugins will be introduced for other GUI frameworks.

Support Matrix

The following shows the support matrix of automated tests. Actual support may be better or worse than described here.

  • Yes - For wiish run, this means that the application starts and continues running for a few seconds. For wiish build it means the build succeeded.
  • No - Means it failed
  • - - Means it's not supported (and isn't planned to be supported)
  • Planned - Means it doesn't currently work, but we're planning on getting it to work.
  • Untested - Means that it might work when run on a real computer, but our automated tests aren't yet capable of testing it. For instance, we haven't yet figured out how to run GUI applications on Windows so those are mostly marked Untested.
Host OS --os Example wiish run wiish build
windows android webview Planned Planned
windows mobiledev webview Untested -
windows windows plainwebview Untested Planned
windows windows webview Untested Planned
linux android webview Planned Yes
linux mobiledev webview Yes -
linux linux plainwebview Yes Planned
linux linux webview Yes Planned
mac android webview Yes Yes
mac ios webview Planned Planned
mac ios-simulator webview Yes Yes
mac mobiledev webview Yes -
mac mac plainwebview Yes Yes
mac mac webview Yes Yes

GUI-independent features

Feature macOS Windows Linux iOS Android
App icons Yes Yes Yes
wiish run logs stdout Yes Yes Yes Yes Yes
Log files
Static assets Yes Yes Yes
Automatic updating - -
File associations
Menu bar access - -

Distribution formats

Package Supported Code signing
macOS .dmg
Windows Portable
Windows Installer
Linux .AppImage
iOS .ipa
Android .apk Yes

Examples

See the examples directory for more examples of how to use this library. You can also initialize a project using these examples with wiish init. See wiish init --help for information.

Plugins

webview

Messaging

When using the wiish/plugins/webview plugin, you send/receive strings between JavaScript and your Nim like this:

In JavaScript do this:

window.wiish = window.wiish || {};
wiish.onReady = () => {
    wiish.onMessage(message => {
        // Handle message from Nim
    })
    wiish.sendMessage("Hello Nim! -Sincerely JavaScript");
}

In Nim do this:

import wiish/plugins/webview/desktop
var app = newWebviewDesktopApp()
app.life.addListener proc(ev: DesktopEvent) =
  case ev.kind
  of desktopAppStarted:
    var win = app.newWindow(
      url = some_html_url,
    )
    win.onReady.handle:
      win.sendMessage("Hello JavaScript! -Sincerely Nim")
    win.onMessage.handle(msg):
      discard "Handle message from JavaScript"
app.start()

A note on quality

This library works as advertised, but it is a huge mess. I'm learning as I'm going, and trying to wrangle all these platforms is ridiculous. I happily welcome suggestions (and pull requests).

Developing wiish

See CONTRIBUTING.md for information about contributing to Wiish development.

More Repositories

1

electron-updater-example

A complete example showing how to use `electron-updater`
JavaScript
596
star
2

nim-argparse

Argument parsing for Nim
Nim
117
star
3

lhtml

An app for working with local HTML files.
JavaScript
85
star
4

install-nim

Github Action to install Nim
Shell
29
star
5

changer

A small command-line utility for updating changelogs easily.
Nim
26
star
6

grace

Graceful server restart
Python
24
star
7

nimxc

Nim cross-compiler tool
C
17
star
8

nim-embedfs

Nim library to embed directories in your executable
Nim
17
star
9

nim-keyring

Cross-platform access to OS keyring
Nim
16
star
10

nim-intl

Nim library for i18n and l10n
Nim
8
star
11

electron-autoupdate-example

A complete example showing how to use electron's autoUpdater
JavaScript
7
star
12

norm

Asynchronous, cross-database library
Python
6
star
13

scriptfs

Python
5
star
14

lin

Linear build system (in Nim)
Nim
5
star
15

termtools

Nim terminal tools
Nim
5
star
16

nim-stripe

Nim library for using the Stripe API
Nim
4
star
17

parsefin

Tools for parsing OFX/QFX/OFC/csv financial files.
Python
4
star
18

nim-protocols

A protocol library for Nim
Nim
3
star
19

generalconference

Programming-friendly General Conference
Python
3
star
20

nim-totp

TOTP command line tool
Nim
3
star
21

humancrypto

Cryptography for humans
Python
2
star
22

campus

A terminal MUDish server
Python
2
star
23

txcas

CAS server implemented with Twisted
Python
2
star
24

simplebb

A dumb-server, smart-client automated build system
Python
2
star
25

inliner

Make standalone HTML pages
Python
2
star
26

iffy.github.com

HTML
1
star
27

gdax-ts

TypeScript promise-returning interface to GDAX
TypeScript
1
star
28

unidb

Unified DB API based on Twisted and web.py
Python
1
star
29

blog

Script to render code snippets and publish to Blogger
Python
1
star
30

moldspec

Mold specification
Python
1
star
31

eventsts

Simple typed event emitter
TypeScript
1
star
32

boom

Bomberman clone used as tutorial for learning Twisted
Python
1
star
33

sqldiff

Makes SQL needed to turn one schema dump into another.
Python
1
star
34

nim-ohm

A Nim implementation of the Ohm grammar/parser
Nim
1
star
35

nim-sentry

Nim client for Sentry.io
Nim
1
star
36

twistedftw

Twisted tutorials for beginners
Python
1
star
37

gocatgo

cat, written in go
Go
1
star
38

chalkboard

A simple online chalkboard
Python
1
star
39

nim-memtools

Nim
1
star