Setup Espruino site locally

Posted on
  • Tried to setup Espruino site locally as described at https://github.com/espruino/EspruinoDocs­.

    Everything ran pretty smooth until the modules directory got hit. Since it is a first-time build (with ./build.sh), all minified versions of the modules are rebuilt...

    me:espruinoDocs me$ ./build.sh
    Script location /Users/me/espruino/Espruino/scripts
    BOARD PICO_R1_3
    HTML_FILENAME boards/PICO_R1_3.html
    Script location /Users/me/espruino/Espruino/scripts
    BOARD ESPRUINOBOARD
    HTML_FILENAME boards/ESPRUINOBOARD.html
    Script location /Users/me/espruino/Espruino/scripts
    BOARD ESP8266_BOARD
    HTML_FILENAME boards/ESP8266_BOARD.html
    Script location /Users/me/espruino/Espruino/scripts
    BOARD EMW3165
    HTML_FILENAME boards/EMW3165.html
    Example File examples/distance_sensing_robot.js
    Example File examples/http_file_server.js
    ...
    ...
    ...
    ...
    ...
    >>>> devices/MFRC522.js
    Module MFRC522 is different or doesn't exist
    min /Users/me/workspace/espruinowebsite/www/­modules/devices/MFRC522.js to MFRC522.min.js
    Minifying  /Users/me/workspace/espruinowebsite/www/­modules/MFRC522.js to /Users/me/workspace/espruinowebsite/www/­modules/MFRC522.min.js
    Sending to Google Closure Compiler...
    Minification complete!
    Complete!
    /Users/me/workspace/espruinowebsite/www/­modules/MFRC522.min.js compile successful
    >>>> devices/MPL115A2.js
    Module MPL115A2 is different or doesn't exist
    min /Users/me/workspace/espruinowebsite/www/­modules/devices/MPL115A2.js to MPL115A2.min.js
    Minifying  /Users/me/workspace/espruinowebsite/www/­modules/MPL115A2.js to /Users/me/workspace/espruinowebsite/www/­modules/MPL115A2.min.js
    Sending to Google Closure Compiler...
    Minification complete!
    Compilation failed - function wrapper not found. Got: "Error(22): T" "ater.\n"
    Error(22): Too many compiles performed recently.  Try again later.
    
    Sending to Google Closure Compiler...
    Minification complete!
    Error(22): Too many compiles performed recently.  Try again later.
    
    devices/MPL115A2.js compile FAILED.
    me:espruinoDocs me$ 
    

    Invoking Google's closure compile service too often in a defined time frame gets you in trouble: service will be temporarily denied. Last time when I got service denied, I was developing a module and making frequent (micro) changes. Since I had the module source in the modules folder in the IDE sandbox, every time I uploaded the code to the board, the compile service was inoked, an Google felt I was abusing the service.

    In the IDE though, options could be set to get over this hurdle and use the srevice only once in a while and at the end of a development cycle.

    Two questions:

    1. What are the options - if there are - to buid the site locally with skipping the compile service and do it later?

    2. How do I get out of the mess of a halfway built site build?

  • Looking into build.sh, I notice that the last 'activity' is bash buildmodules.sh.

    Therefore, I expect the site working locally, but just not with all modules minified. Is that correct? ...(edit): it is not running on http://localhost:3040/EspruinoBoard... see next post... :|(

    Remining question is: When Google compile service is granted again - after some period of inacitivity from my part - what is the procedure to complete the first build?

  • It is not running on localhost:3040/EspruinoBoard ...the site brings some google search references...

    I started the site with npm start (see below) and then killed it with Ctrl-c.

    me:espruinoDocs me$ npm start
    
    > espruino-docs@1.0.0 start /Users/me/espruino/EspruinoDocs
    > node app.js
    
    ** EspruinoDocs - running on http://localhost:3040/EspruinoBoard **
    returning: /index.html
    returning: /.html
    ^C
    [1]+  Killed: 9               node app.js
    me:espruinoDocs me$ pwd
    

    Interestingly, on a second start - I just gave it a shot, don't know why - it worked, but has obviously no menu or index. Using .../modules showed thent he modules page:

    me:espruinoDocs me$ npm start
    
    > espruino-docs@1.0.0 start /Users/me/espruino/EspruinoDocs
    > node app.js
    
    ** EspruinoDocs - running on http://localhost:3040/EspruinoBoard **
    returning: /EspruinoBoard.html
    returning: /refimages/EspruinoBoard_main.jpg
    ...
    ...
    ...
    returning: /index.html
    returning: /.html
    returning: /.html
    returning: /modules.html
    ...
    ...
    ...
    

    Questions:

    1. Where is the .../Reference page? ...or how do I get to it? the piece I was looking for for the most... :(

    2. If the initial build had completed, would there be an index page so navigation is possible?

    3. If there is no navigation built, how how could one be created?

    Note: The modules and images folder are outside of the current directory space: /Users/me/workspace/espruinowebsite/www/­modules/ and .../refimages/ - why is this?

  • This is stuff that @chalkers committed just yesterday, so it might need a few tweaks before it works first time.

    Minification

    Nothing you can do here without a lot of work. Just run it again tomorrow and it'll start where it left off and everything will be fine.

    Reference page

    It's built from the Espruino sources. Check out the Espruino project and run scripts/build_docs.py - or if you just want the 1v81 docs, download the zip file from espruno.com/Download and it's in there.

    Index page

    No, but you have 'Modules' and similar pages

    Navigation

    Yes, that's part of Espruino.com which isn't open source. You could add code to app.js that put a header and footer on to the pages it served up.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Setup Espruino site locally

Posted by Avatar for allObjects @allObjects

Actions