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

refactor(*): recreate the module with typescript #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .babelrc

This file was deleted.

2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
10 changes: 1 addition & 9 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
{
"parser": "babel-eslint",
"extends": ["prettier", "prettier/react"],
"env": {
"es6": true
},
"plugins": ["prettier", "react", "react-hooks"],
"parserOptions": {
"sourceType": "module"
}
"extends": ["react-app", "react-app/jest"]
}
2 changes: 2 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"printWidth": 100,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
24 changes: 24 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2,164 changes: 0 additions & 2,164 deletions example/README.md

This file was deleted.

13 changes: 13 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>react-custom-scroller</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
27 changes: 14 additions & 13 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
"version": "0.0.0",
"license": "MIT",
"private": true,
"dependencies": {
"react-custom-scroller": "./..",
"react-scripts": "^3.2.0"
},
"type": "module",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"prepare": "yarn build"
},
"browserslist": [
">0.2%",
"not dead",
"not op_mini all"
]
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.24",
"@types/react-dom": "^18.0.8",
"@vitejs/plugin-react": "^2.2.0",
"vite": "^3.2.3"
}
}
20 changes: 0 additions & 20 deletions example/public/index.html

This file was deleted.

8 changes: 0 additions & 8 deletions example/public/manifest.json

This file was deleted.

1 change: 1 addition & 0 deletions example/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
55 changes: 0 additions & 55 deletions example/src/Example.js

This file was deleted.

48 changes: 48 additions & 0 deletions example/src/Example.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from 'react';

// react-custom-scroller latest version
import { CustomScroller } from '../../dist';

import styles from './Example.module.css';

export default function Example() {
return (
<CustomScroller className={styles.scroller} innerClassName={styles.content}>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.
</p>
<p>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem
accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
veritatis et quasi architecto beatae vitae dicta sunt explicabo.
</p>
<p>
Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia
consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam
est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non
numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut
enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi
ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea
voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo
voluptas nulla pariatur?
</p>
<p>
But I must explain to you how all this mistaken idea of denouncing pleasure and praising
pain was born and I will give you a complete account of the system, and expound the actual
teachings of the great explorer of the truth, the master-builder of human happiness. No one
rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who
do not know how to pursue pleasure rationally encounter consequences that are extremely
painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself,
because it is pain, but because occasionally circumstances occur in which toil and pain can
procure him some great pleasure. To take a trivial example, which of us ever undertakes
laborious physical exercise, except to obtain some advantage from it? But who has any right
to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences,
or one who avoids a pain that produces no resultant pleasure?
</p>
</CustomScroller>
);
}
7 changes: 0 additions & 7 deletions example/src/index.js

This file was deleted.

File renamed without changes.
14 changes: 14 additions & 0 deletions example/src/main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import ReactDOM from 'react-dom/client';

// react-custom-scroller latest version
import '../../dist/index.css';

import App from './App';
import './main.css';

ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
7 changes: 7 additions & 0 deletions example/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
});
Loading