Skip to content

Commit 08e168a

Browse files
committedJan 28, 2022
docs on modules
1 parent d2ec2ce commit 08e168a

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed
 

‎modules/Layout.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
/* Copyright (c) 2022 Bangle.js contibutors. See the file LICENSE for copying permission. */
12
/*
23
4+
Take a look at README.md for hints on developing with this library.
5+
36
Usage:
47
58
```

‎modules/README.md

+46-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,54 @@
11
App Modules
22
===========
33

4-
These are modules used by apps - you can use them with:
4+
These are modules used by apps - you can use them from a Bangle.js app with:
55

66
```
77
var testmodule = require("testmodule");
88
testmodule.test()
99
```
10+
11+
Development
12+
-----------
13+
14+
When apps that use these modules are uploaded via the
15+
app loader, the module is automatically included in the app's source. However
16+
when developing via the IDE the module won't get pulled in by default.
17+
18+
To fix this you have three options:
19+
20+
### Host your own App Loader and upload from that
21+
22+
This is reasonably easy to set up, but it's more difficult to make changes and upload:
23+
24+
* Follow the steps here to set up your own App Loader: https://www.espruino.com/Bangle.js+App+Loader
25+
* Make changes to that repository
26+
* Refresh and upload your app from the app loader (you can have the IDE connected
27+
at the same time so you can see any error messages)
28+
29+
### Upload the module to the Bangle's internal storage
30+
31+
This allows you to develop both the app and module very quickly, but the app is
32+
uploaded in a slightly different way to what you'd get when you use the App Loader
33+
or the method below:
34+
35+
* Load the module's source file in the Web IDE
36+
* Click the down-arrow below the upload button, then `Storage`
37+
* Click `New File`, type `your_module_name` as the name (with no `.js` extension), click `Ok`
38+
* Now Click the `Upload` icon.
39+
40+
You can now upload the app direct from the IDE. You can even leave a second Web IDE window open
41+
(one for the app, one for the module) to allow you to change the module.
42+
43+
### Change the Web IDE search path to include Bangle.js modules
44+
45+
This is nice and easy (and the results are the same as if the app was
46+
uploaded via the app loader), however you cannot then make/test changes
47+
to the module.
48+
49+
* In the IDE, Click the `Settings` icon in the top right
50+
* Click `Communications` and scroll down to `Module URL`
51+
* Now change the module URL from the default of `https://www.espruino.com/modules`
52+
to `https://banglejs.com/apps/modules|https://www.espruino.com/modules`
53+
54+
The next time you upload your app, the module will automatically be included.

‎modules/dane_arwes.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/* Copyright (c) 2020 OmegaRogue. See the file LICENSE for copying permission. */
22
/*
33
Graphics Functions based on the React Sci-Fi UI Framework Arwes
4+
5+
Take a look at README.md for hints on developing with this library.
46
*/
57

68
var C = {

0 commit comments

Comments
 (0)