Skip to content

Commit a7f9d26

Browse files
committed
chore: TSDX
1 parent cdacd71 commit a7f9d26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+10407
-4153
lines changed

.babelrc

-14
This file was deleted.

.eslintrc

-4
This file was deleted.

.github/workflows/publish.yml

+17-17
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ on:
66
pull_request:
77

88
jobs:
9-
# test:
10-
# name: 'node ${{ matrix.node }} ${{ matrix.os }} '
11-
# runs-on: '${{ matrix.os }}'
12-
# strategy:
13-
# matrix:
14-
# os: [ubuntu-latest]
15-
# node: [12]
16-
# steps:
17-
# - uses: actions/setup-node@v1
18-
# with:
19-
# node-version: ${{ matrix.node }}
20-
# - uses: actions/checkout@v2
21-
# with:
22-
# fetch-depth: 1
23-
# - run: npm i -g yarn
24-
# - run: yarn --frozen-lockfile
25-
# - run: yarn test:ci
9+
test:
10+
name: 'node ${{ matrix.node }} ${{ matrix.os }} '
11+
runs-on: '${{ matrix.os }}'
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
node: [12, 14, 16]
16+
steps:
17+
- uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node }}
20+
- uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 1
23+
- run: npm i -g yarn
24+
- run: yarn --frozen-lockfile
25+
- run: yarn test:ci
2626

2727
publish-module:
2828
name: 'Publish Module to NPM'

.github/workflows/size.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: size
2+
on: [pull_request]
3+
jobs:
4+
size:
5+
runs-on: ubuntu-latest
6+
env:
7+
CI_JOB_NUMBER: 1
8+
steps:
9+
- uses: actions/checkout@v1
10+
- uses: andresz1/size-limit-action@v1
11+
with:
12+
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+16-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
1-
2-
# See https://help.github.com/ignore-files/ for more about ignoring files.
3-
4-
# dependencies
5-
node_modules
6-
7-
# builds
8-
build
9-
dist
10-
artifacts
11-
.rpt2_cache
12-
d3/index.js
13-
14-
# misc
1+
.cache
2+
.DS_Store
153
.DS_Store
164
.env
17-
.env.local
185
.env.development.local
19-
.env.test.local
6+
.env.local
207
.env.production.local
8+
.env.test.local
9+
.history
2110
.next
22-
11+
.rpt2_cache
12+
*.log
13+
artifacts
14+
build
15+
d3/index.js
16+
dist
17+
dist
18+
node_modules
19+
node_modules
2320
npm-debug.log*
21+
size-plugin.json
22+
stats.html
2423
yarn-debug.log*
2524
yarn-error.log*
26-
.history
27-
stats.html
28-
size-plugin.json

.nvmrc

-1
This file was deleted.

.storybook/main.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
stories: ['../stories/**/*.stories.@(ts|tsx|js|jsx)'],
3+
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
4+
// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration
5+
typescript: {
6+
check: true, // type-check stories during Storybook build
7+
}
8+
};

.storybook/preview.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// https://storybook.js.org/docs/react/writing-stories/parameters#global-parameters
2+
export const parameters = {
3+
// https://storybook.js.org/docs/react/essentials/actions#automatically-matching-args
4+
actions: { argTypesRegex: '^on.*' },
5+
};

.travis.yml

-4
This file was deleted.

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"titleBar.inactiveBackground": "#a08600", // change this color!
55
"titleBar.activeForeground": "#ffffff", // change this color!
66
"titleBar.inactiveForeground": "#ffffff" // change this color!
7-
}
7+
},
8+
"typescript.tsdk": "node_modules/typescript/lib"
89
}

LICENSE

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
(The MIT License)
1+
MIT License
22

3-
Copyright (c) 2019 Tanner Linsley
3+
Copyright (c) 2021 Tanner Linsley
44

