wikibase-cli 18.3.0 → 18.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/execute_function.js +12 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ This project received [a Wikimedia Project Grant](https://meta.wikimedia.org/wik
|
|
|
23
23
|
[](https://hub.docker.com/r/maxlath/wikibase-cli/)
|
|
24
24
|
|
|
25
25
|
[](https://opensource.org/licenses/MIT)
|
|
26
|
-
[](http://nodejs.org)
|
|
27
27
|
[](http://standardjs.com/)
|
|
28
28
|
|
|
29
29
|
[Download stats](https://npm-stat.com/charts.html?package=wikibase-cli)
|
|
@@ -55,7 +55,7 @@ See [CHANGELOG.md](CHANGELOG.md) for version info
|
|
|
55
55
|
## Dependencies
|
|
56
56
|
|
|
57
57
|
### General
|
|
58
|
-
* [NodeJs](https://nodejs.org) **>=
|
|
58
|
+
* [NodeJs](https://nodejs.org) **>= v18** (recommended way to install it: use [NVM](https://github.com/creationix/nvm) to install the latest LTS version `nvm install --lts`)
|
|
59
59
|
* [Git](https://git-scm.com/)
|
|
60
60
|
|
|
61
61
|
### Per feature
|
package/lib/execute_function.js
CHANGED
|
@@ -2,7 +2,18 @@ import errors_ from './errors.js'
|
|
|
2
2
|
import validateFunctionArgs from './validate_function_args.js'
|
|
3
3
|
|
|
4
4
|
export async function executeFunction (absoluePath, inputArgs) {
|
|
5
|
-
|
|
5
|
+
const module = await import(absoluePath)
|
|
6
|
+
const firstArg = inputArgs[0]
|
|
7
|
+
let fn
|
|
8
|
+
if (firstArg && typeof module[firstArg] === 'function') {
|
|
9
|
+
fn = module[firstArg]
|
|
10
|
+
inputArgs.shift()
|
|
11
|
+
} else {
|
|
12
|
+
fn = module.default
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (typeof fn !== 'function') throw new Error('function not found')
|
|
16
|
+
|
|
6
17
|
let metadata
|
|
7
18
|
|
|
8
19
|
if (fn && fn.template) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikibase-cli",
|
|
3
|
-
"version": "18.3.
|
|
3
|
+
"version": "18.3.2",
|
|
4
4
|
"description": "A command-line interface to Wikibase",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/maxlath/wikibase-cli#readme",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"chalk": "^5.
|
|
50
|
+
"chalk": "^5.4.1",
|
|
51
51
|
"commander": "^6.0.0",
|
|
52
52
|
"copy-paste": "^1.5.0",
|
|
53
53
|
"lodash-es": "^4.17.21",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"shell-quote": "^1.8.1",
|
|
58
58
|
"split": "^1.0.1",
|
|
59
59
|
"through": "^2.3.8",
|
|
60
|
-
"wikibase-edit": "^7.
|
|
60
|
+
"wikibase-edit": "^7.2.3",
|
|
61
61
|
"wikibase-sdk": "^10.1.0",
|
|
62
62
|
"wikidata-lang": "^2.0.11"
|
|
63
63
|
},
|