Merge pull request #50 from ra100/feature/folder-structure

Change the apps folder structure
master
Gordon Williams 2019-11-18 10:06:21 +00:00 committed by GitHub
commit 200a2184df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
187 changed files with 15 additions and 14 deletions

View File

@ -6,7 +6,7 @@ Try it live at [banglejs.com/apps](https://banglejs.com/apps)
### How does it work? ### How does it work?
* A list of apps is in `apps.json` * A list of apps is in `apps.json`
* Each element references an app in `apps/` which is uploaded * Each element references an app in `apps/<id>` which is uploaded
* When it starts, BangleAppLoader checks the JSON and compares * When it starts, BangleAppLoader checks the JSON and compares
it with the files it sees in the watch's storage. it with the files it sees in the watch's storage.
* To upload an app, BangleAppLoader checks the files that are * To upload an app, BangleAppLoader checks the files that are
@ -26,11 +26,12 @@ easily distinguish between file types, we use the following:
* Start writing your code in the IDE, with `Save on Send` in settings set to * Start writing your code in the IDE, with `Save on Send` in settings set to
the *default* of `To RAM` the *default* of `To RAM`
* When you have your app as you want it, add it as a file in `apps/`, lets assume `apps/my-great-app.js`
* Come up with a unique 7 character name, we'll assume `7chname` * Come up with a unique 7 character name, we'll assume `7chname`
* Create `apps/my-great-app.png` as a 48px icon * When you have your app as you want it, add it as a file in `apps/<id>`, lets assume `apps/7chname/my-great-app.js`
* Use http://www.espruino.com/Image+Converter to create as 1 bit, 4 bit or 8 bit Web Palette "Image String" and save it as `apps/my-great-app-icon.js` * Create `apps/7chname/my-great-app.png` as a 48px icon
* Create an entry in `apps/my-great-app.json` as follows: * Use http://www.espruino.com/Image+Converter to create as 1 bit, 4 bit or 8 bit Web Palette "Image String" and save it
as `apps/7chname/my-great-app-icon.js`
* Create an entry in `apps/7chname/my-great-app.json` as follows:
``` ```
{ {
@ -40,7 +41,7 @@ the *default* of `To RAM`
} }
``` ```
* Create an entry in `apps.json` as follows: * Create an entry in `apps.json` as follows:
``` ```
{ "id": "7chname", { "id": "7chname",

View File

@ -10,7 +10,7 @@ var AppInfo = {
if (storageFile.content) if (storageFile.content)
return Promise.resolve(storageFile); return Promise.resolve(storageFile);
else if (storageFile.url) else if (storageFile.url)
return fileGetter("apps/"+storageFile.url).then(content => { return fileGetter(`apps/${app.id}/${storageFile.url}`).then(content => {
return { return {
name : storageFile.name, name : storageFile.name,
content : content, content : content,

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 743 B

After

Width:  |  Height:  |  Size: 743 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 817 B

After

Width:  |  Height:  |  Size: 817 B

View File

Before

Width:  |  Height:  |  Size: 741 B

After

Width:  |  Height:  |  Size: 741 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 303 B

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 617 B

After

Width:  |  Height:  |  Size: 617 B

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 506 B

View File

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 506 B

View File

Before

Width:  |  Height:  |  Size: 632 B

After

Width:  |  Height:  |  Size: 632 B

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Some files were not shown because too many files have changed in this diff Show More