Skip to content

Commit a8aba09

Browse files
authored
chore: update deps (#41)
* chore: update deps * fix: /deep/ is now parsed as a combinator in postcss-selector-parser v5
1 parent a9fd61b commit a8aba09

File tree

5 files changed

+509
-353
lines changed

5 files changed

+509
-353
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version: 2
66
jobs:
77
build:
88
docker:
9-
- image: circleci/node:6
9+
- image: circleci/node:8
1010

1111
working_directory: ~/repo
1212

lib/stylePlugins/scoped.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,15 @@ export default postcss.plugin('add-id', (options: any) => (root: Root) => {
2626

2727
selector.each((n: any) => {
2828
// ">>>" combinator
29-
if (n.type === 'combinator' && n.value === '>>>') {
29+
// and /deep/ alias for >>>, since >>> doesn't work in SASS
30+
if (
31+
n.type === 'combinator' &&
32+
(n.value === '>>>' || n.value === '/deep/')
33+
) {
3034
n.value = ' '
3135
n.spaces.before = n.spaces.after = ''
3236
return false
3337
}
34-
// /deep/ alias for >>>, since >>> doesn't work in SASS
35-
if (n.type === 'tag' && n.value === '/deep/') {
36-
const prev = n.prev()
37-
if (prev && prev.type === 'combinator' && prev.value === ' ') {
38-
prev.remove()
39-
}
40-
n.remove()
41-
return false
42-
}
4338
if (n.type !== 'pseudo' && n.type !== 'combinator') {
4439
node = n
4540
}

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,29 @@
3737
"homepage": "https://github.com/vuejs/component-compiler-utils#readme",
3838
"devDependencies": {
3939
"@types/jest": "^22.2.3",
40-
"@types/node": "^9.4.7",
41-
"conventional-changelog-cli": "^1.3.22",
40+
"@types/node": "^10.12.18",
41+
"conventional-changelog-cli": "^2.0.11",
4242
"jest": "^22.4.2",
43-
"less": "^3.0.1",
44-
"lint-staged": "^7.2.0",
45-
"node-sass": "^4.8.3",
43+
"less": "^3.9.0",
44+
"lint-staged": "^8.1.0",
45+
"node-sass": "^4.11.0",
4646
"pug": "^2.0.3",
4747
"stylus": "^0.54.5",
4848
"ts-jest": "^22.4.2",
4949
"typescript": "^2.7.2",
50-
"vue": "^2.5.17",
51-
"vue-template-compiler": "^2.5.17",
52-
"yorkie": "^1.0.3"
50+
"vue": "^2.5.21",
51+
"vue-template-compiler": "^2.5.21",
52+
"yorkie": "^2.0.0"
5353
},
5454
"dependencies": {
5555
"consolidate": "^0.15.1",
5656
"hash-sum": "^1.0.2",
5757
"lru-cache": "^4.1.2",
5858
"merge-source-map": "^1.1.0",
59-
"postcss": "^6.0.20",
60-
"postcss-selector-parser": "^3.1.1",
59+
"postcss": "^7.0.7",
60+
"postcss-selector-parser": "^5.0.0",
6161
"prettier": "1.13.7",
62-
"source-map": "^0.5.6",
62+
"source-map": "^0.7.3",
6363
"vue-template-es2015-compiler": "^1.6.0"
6464
}
6565
}

test/stylePluginScoped.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ h1 {
7272
}
7373
.foo p >>> .bar {
7474
color: red;
75-
}`
75+
}
76+
.foo div /deep/ .bar {
77+
color: red;
78+
}
79+
`
7680
})
7781

7882
expect(style).toContain(`.test[v-scope-xxx] {\n color: yellow;\n}`)
@@ -101,6 +105,8 @@ h1 {
101105
expect(style).toContain(`@-webkit-keyframes opacity-v-scope-xxx {`)
102106
// >>> combinator
103107
expect(style).toContain(`.foo p[v-scope-xxx] .bar {\n color: red;\n}`)
108+
// /deep/ alias for >>>
109+
expect(style).toContain(`.foo div[v-scope-xxx] .bar {\n color: red;\n}`)
104110
})
105111

106112
test('pseudo element', () => {

0 commit comments

Comments
 (0)