-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event commands #260
Event commands #260
Conversation
Sync with Master
Sync with master
Sync with Master
Sync with Master
Sync with Master
Sync with master
Sync with master
Sync with Master
Sync with Master
Sync with Master
Sync with master
Sync with Master
Sync with master
Sync with Master
src/commands/app/add/event.js
Outdated
|
||
const BaseCommand = require('../../../BaseCommand') | ||
const yeoman = require('yeoman-environment') | ||
const debug = require('debug')('aio-cli-plugin-app:init') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should use debug anymore..
could you switch to aioLogger.debug ?
I would change the label too with the @adobe prefix..
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:add:event', { provider: 'debug' })
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do this everywhere :)
src/commands/app/add/event.js
Outdated
|
||
debug(`adding component ${args.component} to the project, using flags: `, flags) | ||
|
||
const services = (config.get('services') || []).map(s => s.code).join(',') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the services argument, it's not used by the add-events generator..
src/commands/app/add/event.js
Outdated
} | ||
} | ||
|
||
AddEventCommand.description = `Add a new event action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe let's rename this to Add a new Adobe I/O Events action
src/commands/app/delete/event.js
Outdated
this.error('<action-name> must also be provided when using --yes=') | ||
} | ||
|
||
// todo should undeploy specific action ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the todo comment
src/commands/app/add/event.js
Outdated
async run () { | ||
const { args, flags } = this.parse(AddEventCommand) | ||
|
||
debug(`adding component ${args.component} to the project, using flags: `, flags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is args.component? there is no args right?
just say adding a new events action to the project using flags: '${flags}'
src/commands/app/delete/event.js
Outdated
async run () { | ||
const { args, flags } = this.parse(DeleteEventCommand) | ||
|
||
debug('deleting an action from the project, with args', args, 'and flags:', flags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here when you will switch to aioLogger be careful as I don't think it supports multi args like debug() does
also deleting an events action..
src/commands/app/delete/event.js
Outdated
name: 'action-name', | ||
description: 'Action name to delete, if not specified you will choose from a list of actions', | ||
default: '', | ||
required: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed let's make this required and remove the if (flags.yes && !args['action-name']) {
also let's rename action-name to event-action-name
Updated tests based on these changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm we should merge this once there is a new release of generator aio app + we do a v bump
generator plugin updated to use version 1.1.1
Codecov Report
@@ Coverage Diff @@
## master #260 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 23 +2
Lines 775 808 +33
Branches 106 106
=========================================
+ Hits 775 808 +33
Continue to review full report at Codecov.
|
Added support to add/delete event actions using generators.
aio app:add:event
aio app:delete:event
aio app:delete:event <action-name>
Description
Related Issue
Motivation and Context
How Has This Been Tested?
manual and unit tests
Screenshots (if appropriate):
Types of changes
Checklist: