Mock __dirname, remove package detection (#955)
This commit is contained in:
@@ -6,6 +6,7 @@ Changes:
|
||||
|
||||
- Ensure that only latest metadata is applied (when multiple genesis)
|
||||
- Rename all `*.test.ts` to `*.spec.ts` (cross-repo consistency)
|
||||
- Ensure package path is availble under ESM & CJS
|
||||
|
||||
|
||||
## 0.42.4 Dec 27, 2021
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension-chains authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
declare const __dirname: string | undefined;
|
||||
|
||||
export default __dirname;
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension-chains authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
module.exports = typeof __dirname === 'string'
|
||||
? __dirname.replace('/cjs', '')
|
||||
: undefined;
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { packageInfo as dappInfo } from '@polkadot/extension-dapp/packageInfo';
|
||||
import { packageInfo as injectInfo } from '@polkadot/extension-inject/packageInfo';
|
||||
import { detectPackage } from '@polkadot/util';
|
||||
|
||||
import __dirname from './cjs/dirname';
|
||||
import { packageInfo } from './packageInfo';
|
||||
|
||||
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [chainsInfo, dappInfo, injectInfo]);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2019-2021 @polkadot/extension-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './detectPackage';
|
||||
// Since we inject into pages, we skip this
|
||||
// import './detectPackage';
|
||||
|
||||
export * from './bundle';
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension-chains authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
declare const __dirname: string | undefined;
|
||||
|
||||
export default __dirname;
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension-chains 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 injectInfo } from '@polkadot/extension-inject/packageInfo';
|
||||
import { detectPackage } from '@polkadot/util';
|
||||
|
||||
import __dirname from './cjs/dirname';
|
||||
import { packageInfo } from './packageInfo';
|
||||
|
||||
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [injectInfo]);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2019-2021 @polkadot/extension-chains authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './detectPackage';
|
||||
// Since we inject into pages, we skip this
|
||||
// import './detectPackage';
|
||||
|
||||
export * from './bundle';
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension-chains authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
declare const __dirname: string | undefined;
|
||||
|
||||
export default __dirname;
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension-chains 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 injectInfo } from '@polkadot/extension-inject/packageInfo';
|
||||
import { detectPackage } from '@polkadot/util';
|
||||
|
||||
import __dirname from './cjs/dirname';
|
||||
import { packageInfo } from './packageInfo';
|
||||
|
||||
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [injectInfo]);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2019-2020 @polkadot/extension-compat-metamask authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './detectPackage';
|
||||
// Since we inject into pages, we skip this
|
||||
// import './detectPackage';
|
||||
|
||||
export * from './bundle';
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension-dapp authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
declare const __dirname: string | undefined;
|
||||
|
||||
export default __dirname;
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension-dapp 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 injectInfo } from '@polkadot/extension-inject/packageInfo';
|
||||
import { detectPackage } from '@polkadot/util';
|
||||
|
||||
import __dirname from './cjs/dirname';
|
||||
import { packageInfo } from './packageInfo';
|
||||
|
||||
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [injectInfo]);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2019-2021 @polkadot/extension-dapp authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './detectPackage';
|
||||
// Since we inject into pages, we skip this
|
||||
// import './detectPackage';
|
||||
|
||||
export * from './bundle';
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension-inject authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
declare const __dirname: string | undefined;
|
||||
|
||||
export default __dirname;
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension-inject authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
module.exports = typeof __dirname === 'string'
|
||||
? __dirname.replace('/cjs', '')
|
||||
: undefined;
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import { detectPackage } from '@polkadot/util';
|
||||
|
||||
import __dirname from './cjs/dirname';
|
||||
import { packageInfo } from './packageInfo';
|
||||
|
||||
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, []);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2019-2021 @polkadot/extension-inject authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './detectPackage';
|
||||
// Since we inject into pages, we skip this
|
||||
// import './detectPackage';
|
||||
|
||||
export * from './bundle';
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
declare const __dirname: string | undefined;
|
||||
|
||||
export default __dirname;
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/extension authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
module.exports = typeof __dirname === 'string'
|
||||
? __dirname.replace('/cjs', '')
|
||||
: undefined;
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import { detectPackage } from '@polkadot/util';
|
||||
|
||||
import __dirname from './cjs/dirname';
|
||||
import { packageInfo } from './packageInfo';
|
||||
|
||||
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, []);
|
||||
|
||||
Reference in New Issue
Block a user