dsherret / dax

Cross-platform shell tools for Deno and Node.js inspired by zx.
MIT License
970 stars 33 forks source link

Make dax extension friendly #151

Closed sigmaSd closed 1 year ago

sigmaSd commented 1 year ago

which it seems already is, you can check here we were discussion ideas on how to extend it https://github.com/impactaky/dax_extras/issues/2#issuecomment-1605924938

import $ from "https://deno.land/x/dax@0.32.0/mod.ts";
import { addExtras } from "./vendor/raw.githubusercontent.com/impactaky/dax_extras/1.0.0/mod.ts";

addExtras($); // this will mutate it in place

the function idea seems to work, but we want to known the dax version so we can make a semver check on it,

do you think we can add a version prop to $ , so something like $.version = "0.32.0" / or current version

sigmaSd commented 1 year ago

@dsherret maybe if you have time you can check https://github.com/impactaky/dax_extras and share your thoughts

In particular is it a good idea to try to extend dax from another module, and is there a better way then the current approach

sigmaSd commented 1 year ago

Actually I like the latest idea https://github.com/impactaky/dax_extras/pull/25

We just put dax version at the suffix of dax extras version, and the user have to match them correctly

import $ from "https://deno.land/x/dax@0.32.0/mod.ts";
// the dax version used internally by dax extras is at the suffix
// it **must** match the dax version used
import "https://deno.land/x/dax_extras@2.2.0-0.32.0/mod.ts";