Skip to content

Commit adafb6e

Browse files
committed
feat: add TS type defs
1 parent 9ab8ff4 commit adafb6e

Some content is hidden

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

59 files changed

+18396
-18194
lines changed

.babelrc.cjs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-env node, es2018 */
2+
module.exports = function (api) {
3+
const base = require('@jcoreio/toolchain-esnext/.babelrc.cjs')(api)
4+
return {
5+
...base,
6+
}
7+
}

.babelrc.js

-30
This file was deleted.

.circleci/config.yml

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
version: 2
1+
# created by @jcoreio/toolchain-circle
2+
3+
version: 2.1
24
jobs:
35
build:
46
docker:
5-
- image: circleci/node:8
7+
- image: cimg/node:20.3.0
68

79
steps:
810
- checkout
9-
- restore_cache:
10-
name: Restore Yarn Package Cache
11-
keys:
12-
- v1-yarn-packages-{{ checksum "yarn.lock" }}
13-
1411
- run:
1512
name: Setup NPM Token
1613
command: |
17-
yarn config set registry "https://registry.npmjs.org/"
18-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
19-
echo "registry=https://registry.npmjs.org/" >> .npmrc
20-
14+
npm config set \
15+
"//registry.npmjs.org/:_authToken=$NPM_TOKEN" \
16+
"registry=https://registry.npmjs.org/"
2117
- run:
22-
name: Install Dependencies
23-
command: yarn install --frozen-lockfile
24-
- save_cache:
25-
name: Save Yarn Package Cache
26-
key: v1-yarn-packages-{{ checksum "yarn.lock" }}
27-
paths:
28-
- ~/.cache/yarn
29-
18+
name: Corepack enable
19+
command: sudo corepack enable
3020
- run:
31-
name: build
32-
command: yarn run prepublishOnly
21+
name: Install Dependencies
22+
command: pnpm install --frozen-lockfile
3323
- run:
34-
name: upload test coverage
35-
command: yarn codecov || true
24+
name: Prepublish
25+
command: |
26+
[[ $(netstat -tnlp | grep -F 'circleci-agent') ]] || pnpm run tc prepublish
3627
- run:
37-
name: release
38-
command: yarn run semantic-release || true
28+
name: Release
29+
command: |
30+
[[ $(netstat -tnlp | grep -F 'circleci-agent') ]] || pnpm run tc release
31+
32+
workflows:
33+
build:
34+
jobs:
35+
- build:
36+
context:
37+
- npm-release
38+
- github-release

.eslintrc

-22
This file was deleted.

.eslintrc.cjs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-env node, es2018 */
2+
module.exports = {
3+
extends: [require.resolve('@jcoreio/toolchain/eslint.config.cjs')],
4+
env: {
5+
es6: true,
6+
},
7+
}

.flowconfig

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<PROJECT_ROOT>/node_modules/.*/fbjs/.*
99
<PROJECT_ROOT>/node_modules/fbjs/.*
1010
<PROJECT_ROOT>/node_modules/.*/config-chain/.*
11+
<PROJECT_ROOT>/dist/.*
12+
.*/malformed_package_json/.*
1113

1214
[include]
1315
./src

.gitignore

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
.eslintcache
1+
/dist
22
.nyc_output
3-
coverage
4-
es
53
node_modules
6-
.eslintcache
7-
/*.js
8-
/*.js.flow
9-
!/.babelrc.js
10-
!/webpack.config.js
4+
/coverage

.mocharc.cjs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* eslint-env node, es2018 */
2+
const base = require('@jcoreio/toolchain-mocha/.mocharc.cjs')
3+
module.exports = {
4+
...base,
5+
exit: true,
6+
}

.npmignore

-15
This file was deleted.

demo/bundle.js

+3,297-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/index.html

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22

