How to use the @ngrx/schematics/schematics-core.findModuleFromOptions function in @ngrx/schematics

To help you get started, we’ve selected a few @ngrx/schematics 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 ngrx / platform / modules / schematics / src / effect / index.ts View on Github external
return (host: Tree, context: SchematicContext) => {
    options.path = getProjectPath(host, options);

    if (options.module) {
      options.module = findModuleFromOptions(host, options);
    }

    const parsedPath = parseName(options.path, options.name || '');
    options.name = parsedPath.name;
    options.path = parsedPath.path;

    const templateSource = apply(url('./files'), [
      options.spec
        ? noop()
        : filter(path => !path.endsWith('.spec.ts.template')),
      options.root && options.minimal ? filter(_ => false) : noop(),
      applyTemplates({
        ...stringUtils,
        'if-flat': (s: string) =>
          stringUtils.group(
            options.flat ? '' : s,
github ngrx / platform / modules / schematics / src / entity / index.ts View on Github external
return (host: Tree, context: SchematicContext) => {
    options.path = getProjectPath(host, options);

    const parsedPath = parseName(options.path, options.name);
    options.name = parsedPath.name;
    options.path = parsedPath.path;

    if (options.module) {
      options.module = findModuleFromOptions(host, options);
    }

    const templateOptions = {
      ...stringUtils,
      'if-flat': (s: string) => (options.flat ? '' : s),
      'group-actions': (name: string) =>
        stringUtils.group(name, options.group ? 'actions' : ''),
      'group-models': (name: string) =>
        stringUtils.group(name, options.group ? 'models' : ''),
      'group-reducers': (s: string) =>
        stringUtils.group(s, options.group ? 'reducers' : ''),
      ...(options as object),
    };

    const commonTemplates = apply(url('./common-files'), [
      options.spec
github ngrx / platform / modules / schematics / src / reducer / index.ts View on Github external
return (host: Tree, context: SchematicContext) => {
    options.path = getProjectPath(host, options);

    if (options.module) {
      options.module = findModuleFromOptions(host, options);
    }

    const parsedPath = parseName(options.path, options.name);
    options.name = parsedPath.name;
    options.path = parsedPath.path;

    const templateOptions = {
      ...stringUtils,
      'if-flat': (s: string) =>
        stringUtils.group(
          options.flat ? '' : s,
          options.group ? 'reducers' : ''
        ),
      ...(options as object),
    };
github ngrx / platform / modules / schematics / src / store / index.ts View on Github external
options.path = getProjectPath(host, options);

    const parsedPath = parseName(options.path, options.name || '');
    options.name = parsedPath.name;
    options.path = parsedPath.path;

    const statePath = `/${options.path}/${options.statePath}/index.ts`;
    const srcPath = dirname(options.path as Path);
    const environmentsPath = buildRelativePath(
      statePath,
      `${srcPath}/environments/environment`
    );

    if (options.module) {
      options.module = findModuleFromOptions(host, options);
    }

    if (
      options.root &&
      options.stateInterface &&
      options.stateInterface !== 'State'
    ) {
      options.stateInterface = stringUtils.classify(options.stateInterface);
    }

    const templateSource = apply(url('./files'), [
      options.root && options.minimal ? filter(_ => false) : noop(),
      applyTemplates({
        ...stringUtils,
        ...(options as object),
        isLib: isLib(host, options),