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
+1 -1
View File
@@ -28,7 +28,7 @@
"@babel/core": "^7.12.10",
"@babel/register": "^7.12.10",
"@babel/runtime": "^7.12.5",
"@polkadot/dev": "^0.61.7",
"@polkadot/dev": "^0.61.8",
"@polkadot/ts": "^0.3.58",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^26.0.19",
+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 };
+35 -35
View File
@@ -314,17 +314,17 @@ __metadata:
languageName: node
linkType: hard
"@babel/helper-validator-identifier@npm:^7.10.4":
version: 7.10.4
resolution: "@babel/helper-validator-identifier@npm:7.10.4"
checksum: 25098ef842e3ffecdd9a7216f6173da7ad7be1b0b3e454a9f6965055154b9ad7a4acd2f218ba3d2efc0821bdab97837b3cb815844af7d72f66f89d446a54efc6
"@babel/helper-validator-identifier@npm:^7.10.4, @babel/helper-validator-identifier@npm:^7.12.11":
version: 7.12.11
resolution: "@babel/helper-validator-identifier@npm:7.12.11"
checksum: 18de432203264b501db2690b53370a4289dc56084f5a2c66de624b159ee28b8abaeb402b2b7584296d9261645d91ddb6bfd21125d3ffd9bf02e9262e77baf3d2
languageName: node
linkType: hard
"@babel/helper-validator-option@npm:^7.12.1":
version: 7.12.1
resolution: "@babel/helper-validator-option@npm:7.12.1"
checksum: 5d9a8f67500baf464151d15ca281388e7272ed22e3b909e13ccff89b2b4cc83a3e29972f9feaacb8a372e749028b252187982a59c6e6944ce30e0d15d905ab5c
"@babel/helper-validator-option@npm:^7.12.1, @babel/helper-validator-option@npm:^7.12.11":
version: 7.12.11
resolution: "@babel/helper-validator-option@npm:7.12.11"
checksum: c0a861e95f4f24ed59535c28206f62e639404db873473886ec77b50fef53e21111b4093522838927b79be768a885ad2007086b2434353b9d2b89b891ca14028a
languageName: node
linkType: hard
@@ -788,14 +788,14 @@ __metadata:
languageName: node
linkType: hard
"@babel/plugin-transform-block-scoping@npm:^7.12.1":
version: 7.12.1
resolution: "@babel/plugin-transform-block-scoping@npm:7.12.1"
"@babel/plugin-transform-block-scoping@npm:^7.12.11":
version: 7.12.11
resolution: "@babel/plugin-transform-block-scoping@npm:7.12.11"
dependencies:
"@babel/helper-plugin-utils": ^7.10.4
peerDependencies:
"@babel/core": ^7.0.0-0
checksum: 067f8b55a32ba53c7bc61e730f0a2dd063ee377afea88e153e9b8bd8069d666df3106b80777e37e418d14a21cabd1dee0f7dabfe8cb038d5080d9e332a202e36
checksum: 6bc227619d7890724eec691e53859914a5420be3f8225cc8901dc839aed05697014a241e81125c541a8b5f7ac2ffc639aab645ec26484ffba696eab2cb7c8c02
languageName: node
linkType: hard
@@ -1206,15 +1206,15 @@ __metadata:
languageName: node
linkType: hard
"@babel/preset-env@npm:^7.12.10":
version: 7.12.10
resolution: "@babel/preset-env@npm:7.12.10"
"@babel/preset-env@npm:^7.12.11":
version: 7.12.11
resolution: "@babel/preset-env@npm:7.12.11"
dependencies:
"@babel/compat-data": ^7.12.7
"@babel/helper-compilation-targets": ^7.12.5
"@babel/helper-module-imports": ^7.12.5
"@babel/helper-plugin-utils": ^7.10.4
"@babel/helper-validator-option": ^7.12.1
"@babel/helper-validator-option": ^7.12.11
"@babel/plugin-proposal-async-generator-functions": ^7.12.1
"@babel/plugin-proposal-class-properties": ^7.12.1
"@babel/plugin-proposal-dynamic-import": ^7.12.1
@@ -1243,7 +1243,7 @@ __metadata:
"@babel/plugin-transform-arrow-functions": ^7.12.1
"@babel/plugin-transform-async-to-generator": ^7.12.1
"@babel/plugin-transform-block-scoped-functions": ^7.12.1
"@babel/plugin-transform-block-scoping": ^7.12.1
"@babel/plugin-transform-block-scoping": ^7.12.11
"@babel/plugin-transform-classes": ^7.12.1
"@babel/plugin-transform-computed-properties": ^7.12.1
"@babel/plugin-transform-destructuring": ^7.12.1
@@ -1273,12 +1273,12 @@ __metadata:
"@babel/plugin-transform-unicode-escapes": ^7.12.1
"@babel/plugin-transform-unicode-regex": ^7.12.1
"@babel/preset-modules": ^0.1.3
"@babel/types": ^7.12.10
"@babel/types": ^7.12.11
core-js-compat: ^3.8.0
semver: ^5.5.0
peerDependencies:
"@babel/core": ^7.0.0-0
checksum: 1fe64a0943dac09eb0f19cdea8af8a9906e2ae65cacef3ad33847a012392b92d51c3152697da906e8397a3a1b9fa773bd28c05e54091078099d0193abf8d7d66
checksum: 2811bbf697d86d2d7d972215cf07e4b153cb667eefa2ca3521e0eb34c20d3f2643c44ed31734e1db35675267f5a3de284b87e543132f075c28c979b34af6472c
languageName: node
linkType: hard
@@ -1377,14 +1377,14 @@ __metadata:
languageName: node
linkType: hard
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.10.4, @babel/types@npm:^7.10.5, @babel/types@npm:^7.11.0, @babel/types@npm:^7.12.1, @babel/types@npm:^7.12.10, @babel/types@npm:^7.12.5, @babel/types@npm:^7.12.7, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3":
version: 7.12.10
resolution: "@babel/types@npm:7.12.10"
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.10.4, @babel/types@npm:^7.10.5, @babel/types@npm:^7.11.0, @babel/types@npm:^7.12.1, @babel/types@npm:^7.12.10, @babel/types@npm:^7.12.11, @babel/types@npm:^7.12.5, @babel/types@npm:^7.12.7, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3":
version: 7.12.11
resolution: "@babel/types@npm:7.12.11"
dependencies:
"@babel/helper-validator-identifier": ^7.10.4
"@babel/helper-validator-identifier": ^7.12.11
lodash: ^4.17.19
to-fast-properties: ^2.0.0
checksum: 4f791b6788397d38eba9d4ee7e019e2f88ab337ae331da69d6f4d5d5b26d40c25a47a92f2b0c2025cf856455728fa9d9a79bb046f6f998c491375453822ae2ea
checksum: e592c52b097da2c56f7388f35bf84a267c88e0e1bd7d3b7730892a8c70b2a80bd7f67a2ee57b2acf6aee58a074a234214d3e43ff6968dfb834733aa1417a5a43
languageName: node
linkType: hard
@@ -1736,9 +1736,9 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/dev@npm:^0.61.7":
version: 0.61.7
resolution: "@polkadot/dev@npm:0.61.7"
"@polkadot/dev@npm:^0.61.8":
version: 0.61.8
resolution: "@polkadot/dev@npm:0.61.8"
dependencies:
"@babel/cli": ^7.12.10
"@babel/core": ^7.12.10
@@ -1756,7 +1756,7 @@ __metadata:
"@babel/plugin-syntax-top-level-await": ^7.12.1
"@babel/plugin-transform-regenerator": ^7.12.1
"@babel/plugin-transform-runtime": ^7.12.10
"@babel/preset-env": ^7.12.10
"@babel/preset-env": ^7.12.11
"@babel/preset-react": ^7.12.10
"@babel/preset-typescript": ^7.12.7
"@babel/register": ^7.12.10
@@ -1767,7 +1767,7 @@ __metadata:
"@vue/component-compiler-utils": ^3.2.0
babel-jest: ^26.6.3
babel-plugin-module-extension-resolver: ^1.0.0-rc.1
babel-plugin-module-resolver: ^4.0.0
babel-plugin-module-resolver: ^4.1.0
babel-plugin-styled-components: ^1.12.0
browserslist: ^4.16.0
chalk: ^4.1.0
@@ -1825,7 +1825,7 @@ __metadata:
polkadot-exec-typedoc: scripts/polkadot-exec-typedoc.cjs
polkadot-exec-vuepress: scripts/polkadot-exec-vuepress.cjs
polkadot-exec-webpack: scripts/polkadot-exec-webpack.cjs
checksum: 7be9f1bf2049f1ad6994667294a40eafbd707afea07e4e63dc6eca9e18542d874a7de696580a6ca0dc716143376a63ee7a156e0074b2e500833c08b96ab7d770
checksum: 241bc06d7d0602e1c6b21082e744e681323640f39c74aaf9d62d8404c44d105553fd01bb1b82e9e460c4b03b26ae586cabf89c83f460db059b01264f1fec0bbe
languageName: node
linkType: hard
@@ -2939,16 +2939,16 @@ __metadata:
languageName: node
linkType: hard
"babel-plugin-module-resolver@npm:^4.0.0":
version: 4.0.0
resolution: "babel-plugin-module-resolver@npm:4.0.0"
"babel-plugin-module-resolver@npm:^4.1.0":
version: 4.1.0
resolution: "babel-plugin-module-resolver@npm:4.1.0"
dependencies:
find-babel-config: ^1.2.0
glob: ^7.1.6
pkg-up: ^3.1.0
reselect: ^4.0.0
resolve: ^1.13.1
checksum: ac50e01ef09f1dc506e250e852dcfb49c0cd0e7e5bf02b3f3d1de7c51ccda8bf34fa63bc9a698c098004a15d91efcc65517397ae90209c9c23b7778b83235ce3
checksum: c3efeaac63b63761d253408c120469b13817ae00d05f5ba6f8d25bcb5970affe42b01aabb91db63332993796ece1f57a3680d66317523484bc57ba479e720e89
languageName: node
linkType: hard
@@ -9196,7 +9196,7 @@ fsevents@~2.1.2:
"@babel/core": ^7.12.10
"@babel/register": ^7.12.10
"@babel/runtime": ^7.12.5
"@polkadot/dev": ^0.61.7
"@polkadot/dev": ^0.61.8
"@polkadot/ts": ^0.3.58
"@polkadot/typegen": "workspace:packages/typegen"
"@types/jest": ^26.0.19