<commit_before>import * as path from 'path';

import { IHookEngine, readPackageJsonFile } from '@ionic/cli-utils';

import { build } from './build';
import { generate } from './generate';
import { serve } from './serve';

export const version = '__VERSION__';

export function registerHooks(hooks: IHookEngine) {
  hooks.register('command:docs', async () => {
    const appDirectory = '.'; // TODO: change this
    const ionicAngularPackageJson = await readPackageJsonFile(path.resolve(appDirectory, 'node_modules', 'ionic-angular', 'package.json')); // TODO
    const docsHomepage = 'https://ionicframework.com/docs';
    const version = ionicAngularPackageJson.version;
    const url = `${docsHomepage}/${version}/api`;

    return url;
  });

  hooks.register('command:generate', async (args) => {
    await generate(args);
  });

  hooks.register('command:info', async () => {
    const appDirectory = '.'; // TODO: change this
    const ionicAngularPackageJson = await readPackageJsonFile(path.resolve(appDirectory, 'node_modules', 'ionic-angular', 'package.json')); // TODO
    const appScriptsPackageJson = await readPackageJsonFile(path.resolve(appDirectory, 'node_modules', '@ionic', 'app-scripts', 'package.json')); // TODO

    return [
      { type: 'local-npm', name: 'Ionic Framework', version: `ionic-angular ${ionicAngularPackageJson.version}` },
      { type: 'local-npm', name: '@ionic/cli-plugin-ionic-angular', version: version },
      { type: 'local-npm', name: '@ionic/app-scripts', version: appScriptsPackageJson.version },
    ];
  });

  hooks.register('command:serve', async (args) => {
    return serve(args);
  });

  hooks.register('command:build', async (args) => {
    await build(args);
  });
}<commit_msg>chore(): quick double await -> promise.all<commit_after>import * as path from 'path';

import { IHookEngine, readPackageJsonFile } from '@ionic/cli-utils';

import { build } from './build';
import { generate } from './generate';
import { serve } from './serve';

export const version = '__VERSION__';

export function registerHooks(hooks: IHookEngine) {
  hooks.register('command:docs', async () => {
    const appDirectory = '.'; // TODO: change this
    const ionicAngularPackageJson = await readPackageJsonFile(path.resolve(appDirectory, 'node_modules', 'ionic-angular', 'package.json')); // TODO
    const docsHomepage = 'https://ionicframework.com/docs';
    const version = ionicAngularPackageJson.version;
    const url = `${docsHomepage}/${version}/api`;

    return url;
  });

  hooks.register('command:generate', async (args) => {
    await generate(args);
  });

  hooks.register('command:info', async () => {
    const appDirectory = '.'; // TODO: change this
    const [ ionicAngularPackageJson, appScriptsPackageJson ] = await Promise.all([
      readPackageJsonFile(path.resolve(appDirectory, 'node_modules', 'ionic-angular', 'package.json')), // TODO
      readPackageJsonFile(path.resolve(appDirectory, 'node_modules', '@ionic', 'app-scripts', 'package.json')), // TODO
    ]);

    return [
      { type: 'local-npm', name: 'Ionic Framework', version: `ionic-angular ${ionicAngularPackageJson.version}` },
      { type: 'local-npm', name: '@ionic/cli-plugin-ionic-angular', version: version },
      { type: 'local-npm', name: '@ionic/app-scripts', version: appScriptsPackageJson.version },
    ];
  });

  hooks.register('command:serve', async (args) => {
    return serve(args);
  });

  hooks.register('command:build', async (args) => {
    await build(args);
  });
}
{'fraction_non_alphanumeric': 0.16723356009070295, 'fraction_numerical': 0.0, 'mean_word_length': 4.267164179104477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 2, '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': '1076714', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1039, 'n_words': 235}