@module-federation/third-party-dts-extractor 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +8 -0
- package/dist/index.js +10 -3
- package/dist/index.mjs +10 -3
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
@@ -19,6 +19,9 @@ function getTypedName(name) {
|
|
19
19
|
|
20
20
|
// packages/third-party-dts-extractor/src/ThirdPartyExtractor.ts
|
21
21
|
var ignoredPkgs = ["typescript"];
|
22
|
+
var isNodeUtils = (pkgJsonPath, importPath) => {
|
23
|
+
return pkgJsonPath === importPath;
|
24
|
+
};
|
22
25
|
var ThirdPartyExtractor = class {
|
23
26
|
constructor(destDir, context = process.cwd()) {
|
24
27
|
this.destDir = destDir;
|
@@ -43,9 +46,13 @@ var ThirdPartyExtractor = class {
|
|
43
46
|
return;
|
44
47
|
}
|
45
48
|
try {
|
46
|
-
const
|
47
|
-
|
48
|
-
);
|
49
|
+
const importEntry = __require.resolve(importPath, {
|
50
|
+
paths: [this.context]
|
51
|
+
});
|
52
|
+
if (isNodeUtils(importEntry, importPath)) {
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
const pkgJsonPath = _findpkg2.default.sync(importEntry);
|
49
56
|
const dir = _path2.default.dirname(pkgJsonPath);
|
50
57
|
const pkg = JSON.parse(_fsextra2.default.readFileSync(pkgJsonPath, "utf-8"));
|
51
58
|
const types = pkg.types || pkg.typings;
|
package/dist/index.mjs
CHANGED
@@ -19,6 +19,9 @@ function getTypedName(name) {
|
|
19
19
|
|
20
20
|
// packages/third-party-dts-extractor/src/ThirdPartyExtractor.ts
|
21
21
|
var ignoredPkgs = ["typescript"];
|
22
|
+
var isNodeUtils = (pkgJsonPath, importPath) => {
|
23
|
+
return pkgJsonPath === importPath;
|
24
|
+
};
|
22
25
|
var ThirdPartyExtractor = class {
|
23
26
|
constructor(destDir, context = process.cwd()) {
|
24
27
|
this.destDir = destDir;
|
@@ -43,9 +46,13 @@ var ThirdPartyExtractor = class {
|
|
43
46
|
return;
|
44
47
|
}
|
45
48
|
try {
|
46
|
-
const
|
47
|
-
|
48
|
-
);
|
49
|
+
const importEntry = __require.resolve(importPath, {
|
50
|
+
paths: [this.context]
|
51
|
+
});
|
52
|
+
if (isNodeUtils(importEntry, importPath)) {
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
const pkgJsonPath = findPkg.sync(importEntry);
|
49
56
|
const dir = path.dirname(pkgJsonPath);
|
50
57
|
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
51
58
|
const types = pkg.types || pkg.typings;
|
package/dist/package.json
CHANGED