Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 22 14:02
    kevinresol commented #68
  • Nov 21 21:15
    nulld opened #68
  • Nov 03 12:32

    back2dos on master

    Update README.md Merge pull request #153 from Ri… (compare)

  • Nov 03 12:32
    back2dos closed #153
  • Nov 03 12:32
    back2dos commented #153
  • Nov 03 11:26
    RichardBray opened #153
  • Oct 31 11:31
    flammehawk opened #152
  • Oct 29 14:34

    kevinresol on master

    Guess cp for the kha ecosystem (compare)

  • Oct 29 13:01

    kevinresol on master

    Update haxeshim Release 15.10.1 (compare)

  • Oct 29 13:01

    kevinresol on v15.10.1

    (compare)

  • Oct 29 12:59

    kevinresol on master

    Fix shebang (compare)

  • Oct 29 12:54
    kevinresol closed #151
  • Oct 29 12:54

    kevinresol on master

    Closes #151 (compare)

  • Oct 29 12:52

    kevinresol on master

    Support main in haxelib.json (h… (compare)

  • Oct 29 12:07

    kevinresol on v15.10.0

    (compare)

  • Oct 29 12:07

    kevinresol on master

    Release 15.10.0 (compare)

  • Oct 29 12:06
    kevinresol closed #63
  • Oct 29 12:06

    kevinresol on master

    Update git submodules by defaul… (compare)

  • Oct 12 10:28
    nadako opened #151
  • Oct 12 10:24
    nadako commented #122
Philippe
@elsassph
Is there a shorthand to update a library to a specific version? Thinking about haxelib but also git tags.
Kevin Leung
@kevinresol
lib#ver
Juraj Kirchheim
@back2dos
please open an issue about the subfolder thing ;)
Philippe
@elsassph
I mean for the git lib tag, I have to specify the full git URL everytime I just want to point to another tag - that's... suboptimal
Juraj Kirchheim
@back2dos
where's a near-optimal solution we could steal? ^^
Philippe
@elsassph
Some set-version libname#1.2.3 maybe, which would intelligently work with haxelib and git tags? Alternatively wondering if the git tags handling could be smarter: the tag is translated into the commit hash, whike the tag shoukd be unique enough.
Kevin Leung
@kevinresol
lix install haxelib:lib#ver works already
lix install git:<url>#<hash/tag/branch> too
Philippe
@elsassph
Yes but I'd like to avoid putting the whole git URL just to switch branch/tag.
Juraj Kirchheim
@back2dos
tags can be modified, commit hashes can't
Philippe
@elsassph
Er well that would be silly but still, the point is could there be a shorthand to just change/update the repo to a branch/tag without writing the full qualified git URL.
Either using CLI or like npm where I can change the #branch in package.json and run npm install.
We use git repos heavily.
Juraj Kirchheim
@back2dos
yeah, my point hashes guarantee a specific state and tag names (which are really just branch names) don't, which is why lix uses those ... as does package-lock.json, by the way
Juraj Kirchheim
@back2dos
as for the rest, if editing a file and running a command is fine for you, you can just have a shell script with a bunch of lix install git:...#branch that you can edit and run ^^
Philippe
@elsassph
That kind of defeats using lix at all...
Juraj Kirchheim
@back2dos
if you say so
I'm confused what you're asking for ... I asked about a package manager that does what you want and the only example you've produced is editing a file by hand and then running a command ... this is already possible
Philippe
@elsassph
I can't just change the version in lix's generated hxml - the version appears half a dozen of times and I need to also update the commit hash. Eh nevermind I guess, it's visibly not a concern for you so I'll try to spec it and maybe propose a PR.
Juraj Kirchheim
@back2dos
well, I just type in stuff and when that becomes a nuisance, I make a script
e.g. you can put this into ./scripts/Git.hx:
package ;

import Sys.*;

class Git {
  static function main() 
    switch args() {
      case [repo, version]:
        exit(command('lix', ['install', 'git:some.domain/$repo.git#$version']));
      default:
        println('name and version required');
        exit(1);
    }
}
Juraj Kirchheim
@back2dos
and then lix Git somelib someversion will get the what you want (if I understand what you want)
Philippe
@elsassph
Look, I've been trying to convey that I'd like a built-in CLI option and you continue responding with variations of "type it or write a script" :D
Juraj Kirchheim
@back2dos
well, perhaps you should state your problem, rather than halfheartedly describing a feature ^^
I fail to see how lix set-version libname#1.2.3 solves a problem that e.g. lix Git libname 1.2.3 doesn't
Kevin Leung
@kevinresol
well I guess the issue of such solution is that you will have to copy the same script to every project?
Juraj Kirchheim
@back2dos
hmm, you can also make a lib called set-version and then lix set-version will call into that ... and you can make a lib that basically just bundles such "extensions" as dependencies
Kevin Leung
@kevinresol
using libs as lix extension seems quite practical
and interesting
Philippe
@elsassph
But I have stated the problem! For a git dependencies, a CLI option to change the branch/version of the dep without having to specify the git URL. I'm not sure how to describe it differently...
Now using a lib itself for that might be a solution. I'll explore that.
Philippe
@elsassph
I'm trying to dev an option in lix client but it's a bit of a hassle to run it locally from source...
lix download / npx lix download sometimes work, sometimes no. Once I got the build to work I tried to use it in another project using npm link and now building doesn't work with a
sh: /Users/philippe.elsass/.nvm/versions/node/v10.15.3/bin/haxe: Permission denied
I'm still probably going to use the run-lib approach eventually but I wanted to try how contributing would look like.
Kevin Leung
@kevinresol
usually I just run the built lix.js directly
sth like /path/lix.client/bin/lix.js build.hxml
Philippe
@elsassph
Ok. I had to npm unlink then npm install lix -g again for things to work
I'll use the direct path instead I guess :D
Philippe
@elsassph
Ok so I have a generic script of what I want:
import sys.io.File;
import sys.FileSystem;
import Sys.*;

class SetVersion {
    static function main()
        switch args() {
            case [name, version]:
                final path = './haxe_libraries/$name.hxml';
                if (!FileSystem.exists(path)) {
                    println('Library $name not found at $path');
                    exit(2);
                }
                final hxml = File.getContent(path);
                final reLib = new EReg('download "([^#]+)#[^"]+"');
                if (reLib.match(hxml)) {
                    final lib = reLib.matched(1);
                    exit(command('lix', ['install', '$lib#$version', 'as', name]));
                } else {
                    println('$path doesn\'t include a recognizable lix download URL pattern');
                    exit(1);
                }
            default:
                println('Name and version required');
                exit(1);
        }
}
Philippe
@elsassph
I would still favor something built in the lix client.
Emugel
@emugel
Philippe, just in case this hasn't been mentionned. Github URLs can be shortened as in ‘lix install gh:username/repo#tag‘, this saves about 19chars compared to the full url.
(In that case maybe it is not that painful, but if it's not github it wont help)
Kevin Leung
@kevinresol
that syntax uses the public http protocol to download a zip file, won't help if one wants to use the git protocol (e.g. for ssh auth, etc)
Philippe
@elsassph
@emugel thanks but our git repos aren't supported by lix
Philippe
@elsassph
Kevin Leung
@kevinresol
ok this seems to make lix works with Kha:
// khafile.js
function addLixLibrary(name) {
    for (line of require("fs").readFileSync(`haxe_libraries/${name}.hxml`).toString().split("\n"))
        project.addParameter(line);
}
Peter Achberger
@Antriel
I vaguely remember seeing some haxelib that had some postinstall thing for npm modules... anyone knows some example for this pattern?
I'm trying to keep my projects reproducible, and one more complex part is generating and processing css files. I'm thinking that it could be some separate haxelib that would generate the file based on given configuration, but for that it basically needs to have its own package.json and download npm stuff, etc.
I wonder how to approach it.