CDT Learning

Skeleton

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
my-app/
.cdt # installed lib and conf,do not modify
help/ # help docs
locales/ # translation files
resources/ # imgs & other resources that are not js files
src/ # src code. Contains only one folder (my-app)
my-app/ # name = app name, fully lowercase
test/
bit/ # FT, API concerned only
unit/ # UT
.editorconfig # coding styles,已删
.gitignore
app.config.js # metadata for app
build.json # used by the build module
container.config.js # only for dev, never used in production, contains dev version of container

app.config.js

app configuration file, example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  define({
script: 'active-alerts/ActiveAlerts', // path to app, src下的脚本执行
title: 'Active Alerts', // app title, used in breadcrumb widget
// opt
parent: 'alert-management',
// opt, when exe parent script will start the children
children: [
{app: 'alerts-log'},
{app: 'alerts-settings'}
],
// opt, expose app modules that can be loaded by other apps dynamically
exports: {
'active-alerts/Module1': 'active-alerts/modules/Module1',
'active-alerts/Module2': 'active-alerts/modules/Module2'
}
// i18n.locales: list of supported language
"i18n": { // 这里可以不加引号,也可以加,上面的参数同理
// ES6可以不加,ES5要加
"locales": ["en-us"]
}
});

detailed folder structure: internal link
other link: breadcrumb widget