Skip to content

Commit

Permalink
feat(colors): init TypeScript migration
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Nov 11, 2020
1 parent 7f50401 commit 2383b4d
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 54 deletions.
2 changes: 1 addition & 1 deletion packages/colors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
},
"main": "./dist/nivo-colors.cjs.js",
"module": "./dist/nivo-colors.es.js",
"typings": "./dist/types/index.d.ts",
"files": [
"README.md",
"LICENSE.md",
"index.d.ts",
"dist/"
],
"dependencies": {
Expand Down
13 changes: 0 additions & 13 deletions packages/colors/src/index.js

This file was deleted.

5 changes: 5 additions & 0 deletions packages/colors/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './schemes'
export * from './ordinalColorScale'
export * from './inheritedColor'
export * from './props'
export * from './motion'
8 changes: 0 additions & 8 deletions packages/colors/src/inheritedColor.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { useMemo } from 'react'
import get from 'lodash.get'
import isPlainObject from 'lodash.isplainobject'
Expand Down
8 changes: 0 additions & 8 deletions packages/colors/src/motion.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { spring } from 'react-motion'
import { rgb } from 'd3-color'

Expand Down
9 changes: 1 addition & 8 deletions packages/colors/src/ordinalColorScale.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { useMemo } from 'react'
import get from 'lodash.get'
import isPlainObject from 'lodash.isplainobject'
Expand All @@ -21,6 +13,7 @@ import {
* Compute an ordinal color scale
*/
export const getOrdinalColorScale = (instruction, identity) => {
console.log(instruction, identity)
// user defined function
if (typeof instruction === 'function') return instruction

Expand Down
8 changes: 0 additions & 8 deletions packages/colors/src/props.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import PropTypes from 'prop-types'
import { colorSchemeIds } from './schemes'

Expand Down
8 changes: 0 additions & 8 deletions packages/colors/src/schemes.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import {
// categorical
schemeCategory10,
Expand Down
8 changes: 8 additions & 0 deletions packages/colors/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.types.json",
"compilerOptions": {
"outDir": "./dist/types",
"rootDir": "./src"
},
"include": ["src/**/*"]
}

0 comments on commit 2383b4d

Please sign in to comment.