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.cjs CHANGED
@@ -134,7 +134,7 @@ function createNodeStorage() {
134
134
  }
135
135
  //#endregion
136
136
  //#region package.json
137
- var version = "2.18.1";
137
+ var version = "2.19.0";
138
138
  //#endregion
139
139
  //#region src/litegraph/LiteGraphLinkID.ts
140
140
  const asLiteGraphLinkID = (id) => id;
@@ -8060,6 +8060,14 @@ function loraTag(name, strength = 1, clipStrength) {
8060
8060
  * package.json all the way up is a broken install and throws.
8061
8061
  */
8062
8062
  function bundledExamplesDir(moduleUrl = require("url").pathToFileURL(__filename).href) {
8063
+ const pkgDir = comfyTsPackageDir(moduleUrl);
8064
+ if (pkgDir == null) return null;
8065
+ const examples = (0, pathe.join)(pkgDir, "examples");
8066
+ return (0, node_fs.existsSync)(examples) ? examples : null;
8067
+ }
8068
+ /** the comfy-ts package root (the folder of its package.json), by the same walk: null when the
8069
+ * nearest named package is another one, a throw when no package.json is found at all */
8070
+ function comfyTsPackageDir(moduleUrl = require("url").pathToFileURL(__filename).href) {
8063
8071
  let dir = (0, pathe.dirname)((0, node_url.fileURLToPath)(moduleUrl));
8064
8072
  let prev = "";
8065
8073
  while (dir !== prev) {
@@ -8069,10 +8077,7 @@ function bundledExamplesDir(moduleUrl = require("url").pathToFileURL(__filename)
8069
8077
  try {
8070
8078
  pkg = JSON.parse((0, node_fs.readFileSync)(pkgPath, "utf8"));
8071
8079
  } catch {}
8072
- if (pkg.name === "comfy-ts") {
8073
- const examples = (0, pathe.join)(dir, "examples");
8074
- return (0, node_fs.existsSync)(examples) ? examples : null;
8075
- }
8080
+ if (pkg.name === "comfy-ts") return dir;
8076
8081
  if (pkg.name != null) return null;
8077
8082
  }
8078
8083
  prev = dir;