Skip to content

Dojo Boilerplate Study

Shi Steven edited this page Oct 11, 2020 · 4 revisions

Study the Dojo Boilerplate (https://github.com/csnover/dojo-boilerplate) because the CodeCompass (https://github.com/shijunjing/edk2/wiki/CodeCompass-enabling) use it as the web GUI framework.

Build the Dojo Boilerplate

Follow the steps in https://github.com/csnover/dojo-boilerplate#quick-start

  • Clone the repository using git clone --recursive. Meet the git: proxy problem when clone project
jshi19@ub2-uefi-b01:~/ci/dojo$ git clone https://github.com/csnover/dojo-boilerplate.git --recursive
...
Cloning into '/home/jshi19/ci/dojo/dojo-boilerplate/src/util/less'...
fatal: unable to connect to github.com:
github.com[0: 13.250.177.223]: errno=Connection timed out

fatal: clone of 'git://github.com/cloudhead/less.js.git' into submodule path '/home/jshi19/ci/dojo/dojo-boilerplate/src/util/less' failed
Failed to clone 'less'. 

Need change the "git:" in "url = git://github.com/cloudhead/less.js.git" to "https:" as "url = https://github.com/cloudhead/less.js.git"

jshi19@ub2-uefi-b01:~/ci/dojo$ vim dojo-boilerplate/src/util/.gitmodules
change the "git:" in "url = git://github.com/cloudhead/less.js.git" to "https:" as "url = https://github.com/cloudhead/less.js.git"

Sync and update the submodules again

jshi19@ub2-uefi-b01:~/ci/dojo/dojo-boilerplate$ git submodule sync --recursive
jshi19@ub2-uefi-b01:~/ci/dojo/dojo-boilerplate$ git submodule update --recursive
  • Run npm install to install additional Node.js dependencies.
jshi19@ub2-uefi-b01:~/ci/dojo/dojo-boilerplate$ npm install
npm WARN deprecated istanbul@0.3.17: This module is no longer maintained, try this instead:
npm WARN deprecated   npm i nyc
npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
npm WARN deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

> intern@3.0.6 install /home/jshi19/ci/dojo/dojo-boilerplate/node_modules/intern
> node support/fixdeps.js

dojo-boilerplate@1.10.0 /home/jshi19/ci/dojo/dojo-boilerplate
+-- intern@3.0.6
| +-- chai@3.0.0
| | +-- assertion-error@1.1.0
| | +-- deep-eql@0.1.3
| | | `-- type-detect@0.1.1
| | `-- type-detect@1.0.0
| +-- charm@0.2.0
| +-- diff@1.1.0
| +-- digdug@1.3.2
| | `-- decompress@0.2.3
| |   +-- adm-zip@0.4.16
| |   +-- extname@0.1.5
| |   | +-- ext-list@0.2.0
| |   | | `-- got@0.2.0
| |   | |   `-- object-assign@0.3.1
| |   | `-- underscore.string@2.3.3
| |   +-- get-stdin@0.1.0
| |   +-- map-key@0.1.5
| |   | `-- lodash@2.4.2
| |   +-- nopt@2.2.1
| |   | `-- abbrev@1.1.1
| |   +-- rimraf@2.7.1
| |   | `-- glob@7.1.6
| |   |   +-- fs.realpath@1.0.0
| |   |   `-- minimatch@3.0.4
| |   +-- stream-combiner@0.0.4
| |   | `-- duplexer@0.1.2
| |   +-- tar@0.1.20
| |   | +-- block-stream@0.0.9
| |   | `-- fstream@0.1.31
| |   |   +-- graceful-fs@3.0.12
| |   |   | `-- natives@1.1.6
| |   |   `-- mkdirp@0.5.5
| |   `-- tempfile@0.1.3
| |     `-- uuid@1.4.2
| +-- dojo@2.0.0-alpha.6
| +-- istanbul@0.3.17
| | +-- abbrev@1.0.9
| | +-- async@1.5.2
| | +-- escodegen@1.6.1
| | | +-- esprima@1.2.5
| | | +-- estraverse@1.9.3
| | | +-- esutils@1.1.6
| | | +-- optionator@0.5.0
| | | | +-- deep-is@0.1.3
| | | | +-- fast-levenshtein@1.0.7
| | | | +-- levn@0.2.5
| | | | +-- prelude-ls@1.1.2
| | | | `-- type-check@0.3.2
| | | `-- source-map@0.1.43
| | +-- esprima@2.4.1
| | +-- fileset@0.2.1
| | | +-- glob@5.0.15
| | | | +-- inflight@1.0.6
| | | | `-- path-is-absolute@1.0.1
| | | `-- minimatch@2.0.10
| | |   `-- brace-expansion@1.1.11
| | |     +-- balanced-match@1.0.0
| | |     `-- concat-map@0.0.1
| | +-- handlebars@3.0.0
| | | +-- optimist@0.6.1
| | | | `-- minimist@0.0.10
| | | +-- source-map@0.1.43
| | | `-- uglify-js@2.3.6
| | |   +-- async@0.2.10
| | |   `-- optimist@0.3.7
| | +-- js-yaml@3.14.0
| | | +-- argparse@1.0.10
| | | | `-- sprintf-js@1.0.3
| | | `-- esprima@4.0.1
| | +-- mkdirp@0.5.5
| | | `-- minimist@1.2.5
| | +-- nopt@3.0.6
| | +-- once@1.4.0
| | | `-- wrappy@1.0.2
| | +-- resolve@1.1.7
| | +-- supports-color@1.3.1
| | +-- which@1.0.9
| | `-- wordwrap@0.0.3
| +-- leadfoot@1.6.4
| | `-- jszip@2.5.0
| |   `-- pako@0.2.9
| `-- source-map@0.1.33
|   `-- amdefine@1.0.1
`-- stylus@0.48.1
  +-- css-parse@1.7.0
  +-- debug@4.2.0
  | `-- ms@2.1.2
  +-- glob@3.2.11
  | +-- inherits@2.0.4
  | `-- minimatch@0.3.0
  |   +-- lru-cache@2.7.3
  |   `-- sigmund@1.0.1
  +-- mkdirp@0.3.5
  `-- sax@0.5.8

  • Run build.sh, which will create an awesome optimized build in dist/
jshi19@ub2-uefi-b01:~/ci/dojo/dojo-boilerplate$ ./build.sh
...
starting executing global optimizations...
starting writing resources...
starting cleaning up...
waiting for the optimizer runner to finish...
starting reporting...
Report written to /home/jshi19/ci/dojo/dojo-boilerplate/dist/build-report.txt
Process finished normally.
        errors: 0
        warnings: 77
        build time: 103.574 seconds
Build complete
  • Click the \xx.xx.xx.xx\jshi19\ci\dojo\dojo-boilerplate\dist\index.html with browser to see the build result:

Clone this wiki locally