Allow detectPackage with import.meta.url (#2962)

* Allow detectPackage with import.meta.url

* Fix detectPackage import

* header naming
This commit is contained in:
Jaco Greeff
2020-12-16 15:46:02 +01:00
committed by GitHub
parent 9740c282d8
commit d6106b3253
11 changed files with 91 additions and 39 deletions
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2020 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import packageInfo from './package-info.json';
export { packageInfo };
+10
View File
@@ -0,0 +1,10 @@
// Copyright 2017-2020 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
const util = require('@polkadot/util');
const packageInfo = require('./package-info.json');
util.detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname);
exports.packageInfo = packageInfo;
@@ -5,6 +5,6 @@ import { detectPackage } from '@polkadot/util';
import packageInfo from './package-info.json';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname);
detectPackage(packageInfo, import.meta.url);
export { packageInfo };
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import packageInfo from './package-info.json';
export { packageInfo };
+10
View File
@@ -0,0 +1,10 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
const util = require('@polkadot/util');
const packageInfo = require('./package-info.json');
util.detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname);
exports.packageInfo = packageInfo;
@@ -5,4 +5,6 @@ import { detectPackage } from '@polkadot/util';
import packageInfo from './package-info.json';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname);
detectPackage(packageInfo, import.meta.url);
export { packageInfo };
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import packageInfo from './package-info.json';
export { packageInfo };
+10
View File
@@ -0,0 +1,10 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
const util = require('@polkadot/util');
const packageInfo = require('./package-info.json');
util.detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname);
exports.packageInfo = packageInfo;
@@ -5,4 +5,6 @@ import { detectPackage } from '@polkadot/util';
import packageInfo from './package-info.json';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname);
detectPackage(packageInfo, import.meta.url);
export { packageInfo };