Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 14:22
    kevinresol labeled #160
  • 13:37
    cedx opened #160
  • Jun 07 16:07
    dpomier edited #158
  • Jun 07 08:01
    dpomier ready_for_review #158
  • Jun 05 21:20
    tjrhodes closed #159
  • Jun 05 21:20
    tjrhodes commented #159
  • Jun 05 19:45
    tjrhodes opened #159
  • May 29 15:31
    dpomier synchronize #158
  • May 29 15:28
    dpomier edited #158
  • May 29 15:24
    dpomier opened #158
  • May 25 05:36
    back2dos commented #156
  • May 24 20:10
    PXshadow commented #156
  • May 22 19:38
    cedx edited #157
  • May 22 19:36
    cedx opened #157
  • Apr 23 08:51
    kevinresol commented #152
  • Apr 23 08:45
    RichardBray commented #152
  • 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
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".
Peter Achberger
@Antriel
console.log debugging, it seems to add the credentials headers when looking up the git head, but it doesn't when trying to download the tar.
Kevin Leung
@kevinresol
I think gh-credentials is not preferred as it means that your credentials will be stored in the hxml thus tracked by version control
Peter Achberger
@Antriel
That's fine.
Kevin Leung
@kevinresol
That is not fine. This is the reason why the download url does not contain the credentials
I think it does include it some time in the past
Peter Achberger
@Antriel
I just need something simple that works. Don't wanna mess around with certs and keys and environment variables.
Kevin Leung
@kevinresol
but deliberately removed later
just use git+ssh
Peter Achberger
@Antriel
Especially not when the goal is to be able to do lix download on a different PC without having to setup anything.
Kevin Leung
@kevinresol
when you are using private repo you need to setup something
otherwise your private repo is leaked
Peter Achberger
@Antriel
And that's fine in my case, get access to one repo, can get access to others.
Lix doesn't support the git login thingy so the secret has to be in there somehow.
Kevin Leung
@kevinresol
I dunno. Maybe lix should support a flag telling it to write down the credentials in the hxml files
Peter Achberger
@Antriel
I'm gonna try that ssh/https way. Hopefully I figure it out. :D
Kevin Leung
@kevinresol
the idea of git+ssh is that your machine should be able to access all the private repo on is own
and on CI you really want a ssh key without passphrase