This repository has been archived by the owner on Aug 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
34 lines (32 loc) · 1.44 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const changeCase = require("change-case");
const packageNameRule = (val) => {
let segments = val
.split("/")
.map((segment) => changeCase.lowerCase(changeCase.paramCase(segment)));
if (segments.length > 1 && segments[0][0] !== '@') {
segments[0] = '@' + segments[0];
}
return segments.join("/");
}
module.exports = {
defaults: {
// Some Defaults
settingsFile: 'ng-mono.json',
packageScope: "@foo",
packageName: "foo-feature"
},
conventions: {
routeRule: (val) => changeCase.lowerCase(val
.replace(/ /, '-') // replace whitespaces
.replace(/\\/, "/") // replace backslashes
.replace(/\/(.*)/, '$1') // remove leading slash
.replace(/(.*)\//, '$1') // remove trailing slash
),
pathRule: (val) => changeCase.lowerCase(val),
classNameRule: (val) => changeCase.upperCaseFirst(changeCase.camelCase(val)),
classFileNameRule: (val) => changeCase.upperCaseFirst(changeCase.camelCase(val)),
componentSelectorRule: (val) => changeCase.lowerCase(changeCase.paramCase(val)),
packageScopeRule: (val) => val ? '@' + packageNameRule(val.split('/')[0]) : val,
packageNameRule: packageNameRule
}
};