mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-03-14 13:11:10 -05:00
fix(ui): IPC conflict
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
const ipc = require('node-ipc')
|
||||
|
||||
const defaultId = process.env.VUE_CLI_IPC || 'vue-cli'
|
||||
|
||||
exports.IpcMessenger = class IpcMessenger {
|
||||
constructor (id = 'vue-cli') {
|
||||
constructor (id = defaultId) {
|
||||
ipc.config.id = this.id = id
|
||||
ipc.config.retry = 1500
|
||||
ipc.config.silent = true
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint",
|
||||
"graphql-api": "cross-env VUE_CLI_DEBUG=true VUE_CLI_UI_DEV=true vue-cli-service graphql-api",
|
||||
"graphql-api": "cross-env VUE_CLI_DEBUG=true VUE_CLI_UI_DEV=true VUE_CLI_IPC=vue-cli-dev vue-cli-service graphql-api",
|
||||
"run-graphql-api": "vue-cli-service run-graphql-api",
|
||||
"test-graphql-api": "cross-env VUE_CLI_UI_TEST=true VUE_APP_GRAPHQL_PORT=4040 VUE_APP_CLI_UI_URL=ws://localhost:4040/graphql yarn run graphql-api",
|
||||
"test-graphql-api": "cross-env VUE_CLI_UI_TEST=true VUE_APP_GRAPHQL_PORT=4040 VUE_APP_CLI_UI_URL=ws://localhost:4040/graphql VUE_CLI_IPC=vue-cli-test yarn run graphql-api",
|
||||
"prepublishOnly": "yarn run lint --no-fix && yarn run build",
|
||||
"test:e2e:dev": "cross-env VUE_APP_CLI_UI_URL=ws://localhost:4040/graphql vue-cli-service test:e2e --mode development",
|
||||
"test:e2e:run": "vue-cli-service test:e2e --mode production --headless --url=http://localhost:4040",
|
||||
|
||||
@@ -2,7 +2,7 @@ const ipc = require('node-ipc')
|
||||
// Utils
|
||||
const { log, dumpObject } = require('../utils/logger')
|
||||
|
||||
ipc.config.id = 'vue-cli'
|
||||
ipc.config.id = process.env.VUE_CLI_IPC || 'vue-cli'
|
||||
ipc.config.retry = 1500
|
||||
ipc.config.silent = true
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const { log, error, openBrowser } = require('@vue/cli-shared-utils')
|
||||
const { portfinder, server } = require('@vue/cli-ui/server')
|
||||
const shortid = require('shortid')
|
||||
|
||||
async function ui (options = {}, context = process.cwd()) {
|
||||
let port = options.port
|
||||
@@ -18,6 +19,11 @@ async function ui (options = {}, context = process.cwd()) {
|
||||
process.env.VUE_CLI_UI_DEV = true
|
||||
}
|
||||
|
||||
if (!process.env.VUE_CLI_IPC) {
|
||||
// Prevent IPC id conflicts
|
||||
process.env.VUE_CLI_IPC = `vue-cli-${shortid()}`
|
||||
}
|
||||
|
||||
if (!options.quiet) log(`🚀 Starting GUI...`)
|
||||
|
||||
const opts = {
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
"request-promise-native": "^1.0.5",
|
||||
"resolve": "^1.5.0",
|
||||
"semver": "^5.4.1",
|
||||
"shortid": "^2.2.8",
|
||||
"slash": "^1.0.0",
|
||||
"validate-npm-package-name": "^3.0.0",
|
||||
"yaml-front-matter": "^3.4.1"
|
||||
|
||||
Reference in New Issue
Block a user