Skip to content

Commit

Permalink
Remove relative imports from '.' path to avoid issues in bundlers
Browse files Browse the repository at this point in the history
  • Loading branch information
DeRain committed Nov 22, 2021
1 parent 86619be commit 9cab483
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 20 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ module.exports = {
{allowArgumentsExplicitlyTypedAsAny: true},
],
'@typescript-eslint/no-non-null-assertion': 'off',
'no-restricted-imports': ['error', {paths: ['..', '.', './', '../']}],
},
};
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 6.0.3
- Remove relative imports to avoid issues in bundlers. Restrict relative imports by adding eslint rule.

## 6.0.2
- `Resolution#owner` method doesn't throw an error in case of empty resolver

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unstoppabledomains/resolution",
"version": "6.0.2",
"version": "6.0.3",
"description": "Domain Resolution for blockchain domains",
"main": "./build/index.js",
"directories": {
Expand Down
5 changes: 0 additions & 5 deletions src/UdApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import {
NamingServiceName,
Api,
Locations,
DomainLocation,
BlockchainType,
} from './types/publicTypes';
import Networking from './utils/Networking';
import {constructRecords, findNamingServiceName, isNullAddress} from './utils';
Expand All @@ -27,9 +25,6 @@ export default class Udapi extends NamingService {
private readonly headers: {
[key: string]: string;
};
static readonly ZnsRegistryMap = {
1: 'zil1jcgu2wlx6xejqk9jw3aaankw6lsjzeunx2j0jz',
};

constructor(api?: Api) {
super();
Expand Down
4 changes: 3 additions & 1 deletion src/UnsInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import {
ProxyReaderMap,
NullAddress,
} from './types';
import {UnsLayerSource, ConfigurationError, ConfigurationErrorCode} from '.';
import {UnsLayerSource} from './types/publicTypes';
import ConfigurationError from './errors/configurationError';
import {ConfigurationErrorCode} from './errors/configurationError';
import {
BlockchainType,
DomainData,
Expand Down
7 changes: 3 additions & 4 deletions src/tests/UnsInternal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ import {
} from './helpers';
import {BlockchainType, UnsLocation} from '../types/publicTypes';
import {
ConfigurationError,
ConfigurationErrorCode,
ResolutionError,
ResolutionErrorCode,
} from '..';
ConfigurationError,
} from '../errors/configurationError';
import {ResolutionError, ResolutionErrorCode} from '../errors/resolutionError';
import {eip137Namehash, fromHexStringToDecimals} from '../utils/namehash';

let unsInternalL1: UnsInternal;
Expand Down
6 changes: 0 additions & 6 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import {Provider} from './publicTypes';

export type Dictionary<T> = {[k: string]: T};
export type EnsNetworkIdMap = {
[key: number]: string;
};
export interface BlockhainNetworkUrlMap {
[key: string]: string | undefined;
}
export interface ProxyReaderMap {
[key: string]: string;
}
export type NetworkIdMap = {
[key: number]: string;
};

export type ProviderParams = unknown[] | object;
export interface RequestArguments {
Expand Down
2 changes: 1 addition & 1 deletion src/types/publicTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
RequestArguments,
RpcProviderLogEntry,
TransactionRequest,
} from '.';
} from './index';

export type Api = {api: true; url?: string; network?: number};

Expand Down
2 changes: 1 addition & 1 deletion src/utils/TwitterSignatureValidator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {hexToBytes} from '.';
import {hexToBytes} from './index';
import {keccak256 as sha3} from 'js-sha3';
import {recover} from './recoverSignature';
import {fromHexStringToDecimals} from './namehash';
Expand Down
2 changes: 1 addition & 1 deletion src/utils/recoverSignature.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-undef */
import {keccak256 as sha3} from 'js-sha3';
import {hexToBytes} from '.';
import {hexToBytes} from './index';
import {ec} from 'elliptic';
const secp256k1 = new ec('secp256k1');

Expand Down

0 comments on commit 9cab483

Please sign in to comment.