Mock __dirname via cjs import (#577)

* Mock __dirname via cjs import

* CHANGELOG
This commit is contained in:
Jaco
2021-12-31 14:07:43 +01:00
committed by GitHub
parent 757b138977
commit 0467c16bee
32 changed files with 150 additions and 4 deletions
+2 -1
View File
@@ -2,7 +2,8 @@
## master
- Allow for loading of accounts on additional specified hashes
- Allow for loading of accounts on additional genesisHashes
- Ensure package path is availble under ESM & CJS
## 0.87.7 Dec 27, 2021
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/react-identicon 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/react-identicon 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 settingsInfo } from '@polkadot/ui-settings/packageInfo';
import { packageInfo as sharedInfo } from '@polkadot/ui-shared/packageInfo';
import { detectPackage } from '@polkadot/util';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [settingsInfo, sharedInfo]);
+4 -1
View File
@@ -12,7 +12,10 @@
"type": "git",
"url": "https://github.com/polkadot-js/ui.git"
},
"sideEffects": false,
"sideEffects": [
"./detectPackage.js",
"./detectPackage.cjs"
],
"type": "module",
"version": "0.87.8-3",
"main": "index.js",
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/react-qr 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/react-qr 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"
}
+9
View File
@@ -0,0 +1,9 @@
// Copyright 2017-2021 @polkadot/react-qr authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { detectPackage } from '@polkadot/util';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, []);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/reactnative-identicon authors & contributors
// SPDX-License-Identifier: Apache-2.0
declare const __dirname: string | undefined;
export default __dirname;
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/reactnative-identicon authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = typeof __dirname === 'string'
? __dirname.replace('/cjs', '')
: undefined;
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
@@ -4,6 +4,7 @@
import { packageInfo as sharedInfo } from '@polkadot/ui-shared/packageInfo';
import { detectPackage } from '@polkadot/util';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [sharedInfo]);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/ui-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/ui-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 { packageInfo as settingsInfo } from '@polkadot/ui-settings/packageInfo';
import { detectPackage } from '@polkadot/util';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [settingsInfo]);
+4 -1
View File
@@ -12,7 +12,10 @@
"type": "git",
"url": "https://github.com/polkadot-js/ui.git"
},
"sideEffects": false,
"sideEffects": [
"./detectPackage.js",
"./detectPackage.cjs"
],
"type": "module",
"version": "0.87.8-3",
"main": "index.js",
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/ui-settings 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/ui-settings authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = typeof __dirname === 'string'
? __dirname.replace('/cjs', '')
: undefined;
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
@@ -0,0 +1,9 @@
// Copyright 2017-2021 @polkadot/ui-settings authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { detectPackage } from '@polkadot/util';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, []);
+4 -1
View File
@@ -12,7 +12,10 @@
"type": "git",
"url": "https://github.com/polkadot-js/ui.git"
},
"sideEffects": false,
"sideEffects": [
"./detectPackage.js",
"./detectPackage.cjs"
],
"type": "module",
"version": "0.87.8-3",
"main": "index.js",
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/ui-shared 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/ui-shared 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"
}
+9
View File
@@ -0,0 +1,9 @@
// Copyright 2017-2021 @polkadot/ui-shared authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { detectPackage } from '@polkadot/util';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, []);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/vue-identicon authors & contributors
// SPDX-License-Identifier: Apache-2.0
declare const __dirname: string | undefined;
export default __dirname;
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/vue-identicon authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = typeof __dirname === 'string'
? __dirname.replace('/cjs', '')
: undefined;
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
@@ -4,6 +4,7 @@
import { packageInfo as sharedInfo } from '@polkadot/ui-shared/packageInfo';
import { detectPackage } from '@polkadot/util';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [sharedInfo]);