public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fx] rawhide: Update to 40.0.2 - Closes rhbz#2497055
@ 2026-12-01 11:24 emape
0 siblings, 0 replies; only message in thread
From: emape @ 2026-12-01 11:24 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/fx
Branch : rawhide
Commit : fa5fd36aa5a7e9e7e555e9d397b2f83cf997f908
Author : emape <inbox@emanuelepetriglia.com>
Date : 2026-12-01T12:22:31+01:00
Stats : +55/-1265 in 9 file(s)
URL : https://src.fedoraproject.org/rpms/fx/c/fa5fd36aa5a7e9e7e555e9d397b2f83cf997f908?branch=rawhide
Log:
Update to 40.0.2 - Closes rhbz#2497055
---
diff --git a/.gitignore b/.gitignore
index 8382015..e984822 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
/fx-20.0.2-nm-dev.tgz
/fx-20.0.2-nm-prod.tgz
/fx-20.0.2.tgz
+/fx-40.0.2-vendor.tar.bz2
+/fx-40.0.2.tar.gz
diff --git a/DOCS.md b/DOCS.md
deleted file mode 100644
index 5444d39..0000000
--- a/DOCS.md
+++ /dev/null
@@ -1,330 +0,0 @@
-# Documentation
-
-* [Getting started](#getting-started)
-* [Usage](#usage)
- + [Anonymous function](#anonymous-function)
- + [Binding](#binding)
- + [Dot](#dot)
- + [Map](#map)
- + [Chaining](#chaining)
- + [Updating](#updating)
- + [Edit-in-place](#edit-in-place)
- + [Using packages](#using-packages)
-* [Using .fxrc](#using-fxrc)
- + [Query language](#query-language)
-* [Formatting](#formatting)
-* [Other examples](#other-examples)
-* [Streaming mode](#streaming-mode)
- + [Filtering](#filtering)
-* [Interactive mode](#interactive-mode)
- + [Searching](#searching)
- + [Selecting text](#selecting-text)
-* [Memory Usage](#memory-usage)
-
-## Getting started
-
-`fx` can work in two modes: cli and interactive. To start interactive mode pipe any JSON into `fx`:
-
-```bash
-$ curl ... | fx
-```
-
-Or you can pass a filename as the first parameter:
-
-```bash
-$ fx my.json
-```
-
-If any argument was passed, `fx` will apply it and prints to stdout.
-
-## Usage
-
-### Anonymous function
-
-Use an anonymous function as reducer which gets JSON and processes it:
-```bash
-$ echo '{"foo": [{"bar": "value"}]}' | fx 'x => x.foo[0].bar'
-value
-```
-
-### Binding
-
-If you don't pass anonymous function `param => ...`, code will be automatically transformed into anonymous function.
-And you can get access to JSON by `this` keyword:
-```bash
-$ echo '{"foo": [{"bar": "value"}]}' | fx 'this.foo[0].bar'
-value
-```
-
-### Dot
-
-It is possible to omit `this` keyword:
-```bash
-$ echo '{"foo": [{"bar": "value"}]}' | fx .foo[0].bar
-value
-```
-
-If a single dot is passed, the input JSON will be formatted but otherwise unaltered:
-```bash
-$ echo '{"foo": "bar"}' | fx .
-{
- "foo": "bar"
-}
-```
-
-### Map
-
-One of the frequent operations is mapping some function on an array. For example, to extract some values.
-
-```
-[
- {
- "author": {
- "name": "antonmedv"
- }
- },
- {...},
- ...
-]
-```
-
-And we want to collect names of each object in the array. We can do this by mapping anonymous function:
-
-```bash
-$ cat ... | fx '.map(x => x.author.name)'
-```
-
-Or we can do the same by using jq-like syntax:
-
-```bash
-$ cat ... | fx .[].author.name
-[
- "antonmedv",
- ...
-]
-```
-
-> Note what `[]` can be applied to map object values.
-> ```bash
-> $ echo '{"foo": 1, "bar": 2}' | fx .[]
-> [1, 2]
-> ```
-
-
-### Chaining
-
-You can pass any number of anonymous functions for reducing JSON:
-```bash
-$ echo '{"foo": [{"bar": "value"}]}' | fx 'x => x.foo' 'this[0]' 'this.bar'
-value
-```
-
-### Updating
-
-You can update existing JSON using the spread operator:
-
-```bash
-$ echo '{"count": 0}' | fx '{...this, count: 1}'
-{
- "count": 1
-}
-```
-
-### Edit-in-place
-
-`fx` provides a function `save` which will save everything in place and return saved object.
-This function can be only used with filename as first argument to `fx` command.
-
-Usage:
-
-```bash
-fx data.json '{...this, count: this.count+1}' save .count
-```
-
-### Using packages
-
-Use any npm package by installing it globally:
-```bash
-$ npm install -g lodash
-$ cat package.json | fx 'require("lodash").keys(this.dependencies)'
-```
-
-## Using .fxrc
-
-Create _.fxrc_ file in `$HOME` directory, and require any packages or define global functions.
-
-For example, access all lodash methods without `_` prefix. Put in your `.fxrc` file:
-
-```js
-Object.assign(global, require('lodash/fp'))
-```
-
-And now you will be able to call all lodash methods. For example, see who's been committing to react recently:
-
-```bash
-curl 'https://api.github.com/repos/facebook/react/commits?per_page=100' \
-| fx 'groupBy("commit.author.name")' 'mapValues(size)' toPairs 'sortBy(1)' reverse 'take(10)' fromPairs
-```
-
-> To be able require global modules make sure you have correct `NODE_PATH` env variable.
-> ```bash
-> export NODE_PATH=`npm root -g`
-> ```
-
-### Query language
-
-If you want to use query language, for example [jsonata](http://jsonata.org/) you can use helper function like this:
-
-```js
-global.jsonata = expr => require('jsonata')(expr).evaluate
-```
-
-And use it like this:
-
-```bash
-curl ... | fx 'jsonata("$sum(Order.Product.(Price * Quantity))")'
-```
-
-Instead you can create next alias in _.bashrc_ file:
-
-```bash
-alias jsonata='FX_APPLY=jsonata fx'
-```
-
-And now all code arguments to `jsonata` will be passed through `jsonata` helper. And now you can use it like this:
-
-```bash
-curl ... | jsonata '$sum(Order.Product.(Price * Quantity))'
-```
-
-## Formatting
-
-If you need output other than JSON (for example arguments for xargs), do not return anything from the reducer.
-`undefined` value is printed into stderr by default.
-```bash
-echo '[]' | fx 'void 0'
-undefined
-```
-
-```bash
-echo '[1,2,3]' | fx 'this.forEach(x => console.log(+x))' 2>/dev/null | xargs echo
-1 2 3
-```
-
-## Other examples
-
-Convert object to array:
-```bash
-$ cat package.json | fx 'Object.keys(this.dependencies)'
-```
-
-Or by two functions:
-```bash
-$ cat package.json | fx .dependencies Object.keys
-```
-
-By the way, fx has shortcut for `Object.keys`. Previous example can be rewritten as:
-
-```bash
-$ cat package.json | fx .dependencies ?
-```
-
-## Streaming mode
-
-`fx` supports line-delimited JSON and concatenated JSON streaming.
-
-```bash
-$ kubectl logs ... | fx .message
-```
-
-> Note what is object lacks `message` field, _undefined_ will be printed to stderr.
-> This is useful to see if you are skipping some objects. But if you want to hide them,
-> redirect stderr to `/dev/null`.
-
-### Filtering
-
-Sometimes it is necessary to omit some messages in JSON stream, or select only specified log messages.
-For this purpose, `fx` has special helpers `select`/`filter`, pass function into it to select/filter JSON messages.
-
-```bash
-$ kubectl logs ... | fx 'select(x => x.status == 500)' .message
-```
-
-```bash
-$ kubectl logs ... | fx 'filter(x => x.status < 499)' .message
-```
-
-> If `filter`/`select` overridden in _.fxrc_ you still able to access them with prefix:
-> `std.select(cb)` or `std.filter(cd)`
-
-## Interactive mode
-
-Click on fields to expand or collapse JSON tree, use mouse wheel to scroll view.
-
-Next commands available in interactive mode:
-
-| Key | Command |
-|-------------------------------|----------------------------------------------|
-| `q` or `Esc` or `Ctrl`+`c` | Exit |
-| `up` or `k` | Move cursor up |
-| `down` or `j` | Move cursor down |
-| `left` or `h` | Collapse |
-| `right` or `l` | Expand |
-| `Shift`+`right` or `L` | Expand all under cursor |
-| `e` | Expand all |
-| `E` | Collapse all |
-| `g` | Scroll to top |
-| `G` | Scroll to bottom |
-| `.` | Edit filter |
-| `/` | Search |
-| `n` | Find next |
-| `p` | Exit and print JSON to stdout |
-| `P` | Exit and print fully expanded JSON to stdout |
-
-These commands are available when editing the filter:
-
-| Key | Command |
-|-------------------------------|-------------------------|
-| `Enter` | Apply filter |
-| `Ctrl`+`u` | Clear filter |
-| `Ctrl`+`w` | Delete last part |
-| `up`/`down` | Select autocomplete |
-
-### Searching
-
-Press `/` and type regexp pattern to search in current JSON. Search work with currently applied filter.
-
-Examples of pattern and corresponding regexp:
-
-| Pattern | RegExp |
-|------------|-------------|
-| `/apple` | `/apple/ig` |
-| `/apple/` | `/apple/` |
-| `/apple/u` | `/apple/u` |
-| `/\w+` | `/\w+/ig` |
-
-### Selecting text
-
-You may found what you can't just select text in fx. This is due the fact that all mouse events redirected to stdin. To be able select again you need instruct your terminal not to do it. This can be done by holding special keys while selecting:
-
-| Key | Terminal |
-|------------------|---------------|
-| `Option`+`Mouse` | iTerm2, Hyper |
-| `Fn`+`Mouse` | Terminal.app |
-| `Shift`+`Mouse` | Linux |
-
-> Note what you can press `p`/`P` to print everything to stdout and select if there.
-
-## Memory Usage
-
-You may find that sometimes, on really big JSON files, fx prints an error message like this:
-
-```
-FATAL ERROR: JavaScript heap out of memory
-```
-
-V8 limits memory usage to around 2 GB by default. You can increase the limit by putting this line in your _.profile_:
-
-```bash
-export NODE_OPTIONS='--max-old-space-size=8192'
-```
diff --git a/audited-null-licenses.toml b/audited-null-licenses.toml
deleted file mode 100644
index 48bfc0c..0000000
--- a/audited-null-licenses.toml
+++ /dev/null
@@ -1,64 +0,0 @@
-[any]
-
-# Contains a LICENSE file that is MIT
-# @medv/blessed/example/ansi-viewer
-"ansi-viewer" = "0.0.1"
-
-# All of these fall under rxjs, which has a proper license in its package.json:
-"rxjs/webSocket" = "<unknown version>"
-"rxjs/testing" = "<unknown version>"
-"rxjs/operators" = "<unknown version>"
-"rxjs/internal-compatibility" = "<unknown version>"
-"rxjs/fetch" = "<unknown version>"
-"rxjs/ajax" = "<unknown version>"
-
-# Just a module wrapper around the code in tslib, which does have a proper
-# license in its package.json:
-# tslib/modules
-modules = "<unknown version>"
-# A “dummy” module in the tests for tslib
-# tslib/test/validateModuleExportsMatchCommonJS
-validateModuleExportsMatchCommonJS = "<unknown version>"
-
-# These are all “dummy” modules in the tests for resolve:
-# resolve/test/module_dir/zmodules/bbb
-bbb = "<unknown version>"
-# resolve/test/resolver/invalid_main
-"invalid main" = "<unknown version>"
-# resolve/test/resolver/incorrect_main
-incorrect_main = "<unknown version>"
-# resolve/test/resolver/dot_slash_main
-dot_slash_main = "<unknown version>"
-# resolve/test/resolver/dot_main
-dot_main = "<unknown version>"
-# resolve/test/resolver/baz
-baz = "<unknown version>"
-# resolve/test/resolver/browser_field
-browser_field = "<unknown version>"
-# resolve/test/resolver/symlinked/package
-package = "<unknown version>"
-
-# stream-http/test/browser is covered by stream-http’s MIT license
-browser = "<unknown version>"
-
-# flatted/cjs is covered by flatted’s ISC license
-cjs = "<unknown version>"
-
-# uid2/LICENSE is MIT
-uid2 = "0.0.3"
-
-# yargs/helpers falls under yargs which is MIT
-helpers = "<unknown version>"
-
-# @babel/runtime/helpers/esm falls under @babel/runtime which is MIT
-esm = "<unknown version>"
-
-[prod]
-
-[dev]
-
-# yaml/browser/dist/package falls under yaml which is ISC
-dist = "<unknown version>"
-
-# Various dummy packages in github-from-package, falling under its MIT license
-beep-boop = "1.2.3"
diff --git a/check-null-licenses b/check-null-licenses
deleted file mode 100755
index db2e0d3..0000000
--- a/check-null-licenses
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/usr/bin/python3
-# -*- coding: utf-8 -*-
-
-import json
-from argparse import ArgumentParser, FileType, RawDescriptionHelpFormatter
-from pathlib import Path
-from sys import exit, stderr
-
-import toml
-
-
-def main():
- args = parse_args()
- problem = False
- if not args.tree.is_dir():
- return f"Not a directory: {args.tree}"
- for pjpath in args.tree.glob("**/package.json"):
- name, version, license = parse(pjpath)
- identity = f"{name} {version}"
- if version in args.exceptions.get(name, ()):
- continue # Do not even check the license
- elif license is None:
- problem = True
- print(
- f"Missing license in package.json for {identity}", file=stderr
- )
- elif isinstance(license, dict):
- if isinstance(license.get("type"), str):
- continue
- print(
- (
- "Missing type for (deprecated) license object in "
- f"package.json for {identity}: {license}"
- ),
- file=stderr,
- )
- elif isinstance(license, list):
- if license and all(
- isinstance(entry, dict) and isinstance(entry.get("type"), str)
- for entry in license
- ):
- continue
- print(
- (
- "Defective (deprecated) licenses array-of objects in "
- f"package.json for {identity}: {license}"
- ),
- file=stderr,
- )
- elif isinstance(license, str):
- continue
- else:
- print(
- (
- "Weird type for license in "
- f"package.json for {identity}: {license}"
- ),
- file=stderr,
- )
- problem = True
- if problem:
- return "At least one missing license was found."
-
-
-def check_exception(exceptions, name, version):
- x = args.exceptions
-
-
-def parse(package_json_path):
- with package_json_path.open("rb") as pjfile:
- pj = json.load(pjfile)
- try:
- license = pj["license"]
- except KeyError:
- license = pj.get("licenses")
- try:
- name = pj["name"]
- except KeyError:
- name = package_json_path.parent.name
- version = pj.get("version", "<unknown version>")
-
- return name, version, license
-
-
-def parse_args():
- parser = ArgumentParser(
- formatter_class=RawDescriptionHelpFormatter,
- description=(
- "Search for bundled dependencies without declared licenses"
- ),
- epilog="""
-
-The exceptions file must be a TOML file with zero or more tables. Each table’s
-keys are package names; the corresponding values values are exact version
-number strings, or arrays of version number strings, that have been manually
-audited to determine their license status and should therefore be ignored.
-
-Exceptions in a table called “any” are always applied. Otherwise, exceptions
-are applied only if a corresponding --with TABLENAME argument is given;
-multiple such arguments may be given.
-
-For
-example:
-
- [any]
- example-foo = "1.0.0"
-
- [prod]
- example-bar = [ "2.0.0", "2.0.1",]
-
- [dev]
- example-bat = [ "3.7.4",]
-
-would always ignore version 1.0.0 of example-foo. It would ignore example-bar
-2.0.1 only when called with “--with prod”.
-
-Comments may (and should) be used to describe the manual audits upon which the
-exclusions are based.
-
-Otherwise, any package.json with missing or null license field in the tree is
-considered an error, and the program returns with nonzero status.
-""",
- )
- parser.add_argument(
- "-x",
- "--exceptions",
- type=FileType("r"),
- help="Manually audited package versions file",
- )
- parser.add_argument(
- "-w",
- "--with",
- action="append",
- default=[],
- help="Enable a table in the exceptions file",
- )
- parser.add_argument(
- "tree",
- metavar="node_modules_dir",
- type=Path,
- help="Path to search recursively",
- default=".",
- )
- args = parser.parse_args()
-
- if args.exceptions is None:
- args.exceptions = {}
- xname = None
- else:
- with args.exceptions as xfile:
- xname = getattr(xfile, "name", "<exceptions>")
- args.exceptions = toml.load(args.exceptions)
- if not isinstance(args.exceptions, dict):
- parser.error(f"Invalid format in {xname}: not an object")
- for tablename, table in args.exceptions.items():
- if not isinstance(table, dict):
- parser.error(
- f"Non-table entry in {xname}: {tablename} = {table!r}"
- )
- overlay = {}
- for key, value in table.items():
- if isinstance(value, str):
- overlay[key] = [value]
- elif not isinstance(value, list) or not all(
- isinstance(entry, str) for entry in value
- ):
- parser.error(
- f"Invalid format in {xname} in [{tablename}]: "
- f"{key!r} = {value!r}"
- )
- table.update(overlay)
-
- x = args.exceptions.get("any", {})
- for add in getattr(args, "with"):
- try:
- x.update(args.exceptions[add])
- except KeyError:
- if xname is None:
- parser.error(
- f"No table {add}, as no exceptions file was given"
- )
- else:
- parser.error(f"No table {add} in {xname}")
- # Store the merged dictionary
- args.exceptions = x
-
- return args
-
-
-if __name__ == "__main__":
- exit(main())
diff --git a/fx-20.0.2-bundled-licenses.txt b/fx-20.0.2-bundled-licenses.txt
deleted file mode 100644
index fb9b424..0000000
--- a/fx-20.0.2-bundled-licenses.txt
+++ /dev/null
@@ -1 +0,0 @@
-"MIT"
diff --git a/fx.1 b/fx.1
deleted file mode 100644
index 789d0dd..0000000
--- a/fx.1
+++ /dev/null
@@ -1,520 +0,0 @@
-'\" t
-.TH FX "1" "February 2021" "" "User Commands"
-.SH NAME
-fx \- command-line JSON processing tool
-.SH SYNOPSIS
-.B fx
-.RI [ code \ ...]
-.P
-.B fx
-can work in two modes: cli and interactive.
-To start interactive mode pipe any JSON into
-.BR fx :
-.in +4n
-.EX
-.B $\ curl\ ...\ |\ fx
-.EE
-.in
-Or you can pass a filename as the first parameter:
-.in +4n
-.EX
-.B $\ fx\ my.json
-.EE
-.in
-If any argument was passed,
-.B fx
-will apply it and prints to stdout.
-.SH DESCRIPTION
-.P
-Start interactive mode without passing any arguments.
-.in +4n
-.EX
-.B $\ curl\ ...\ |\ fx
-.EE
-.in
-Or by passing filename as first argument.
-.in +4n
-.EX
-.B $\ fx\ data.json
-.EE
-.in
-Pass a few JSON files.
-.in +4n
-.EX
-.B $\ cat\ foo.json\ bar.json\ baz.json\ |\ fx\ .message
-.EE
-.in
-Use full power of JavaScript.
-.in +4n
-.EX
-.B $\ curl\ ...\ |\ fx\ '.filter(x\ =>\ x.startsWith("a"))'
-.EE
-.in
-Access all lodash (or ramda, etc) methods by using .fxrc file.
-.in +4n
-.EX
-.B $\ curl\ ...\ |
-.B >\ fx\ '_.groupBy("commit.committer.name")'\ '_.mapValues(_.size)'
-.EE
-.in
-Update JSON using spread operator.
-.in +4n
-.EX
-.B $\ echo '{"count":\ 0}'\ |\ fx '{...this,\ count:\ 1}'
-.B {
-.B \ \ "count": 1
-.B }
-.EE
-.in
-Extract values from maps.
-.in +4n
-.EX
-.B $\ fx\ commits.json\ |\ fx\ .[].author.name
-.EE
-.in
-Print formatted JSON to stdout.
-.in +4n
-.EX
-.B $\ curl\ ...\ | fx\ .
-.EE
-.in
-Pipe JSON logs stream into fx.
-.in +4n
-.EX
-.B $\ kubectl\ logs\ ...\ -f\ |\ fx\ .message
-.EE
-.in
-And try this:
-.in +4n
-.EX
-.B $\ fx\ --life
-.EE
-.in
-.SS USAGE
-.TP
-.B "ANONYMOUS\ FUNCTION"
-Use an anonymous function as reducer which gets JSON and processes it:
-.in +4n
-.EX
-.B $\ echo\ '{"foo":\ [{"bar":\ "value"}]}'\ |\ fx\ 'x\ =>\ x.foo[0].bar'
-.B value
-.EE
-.in
-.TP
-.B BINDING
-If you don't pass anonymous function
-.BR param\ =>\ ... ,
-code will be automatically transformed into anonymous function.
-And you can get access to JSON by
-.B this
-keyword:
-.in +4n
-.EX
-.B $\ echo\ '{"foo":\ [{"bar":\ "value"}]}'\ |\ fx\ 'this.foo[0].bar'
-.B value
-.EE
-.in
-.TP
-.B DOT
-It is possible to omit
-.B this
-keyword:
-.in +4n
-.EX
-.B $\ echo\ '{"foo":\ [{"bar":\ "value"}]}'\ |\ fx\ .foo[0].bar
-.B value
-.EE
-.in
-If a single dot is passed, the input JSON will be formatted but otherwise
-unaltered:
-.in +4n
-.EX
-.B $\ echo\ '{"foo":\ "bar"}'\ |\ fx\ .
-.B {
-.B \ \ "foo":\ "bar"
-.B }
-.EE
-.in
-.TP
-.B MAP
-One of the frequent operations is mapping some function on an array.
-For example, to extract some values.
-.in +4n
-.EX
-.B [
-.B \ \ {
-.B \ \ \ \ "author":\ {
-.B \ \ \ \ \ \ "name":\ "antonmedv"
-.B \ \ \ \ }
-.B \ \ },
-.B \ \ {...},
-.B \ \ ...
-.B ]
-.EE
-.in
-And we want to collect names of each object in the array.
-We can do this by mapping anonymous function:
-.in +4n
-.EX
-.B $\ cat\ ...\ |\ fx\ '.map(x\ =>\ x.author.name)'
-.EE
-.in
-Or we can do the same by using
-.BR jq (1)-like
-syntax:
-.in +4n
-.EX
-.B $\ cat\ ...\ |\ fx\ .[].author.name
-.B [
-.B \ \ "antonmedv",
-.B \ \ ...
-.B ]
-.EE
-.in
-Note what
-.B []
-can be applied to map object values.
-.in +4n
-.EX
-.B $\ echo\ '{"foo":\ 1,\ "bar":\ 2}'\ |\ fx\ .[]
-.B [1,\ 2]
-.EE
-.in
-.TP
-.B CHAINING
-You can pass any number of anonymous functions for reducing JSON:
-.in +4n
-.EX
-.B $\ echo\ '{"foo":\ [{"bar":\ "value"}]}'\ |
-.B >\ fx\ 'x\ =>\ x.foo'\ 'this[0]'\ 'this.bar'
-.B value
-.EE
-.in
-.TP
-.B UPDATING
-You can update existing JSON using the spread operator:
-.in +4n
-.EX
-.B $\ echo\ '{"count":\ 0}'\ |\ fx\ '{...this,\ count:\ 1}'
-.B {
-.B \ \ "count":\ 1
-.B }
-.EE
-.in
-.TP
-.B EDIT\-IN\-PLACE
-.B fx
-provides a function
-.B save
-which will save everything in place and return saved object.
-This function can be only used with filename as first argument to
-.B fx
-command.
-.IP
-Usage:
-.in +4n
-.EX
-.B $\ fx\ data.json\ '{...this,\ count:\ this.count+1}'\ save\ .count
-.EE
-.in
-.TP
-.B "USING\ PACKAGES"
-Use any npm package by installing it globally:
-.in +4n
-.EX
-.B $\ npm\ install\ -g\ lodash
-.B $\ cat\ package.json\ |
-.B >\ fx\ 'require("lodash").keys(this.dependencies)'
-.EE
-.in
-.SS "FORMATTING"
-If you need output other than JSON (for example arguments for xargs), do not
-return anything from the reducer.
-.B undefined
-value is printed into stderr by default.
-.in +4n
-.EX
-.B echo\ '[]'\ |\ fx\ 'void\ 0'
-.B undefined
-.EE
-.in
-.P
-.in +4n
-.EX
-.B echo\ '[1,2,3]'\ |
-.B \ \ fx\ 'this.forEach(x\ =>\ console.log(+x))'\ 2>/dev/null\ |
-.B \ \ xargs echo
-.B 1\ 2\ 3
-.EE
-.in
-.SS "STREAMING\ MODE"
-.P
-.B fx
-supports line-delimited JSON and concatenated JSON streaming.
-.in +4n
-.EX
-.B $\ kubectl\ logs\ ...\ |\ fx\ .message
-.EE
-.in
-Note what is object lacks
-.B message
-field,
-.B undefined
-will be printed to stderr.
-This is useful to see if you are skipping some objects.
-But if you want to hide them, redirect stderr to
-.BR /dev/null .
-.TP
-.B FILTERING
-Sometimes it is necessary to omit some messages in JSON stream, or select only
-specified log messages.
-For this purpose,
-.B fx
-has special helpers
-.BR select / filter ,
-pass function into it to select/filter JSON messages.
-.in +4n
-.EX
-.B $\ kubectl\ logs\ ...\ |
-.B >\ fx\ 'select(x\ =>\ x.status\ ==\ 500)'\ .message
-.EE
-.in
-.IP
-.in +4n
-.EX
-.B $\ kubectl\ logs\ ...\ |
-.B >\ fx\ 'filter(x\ =>\ x.status\ <\ 499)'\ .message
-.EE
-.in
-.IP
-If
-.BR filter / select
-overridden in
-.B .fxrc
-you still able to access them with prefix:
-.B std.select(cb)
-or
-.BR std.filter(cd)
-.SH FILES
-.SS "USING\ .fxrc"
-.P
-Create
-.B .fxrc
-in
-.B $HOME
-directory, and require any packages or define global functions.
-.P
-For example, access all lodash methods without
-.B _
-prefix.
-Put in your
-.B .fxrc
-file:
-.in +4n
-.EX
-.B Object.assign(global,\ require('lodash/fp'))
-.EE
-.in
-And now you will be able to call all lodash methods.
-For example, see who's been committing to react recently:
-.in +4n
-.EX
-.B curl\ 'https://api.github.com/repos/facebook/react/commits?per_page=100'\ |
-.B \ \ fx\ 'groupBy("commit.author.name")'\ 'mapValues(size)'\ toPairs\ \\\\
-.B \ \ \ \ \ \ 'sortBy(1)'\ reverse\ 'take(10)'\ fromPairs
-.EE
-.in
-See the
-.B ENVIRONMENT
-section.
-.TP
-.B "QUERY\ LANGUAGE"
-If you want to use query language, for example
-.UR https://jsonata.org/
-jsonata
-.UE
-you can use helper function like this:
-.in +4n
-.EX
-.B global.jsonata\ =\ expr\ =>\ require('jsonata')(expr).evaluate
-.EE
-.in
-And use it like this:
-.in +4n
-.EX
-.B curl\ ...\ |
-.B \ \ fx\ 'jsonata("$sum(Order.Product.(Price\ *\ Quantity))")'
-.EE
-.in
-Instead you can create next alias in
-.B .bashrc
-file:
-.in +4n
-.EX
-.B alias\ jsonata='FX_APPLY=jsonata\ fx'
-.EE
-.in
-And now all code arguments to
-.B jsonata
-will be passed through
-.B jsonata
-helper.
-And now you can use it like this:
-.in +4n
-.EX
-.B curl\ ...\ |\ jsonata\ '$sum(Order.Product.(Price\ *\ Quantity))'
-.EE
-.in
-.SS "INTERACTIVE\ MODE"
-.P
-Click on fields to expand or collapse JSON tree, use mouse wheel to scroll
-view.
-.P
-Next commands available in interactive mode:
-.TS
-allbox tab(|);
-ci ci
-l l .
-Key|Command
-\fBq\fR or \fBEsc\fR or \fBCtrl\fR+\fBc\fR|Exit
-\fBup\fR or \fBk\fR|Move cursor up
-\fBleft\fR or \fBh\fR|Collapse
-\fBright\fR or \fBl\fR|Expand
-\fBShift+right\fR or \fBL\fR|Expand all under cursor
-\fBShift+left\fR or \fBK\fR|Collapse all under cursor
-\fBe\fR|Expand all
-\fBE\fR|Collapse all
-\fBg\fR|Scroll to top
-\fBG\fR|Scroll to bottom
-\fB.\fR|Edit filter
-\fB/\fR|Search
-\fBn\fR|Find next
-\fBp\fR|Exit and print JSON to stdout
-\fBP\fR|Exit and print fully expanded JSON to stdout
-.TE
-.P
-These commands are available when editing the filter:
-.TS
-allbox tab(|);
-ci ci
-l l .
-Key|Command
-\fBEnter\fR|Apply filter
-\fBCtrl\fR+\fBu\fR|Clear filter
-\fBCtrl\fR+\fBw\fR|Delete last part
-\fBup\fR/\fBdown\fR|Select autocomplete
-.TE
-.TP
-.B SEARCHING
-Press
-.B /
-and type regexp pattern to search in current JSON.
-Search work with currently applied filter.
-.IP
-Examples of pattern and corresponding regexp:
-.TS
-allbox tab(|);
-ci ci
-l l .
-Pattern|RegExp
-\fB/apple\fR|\fB/apple/ig\fR
-\fB/apple/\fR+\fBu\fR|\fB/apple/\fR
-\fB/apple/u\fR+\fBw\fR|\fB/apple/u\fR
-\fB\\w+\fR|\fB/\\w+/ig\fR
-.TE
-.TP
-.B "SELECTING\ TEXT"
-You may found what you can't just select text in fx.
-This is due the fact that all mouse events redirected to stdin.
-To be able select again you need instruct your terminal not to do it.
-This can be done by holding special keys while selecting:
-.TS
-allbox tab(|);
-ci ci
-l l .
-Key|Terminal
-\fBOption\fR+\fBMouse\fR|iTerm2, Hyper
-\fBFn\fR+\fBMouse\fR|Terminal.app
-\fBShift\fR+\fBMouse\fR|Linux
-.TE
-.IP
-Note what you can press
-.BR p / P
-to print everything to stdout and select if there.
-.SS "MEMORY\ USAGE"
-You may find that sometimes, on really big JSON files, fx prints an error
-message like this:
-.in +4n
-.EX
-.B FATAL ERROR: JavaScript heap out of memory
-.EE
-.in
-V8 limits memory usage to around 2 GB by default.
-You can increase the limit by putting this line in your
-.BR .profile :
-.in +4n
-.EX
-.B export NODE_OPTIONS='--max-old-space-size=8192'
-.EE
-.in
-.SH ENVIRONMENT
-.P
-To be able require global modules make sure you have correct
-.B NODE_PATH
-env variable.
-.SH EXAMPLES
-.SS "BASIC\ EXAMPLES"
-.P
-.EX
-.B $\ echo\ '{"key":\ "value"}'\ |\ fx\ 'x\ =>\ x.key'
-.B value
-.EE
-.P
-.EX
-.B $\ echo\ '{"key":\ "value"}'\ |\ fx\ .key
-.B value
-.EE
-.P
-.EX
-.B $\ echo\ '[1,2,3]'\ |\ fx\ 'this.map(x\ =>\ x\ *\ 2)'
-.B [2,\ 4,\ 6]
-.EE
-.P
-.EX
-.B $\ echo\ '{"items":\ ["one",\ "two"]}'\ |\ fx\ 'this.items'\ 'this[1]'
-.B two
-.EE
-.P
-.EX
-.B $\ echo\ '{"count":\ 0}'\ |\ fx\ '{...this,\ count:\ 1}'
-.B {"count":\ 1}
-.EE
-.P
-.EX
-.B $\ echo\ '{"foo":\ 1,\ "bar":\ 2}'\ |\ fx\ ?
-.B ["foo",\ "bar"]
-.EE
-.SS "OTHER\ EXAMPLES"
-.P
-Convert object to array:
-.in +4n
-.EX
-.B $\ cat\ package.json\ |\ fx\ 'Object.keys(this.dependencies)'
-.EE
-.in
-Or by two functions:
-.in +4n
-.EX
-.B $\ cat\ package.json\ |\ fx\ .dependencies\ Object.keys
-.EE
-.in
-By the way, fx has shortcut for
-.BR Object.keys .
-Previous example can be rewritten as:
-.in +4n
-.EX
-.B $\ cat\ package.json\ |\ fx\ .dependencies\ ?
-.EE
-.in
-.SH "SEE\ ALSO"
-.BR jq (1)
diff --git a/fx.spec b/fx.spec
index 48be3e2..12032ed 100644
--- a/fx.spec
+++ b/fx.spec
@@ -1,175 +1,58 @@
-%global npm_name fx
+# Generated by go2rpm 1.19.0
+%bcond check 1
-Name: %{npm_name}
-Version: 20.0.2
-Release: %autorelease
-Summary: Command-line JSON processing tool
+# https://github.com/antonmedv/fx
+%global goipath github.com/antonmedv/fx
+Version: 40.0.2
+%global tag 40.0.2
-# License of fx is MIT; any others come from bundled dependencies. See the
-# license file %%{npm_name}-%%{version}-bundled-licenses.txt for a list of
-# licenses in NPM format. Each bundled dependency has the license specified in
-# the "license" key of its package.json file.
-#
-# Additionally, node_modules_prod/@medv/blessed/usr/fonts/ is licensed under
-# the SIL Open Font License 1.1 (OFL) even though the overall license of
-# @medv/blessed is MIT; OFL is therefore not listed in the bundled licenses
-# file.
-License: MIT and OFL
-URL: https://github.com/antonmedv/%{npm_name}
-Source0: https://registry.npmjs.org/%{npm_name}/-/%{npm_name}-%{version}.tgz
-# The DOCS.md file, which is very useful, is not included in the NPM tarball.
-#
-# Note https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/ says,
-# “The canonical method for shipping most node modules is tarballs from the npm
-# registry. […] This method should be preferred to using checkouts from git or
-# automatically generated tarballs from GitHub.” (Otherwise, we might just use
-# the GitHub tarball as the primary source.)
-Source1: https://raw.githubusercontent.com/antonmedv/%{npm_name}/%{version}/DOCS.md
-# Created with (from nodejs-packaging RPM):
-# nodejs-packaging-bundler %%{npm_name} %%{version}
-Source2: %{npm_name}-%{version}-nm-prod.tgz
-Source3: %{npm_name}-%{version}-nm-dev.tgz
-Source4: %{npm_name}-%{version}-bundled-licenses.txt
-# Hand-written man page
-Source5: %{npm_name}.1
-# https://bugzilla.redhat.com/show_bug.cgi?id=1920223
-Source6: check-null-licenses
-Source7: audited-null-licenses.toml
+%gometa -L -f
-ExclusiveArch: %{nodejs_arches} noarch
-BuildArch: noarch
-BuildRequires: nodejs-devel
-BuildRequires: symlinks
-BuildRequires: hardlink
-BuildRequires: rsync
+Name: fx
+Release: %autorelease
+Summary: Terminal JSON viewer & processor
-# For check-null-licenses
-BuildRequires: python3-devel
-BuildRequires: python3dist(toml)
+# Generated by go-vendor-tools
+License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT
+URL: %{gourl}
+Source0: %{gosource}
+# Generated by go-vendor-tools
+Source1: %{archivename}-vendor.tar.bz2
+Source2: go-vendor-tools.toml
-Requires: nodejs
+BuildRequires: go-vendor-tools
%description
-Command-line JSON processing tool
-
-Features:
-
- * Easy to use
- * Standalone binary
- * Interactive mode
- * Streaming support
-
+Fx is a CLI for JSON: it shows JSON interactively in your terminal, and lets you
+transform JSON with JavaScript. Fx is written in Go and uses goja as its
+embedded JavaScript engine.
%prep
-%setup -q -n package
-# Copy in the documentation file from GitHub; and copy in the bundled license
-# list.
-cp -p '%{SOURCE1}' '%{SOURCE4}' .
-# Set up bundled runtime (prod) node modules.
-tar -xzf '%{SOURCE2}'
-mkdir -p node_modules
-pushd node_modules
-ln -s ../node_modules_prod/* .
-if [ -e ../node_modules_prod/.bin ]
-then
- ln -s ../node_modules_prod/.bin .
-fi
-popd
-
-# Fix shebang lines in executables. For some reason, brp-mangle-shebangs does
-# not seem to do this under %%nodejs_sitelib.
-find . -type f -perm /0111 -exec gawk \
- '/^#!\/usr\/bin\/env[[:blank:]]/ { print FILENAME }; { nextfile }' \
- '{}' '+' |
- xargs -r sed -r -i '1{s|^(#!/usr/bin/)env[[:blank:]]+([^[:blank:]]+)|\1\2|}' \
+%goprep -p1
+tar -xf %{S:1}
-# Remove dotfiles (hidden files) from bundled dependencies. As of 6.1.0-1,
-# these include: (.editorconfig .eslintignore .eslintrc .eslintrc.json .gitkeep
-# .istanbul.yml .jscs.json .npmignore .nycrc .travis.yml) and are all not
-# needed at runtime. If a dependency appears with an important hidden file, we
-# may need to exclude it from removal.
-#
-# Also remove zero-length files from bundled dependencies. As of 6.1.0-1, these
-# are only in tests and examples for bundled dependencies, neither of which
-# will be used by the installed package, so it is OK if these portions of the
-# dependencies are broken by the removal.
-find node_modules_prod -type f \( -name '.*' -o -size 0 \) -print -delete
-
-# Remove hidden directories from bundled dependencies, except those known to be
-# useful. If a dependency appears with an important hidden directory, we may
-# need to exclude it from removal.
-find node_modules_prod -depth -type d -name '.*' ! -name '.bin' \
- -printf '--> Remove hidden directory %p\n' -exec rm -rvf '{}' ';'
+%generate_buildrequires
+%go_vendor_license_buildrequires -c %{S:2}
+%build
+%global gomodulesmode GO111MODULE=on
+%gobuild -o %{gobuilddir}/bin/fx %{goipath}
%install
-install -d '%{buildroot}%{nodejs_sitelib}/%{npm_name}'
-# Note that, per Fedora guidelines, we MUST install the original sources
-# whether they are used or not.
-cp -rp \
- package.json \
- *.js \
- node_modules node_modules_prod \
- '%{buildroot}%{nodejs_sitelib}/%{npm_name}'
-
-install -d '%{buildroot}%{_bindir}'
-# Create an absolute symlink in the buildroot, then convert it to a relative
-# one that will still resolve after installation. Otherwise, to create a
-# relative symlink, we would have to know how deeply nested %%nodejs_sitelib
-# is, which breaks the abstraction of using a macro.
-ln -s '%{buildroot}%{nodejs_sitelib}/%{npm_name}/index.js' \
- '%{buildroot}%{_bindir}/%{npm_name}'
-symlinks -c -o '%{buildroot}%{_bindir}/%{npm_name}'
-
-install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 -D '%{SOURCE5}'
-
-# We do not need binaries associated with bundled node libraries, so even .bin
-# directories may be removed from the buildroot.
-find '%{buildroot}/%{nodejs_sitelib}/%{npm_name}/node_modules_prod' \
- -depth -type d -name '.bin' \
- -printf '--> Remove hidden directory %p\n' -exec rm -rvf '{}' ';'
-# Also, remove the .bin symlink:
-rm -vf '%{buildroot}/%{nodejs_sitelib}/%{npm_name}/node_modules/.bin'
-
-# Hardlink duplicate files in the dependency bundle. We don’t pass the “-t”
-# option to “hardlink”, so only files with the same mtime (not just identical
-# contents) are hardlinked.
-hardlink '%{buildroot}%{nodejs_sitelib}/%{npm_name}/node_modules_prod'
-
+%go_vendor_license_install -c %{S:2}
+install -m 0755 -vd %{buildroot}%{_bindir}
+install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
%check
-%{python3} '%{SOURCE6}' --exceptions '%{SOURCE7}' --with prod node_modules_prod
-# We do not call:
-# %%{__nodejs} -e 'require("./")'
-# because this package does not provide an importable module. See the lack of a
-# "main" or "module" key in package.json.
-
-# Set up bundled dev node_modules for testing. We must do this here, not in
-# prep, so that they are not pulled into the installed RPM.
-tar -xzf '%{SOURCE3}'
-%{python3} '%{SOURCE6}' --exceptions '%{SOURCE7}' --with dev node_modules_dev
-# The usual symlinking approach recommended by the guidelines does not work as
-# some dependencies are split across the prod and dev tarballs due to plugins.
-# Instead, we overlay the two directories using local rsync. This is less
-# space-efficient, but it works!
-rm -rf node_modules
-cp -rp ./node_modules_prod node_modules
-rsync -aqP ./node_modules_dev/ ./node_modules/
-
-# See scripts.test in package.json. We must explicitly specify the test script,
-# or ava recurses inside node_modules*/ looking for tests and finds a great
-# many excuses to crash.
-NODE_ENV=test ./node_modules/.bin/ava test.js
-
-
-%files
-%doc README.md
-%doc DOCS.md
-%license LICENSE %{npm_name}-%{version}-bundled-licenses.txt
-%{nodejs_sitelib}/%{npm_name}
-%{_bindir}/%{npm_name}
-%{_mandir}/man1/%{npm_name}.1*
+%go_vendor_license_check -c %{S:2}
+%if %{with check}
+%gotest ./...
+%endif
+
+%files -f %{go_vendor_license_filelist}
+%doc README.md RELEASE.md
+%{_bindir}/fx
%changelog
diff --git a/go-vendor-tools.toml b/go-vendor-tools.toml
new file mode 100644
index 0000000..a048292
--- /dev/null
+++ b/go-vendor-tools.toml
@@ -0,0 +1,12 @@
+[archive]
+
+[archive.dependency_overrides]
+"github.com/mattn/go-localereader" = "2491eb6c1c75"
+
+[licensing]
+detector = "askalono"
+
+[[licensing.licenses]]
+path = "vendor/go.yaml.in/yaml/v3/LICENSE"
+sha256sum = "d18f6323b71b0b768bb5e9616e36da390fbd39369a81807cca352de4e4e6aa0b"
+expression = "MIT AND Apache-2.0"
diff --git a/sources b/sources
index 0add8b2..7d665d7 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,2 @@
-SHA512 (fx-20.0.2.tgz) = 06064dca5a6c0dfe55d1ce03c235a7aded9d95df586c46dd3549d7cce0b6589bf847f027246f1cbbb981111864ab1b9edd2de182626bde5aa8a9e29bd8f79d19
-SHA512 (fx-20.0.2-nm-prod.tgz) = 38c9532a52fa4fc27e89dd8d5b96f6fc06c8d0da3a6e6db8f4f6329423a2636abf91eada4efd52cdc7456cb7f19fea5d8d261c50c0b317869be40c2a0240bd10
-SHA512 (fx-20.0.2-nm-dev.tgz) = 9b04ab6f77a581abed9a7b47cb873dc83a478253e99d9db2ad48d7c79efeaae59fe00e165d27d595f97cb0c56d72eff1572e9776de2cc2e12b3c82cad8a81dab
+SHA512 (fx-40.0.2-vendor.tar.bz2) = 520f7dcd183758dc71ba461be1a3c6c80a5fccf88382cad8d3ce487846da62082ea5777a174f85e7434dfa194cf76fae306d8868a8b94a18fee1df2a9dfdc331
+SHA512 (fx-40.0.2.tar.gz) = dae32fa074ac23f10e2c1dc54855c2314d737f422cd2e9be07a6d9999c8623d8a2c1a446c3131d96f480b905ca71a73b4d0d7617ce1bef3777f34b592602795a
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-01 11:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01 11:24 [rpms/fx] rawhide: Update to 40.0.2 - Closes rhbz#2497055 emape
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox