Skip to content

Commit

Permalink
chore: bump js-yaml version
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Feb 23, 2021
1 parent df00b3e commit 8670997
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function readFile (config, fileDescriptor, context) {
if (file.type === 'json') {
fileData = JSON.parse(rawContent)
} else if (file.type === 'yaml') {
fileData = yaml.safeLoad(rawContent)
fileData = yaml.load(rawContent)
}
}
}
Expand Down Expand Up @@ -121,7 +121,7 @@ function writeFile (config, fileId, data, changedFields, context) {
if (file.type === 'json') {
rawContent = JSON.stringify(data, null, 2)
} else if (file.type === 'yaml') {
rawContent = yaml.safeDump(data)
rawContent = yaml.dump(data)
} else if (file.type === 'js') {
const source = fs.readFileSync(file.path, { encoding: 'utf8' })
if (!source.trim()) {
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 @@ -49,7 +49,7 @@
"graphql-tag": "^2.10.3",
"graphql-type-json": "^0.3.1",
"javascript-stringify": "^2.0.1",
"js-yaml": "^3.14.1",
"js-yaml": "^4.0.0",
"lodash.merge": "^4.6.1",
"lowdb": "^1.0.0",
"lru-cache": "^6.0.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/@vue/cli/__tests__/invoke.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,17 @@ test('invoke with existing files (yaml)', async () => {
await project.write(`.eslintrc.yml`, `
root: true
extends:
- 'plugin:vue/essential'
- 'eslint:recommended'
- plugin:vue/essential
- eslint:recommended
`.trim())

await project.run(`${require.resolve('../bin/vue')} invoke eslint --config airbnb`)

const updated = await project.read('.eslintrc.yml')
expect(updated).toMatch(`
extends:
- 'plugin:vue/essential'
- 'eslint:recommended'
- plugin:vue/essential
- eslint:recommended
- '@vue/airbnb'
`.trim())
})
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli/lib/util/configTransforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const transformJSON = {
}

const transformYAML = {
read: ({ source }) => require('js-yaml').safeLoad(source),
read: ({ source }) => require('js-yaml').load(source),
write: ({ value, existing }) => {
return require('js-yaml').safeDump(merge(existing, value, mergeOptions), {
return require('js-yaml').dump(merge(existing, value, mergeOptions), {
skipInvalid: true
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"inquirer": "^7.1.0",
"isbinaryfile": "^4.0.6",
"javascript-stringify": "^2.0.1",
"js-yaml": "^3.14.1",
"js-yaml": "^4.0.0",
"leven": "^3.1.0",
"lodash.clonedeep": "^4.5.0",
"lru-cache": "^6.0.0",
Expand Down

0 comments on commit 8670997

Please sign in to comment.