diff --git a/nx.json b/nx.json index ca8a10664b..427cd00d2c 100644 --- a/nx.json +++ b/nx.json @@ -14,7 +14,10 @@ "cache": true }, "test": { - "cache": true + "cache": true, + "dependsOn": [ + "build" + ] }, "build": { "dependsOn": [ diff --git a/package.json b/package.json index 76ce7e94c7..e0361c836c 100644 --- a/package.json +++ b/package.json @@ -53,13 +53,14 @@ "docs:build": "typedoc", "docs:serve": "http-server ./docs --cors -p 8080 -c-1", "lint": "nx run-many -t lint --parallel=5 --no-error-on-unmatched-pattern", + "nx": "nx", "postinstall": "husky install; ./.husky/install_gitleaks.sh", "release": "release-it", "scan:secrets": "./.husky/run_gitleaks.sh", "syncpack:check": "yarn syncpack list-mismatches", "syncpack:fix": "yarn syncpack fix-mismatches", "syncpack:format": "yarn syncpack format", - "test": "wsrun --exclude-missing -e test", + "test": "nx run-many -t test --parallel=5", "test:checkout:cypress": "wsrun -p @imtbl/checkout-widgets-lib --exclude-missing -e test:cypress", "test:checkout:sdk:coverage": "wsrun -p @imtbl/checkout-sdk --exclude-missing -e test:coverage", "test:examples": "cd examples/ts-immutable-sample && yarn test && yarn test:e2e", diff --git a/packages/x-provider/src/sample-app/config-overrides.js b/packages/x-provider/src/sample-app/config-overrides.js index 504ed5b1a1..ce8ad6dc59 100644 --- a/packages/x-provider/src/sample-app/config-overrides.js +++ b/packages/x-provider/src/sample-app/config-overrides.js @@ -8,7 +8,8 @@ module.exports = function override(config, env) { crypto: require.resolve("crypto-browserify"), assert: require.resolve("assert-browserify"), stream: require.resolve("stream-browserify"), - buffer: require.resolve("buffer/") + buffer: require.resolve("buffer/"), + https: false }); config.resolve.fallback = fallback; diff --git a/packages/x-provider/src/sample-app/src/Components/connect-button.tsx b/packages/x-provider/src/sample-app/src/Components/connect-button.tsx index 9c3641d49d..aba5049898 100644 --- a/packages/x-provider/src/sample-app/src/Components/connect-button.tsx +++ b/packages/x-provider/src/sample-app/src/Components/connect-button.tsx @@ -1,5 +1,5 @@ import { Box, Button } from '@biom3/react'; -import { provider } from '@imtbl/sdk'; +import { x } from '@imtbl/sdk'; import { Environment, ImmutableConfiguration } from '@imtbl/config'; import { useContext } from 'react'; import { Actions, AppCtx } from '../Context/app-context'; @@ -8,11 +8,12 @@ export const ConnectButton = () => { const { state, dispatch } = useContext(AppCtx); const wrapperMetaMaskConnect = async () => { - const metaMaskIMXProvider = await provider.MetaMaskIMXProvider.connect( - new provider.ProviderConfiguration({ + const metaMaskIMXProvider = await x.MetaMaskIMXProvider.connect( + new x.ProviderConfiguration({ baseConfig: new ImmutableConfiguration({ environment: Environment.PRODUCTION, }), + overrides: undefined, }) ); diff --git a/packages/x-provider/src/sample-app/src/Components/disconnect-button.tsx b/packages/x-provider/src/sample-app/src/Components/disconnect-button.tsx index 515926ea4b..9cab355206 100644 --- a/packages/x-provider/src/sample-app/src/Components/disconnect-button.tsx +++ b/packages/x-provider/src/sample-app/src/Components/disconnect-button.tsx @@ -1,13 +1,13 @@ import { Actions, AppCtx } from '../Context/app-context'; import { Box, Heading, Button } from '@biom3/react'; import { useContext } from 'react'; -import { provider } from '@imtbl/sdk'; +import { x } from '@imtbl/sdk'; export const DisconnectButton = () => { const { state, dispatch } = useContext(AppCtx); const disconnect = async () => { - await provider.MetaMaskIMXProvider.disconnect(); + await x.MetaMaskIMXProvider.disconnect(); dispatch({ payload: { diff --git a/packages/x-provider/src/sample-app/src/Components/sign-message.tsx b/packages/x-provider/src/sample-app/src/Components/sign-message.tsx index 4bf7dc05a5..851958380e 100644 --- a/packages/x-provider/src/sample-app/src/Components/sign-message.tsx +++ b/packages/x-provider/src/sample-app/src/Components/sign-message.tsx @@ -8,7 +8,7 @@ import { Heading, } from '@biom3/react'; import { ChangeEvent, useContext, useState } from 'react'; -import { provider } from '@imtbl/sdk'; +import { x } from '@imtbl/sdk'; export const SignMessage = () => { const { state, dispatch } = useContext(AppCtx); @@ -34,7 +34,7 @@ export const SignMessage = () => { }; const sign = async () => { - const signedMessage = await provider.MetaMaskIMXProvider.signMessage(signMessage); + const signedMessage = await x.MetaMaskIMXProvider.signMessage(signMessage); dispatch({ payload: { type: Actions.MetaMaskIMXProviderSignMessage, diff --git a/packages/x-provider/src/sample-app/src/Context/app-context.ts b/packages/x-provider/src/sample-app/src/Context/app-context.ts index 7e7e3bf013..3386a582b6 100644 --- a/packages/x-provider/src/sample-app/src/Context/app-context.ts +++ b/packages/x-provider/src/sample-app/src/Context/app-context.ts @@ -1,8 +1,8 @@ import { createContext } from 'react'; -import { provider, config } from '@imtbl/sdk'; +import { x, config } from '@imtbl/sdk'; export interface AppState { - metaMaskIMXProvider: provider.MetaMaskIMXProvider | null; + metaMaskIMXProvider: x.MetaMaskIMXProvider | null; address: string; signedMessage: string; env: string; @@ -51,7 +51,7 @@ export interface SetEnvironment { export interface MetaMaskIMXProviderConnected { type: Actions.MetaMaskIMXProviderConnected; - metaMaskIMXProvider: provider.MetaMaskIMXProvider; + metaMaskIMXProvider: x.MetaMaskIMXProvider; address: string; }