mulesoft-labs / api-console-cli

A CLI tools for the API console.
Other
14 stars 15 forks source link

Specify working directory while building documentation #17

Closed rahulkavale closed 6 years ago

rahulkavale commented 6 years ago

Hi, Thanks for building such an awesome tool. I have been using this for some time now and I really appreciate you for making this available. However, I wanted to know if we can provide a working directory while building the documentation. Currently when building the documentation, it always downloads the dependencies everytime and takes too much time to complete. I am attaching the log generated via --verbose true option.

info: Creating working directory...
info: Working directory created:  /var/folders/h3/0vpnt1ns19z7df0rrt8rlzfr0000gp/T/tmp-530343yNUs4Lz945B
info: Downloading latest release info...
info: Downloading release tagged as:  v4.2.0
info: Writing source data to temporaty file...
info: Writing API console sources to /var/folders/h3/0vpnt1ns19z7df0rrt8rlzfr0000gp/T/tmp-53034txrXPh1NA7JM.tmp
info: API console sources saved in temporaty location.
info: Zip file has been extracted.
info: Executing command: id -u
info: Checking if bower is installed...
info: Executing command: which bower
info: Installing bower locally...
info: Executing command: npm install bower in dir: /private/var/folders/h3/0vpnt1ns19z7df0rrt8rlzfr0000gp/T/tmp-530343yNUs4Lz945B
info: Installing bower dependencies...
info: Executing command: node_modules/.bin/bower install in dir: /private/var/folders/h3/0vpnt1ns19z7df0rrt8rlzfr0000gp/T/tmp-530343yNUs4Lz945B
info: Dependencies installed.
info: Installing additional bower dependencies...
info: Installing:  0=PolymerElements/app-route#^1.0.0
info: Executing command: node_modules/.bin/bower install PolymerElements/app-route#^1.0.0 in dir: /private/var/folders/h3/0vpnt1ns19z7df0rrt8rlzfr0000gp/T/tmp-530343yNUs4Lz945B
info: Getting the RAML data...
info: RAML data ready
info: Template to use:  standalone-json-inline.tpl
info: Copying the template file to the working directory...
info: Updating main file template variables...
info: Main file read. Parsing content
info: Changing working dir to /private/var/folders/h3/0vpnt1ns19z7df0rrt8rlzfr0000gp/T/tmp-530343yNUs4Lz945B
info: Starting the build.
info: Initializing Polymer builder...
info: Building api console from  /private/var/folders/h3/0vpnt1ns19z7df0rrt8rlzfr0000gp/T/tmp-530343yNUs4Lz945B/index.html
info: Building app with Polymer build...
info: Analyzing sources...
info: Fixing minification issues...
info: Done.
info: Compiling JavaScript...
info: Done.
info: Updating bower paths on the elements.
info: Done.
info: Stripping comments...
info: Done.
info: Minifing HTML...
info: Done.
info: Minifing CSS...
info: Done.
info: Polymer build complete.
info: Copying required dependencies to bower_components...
info: Dependency files copied.
info: Changing working dir to /Users/rahul/projects
info: Copying generated files to the output folder
info: All files copied
info: Cleaning up temporaty dir...
info: Removing  /private/var/folders/h3/0vpnt1ns19z7df0rrt8rlzfr0000gp/T/tmp-530343yNUs4Lz945B
  Console built in 810711 seconds.

As you can see the time taken for building the doc is very high and hence the feedback loop is also long for generating documentation. Most of the time taken is for downloading. I think If we could specify the current working directory, we could reuse the previously downloaded things.

I would appreciate if you could help me with this.

jarrodek commented 6 years ago

Hi,

Thank you for reaching out. The build command has -s option (https://github.com/mulesoft-labs/api-console-cli/blob/master/docs/api-console-build.md#-s---source-value) which you can use to point to api console source location. It can be a directory or a zip file (-z option must be used for zip files). If this option is set then the program will not download the console but will use provided sources.

I hope that helps.