Skip to content

Commit

Permalink
chore: update to latest apollo
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Aug 23, 2018
1 parent f261410 commit 4acf48d
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 116 deletions.
3 changes: 2 additions & 1 deletion packages/@vue/cli-ui/apollo-server/connectors/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const execa = require('execa')
const path = require('path')
const fs = require('fs-extra')
const parseDiff = require('../util/parse-diff')
const { highlightCode } = require('../util/highlight')
// Connectors
const cwd = require('./cwd')
// Utils
Expand All @@ -28,6 +27,8 @@ async function getNewFiles (context) {
async function getDiffs (context) {
if (!hasProjectGit(cwd.get())) return []

const { highlightCode } = require('../util/highlight')

const newFiles = await getNewFiles(context)
await execa('git', ['add', '-N', '*'], {
cwd: cwd.get()
Expand Down
10 changes: 6 additions & 4 deletions packages/@vue/cli-ui/apollo-server/util/highlight.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const Prism = require('prismjs')
const loadLanguages = require('prismjs/components/')
const path = require('path')
// Prism don't like cjs with EMS package
// So we use ES modules for the whole file
import Prism from 'prismjs'
import loadLanguages from 'prismjs/components/index.js'
import path from 'path'

loadLanguages()

Expand All @@ -19,7 +21,7 @@ const languages = [
{ test: /\.yml$/, lang: 'yaml' }
]

exports.highlightCode = function (filename, content, lang = null) {
export function highlightCode (filename, content, lang = null) {
let language
if (lang) {
language = { lang }
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 @@ -52,7 +52,7 @@
"semver": "^5.5.0",
"shortid": "^2.2.11",
"terminate": "^2.1.0",
"vue-cli-plugin-apollo": "^0.14.6",
"vue-cli-plugin-apollo": "^0.16.3",
"watch": "^1.0.2"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/@vue/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"chalk": "^2.4.1",
"cmd-shim": "^2.0.2",
"commander": "^2.16.0",
"core-js": "^2.5.7",
"debug": "^3.1.0",
"deepmerge": "^2.1.1",
"download-git-repo": "^1.0.2",
Expand Down
Loading

0 comments on commit 4acf48d

Please sign in to comment.