Skip to content

Commit a88203d

Browse files
committed
chore: merge branch 'dev' into next-minor
2 parents 2e20b7a + 3e16924 commit a88203d

File tree

22 files changed

+111
-70
lines changed

22 files changed

+111
-70
lines changed

packages/@vue/cli-ui-addon-webpack/src/components/WebpackDashboard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default {
9696
.title
9797
color lighten($vue-ui-color-dark, 60%)
9898
font-size 20px
99-
font-weight lighter
99+
font-weight 300
100100
text-align center
101101
margin-bottom $padding-item
102102
@@ -108,7 +108,7 @@ export default {
108108
.info-block
109109
v-box()
110110
box-center()
111-
font-weight lighter
111+
font-weight 300
112112
text-align center
113113
114114
.label

packages/@vue/cli-ui-addon-widgets/src/components/Welcome.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default {
6969
7070
.title
7171
font-size 32px
72-
font-weight lighter
72+
font-weight 300
7373
text-align center
7474
margin-bottom ($padding-item * 2)
7575

packages/@vue/cli-ui/apollo-server/connectors/logs.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/** @typedef {'warn' | 'error' | 'info' | 'done'} LogType */
2+
3+
/**
4+
* @typedef Log
5+
* @prop {string} id
6+
* @prop {string} date
7+
* @prop {LogType} type
8+
* @prop {string} tag
9+
* @prop {string} message
10+
*/
11+
112
const shortId = require('shortid')
213
const { events } = require('@vue/cli-shared-utils/lib/logger')
314
const { generateTitle } = require('@vue/cli/lib/util/clearConsole')
@@ -6,9 +17,15 @@ const channels = require('../channels')
617
// Context
718
const getContext = require('../context')
819

20+
/** @type {Log []} */
921
let logs = []
1022

23+
/**
24+
* @param {Log} log
25+
* @param {any} context
26+
*/
1127
exports.add = function (log, context) {
28+
/** @type {Log} */
1229
const item = {
1330
id: shortId.generate(),
1431
date: new Date().toISOString(),

packages/@vue/cli-ui/apollo-server/connectors/projects.js

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const Creator = require('@vue/cli/lib/Creator')
55
const { getPromptModules } = require('@vue/cli/lib/util/createTools')
66
const { getFeatures } = require('@vue/cli/lib/util/features')
77
const { defaults } = require('@vue/cli/lib/options')
8-
const { toShortPluginId, clearModule } = require('@vue/cli-shared-utils')
8+
const { toShortPluginId, execa } = require('@vue/cli-shared-utils')
99
const { progress: installProgress } = require('@vue/cli/lib/util/installDeps')
1010
const parseGitConfig = require('parse-git-config')
1111
// Connectors
@@ -15,6 +15,7 @@ const prompts = require('./prompts')
1515
const folders = require('./folders')
1616
const plugins = require('./plugins')
1717
const locales = require('./locales')
18+
const logs = require('./logs')
1819
// Context
1920
const getContext = require('../context')
2021
// Utils
@@ -258,52 +259,23 @@ async function create (input, context) {
258259

259260
const targetDir = path.join(cwd.get(), input.folder)
260261

261-
// Delete existing folder
262-
if (fs.existsSync(targetDir)) {
263-
if (input.force) {
264-
setProgress({
265-
info: 'Cleaning folder...'
266-
})
267-
await folders.delete(targetDir)
268-
setProgress({
269-
info: null
270-
})
271-
} else {
272-
throw new Error(`Folder ${targetDir} already exists`)
273-
}
274-
}
275-
276262
cwd.set(targetDir, context)
277263
creator.context = targetDir
278264

279-
process.env.VUE_CLI_CONTEXT = targetDir
280-
clearModule('@vue/cli-service/webpack.config.js', targetDir)
281-
282265
const inCurrent = input.folder === '.'
283-
const name = inCurrent ? path.relative('../', process.cwd()) : input.folder
284-
creator.name = name.toLowerCase()
266+
const name = creator.name = (inCurrent ? path.relative('../', process.cwd()) : input.folder).toLowerCase()
285267

286268
// Answers
287269
const answers = prompts.getAnswers()
288270
await prompts.reset()
289-
let index
290271

291272
// Config files
273+
let index
292274
if ((index = answers.features.indexOf('use-config-files')) !== -1) {
293275
answers.features.splice(index, 1)
294276
answers.useConfigFiles = 'files'
295277
}
296278

297-
const createOptions = {
298-
packageManager: input.packageManager
299-
}
300-
// Git
301-
if (input.enableGit && input.gitCommitMessage) {
302-
createOptions.git = input.gitCommitMessage
303-
} else {
304-
createOptions.git = input.enableGit
305-
}
306-
307279
// Preset
308280
answers.preset = input.preset
309281
if (input.save) {
@@ -329,7 +301,49 @@ async function create (input, context) {
329301
})
330302

331303
// Create
332-
await creator.create(createOptions, preset)
304+
const args = [
305+
'--skipGetStarted'
306+
]
307+
if (input.packageManager) args.push('--packageManager', input.packageManager)
308+
if (input.bar) args.push('--bare')
309+
if (input.force) args.push('--force')
310+
// Git
311+
if (input.enableGit && input.gitCommitMessage) {
312+
args.push('--git', input.gitCommitMessage)
313+
} else if (!input.enableGit) {
314+
args.push('--no-git')
315+
}
316+
// Preset
317+
args.push('--inlinePreset', JSON.stringify(preset))
318+
319+
log('create', name, args)
320+
321+
const child = execa('vue', [
322+
'create',
323+
name,
324+
...args
325+
], {
326+
cwd: cwd.get(),
327+
stdio: ['inherit', 'pipe', 'inherit']
328+
})
329+
330+
const onData = buffer => {
331+
const text = buffer.toString().trim()
332+
if (text) {
333+
setProgress({
334+
info: text
335+
})
336+
logs.add({
337+
type: 'info',
338+
message: text
339+
}, context)
340+
}
341+
}
342+
343+
child.stdout.on('data', onData)
344+
345+
await child
346+
333347
removeCreator()
334348

335349
notify({

packages/@vue/cli-ui/apollo-server/schema/project.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ enum ProjectType {
4444
input ProjectCreateInput {
4545
folder: String!
4646
force: Boolean!
47+
bare: Boolean!
4748
packageManager: PackageManager
4849
preset: String!
4950
remote: String

packages/@vue/cli-ui/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@
280280
"options": {
281281
"label": "Additional options",
282282
"force": "Overwrite target folder if it exists",
283+
"bare": "Scaffold project without beginner instructions",
283284
"git-title": "Git repository",
284285
"git": "Initialize git repository (recommended)",
285286
"git-commit-message": "Initial commit message (optional)"

packages/@vue/cli-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"@vue/cli-plugin-eslint": "^3.5.1",
6767
"@vue/cli-service": "^3.5.3",
6868
"@vue/eslint-config-standard": "^4.0.0",
69-
"@vue/ui": "^0.5.5",
69+
"@vue/ui": "^0.8.2",
7070
"ansi_up": "^3.0.0",
7171
"cross-env": "^5.1.5",
7272
"eslint": "^5.8.0",

packages/@vue/cli-ui/src/components/app/ProgressScreen.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
</div>
3333

3434
<div class="secondary-info">
35-
<div v-if="progress.info" class="info">
36-
{{ progress.info }}
37-
</div>
35+
<div
36+
v-if="progress.info"
37+
class="info"
38+
v-html="ansiColors(progress.info)"
39+
/>
3840

3941
<VueLoadingBar
4042
v-if="progress.progress !== -1"

packages/@vue/cli-ui/src/components/app/ProjectQuickDropdown.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
:value="projectCurrent.favorite"
1414
:icon="projectCurrent.favorite ? 'star' : 'star_border'"
1515
class="extend-left"
16-
@input="toggleCurrentFavorite()"
16+
@update="toggleCurrentFavorite()"
1717
>
1818
{{ $t('org.vue.components.project-select-list-item.tooltips.favorite') }}
1919
</VueSwitch>

packages/@vue/cli-ui/src/components/app/TopBar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
3232
.title
3333
font-size 28px
34-
font-weight lighter
34+
font-weight 300
3535
</style>

0 commit comments

Comments
 (0)