Introducing Fuse SDK

Morten Daniel Fornes

Hello everyone,

Just wanted to write a blog post about our new package manager solution, to get all on board with the new workflow, now powered by NPM.

For those who don’t know already, Fuse Open is a set of open-source tools and libraries for cross-platform mobile app development, which supports building beautiful, high-performance iOS and Android apps with a single codebase. Essentially, it’s the best tech around to build any app. ;)

The core components of Fuse Open are Uno/UX and Fuselibs, essentially a compiler and a set of libraries. In the past, these components were shipped as part of Fuse Studio. Unfortunately, creating new Fuse Studio releases is time consuming and manual work, and after going open-source we’ve run out of disk space in our hosting provider, and generally seen little interest from volunteers wanting to work on the open-source version of Fuse Studio…

Regardless, Uno/UX and Fuselibs are still kept up-to-date by the community; with many bugfixes, performance improvements and new features coming in every month. Most notably we support latest versions of Android SDK/NDK tools and iOS tools, the new 64-bit policy in Google Play Store, TypeScript transpiling, Linux building, and much more. Complete changelogs can be found here and here.

So, we needed a new way to distribute up-to-date core components in a more efficient manner. The solution is NPM, and here comes a quick introduction to the new workflow.

Global install

The quickest way to get going is to install Fuse SDK globally.

$ npm install -g fuse-sdk

This will install uno (the compiler) and all libraries needed to build Fuse apps. You can check that everything is OK by invoking uno --version. If this says version 1.12.0 (or greater) you know that we're running the latest version.

$ uno --versionUno version 1.12.0 (build 347) Windows 10 x64 72a6a3f
Copyright (C) 2018-present Fuse Open

You can now go ahead and build your Fuse app using the uno command.

$ uno build android foo.unoproj

Uno can build apps for the following targets: android, ios, dotnet and native. For rapid testing directly on your desktop computer, dotnet is often the best choice; the same target the designer in Fuse Studio is based upon.

You can find a bunch of example projects to play with on our GitHub.

Local install

With NPM, you can also install Fuse SDK locally in your project. This ensures that everyone working on the project are using the exact same version, and allows working on multiple projects simultaneously using different versions of Fuse SDK. You’re more likely to avoid unfortunate surprises when digging up an old Fuse project, since the Fuse SDK version will still be the same as before. If you’re familiar with NPM you probably know this already.

To install Fuse SDK locally, you’ll need a package.json file for NPM. Running npm init will create one for you.

$ npm init

Then you can install Fuse SDK as a developer dependency.

$ npm install fuse-sdk --save-dev

Now, a local version of uno is added in your node_modules/.bin folder. You can run it by providing its full path.

$ node_modules/.bin/uno --versionUno version 1.12.0 (build 347) Windows 10 x64 72a6a3f
Copyright (C) 2018-present Fuse Open

To make things more streamlined, you can add a script in package.json to run the right uno.

"scripts": {
"uno": "uno"
}

And then run uno like this:

$ npm run uno -- --versionUno version 1.12.0 (build 347) Windows 10 x64 72a6a3f
Copyright (C) 2018-present Fuse Open

You can add some more high-level scripts for convenience, such as:

"scripts": {
"android": "uno build android --run",
"ios": "uno build ios --run",
"dotnet": "uno build dotnet --run",
"native": "uno build native --run"
}

And then easily run your app on a connected device, like this:

$ npm run android

… and so on. :)

Continuous integration

Another benefit of the new workflow is how easy it is to set up continuous integration (CI) for your project, because all dependencies are installed via NPM. Essentially, all you need is this:

$ npm install
$ npm install -g android-build-tools
$ uno build android

And that’s it. You can check out this GitHub repo for a full working example, most notably .appveyor.yml. AppVeyor is a nice CI that is easy to set up and free for open-source projects.

Bleeding edge

If you’re waiting for a particular feature to be released, it’s possible to take a shortcut and install individual components straight from master, or any other branch or your personal fork. Just visit Uno/UX or Fuselibs, click the AppVeyor badge in README, select a build and go to the Artifacts tab. Then copy the link to the listed .tgz file, for example:

$ npm install https://ci.appveyor.com/api/buildjobs/ymv2oq4jya5xas2l/artifacts/fuse-open-uno-1.12.0.tgz --save-dev

NB: Please be aware that artifacts are automatically deleted by AppVeyor after six months.

Final words

If you have feedback or experience difficulties, don’t hesitate to reach out. You can comment below on this blog post, or find us on Slack, GitHub and Forums.

Oh, and we’re setting up an Open Collective to fund future development of Fuse Open. We plan to write more about this and future plans soon, but if you have money burning in your pocket, you can go donate already and help us continue our work. ;)

Thank you everyone and happy apping!

Morten Daniel Fornes

Written by

Digital Entrepreneur, Digital Nomad, Open Source Software Developer and Hakuna Matata. Bangkok, Thailand ❤

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade