Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Mar 18 22:44
    Gama11 opened #70
  • Mar 07 06:55
    back2dos opened #69
  • Mar 02 16:23
    back2dos opened #156
  • Feb 11 21:37
    cedx commented #60
  • Feb 11 02:07
    back2dos commented #48
  • Feb 10 14:13
    kevinresol commented #68
  • Feb 10 14:09
    kevinresol labeled #48
  • Feb 10 14:09
    kevinresol commented #48
  • Feb 10 10:57
    cedx edited #155
  • Feb 10 10:55
    cedx edited #155
  • Feb 10 10:35
    cedx edited #155
  • Feb 10 10:32
    cedx opened #155
  • Dec 19 2020 12:11
    Aidan63 closed #83
  • Nov 27 2020 17:32
    back2dos closed #154
  • Nov 27 2020 17:32
    back2dos commented #154
  • Nov 27 2020 17:31
    back2dos commented #154
  • Nov 27 2020 17:11
    pawel-miczka opened #154
  • Nov 22 2020 14:02
    kevinresol commented #68
  • Nov 21 2020 21:15
    nulld opened #68
  • Nov 03 2020 12:32

    back2dos on master

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

Juraj Kirchheim
@back2dos
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);
    }
}
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.
Gabriel Hayes
@piboistudios
How do I resolve this issue again? I ran into this in the past and I can't remember what I did to deal with it, think it had to do with some lingering packages...
Error: Cannot find module 'C:\Users\gabri\AppData\Roaming\npm\node_modules\haxeshim\bin\nekoshim.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
(when running haxelib run <haxelib>)
Gabriel Hayes
@piboistudios
Well.. I just reinstalled haxeshim as a workaround but I'm pretty sure you guys deprecated that a long time ago
Can anyone shed light on how to completely remove dependence on haxeshim? I reinstalled Haxe completely and it still seems to be looking for haxeshim when using haxelib
Kevin Leung
@kevinresol
what is your lix version
Kevin Leung
@kevinresol
@back2dos is there a way to print out the path of the haxe folder/binary for current scope?
Kevin Leung
@kevinresol
ok I made this work finally lix run Kha html5
Juraj Kirchheim
@back2dos
\o/
Kevin Leung
@kevinresol
But I still need a easy way to get the path of the Haxe folder, preferably a variable usable in the @run directive
Because kha bundles it's own Haxe binary and I want to override it
Kevin Leung
@kevinresol
and need some way to customize the @run directive
Gabriel Hayes
@piboistudios
@kevinresol Sorry, Lix v is 15.9.1
But its a local install, I don't have a lix globally
Peter Achberger
@Antriel
If I would use postDownload hook to install some node modules into the library folder, is there some way to be able to require them when running node from the project folder?
Juraj Kirchheim
@back2dos
yes, but I wouldn't recommend that ... it's not really in line with how require works
instead, you should use postInstall to install the packages in the project folder
Peter Achberger
@Antriel
Yeah, I did end up deciding to do that. I really hate having node_modules in my Haxe projects, but I can live with that.
Just didn't yet manage to code it. :D The postInstall hook is not easy to test out, hehe.
6 replies
Just out of curiosity, how could I require them from the project cwd? I.e. how could I find out the haxelib directory?
9 replies
Peter Achberger
@Antriel
Hmm. Trying to use --gh-credentials, and it seems to work, as it finds the head commit hash, but doesn't download, just says "Not Found".