Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prerun(options),
XplatHelpers.applyAppNamingConvention(options, 'electron'),
(tree: Tree, context: SchematicContext) =>
externalSchematic('@nstudio/electron', 'xplat', {
...options,
skipDependentPlatformFiles: true
}),
// use xplat or not
options.useXplat
? externalSchematic('@nstudio/electron-angular', 'xplat', options)
: noop(),
(tree: Tree, context: SchematicContext) =>
addAppFiles(options, options.name)(tree, context),
XplatElectronAngularHelpers.updateRootDeps(options),
...packageHandling,
XplatElectrontHelpers.addNpmScripts(options),
(tree: Tree, context: SchematicContext) => {
// grab the target app configuration
const workspaceConfig = readWorkspaceJson(tree);
// find app
const fullTargetAppName = options.target;
let targetConfig;
if (workspaceConfig && workspaceConfig.projects) {
targetConfig = workspaceConfig.projects[fullTargetAppName];
}
if (!targetConfig) {
throw new SchematicsException(
`The target app name "${fullTargetAppName}" does not appear to be in ${workspaceFileName()}. You may need to generate the app first or perhaps check the spelling.`
);
}
const projects = {};
delete projects[electronAppName].architect['extract-i18n'];
delete projects[electronAppName].architect['test'];
delete projects[electronAppName].architect['lint'];
return updateWorkspace({ projects })(tree, context);
},
(tree: Tree) => {
const projects = {};
projects[`${options.name}`] = {
tags: []
};
return updateNxProjects(tree, projects);
},
options.useXplat ? (tree: Tree) => adjustAppFiles(options, tree) : noop(),
formatFiles({ skipFormat: options.skipFormat }),
XplatElectrontHelpers.noteAppCommands(options)
]);
}