@module-federation/third-party-dts-extractor
Advanced tools
Comparing version 0.0.0-next-20240401084119 to 0.0.0-next-20240401122911
@@ -7,2 +7,3 @@ declare class ThirdPartyExtractor { | ||
constructor(destDir: string, context?: string); | ||
addPkgs(pkgName: string, dirName: string): void; | ||
inferPkgDir(importPath: string): string | void; | ||
@@ -9,0 +10,0 @@ collectPkgs(str: string): void; |
@@ -21,2 +21,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { | ||
// packages/third-party-dts-extractor/src/ThirdPartyExtractor.ts | ||
var ignoredPkgs = ["typescript"]; | ||
var ThirdPartyExtractor = class { | ||
@@ -29,2 +30,8 @@ constructor(destDir, context = process.cwd()) { | ||
} | ||
addPkgs(pkgName, dirName) { | ||
if (ignoredPkgs.includes(pkgName)) { | ||
return; | ||
} | ||
this.pkgs[pkgName] = dirName; | ||
} | ||
inferPkgDir(importPath) { | ||
@@ -51,6 +58,6 @@ if (this.pkgs[importPath]) { | ||
if (types) { | ||
this.pkgs[pkg.name] = dir; | ||
this.addPkgs(pkg.name, dir); | ||
return dir; | ||
} else if (_fsextra2.default.existsSync(_path2.default.resolve(dir, "index.d.ts"))) { | ||
this.pkgs[pkg.name] = dir; | ||
this.addPkgs(pkg.name, dir); | ||
return dir; | ||
@@ -66,3 +73,3 @@ } else { | ||
_fsextra2.default.readFileSync(typedPkgJsonPath, "utf-8"); | ||
this.pkgs[typedPkgName] = typedDir; | ||
this.addPkgs(typedPkgName, typedDir); | ||
return typedDir; | ||
@@ -69,0 +76,0 @@ } |
{ | ||
"name": "@module-federation/third-party-dts-extractor", | ||
"version": "0.0.0-next-20240401084119", | ||
"version": "0.0.0-next-20240401122911", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "dist/", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
11596
260