How to use @adonisjs/ace - 10 common examples

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 ahmadarif / adonis-swagger / test / swagger-provider.spec.js View on Github external
group.before(async () => {
    await registrar.providers([
      path.join(__dirname, '../providers/SwaggerProvider')
    ]).register()

    // call in boot SwaggerProvider
    ace.addCommand('Adonis/Commands/SwaggerExport')
    ace.addCommand('Adonis/Commands/SwaggerExportDocs')
    ace.addCommand('Adonis/Commands/SwaggerRemove')
    ace.addCommand('Adonis/Commands/SwaggerRemoveDocs')
  })
github creatrixity / adonis-auth-scaffold / index.js View on Github external
const ace = require("@adonisjs/ace");
ace.command(
  "make:auth",
  "Generates Views, Controllers and Models for user authentication",
  function({ name }) {
    console.log(`Scaffolding basic authentication`);
  }
);

// Boot ace to execute commands
ace.wireUpWithCommander();
ace.invoke();
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') {
      class Noop extends BaseCommand {}
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 LianjiaTech / fee / server / src / fee.js View on Github external
// 测试uc
  './commands/utils/testUC',
  // 心跳
  './commands/utils/heart_beat',
  // 初始化日报订阅表
  './commands/utils/init_daily_subscription'
]

// register commands
for (let command of registedCommandList) {
  ace.addCommand(require(command)['default'])
}

// Boot ace to execute commands
ace.wireUpWithCommander()
ace.invoke()
github YaoZeyuan / zhihuhelp_with_node / src / ace.ts View on Github external
// './command/generate/author', //  按用户生成电子书
  // './command/generate/activity', //  按用户点赞回答&文章生成电子书
  // './command/generate/column', //  按专栏生成电子书
  // './command/generate/topic', //  按话题生成电子书
  // './command/generate/collection', //  按收藏夹生成电子书
  './command/fetch/customer', //  [抓取]执行自定义任务
  './command/generate/customer', //  [生成]执行自定义任务
]
// register commands
for (const command of registedCommandList) {
  ace.addCommand(require(command)['default'])
}

// Boot ace to execute commands
ace.wireUpWithCommander()
ace.invoke()
github YaoZeyuan / zhihuhelp_with_node / src / ace.ts View on Github external
// './command/fetch/collection', //  抓取收藏夹记录
  // './command/generate/author', //  按用户生成电子书
  // './command/generate/activity', //  按用户点赞回答&文章生成电子书
  // './command/generate/column', //  按专栏生成电子书
  // './command/generate/topic', //  按话题生成电子书
  // './command/generate/collection', //  按收藏夹生成电子书
  './command/fetch/customer', //  [抓取]执行自定义任务
  './command/generate/customer', //  [生成]执行自定义任务
]
// register commands
for (const command of registedCommandList) {
  ace.addCommand(require(command)['default'])
}

// Boot ace to execute commands
ace.wireUpWithCommander()
ace.invoke()
github LianjiaTech / fee / server / src / fee.js View on Github external
// 测试uc
  './commands/utils/testUC',
  // 心跳
  './commands/utils/heart_beat',
  // 初始化日报订阅表
  './commands/utils/init_daily_subscription'
]

// register commands
for (let command of registedCommandList) {
  ace.addCommand(require(command)['default'])
}

// Boot ace to execute commands
ace.wireUpWithCommander()
ace.invoke()
github adonisjs / adonis-lucid / test / functional / migration-rollback.spec.js View on Github external
test('log queries when asked to log', async (assert) => {
    ace.addCommand(MigrationRun)
    ace.addCommand(MigrationRollback)

    await fs.writeFile(path.join(__dirname, 'database/migrations/User.js'), `
      const Schema = use('Schema')
      class User extends Schema {
        up () {
          this.createTable('schema_users', (table) => {
            table.increments()
            table.string('username')
          })
        }

        down () {
          this.drop('schema_users')
        }
      }
github brainnit / adonisjs-scout / test / functional / import.spec.js View on Github external
it('import models', async () => {
    ace.addCommand(Import)

    jest.spyOn(console, 'log')

    const TestModel = require('../unit/fixtures/TestModel')
    TestModel._bootIfNotBooted()

    ioc.bind('App/Models/TestModel', () => TestModel)

    await ioc.use('Database').table('posts').insert([
      { title: 'foo' },
      { title: 'bar' },
      { title: 'foobar' }
    ])

    await ace.call('scout:import', { model: 'TestModel' })