How to use the @ngrx/schematics/schematics-core.getProjectPath 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 / container / 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;

    const opts = ['state', 'stateInterface'].reduce(
      (current: Partial, key) => {
        return omit(current, key as any);
      },
      options
    );

    const templateSource = apply(
      url(options.testDepth === 'unit' ? './files' : './integration-files'),
      [
        options.spec
github ngrx / platform / modules / schematics / src / action / 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;

    const templateSource = apply(
      url(options.creators ? './creator-files' : './files'),
      [
        options.spec
          ? noop()
          : filter(path => !path.endsWith('.spec.ts.template')),
        applyTemplates({
          ...stringUtils,
          'if-flat': (s: string) =>
            stringUtils.group(
              options.flat ? '' : s,
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,
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' : ''
        ),
github ngrx / platform / modules / schematics / src / store / index.ts View on Github external
return (host: Tree, context: SchematicContext) => {
    if (!options.name && !options.root) {
      throw new Error(`Please provide a name for the feature state`);
    }

    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);
    }
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' : ''),