Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
])),
mergeWith(
apply(url('./files/lint'), [
template({
utils: strings,
...options,
tsLintRoot,
relativePathToWorkspaceRoot,
prefix,
}),
// TODO: Moving should work but is bugged right now.
// The __tsLintRoot__ is being used meanwhile.
// Otherwise the tslint.json file could be inside of the root folder and
// this block and the lint folder could be removed.
])),
schematic('module', {
name: 'app',
commonModule: false,
flat: true,
routing: options.routing,
routingScope: 'Root',
path: sourceDir,
spec: false,
project: options.name,
}),
schematic('component', {
name: 'app',
selector: appRootSelector,
flat: true,
path: sourceDir,
skipImport: true,
project: options.name,
(tree: Tree, context: SchematicContext) =>
// inside closure to ensure it uses the modifed options.name from applyAppNamingConvention
schematic('app-resources', {
path: `apps/${options.name}/app`,
})(tree, context),
// add root package dependencies
function default_1(options) {
// const plain = options.plain;
// const withModule = options.withModule;
// const withContentManagement = options.withContentManagement;
const { plain, withModule, withContentManagement } = options;
let files = [
schematics_1.schematic(plain ? 'store' : 'entity-store', {
flat: options.flat,
name: options.name,
path: options.path,
project: options.project,
dirName: options.dirName,
feature: true,
spec: options.spec
}),
schematics_1.schematic(plain ? 'query' : 'entity-query', {
flat: options.flat,
name: options.name,
path: options.path,
project: options.project,
spec: options.spec,
dirName: options.dirName,
feature: true
const addCommonModuleFile = (options, modInfo) => {
const { name } = options;
const { modulePath } = modInfo;
const moduleDirectory = dirname(modulePath);
const commonModuleOptions = {
name,
path: moduleDirectory,
};
return schematic('common-module', commonModuleOptions);
};
}),
schematics_1.schematic(serviceSchematic, {
flat: options.flat,
module: options.module,
name: options.name,
path: options.path,
project: options.project,
spec: options.spec,
plain,
dirName: options.dirName,
feature: true
})
];
if (!plain) {
files = files.concat([
schematics_1.schematic('model', {
flat: options.flat,
module: options.module,
name: options.name,
path: options.path,
project: options.project,
spec: options.spec,
dirName: options.dirName,
feature: true
})
]);
}
if (withModule) {
files = files.concat([
schematics_1.schematic('withModule', {
flat: options.flat,
module: options.module,
{
inlineStyle: true,
inlineTemplate: true,
spec: false,
styleext: options.style,
};
const sourceDir = options.sourceDir || 'src';
return schematics_1.chain([
schematics_1.mergeWith(schematics_1.apply(schematics_1.url('./files'), [
options.minimal ? schematics_1.filter(minimalPathFilter) : schematics_1.noop(),
options.skipGit ? schematics_1.filter(path => !path.endsWith('/__dot__gitignore')) : schematics_1.noop(),
options.serviceWorker ? schematics_1.noop() : schematics_1.filter(path => !path.endsWith('/ngsw-config.json')),
schematics_1.template(Object.assign({ utils: stringUtils }, options, { 'dot': '.', sourcedir: sourceDir })),
schematics_1.move(options.directory),
])),
schematics_1.schematic('module', {
name: 'app',
commonModule: false,
flat: true,
routing: options.routing,
routingScope: 'Root',
path: options.path,
sourceDir: options.directory + '/' + sourceDir,
spec: false,
}),
schematics_1.schematic('component', Object.assign({ name: 'app', selector: appRootSelector, sourceDir: options.directory + '/' + sourceDir, flat: true, path: options.path }, componentOptions)),
addBootstrapToNgModule(options.directory, sourceDir),
schematics_1.mergeWith(schematics_1.apply(schematics_1.url('./other-files'), [
componentOptions.inlineTemplate ? schematics_1.filter(path => !path.endsWith('.html')) : schematics_1.noop(),
!componentOptions.spec ? schematics_1.filter(path => !path.endsWith('.spec.ts')) : schematics_1.noop(),
schematics_1.template(Object.assign({ utils: stringUtils }, options, { selector: appRootSelector }, componentOptions)),
schematics_1.move(options.directory + '/' + sourceDir + '/app'),
(tree: Tree) => shouldCreateCommonFile(platformUse, options.common) ?
schematic('common-module', { name: moduleInfo.name, path: moduleInfo.path }) :
tree,
]));
}
if (withModule) {
files = files.concat([
schematic('withModule', {
flat: options.flat,
module: options.module,
name: options.name,
path: options.path,
project: options.project,
spec: options.spec,
dirName: options.dirName,
feature: true
}),
schematic('withComponent', {
flat: options.flat,
module: options.module,
name: options.name,
path: options.path,
project: options.project,
spec: options.spec,
dirName: options.dirName,
styleext: options.styleext,
entity: !options.plain,
feature: true
})
]);
}
return (host: Tree, context: SchematicContext) => {
return chain(files)(host, context);
};
prefix: options.prefix,
viewEncapsulation: options.viewEncapsulation,
routing: options.routing,
style: options.style,
skipTests: options.skipTests
};
const yangInitOptions: YangInitOptions = {
name: options.name
};
return chain([
mergeWith(
apply(empty(), [
externalSchematic('@schematics/angular', 'ng-new', ngNewOptions),
schematic('init', yangInitOptions),
move(options.directory),
]), MergeStrategy.Overwrite
),
(host: Tree, context: SchematicContext) => {
let packageTask;
if (!options.skipInstall) {
packageTask = context.addTask(new NodePackageInstallTask(options.directory));
if (options.linkCli) {
packageTask = context.addTask(
new NodePackageLinkTask('@angular/cli', options.directory),
[packageTask],
);
}
}
if (!options.skipGit) {
const commit = typeof options.commit == 'object'
() => {
if (options.shared) {
const sharedOptions: SharedOptions = parseToSharedOptions(options);
return schematic('shared', sharedOptions);
} else {
const applicationOptions: ApplicationOptions = parseToApplicationOptions(options);
return schematic('application', applicationOptions);
}
},
(_tree: Tree, context: SchematicContext) => {