Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript(vx-group): re-write package in TypeScript #488

Merged
merged 13 commits into from
Oct 3, 2019
Merged
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jest.config.js
prettier.config.js
tsconfig.eslint.json
tsconfig.json
tsconfig.options.json
*.tsbuildinfo
webpack.config.js

# Lock files, libs should not have lock files
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ jest.config.js
prettier.config.js
tsconfig.eslint.json
tsconfig.json
tsconfig.options.json
*.tsbuildinfo
webpack.config.js
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "@hshoff",
"private": true,
"scripts": {
"build": "yarn run babel",
"build": "yarn run babel && yarn run type:dts",
"build-one": "nimbus babel --clean",
"babel": "yarn run babel:cjs && yarn run babel:esm",
"babel:cjs": "nimbus babel --clean --workspaces=\"@vx/!(demo)\"",
Expand All @@ -31,6 +31,7 @@
"precommit": "lint-staged",
"setup": "yarn run build",
"test": "yarn run jest",
"type:dts": "nimbus typescript --build --reference-workspaces",
"docs": "yarn run docs:gen && node ./scripts/docs/index.js",
"docs:gen": "lerna run docs",
"prepare-release": "git checkout master && git pull --rebase origin master && yarn run docs && lerna updated",
Expand All @@ -47,7 +48,11 @@
"@airbnb/config-eslint": "^2.0.0",
"@airbnb/config-jest": "^2.0.0",
"@airbnb/config-prettier": "^2.0.0",
"@airbnb/config-typescript": "^2.0.0",
"@airbnb/nimbus": "^2.0.0",
"@types/enzyme": "^3.10.3",
"@types/jsdom": "^12.2.4",
"@types/react-test-renderer": "^16.9.0",
"coveralls": "^3.0.6",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
Expand All @@ -72,13 +77,19 @@
"babel",
"eslint",
"jest",
"prettier"
"prettier",
"typescript"
],
"settings": {
"library": true,
"react": true,
"next": true
},
"typescript": {
"compilerOptions": {
"emitDeclarationOnly": true
}
},
"jest": {
"coverageReporters": [
"json"
Expand Down
3 changes: 3 additions & 0 deletions packages/vx-group/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"scripts": {
"docs": "cd ./docs && ../../../node_modules/.bin/react-docgen --exclude index.js ../src | ../../../scripts/buildDocs.sh"
},
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/hshoff/vx.git"
Expand All @@ -34,6 +35,8 @@
"react": "^15.0.0-0 || ^16.0.0-0"
},
"dependencies": {
"@types/classnames": "^2.2.9",
"@types/react": "*",
"classnames": "^2.2.5",
"prop-types": "^15.6.2"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from 'react';
import cx from 'classnames';
import PropTypes from 'prop-types';

Group.propTypes = {
top: PropTypes.number,
left: PropTypes.number,
transform: PropTypes.string,
className: PropTypes.string,
children: PropTypes.any,
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
type GroupProps = {
top?: number;
left?: number;
transform?: string;
className?: string;
children?: React.ReactNode;
innerRef?: React.Ref<SVGGElement>;
};

export default function Group({
Expand All @@ -19,7 +18,7 @@ export default function Group({
children,
innerRef,
...restProps
}) {
}: GroupProps & Omit<React.SVGProps<SVGGElement>, keyof GroupProps>) {
return (
<g
ref={innerRef}
Expand Down
File renamed without changes.