__dirname mock (#1344)

* __dirname mock

* CHANGELOG
This commit is contained in:
Jaco
2021-12-31 11:43:13 +02:00
committed by GitHub
parent d40331f3f3
commit 5b36029cb2
17 changed files with 65 additions and 0 deletions
+1
View File
@@ -3,6 +3,7 @@
Changes:
- Pin `@noble/hashes` to 0.5.5, 0.5.6 version is broken for rollup
- Ensure package path is availble under ESM & CJS
- Add all known Rococo genesis hashes
- Upgrade 3rd party dependencies
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
declare const __dirname: string | undefined;
export default __dirname;
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = typeof __dirname === 'string'
? __dirname.replace('/cjs', '')
: undefined;
+3
View File
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
+1
View File
@@ -4,6 +4,7 @@
import { packageInfo as transportInfo } from '@polkadot/hw-ledger-transports/packageInfo';
import { detectPackage, packageInfo as utilInfo } from '@polkadot/util';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [transportInfo, utilInfo]);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
declare const __dirname: string | undefined;
export default __dirname;
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = typeof __dirname === 'string'
? __dirname.replace('/cjs', '')
: undefined;
+3
View File
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
+1
View File
@@ -4,6 +4,7 @@
import { detectPackage, packageInfo as utilInfo } from '@polkadot/util';
import { packageInfo as cryptoInfo } from '@polkadot/util-crypto/packageInfo';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [utilInfo, cryptoInfo]);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
declare const __dirname: string | undefined;
export default __dirname;
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = typeof __dirname === 'string'
? __dirname.replace('/cjs', '')
: undefined;
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
@@ -5,6 +5,7 @@ import { packageInfo as netInfo } from '@polkadot/networks/packageInfo';
import { detectPackage, packageInfo as utilInfo } from '@polkadot/util';
import { packageInfo as randomInfo } from '@polkadot/x-randomvalues';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [netInfo, utilInfo, randomInfo]);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
declare const __dirname: string | undefined;
export default __dirname;
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = typeof __dirname === 'string'
? __dirname.replace('/cjs', '')
: undefined;
+3
View File
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
+1
View File
@@ -19,6 +19,7 @@
import { packageInfo as decoderInfo } from '@polkadot/x-textdecoder';
import { packageInfo as encoderInfo } from '@polkadot/x-textencoder';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
import { detectPackage } from './versionDetect';