New-bee ...How to force WEB-IDE to read local SD card modules? #3984
Replies: 1 comment
-
Posted at 2014-07-31 by DrAzzy You can confuse the IDE into not looking for the module online like so:
Also, require()'s entered on the left side of the IDE will never use the module from the internet (it's going direct to the Espruino). I agree that it would be a nice feature addition to be able to disable searching for modules online. At the same time - if you're doing much development of a module on the SD card, that's a heck of a lot of swapping around of SD cards. You can also install XAMPP and use that as a local webserver, and do:
(unfortunately, on default settings, XAMPP-apache serves files such that they get cached, so you have to use a different file name for each revision - there's a way to change this so apache sends headers that say not to cache, but I've had a hard time figuring it out :-/ - frankly, having to change the name of the file every time is no bad thing if you're not using source control - having those old debug versions around has come in handy on a number of occasions) Posted at 2014-07-31 by user7114 Of course, I could do one of the following: Use a terminal program (Non WEB-IDE) and lose the extremely easy to use syntax checking the WEB-IDE provides. Just publish my new "top secret" module(s) on Github for the Internet to see and use. Install and use XAMPP-apache webserver but for a novice or new-bee this would be a non-starter. Force/fake the WEB-IDE to look at the SD card and constantly swap out the SD and wear out the transflash socket. There has to be a better and easier way. Like directing the WEB-IDE to a C: drive folder for modules? Posted at 2014-07-31 by DrAzzy I just realized - Why the can't the WebIDE handle file:// urls? This would be the perfect solution to this I can do file:///c:/module.js in URL bar of Chrome, press enter, and it loads the file. But for some reason, if I do require("file:///c:/module.js").connect(...) in the right side of the WebIDE, it complains that it can't find the module. Since chrome can handle those URLs, I suspect (hope?) it wouldn't be that hard to get the WebIDE to support that. It would certainly make life much easier for people developing modules (which right now pretty much requires installing a local webserver) Posted at 2014-07-31 by JumJum Chrome apps don't support something like file:// Posted at 2014-07-31 by DrAzzy That is so lame that the chrome web browser will take that URL no problem, but web apps can't. What do you mean "in WebIDE you have to activate projects in options" What are "projects" in this context? Is that something that lets you use files from the local computer with the WebIDE? Where is the tutorial??? Posted at 2014-07-31 by JumJum Projects are a plugin for WebIDE. Under help should be a new button for project which gives a first introduction. I'm still working on this to add functions like
Posted at 2014-07-31 by DrAzzy Oh, woah, that's awesome! Yeah, there's an option in General to enable Projects plugin, then you exit and restart the WebIDE completely, and there it is... neat! I'll have to play with it tonight! Those planned features for it also sound really great, fills in a gap that I've seen a number of people talking about. Posted at 2014-07-31 by JumJum Don't forget to assign a local directory in options ;-) Planned feature will take some time, it will work together with a new function to set and watch variables on Espruino in line chart in webIDE. Posted at 2014-08-01 by user7114
Great, now I am able to patch or modify library modules to my liking and keep On another note ... there should be strict revision version control on all library modules on the internet so users can either chose between keeping their local modules or using the "default" internet modules. Posted at 2014-08-01 by @gfwilliams I was going to suggest this, but @jumjum's already there :) The ability to specify the project directory for modules/etc is really handy. @user7114 the modules all come from GitHub so you can actually just link to specific revisions on there if you have a real need, or you can check back and see what changed. The issue really is that stuff that's more than skin deep doesn't really get used at the moment... If I'd spend months writing a proper package management website, and provided the ability to choose specific revisions, would you have actually read about it and used it, when you didn't even look in settings to see the checkbox marked 'allows you to use files on your local disk'. Posted at 2014-08-01 by user7114
I did look but the word BETA kept me away. "Enable Projects Plugin (BETA)" BTW ... the online docs for modules should include this "new" option. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-07-31 by user7114
I made a modified module and put this module in the "node_modules" folder on the SD card.
When I try to download my code to the Espruino with the proper require("xxxx") a pop-up window says file "xxxx" not found ?
Are you saying I can't use the WEB-IDE with a "Stand-Alone Espruino?"
There should a software flag in the WEB-IDE to select either the Internet or default to the local SD card using the WEB-IDE?
Beta Was this translation helpful? Give feedback.
All reactions