@rse/nunjucks-cli 1.5.3 → 1.6.0
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/Dockerfile +1 -1
- package/README.md +1 -1
- package/eslint.mjs +65 -0
- package/nunjucks.1 +9 -9
- package/nunjucks.js +13 -13
- package/package.json +13 -11
- package/eslint.yaml +0 -51
package/Dockerfile
CHANGED
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ Hello, world!
|
|
|
98
98
|
License
|
|
99
99
|
-------
|
|
100
100
|
|
|
101
|
-
Copyright © 2019-
|
|
101
|
+
Copyright © 2019-2025 Dr. Ralf S. Engelschall (http://engelschall.com/)
|
|
102
102
|
|
|
103
103
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
104
104
|
a copy of this software and associated documentation files (the
|
package/eslint.mjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
** nunjucks -- Nunjucks Template Rendering Command-Line Interface
|
|
3
|
+
** Copyright (c) 2019-2025 Dr. Ralf S. Engelschall <http://engelschall.com>
|
|
4
|
+
** Licensed under MIT <http://spdx.org/licenses/MIT.html>
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import pluginJs from "@eslint/js"
|
|
8
|
+
import pluginStd from "neostandard"
|
|
9
|
+
import pluginN from "eslint-plugin-n"
|
|
10
|
+
import pluginImport from "eslint-plugin-import"
|
|
11
|
+
import pluginPromise from "eslint-plugin-promise"
|
|
12
|
+
import globals from "globals"
|
|
13
|
+
|
|
14
|
+
export default [
|
|
15
|
+
pluginJs.configs.recommended,
|
|
16
|
+
...pluginStd({
|
|
17
|
+
ignores: pluginStd.resolveIgnoresFromGitignore()
|
|
18
|
+
}),
|
|
19
|
+
{
|
|
20
|
+
plugins: {
|
|
21
|
+
"n": pluginN,
|
|
22
|
+
"import": pluginImport,
|
|
23
|
+
"promise": pluginPromise
|
|
24
|
+
},
|
|
25
|
+
files: [ "**/*.js" ],
|
|
26
|
+
ignores: [ "dst/" ],
|
|
27
|
+
languageOptions: {
|
|
28
|
+
ecmaVersion: 2022,
|
|
29
|
+
sourceType: "module",
|
|
30
|
+
globals: {
|
|
31
|
+
...globals.browser,
|
|
32
|
+
...globals.node,
|
|
33
|
+
...globals.commonjs,
|
|
34
|
+
...globals.worker,
|
|
35
|
+
...globals.serviceworker
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
rules: {
|
|
39
|
+
"curly": "off",
|
|
40
|
+
"require-atomic-updates": "off",
|
|
41
|
+
"dot-notation": "off",
|
|
42
|
+
"no-labels": "off",
|
|
43
|
+
"no-useless-constructor": "off",
|
|
44
|
+
"no-dupe-class-members": "off",
|
|
45
|
+
|
|
46
|
+
"@stylistic/indent": [ "error", 4, { SwitchCase: 1 } ],
|
|
47
|
+
"@stylistic/linebreak-style": [ "error", "unix" ],
|
|
48
|
+
"@stylistic/semi": [ "error", "never" ],
|
|
49
|
+
"@stylistic/operator-linebreak": [ "error", "after", { overrides: { "&&": "before", "||": "before", ":": "after" } } ],
|
|
50
|
+
"@stylistic/brace-style": [ "error", "stroustrup", { allowSingleLine: true } ],
|
|
51
|
+
"@stylistic/quotes": [ "error", "double" ],
|
|
52
|
+
|
|
53
|
+
"@stylistic/no-multi-spaces": "off",
|
|
54
|
+
"@stylistic/no-multiple-empty-lines": "off",
|
|
55
|
+
"@stylistic/key-spacing": "off",
|
|
56
|
+
"@stylistic/object-property-newline": "off",
|
|
57
|
+
"@stylistic/space-in-parens": "off",
|
|
58
|
+
"@stylistic/array-bracket-spacing": "off",
|
|
59
|
+
"@stylistic/lines-between-class-members": "off",
|
|
60
|
+
"@stylistic/multiline-ternary": "off",
|
|
61
|
+
"@stylistic/quote-props": "off"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
|
package/nunjucks.1
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.TH "NUNJUCKS" "1" "
|
|
1
|
+
.TH "NUNJUCKS" "1" "June 2025" "" ""
|
|
2
2
|
.SH "NAME"
|
|
3
3
|
\fBnunjucks\fR - Template Rendering Engine
|
|
4
4
|
.SH "SYNOPSIS"
|
|
@@ -14,21 +14,21 @@ The following top-level options and arguments exist:
|
|
|
14
14
|
.IP \(bu 4
|
|
15
15
|
\[lB]\fB-h\fR|\fB--help\fR\[rB] Show usage help.
|
|
16
16
|
.IP \(bu 4
|
|
17
|
-
\[lB]\fB-V\fR|\fB--version\fR\[rB]
|
|
17
|
+
\[lB]\fB-V\fR|\fB--version\fR\[rB] Show program version information.
|
|
18
18
|
.IP \(bu 4
|
|
19
|
-
\[lB]\fB-c\fR|\fB--config\fR \fIconfig-file\fR\[rB]
|
|
19
|
+
\[lB]\fB-c\fR|\fB--config\fR \fIconfig-file\fR\[rB] Load Nunjucks configuration YAML file.
|
|
20
20
|
.IP \(bu 4
|
|
21
|
-
\[lB]\fB-C\fR|\fB--option\fR \fIkey\fR=\fIvalue\fR\[rB]
|
|
21
|
+
\[lB]\fB-C\fR|\fB--option\fR \fIkey\fR=\fIvalue\fR\[rB] Set Nunjucks configuration option.
|
|
22
22
|
.IP \(bu 4
|
|
23
|
-
\[lB]\fB-d\fR|\fB--defines\fR \fIcontext-file\fR\[rB]
|
|
23
|
+
\[lB]\fB-d\fR|\fB--defines\fR \fIcontext-file\fR\[rB] Load context definition YAML file. Can occur multiple times.
|
|
24
24
|
.IP \(bu 4
|
|
25
|
-
\[lB]\fB-D\fR|\fB--define\fR \fIkey\fR=\fIvalue\fR\[rB]
|
|
25
|
+
\[lB]\fB-D\fR|\fB--define\fR \fIkey\fR=\fIvalue\fR\[rB] Set context definition key/value. Can occur multiple times.
|
|
26
26
|
.IP \(bu 4
|
|
27
|
-
\[lB]\fB-e\fR|\fB--extension\fR \fImodule-name\fR\[rB]
|
|
27
|
+
\[lB]\fB-e\fR|\fB--extension\fR \fImodule-name\fR\[rB] Load Nunjucks JavaScript extension module (installed via NPM).
|
|
28
28
|
.IP \(bu 4
|
|
29
|
-
\[lB]\fB-o\fR|\fB--output\fR \fIoutput-file\fR|\fB-\fR\[rB]
|
|
29
|
+
\[lB]\fB-o\fR|\fB--output\fR \fIoutput-file\fR|\fB-\fR\[rB] Save output file (or stdout).
|
|
30
30
|
.IP \(bu 4
|
|
31
|
-
\[lB]\fB<input-file>\fR|\fB-\fR\[rB]
|
|
31
|
+
\[lB]\fB<input-file>\fR|\fB-\fR\[rB] Load input file (or stdin).
|
|
32
32
|
.RE 0
|
|
33
33
|
|
|
34
34
|
.SH "EXAMPLE"
|
package/nunjucks.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
3
|
** nunjucks -- Nunjucks Template Rendering Command-Line Interface
|
|
4
|
-
** Copyright (c) 2019-
|
|
4
|
+
** Copyright (c) 2019-2025 Dr. Ralf S. Engelschall <http://engelschall.com>
|
|
5
5
|
** Licensed under MIT <http://spdx.org/licenses/MIT.html>
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
/* own information */
|
|
9
|
-
const my = require("./package.json")
|
|
10
|
-
|
|
11
8
|
/* internal requirements */
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import fs from "node:fs"
|
|
10
|
+
import path from "node:path"
|
|
14
11
|
|
|
15
12
|
/* external requirements */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
import { Command } from "commander"
|
|
14
|
+
import chalk from "chalk"
|
|
15
|
+
import jsYAML from "js-yaml"
|
|
16
|
+
import nunjucks from "nunjucks"
|
|
17
|
+
import deepmerge from "deepmerge"
|
|
18
|
+
|
|
19
|
+
/* load my own information */
|
|
20
|
+
const my = JSON.parse(await fs.promises.readFile(new URL("./package.json", import.meta.url)))
|
|
21
21
|
|
|
22
22
|
/* parse command-line arguments */
|
|
23
|
-
const program = new
|
|
23
|
+
const program = new Command()
|
|
24
24
|
program.name("nunjucks")
|
|
25
25
|
.description("Nunjucks Template Rendering Command-Line Interface")
|
|
26
26
|
.showHelpAfterError("hint: use option --help for usage information")
|
|
@@ -47,7 +47,7 @@ if (argv.help) {
|
|
|
47
47
|
if (argv.version) {
|
|
48
48
|
console.log(`${my.name} ${my.version} (Node.js ${process.versions.node}, Nunjucks: ${my.dependencies.nunjucks})`)
|
|
49
49
|
console.log(`${my.description}`)
|
|
50
|
-
console.log(`Copyright (c) 2019-
|
|
50
|
+
console.log(`Copyright (c) 2019-2025 ${my.author.name} <${my.author.url}>`)
|
|
51
51
|
console.log(`Licensed under ${my.license} <http://spdx.org/licenses/${my.license}.html>`)
|
|
52
52
|
process.exit(0)
|
|
53
53
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rse/nunjucks-cli",
|
|
3
3
|
"publishConfig": { "access": "public" },
|
|
4
|
-
"version": "1.
|
|
5
|
-
"stdver": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
|
+
"stdver": "1.6.0-GA",
|
|
6
6
|
"description": "Nunjucks Template Rendering Command-Line Interface",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Dr. Ralf S. Engelschall",
|
|
@@ -21,26 +21,28 @@
|
|
|
21
21
|
"nunjucks": "nunjucks.js"
|
|
22
22
|
},
|
|
23
23
|
"man": "nunjucks.1",
|
|
24
|
+
"type": "module",
|
|
24
25
|
"dependencies": {
|
|
25
26
|
"nunjucks": "3.2.4",
|
|
26
|
-
"chalk": "4.1
|
|
27
|
-
"commander": "
|
|
27
|
+
"chalk": "5.4.1",
|
|
28
|
+
"commander": "14.0.0",
|
|
28
29
|
"js-yaml": "4.1.0",
|
|
29
30
|
"deepmerge": "4.3.1"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"eslint": "
|
|
33
|
-
"eslint
|
|
34
|
-
"
|
|
35
|
-
"eslint-plugin-
|
|
36
|
-
"eslint-plugin-
|
|
33
|
+
"eslint": "9.28.0",
|
|
34
|
+
"@eslint/js": "9.28.0",
|
|
35
|
+
"neostandard": "0.12.1",
|
|
36
|
+
"eslint-plugin-promise": "7.2.1",
|
|
37
|
+
"eslint-plugin-import": "2.31.0",
|
|
38
|
+
"eslint-plugin-n": "17.19.0",
|
|
39
|
+
"globals": "16.2.0",
|
|
37
40
|
"remark-cli": "12.0.1",
|
|
38
41
|
"remark": "15.0.1",
|
|
39
42
|
"remark-man": "9.0.0"
|
|
40
43
|
},
|
|
41
|
-
"upd": [ "!chalk" ],
|
|
42
44
|
"scripts": {
|
|
43
|
-
"lint": "eslint --config eslint.
|
|
45
|
+
"lint": "eslint --config eslint.mjs nunjucks.js",
|
|
44
46
|
"man": "remark --quiet --use remark-man --output nunjucks.1 nunjucks.md",
|
|
45
47
|
"test": "echo 'Hello, {{who}}!' | node nunjucks.js -D who=world -"
|
|
46
48
|
}
|
package/eslint.yaml
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
## nunjucks -- Nunjucks Template Rendering Command-Line Interface
|
|
3
|
-
## Copyright (c) 2019-2024 Dr. Ralf S. Engelschall <http://engelschall.com>
|
|
4
|
-
## Licensed under MIT <http://spdx.org/licenses/MIT.html>
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
extends:
|
|
10
|
-
- eslint:recommended
|
|
11
|
-
- eslint-config-standard
|
|
12
|
-
|
|
13
|
-
parserOptions:
|
|
14
|
-
ecmaVersion: 12
|
|
15
|
-
sourceType: module
|
|
16
|
-
ecmaFeatures:
|
|
17
|
-
jsx: false
|
|
18
|
-
|
|
19
|
-
env:
|
|
20
|
-
browser: false
|
|
21
|
-
node: true
|
|
22
|
-
mocha: false
|
|
23
|
-
commonjs: true
|
|
24
|
-
worker: false
|
|
25
|
-
serviceworker: false
|
|
26
|
-
|
|
27
|
-
globals:
|
|
28
|
-
process: true
|
|
29
|
-
|
|
30
|
-
rules:
|
|
31
|
-
# modified rules
|
|
32
|
-
indent: [ "error", 4, { "SwitchCase": 1 } ]
|
|
33
|
-
linebreak-style: [ "error", "unix" ]
|
|
34
|
-
semi: [ "error", "never" ]
|
|
35
|
-
operator-linebreak: [ "error", "after", { "overrides": { "&&": "before", "||": "before", ":": "after" } } ]
|
|
36
|
-
brace-style: [ "error", "stroustrup", { "allowSingleLine": true } ]
|
|
37
|
-
quotes: [ "error", "double" ]
|
|
38
|
-
|
|
39
|
-
# disabled rules
|
|
40
|
-
no-multi-spaces: off
|
|
41
|
-
no-multiple-empty-lines: off
|
|
42
|
-
key-spacing: off
|
|
43
|
-
object-property-newline: off
|
|
44
|
-
curly: off
|
|
45
|
-
space-in-parens: off
|
|
46
|
-
array-bracket-spacing: off
|
|
47
|
-
require-atomic-updates: off
|
|
48
|
-
dot-notation: off
|
|
49
|
-
no-whitespace-before-property: off
|
|
50
|
-
lines-between-class-members: off
|
|
51
|
-
|