-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathindex.ts
65 lines (60 loc) · 1.33 KB
/
index.ts
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import {
apply,
chain,
url,
move,
template,
mergeWith,
TemplateOptions,
schematic,
noop,
} from '@angular-devkit/schematics';
import { stringUtils } from '../utils';
import { Schema as ApplicationOptions } from './schema';
export default function (options: ApplicationOptions) {
const appPath = options.name;
const sourcedir = options.sourceDir;
const routing = options.routing && !options.minimal;
return chain([
mergeWith(
apply(url('./_files'), [
template(<TemplateOptions>{
...options as any,
utils: stringUtils,
routing,
sourcedir,
dot: '.',
}),
move(appPath),
]),
),
routing ?
mergeWith(
apply(url('./_routing-files'), [
template(<TemplateOptions>{
...options as any,
utils: stringUtils,
routing,
sourcedir,
dot: '.',
}),
move(appPath),
]),
) :
noop(),
schematic('ng-cli-config', {
path: appPath,
style: options.style,
sourceDir: options.sourceDir,
}),
schematic('app-resources', {
path: `${appPath}/${sourcedir}`,
}),
schematic('styling', {
appPath,
sourceDir: sourcedir,
extension: options.style,
theme: options.theme,
}),
])
}