Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 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
  • Feb 11 02:07
    back2dos commented #48
  • Feb 10 14:13
    kevinresol commented #68
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".
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.