* Revert "Revert "Share node_modules for samples/js" (#1967)"
This reverts commit 7bb1623e99.
* Add parent directory to the PATH
* Change run-all-js-tests to run samples/js before samples/js/**
* Fix a temporary comment
This is so that we do not need to do npm install 10 times in the
samples directory. Instead we do it once inside samples/js and let
all the sub directories have no dependencies. This works because
nodejs searches the parent directories when looking for a module.
Towards #1888
Also remove test util code from the two simpler Go samples. I think
we will want to distinguish between "samples" and "utilities". The
former should be as easy to understand and lightweight as possible,
while the latter will tend to be more a real part of the project
that is maintained, tuned, relied upon, etc.
The former should only rely on the Noms SDK and the Go stdlib. The
latter should follow normal Noms internal coding conventions.
Instead of writing blobs using base64 we now write the values as
hex (16 per row)
Blob(00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f\n10)
Towards #1837
As one step towards #1819, we've created MapMutator, which can take a
bunch of (what would normally be) Map.Set() calls and batch them up to
be applied all at once. The keys and values are held in a LevelDB cache
until everything's done. Usage looks like this:
m := types.NewMap()
mx := m.Mx()
mx = mx.Set(String("foo"), String("bar")).Set(String("baz"), Number(42))
m = mx.Finish()
We intend to make this the only way to modify collections, but at first
this will only work on an empty NomsMap.
Previously when we had an ordered (set/map) prolly tree containing
non-ordered values (blobs/refs/etc), we'd put the ref of the largest
value in each meta node, complete with its full type info and height.
This is wasteful, all we really need is the hash of the largest item for
searching the tree. In lieu of encoding just the hash - which isn't a
value - this patch creates a fake Ref<Boolean> with height 0.
In Go: there are already similar tests for numbers, but testing structs
hits the non-scalar value prolly tree code.
In JS: the set and map tests hadn't even been ported from Go, so I
ported most of their functionality.