Skip to content

Commit

Permalink
feat: add TS type defs
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Nov 14, 2023
1 parent 9ab8ff4 commit adafb6e
Show file tree
Hide file tree
Showing 59 changed files with 18,396 additions and 18,194 deletions.
7 changes: 7 additions & 0 deletions .babelrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-env node, es2018 */
module.exports = function (api) {
const base = require('@jcoreio/toolchain-esnext/.babelrc.cjs')(api)
return {
...base,
}
}
30 changes: 0 additions & 30 deletions .babelrc.js

This file was deleted.

50 changes: 25 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
version: 2
# created by @jcoreio/toolchain-circle

version: 2.1
jobs:
build:
docker:
- image: circleci/node:8
- image: cimg/node:20.3.0

steps:
- checkout
- restore_cache:
name: Restore Yarn Package Cache
keys:
- v1-yarn-packages-{{ checksum "yarn.lock" }}

- run:
name: Setup NPM Token
command: |
yarn config set registry "https://registry.npmjs.org/"
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
npm config set \
"//registry.npmjs.org/:_authToken=$NPM_TOKEN" \
"registry=https://registry.npmjs.org/"
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: v1-yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn

name: Corepack enable
command: sudo corepack enable
- run:
name: build
command: yarn run prepublishOnly
name: Install Dependencies
command: pnpm install --frozen-lockfile
- run:
name: upload test coverage
command: yarn codecov || true
name: Prepublish
command: |
[[ $(netstat -tnlp | grep -F 'circleci-agent') ]] || pnpm run tc prepublish
- run:
name: release
command: yarn run semantic-release || true
name: Release
command: |
[[ $(netstat -tnlp | grep -F 'circleci-agent') ]] || pnpm run tc release
workflows:
build:
jobs:
- build:
context:
- npm-release
- github-release
22 changes: 0 additions & 22 deletions .eslintrc

This file was deleted.

7 changes: 7 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-env node, es2018 */
module.exports = {
extends: [require.resolve('@jcoreio/toolchain/eslint.config.cjs')],
env: {
es6: true,
},
}
2 changes: 2 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<PROJECT_ROOT>/node_modules/.*/fbjs/.*
<PROJECT_ROOT>/node_modules/fbjs/.*
<PROJECT_ROOT>/node_modules/.*/config-chain/.*
<PROJECT_ROOT>/dist/.*
.*/malformed_package_json/.*

[include]
./src
Expand Down
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
.eslintcache
/dist
.nyc_output
coverage
es
node_modules
.eslintcache
/*.js
/*.js.flow
!/.babelrc.js
!/webpack.config.js
/coverage
6 changes: 6 additions & 0 deletions .mocharc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-env node, es2018 */
const base = require('@jcoreio/toolchain-mocha/.mocharc.cjs')
module.exports = {
...base,
exit: true,
}
15 changes: 0 additions & 15 deletions .npmignore

This file was deleted.

3,298 changes: 3,297 additions & 1 deletion demo/bundle.js

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<!doctype html>
<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8">
<meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
>
<title>react-view-slider</title>
<style type="text/css">
body {
background-color: #fafafa;
}
.loading {
position: absolute;
text-align: center;
width: 100%;
top: 10%;
}
</style>
</head>
<body>
<div id="root"><h1 class="loading">Loading...</h1></div>
<script src="bundle.js"></script>
</body>
<head>
<meta charset="utf-8" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<title>react-view-slider</title>
<style type="text/css">
body {
background-color: #fafafa;
}
.loading {
position: absolute;
text-align: center;
width: 100%;
top: 10%;
}
</style>
</head>
<body>
<div id="root"><h1 class="loading">Loading...</h1></div>
<script src="bundle.js"></script>
</body>
</html>
6 changes: 4 additions & 2 deletions demo/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/* eslint-env browser, commonjs */

import * as React from 'react'
import ReactDOM from 'react-dom'
import { createRoot } from 'react-dom/client'
import Root from './Root'

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

const root = createRoot(rootElement)

function mount(Root) {
ReactDOM.render(<Root key={++reloads} />, rootElement)
root.render(<Root key={++reloads} />)
}

if (module.hot instanceof Object) {
Expand Down
32 changes: 8 additions & 24 deletions flow-typed/npm/@babel/core_vx.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,7 @@ declare module '@babel/core/lib/config/util.js' {
declare module.exports: $Exports<'@babel/core/lib/config/util'>
}
declare module '@babel/core/lib/config/validation/option-assertions.js' {
declare module.exports: $Exports<
'@babel/core/lib/config/validation/option-assertions'
>
declare module.exports: $Exports<'@babel/core/lib/config/validation/option-assertions'>
}
declare module '@babel/core/lib/config/validation/options.js' {
declare module.exports: $Exports<'@babel/core/lib/config/validation/options'>
Expand All @@ -266,9 +264,7 @@ declare module '@babel/core/lib/parse.js' {
declare module.exports: $Exports<'@babel/core/lib/parse'>
}
declare module '@babel/core/lib/tools/build-external-helpers.js' {
declare module.exports: $Exports<
'@babel/core/lib/tools/build-external-helpers'
>
declare module.exports: $Exports<'@babel/core/lib/tools/build-external-helpers'>
}
declare module '@babel/core/lib/transform-ast.js' {
declare module.exports: $Exports<'@babel/core/lib/transform-ast'>
Expand All @@ -283,22 +279,16 @@ declare module '@babel/core/lib/transform.js' {
declare module.exports: $Exports<'@babel/core/lib/transform'>
}
declare module '@babel/core/lib/transformation/block-hoist-plugin.js' {
declare module.exports: $Exports<
'@babel/core/lib/transformation/block-hoist-plugin'
>
declare module.exports: $Exports<'@babel/core/lib/transformation/block-hoist-plugin'>
}
declare module '@babel/core/lib/transformation/file/file.js' {
declare module.exports: $Exports<'@babel/core/lib/transformation/file/file'>
}
declare module '@babel/core/lib/transformation/file/generate.js' {
declare module.exports: $Exports<
'@babel/core/lib/transformation/file/generate'
>
declare module.exports: $Exports<'@babel/core/lib/transformation/file/generate'>
}
declare module '@babel/core/lib/transformation/file/merge-map.js' {
declare module.exports: $Exports<
'@babel/core/lib/transformation/file/merge-map'
>
declare module.exports: $Exports<'@babel/core/lib/transformation/file/merge-map'>
}
declare module '@babel/core/lib/transformation/index' {
declare module.exports: $Exports<'@babel/core/lib/transformation'>
Expand All @@ -307,20 +297,14 @@ declare module '@babel/core/lib/transformation/index.js' {
declare module.exports: $Exports<'@babel/core/lib/transformation'>
}
declare module '@babel/core/lib/transformation/normalize-file.js' {
declare module.exports: $Exports<
'@babel/core/lib/transformation/normalize-file'
>
declare module.exports: $Exports<'@babel/core/lib/transformation/normalize-file'>
}
declare module '@babel/core/lib/transformation/normalize-opts.js' {
declare module.exports: $Exports<
'@babel/core/lib/transformation/normalize-opts'
>
declare module.exports: $Exports<'@babel/core/lib/transformation/normalize-opts'>
}
declare module '@babel/core/lib/transformation/plugin-pass.js' {
declare module.exports: $Exports<'@babel/core/lib/transformation/plugin-pass'>
}
declare module '@babel/core/lib/transformation/util/missing-plugin-helper.js' {
declare module.exports: $Exports<
'@babel/core/lib/transformation/util/missing-plugin-helper'
>
declare module.exports: $Exports<'@babel/core/lib/transformation/util/missing-plugin-helper'>
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@ declare module '@babel/plugin-proposal-class-properties/lib' {

// Filename aliases
declare module '@babel/plugin-proposal-class-properties/lib/index' {
declare module.exports: $Exports<
'@babel/plugin-proposal-class-properties/lib'
>
declare module.exports: $Exports<'@babel/plugin-proposal-class-properties/lib'>
}
declare module '@babel/plugin-proposal-class-properties/lib/index.js' {
declare module.exports: $Exports<
'@babel/plugin-proposal-class-properties/lib'
>
declare module.exports: $Exports<'@babel/plugin-proposal-class-properties/lib'>
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@ declare module '@babel/plugin-proposal-export-default-from/lib' {

// Filename aliases
declare module '@babel/plugin-proposal-export-default-from/lib/index' {
declare module.exports: $Exports<
'@babel/plugin-proposal-export-default-from/lib'
>
declare module.exports: $Exports<'@babel/plugin-proposal-export-default-from/lib'>
}
declare module '@babel/plugin-proposal-export-default-from/lib/index.js' {
declare module.exports: $Exports<
'@babel/plugin-proposal-export-default-from/lib'
>
declare module.exports: $Exports<'@babel/plugin-proposal-export-default-from/lib'>
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@ declare module '@babel/plugin-proposal-export-namespace-from/lib' {

// Filename aliases
declare module '@babel/plugin-proposal-export-namespace-from/lib/index' {
declare module.exports: $Exports<
'@babel/plugin-proposal-export-namespace-from/lib'
>
declare module.exports: $Exports<'@babel/plugin-proposal-export-namespace-from/lib'>
}
declare module '@babel/plugin-proposal-export-namespace-from/lib/index.js' {
declare module.exports: $Exports<
'@babel/plugin-proposal-export-namespace-from/lib'
>
declare module.exports: $Exports<'@babel/plugin-proposal-export-namespace-from/lib'>
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@ declare module '@babel/plugin-proposal-object-rest-spread/lib' {

// Filename aliases
declare module '@babel/plugin-proposal-object-rest-spread/lib/index' {
declare module.exports: $Exports<
'@babel/plugin-proposal-object-rest-spread/lib'
>
declare module.exports: $Exports<'@babel/plugin-proposal-object-rest-spread/lib'>
}
declare module '@babel/plugin-proposal-object-rest-spread/lib/index.js' {
declare module.exports: $Exports<
'@babel/plugin-proposal-object-rest-spread/lib'
>
declare module.exports: $Exports<'@babel/plugin-proposal-object-rest-spread/lib'>
}
Loading

0 comments on commit adafb6e

Please sign in to comment.