<commit_before>import chalk from 'chalk';
import * as Debug from 'debug';
import * as lodash from 'lodash';

import { Project } from '../';
import { IAilmentRegistry, InfoItem } from '../../../definitions';

import * as ζbuild from './build';
import * as ζgenerate from './generate';
import * as ζserve from './serve';

const debug = Debug('ionic:lib:project:ionic-angular');

export class IonicAngularProject extends Project {
  readonly type: 'ionic-angular' = 'ionic-angular';

  async getInfo(): Promise<InfoItem[]> {
    const [
      [ ionicAngularPkg ],
      [ appScriptsPkg ],
    ] = await Promise.all([
      this.getPackageJson('ionic-angular'),
      this.getPackageJson('@ionic/app-scripts'),
    ]);

    return [
      ...(await super.getInfo()),
      { group: 'ionic', key: 'Ionic Framework', value: ionicAngularPkg ? `ionic-angular ${ionicAngularPkg.version}` : 'not installed' },
      { group: 'ionic', key: '@ionic/app-scripts', value: appScriptsPkg ? appScriptsPkg.version : 'not installed' },
    ];
  }

  async registerAilments(registry: IAilmentRegistry): Promise<void> {
    await super.registerAilments(registry);
    const ailments = await import('./ailments');
    const deps = { ...this.e, project: this };

    registry.register(new ailments.IonicAngularUpdateAvailable(deps));
    registry.register(new ailments.IonicAngularMajorUpdateAvailable(deps));
    registry.register(new ailments.AppScriptsUpdateAvailable(deps));
    registry.register(new ailments.AppScriptsMajorUpdateAvailable(deps));
    registry.register(new ailments.IonicAngularPackageJsonHasDefaultIonicBuildCommand(deps));
    registry.register(new ailments.IonicAngularPackageJsonHasDefaultIonicServeCommand(deps));
  }

  async detected() {
    try {
      const pkg = await this.requirePackageJson();
      const deps = lodash.assign({}, pkg.dependencies, pkg.devDependencies);

      if (typeof deps['ionic-angular'] === 'string') {
        debug(`${chalk.bold('ionic-angular')} detected in ${chalk.bold('package.json')}`);
        return true;
      }
    } catch (e) {
      // ignore
    }
<commit_msg>fix(ionic-angular): link to proper v3 docs<commit_after>import chalk from 'chalk';
import * as Debug from 'debug';
import * as lodash from 'lodash';

import { Project } from '../';
import { IAilmentRegistry, InfoItem } from '../../../definitions';

import * as ζbuild from './build';
import * as ζgenerate from './generate';
import * as ζserve from './serve';

const debug = Debug('ionic:lib:project:ionic-angular');

export class IonicAngularProject extends Project {
  readonly type: 'ionic-angular' = 'ionic-angular';

  async getInfo(): Promise<InfoItem[]> {
    const [
      [ ionicAngularPkg ],
      [ appScriptsPkg ],
    ] = await Promise.all([
      this.getPackageJson('ionic-angular'),
      this.getPackageJson('@ionic/app-scripts'),
    ]);

    return [
      ...(await super.getInfo()),
      { group: 'ionic', key: 'Ionic Framework', value: ionicAngularPkg ? `ionic-angular ${ionicAngularPkg.version}` : 'not installed' },
      { group: 'ionic', key: '@ionic/app-scripts', value: appScriptsPkg ? appScriptsPkg.version : 'not installed' },
    ];
  }

  async getDocsUrl(): Promise<string> {
    return 'https://ion.link/v3-docs';
  }

  async registerAilments(registry: IAilmentRegistry): Promise<void> {
    await super.registerAilments(registry);
    const ailments = await import('./ailments');
    const deps = { ...this.e, project: this };

    registry.register(new ailments.IonicAngularUpdateAvailable(deps));
    registry.register(new ailments.IonicAngularMajorUpdateAvailable(deps));
    registry.register(new ailments.AppScriptsUpdateAvailable(deps));
    registry.register(new ailments.AppScriptsMajorUpdateAvailable(deps));
    registry.register(new ailments.IonicAngularPackageJsonHasDefaultIonicBuildCommand(deps));
    registry.register(new ailments.IonicAngularPackageJsonHasDefaultIonicServeCommand(deps));
  }

  async detected() {
    try {
      const pkg = await this.requirePackageJson();
      const deps = lodash.assign({}, pkg.dependencies, pkg.devDependencies);

      if (typeof deps['ionic-angular'] === 'string') {
        debug(`${chalk.bold('ionic-angular')} detected in ${chalk.bold('package.json')}`);
        return true;
      }
    } catch (e) {
      // ignore
    }

{'fraction_non_alphanumeric': 0.14631894761135472, 'fraction_numerical': 0.00046157396722824835, 'mean_word_length': 3.9027149321266967, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5007613', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1298, 'n_words': 278}