https://github.com/robertklep/homey-app-bundler
Bundle Homey apps before `homey app run` to dramatically decrease installation times.
https://github.com/robertklep/homey-app-bundler
Last synced: about 1 year ago
JSON representation
Bundle Homey apps before `homey app run` to dramatically decrease installation times.
- Host: GitHub
- URL: https://github.com/robertklep/homey-app-bundler
- Owner: robertklep
- Created: 2022-11-20T10:56:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-20T12:09:18.000Z (over 3 years ago)
- Last Synced: 2025-02-15T02:43:04.761Z (over 1 year ago)
- Language: Shell
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Homey App Bundler
A shell script for Homey app developers to dramatically decrease installation times (the time it takes for `homey app run` to transfer and install the app on your Homey) by bundling all its resources into a single file.
## Prerequisites
Depends on [`@vercel/ncc`](https://github.com/vercel/ncc), which should be installed globally:
```
$ npm i -g @vercel/ncc
```
## Installation
Download the `homey-app-bundle` script and copy it to somewhere in your `$PATH`. Make sure it's executable:
```
$ chmod 755 /path/to/homey-app-bundle
```
## How to use
Instead of using `homey app run`, use `homey-app-bundle`
## What it does
The script creates a temporary directory to where it copies all app files, _except `node_modules` and `.homeybuild`_. It then runs `ncc` to bundle your `app.js` file including all its dependencies into a single file. Lastly, it will run `homey app run` from inside the temporary directory. Once you stop the app, the temporary directory will be removed automatically.
The script should not change anything in your local app directory.
## Disclaimer
Only tested on a _very_ limited subset of apps, so it will likely not work with all apps (especially SDKv2 apps are problematic at the moment). YMMV.
Known issues:
* apps that load requirements (using `require()`) in `api.js` will fail unless those requirements are also used in/from the main `app.js`
* the use of modules like `require-all` will very likely cause the bundler not to work