Enhancement: Node.js Local Document Generator#531
Enhancement: Node.js Local Document Generator#531MutableLoss wants to merge 12 commits intoworkshopper:masterfrom
Conversation
|
The CI build check is choking on the docbuild file which cannot get past the test. I am not sure what to do to get around the errors on the require calls, but everything works as intended. |
| @@ -0,0 +1,7 @@ | |||
| createDocs = require('node-offline-api').createDocs | |||
| buildOptions = require('node-offline-api').buildOptions | |||
There was a problem hiding this comment.
can we use something like var buildOptions = require('') or const may be.
That would help the test to pass.
There was a problem hiding this comment.
Thanks @AnshulMalik !
Wow, what in the world was I doing when I submitted that? I think I spent a little too much time with Ruby that day. :)
It has been done! Using var for now, until the lowest version of Node is a specific, then I can cross-check the available ES6 sugar that can be safely used.
|
Looks like one more issue where it is checking the local file build, and adding the default folder path. Fix on the way up. |
|
Looks like the travis is still unhappy :P |
|
Ok, it looks like it is now failing on the official Node.js document generator API that is part of the offline document API, otherwise it seems to be working as intended. I could go through those files, and change them all to standard if needed, and it should remove any of the CI errors. Actually, going to check out this EEXISTS issue first. |
|
Ok, I see now. It is catching the fs.stat error which isn't an actual error. Let me quiet that down, and see if it will ignore the standard on the official after that. Fix coming up. |
|
Well, the fatal errors are gone now. The only issue with the tests is where the tests see some of the verbosity of the API when testing the exercises.
EDIT: Yep, I need to check this out. It seems when running it with next/verify/help/etc the messages still show. I'll create a new fix in the morning. Apologies for all of the surprises there at the end. |
|
Ok, refactored, and re-released module to allow 100% passing locally. |
|
It looks like there is a possible issue when validating files. I'm going to take the weekend to look for a way to limit the possible executions, instead of running on every instance. |
1b44cdb to
ed2bee4
Compare
|
Since I rebased with the latest master, it seems that the 5.x build is now erroring, but the 6.x and 7.x tests are passing. Unfortunately the 5.0 build is giving an npm error that if cannot find the function Looking through my latest source, I am not finding this being called. It looks like this is an external issue, but not sure where when no node modules are being installed due to the error. Please let me know if you need anything from me, as I would love to see this move forward so I can continue to help with new updates to help make this a more recent-friendly workshop. 😃 |
martinheidegger
left a comment
There was a problem hiding this comment.
I merged this PR against a test-branch and the build seems to be working now: https://travis-ci.org/workshopper/learnyounode/builds/343205079
But I added some response on how to improve this PR. It would be awesome if this could find its way into master.
| }, | ||
| "scripts": { | ||
| "lint": "./node_modules/.bin/standard", | ||
| "lint": "./node_modules/.bin/standard --fix", |
There was a problem hiding this comment.
This should not be part of THIS pr! (Note: during development you can run npm run lint -- --fix
| buildOptions.buildName = 'node_apidoc' | ||
|
|
||
| fs.stat('../node-apidoc', function (err) { | ||
| if (err) { createDocs() } |
There was a problem hiding this comment.
There can theoretically be various errors here. I think the .code === "ENOENT" is the error we are looking for.
| buildOptions.buildDir = process.cwd() | ||
| buildOptions.buildName = 'node_apidoc' | ||
|
|
||
| fs.stat('../node-apidoc', function (err) { |
There was a problem hiding this comment.
I try to avoid modules without an export, can this module also wrap the operation in a module?
| require('../learnyounode').execute(process.argv.slice(2)) No newline at end of file | ||
| require('../learnyounode').execute(process.argv.slice(2)) | ||
|
|
||
| if(process.argv.slice(2) == 0){ |
There was a problem hiding this comment.
(This is not standard syntax)
Workshopper has a commands option that allows to register custom commands just for this purpose. Of course there should be a postinstall script that launches this command.
There was a problem hiding this comment.
Huge thanks Martin. I'll get these knocked out this week.
There was a problem hiding this comment.
These are all resolved. It doesn't like like I can mark these resolved, so just leaving a reminder since I know you're very busy.
|
I went ahead and cleaned up the module, and added the postinstall script. Let me know if there is anything else that you feel would work better, or be more ideal in other situations. EDIT: rebased the branch due to some lockfile conflicts. Not sure if you want an updated lockfile, so left it as-is until later. |
…making sure documents were not created when using commands to keep the speed high
c766851 to
8b35ab3
Compare


Update One adding custom Node.js documentation building, to start the upgrade process per Issue #503 .
The new API module is setup to create new documents once learnyounode is started, generating to node_apidoc and the version reflecting the version of Node.js used to execute. To keep with the consistency of offering an offline solution, all requests are made locally so there is no need for connectivity after the deps have been installed.
Note: Once the documents are created any future requests will be ignored as long as the folder exists, making sure not to add overhead on every single run. If a user accidentally removes the doc folder, it will recreate that folder on the next run.
To remove the need to overwrite files, reduce size, and redundancy the old 0.10 apidoc folder has been removed.