Skip to content

Commit

Permalink
feat(AP-1201): replace javascript-sdk with @evolv/client (#5)
Browse files Browse the repository at this point in the history
* chore: ignore ide config directories

* feat(AP-1201): replace javascript-sdk with @evolv/client

Co-authored-by: Matt Strom <matt.strom@evolv.ai>
  • Loading branch information
mattstrom and Matt Strom authored Aug 15, 2022
1 parent 8d98bbe commit d3f29f7
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 32 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ yarn-error.log*

# turbo
.turbo

# IDEs
.idea
.vscode
41 changes: 21 additions & 20 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@evolv-delivery-tools/react",
"version": "0.4.5",
"version": "0.5.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
Expand All @@ -15,10 +15,10 @@
],
"repository": {
"type": "git",
"url": "https://github.com/evolv-ai/delivery"
"url": "https://github.com/evolv-ai/delivery-clients"
},
"dependencies": {
"@evolv/javascript-sdk": "git+https://git@github.com/evolv-ai/javascript-sdk.git#48669eae833c33ae01d402f8c97af26f513fe0f7",
"@evolv/client": "^1.23.1",
"@types/react": "^18.0.15",
"react": "17.0.2",
"react-is": "17.0.2",
Expand Down
4 changes: 2 additions & 2 deletions src/client/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EvolvSdk from "@evolv/javascript-sdk";
import EvolvSdk from '@evolv/client';
import { EvolvClientOptions } from '@types';
import { getCookie, setCookie } from 'cookies-next';

Expand Down Expand Up @@ -106,4 +106,4 @@ export function generateId() {
const date = Date.now();

return `${prefix}_${date}`;
}
}
4 changes: 2 additions & 2 deletions src/components/EvolvContext.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext } from 'react'
import EvolvClient from "@evolv/javascript-sdk";
import EvolvClient from '@evolv/client';

import { EvolvContextInterface } from '@types';

Expand All @@ -22,4 +22,4 @@ export const EvolvProvider = ({ children, client }: React.PropsWithChildren<Evol
export const useEvolvClient = () => {
const client = useContext(EvolvContext);
return client;
}
}
4 changes: 2 additions & 2 deletions types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type EvolvClient from "@evolv/javascript-sdk"
import type EvolvClient from '@evolv/client';

export interface EvolvContextInterface {
client?: EvolvClient
Expand Down Expand Up @@ -58,4 +58,4 @@ declare global {
getInitialProps?(ctx: any): any;
}
}
}
}
6 changes: 3 additions & 3 deletions types/sdk.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module '@evolv/javascript-sdk' {
declare module '@evolv/client' {
export interface EvolvSdkOptions {
environment: string;
endpoint?: string;
Expand All @@ -18,7 +18,7 @@ declare module '@evolv/javascript-sdk' {
timeout?: number;
hooks?: {};
}

class EvolvSdk {
constructor(options: EvolvSdkOptions): EvolvSdk;
get: (key: string) => Promise<any> | any
Expand Down Expand Up @@ -46,4 +46,4 @@ declare module '@evolv/javascript-sdk' {
}

export default EvolvSdk;
}
}

0 comments on commit d3f29f7

Please sign in to comment.