Skip to content

Commit

Permalink
fix(ui): deps + dahsboard plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Apr 11, 2018
1 parent 2ef6900 commit a628b43
Show file tree
Hide file tree
Showing 8 changed files with 275 additions and 48 deletions.
8 changes: 1 addition & 7 deletions packages/@vue/cli-service/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ module.exports = (api, options) => {

api.extendPackage({
scripts: {
'serve': 'vue-cli-service serve' + (
// only auto open browser on MacOS where applescript
// can avoid dupilcate window opens
process.platform === 'darwin'
? ' --open'
: ''
),
'serve': 'vue-cli-service serve',
'build': 'vue-cli-service build'
},
dependencies: {
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/lib/webpack/DashboardPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class DashboardPlugin {
const outputPath = compiler.options.output.path
statsData.assets.forEach(asset => {
asset.fullPath = path.join(outputPath, asset.name)
asset.gzipSize = getGzipSize(assetSources.get(asset.name))
asset.gzipSize = assetSources && getGzipSize(assetSources.get(asset.name))
})

handler([
Expand Down
1 change: 1 addition & 0 deletions packages/@vue/cli-ui-addon-build/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
],
"globals": {
"ClientAddonApi": false,
"mapSharedData": false,
"Vue": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ export default {
text-align right
margin-bottom $padding-item
</style>

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'mode',
'mode'
])
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"lint-staged": "^6.0.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"vue-cli-plugin-apollo": "^0.7.1",
"vue-cli-plugin-apollo": "^0.7.4",
"vue-template-compiler": "^2.5.17-beta.0"
},
"browserslist": [
Expand Down
31 changes: 18 additions & 13 deletions packages/@vue/cli/lib/util/installDeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,25 @@ function executeCommand (command, args, targetDir) {
if (newLineIndex !== -1) {
str = str.substr(newLineIndex)
}
const data = JSON.parse(str)
if (data.type === 'step') {
progress.enabled = false
progress.log(data.data.message)
} else if (data.type === 'progressStart') {
progressTotal = data.data.total
} else if (data.type === 'progressTick') {
const time = Date.now()
if (time - progressTime > 20) {
progressTime = time
progress.progress = data.data.current / progressTotal
try {
const data = JSON.parse(str)
if (data.type === 'step') {
progress.enabled = false
progress.log(data.data.message)
} else if (data.type === 'progressStart') {
progressTotal = data.data.total
} else if (data.type === 'progressTick') {
const time = Date.now()
if (time - progressTime > 20) {
progressTime = time
progress.progress = data.data.current / progressTotal
}
} else {
progress.enabled = false
}
} else {
progress.enabled = false
} catch (e) {
console.error(e)
console.log(str)
}
} else {
process.stdout.write(buffer)
Expand Down
Loading

0 comments on commit a628b43

Please sign in to comment.