From 092be8199135fb140b739b4749e473cd86d606b4 Mon Sep 17 00:00:00 2001 From: Daniel Izdebski Date: Sat, 2 Dec 2023 19:37:18 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=EF=B8=8F=20chore:=20Add=20`@synthe?= =?UTF-8?q?tixio`=20prefix=20to=20packages=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/package.json | 4 ++-- packages/fixtures/package.json | 6 +++--- packages/fixtures/src/fixtures/testWithSynpress.ts | 6 +++--- pnpm-lock.yaml | 10 +++++----- wallets/metamask/package.json | 14 +++++++------- wallets/metamask/src/prepareExtension.ts | 2 +- .../metamask/test/e2e/metamask/addNetwork.spec.ts | 2 +- .../test/e2e/metamask/addNewAccount.spec.ts | 2 +- .../test/e2e/metamask/connectToDapp.spec.ts | 2 +- .../test/e2e/metamask/goBackToHomePage.spec.ts | 2 +- .../metamask/importWalletFromPrivateKey.spec.ts | 2 +- wallets/metamask/test/e2e/metamask/lock.spec.ts | 2 +- .../test/e2e/metamask/openSettings.spec.ts | 2 +- .../test/e2e/metamask/openSidebarMenu.spec.ts | 2 +- .../test/e2e/metamask/switchAccount.spec.ts | 2 +- .../test/e2e/metamask/switchNetwork.spec.ts | 2 +- ...ggleDismissSecretRecoveryPhraseReminder.spec.ts | 2 +- .../e2e/metamask/toggleShowTestNetworks.spec.ts | 2 +- wallets/metamask/test/e2e/metamask/unlock.spec.ts | 2 +- wallets/metamask/test/e2e/testWithMetaMask.ts | 2 +- .../metamask/test/e2e/wallet-setup/basic.setup.ts | 2 +- .../test/e2e/wallet-setup/connected.setup.ts | 4 ++-- .../metamask/test/unit/prepareExtension.test.ts | 4 ++-- 23 files changed, 40 insertions(+), 40 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 2ec1f2ad4..a0c76cfc2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { - "name": "core", - "version": "1.0.0", + "name": "@synthetixio/synpress-core", + "version": "0.0.1", "type": "module", "exports": { ".": { diff --git a/packages/fixtures/package.json b/packages/fixtures/package.json index 0dd56c4aa..a38c94fa8 100644 --- a/packages/fixtures/package.json +++ b/packages/fixtures/package.json @@ -1,6 +1,6 @@ { - "name": "fixtures", - "version": "1.0.0", + "name": "@synthetixio/synpress-fixtures", + "version": "0.0.1", "type": "module", "exports": { ".": { @@ -28,8 +28,8 @@ "types:check": "tsc --noEmit" }, "dependencies": { + "@synthetixio/synpress-core": "workspace:*", "@viem/anvil": "^0.0.6", - "core": "workspace:*", "fs-extra": "^11.1.1", "zod": "^3.22.4" }, diff --git a/packages/fixtures/src/fixtures/testWithSynpress.ts b/packages/fixtures/src/fixtures/testWithSynpress.ts index af3333b5a..908d6cade 100644 --- a/packages/fixtures/src/fixtures/testWithSynpress.ts +++ b/packages/fixtures/src/fixtures/testWithSynpress.ts @@ -8,10 +8,10 @@ import type { PlaywrightWorkerOptions } from '@playwright/test' import { chromium, test as base } from '@playwright/test' +import { defineWalletSetup } from '@synthetixio/synpress-core' +import { createTempContextDir, removeTempContextDir } from '@synthetixio/synpress-core' +import { CACHE_DIR_NAME, prepareExtension } from '@synthetixio/synpress-core' import { type Anvil, type CreateAnvilOptions, createPool } from '@viem/anvil' -import { defineWalletSetup } from 'core' -import { createTempContextDir, removeTempContextDir } from 'core' -import { CACHE_DIR_NAME, prepareExtension } from 'core' import fs from 'fs-extra' import { getExtensionId } from '../utils/getExtensionId' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62f6cc4c9..ee17faf0c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -134,12 +134,12 @@ importers: '@playwright/test': specifier: 1.40.0 version: 1.40.0 + '@synthetixio/synpress-core': + specifier: workspace:* + version: link:../core '@viem/anvil': specifier: ^0.0.6 version: 0.0.6 - core: - specifier: workspace:* - version: link:../core fs-extra: specifier: ^11.1.1 version: 11.1.1 @@ -192,10 +192,10 @@ importers: wallets/metamask: dependencies: - core: + '@synthetixio/synpress-core': specifier: workspace:* version: link:../../packages/core - fixtures: + '@synthetixio/synpress-fixtures': specifier: workspace:* version: link:../../packages/fixtures zod: diff --git a/wallets/metamask/package.json b/wallets/metamask/package.json index b87d7da6e..4e7cccbf3 100644 --- a/wallets/metamask/package.json +++ b/wallets/metamask/package.json @@ -1,6 +1,6 @@ { - "name": "metamask", - "version": "1.0.0", + "name": "@synthetixio/synpress-metamask", + "version": "0.0.1", "type": "module", "exports": { ".": { @@ -18,9 +18,9 @@ ], "scripts": { "build": "pnpm run clean && pnpm run build:dist && pnpm run build:types", - "build:cache": "core test/e2e/wallet-setup", - "build:cache:headless": "core test/e2e/wallet-setup --headless", - "build:cache:headless:force": "core test/e2e/wallet-setup --headless --force", + "build:cache": "synpress-core test/e2e/wallet-setup", + "build:cache:headless": "synpress-core test/e2e/wallet-setup --headless", + "build:cache:headless:force": "synpress-core test/e2e/wallet-setup --headless --force", "build:dist": "tsup --tsconfig tsconfig.build.json", "build:types": "tsc --emitDeclarationOnly --project tsconfig.build.json", "clean": "rimraf dist types", @@ -33,8 +33,8 @@ "types:check": "tsc --noEmit" }, "dependencies": { - "core": "workspace:*", - "fixtures": "workspace:*", + "@synthetixio/synpress-core": "workspace:*", + "@synthetixio/synpress-fixtures": "workspace:*", "zod": "^3.22.4" }, "devDependencies": { diff --git a/wallets/metamask/src/prepareExtension.ts b/wallets/metamask/src/prepareExtension.ts index 754baad8e..3dae3de38 100644 --- a/wallets/metamask/src/prepareExtension.ts +++ b/wallets/metamask/src/prepareExtension.ts @@ -1,4 +1,4 @@ -import { downloadFile, ensureCacheDirExists, unzipArchive } from 'core' +import { downloadFile, ensureCacheDirExists, unzipArchive } from '@synthetixio/synpress-core' export const DEFAULT_METAMASK_VERSION = '11.6.3' export const EXTENSION_DOWNLOAD_URL = `https://github.com/MetaMask/metamask-extension/releases/download/v${DEFAULT_METAMASK_VERSION}/metamask-chrome-${DEFAULT_METAMASK_VERSION}.zip` diff --git a/wallets/metamask/test/e2e/metamask/addNetwork.spec.ts b/wallets/metamask/test/e2e/metamask/addNetwork.spec.ts index ef06e6257..b15b745d0 100644 --- a/wallets/metamask/test/e2e/metamask/addNetwork.spec.ts +++ b/wallets/metamask/test/e2e/metamask/addNetwork.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { z } from 'zod' import { MetaMask, unlockForFixture } from '../../../src' import { waitFor } from '../../../src/utils/waitFor' diff --git a/wallets/metamask/test/e2e/metamask/addNewAccount.spec.ts b/wallets/metamask/test/e2e/metamask/addNewAccount.spec.ts index 010a40390..c5a43b207 100644 --- a/wallets/metamask/test/e2e/metamask/addNewAccount.spec.ts +++ b/wallets/metamask/test/e2e/metamask/addNewAccount.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/connectToDapp.spec.ts b/wallets/metamask/test/e2e/metamask/connectToDapp.spec.ts index b7c43023b..3c983dde7 100644 --- a/wallets/metamask/test/e2e/metamask/connectToDapp.spec.ts +++ b/wallets/metamask/test/e2e/metamask/connectToDapp.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/goBackToHomePage.spec.ts b/wallets/metamask/test/e2e/metamask/goBackToHomePage.spec.ts index b4e3bfa7b..4992628d4 100644 --- a/wallets/metamask/test/e2e/metamask/goBackToHomePage.spec.ts +++ b/wallets/metamask/test/e2e/metamask/goBackToHomePage.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/importWalletFromPrivateKey.spec.ts b/wallets/metamask/test/e2e/metamask/importWalletFromPrivateKey.spec.ts index 2a636dd3b..b6b17ce51 100644 --- a/wallets/metamask/test/e2e/metamask/importWalletFromPrivateKey.spec.ts +++ b/wallets/metamask/test/e2e/metamask/importWalletFromPrivateKey.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/lock.spec.ts b/wallets/metamask/test/e2e/metamask/lock.spec.ts index 62a9dc3d2..b8d2305af 100644 --- a/wallets/metamask/test/e2e/metamask/lock.spec.ts +++ b/wallets/metamask/test/e2e/metamask/lock.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/openSettings.spec.ts b/wallets/metamask/test/e2e/metamask/openSettings.spec.ts index c1528b72c..7971af119 100644 --- a/wallets/metamask/test/e2e/metamask/openSettings.spec.ts +++ b/wallets/metamask/test/e2e/metamask/openSettings.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/openSidebarMenu.spec.ts b/wallets/metamask/test/e2e/metamask/openSidebarMenu.spec.ts index 8c9b59f90..2b31b2a07 100644 --- a/wallets/metamask/test/e2e/metamask/openSidebarMenu.spec.ts +++ b/wallets/metamask/test/e2e/metamask/openSidebarMenu.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/switchAccount.spec.ts b/wallets/metamask/test/e2e/metamask/switchAccount.spec.ts index a56b2ca0a..6365240de 100644 --- a/wallets/metamask/test/e2e/metamask/switchAccount.spec.ts +++ b/wallets/metamask/test/e2e/metamask/switchAccount.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/switchNetwork.spec.ts b/wallets/metamask/test/e2e/metamask/switchNetwork.spec.ts index b57bfb6ee..ad82f7ddc 100644 --- a/wallets/metamask/test/e2e/metamask/switchNetwork.spec.ts +++ b/wallets/metamask/test/e2e/metamask/switchNetwork.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts b/wallets/metamask/test/e2e/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts index 75edca1e5..4d7b13a8b 100644 --- a/wallets/metamask/test/e2e/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts +++ b/wallets/metamask/test/e2e/metamask/toggleDismissSecretRecoveryPhraseReminder.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import Selectors from '../../../src/pages/HomePage/selectors' diff --git a/wallets/metamask/test/e2e/metamask/toggleShowTestNetworks.spec.ts b/wallets/metamask/test/e2e/metamask/toggleShowTestNetworks.spec.ts index d13da5d08..879628d52 100644 --- a/wallets/metamask/test/e2e/metamask/toggleShowTestNetworks.spec.ts +++ b/wallets/metamask/test/e2e/metamask/toggleShowTestNetworks.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import Selectors from '../../../src/pages/HomePage/selectors' diff --git a/wallets/metamask/test/e2e/metamask/unlock.spec.ts b/wallets/metamask/test/e2e/metamask/unlock.spec.ts index 8741e63f1..45f090c60 100644 --- a/wallets/metamask/test/e2e/metamask/unlock.spec.ts +++ b/wallets/metamask/test/e2e/metamask/unlock.spec.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../../src' import basicSetup from '../wallet-setup/basic.setup' diff --git a/wallets/metamask/test/e2e/testWithMetaMask.ts b/wallets/metamask/test/e2e/testWithMetaMask.ts index a4922480e..c190afc58 100644 --- a/wallets/metamask/test/e2e/testWithMetaMask.ts +++ b/wallets/metamask/test/e2e/testWithMetaMask.ts @@ -1,4 +1,4 @@ -import { testWithSynpress } from 'fixtures' +import { testWithSynpress } from '@synthetixio/synpress-fixtures' import { MetaMask, unlockForFixture } from '../../src' import connectedSetup from './wallet-setup/connected.setup' diff --git a/wallets/metamask/test/e2e/wallet-setup/basic.setup.ts b/wallets/metamask/test/e2e/wallet-setup/basic.setup.ts index ae0df552a..b70050461 100644 --- a/wallets/metamask/test/e2e/wallet-setup/basic.setup.ts +++ b/wallets/metamask/test/e2e/wallet-setup/basic.setup.ts @@ -1,4 +1,4 @@ -import { defineWalletSetup } from 'core' +import { defineWalletSetup } from '@synthetixio/synpress-core' import { MetaMask } from '../../../src' const SEED_PHRASE = 'test test test test test test test test test test test junk' diff --git a/wallets/metamask/test/e2e/wallet-setup/connected.setup.ts b/wallets/metamask/test/e2e/wallet-setup/connected.setup.ts index 0dc099d73..460570eaa 100644 --- a/wallets/metamask/test/e2e/wallet-setup/connected.setup.ts +++ b/wallets/metamask/test/e2e/wallet-setup/connected.setup.ts @@ -1,5 +1,5 @@ -import { defineWalletSetup } from 'core' -import { getExtensionId } from 'fixtures' +import { defineWalletSetup } from '@synthetixio/synpress-core' +import { getExtensionId } from '@synthetixio/synpress-fixtures' import { MetaMask } from '../../../src' const SEED_PHRASE = 'test test test test test test test test test test test junk' diff --git a/wallets/metamask/test/unit/prepareExtension.test.ts b/wallets/metamask/test/unit/prepareExtension.test.ts index ea4b9f604..982b9e97c 100644 --- a/wallets/metamask/test/unit/prepareExtension.test.ts +++ b/wallets/metamask/test/unit/prepareExtension.test.ts @@ -1,4 +1,4 @@ -import * as core from 'core' +import * as core from '@synthetixio/synpress-core' import { afterAll, afterEach, describe, expect, it, vi } from 'vitest' import { DEFAULT_METAMASK_VERSION, EXTENSION_DOWNLOAD_URL, prepareExtension } from '../../src/prepareExtension' @@ -6,7 +6,7 @@ const MOCK_CACHE_DIR_PATH = 'mockCacheDirPath' const MOCK_EXTENSION_ARCHIVE_PATH = 'mockExtensionArchivePath' const MOCK_EXTENSION_FINAL_PATH = 'mockExtensionFinalPath' -vi.mock('core', async () => { +vi.mock('@synthetixio/synpress-core', async () => { return { default: vi.fn(), ensureCacheDirExists: vi.fn().mockImplementation(() => MOCK_CACHE_DIR_PATH),