Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into chore/TD-1577-bulk-listing-scw
Browse files Browse the repository at this point in the history
  • Loading branch information
naveen-imtb committed Aug 7, 2024
2 parents b224cd8 + 5447a9e commit 984dbbc
Show file tree
Hide file tree
Showing 26 changed files with 511 additions and 227 deletions.
39 changes: 39 additions & 0 deletions .github/actions/setup-playwright/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Playwright setup"
description: "Install the browsers and dependencies for Playwright to run"

runs:
using: "composite"
steps:
- name: Playwright versions in sync check
shell: bash
run: |
versions=$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://')
unique_versions=$(echo "$versions" | sort | uniq)
if [ $(echo "$unique_versions" | wc -l) -ne 1 ]; then
echo "Playwright versions are not in sync:"
echo "$unique_versions"
exit 1
else
echo "All Playwright versions are in sync."
fi
- name: Get Playwright version
shell: bash
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('playwright/package.json').version)")" >> $GITHUB_ENV

- name: Cache Playwright Browsers
id: cache-playwright-browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ runner.os }}-${{ env.PLAYWRIGHT_VERSION }}

- name: Install Playwright with dependencies
shell: bash
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: yarn dlx playwright@${{ env.PLAYWRIGHT_VERSION }} install --with-deps

- name: Install Playwright dependencies
shell: bash
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
run: yarn dlx playwright@${{ env.PLAYWRIGHT_VERSION }} install-deps
6 changes: 6 additions & 0 deletions .github/scripts/check-docs-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ if [ -d "$CLONE_DIR/api-docs/sdk-references/ts-immutable-sdk/$VERSION" ]; then
echo "There is already a docs folder for v$VERSION. Please create a separate PR to update the SDK reference docs for v$VERSION."
exit 1
fi

# check the version contains `alpha` string
if echo "$VERSION" | grep -q "alpha"; then
echo "Skipping docs generation for alpha version"
exit 1
fi
9 changes: 6 additions & 3 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
build-examples:
name: Build Examples
needs: build-sdk
runs-on: ubuntu-latest-4-cores
runs-on: ubuntu-latest-8-cores
env:
NODE_OPTIONS: --max-old-space-size=14366
steps:
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
test-examples:
name: Test Examples
needs: build-sdk
runs-on: ubuntu-latest-4-cores
runs-on: ubuntu-latest-8-cores
env:
NODE_OPTIONS: --max-old-space-size=14366
steps:
Expand All @@ -178,6 +178,9 @@ jobs:
- name: Setup examples
uses: ./.github/actions/setup-examples

- name: Setup playwright
uses: ./.github/actions/setup-playwright

- name: Test examples
run: yarn test:examples

Expand Down Expand Up @@ -217,7 +220,7 @@ jobs:

func-test-zkevm:
name: zkevm func tests
runs-on: ubuntu-latest-4-cores
runs-on: ubuntu-latest-8-cores
needs: build-sdk
env:
ZKEVM_ORDERBOOK_BANKER: ${{ secrets.ZKEVM_ORDERBOOK_BANKER }}
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ jobs:
VERSION=$(git describe --tags --abbrev=0)
if echo "$VERSION" | grep -q "alpha"; then
echo "Skipping docs generation for alpha version"
echo "is_alpha=true" >> $GITHUB_ENV
echo "is_alpha=true" >> $GITHUB_OUTPUT
exit 0
else
echo "Generating docs for non-alpha version"
echo "is_alpha=false" >> $GITHUB_ENV
echo "is_alpha=false" >> $GITHUB_OUTPUT
fi
shell: bash

PublishDocs:
name: Publish SDK Reference Docs
runs-on: ubuntu-latest
needs: AlphaCheck
# if: ${{ needs.AlphaCheck.outputs.is_alpha == 'false' }}
if: ${{ needs.AlphaCheck.outputs.is_alpha == 'false' }}
env:
SDK_PUBLISH_SLACK_WEBHOOK: ${{ secrets.SDK_PUBLISH_SLACK_WEBHOOK }}
NETLIFY_BUILD_HOOK: ${{ secrets.NETLIFY_BUILD_HOOK }}
Expand Down Expand Up @@ -87,12 +87,6 @@ jobs:
node-version-file: .nvmrc
cache: "yarn"

