bitovi / documentjs

The sophisticated documentation engine
https://documentjs.com/
MIT License
598 stars 381 forks source link

update steal-* dependencies (fixes #270) #288

Closed christopherjbaker closed 6 years ago

christopherjbaker commented 6 years ago

Updates steal-* to the latest

m-mujica commented 6 years ago

so, these deps are listed here just to make documenjs tests a little faster....

During the build, this module is used to create a package.json in /sites/static/build/...., and npm install is ran inside the build folder.

if we wanted to upgrade the version of steal used during the build, make_package_json is what you want to update.... And I'm guessing you'll have to update/upgrade the stuff in here https://github.com/bitovi/documentjs/tree/15cf7de6316ee6500a17f051a3592787abf2aa00/site/default/static to get that build working.

christopherjbaker commented 6 years ago

That makes sense. Took some time to figure out, though. Thanks @m-mujica!

When I run the tests locally, I get the following error. However, I modified test/open.js to not turn off the server, and was able to open the file in my browser just fine. I also tried adding a 10s delay before trying to open the URL, and that did not help. It passes on travis, though...

 Error: Server returned status code 404 from http://localhost:8081/test/tmp/multiple_versions/1.0.0/api/index.html
    at /Users/christopherjbaker/Bitovi/canjs/documentjs/node_modules/zombie/lib/document.js:764:39
    at process._tickCallback (internal/process/next_tick.js:68:7)
  cause:
   Error: Server returned status code 404 from http://localhost:8081/test/tmp/multiple_versions/1.0.0/api/index.html
       at /Users/christopherjbaker/Bitovi/canjs/documentjs/node_modules/zombie/lib/document.js:764:39
       at process._tickCallback (internal/process/next_tick.js:68:7),
  isOperational: true }
m-mujica commented 6 years ago

@christopherjbaker I just tested this branch with the documentcss quick start guide and it works but I think it'd be worth to make some small changes and stick to steal defaults as much as possible.... not a fan of the bundles/bundles part of the path

  1. in site/default/static/build.js, remove the custom dest value.

    this way the build in site/static/build/{hash} looks like any regular stealjs app. screen shot 2018-06-22 at 12 07 26 pm

  2. in site/default/static/build.js, remove the logic to create a bundles folder and just move the generated folders as is, like: screen shot 2018-06-22 at 12 09 03 pm

  3. Update the mustache templates to load steal and the bundles from the right locations: a. <link rel="stylesheet" type="text/css" href="./static/dist/bundles/static.css"> b.

       <script type="text/javascript"
          data-main="static"
          data-bundles-path="./static/dist/bundles"
          data-config="package.json!npm"
          src="./static/dist/steal.production.js">
       </script>

The generated docs structure would look like this: screen shot 2018-06-22 at 12 14 21 pm

Taking it one step further ... ?

I'd even look into removing the static folder we create in the final folder, that way the generated docs would look like every other stealjs app and we'd be able to remove some of the custom config passed to the script tag.

├── dist
│   ├── bundles
│   │   ├── static.css
│   │   └── static.js
│   └── steal.production.js
├── fonts ...
├── html5shiv.js
├── img ...
├── index.html
├── package.json