This is the User Data App for Zendesk. The App displays relevant information about the user and their ticket, fields and organizations.
Since a ZAF V2 app is free to implement its own system, we have tried several approaches and looked at how the App scaffold had merged different systems together.
- dist/
- An empty folder that needs no input from the developer. Its content comes from webpack. Point your ZAT server to this folder:
zat server -p dist/
.
- An empty folder that needs no input from the developer. Its content comes from webpack. Point your ZAT server to this folder:
- spec/
- The (mocha with karma on Chrome) specs in this folder test the
src/javascript/
files. These test run in ChromeHeadless as defined bykarma.conf.js
.
- The (mocha with karma on Chrome) specs in this folder test the
- src/
- The app itself that the developer will change.
- test/
- All the (mocha on node) specs sit in this folder. Currently it only tests the
webpack/
files.
- All the (mocha on node) specs sit in this folder. Currently it only tests the
- webpack/
- translations-loader.js - Renders translations (
src/translations/*.json
) into a single object with key-values and puts that into thebundle.js
. - translations-plugin.js - Copies the marketplace translations (
src/translations/*.json
) into thedist/translations
folder.
- translations-loader.js - Renders translations (
- karma.conf.js - Karma config file.
- package-lock.json
- package.json
- settings.yml - Settings file for the app used by ZAT server.
- webpack.config.js
Webpack is the builder that will transform the src
directory into an dist/
app suitable for browsers. The config can be quite confusing so we opted to keep it as simple as possible. The most confusing part is probably the css part. It uses a sass-loader
to convert .scss into css, then css-loader
to convert that into javascript, and last ExtractTextPlugin
to convert that javascript back into css and stick it into a styles.css
file.
For development run either a single run npm run build:dev
or keep watching the files with npm run watch
. For production npm run build
will run the end result through babel, because IE11 doesn't understand ES6 code, and webpack's -p
options will minify the code.
Karma is a test runner, Mocha the test framework. In order to make this work we tell karma to compile the files first using webpack (with out webpack.config.js loaded in).
Mocha on Node will run the mocha (test/
) tests.