Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (host: Tree, context: SchematicContext) => {
const options = normalizeOptions(schema);
return chain([
init({ skipFormat: true }),
externalSchematic('@nrwl/node', 'application', schema),
addMainFile(options),
addTypes(options),
formatFiles(options)
])(host, context);
};
}
return (host: Tree, context: SchematicContext) => {
const options = normalizeOptions(schema);
return chain([
init({
skipFormat: true
}),
externalSchematic('@nrwl/node', 'application', schema),
addMainFile(options),
addAppFiles(options),
updateJsonInTree(join(options.appProjectRoot, 'tsconfig.json'), json => {
json.compilerOptions.emitDecoratorMetadata = true;
return json;
}),
formatFiles(options)
])(host, context);
};
}
export default function(schema: Schema) {
return chain([
setDefault(),
addPackageWithInit('@nrwl/jest'),
addDependencies(),
moveDependency(),
formatFiles(schema)
]);
}
export default function(schema: Schema) {
return chain([
setDefault(),
addPackageWithInit('@nrwl/node'),
addPackageWithInit('@nrwl/jest'),
addDependencies(),
moveDependency(),
formatFiles(schema)
]);
}
}),
addLintFiles(options.appProjectRoot, options.linter, {
localConfig: reactEslintJson,
extraPackageDeps: extraEslintDependencies
}),
createApplicationFiles(options),
updateNxJson(options),
addProject(options),
addCypress(options),
addJest(options),
updateJestConfig(options),
addStyledModuleDependencies(options),
addRouting(options, context),
addBabel(options),
setDefaults(options),
formatFiles(options)
]);
};
}
project: options.name,
setupFile: 'none',
supportTsx: true,
skipSerializers: true
})
: noop(),
externalSchematic('@nrwl/react', 'component', {
name: options.name,
project: options.name,
style: options.style,
skipTests: options.unitTestRunner === 'none',
export: true,
routing: options.routing
}),
updateAppRoutes(options, context),
formatFiles(options)
])(host, context);
};
}
const moduleModification = !options.onlyAddFiles
? [
addImportsToModule(requestContext),
addExportsToBarrel(requestContext.options)
]
: [];
const packageJsonModification = !options.skipPackageJson
? [addNgRxToPackageJson()]
: [];
return chain([
...fileGeneration,
...moduleModification,
...packageJsonModification,
formatFiles(options)
])(host, context);
};
}
options.e2eTestRunner === 'cypress'
? externalSchematic('@nrwl/cypress', 'cypress-project', {
...options,
name: options.name + '-e2e',
directory: options.directory,
project: options.projectName
})
: noop(),
options.unitTestRunner === 'jest'
? externalSchematic('@nrwl/jest', 'jest-project', {
project: options.projectName,
skipSerializers: true,
setupFile: 'web-components'
})
: noop(),
formatFiles(options)
])(host, context);
};
}
export default function(options: Schema): Rule {
const angularJsImport = options.angularJsImport
? options.angularJsImport
: options.name;
return chain([
createFiles(angularJsImport, options),
addImportsToModule(options),
addNgDoBootstrapToModule(options),
options.skipPackageJson ? noop() : addUpgradeToPackageJson(),
formatFiles(options)
]);
}
return (host: Tree, context: SchematicContext) => {
const options = normalizeOptions(schema);
return chain([
externalSchematic('@nrwl/workspace', 'lib', schema),
createFiles(options),
updateTsConfig(options),
addProject(options),
formatFiles(options)
]);
};
}