How to use the @adonisjs/ace.Manifest function in @adonisjs/ace

To help you get started, we’ve selected a few @adonisjs/ace 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 adonisjs / adonis-framework / src / Ignitor / Ace.ts View on Github external
public async handle (argv: string[]) {
    const { Kernel, handleError, Manifest, BaseCommand } = require('@adonisjs/ace')

    const manifest = new Manifest(this._ignitor.application.appRoot)
    const kernel = new Kernel()
    kernel.useManifest(manifest)

    /**
     * Print help when no command is defined
     */
    if (!argv.length) {
      await kernel.handle() // This will load the commands from manifest
      this._printHelp(kernel)
      return
    }

    /**
     * Generate manifest when command is `generate:manifest`
     */
    if (argv[0] === 'generate:manifest') {
github adonisjs / adonis-cli / index.ts View on Github external
* file that was distributed with this source code.
*/

import { join } from 'path'
import { yellow, underline } from 'kleur'

import { Kernel, Manifest } from '@adonisjs/ace'
import { getCliVersion, getAdonisCoreVersion, dumpAsciiLogo } from './src/helpers'

const kernel = new Kernel()

/**
 * Using manifest file over loading all commands all the
 * time
 */
const manifest = new Manifest(join(__dirname))
kernel.useManifest(manifest)

/**
 * Printing the help screen
 */
kernel.flag('help', (value, _options, command) => {
  if (!value) {
    return
  }

  dumpAsciiLogo()
  kernel.printHelp(command)
  process.exit(0)
}, {})

/**
github adonisjs / assembler / index.ts View on Github external
/*
* @adonisjs/assembler
*
* (c) Harminder Virk 
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { Manifest } from '@adonisjs/ace'
new Manifest(__dirname).generate([
  './commands/Build',
  './commands/Serve',
  './commands/Invoke',
  './commands/Make/Command',
  './commands/Make/Controller',
  './commands/Make/Middleware',
  './commands/Make/Provider',
  './commands/Make/View',
])
github adonisjs / adonis-cli / generateManifest.ts View on Github external
/*
 * @adonisjs/cli
 *
 * (c) Harminder Virk 
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
*/

import { join } from 'path'
import { Manifest } from '@adonisjs/ace'

const manifest = new Manifest(join(__dirname))
manifest.generate(
  [
    './src/Commands/Serve',
    './src/Commands/Build',
    './src/Commands/New',
    './src/Commands/DumpRcFile',
    './src/Commands/RunInstructions',
    './src/Commands/Make/Controller',
    './src/Commands/Make/Model',
    './src/Commands/Make/Provider',
    './src/Commands/Make/Middleware',
  ],
)