AirCodea - AirCode in Codea

Hello everyone!

AirCodea is my attempt to reproduce AirCode in Codea.
It’s actually a prototype with some ideas that are not fully implemented.
It runs a web server based on expressLua (my partial implementation of expressJS but in Lua) with coroutines.
You can fork this project to create your own AirCodea or to contribute to the main project.

Some additional features compared to AirCode:

  • You can play/pause (if you use the update callback), enable/disable autoplay and autosave
  • Alt-s to save the project (only useful if autosave mode is disabled)
  • Alt-r to restart the project
  • Alt-w to remove the current project tab

The autoplay don’t restart entirely the project, in other words, it doesn’t run again the setup function, but all others variables and functions are updated.

Limitations

  • only project names without spaces, accents and special characters like ‘_’ works for now
  • only projects that you have created are availables

Don’t use it on projects that haven’t backup ! Stability is not well tested yet. So don’t hesitate to duplicate your projects before using AirCodea for now.

https://github.com/HyroVitalyProtago/AirCodea/releases/download/v0.1/AirCodea.zip

In this thread, you can also list the features that you want or dream about.

examples of the next features/changes list :

  • maintain good tab order order on client, change tab order (, scroll horizontaly if there is a lot of tabs)
  • better projects list
  • better editor ui (create/delete tab, …)
  • create/delete projects
  • replace monaco editor with codemirror
  • version control system integration (github)

Have a good day!

Cool thanks ! I’ll test it soon and contribute if I can !

@HyroVitalyProtago - just had a quick look at AirCodea and looks neat. Nice editor. Can you get the icons up for the file?

Hit an early problem - ran one of my developing projects and it fired up an error for the following line:


if instW < 32 then

Error was “Main:75: type ‘userdata’ is not supported by JSON.”

Hey @Bri_G !

Sorry, but I don’t understand your question about the icons :confused:
If it’s about icons in the buttons, you can keep your mouse over it to have a tooltip of what it does. If it’s about projects page, icons of each project will be added, but it’s not a main feature for now and I’ll have to redo the projects page anyway.

For your early problem, it’s maybe because you read something in your project like local data, and I haven’t encapsulated all this functions in the env to run it on your real codea project (for the moment, storage functions don’t works for project). Or it’s maybe a problem with the line before or after (lua isn’t really precise in its line errors detection). If I can see the code of the main file, maybe I can found the problem.

@HyroVitalyProtago - I was referring to the project page icons. It would be nice but not a priority.

I think the error may be as a result of a dependency file being included, does AirCodea deal with that in you released version?

The dependency includes a table of data, is that read in by Json?

@Bri_G Yep, I will include icons later on the projects page :wink:

Right, I also doesn’t include dependencies at this time, I’ll add it to my main list of features!

@HyroVitalyProtago - more feedback. Just logged onto AirCodea again and whilst logging on (using Firefox on Mac) I typed in 192.168.0.5 in the address field - gave the usual options but on pressing the enter key AirCodea was connected without specifying the port?

Also AirCodea seemed to keep the port open even when I had exited it on the iPad.

Previous issue - regarding dependencies, the error did not disappeared when I removed the dependency and incorporated the dependent code in a new Tab in the Codea project.

Ran a number of my projects fine then seemed to hang up, locked out and had to restart the project and web page.

Love the editor - still early days. Hope this feedback helps.

@Bri_G Thanks a lot for the feedbacks!

  • You don’t need to write the port because it’s the default HTTP one. I found that more user-friendly.
  • To close the socket directly, there is a button Close in parameters sidebar. @Simeon is there a way to have a onClose fallback that is called when a project is closed?
  • For the dependency things, it’s strange that incorporate files directly in the project doesn’t resolve the things… did you use a storage function like readText, readProjectData or readImage? I haven’t handle those functions for now if the assetKey begins with Project:.

Ran a number of my projects fine then seemed to hang up, locked out and had to restart the project and web page.
Don’t know why, I needs to try this kind of project to see if I can identify the problem…

I forgot to say it in the initial message, but it’s possible to create a new tab with alt-t, write the tab name, then press enter.

@HyroVitalyProtago - just tried running my project above with the data table incorporated in a tab. It came back with the same problem - not dependency related.

Now think it may be due to me using emoji tables as in the following recent link:

https://codea.io/talk/profile/419/Bri_G

@Bri_G Thanks again for the feedback! I will try to use emojis to see if its related.

Cool. I’d love to try this. For dummies: What do I have to do? (I don’t really know what to do with the ZIP files and its content. I have it on my PC.)

@Bejoscha - if you have used the Codea version (from the assets menu on Codea) it is very similar. You run the Aircode link on Codea which gives you a URL to type into a browser window and voila you can see the project icons and can edit projects by selecting them.

With @HyroVitalyProtago ‘s project you can select the zip (from the file app) and when it comes back with open in ??? You select Codea, Codea then downloads and installs the app. So instead of using the Codea Aircode link you just run the new project which gives you its own link for your browser.

Differences? Projects listed as text and a different editor. Still early days but looks promising.

@Bri_G Thanks a lot. Got it to work - and like it.

@HyroVitalyProtago
This is very much what I was asking for on a different topic, absolutely love it! Please continue working on this project. I have not yet have a lot of time for testing (life is in the way and I need to get used to Codea itself as well), but it already works quite nicely.
I don’t understand any of the Lua magic behind it, but I’m glad I don’t need to right now :c)

Some feedback right away:

  • But the ALT-S, ALT-R, etc short key info into the tool text of the UI.
  • Have a dedicated “restart button” on top (the ALT-R)
    Or have the “play” button work like that. (When pressed while not on pause). Currently, it doesn’t seem to do anything.
  • mouse wheel scrolling on the code does not seem to work

I love the fact that I can jump between projects for easy copy & paste.

Hi @Bejoscha ! Thanks for your kind words and your feedbacks.

I will add buttons in addition to the shortcuts, it’s a better UX design, but shortcuts was more easy to add at the beginning to test things :slight_smile:

The play button only do something if you use an update fallback like setup or draw. I will probably only display a restart button if the main file doesn’t contains the update callback.

Sadly, the mouse scrolling doesn’t work on firefox with the monaco editor. I will create another branch of the project with the CodeMirror editor.

In addition, I will probably add a webdav support to enable everyone to edit files with its favorite editor, but that will not support functions like disabling autoreplay, play/pause, etc… // or maybe I can support it with annotations in comments on the main file

@HyroVitalyProtago Great! Please keep me posted. I’m not online that often, so if you could send me notification if you post and update, that would be lovely. Or… hang on. It’s GitHUB. I should just follow the project there I guess :c)

@HyroVitalyProtago - I have just been using Visual Studio Code editor and it is great. Is there any way you can use that with AirCodea?

@Bri_G For now, AirCodea doesn’t support it but you can try https://github.com/XanDDemoX/DAVify-Codea

I want to integrate it, but I haven’t enough time to work on it right now…

@HyroVitalyProtago - had a look at DAVify but struggling to get a connection. Downloaded DAVify from the website and put zip in the Codea folder - when trying to run it the zip opens Codea but can not see any app present. Should I just manually transfer files into Codea?

@Bri_G You can also manually transfer files if the open zip one doesn’t work. Else, there is also a WebDAV server with the Working Copy app.

@HyroVitalyProtago - unzipped the Davify zip and transferred the files to Codea. After a little tab shuffling got it to work and window came up but can not see it from my Mac opening up wit URL and port 8080. There is a problem with AirCode at the moment on 179 and it bombs Codea. Simeon looking into it.