npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

haxe-travix

v0.11.2

Published

Travis helper for Haxe

Downloads

13

Readme

Travix - Travis CI helper for Haxe

Build Status

Are you tired of setting up Travis CI for all your projects? Then travix is for you! \o/

  1. Quickstart
  2. Building
  3. Using Travix in your code
  4. Reasons to use Travix
  5. Reasons not to use Travix
  6. How to use git version

Note: Since v0.11.0, Travix only supports Haxe 3.3+. If you need older Haxe, please use v0.10.5.

Quickstart

To use Travix within one of your libs, cd into your project root and execute:

haxelib install travix    # if it's not installed already
haxelib run travix init   # this will ask you to input the necessary information and create a .travis.yml file

From there, the setup should be straight forward.

Building

Travix has individual commands for building:

  • interp - run tests on interpreter
  • neko - run tests on neko
  • node - run tests on nodejs (with hxnodejs)
  • php - run tests on php
  • java - run tests on java
  • js - run tests on phantomjs
  • flash - run tests on flash (see instructions below)
  • python - run tests on python
  • cs - run tests on cs
  • cpp - run tests on cpp
  • lua - run tests on lua

So instead of having to have to define all kinds of builds and figuring out the right way to run them, this will do.

Using Travix in your code

There are differences among platforms about logging and exiting the process. For example, we run JS tests on PhantomJS where your test code needs to communicate with the Phantom host in some special ways in order to log or exit the process. And on Flash you need to use flash.Lib.trace and flash.system.System.exit(status).

In order to ease the pain, Travix provides a unified interface for these functionalities. Use them to instead of trace(), Sys.exit(), etc, for maximum compatibility across platforms

  • travix.Logger.print(string): Print a string without newline
  • travix.Logger.println(string): Print a string with newline
  • travix.Logger.exit(exitCode): Exit the process

If you don't want to introduce a hard compile dependency to Travix in your code for some reason, you can also use the travix.Logger in combination with the compile condition #if travix that will result in the travix.Logger being used when executing builds via travix but bypass it when executed without.

For example:

inline function println(v:String)
  #if travix
    travix.Logger.println(v);
  #elseif (flash || air || air3)
    flash.Lib.trace(v);
  #elseif (sys || nodejs)
    Sys.println(v);
  #else
    trace(v);
  #end

The BDD library Buddy has built-in support for flash and JS testing, so if you're using Buddy you don't even have to worry about the above.

Reasons to use Travix

Apart from helping the pathologically lazy to set up a CI, the strength of Travix lies in that it deals with dependencies rather gracefully:

  1. it relies on the haxelib.json to install haxelib dependencies. It also uses the haxelib dev command to "mount" your library as a haxelib, giving you all the extra features, e.g. the presense of your -D libname flag and the inclusion of extraParams.hxml in the build. This happens with the install command.
  2. it follows a fail-fast philosophy. What's that supposed to mean? Normally, in your CI, you will install all dependencies before running any of the tests. If you wait for the installation of hxjava, hxcpp, hxcs, mono and php, only to make your first test abort because of a missing semi-colon or a similarly silly mistake, it can be rather frustrating. To avoid that problem, Travix diverges from the usual modus operandi of having distinct installation and execution phases, and instead installs such dependencies right before execution, e.g. in the cs command.

Reasons not to use Travix

The motivation behind Travix is to be able to spin up CI setups quickly, for many small libraries (in my case the tink libs). It is very likely, that it will not scale up to bigger projects, particularly when multiple builds need to be run in unison to have a test. If you have suggestions - or better yet: pull requests - to make Travix more useful for such cases, you are highly welcome.

How to use git version

In your .travis.yml simply replace haxelib install travix with the following:

haxelib git travix https://github.com/back2dos/travix && pushd . && cd $(haxelib config)travix/git && haxe build-neko.hxml && popd