Use .js imports in src (#1756)

* Use .js imports in src

* Revert node/test/node -> node/test/node.d.ts (for now)

* util-crypto

* Additional

* Adjust tsconfig aliases

* Bump dev
This commit is contained in:
Jaco
2023-03-09 11:04:03 +02:00
committed by GitHub
parent bcb7861d88
commit 9c224f5076
483 changed files with 1094 additions and 1088 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
import { extractGlobal } from '@polkadot/x-global';
import { TextDecoder as Fallback } from './fallback';
import { TextDecoder as Fallback } from './fallback.js';
export { packageInfo } from './packageInfo';
export { packageInfo } from './packageInfo.js';
export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', Fallback);
+1 -1
View File
@@ -3,7 +3,7 @@
/// <reference types="@polkadot/dev/node/test/node" />
import { TextDecoder } from './fallback';
import { TextDecoder } from './fallback.js';
describe('TextDecoder (fallback)', (): void => {
it('decodes correctly', (): void => {
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { packageInfo } from './packageInfo';
export { packageInfo } from './packageInfo.js';
const _TextDecoder = TextDecoder;
+1 -1
View File
@@ -13,7 +13,7 @@ describe('TextDecoder (node)', (): void => {
let TD: typeof TextDecoder;
beforeEach(async (): Promise<void> => {
const node = await import('./node');
const node = await import('./node.js');
TD = node.TextDecoder;
});
+1 -1
View File
@@ -5,6 +5,6 @@ import util from 'util';
import { extractGlobal } from '@polkadot/x-global';
export { packageInfo } from './packageInfo';
export { packageInfo } from './packageInfo.js';
export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', util.TextDecoder);
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2023 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { TextDecoder, packageInfo } from './browser';
export { TextDecoder, packageInfo } from './browser.js';
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2023 @polkadot/x-textdecoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TextDecoder as BrowserTD } from './browser';
import { TextDecoder as NodeTD } from './node';
import { TextDecoder as BrowserTD } from './browser.js';
import { TextDecoder as NodeTD } from './node.js';
console.log(new BrowserTD('utf-8').decode(new Uint8Array([1, 2, 3])));
console.log(new NodeTD('utf-8').decode(new Uint8Array([1, 2, 3])));