- name: Update SDK package.json version
run: |
tmp=$(mktemp)
jq '.version = "${{ env.VERSION }}"' ./package.json > "$tmp" && mv "$tmp" ./package.json
shell: bash

- name: Restore cached node_modules
id: restore-cache-node_modules
uses: actions/cache@v4
Expand All @@ -107,6 +101,12 @@ jobs:
- name: Build
run: export NODE_OPTIONS=--max-old-space-size=6144 && yarn build

- name: Update SDK package.json version
run: |
tmp=$(mktemp)
jq '.version = "${{ env.VERSION }}"' ./sdk/package.json > "$tmp" && mv "$tmp" ./sdk/package.json
shell: bash

- name: Build SDK Docs
run: yarn docs:build

Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
if: ${{ success() && steps.docs_push.conclusion == 'success' && steps.netlify_build.conclusion == 'success' && steps.netlify_deploy.conclusion == 'success' }}
uses: ./.github/actions/notify-slack-publish-status
with:
message: "✅ SDK reference documents published successfully - https://docs.immutable.com/sdk-references/ts-immutable-sdk/${{ env.VERSION }}/modules/_imtbl_sdk.html\n\n>*`${{ env.GITHUB_USER }}` Please ensure you and the team updated all Sample Code + Guides on the <https://docs.immutable.com|imx-docs site> to reflect the change.*"
message: "✅ SDK reference documents published successfully - https://docs.immutable.com/sdk-references/ts-immutable-sdk/${{ env.VERSION }}/\n\n>*`${{ env.GITHUB_USER }}` Please ensure you and the team updated all Sample Code + Guides on the <https://docs.immutable.com|imx-docs site> to reflect the change.*"

- name: Notify SDK Slack Docs Publish Failure
if: ${{ failure() && steps.docs_version_check.conclusion == 'success' }}
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Example of the base level of testing required can be found in `/examples/passpor
Add the test runner to the scripts in your package.json

```
"test": "playwright install --with-deps && playwright test"
"test": "playwright test"
```

Run your tests with `yarn test`
2 changes: 1 addition & 1 deletion examples/passport/identity-with-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"dev": "next dev",
"lint": "next lint",
"start": "next start",
"test": "playwright install --with-deps && playwright test"
"test": "playwright test"
}
}
2 changes: 1 addition & 1 deletion examples/passport/wallets-connect-with-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"dev": "next dev",
"lint": "eslint app --ext .js,.jsx,.ts,.tsx",
"start": "next start",
"test": "playwright install --with-deps && playwright test"
"test": "playwright test"
}
}
2 changes: 1 addition & 1 deletion examples/passport/wallets-signing-with-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"dev": "next dev",
"lint": "next lint",
"start": "next start",
"test": "playwright install --with-deps && playwright test"
"test": "playwright test"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"dev": "next dev",
"lint": "next lint",
"start": "next start",
"test": "playwright install --with-deps && playwright test"
"test": "playwright test"
}
}
1 change: 1 addition & 0 deletions packages/checkout/sdk/src/postMessageHandler/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './postMessageHandler';
export * from './postMessageEventTypes';
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export enum PostMessageHandlerEventType {
SYN = 'IMTBL_POST_MESSAGE_SYN',
ACK = 'IMTBL_POST_MESSAGE_ACK',
PROVIDER_RELAY = 'IMTBL_PROVIDER_RELAY',
EIP_6963_EVENT = 'IMTBL_EIP_6963_EVENT',
WIDGET_EVENT = 'IMTBL_CHECKOUT_WIDGET_EVENT',
}

export type PostMessageProviderRelayData = any;

export type PostMessageEIP6963Data = any;

export type PostMessagePayload =
| PostMessageProviderRelayData
| PostMessageEIP6963Data;
Loading

0 comments on commit 984dbbc

Please sign in to comment.