github vava-nessa/free-coding-models v0.5.57

latest releases: v0.6.0, v0.5.99, v0.5.98...
3 months ago

Fixed

  • ๐Ÿ“ฆ patch-openclaw.js now finds sources.js in more locations (#35) โ€” when users copy just patch-openclaw.js to another directory (e.g. ~/.free-coding-models/) and run it, the static import './sources.js' failed with ERR_MODULE_NOT_FOUND because ESM resolves imports relative to the importer file at parse time. Switched to a runtime search over multiple candidate paths:

    1. Same directory as the script (primary โ€” FCM source / global install layout)
    2. Parent directory (covers tools/-style subdirs)
    3. Two levels up
    4. Three levels up
    5. process.cwd() (last-resort fallback)

    If none resolve, the script now prints a clear error pointing to the script's actual location and how to fix it, instead of a cryptic ERR_MODULE_NOT_FOUND.

Maintenance

  • ๐Ÿงช +1 unit test (test/patch-openclaw.test.js) locking in the search order so any future reordering is caught.
  • ๐Ÿงช 592/592 tests pass (pnpm test).
  • ๐Ÿงน vite build succeeds.

Why a top-level await import()?

ESM import './sources.js' is resolved at parse-time relative to the importer file's directory. There's no way to fall back at parse time, so the only way to support multiple candidate paths is to compute the path at runtime and use dynamic import(pathToFileURL(sourcesPath).href). Top-level await keeps the rest of the script's top-level statements unchanged.

Don't miss a new free-coding-models release

NewReleases is sending notifications on new releases.