Skip to content

Commit

Permalink
Update to nightly build.
Browse files Browse the repository at this point in the history
Update libraries.
Disable testing in eval target. Macro-in-macro error. #6
Add hashlink target.
Closes #5
  • Loading branch information
skial committed Nov 15, 2018
1 parent ea94ba2 commit 65fcde8
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .haxerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.0.0-preview.2",
"version": "c0b6767",
"resolveLibs": "scoped"
}
6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

6 changes: 0 additions & 6 deletions .vscode/tasks.json

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ Regle is a collection of utilities that generate ids.
Regle currently contains:

- An [Hashids] port that generates short, unique, non-sequential ids from numbers.
+ To access the original `uhx.uid` Hashids implementation add `-D uhx_hashids`. The lib `hashids` by @kevinresol has better expanded tests.
- An [Optimus] port that obfuscates ids based on Knuth's multiplicative hashing method.

## Installation

You need to install the following libraries from HaxeLib and GitHub.

1. yaml - `haxelib install yaml`
2. regle - `haxelib git regle https://github.com/skial/regle master src`
2. hashids - `haxelib git hashids https://github.com/kevinresol/hashids master src`
3. regle - `haxelib git regle https://github.com/skial/regle master src`

Then in your `.hxml` file, add `-lib regle` and you're set.

Expand Down
3 changes: 3 additions & 0 deletions haxe_libraries/hashids.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-D hashids=1.0.0
# @install: lix --silent download "gh://github.com/kevinresol/hashids#f9dfd8146301503220fc2cf56b4e13c160fd4a18" into hashids/1.0.0/github/f9dfd8146301503220fc2cf56b4e13c160fd4a18
-cp ${HAXE_LIBCACHE}/hashids/1.0.0/github/f9dfd8146301503220fc2cf56b4e13c160fd4a18/src
3 changes: 0 additions & 3 deletions haxe_libraries/hxcs.hxml

This file was deleted.

6 changes: 6 additions & 0 deletions haxe_libraries/hxnodejs.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-D hxnodejs=6.9.0
# @install: lix --silent download "gh://github.com/haxefoundation/hxnodejs#877a80e7f1f96218f7f3fbf8f37ffc2a7f42e1bd" into hxnodejs/6.9.0/github/877a80e7f1f96218f7f3fbf8f37ffc2a7f42e1bd
-cp ${HAXE_LIBCACHE}/hxnodejs/6.9.0/github/877a80e7f1f96218f7f3fbf8f37ffc2a7f42e1bd/src
--macro allowPackage('sys')
# should behave like other target defines and not be defined in macro context
--macro define('nodejs')
4 changes: 2 additions & 2 deletions haxe_libraries/random.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "haxelib:random#1.4.1" into random/1.4.1/haxelib
-D random=1.4.1
-cp ${HAXESHIM_LIBCACHE}/random/1.4.1/haxelib/src/
# @install: lix --silent download "haxelib:/random#1.4.1" into random/1.4.1/haxelib
-cp ${HAXE_LIBCACHE}/random/1.4.1/haxelib/src/
6 changes: 3 additions & 3 deletions haxe_libraries/tink_core.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "https://github.com/haxetink/tink_core/archive/41187d54224fe8adab5d93018831700fd9bd41d8.tar.gz" into tink_core/1.15.2/github/41187d54224fe8adab5d93018831700fd9bd41d8
-D tink_core=1.15.2
-cp ${HAXESHIM_LIBCACHE}/tink_core/1.15.2/github/41187d54224fe8adab5d93018831700fd9bd41d8/src
-D tink_core=1.18.0
# @install: lix --silent download "gh://github.com/haxetink/tink_core#7b5acdbc54ddcd27bbdd5fcebd666c4ad150426e" into tink_core/1.18.0/github/7b5acdbc54ddcd27bbdd5fcebd666c4ad150426e
-cp ${HAXE_LIBCACHE}/tink_core/1.18.0/github/7b5acdbc54ddcd27bbdd5fcebd666c4ad150426e/src
6 changes: 3 additions & 3 deletions haxe_libraries/utest.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "haxelib:utest#1.7.2" into utest/1.7.2/haxelib
-D utest=1.7.2
-cp ${HAXESHIM_LIBCACHE}/utest/1.7.2/haxelib/src
-D utest=1.9.0
# @install: lix --silent download "haxelib:/utest#1.9.0" into utest/1.9.0/haxelib
-cp ${HAXE_LIBCACHE}/utest/1.9.0/haxelib/src
4 changes: 2 additions & 2 deletions haxe_libraries/yaml.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "haxelib:yaml#1.3.0" into yaml/1.3.0/haxelib
-D yaml=1.3.0
-cp ${HAXESHIM_LIBCACHE}/yaml/1.3.0/haxelib/
# @install: lix --silent download "haxelib:/yaml#1.3.0" into yaml/1.3.0/haxelib
-cp ${HAXE_LIBCACHE}/yaml/1.3.0/haxelib/
10 changes: 8 additions & 2 deletions regle.hxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
-lib utest
-lib random
-lib tink_core
-lib hashids

-cp src
-cp tests

-dce full

-debug
#-debug
-D analyzer-optimize

-main Main
Expand All @@ -19,6 +20,7 @@

--next

-lib hxnodejs
-js bin/regle.js

--next
Expand All @@ -39,6 +41,10 @@
-D php7
-php bin/php

#--next

#--macro Main.main()

--next

--macro Main.main()
-hl bin/regle.hl
6 changes: 5 additions & 1 deletion src/uhx/uid/Hashids.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package uhx.uid;

import yaml.util.Ints;

#if !uhx_hashids
typedef Hashids = hashids.Hashids;
#else
/**
* @author Skial Bainn
* Port of the JavaScript version of Hashids
Expand Down Expand Up @@ -239,4 +242,5 @@ class Hashids {
return Std.int( number );
}

}
}
#end
1 change: 1 addition & 0 deletions src/uhx/uid/Optimus.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Optimus {

public static var MAX_INT:Int64 = 2147483647.ofInt();


public static macro function make() {
var path = '${Sys.getCwd()}/.optimus'.normalize();
if (!sys.FileSystem.exists(path)) {
Expand Down

0 comments on commit 65fcde8

Please sign in to comment.