Skip to content

Commit e3009cb

Browse files
authored
Merge pull request #241 from smooth-code/upgrade-deps
Upgrade deps & add test
2 parents e66faf0 + fc184a2 commit e3009cb

8 files changed

Lines changed: 455 additions & 562 deletions

File tree

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
},
1717
"devDependencies": {
1818
"@babel/cli": "^7.1.5",
19-
"@babel/core": "^7.1.5",
20-
"@babel/generator": "^7.1.5",
19+
"@babel/core": "^7.1.6",
20+
"@babel/generator": "^7.1.6",
2121
"@babel/node": "^7.0.0",
2222
"@babel/plugin-proposal-class-properties": "^7.1.0",
23-
"@babel/preset-env": "^7.1.5",
23+
"@babel/plugin-syntax-typescript": "^7.1.5",
24+
"@babel/preset-env": "^7.1.6",
2425
"babel-core": "^7.0.0-bridge.0",
2526
"babel-eslint": "^10.0.1",
2627
"babel-jest": "^23.6.0",
@@ -34,8 +35,8 @@
3435
"jest": "^23.6.0",
3536
"lerna": "^3.4.3",
3637
"react": "^16.6.3",
37-
"rehype-parse": "^5.0.0",
38-
"unified": "^7.0.1",
38+
"rehype-parse": "^6.0.0",
39+
"unified": "^7.0.2",
3940
"vfile": "^3.0.1"
4041
}
4142
}

packages/babel-plugin-transform-svg-component/src/index.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,27 @@ export default SvgComponent;"
4141
4242
const MyComponent = () => <svg><div /></svg>;
4343
44+
export default MyComponent;"
45+
`)
46+
})
47+
48+
it('should support custom typescript template', () => {
49+
const { code } = testPlugin('<svg><div /></svg>', {
50+
template: ({ template }, opts, { jsx }) => {
51+
const typescriptTemplate = template.smart({ plugins: ['typescript'] })
52+
return typescriptTemplate.ast`
53+
import * as React from 'react';
54+
const MyComponent = (props: React.SVGProps<SVGSVGElement>) => ${jsx};
55+
export default MyComponent;
56+
`
57+
},
58+
state: { componentName: 'SvgComponent' },
59+
})
60+
expect(code).toMatchInlineSnapshot(`
61+
"import * as React from 'react';
62+
63+
const MyComponent = (props: React.SVGProps<SVGSVGElement>) => <svg><div /></svg>;
64+
4465
export default MyComponent;"
4566
`)
4667
})

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"camelcase": "^5.0.0",
3434
"chalk": "^2.4.1",
3535
"commander": "^2.19.0",
36-
"dashify": "^1.0.0",
36+
"dashify": "^2.0.0",
3737
"glob": "^7.1.3",
3838
"output-file-sync": "^2.0.1",
3939
"recursive-readdir": "^2.2.2"

packages/hast-util-to-babel-ast/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
"prepublishOnly": "yarn run build"
2727
},
2828
"dependencies": {
29-
"@babel/types": "^7.1.5"
29+
"@babel/types": "^7.1.6"
3030
}
3131
}

packages/plugin-jsx/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
"prepublishOnly": "yarn run build"
2222
},
2323
"dependencies": {
24-
"@babel/core": "^7.1.5",
24+
"@babel/core": "^7.1.6",
2525
"@svgr/babel-preset": "^4.0.3",
2626
"@svgr/hast-util-to-babel-ast": "^4.0.3",
27-
"rehype-parse": "^5.0.0",
28-
"unified": "^7.0.1",
27+
"rehype-parse": "^6.0.0",
28+
"unified": "^7.0.2",
2929
"vfile": "^3.0.1"
3030
}
3131
}

packages/rollup/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
"prepublishOnly": "yarn run build"
2626
},
2727
"dependencies": {
28-
"@babel/core": "^7.1.5",
28+
"@babel/core": "^7.1.6",
2929
"@babel/plugin-transform-react-constant-elements": "^7.0.0",
30-
"@babel/preset-env": "^7.1.5",
30+
"@babel/preset-env": "^7.1.6",
3131
"@babel/preset-react": "^7.0.0",
3232
"@svgr/core": "^4.0.3",
3333
"@svgr/plugin-jsx": "^4.0.3",
3434
"@svgr/plugin-svgo": "^4.0.3",
3535
"rollup-pluginutils": "^2.3.3"
3636
},
3737
"devDependencies": {
38-
"rollup": "^0.67.1",
38+
"rollup": "^0.67.3",
3939
"rollup-plugin-image": "^1.0.2",
4040
"rollup-plugin-url": "^2.0.1"
4141
}

packages/webpack/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"prepublishOnly": "yarn run build"
2626
},
2727
"dependencies": {
28-
"@babel/core": "^7.1.5",
28+
"@babel/core": "^7.1.6",
2929
"@babel/plugin-transform-react-constant-elements": "^7.0.0",
30-
"@babel/preset-env": "^7.1.5",
30+
"@babel/preset-env": "^7.1.6",
3131
"@babel/preset-react": "^7.0.0",
3232
"@svgr/core": "^4.0.3",
3333
"@svgr/plugin-jsx": "^4.0.3",
@@ -38,6 +38,6 @@
3838
"babel-loader": "^8.0.4",
3939
"memory-fs": "^0.4.1",
4040
"url-loader": "^1.1.2",
41-
"webpack": "^4.24.0"
41+
"webpack": "^4.26.0"
4242
}
4343
}

0 commit comments

Comments
 (0)