5-
Permission is hereby granted, free of charge, to any person obtaining
6-
a copy of this software and associated documentation files (the
7-
'Software'), to deal in the Software without restriction, including
8-
without limitation the rights to use, copy, modify, merge, publish,
9-
distribute, sublicense, and/or sell copies of the Software, and to
10-
permit persons to whom the Software is furnished to do so, subject to
11-
the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1211

13-
The above copyright notice and this permission notice shall be
14-
included in all copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1514

16-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

d3/.babelrc

+3-6
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
"@babel/env",
55
{
66
"modules": false,
7-
"loose": true,
8-
"exclude": ["@babel/plugin-transform-regenerator"]
7+
"loose": true
98
}
10-
],
11-
"@babel/react"
12-
],
13-
"plugins": ["babel-plugin-transform-async-to-promises"]
9+
]
10+
]
1411
}

d3/entry.js

-36
This file was deleted.

d3/entry.jsss

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// import preval from 'preval.macro'
2+
3+
export { Delaunay } from 'd3-delaunay';
4+
5+
export {
6+
scaleLinear,
7+
scaleLog,
8+
scaleTime,
9+
scaleUtc,
10+
scaleBand,
11+
} from 'd3-scale';
12+
13+
export { arc, area, line, pie } from 'd3-shape';
14+
15+
export * from 'd3-time';
16+
17+
// export const schemeTableau10 = preval`
18+
// module.exports = require('d3-scale-chromatic').schemeTableau10
19+
// `

d3/rollup.config.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import path from 'path'
2-
import babel from 'rollup-plugin-babel'
3-
import node from 'rollup-plugin-node-resolve'
4-
// import { terser } from 'rollup-plugin-terser'
1+
import path from 'path';
2+
import babel from 'rollup-plugin-babel';
3+
import node from 'rollup-plugin-node-resolve';
54

65
export default [
76
{
@@ -13,11 +12,11 @@ export default [
1312
plugins: [node(), babel()],
1413
onwarn,
1514
},
16-
]
15+
];
1716

1817
function onwarn(message) {
1918
if (message.code === 'CIRCULAR_DEPENDENCY') {
20-
return
19+
return;
2120
}
22-
console.error(message)
21+
console.error(message);
2322
}

example/.npmignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.cache
3+
dist

example/index.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
7+
<title>Playground</title>
8+
</head>
9+
10+
<body>
11+
<div id="root"></div>
12+
<script src="./index.tsx"></script>
13+
</body>
14+
</html>

example/index.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import 'react-app-polyfill/ie11';
2+
import * as React from 'react';
3+
import * as ReactDOM from 'react-dom';
4+
import { Thing } from '../.';
5+
6+
const App = () => {
7+
return (
8+
<div>
9+
<Thing />
10+
</div>
11+
);
12+
};
13+
14+
ReactDOM.render(<App />, document.getElementById('root'));

example/package.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "example",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"start": "parcel index.html",
8+
"build": "parcel build index.html"
9+
},
10+
"dependencies": {
11+
"react-app-polyfill": "^1.0.0"
12+
},
13+
"alias": {
14+
"react": "../node_modules/react",
15+
"react-dom": "../node_modules/react-dom/profiling",
16+
"scheduler/tracing": "../node_modules/scheduler/tracing-profiling"
17+
},
18+
"devDependencies": {
19+
"@types/react": "^16.9.11",
20+
"@types/react-dom": "^16.8.4",
21+
"parcel": "^1.12.3",
22+
"typescript": "^3.4.5"
23+
}
24+
}

example/tsconfig.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"allowSyntheticDefaultImports": false,
4+
"target": "es5",
5+
"module": "commonjs",
6+
"jsx": "react",
7+
"moduleResolution": "node",
8+
"noImplicitAny": false,
9+
"noUnusedLocals": false,
10+
"noUnusedParameters": false,
11+
"removeComments": true,
12+
"strictNullChecks": true,
13+
"preserveConstEnums": true,
14+
"sourceMap": true,
15+
"lib": ["es2015", "es2016", "dom"],
16+
"types": ["node"]
17+
}
18+
}

index.js

-5
This file was deleted.

0 commit comments

Comments
 (0)