How to use the @nstudio/xplat.missingArgument function in @nstudio/xplat

To help you get started, we’ve selected a few @nstudio/xplat 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 / angular / src / schematics / elements / index.ts View on Github external
example
        )
      );
    }
    if (!options.barrel) {
      throw new SchematicsException(
        missingArgument(
          'barrel',
          'Provide the name of the workspace barrel where your components live.',
          example
        )
      );
    }
    if (!options.components) {
      throw new SchematicsException(
        missingArgument(
          'components',
          `Provide a comma delimited list of components you'd like to create as custom elements.`,
          example
        )
      );
    }
  }

  return chain([
    prerun(options),
    (tree: Tree) => {
      if (!options.builderModule) {
        const workspacePrefix = options.prefix || getPrefix() || '';
        const htmlElementList = [];
        componentSymbols = [];
        // parse component names to standard convention
github nstudio / xplat / packages / nativescript / src / schematics / application / index.ts View on Github external
export default function(options: Schema) {
  if (!options.name) {
    throw new SchematicsException(
      missingArgument(
        'name',
        'Provide a name for your NativeScript app.',
        'nx g @nstudio/nativescript:app name'
      )
    );
  }
  // if (options.setupSandbox) {
  //   // always setup routing with sandbox
  //   options.routing = true;
  // }

  return chain([
    prerun(options),
    // adjust naming convention
    XplatHelpers.applyAppNamingConvention(options, 'nativescript'),
    // create app files
github nstudio / xplat / packages / electron-angular / src / schematics / application / index.ts View on Github external
export default function(options: XplatElectrontHelpers.SchemaApp) {
  if (!options.name) {
    throw new SchematicsException(
      missingArgument(
        'name',
        'Provide a name for your Electron app.',
        'nx g @nstudio/electron-angular:app name'
      )
    );
  }
  if (!options.target) {
    throw new SchematicsException(
      missingArgument(
        'target',
        'Provide the name of the web app in your workspace to use inside the electron app.',
        'nx g @nstudio/electron-angular:app name --target web-myapp'
      )
    );
  }

  const packageHandling = [];
  if (options.isTesting) {
    packageHandling.push(
      externalSchematic('@nstudio/electron', 'tools', {
        ...options
      })
    );
  } else {
    // TODO: find a way to unit test schematictask runners with install tasks
github nstudio / xplat / packages / angular / src / schematics / application / index.ts View on Github external
export default function(options: Schema) {
  if (!options.name) {
    throw new SchematicsException(
      missingArgument(
        'name',
        'Provide a name for your app.',
        'nx g @nstudio/angular:app my-app'
      )
    );
  }
  if (options.useXplat) {
    // xplat is configured for sass only (at moment)
    options.style = 'scss';
  }

  return chain([
    prerun(options),
    // adjust naming convention
    XplatHelpers.applyAppNamingConvention(options, 'web'),
    // use xplat or not
github nstudio / xplat / packages / ionic / src / schematics / application / index.ts View on Github external
export default function(options: Schema) {
  if (!options.name) {
    throw new SchematicsException(
      missingArgument(
        'name',
        'Provide a name for your Ionic app.',
        'nx g @nstudio/ionic:app name'
      )
    );
  }

  return chain([
    prerun(options),
    // adjust naming convention
    XplatHelpers.applyAppNamingConvention(options, 'ionic'),
    // create app files
    (tree: Tree, context: SchematicContext) =>
      addAppFiles(options, options.name)(tree, context),
    // add root package dependencies
    XplatIonicHelpers.updateRootDeps(options),
github nstudio / xplat / packages / angular / src / schematics / helpers / index.ts View on Github external
export default function(options: IHelperSchema) {
  if (!options.name) {
    throw new SchematicsException(
      missingArgument(
        'name',
        'Provide the name of the helper to generate.',
        'ng g @nstudio/angular:helpers applitools --target=web-myapp'
      )
    );
  }

  const helperChain = [];
  const helpers = options.name.split(',');

  for (const helper of helpers) {
    if (supportedHelpers[helper]) {
      buildHelperChain(helper, options, supportedHelpers[helper], helperChain);
    } else {
      helperChain.push(noop());
    }
github nstudio / xplat / packages / angular / src / schematics / elements / index.ts View on Github external
export default function(options: ElementsOptions) {
  if (!options.builderModule) {
    const example = `nx g @nstudio/angular:elements menu --barrel=@mycompany/ui --components=menu,footer`;
    if (!options.name) {
      throw new SchematicsException(
        missingArgument(
          'name',
          'Provide a name for the custom element module.',
          example
        )
      );
    }
    if (!options.barrel) {
      throw new SchematicsException(
        missingArgument(
          'barrel',
          'Provide the name of the workspace barrel where your components live.',
          example
        )
      );
    }
    if (!options.components) {
      throw new SchematicsException(
        missingArgument(
          'components',
          `Provide a comma delimited list of components you'd like to create as custom elements.`,
          example
        )
      );
    }
  }
github nstudio / xplat / packages / electron / src / schematics / application / index.ts View on Github external
export default function(options: XplatElectrontHelpers.SchemaApp) {
  if (!options.name) {
    throw new SchematicsException(
      missingArgument(
        'name',
        'Provide a name for your Electron app.',
        'nx g @nstudio/electron:app name'
      )
    );
  }
  if (!options.target) {
    throw new SchematicsException(
      `Missing target argument. Provide the name of the web app in your workspace to use inside the electron app. ie, web-myapp`
    );
  }

  const packageHandling = [];
  if (options.isTesting) {
    packageHandling.push(
      externalSchematic('@nstudio/electron', 'tools', {
github nstudio / xplat / packages / electron-angular / src / schematics / application / index.ts View on Github external
export default function(options: XplatElectrontHelpers.SchemaApp) {
  if (!options.name) {
    throw new SchematicsException(
      missingArgument(
        'name',
        'Provide a name for your Electron app.',
        'nx g @nstudio/electron-angular:app name'
      )
    );
  }
  if (!options.target) {
    throw new SchematicsException(
      missingArgument(
        'target',
        'Provide the name of the web app in your workspace to use inside the electron app.',
        'nx g @nstudio/electron-angular:app name --target web-myapp'
      )
    );
  }
github nstudio / xplat / packages / angular / src / schematics / elements / index.ts View on Github external
export default function(options: ElementsOptions) {
  if (!options.builderModule) {
    const example = `nx g @nstudio/angular:elements menu --barrel=@mycompany/ui --components=menu,footer`;
    if (!options.name) {
      throw new SchematicsException(
        missingArgument(
          'name',
          'Provide a name for the custom element module.',
          example
        )
      );
    }
    if (!options.barrel) {
      throw new SchematicsException(
        missingArgument(
          'barrel',
          'Provide the name of the workspace barrel where your components live.',
          example
        )
      );
    }
    if (!options.components) {