@rse/nunjucks-cli 1.5.2 → 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 CHANGED
@@ -10,7 +10,7 @@ ARG IMAGE_RELEASE=20240311
10
10
  ARG IMAGE_ALIAS=latest
11
11
 
12
12
  # derive image from a certain base image
13
- FROM node:20.11-alpine3.18
13
+ FROM node:24-alpine3.21
14
14
 
15
15
  # add additional build tools
16
16
  RUN apk update && \
package/Dockerfile.mk CHANGED
@@ -20,7 +20,7 @@ IMAGE_CONFIG = \
20
20
 
21
21
  # ==== BUILD ====
22
22
  # (re)build a container image
23
- DOCKER_BUILD_FLAGS ?= --progress=plain --pull --no-cache
23
+ DOCKER_BUILD_FLAGS ?= --pull --no-cache
24
24
  build: Dockerfile
25
25
  @$(IMAGE_CONFIG) && \
26
26
  echo "++ building Docker image $${IMAGE_PREFIX}$${IMAGE_NAME}:$${IMAGE_VERSION}-$${IMAGE_RELEASE} ($${IMAGE_ALIAS})" && \
package/README.md CHANGED
@@ -98,7 +98,7 @@ Hello, world!
98
98
  License
99
99
  -------
100
100
 
101
- Copyright © 2019-2024 Dr. Ralf S. Engelschall (http://engelschall.com/)
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" "August 2023" "" ""
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] show program version information.
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] load Nunjucks configuration YAML file.
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] set Nunjucks configuration option.
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] load context definition YAML file.
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] set context definition key/value.
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] load Nunjucks JavaScript extension module (installed via NPM).
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] save output file (or stdout).
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] load input file (or stdin).
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-2024 Dr. Ralf S. Engelschall <http://engelschall.com>
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
- const fs = require("node:fs")
13
- const path = require("node:path")
9
+ import fs from "node:fs"
10
+ import path from "node:path"
14
11
 
15
12
  /* external requirements */
16
- const commander = require("commander")
17
- const chalk = require("chalk")
18
- const jsYAML = require("js-yaml")
19
- const nunjucks = require("nunjucks")
20
- const deepmerge = require("deepmerge")
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 commander.Command()
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-2024 ${my.author.name} <${my.author.url}>`)
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.2",
5
- "stdver": "1.5.2-GA",
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.0",
27
- "commander": "12.0.0",
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": "8.57.0",
33
- "eslint-config-standard": "17.1.0",
34
- "eslint-plugin-promise": "6.1.1",
35
- "eslint-plugin-import": "2.29.1",
36
- "eslint-plugin-node": "11.1.0",
37
- "remark-cli": "12.0.0",
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",
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.yaml nunjucks.js",
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
-