Initial rebrand: @polkadot -> @pezkuwi (14 packages)

- Package namespace: @polkadot/* -> @pezkuwi/*
- Repository: polkadot-js/common -> pezkuwichain/pezkuwi-common
- Author: Pezkuwi Team <team@pezkuwichain.io>

Core packages:
- @pezkuwi/util (utilities)
- @pezkuwi/util-crypto (crypto primitives)
- @pezkuwi/keyring (account management)
- @pezkuwi/networks (chain metadata)
- @pezkuwi/hw-ledger (Ledger hardware wallet)
- @pezkuwi/x-* (10 polyfill packages)

Total: 14 packages
Upstream: polkadot-js/common v14.0.1
This commit is contained in:
2026-01-05 14:00:34 +03:00
commit ec06da0ebc
687 changed files with 48096 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
// Copyright 2017-2025 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { extractGlobal } from '@pezkuwi/x-global';
import { TextDecoder as Fallback } from './fallback.js';
export { packageInfo } from './packageInfo.js';
export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', Fallback);
@@ -0,0 +1,20 @@
// Copyright 2017-2025 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { TextDecoder } from './fallback.js';
describe('TextDecoder (fallback)', (): void => {
it('decodes correctly', (): void => {
expect(
new TextDecoder().decode(new Uint8Array([97, 98, 99]))
).toEqual('abc');
});
it('decodes correctly (with constructor param)', (): void => {
expect(
new TextDecoder('utf-8').decode(new Uint8Array([97, 98, 99, 98, 97]))
).toEqual('abcba');
});
});
+21
View File
@@ -0,0 +1,21 @@
// Copyright 2017-2025 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
// This is very limited, only handling Ascii values
export class TextDecoder {
__encoding?: string;
constructor (encoding?: 'utf-8' | 'utf8') {
this.__encoding = encoding;
}
decode (value: Uint8Array): string {
let result = '';
for (let i = 0, count = value.length; i < count; i++) {
result += String.fromCharCode(value[i]);
}
return result;
}
}
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2025 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './browser.js';
+25
View File
@@ -0,0 +1,25 @@
// Copyright 2017-2025 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { xglobal } from '@pezkuwi/x-global';
// @ts-expect-error Clearing this, it is obviously not valid in normal code
xglobal.TextDecoder = undefined;
describe('TextDecoder (node)', (): void => {
let TD: typeof TextDecoder;
beforeEach(async (): Promise<void> => {
const node = await import('./node.js');
TD = node.TextDecoder;
});
it('encodes correctly', (): void => {
expect(
new TD().decode(new Uint8Array([97, 98, 99]))
).toEqual('abc');
});
});
+10
View File
@@ -0,0 +1,10 @@
// Copyright 2017-2025 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
import util from 'node:util';
import { extractGlobal } from '@pezkuwi/x-global';
export { packageInfo } from './packageInfo.js';
export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', util.TextDecoder);
@@ -0,0 +1,6 @@
// Copyright 2017-2025 @polkadot/x-textdecoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/x-textdecoder', path: 'auto', type: 'auto', version: '14.0.1' };
@@ -0,0 +1,4 @@
// Copyright 2017-2025 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './browser.js';
+7
View File
@@ -0,0 +1,7 @@
// Copyright 2017-2025 @polkadot/x-textdecoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { exposeGlobal } from '@pezkuwi/x-global';
import { TextDecoder } from '@pezkuwi/x-textdecoder';
exposeGlobal('TextDecoder', TextDecoder);
+8
View File
@@ -0,0 +1,8 @@
// Copyright 2017-2025 @polkadot/x-textdecoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
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])));