-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(docs): issues/38 integrate documentation #62
Conversation
* build, add placeholder files for generating docs during build * build, quipudocs build script, package.json npm scripts * build, remove pot file in favor of i18n snapshot test * tests, integration checks for docs, htmlhint, i18n * aboutModal, update locale keys from quipudocs * pageLayout menu items added for docs
Codecov Report
@@ Coverage Diff @@
## master #62 +/- ##
=======================================
Coverage 69.13% 69.13%
=======================================
Files 91 91
Lines 2132 2132
Branches 338 338
=======================================
Hits 1474 1474
Misses 567 567
Partials 91 91
Continue to review full report at Codecov.
|
"build:clean": "rm -rf -- \"$(pwd)\"/build", | ||
"build:css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/styles/index.scss -o src/styles/.css", | ||
"build:docs": "node ./scripts/quipudocs.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd ../quipucords-ui;yarn;yarn build
yarn install v1.16.0
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
warning Resolution field "[email protected]" is incompatible with requested version "[email protected]"
success Already up-to-date.
✨ Done in 0.71s.
yarn run v1.16.0
$ run-s -l build:clean build:docs test:docs build:version build:css build:js build:finish test:integration
[build:clean ] $ rm -rf -- "$(pwd)"/build
[build:docs ] $ node ./scripts/quipudocs.js
[build:docs ] internal/modules/cjs/loader.js:626
[build:docs ] throw err;
[build:docs ] ^
[build:docs ]
[build:docs ] Error: Cannot find module 'quipudocs'
[build:docs ] Require stack:
[build:docs ] - /Users/cmyers/Desktop/projects/quipucords-ui/scripts/quipudocs.js
[build:docs ] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)
[build:docs ] at Function.Module._load (internal/modules/cjs/loader.js:527:27)
[build:docs ] at Module.require (internal/modules/cjs/loader.js:681:19)
[build:docs ] at require (internal/modules/cjs/helpers.js:16:16)
[build:docs ] at Object.<anonymous> (/Users/cmyers/Desktop/projects/quipucords-ui/scripts/quipudocs.js:2:40)
[build:docs ] at Module._compile (internal/modules/cjs/loader.js:774:30)
[build:docs ] at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
[build:docs ] at Module.load (internal/modules/cjs/loader.js:641:32)
[build:docs ] at Function.Module._load (internal/modules/cjs/loader.js:556:12)
[build:docs ] at Function.Module.runMain (internal/modules/cjs/loader.js:837:10) {
[build:docs ] code: 'MODULE_NOT_FOUND',
[build:docs ] requireStack: [
[build:docs ] '/Users/cmyers/Desktop/projects/quipucords-ui/scripts/quipudocs.js'
[build:docs ] ]
[build:docs ] }
[build:docs ] error Command failed with exit code 1.
[build:docs ] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
After talking with dave it looks like something didn't get merged in quipudocs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, so after some more digging. Looks like we were referencing an "older" version of quipudocs via git commit hash. Since we really only pull the "master" branch with this PR, we'll need a subsequent PR to flip over to Quipudocs tags, making debugging a little bit easier. The reference for master has now been updated.
NOTE: need follow up PR to incorporate the latest Quipudocs changes through a more recent tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work Dave 🏅
I was able to test it through this make command, just in case other people need it.
quick: build-ui
docker rm -f quipucords | true
docker rmi quipucords:0.0.46 | true
export QPC_VAR_DATA=$$PWD/var/data
mkdir -p $$QPC_VAR_DATA
docker -D build . -t quipucords:0.0.46
docker run --name quipucords --link qpc-db:qpc-link -d -e QPC_DBMS_HOST=qpc-db -p 9443:443 -v $$QPC_VAR_DATA:/var/data -i quipucords:0.0.46
@echo "https://127.0.0.1:9443/client/docs/"
@echo "https://127.0.0.1:9443/client/docs/install.html"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
What's included
Notes
How it works
We've opted to go for the dynamic content pull and replace from Quipudocs so the content is only maintained in a single location, Quipudocs. What this means is that we've checked in placeholder files into Quipucords-UI, for when the build actually happens. See "how to test"
How to test
Run the build
The easiest way to confirm everything is compiling, or run the build, then review the file output under
[repo]/dist
which represents what'll be compiled for the outputtar.gz
$ yarn
$ yarn build
[repo]/dist/client/docs
, compare to the files checked in under[repo]/public/docs
[repo]/dist/client/locales
, compare to the files checked in under[repo]/public/locales
Run the staging development version
Another quick way to review is to run the GUI staging development serve. If you ran the build first make sure to reset the files with git since build updates the
public/docs/*
files$ yarn
$ yarn start:stage
Run the review version
Another quick way to review is to run the GUI review serve. If you ran the build first make sure to reset the files with git since build updates the
public/docs/*
files$ yarn
$ yarn start:review
https://localhost:9443/login
you'll see a close approximation of what production would be like. In addition, you'll see the actual Quipudocs content, instead of the placeholder content as shown below.Example
Updates issue/story
#38