Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Code organization, folder per app #46

Closed
ra100 opened this issue Nov 15, 2019 · 7 comments
Closed

[Suggestion] Code organization, folder per app #46

ra100 opened this issue Nov 15, 2019 · 7 comments

Comments

@ra100
Copy link
Contributor

ra100 commented Nov 15, 2019

Would it make sense to have a folder per app, for better navigation in the source?
example:

  • apps/animals/animals.js
  • apps/animals/animals.json
@gfwilliams
Copy link
Member

Thanks - yes, that could make sense. To be honest even with that it's going to get pretty hard to navigate, so I'm open to other ideas as well.

While having a single apps.json is a bit of a pain, there's something really handy about being able to test using GitHub pages on your own fork though.

@ra100
Copy link
Contributor Author

ra100 commented Nov 16, 2019

So for apps.json, would it make sense, to have that info actually in json of every app, and then just generating apps.json by simple script?
And going even further, what if every app had it's own repo and be linked to BangleApps just by apps.json? But that would mean, that apps could change without PR review to this repo, which sounds a bit unsecure.
Maybe just for now, some simple structure would be enough, and later, when it gets out of hands, to think more about it :)

@gfwilliams
Copy link
Member

and then just generating apps.json by simple script?

Except that you could no longer just test it out using GitHub pages :(

While running a script seems fine to us, for a non-Node.js developer, installing Node.js then downloading and learning command-line git is quite a big learning curve.

Another option is to use something like https://github.com/gfwilliams/ThinGallery (so basically just scrape the website using client-side code), but that's slow.

But that would mean, that apps could change without PR review to this repo, which sounds a bit unsecure.

Yeah, I mean if you don't want to do a PR you can always host your own repo. I think there's definitely some possibility of allowing proper third party stuff later, but especially for beginners I think having one repo with some level of vetting is a good idea.

@ra100
Copy link
Contributor Author

ra100 commented Nov 16, 2019

Yes, I didn't think about non-Node.js users. What about leaving it like it is, you'll just edit apps.json manually, for normal people :) and for lazy ones have js script, that would update it based on changes in apps. Buuut, right now, as I'm reading this, it looks like too much overhead. You'll have always the "check" in PR, where you'll see that apps.json was (or was not) updated.

Now I'm thinking how to combine good developer experience (with nice toolset, automated things and so on), but also keep it as simple as possible to add your own app.

@ra100
Copy link
Contributor Author

ra100 commented Nov 16, 2019

So how would moving to app folders look like.

  • Have folder based on app id? Eg: mclock for Morphing clock, or clock-morphing?
  • Should folder be specified in apps.json? {"name":"+mclock","url":"clock-morphing/clock-morphing.json"}, or if it's the id, then create the path automatically, or add new property like rootDir or something with better name?

@gfwilliams
Copy link
Member

I'd say have the folder based on the 7 character name - which means we then easily avoid name clashes.

Probably not worth specifying the folder name in the JSON as it's just extra typing/opportunity for errors :)

ra100 added a commit to ra100/BangleApps that referenced this issue Nov 17, 2019
ra100 added a commit to ra100/BangleApps that referenced this issue Nov 17, 2019
ra100 added a commit to ra100/BangleApps that referenced this issue Nov 17, 2019
@gfwilliams
Copy link
Member

gfwilliams commented Nov 18, 2019

Fixed with #50

adamschmalhofer added a commit to adamschmalhofer/BangleApps that referenced this issue Jan 4, 2022
Reading

espruino#1020
espruino#46

My understanding is that the requirement for a splitt apps.json solution
is:

  - work seemlessly with github pages (no manually calling a script)

  - single (or at most a few) apps.json for the browser to load for the
    store so the store page is fast

As the github pages already use jekyll to build the store page this can
be solved by a minimal jekyll plugin. This is a proof of concept of
that. If the concept is accepted in a next step, I will create the
splitt files for mmore that just the two here.
adamschmalhofer added a commit to adamschmalhofer/BangleApps that referenced this issue Jan 5, 2022
Reading

espruino#1020
espruino#46

My understanding is that the requirement for a splitt apps.json solution
is:

  - work seemlessly with github pages (no manually calling a script)

  - single (or at most a few) apps.json for the browser to load for the
    store so the store page is fast

As the github pages already use jekyll to build the store page this can
be solved by a minimal jekyll plugin. This is a proof of concept of
that. If the concept is accepted in a next step, I will create the
splitt files for mmore that just the two here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants