From da7d5a26d0feb4e6eafbb06a7fb51ffe1bcd9e38 Mon Sep 17 00:00:00 2001 From: kujtimprenkuSQA <95851345+kujtimprenkuSQA@users.noreply.github.com> Date: Thu, 9 Nov 2023 10:56:02 +0100 Subject: [PATCH] Remove default-wallets package. (#1005) --- package.json | 1 - packages/default-wallets/.babelrc | 10 --- packages/default-wallets/.eslintrc.json | 18 ----- packages/default-wallets/README.md | 68 ------------------- packages/default-wallets/jest.config.ts | 16 ----- packages/default-wallets/package.json | 22 ------ packages/default-wallets/project.json | 64 ----------------- packages/default-wallets/src/index.ts | 1 - .../src/lib/default-wallets.ts | 7 -- packages/default-wallets/tsconfig.json | 19 ------ packages/default-wallets/tsconfig.lib.json | 10 --- packages/default-wallets/tsconfig.spec.json | 9 --- scripts/release-packages.bash | 3 - tsconfig.base.json | 3 - 14 files changed, 251 deletions(-) delete mode 100644 packages/default-wallets/.babelrc delete mode 100644 packages/default-wallets/.eslintrc.json delete mode 100644 packages/default-wallets/README.md delete mode 100644 packages/default-wallets/jest.config.ts delete mode 100644 packages/default-wallets/package.json delete mode 100644 packages/default-wallets/project.json delete mode 100644 packages/default-wallets/src/index.ts delete mode 100644 packages/default-wallets/src/lib/default-wallets.ts delete mode 100644 packages/default-wallets/tsconfig.json delete mode 100644 packages/default-wallets/tsconfig.lib.json delete mode 100644 packages/default-wallets/tsconfig.spec.json diff --git a/package.json b/package.json index 4fb5891d3..b36f522c0 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ "build:finer-wallet": "nx run-many --target=build --projects=finer-wallet --configuration=production", "build:xdefi-wallet": "nx run-many --target=build --projects=xdefi --configuration=production", "build:wallet-utils": "nx run-many --target=build --projects=wallet-utils --configuration=production", - "build:default-wallets": "nx run-many --target=build --projects=default-wallets --configuration=production", "build:near-snap": "nx run-many --target=build --projects=near-snap --configuration=production", "build:account-export": "nx run-many --target=build --projects=account-export --configuration=production", "build:ramper-wallet": "nx run-many --target=build --projects=ramper-wallet --configuration=production", diff --git a/packages/default-wallets/.babelrc b/packages/default-wallets/.babelrc deleted file mode 100644 index b63f0528f..000000000 --- a/packages/default-wallets/.babelrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": [ - [ - "@nrwl/js/babel", - { - "useBuiltIns": "usage" - } - ] - ] -} diff --git a/packages/default-wallets/.eslintrc.json b/packages/default-wallets/.eslintrc.json deleted file mode 100644 index 9d9c0db55..000000000 --- a/packages/default-wallets/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/packages/default-wallets/README.md b/packages/default-wallets/README.md deleted file mode 100644 index c0b12e1b7..000000000 --- a/packages/default-wallets/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# @near-wallet-selector/default-wallets - -This is the Default Wallets package for NEAR Wallet Selector. - -This is the list of default wallets: - -> **⚠️ Package deprecated starting from `v8.1.4`. The package no longer holds a list of default wallets please install specific wallet packages from https://www.npmjs.com/org/near-wallet-selector ⚠️** - -## Installation and Usage - -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: - -```bash -# Using Yarn -yarn add near-api-js - -# Using NPM. -npm install near-api-js -``` -```bash -# Using Yarn -yarn add @near-wallet-selector/default-wallets - -# Using NPM. -npm install @near-wallet-selector/default-wallets -``` - -Then use it in your dApp: - -```ts -import { setupWalletSelector } from "@near-wallet-selector/core"; -import { setupDefaultWallets } from "@near-wallet-selector/default-wallets"; - -const selector = await setupWalletSelector({ - network: "testnet", - modules: await setupDefaultWallets(), -}); -``` - - -## Options - -The `setupDefaultWallets` does not take any options.
-You can override configuration for a wallet that is in the default list by including a customized instance of that wallet ahead of the default wallets in the `modules` array. - ->**Note**: In this case the customized wallet setup function must be placed **before** the `setupDefaultWallets` call. - -**Example** - -```ts -// The same can be done for MyNearWallet and Ledger too. -import { setupWalletSelector } from "@near-wallet-selector/core"; -import { setupDefaultWallets } from "@near-wallet-selector/default-wallets"; - -const selector = await setupWalletSelector({ - network: "testnet", - modules: [ - setupLedger({ - iconUrl: "your-custom-icon-url", - }), - ...(await setupDefaultWallets()) - ], -}); -``` - -## License - -This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0). diff --git a/packages/default-wallets/jest.config.ts b/packages/default-wallets/jest.config.ts deleted file mode 100644 index 448d8aa81..000000000 --- a/packages/default-wallets/jest.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable */ -export default { - displayName: "default-wallets", - preset: "../../jest.preset.js", - globals: {}, - transform: { - "^.+\\.[tj]s$": [ - "ts-jest", - { - tsconfig: "/tsconfig.spec.json", - }, - ], - }, - moduleFileExtensions: ["ts", "tsx", "js", "jsx"], - coverageDirectory: "../../coverage/packages/default-wallets", -}; diff --git a/packages/default-wallets/package.json b/packages/default-wallets/package.json deleted file mode 100644 index b64b5e09b..000000000 --- a/packages/default-wallets/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@near-wallet-selector/default-wallets", - "version": "8.7.1", - "description": "Default wallets package for NEAR Wallet Selector.", - "keywords": [ - "near", - "blockchain", - "wallets", - "dapps", - "near-protocol", - "near-blockchain", - "wallet selector" - ], - "repository": { - "type": "git", - "url": "https://github.com/near/wallet-selector.git" - }, - "bugs": { - "url": "https://github.com/near/wallet-selector/issues" - }, - "homepage": "https://github.com/near/wallet-selector/tree/main/packages/default-wallets" -} diff --git a/packages/default-wallets/project.json b/packages/default-wallets/project.json deleted file mode 100644 index fb118bee7..000000000 --- a/packages/default-wallets/project.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "default-wallets", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "packages/default-wallets/src", - "projectType": "library", - "targets": { - "build": { - "executor": "@nrwl/rollup:rollup", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/default-wallets", - "tsConfig": "packages/default-wallets/tsconfig.lib.json", - "project": "packages/default-wallets/package.json", - "entryFile": "packages/default-wallets/src/index.ts", - "buildableProjectDepsInPackageJsonType": "dependencies", - "compiler": "babel", - "format": ["esm", "cjs"], - "assets": [ - { - "glob": "packages/default-wallets/README.md", - "input": ".", - "output": "." - }, - { - "glob": "packages/default-wallets/assets/*", - "input": ".", - "output": "assets" - }, - { - "glob": "**/*", - "input": "packages/my-near-wallet/assets/", - "output": "assets/" - }, - { - "glob": "**/*", - "input": "packages/ledger/assets/", - "output": "assets/" - }, - { - "glob": "**/*", - "input": "packages/wallet-connect/assets/", - "output": "assets/" - } - ] - } - }, - "lint": { - "executor": "@nx/linter:eslint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": ["packages/default-wallets/**/*.ts"] - } - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/packages/default-wallets"], - "options": { - "jestConfig": "packages/default-wallets/jest.config.ts", - "passWithNoTests": true - } - } - }, - "tags": ["hardware-wallet"] -} diff --git a/packages/default-wallets/src/index.ts b/packages/default-wallets/src/index.ts deleted file mode 100644 index e77d7bc03..000000000 --- a/packages/default-wallets/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { setupDefaultWallets } from "./lib/default-wallets"; diff --git a/packages/default-wallets/src/lib/default-wallets.ts b/packages/default-wallets/src/lib/default-wallets.ts deleted file mode 100644 index ad779c082..000000000 --- a/packages/default-wallets/src/lib/default-wallets.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WalletModuleFactory } from "@near-wallet-selector/core"; - -export const setupDefaultWallets = async (): Promise< - Array -> => { - return []; -}; diff --git a/packages/default-wallets/tsconfig.json b/packages/default-wallets/tsconfig.json deleted file mode 100644 index 8b6d6acaf..000000000 --- a/packages/default-wallets/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true - }, - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" - } - ] -} diff --git a/packages/default-wallets/tsconfig.lib.json b/packages/default-wallets/tsconfig.lib.json deleted file mode 100644 index e85ef50f6..000000000 --- a/packages/default-wallets/tsconfig.lib.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "declaration": true, - "types": [] - }, - "include": ["**/*.ts"], - "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] -} diff --git a/packages/default-wallets/tsconfig.spec.json b/packages/default-wallets/tsconfig.spec.json deleted file mode 100644 index b506d384e..000000000 --- a/packages/default-wallets/tsconfig.spec.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "include": ["jest.config.ts", "**/*.spec.ts"] -} diff --git a/scripts/release-packages.bash b/scripts/release-packages.bash index e9db00837..610214207 100644 --- a/scripts/release-packages.bash +++ b/scripts/release-packages.bash @@ -27,6 +27,3 @@ npm publish dist/packages/xdefi --tag "${TAG}" --otp "${OTP}" npm publish dist/packages/near-snap --tag "${TAG}" --otp "${OTP}" npm publish dist/packages/ramper-wallet --tag "${TAG}" --otp "${OTP}" npm publish dist/packages/near-mobile-wallet --tag "${TAG}" --otp "${OTP}" - -# Commented script for default wallets to avoid publishing new versions since the package is now deprecated. -#npm publish dist/packages/default-wallets --tag "${TAG}" --otp "${OTP}" diff --git a/tsconfig.base.json b/tsconfig.base.json index 3800e7a84..3a79ff6b8 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -29,9 +29,6 @@ "@near-wallet-selector/core": [ "packages/core/src/index.ts" ], - "@near-wallet-selector/default-wallets": [ - "packages/default-wallets/src/index.ts" - ], "@near-wallet-selector/finer-wallet": [ "packages/finer-wallet/src/index.ts" ],