comfy-ts 2.18.1 → 2.19.0

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/index.js CHANGED
@@ -110,7 +110,7 @@ function createNodeStorage() {
110
110
  }
111
111
  //#endregion
112
112
  //#region package.json
113
- var version = "2.18.1";
113
+ var version = "2.19.0";
114
114
  //#endregion
115
115
  //#region src/litegraph/LiteGraphLinkID.ts
116
116
  const asLiteGraphLinkID = (id) => id;
@@ -8033,6 +8033,14 @@ function loraTag(name, strength = 1, clipStrength) {
8033
8033
  * package.json all the way up is a broken install and throws.
8034
8034
  */
8035
8035
  function bundledExamplesDir(moduleUrl = import.meta.url) {
8036
+ const pkgDir = comfyTsPackageDir(moduleUrl);
8037
+ if (pkgDir == null) return null;
8038
+ const examples = join(pkgDir, "examples");
8039
+ return existsSync(examples) ? examples : null;
8040
+ }
8041
+ /** the comfy-ts package root (the folder of its package.json), by the same walk: null when the
8042
+ * nearest named package is another one, a throw when no package.json is found at all */
8043
+ function comfyTsPackageDir(moduleUrl = import.meta.url) {
8036
8044
  let dir = dirname(fileURLToPath(moduleUrl));
8037
8045
  let prev = "";
8038
8046
  while (dir !== prev) {
@@ -8042,10 +8050,7 @@ function bundledExamplesDir(moduleUrl = import.meta.url) {
8042
8050
  try {
8043
8051
  pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
8044
8052
  } catch {}
8045
- if (pkg.name === "comfy-ts") {
8046
- const examples = join(dir, "examples");
8047
- return existsSync(examples) ? examples : null;
8048
- }
8053
+ if (pkg.name === "comfy-ts") return dir;
8049
8054
  if (pkg.name != null) return null;
8050
8055
  }
8051
8056
  prev = dir;