33
<html lang="en">
4-
<head>
5-
<meta charset="utf-8">
6-
<meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1">
7-
<meta name="description" content="">
8-
<meta
9-
name="viewport"
10-
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
11-
>
12-
<title>react-view-slider</title>
13-
<style type="text/css">
14-
body {
15-
background-color: #fafafa;
16-
}
17-
.loading {
18-
position: absolute;
19-
text-align: center;
20-
width: 100%;
21-
top: 10%;
22-
}
23-
</style>
24-
</head>
25-
<body>
26-
<div id="root"><h1 class="loading">Loading...</h1></div>
27-
<script src="bundle.js"></script>
28-
</body>
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7+
<meta name="description" content="" />
8+
<meta
9+
name="viewport"
10+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
11+
/>
12+
<title>react-view-slider</title>
13+
<style type="text/css">
14+
body {
15+
background-color: #fafafa;
16+
}
17+
.loading {
18+
position: absolute;
19+
text-align: center;
20+
width: 100%;
21+
top: 10%;
22+
}
23+
</style>
24+
</head>
25+
<body>
26+
<div id="root"><h1 class="loading">Loading...</h1></div>
27+
<script src="bundle.js"></script>
28+
</body>
2929
</html>

demo/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
/* eslint-env browser, commonjs */
22

33
import * as React from 'react'
4-
import ReactDOM from 'react-dom'
4+
import { createRoot } from 'react-dom/client'
55
import Root from './Root'
66

77
let reloads = 0
88
const rootElement = document.getElementById('root')
99
if (!rootElement) throw new Error('#root not found')
1010

11+
const root = createRoot(rootElement)
12+
1113
function mount(Root) {
12-
ReactDOM.render(<Root key={++reloads} />, rootElement)
14+
root.render(<Root key={++reloads} />)
1315
}
1416

