How to use @nstudio/electron - 2 common examples

To help you get started, we’ve selected a few @nstudio/electron examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nstudio / xplat / packages / electron-angular / src / schematics / application / index.ts View on Github external
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 = {};
github nstudio / xplat / packages / electron-angular / src / schematics / application / index.ts View on Github external
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)
  ]);
}

@nstudio/electron

Electron Plugin for xplat

MIT
Latest version published 7 months ago

Package Health Score

65 / 100
Full package analysis