Skip to content

Commit

Permalink
feat(ui): project/plugin notifs
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Apr 17, 2018
1 parent 0335d32 commit eab8b0a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/@vue/cli-ui/src/graphql-api/connectors/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const {
updatePackage
} = require('@vue/cli/lib/util/installDeps')
const invoke = require('@vue/cli/lib/invoke')
const notifier = require('node-notifier')
// Subs
const channels = require('../channels')
// Connectors
Expand Down Expand Up @@ -206,6 +207,13 @@ function install (id, context) {
await installPackage(cwd.get(), getCommand(), null, id)
await initPrompts(id, context)
installationStep = 'config'

notifier.notify({
title: `Plugin installed`,
message: `Plugin ${id} installed, next step is configuration`,
icon: path.resolve(__dirname, '../../assets/done.png')
})

return getInstallation(context)
})
}
Expand All @@ -221,6 +229,13 @@ function uninstall (id, context) {
await uninstallPackage(cwd.get(), getCommand(), null, id)
currentPluginId = null
installationStep = null

notifier.notify({
title: `Plugin uninstalled`,
message: `Plugin ${id} uninstalled`,
icon: path.resolve(__dirname, '../../assets/done.png')
})

return getInstallation(context)
})
}
Expand All @@ -239,6 +254,13 @@ function runInvoke (id, context) {
// Run plugin api
runPluginApi(id, context)
installationStep = 'diff'

notifier.notify({
title: `Plugin invoke sucess`,
message: `Plugin ${id} invoked successfully`,
icon: path.resolve(__dirname, '../../assets/done.png')
})

return getInstallation(context)
})
}
Expand Down
7 changes: 7 additions & 0 deletions packages/@vue/cli-ui/src/graphql-api/connectors/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { getFeatures } = require('@vue/cli/lib/util/features')
const { defaults } = require('@vue/cli/lib/options')
const { toShortPluginId } = require('@vue/cli-shared-utils')
const { progress: installProgress } = require('@vue/cli/lib/util/installDeps')
const notifier = require('node-notifier')
// Connectors
const progress = require('./progress')
const cwd = require('./cwd')
Expand Down Expand Up @@ -273,6 +274,12 @@ async function create (input, context) {
await creator.create({}, preset)
removeCreator()

notifier.notify({
title: `Project created`,
message: `Project ${cwd.get()} created`,
icon: path.resolve(__dirname, '../../assets/done.png')
})

return importProject({
path: targetDir
}, context)
Expand Down

0 comments on commit eab8b0a

Please sign in to comment.