1517
if (module.hot instanceof Object) {

flow-typed/npm/@babel/core_vx.x.x.js

+8-24
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,7 @@ declare module '@babel/core/lib/config/util.js' {
243243
declare module.exports: $Exports<'@babel/core/lib/config/util'>
244244
}
245245
declare module '@babel/core/lib/config/validation/option-assertions.js' {
246-
declare module.exports: $Exports<
247-
'@babel/core/lib/config/validation/option-assertions'
248-
>
246+
declare module.exports: $Exports<'@babel/core/lib/config/validation/option-assertions'>
249247
}
250248
declare module '@babel/core/lib/config/validation/options.js' {
251249
declare module.exports: $Exports<'@babel/core/lib/config/validation/options'>
@@ -266,9 +264,7 @@ declare module '@babel/core/lib/parse.js' {
266264
declare module.exports: $Exports<'@babel/core/lib/parse'>
267265
}
268266
declare module '@babel/core/lib/tools/build-external-helpers.js' {
269-
declare module.exports: $Exports<
270-
'@babel/core/lib/tools/build-external-helpers'
271-
>
267+
declare module.exports: $Exports<'@babel/core/lib/tools/build-external-helpers'>
272268
}
273269
declare module '@babel/core/lib/transform-ast.js' {
274270
declare module.exports: $Exports<'@babel/core/lib/transform-ast'>
@@ -283,22 +279,16 @@ declare module '@babel/core/lib/transform.js' {
283279
declare module.exports: $Exports<'@babel/core/lib/transform'>
284280
}
285281
declare module '@babel/core/lib/transformation/block-hoist-plugin.js' {
286-
declare module.exports: $Exports<
287-
'@babel/core/lib/transformation/block-hoist-plugin'
288-
>
282+
declare module.exports: $Exports<'@babel/core/lib/transformation/block-hoist-plugin'>
289283
}
290284
declare module '@babel/core/lib/transformation/file/file.js' {
291285
declare module.exports: $Exports<'@babel/core/lib/transformation/file/file'>
292286
}
293287
declare module '@babel/core/lib/transformation/file/generate.js' {
294-
declare module.exports: $Exports<
295-
'@babel/core/lib/transformation/file/generate'
296-
>
288+
declare module.exports: $Exports<'@babel/core/lib/transformation/file/generate'>
297289
}
298290
declare module '@babel/core/lib/transformation/file/merge-map.js' {
299-
declare module.exports: $Exports<
300-
'@babel/core/lib/transformation/file/merge-map'
301-
>
291+
declare module.exports: $Exports<'@babel/core/lib/transformation/file/merge-map'>
302292
}
303293
declare module '@babel/core/lib/transformation/index' {
304294
declare module.exports: $Exports<'@babel/core/lib/transformation'>
@@ -307,20 +297,14 @@ declare module '@babel/core/lib/transformation/index.js' {
307297
declare module.exports: $Exports<'@babel/core/lib/transformation'>
308298
}
309299
declare module '@babel/core/lib/transformation/normalize-file.js' {
310-
declare module.exports: $Exports<
311-
'@babel/core/lib/transformation/normalize-file'
312-
>
300+
declare module.exports: $Exports<'@babel/core/lib/transformation/normalize-file'>
313301
}
314302
declare module '@babel/core/lib/transformation/normalize-opts.js' {
315-
declare module.exports: $Exports<
316-
'@babel/core/lib/transformation/normalize-opts'
317-
>
303+
declare module.exports: $Exports<'@babel/core/lib/transformation/normalize-opts'>
318304
}
319305
declare module '@babel/core/lib/transformation/plugin-pass.js' {
320306
declare module.exports: $Exports<'@babel/core/lib/transformation/plugin-pass'>
321307
}
322308
declare module '@babel/core/lib/transformation/util/missing-plugin-helper.js' {
323-
declare module.exports: $Exports<
324-
'@babel/core/lib/transformation/util/missing-plugin-helper'
325-
>
309+
declare module.exports: $Exports<'@babel/core/lib/transformation/util/missing-plugin-helper'>
326310
}

flow-typed/npm/@babel/plugin-proposal-class-properties_vx.x.x.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ declare module '@babel/plugin-proposal-class-properties/lib' {
2828

2929
// Filename aliases
3030
declare module '@babel/plugin-proposal-class-properties/lib/index' {
31-
declare module.exports: $Exports<
32-
'@babel/plugin-proposal-class-properties/lib'
33-
>
31+
declare module.exports: $Exports<'@babel/plugin-proposal-class-properties/lib'>
3432
}
3533
declare module '@babel/plugin-proposal-class-properties/lib/index.js' {
36-
declare module.exports: $Exports<
37-
'@babel/plugin-proposal-class-properties/lib'
38-
>
34+
declare module.exports: $Exports<'@babel/plugin-proposal-class-properties/lib'>
3935
}

flow-typed/npm/@babel/plugin-proposal-export-default-from_vx.x.x.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ declare module '@babel/plugin-proposal-export-default-from/lib' {
2828

2929
// Filename aliases
3030
declare module '@babel/plugin-proposal-export-default-from/lib/index' {
31-
declare module.exports: $Exports<
32-
'@babel/plugin-proposal-export-default-from/lib'
33-
>
31+
declare module.exports: $Exports<'@babel/plugin-proposal-export-default-from/lib'>
3432
}
3533
declare module '@babel/plugin-proposal-export-default-from/lib/index.js' {
36-
declare module.exports: $Exports<
37-
'@babel/plugin-proposal-export-default-from/lib'
38-
>
34+
declare module.exports: $Exports<'@babel/plugin-proposal-export-default-from/lib'>
3935
}

flow-typed/npm/@babel/plugin-proposal-export-namespace-from_vx.x.x.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ declare module '@babel/plugin-proposal-export-namespace-from/lib' {
2828

2929
// Filename aliases
3030
declare module '@babel/plugin-proposal-export-namespace-from/lib/index' {
31-
declare module.exports: $Exports<
32-
'@babel/plugin-proposal-export-namespace-from/lib'
33-
>
31+
declare module.exports: $Exports<'@babel/plugin-proposal-export-namespace-from/lib'>
3432
}
3533
declare module '@babel/plugin-proposal-export-namespace-from/lib/index.js' {
36-
declare module.exports: $Exports<
37-
'@babel/plugin-proposal-export-namespace-from/lib'
38-
>
34+
declare module.exports: $Exports<'@babel/plugin-proposal-export-namespace-from/lib'>
3935
}

flow-typed/npm/@babel/plugin-proposal-object-rest-spread_vx.x.x.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ declare module '@babel/plugin-proposal-object-rest-spread/lib' {
2828

2929
// Filename aliases
3030
declare module '@babel/plugin-proposal-object-rest-spread/lib/index' {
31-
declare module.exports: $Exports<
32-
'@babel/plugin-proposal-object-rest-spread/lib'
33-
>
31+
declare module.exports: $Exports<'@babel/plugin-proposal-object-rest-spread/lib'>
3432
}
3533
declare module '@babel/plugin-proposal-object-rest-spread/lib/index.js' {
36-
declare module.exports: $Exports<
37-
'@babel/plugin-proposal-object-rest-spread/lib'
38-
>
34+
declare module.exports: $Exports<'@babel/plugin-proposal-object-rest-spread/lib'>
3935
}

0 commit comments

Comments
 (0)