1 | See [CODESTYLE](CODESTYLE.md)
|
2 |
|
3 | ## Naming Conventions / Directory Layout
|
4 |
|
5 | ```
|
6 | build/ # compiled and concatenanted classes
|
7 | dist/ # compiled JS classes
|
8 | src/ # ES6 and Handlebars templates
|
9 | style/ # LESS, SASS or, CSS
|
10 | resource/ # Copied as is to build directory
|
11 | lib-export.js # the entrypoint ala index.js
|
12 | ```
|
13 |
|
14 | ## Build Pipeline
|
15 |
|
16 | * All bower dependencies are downloaded and concatenated into `build/dependencies.js` and `build/dependencies.css`
|
17 | * ES6 files are compiled and concatenanted into `build/app.js` where 'app.js' is the `mainFile` in `package.json`
|
18 | (inferred from package's name by default)
|
19 | * CSS/LESS/SASS are compliled and concatened into `build/app.css`
|
20 | * In production mode all source is minified and source maps generated.
|
21 |
|
22 | ## Handlebars Templates
|
23 |
|
24 | A Handlebar template is any file ending in `.hbs` it is available in the `TEMPLATES` global without the extension.
|
25 | A Handlebar partial is any file begining with `_` and ending in `.hbs` and is automatically registered
|
26 |
|
27 |
|
28 |
|
29 | ## Build steps:
|
30 | * export your `NPM_TOKEN`
|
31 | * Copy and rename the seed_package.json to package.json (only when bootstraping new projects)
|
32 | * Run `npm run setup` to install and build all required dependencies
|
33 | * Run `npm run dev` to build files suitable for wathcing and startup a watch server
|
34 | * Run `npm run build` to build a package suitable for production
|
35 | * Run `npm run test` to run karma test suites
|
36 |
|
37 |
|
38 | ## Customizing builds using bower.json and package.json
|
39 |
|
40 | ### bower.json
|
41 | All bower dependencies with main files are concatenanted together, this can be overriden in bower.json as follows:
|
42 |
|
43 | ```json
|
44 | "overrides": {
|
45 | "bootstrap": {
|
46 | "main": [
|
47 | "dist/js/bootstrap.js",
|
48 | "dist/css/bootstrap.css",
|
49 | "dist/css/bootstrap.css.map"
|
50 | ]
|
51 | },
|
52 | }
|
53 | ```
|
54 |
|
55 | To exclude certain large libraries from concatenantion list in exclude, the main files will be concated together and placed in build/<libray name>
|
56 | ```json
|
57 | "standalone": ["handsontable", "codemirror"]
|
58 | ```
|
59 |
|
60 | To exclude libraries that have already been packaged elsewhere:
|
61 | ```json
|
62 | "excludes": ["jquery"]
|
63 | ```
|
64 |
|
65 | To copy entire directories from dependencies:
|
66 |
|
67 | ```json
|
68 | "directories": {
|
69 | "fontawesome": "fonts/*",
|
70 | "bootstrap": "fonts/*"
|
71 | },
|
72 | ```
|
73 |
|
74 | To create a plugin package:
|
75 |
|
76 | ```json
|
77 | "plugin": "PortalApp",
|
78 | ```
|
79 | This will create a .zip instead of a .war and place all the compiled .js file in to a subdirectory *System/plugins/{plugin}*
|
80 |
|