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

Patch #109

Merged
merged 1 commit into from
Aug 4, 2024
Merged

Patch #109

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
66 changes: 0 additions & 66 deletions .eslintignore

This file was deleted.

35 changes: 0 additions & 35 deletions .eslintrc.yml

This file was deleted.

8 changes: 4 additions & 4 deletions dist/index.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.es.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/paystack-button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { callback, PaystackProps } from './types';
interface PaystackButtonProps extends PaystackProps {
text?: string;
className?: string;
disabled?: boolean;
children?: ReactNode;
onSuccess?: callback;
onClose?: callback;
}
declare const PaystackButton: ({ text, className, children, onSuccess, onClose, ...config }: PaystackButtonProps) => JSX.Element;
declare const PaystackButton: ({ text, className, children, onSuccess, onClose, disabled, ...config }: PaystackButtonProps) => JSX.Element;
export default PaystackButton;
1 change: 0 additions & 1 deletion dist/paystack-context.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="react" />
import { InitializePayment, PaystackProps } from './types';
type IPaystackContext = {
config: PaystackProps;
Expand Down
1 change: 0 additions & 1 deletion dist/paystack-provider.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="react" />
import { callback, PaystackProps } from './types';
interface PaystackProviderProps extends PaystackProps {
children: JSX.Element;
Expand Down
44 changes: 44 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import PluginJest from 'eslint-plugin-jest';

export default [
{
files: ['libs/test/**'],
...PluginJest.configs['flat/recommended'],
rules: {
...PluginJest.configs['flat/recommended'].rules,
'jest/prefer-expect-assertions': 'off',
},
},
{
files: ['**/*.{js,ts,jsx,tsx}'],
},
{
files: ['**/*.js'],
languageOptions: {sourceType: 'commonjs'},
},
{
languageOptions: {globals: globals.browser},
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
eslintPluginPrettierRecommended,
{
ignores: ['example/', 'dist/', 'babel.config.js', 'jest.config.js'],
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
},
},
];
8 changes: 0 additions & 8 deletions example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ function App() {
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<PaystackHookExample />
<PaystackHookSplitParameterExample />
Expand Down
8 changes: 4 additions & 4 deletions example/src/dist/index.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/src/dist/index.es.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions example/src/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/src/dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion example/src/dist/paystack-button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { callback, PaystackProps } from './types';
interface PaystackButtonProps extends PaystackProps {
text?: string;
className?: string;
disabled?: boolean;
children?: ReactNode;
onSuccess?: callback;
onClose?: callback;
}
declare const PaystackButton: ({ text, className, children, onSuccess, onClose, ...config }: PaystackButtonProps) => JSX.Element;
declare const PaystackButton: ({ text, className, children, onSuccess, onClose, disabled, ...config }: PaystackButtonProps) => JSX.Element;
export default PaystackButton;
1 change: 0 additions & 1 deletion example/src/dist/paystack-context.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="react" />
import { InitializePayment, PaystackProps } from './types';
type IPaystackContext = {
config: PaystackProps;
Expand Down
1 change: 0 additions & 1 deletion example/src/dist/paystack-provider.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="react" />
import { callback, PaystackProps } from './types';
interface PaystackProviderProps extends PaystackProps {
children: JSX.Element;
Expand Down
3 changes: 3 additions & 0 deletions libs/paystack-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {callback, PaystackProps} from './types';
interface PaystackButtonProps extends PaystackProps {
text?: string;
className?: string;
disabled?: boolean;
children?: ReactNode;
onSuccess?: callback;
onClose?: callback;
Expand All @@ -16,6 +17,7 @@ const PaystackButton = ({
children,
onSuccess,
onClose,
disabled,
...config
}: PaystackButtonProps): JSX.Element => {
const initializePayment = usePaystackPayment(config);
Expand All @@ -24,6 +26,7 @@ const PaystackButton = ({
<button
className={className}
onClick={(): void => initializePayment({config, onSuccess, onClose})}
disabled={disabled}
>
{text || children}
</button>
Expand Down
4 changes: 2 additions & 2 deletions libs/test/use-paystack.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {renderHook, cleanup, act} from '@testing-library/react-hooks';
import {renderHook, cleanup} from '@testing-library/react-hooks';
import {render, fireEvent} from '@testing-library/react';
import React from 'react';
import React, {act} from 'react';
import usePaystackPayment from '../use-paystack';
import {callPaystackPop} from '../paystack-actions';
import {config} from './fixtures';
Expand Down
48 changes: 26 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "rm -rf dist && rollup -c --bundleConfigAsCjs",
"build:watch": "rm -rf dist && rollup -c --watch --bundleConfigAsCjs",
"format": "prettier --write '**/**/*.{js,}'",
"lint": "eslint --ext .js,.ts,.tsx,.jsx --ignore-path .eslintignore .",
"lint": "eslint .",
"lint:fix": "npm run lint -- --fix",
"test": "jest --env=jsdom",
"test:watch": "jest --watch --verbose --env=jsdom"
Expand Down Expand Up @@ -39,43 +39,47 @@
"react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
},
"dependencies": {
"@paystack/inline-js": "^2.18.0"
"@paystack/inline-js": "^2.19.2",
"@testing-library/dom": "^10.4.0"
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"@babel/preset-typescript": "^7.21.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/preset-typescript": "^7.24.7",
"@eslint/js": "^9.8.0",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^11.0.0",
"@testing-library/react": "^14.0.0",
"@rollup/plugin-typescript": "^11.1.6",
"@testing-library/react": "^16.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@types/jest": "^29.5.0",
"@types/react": "^18.0.32",
"@types/react-dom": "^18.0.11",
"@types/jest": "^29.5.12",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^29.5.0",
"eslint": "^8.37.0",
"eslint": "^9.8.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-jest": "^28.7.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.35.0",
"globals": "^15.9.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^3.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0",
"rollup": "^4.9.2",
"prettier": "^3.3.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-test-renderer": "^18.3.1",
"rollup": "^4.20.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-typescript2": "^0.36.0",
"ts-jest": "^29.1.0",
"typescript": "^5.0.3"
"ts-jest": "^29.2.4",
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.0"
}
}
Loading