Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Franco Ponticelli
    @fponticelli
    and we could build a macro lib that add the versions from the package.json
    I already have one https://github.com/abedev/jsrequire that installs npm modules if needed
    Andreas
    @ciscoheat
    Franco Ponticelli
    @fponticelli
    I don't think it is
    abe/npm and hxexpress both use the new @:jsRequire()meta
    the jsrequire uses a macro to actually install the modules when they are not found
    Andreas
    @ciscoheat
    Ah yes, that's nice
    It creates a package.json?
    (or updates it)
    Franco Ponticelli
    @fponticelli
    it scans all the jsRequire, checks their existance and call npm install when needed
    it updates it and there is an option to create it
    if it doesn't exist and the option is off (default) it simply installs the modules
    Andreas
    @ciscoheat
    Great, it's very similar then, it's just that js-kit uses its own convention for the installation and versioning:
    // js/npm/MyPackage.hx
    package js.npm;
    extern class MyPackage
    implements npm.Package.Require<"my-package","^1.1.2">
    Franco Ponticelli
    @fponticelli
    cool
    Andreas
    @ciscoheat
    Do you manage specific versions in any way?
    Franco Ponticelli
    @fponticelli
    not at all
    Andreas
    @ciscoheat
    I'd prefer to use the @:jsRequire syntax for packages, as in the hxnodejs project, but the versioning in js-kit is quite nice.
    Franco Ponticelli
    @fponticelli
    it could be nice if you could do it at the function level
    you could achieve that with either -D or a custom meta
    Andreas
    @ciscoheat
    like the #if npm_express > 4.x ?
    Franco Ponticelli
    @fponticelli
    yup
    or
    @:npm_version("4.x")
    Andreas
    @ciscoheat
    I like it, as long as it's simple to also use the latest version with no effort.
    Franco Ponticelli
    @fponticelli
    not sure how the meta version could prevent you from using the wrong version ... maybe a warning
    Andreas
    @ciscoheat
    Ok, but it looks promising. But it will take some changes, especially in js-kit... @clemos what are you thoughts about that?
    It would be great to unify what we got in abe/js-kit, and include the utils in js-kit, I mean @async is awesome: https://github.com/clemos/haxe-js-kit#asynchronous-programming-experimental
    But will this end up in the deprecation of abenpm and js-kit, or will be keep going in one or the other?
    Franco Ponticelli
    @fponticelli
    I don't know :)
    I am massively using abe so I am not very keen on giving up on it unless it is almost a transparent replacement
    Andreas
    @ciscoheat
    It should be, since you're following the hxnodejs conventions, and that's the intention of js-kit as well I think.
    Andreas
    @ciscoheat
    @clemos when you have time, any thoughts? What do you think about moving to the new @:jsRequire syntax?
    Dion Amago Whitehead
    @dionjwa
    Is there a consensus on where we should add npm module externs?
    I have a bunch I'd like to make available, but I'm now no longer sure where to put them
    Franco Ponticelli
    @fponticelli
    I have a bunch as well in a project called npm
    Clément Charmet
    @clemos
    hey sorry I'm not too much into gitter :S
    anyway, I'm not too sure about conventions like @:npm_version
    I would like to see it implemented to see if it's viable in practice
    Also, I'm starting to somehow "doubt" about the workflow of rewriting package.json;
    I'm in the process of writing an haxe NPM package (https://github.com/clemos/npm-haxe)
    and I can't yet figure out how NPM and haxelib should work together
    anyway I guess I'm not too comfortable with rewriting package.json, I don't know
    Clément Charmet
    @clemos
    in any case, I guess a good idea would be to split the NPM / dependency management into another repo / lib
    so it can be used as a dependency by all projects
    then I guess we could implement both "ways" of "tagging" NPM dependencies in externs, so authors have choice
    then it's only a matter of not (over|re)writing each other's extern
    maybe -remap could help here, I don't know (so you can switch between different externs with same names)
    I must say I'm not too much into nodejs any more these days, but still into Haxe/JS more generally
    Clément Charmet
    @clemos
    also, still waiting for hxnodejs to be released so I can clean-up my repo a bit
    Clément Charmet
    @clemos