This is the repository in which we develop each element of the GUI. Each module is tested in isolation and put into an JSON object that keeps track of all versions.
- General
- Run the source
- Testing ingredient
- Versioning
- Adding ingredient
- Workflow
- The module.json
- Release History
- License
We try to keep our rules simple.
We call each module GUI Ingredient and a compiled mix GUI Blend. The GUI Blender is provided to help you pick your mix.
- The code is modular and built so each
Ingredientcan be blended together at will. - The browser/feature support philosopy is:
- Support new features by default.
- Fallback to something useable.
- Don't fake features that are not supported.
- Make as little assumption as possible about the enviroment this might be used in.
- This is primarly a CSS framework and Javascript should only be used to toggle classes.
- A no-js fallback must be given.
- Collaboration has to abide to the Styleguide.
Ingredientget a new version when anything changes. We try to keep HTML changes to the absolute minimum. Older versions will always be avaliable but might not be supported anymore.
New versions are submodules pointing to a tag in the repository of the module. Each version must be referenced in the module.json and the latest version
must be marked in the package.json. The changelog is maintained in the Readme.md file in each version.
The semantic versioning in the GUI follows this principle: [HTML changes].[JS changes].[Less/SVG changes] as of version 2.0.0. New modules will start
with version 2.0.0 to clearly communicate that they follow this version principle.
The reason for this is our focus on updatability and maintainability. We want to make it easy for everyone to assess the impact of each change. HTML
changes are most difficult to implement as these changes will typically be done in a database or another larger system. Javascript changes will be easier as
you may only have to replace the gui.min.js file unless you integrated other js functionality with it. Lastly Less and SVG changes will be the easiest as
this typically means you just have to replace the gui.min.css file. We hope this makes it easier to integrate with the GUI.
(If we introduce a new feature that comes with a new class(you could argue an HTML change) we still keep to the smallest change: 2.0.[change].)
To run this repo first download, install all dependencies in the root and initialize all submodules.
To see an overview of all Ingredient you can run grunt in the root or visit the GH-Pages hosted by GitHub.
To work on a module and watch its files you can run grunt in each repository. Please note that you cannot make changes to any module in this repo.
Each
Ingredientversion has atestsfolder that contains various html files to be tested.
You can see the tests here. Note that those tests are for stress testing only. Find documentation for the GUI on the GEL pages.
To include a new module, create a new repo and prefix it with
GUI-orGUI_for core modules.
To add this new module into the source you have to create a new folder with the same name and include each version (tagged) in a version folder. All versions
have to be noted in the module.json. See the boilerplate for a new module in the here: ._template/module.
See more in Workflow.
See below the workflow for adding a new module.
- create new repo
- prefix with
GUI-orGUI_for core modules - take files from
._template/modulefolder - replace
[-Module-]with module name inREADME.md,module.json,package.json,less/module-mixin.less,js/module.js - make sure
coreis up to date - create the module
- adjust
module.jsonto reflect use ofjs,less,svgetc. - commit, merge
master - tag, publish tag
- edit release on GitHub
- prefix with
See below the workflow for changes to a module.
- change module
package.jsonversion bumpmodule.jsonversion bumpREADME.mdversion bump- make changes
README.mdwhatsnew- commit and push changes, reference issues with:
WestpacCXTeam/GUI-source#[issue number]or reference commits with:WestpacCXTeam/[repo name]@[commit hash]and fix issues with:fixed WestpacCXTeam/GUI-source#[issue number](nb.fixedkeyword will automatically close the issue once merged tomaster) - merge
master(masterpowers GitHub pages) - -- Do the following after email is sent out --
- tag, publish tag
- edit release on GitHub
Run GUI-source and GUI-docs and upload to ubuntu server, install blender script and make sure we have 404 pages in place for transition
- GUI-source
- add submodule in new version folder
git submodule add [email protected]:WestpacCXTeam/GUI-[module].git [module]/[version] - update submodule to pull files (command above does that automatically)
- checkout tag (should always be the latest tag)
gruntto compileindex.html,GUI.jsonand all READMEs- (optional)
grunt allto compile_sandboxfiles - commit and push
master(masterpowers GitHub pages)
- add submodule in new version folder
- GUI-docs
- pull submodule
GUI-source-masterand update to latest master release - update new submodules to pull files
- run
grunt new-exampleto automatically add the missing_includes/modulesand_examplesfolders - make sure you have the new
_includes/modules/[module]/[version].liquidfile and updated its documentation - adjust
_examplesand add whatsnew gruntto compile (current devBrand) and run server (or)grunt serverif you don't need to compile- run blender locally
node remote/server-dev.jsfrom/blender(while GUI-docs server is running) - check local copy and blend new blend if required
- install new GUI module(s) into the docs build (js, css, grunticon, img fallback)
- check new versions examples in all brands
grunt prod-allto build the production files- commit, merge
master - now make sure all modules have their tags published, GitHub releases submitted
- if fonts have changed make sure to upload the new webfont zip to the internal hosting site
- pull submodule
- upload files
- Compress all the folders found in
GUI-docs/jekyll/_siteindocs.zip - Compress
GUI-source-masterfolder found inGUI-docs/GUI-source-masteringui.zip - In the server: upload
gui.zipanddocs.zipto/www/GUI/.tempfolder (check no version folders are empty) (or usescp /Users/username/Desktop/gui.zip [email protected]:/www/GUI/.temp/gui.zipfrom your local computer) - upload blender files (
server.js,.template/,assets/possiblypackage.jsonand.guiconfig) [For Blender updates only] - ssh into machine
- possibly
npm iinblender/remotefolder [For Blender updates only] - Navigate to the
/www/GUI/.tempfolder and run:unzip gui.zip -d ../safety-net - Navigate to the
/www/GUIfolder and run:rm -rf GUI-source-master - Move
GUI-source-masterfrom foldersafety-netto the/www/GUIfolder forever list[For Blender updates only]forever restart 0orforever start -l blender.log --append -o blenderOut.log -e blenderError.log server.js[For Blender updates only]forever listand blend something to test [For Blender updates only]- Navigate to the
/wwwfolder and renameconstruction2.htmltoconstruction.htmlto redirect traffic to this file with nginx - Navigate to the
/www/GUIfolder and run:rm -rf BOM|rm -rf BSA|rm -rf STG|rm -rf WBC|rm -rf WBG|rm -rf BT - Navigate to the
/www/GUI/.tempfolder and run:unzip docs.zip -d ../ - Navigate to the
/wwwfolder and renameconstruction.htmltoconstruction2.htmlto direct traffic back to the site sudo rebootif necessary
- Compress all the folders found in
- email
- get all change messages
- make it entertaining AND informative
- be polite and appreciative
- check spelling and grammar
- ask for collaboration and ideas
The following are a few things to remember:
- When adding a new _fonts module remember to add the new font zips to the shared network location (ref link in Blend index page)
- SVGs require some manual editing to clean up XML (aria attributes, fill replace task text, title elements etc)
- GUI-source _sandbox markup needs to be manually updated
The module.json file that is then compiled into the GUI.json file is the engine of the GUI modular system.
{
"ID": "moduleID", #the unique ID of the module
"name": "Module name", #the name of the module
"description": "some text", #description used in the blender
"category": "cateogry", #category for blender and doc pages
"versions": {
"1.0.0": { #listing of all versions
"dependencies": [], #dependencies on any other modules?
"js": true, #does this module include javascript
"less": true, #does this module include less
"svg": false, #does this module include svgs
"font": false, #does this module include web fonts
"size": 12 #what's the estimated file size
},
"1.0.1": {
"dependencies": [],
"js": true,
"less": true,
"svg": true,
"font": false,
"size": 13
},
"1.0.2": {
"dependencies": [],
"js": true,
"less": true,
"svg": true,
"font": true,
"size": 27
}
},
"hash": "f718a7d02eab6d114b8375aca7c23d98" #checksum of this module
}We are trying to make as little changes to the overall build as possible.
- v1.1.0 - Updated package dependencies
- v1.0.5 - Added new
submoduleSynctask to ensure submodule updates are sync’d between developers - v1.0.4 - Send stress test pages to
/docsdirectory - v1.0.3 - Clean
_sandboxicon output pre build and update._templatefiles - v1.0.2 - Automated branding with the
.guiconfigfile - v1.0.1 - Moved all modules into submodules
- v1.0.0 - Initial build system setup
Copyright (c) 2019 Westpac. Licensed under the GNU GPLv2.