Skip to content
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

Merged
merged 2 commits into from
Jul 12, 2019

Conversation

cdcabrera
Copy link
Member

@cdcabrera cdcabrera commented Jul 11, 2019

What's included

  • feat(docs): issues/38 integrate documentation
    • 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

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 output tar.gz

  1. update the NPM packages with $ yarn
  2. $ yarn build
  3. the docs updates should be located under
    • [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

  1. update the NPM packages with $ yarn
  2. make sure docker is running
  3. $ yarn start:stage
  4. It'll take a min or two to compile, you'll see an un-styled login, once it compiles use the default creds, from there you should now be able to access what the below example gif highlights...

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

  1. update the NPM packages with $ yarn
  2. make sure docker is running
  3. $ yarn start:review
  4. It'll take a min or two to compile, then running on 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

Jul-11-2019 10-15-26

Updates issue/story

#38

* 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-io
Copy link

codecov-io commented Jul 11, 2019

Codecov Report

Merging #62 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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
Impacted Files Coverage Δ
src/components/pageLayout/pageLayout.js 64.28% <ø> (ø) ⬆️
src/components/aboutModal/aboutModal.js 84.84% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 299a8d7...6a3abc3. Read the comment docs.

@cdcabrera cdcabrera changed the title WIP feat(docs): issues/38 integrate documentation feat(docs): issues/38 integrate documentation Jul 11, 2019
"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",

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.

Copy link
Member Author

@cdcabrera cdcabrera Jul 11, 2019

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.

Copy link

@myersCody myersCody left a 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"

Copy link
Contributor

@himmAllRight himmAllRight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@cdcabrera cdcabrera merged commit d21d47f into quipucords:master Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants