Skip to content

Commit

Permalink
Ojs fixes (#71)
Browse files Browse the repository at this point in the history
* fix types

* chalk as deps
  • Loading branch information
zeyarpaing authored Nov 27, 2024
1 parent 7c15e03 commit 2297a45
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 6 deletions.
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions packages/react/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ import CardCvcElement from './components/card-cvc';
import CardElement from './components/card';
import CardExpiryElement from './components/card-expiry';
import CardNumberElement from './components/card-number';
import { FieldName } from '@getopenpay/utils';
import { ElementProps, ElementsFormProps } from '@getopenpay/utils';
import {
ElementProps,
ElementsFormProps,
ElementsFormChildrenProps,
DynamicPreview,
PaymentRequestStatus,
Amount,
FieldName,
PaymentRequestStartParams,
} from '@getopenpay/utils';

export {
useOpenPayElements,
Expand All @@ -17,4 +25,9 @@ export {
FieldName,
type ElementProps,
type ElementsFormProps,
type ElementsFormChildrenProps,
type DynamicPreview,
type PaymentRequestStatus,
type PaymentRequestStartParams,
type Amount,
};
4 changes: 3 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"dependencies": {
"use-async-effect": "^2.2.7",
"uuid": "^10.0.0",
"zod": "^3.23.8"
"zod": "^3.23.8",
"chalk": "^5.3.0",
"penpal": "^6.2.2"
},
"peerDependencies": {
"react": "^16.x || ^17.x || ^18.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineConfig({
formats: ['es'],
},
rollupOptions: {
external: ['react', 'react-dom', 'react/jsx-runtime', 'zod'],
external: ['react', 'react-dom', 'react/jsx-runtime', 'zod', 'chalk', 'penpal', 'uuid'],
output: {
globals: {
react: 'React',
Expand Down
3 changes: 2 additions & 1 deletion packages/utils/src/cde-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,12 @@ export const CDE_POLLING_INTERVAL = 1000;
* @throws if the response is not valid or connection failed
*/
export const pingCdeFor3dsStatus = async (iframe: HTMLIFrameElement, childOrigin: string) => {
console.log(childOrigin);
const connection = connectToChild({
iframe,
debug: true,
timeout: CDE_POLLING_INTERVAL,
childOrigin,
childOrigin: '*', // TODO: use with proper childOrigin
});
const connectionObj = (await connection.promise) as unknown as CdeConnection;
const result = await queryCDE(connectionObj, { type: 'ping-3ds-status' }, Ping3DSStatusResponse);
Expand Down
1 change: 1 addition & 0 deletions packages/vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"dev": "vite build --watch --mode development"
},
"dependencies": {
"chalk": "^5.3.0",
"penpal": "^6.2.2",
"uuid": "^10.0.0",
"zod": "^3.23.8"
Expand Down
2 changes: 1 addition & 1 deletion packages/vanilla/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineConfig(({ mode }) => {
fileName: (format) => `index.${format}.js`,
},
rollupOptions: {
external: ['@stripe/stripe-js', 'zod', 'penpal', 'uuid', 'react', 'react-dom'], // React is included in 'utils'
external: ['react', 'react-dom', 'zod', 'penpal', 'uuid', 'chalk'], // React is included in 'utils'
output: {
assetFileNames: 'assets/[name][extname]',
},
Expand Down

0 comments on commit 2297a45

Please sign in to comment.