Skip to content

Commit

Permalink
Release 0.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sbarzowski committed Nov 22, 2020
1 parent 2e3df82 commit ed11b01
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_dependencies(libjsonnet++ jsonnet)
# CMake prepends CMAKE_SHARED_LIBRARY_PREFIX to shared libraries, so without
# this step the output would be |liblibjsonnet|.
set_target_properties(libjsonnet++ PROPERTIES OUTPUT_NAME jsonnet++
VERSION "0.16.0"
VERSION "0.17.0"
SOVERSION "0"
PUBLIC_HEADER "${LIB_HEADER}")
install(TARGETS libjsonnet++
Expand Down
21 changes: 17 additions & 4 deletions doc/_stdlib_gen/stdlib-content.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ local html = import 'html.libsonnet';
{
name: 'objectValues',
params: ['o'],
availableSince: '0.17.0',
description: |||
Returns an array of the values in the given object. Does not include hidden fields.
|||,
Expand All @@ -104,6 +105,7 @@ local html = import 'html.libsonnet';
{
name: 'objectValuesAll',
params: ['o'],
availableSince: '0.17.0',
description: |||
As <code>std.objectValues</code> but also includes hidden fields.
|||,
Expand Down Expand Up @@ -944,10 +946,17 @@ local html = import 'html.libsonnet';
{
name: 'flatMap',
params: ['func', 'arr'],
description: |||
Apply the given function to every element of the array to form a new array then flatten the result.
It can be thought of as a generalized map, where each element can get mapped to 0, 1 or more elements.
|||,
description: html.paragraphs([
|||
Apply the given function to every element of <code>arr</code> to form a new array then flatten the result.
The argument <code>arr</code> must be an array or a string. If <code>arr</code> is an array, function <code>func</code> must return an array.
If <code>arr</code> is a string, function <code>func</code> must return an string.
|||,
|||
The <code>std.flatMap</code> function can be thought of as a generalized <code>std.map</code>,
with each element mapped to 0, 1 or more elements.
|||
]),
examples: [
{
input: 'std.flatMap(function(x) [x, x], [1, 2, 3])',
Expand All @@ -961,6 +970,10 @@ local html = import 'html.libsonnet';
input: 'std.flatMap(function(x) if x == 2 then [] else [x * 3, x * 2], [1, 2, 3])',
output: std.flatMap(function(x) if x == 2 then [] else [x * 3, x * 2], [1, 2, 3]),
},
{
input: 'std.flatMap(function(x) x+x, "foo")',
output: std.flatMap(function(x) x+x, "foo")
},
],
},
{
Expand Down
22 changes: 20 additions & 2 deletions doc/ref/stdlib.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ <h4 id="objectValues">
<div class="hgroup">
<div class="hgroup-inline">
<div class="panel">
<p>
<em>
Available since version 0.17.0.
</em>
</p>
<p>
Returns an array of the values in the given object. Does not include hidden fields.
</p>
Expand Down Expand Up @@ -283,6 +288,11 @@ <h4 id="objectValuesAll">
<div class="hgroup">
<div class="hgroup-inline">
<div class="panel">
<p>
<em>
Available since version 0.17.0.
</em>
</p>
<p>
As <code>std.objectValues</code> but also includes hidden fields.
</p>
Expand Down Expand Up @@ -1733,8 +1743,13 @@ <h4 id="flatMap">
<div class="hgroup-inline">
<div class="panel">
<p>
Apply the given function to every element of the array to form a new array then flatten the result.
It can be thought of as a generalized map, where each element can get mapped to 0, 1 or more elements.
Apply the given function to every element of <code>arr</code> to form a new array then flatten the result.
The argument <code>arr</code> must be an array or a string. If <code>arr</code> is an array, function <code>func</code> must return an array.
If <code>arr</code> is a string, function <code>func</code> must return an string.
</p>
<p>
The <code>std.flatMap</code> function can be thought of as generalized map,
where each element is mapped to 0, 1 or more elements.
</p>
<p>
Example: <code>std.flatMap(function(x) [x, x], [1, 2, 3])</code> yields <code>[ 1, 1, 2, 2, 3, 3 ]</code>.
Expand All @@ -1745,6 +1760,9 @@ <h4 id="flatMap">
<p>
Example: <code>std.flatMap(function(x) if x == 2 then [] else [x * 3, x * 2], [1, 2, 3])</code> yields <code>[ 3, 2, 9, 6 ]</code>.
</p>
<p>
Example: <code>std.flatMap(function(x) x+x, "foo")</code> yields <code>"ffoooo"</code>.
</p>
</div>
<div style="clear: both"></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion include/libjsonnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ limitations under the License.
*
* If this isn't the sae as jsonnet_version() then you've got a mismatched binary / header.
*/
#define LIB_JSONNET_VERSION "v0.16.0"
#define LIB_JSONNET_VERSION "v0.17.0"

/** Return the version string of the Jsonnet interpreter. Conforms to semantic versioning
* http://semver.org/ If this does not match LIB_JSONNET_VERSION then there is a mismatch between
Expand Down
2 changes: 1 addition & 1 deletion test_cmd/fmt_help.golden.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Jsonnet reformatter v0.16.0
Jsonnet reformatter v0.17.0

jsonnetfmt {<option>} { <filename> }

Expand Down
2 changes: 1 addition & 1 deletion test_cmd/fmt_help.golden.stdout.golang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Jsonnet reformatter v0.16.0
Jsonnet reformatter v0.17.0

jsonnetfmt {<option>} { <filename> }

Expand Down
2 changes: 1 addition & 1 deletion test_cmd/fmt_no_args.golden.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ERROR: must give filename

Jsonnet reformatter v0.16.0
Jsonnet reformatter v0.17.0

jsonnetfmt {<option>} { <filename> }

Expand Down
2 changes: 1 addition & 1 deletion test_cmd/fmt_no_args.golden.stderr.golang
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ERROR: must give filename

Jsonnet reformatter v0.16.0
Jsonnet reformatter v0.17.0

jsonnetfmt {<option>} { <filename> }

Expand Down
2 changes: 1 addition & 1 deletion test_cmd/fmt_version1.golden.stdout
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Jsonnet reformatter v0.16.0
Jsonnet reformatter v0.17.0
2 changes: 1 addition & 1 deletion test_cmd/fmt_version2.golden.stdout
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Jsonnet reformatter v0.16.0
Jsonnet reformatter v0.17.0
2 changes: 1 addition & 1 deletion test_cmd/help.golden.stdout.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Jsonnet commandline interpreter v0.16.0
Jsonnet commandline interpreter v0.17.0

jsonnet {<option>} <filename>

Expand Down
2 changes: 1 addition & 1 deletion test_cmd/help.golden.stdout.golang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Jsonnet commandline interpreter v0.16.0
Jsonnet commandline interpreter v0.17.0

jsonnet {<option>} <filename>

Expand Down
2 changes: 1 addition & 1 deletion test_cmd/no_args.golden.stderr.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ERROR: must give filename

Jsonnet commandline interpreter v0.16.0
Jsonnet commandline interpreter v0.17.0

jsonnet {<option>} <filename>

Expand Down
2 changes: 1 addition & 1 deletion test_cmd/no_args.golden.stderr.golang
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ERROR: must give filename

Jsonnet commandline interpreter v0.16.0
Jsonnet commandline interpreter v0.17.0

jsonnet {<option>} <filename>

Expand Down
2 changes: 1 addition & 1 deletion test_cmd/version1.golden.stdout
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Jsonnet commandline interpreter v0.16.0
Jsonnet commandline interpreter v0.17.0
2 changes: 1 addition & 1 deletion test_cmd/version2.golden.stdout
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Jsonnet commandline interpreter v0.16.0
Jsonnet commandline interpreter v0.17.0

0 comments on commit ed11b01

Please sign in to comment.