Skip to content

Commit

Permalink
Updated to TypeScript 5, latest ESLint plugins, Prettier 3
Browse files Browse the repository at this point in the history
 (#48)
  • Loading branch information
steveluscher authored Jun 7, 2024
2 parents 59cea77 + 602977c commit a9e1577
Show file tree
Hide file tree
Showing 16 changed files with 1,246 additions and 545 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
"$schema": "https://unpkg.com/@changesets/config@3.0.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
Expand Down
17 changes: 17 additions & 0 deletions .changeset/stupid-snakes-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'wallet-standard': patch
'@wallet-standard/core': patch
'@wallet-standard/app': patch
'@wallet-standard/base': patch
'@wallet-standard/features': patch
'@wallet-standard/wallet': patch
'@wallet-standard/ethereum': patch
'@wallet-standard/ethereum-chains': patch
'@wallet-standard/experimental': patch
'@wallet-standard/experimental-features': patch
'@wallet-standard/react': patch
'@wallet-standard/react-core': patch
'@wallet-standard/test-config': patch
---

Updated to TypeScript 5, latest ESLint plugins, Prettier 3
30 changes: 12 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,31 @@
"deploy:docs": "pnpm run docs && gh-pages --dist docs --dotfiles"
},
"devDependencies": {
"@changesets/cli": "^2.25.0",
"@changesets/cli": "^2.27.5",
"@jest/types": "^30.0.0-alpha.3",
"@swc/jest": "^0.2.36",
"@types/chrome": "^0.0.195",
"@types/jest": "^29.5.12",
"@types/node": "^18.11.4",
"@types/react-test-renderer": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"@wallet-standard/test-config": "workspace:*",
"eslint": "8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-require-extensions": "^0.1.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-require-extensions": "^0.1.3",
"gh-pages": "^4.0.0",
"jest": "^30.0.0-alpha.3",
"jest-environment-jsdom": "^30.0.0-alpha.3",
"pnpm": "^7.14.0",
"prettier": "^2.7.1",
"prettier": "^3.2.5",
"react-test-renderer": "^18.3.1",
"shx": "^0.3.4",
"ts-node": "^10.9.2",
"typedoc": "^0.23.18",
"typescript": "~4.7.4"
},
"resolutions": {
"eslint": "8.22.0"
},
"overrides": {
"eslint": "8.22.0"
"typedoc": "^0.25.13",
"typescript": "^5"
}
}
3 changes: 2 additions & 1 deletion packages/core/app/tests/window.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Wallet, WalletAccount, WalletEventsWindow } from '@wallet-standard/base';
import { getWallets } from '..';

import { getWallets } from '../src/index';

type FooSignTransactionFeature = {
'foo:signTransaction': {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/base/tests/wallet.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Wallet, WalletAccount } from '..';
import type { Wallet, WalletAccount } from '../src/wallet.js';

class GlowWallet implements Wallet {
version = '1.0.0' as const;
Expand Down
10 changes: 1 addition & 9 deletions packages/core/features/tests/features.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import type { WalletAccount, WalletWithFeatures } from '@wallet-standard/base';
import {
StandardConnect,
StandardDisconnect,
StandardEvents,
type StandardConnectFeature,
type StandardDisconnectFeature,
type StandardEventsFeature,
type StandardFeatures,
} from '..';
import { StandardConnect, StandardDisconnect, StandardEvents, type StandardFeatures } from '../src/index';

type FooWalletFeature = {
'foo:': {
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum/chains/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export const ETHEREUM_GOERLI_CHAIN = 'ethereum:5';
export const ETHEREUM_CHAINS = [ETHEREUM_MAINNET_CHAIN, ETHEREUM_GOERLI_CHAIN] as const;

/** TODO: docs */
export type EthereumChain = typeof ETHEREUM_CHAINS[number];
export type EthereumChain = (typeof ETHEREUM_CHAINS)[number];
4 changes: 2 additions & 2 deletions packages/example/extension/src/background/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RPC } from '../messages';
import { CONTENT_PORT_NAME, createPortTransport, createRPC, POPUP_PORT_NAME } from '../messages';
import type { RPC } from '../messages/index';
import { CONTENT_PORT_NAME, createPortTransport, createRPC, POPUP_PORT_NAME } from '../messages/index';
import { asyncState } from '../utils/asyncState';
import { openPopup } from '../utils/popup';
import { getMnemonic, setMnemonic } from './storage';
Expand Down
2 changes: 1 addition & 1 deletion packages/example/extension/src/content/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CONTENT_PORT_NAME } from '../messages';
import { CONTENT_PORT_NAME } from '../messages/ports';
import { inject } from './utils';

const windowScript = new URL('./window.ts', import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion packages/example/extension/src/content/multiChainWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
import { ETHEREUM_MAINNET_CHAIN } from '@wallet-standard/ethereum';
import bs58 from 'bs58';
import { utils as ethUtils } from 'ethers';
import type { RPC } from '../messages';
import type { RPC } from '../messages/index';

export class EthereumWalletAccount implements WalletAccount {
readonly #publicKey: Uint8Array;
Expand Down
2 changes: 1 addition & 1 deletion packages/example/extension/src/content/window.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { registerWallet } from '@wallet-standard/core';
import { createRPC, createWindowTransport } from '../messages';
import { createRPC, createWindowTransport } from '../messages/index';
import { MultiChainWallet } from './multiChainWallet';

function register(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PublicKey as SolPublicKey } from '@solana/web3.js';
import { utils as ethUtils } from 'ethers';
import type { FC, ReactNode } from 'react';
import React, { useEffect, useState } from 'react';
import { rpc } from '../rpc';
import { rpc } from '../rpc/index';

export type Network = 'ethereum' | 'solana';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { FC } from 'react';
import React, { useState } from 'react';
import { condenseAddress } from '../../utils/address';
import { useAccounts } from '../hooks/useAccounts';
import { rpc } from '../rpc';
import { rpc } from '../rpc/index';

export type Network = 'ethereum' | 'solana';

Expand Down
2 changes: 1 addition & 1 deletion packages/example/extension/src/ui/popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { FC } from 'react';
import React, { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

import { AppContext } from './context';
import { AppContext } from './context/index';
import { ApproveConnection } from './pages/ApproveConnection';
import { Home } from './pages/Home';

Expand Down
2 changes: 1 addition & 1 deletion packages/example/extension/src/ui/rpc/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPortTransport, createRPC, POPUP_PORT_NAME } from '../../messages';
import { createPortTransport, createRPC, POPUP_PORT_NAME } from '../../messages/index';

const port = chrome.runtime.connect({ name: POPUP_PORT_NAME });

Expand Down
Loading

0 comments on commit a9e1577

Please sign in to comment.