@2515097216/jimeng-free-api 0.8.8 → 0.8.10

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.
@@ -31,10 +31,29 @@ var Environment = class {
31
31
  this.package = _package;
32
32
  }
33
33
  };
34
+ function loadPackageJson() {
35
+ const cwdPkgPath = path.join(process.cwd(), "package.json");
36
+ if (fs.pathExistsSync(cwdPkgPath)) {
37
+ return JSON.parse(fs.readFileSync(cwdPkgPath).toString());
38
+ }
39
+ const entryFile = process.argv[1];
40
+ const entryDir = entryFile ? path.dirname(entryFile) : process.cwd();
41
+ const candidates = [
42
+ path.resolve(entryDir, "../package.json"),
43
+ path.resolve(entryDir, "../../package.json"),
44
+ path.resolve(entryDir, "../../../package.json")
45
+ ];
46
+ for (const p of candidates) {
47
+ if (fs.pathExistsSync(p)) {
48
+ return JSON.parse(fs.readFileSync(p).toString());
49
+ }
50
+ }
51
+ return {};
52
+ }
34
53
  var environment_default = new Environment({
35
54
  cmdArgs,
36
55
  envVars,
37
- package: JSON.parse(fs.readFileSync(path.join(path.resolve(), "package.json")).toString())
56
+ package: loadPackageJson()
38
57
  });
39
58
 
40
59
  // src/lib/configs/service-config.ts
@@ -5585,4 +5604,4 @@ export {
5585
5604
  generateSeedanceVideo,
5586
5605
  routes_default
5587
5606
  };
5588
- //# sourceMappingURL=chunk-KHOQ4PCS.js.map
5607
+ //# sourceMappingURL=chunk-Z45BIJT6.js.map