@thi.ng/tangle 1.1.33 → 1.1.35

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.
Files changed (4) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/README.md +16 -16
  3. package/cli.js +13 -15
  4. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-08-04T09:13:01Z
3
+ - **Last updated**: 2025-08-06T18:02:31Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -11,6 +11,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
11
11
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
12
12
  and/or version bumps of transitive dependencies.
13
13
 
14
+ ### [1.1.34](https://github.com/thi-ng/umbrella/tree/@thi.ng/tangle@1.1.34) (2025-08-06)
15
+
16
+ #### ♻️ Refactoring
17
+
18
+ - update CLI internals, rename `--debug` => `--verbose` ([5756b75](https://github.com/thi-ng/umbrella/commit/5756b75))
19
+
14
20
  ## [1.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/tangle@1.1.0) (2025-02-11)
15
21
 
16
22
  #### 🚀 Features
package/README.md CHANGED
@@ -189,24 +189,24 @@ lib.md (e.g. maybe a library of useful snippets for a larger project):
189
189
  Calling the `tangle` CLI util, we can process these example files and produce
190
190
  the following two outputs:
191
191
 
192
- ```bash
192
+ ```text
193
193
  npx @thi.ng/tangle --help
194
194
 
195
- # █ █ █ │
196
- # ██ █ │
197
- # █ █ █ █ █ █ █ █ │ @thi.ng/tangle 0.1.0
198
- # █ █ █ █ █ █ █ █ █ │ Literate programming code block tangling
199
- # █ │
200
- # █ █ │
201
- #
202
- # usage: tangle [OPTS] SOURCE-FILES(S) ...
203
- # tangle --help
204
- #
205
- # Flags:
206
- #
207
- # -d, --debug enable debug output
208
- # --dry-run enable dry run (don't overwrite files)
209
- # --no-comments don't generate comments
195
+ █ █ █ │
196
+ ██ █ │
197
+ █ █ █ █ █ █ █ █ │ @thi.ng/tangle v1.1.33
198
+ █ █ █ █ █ █ █ █ █ │ Literate programming code block tangling
199
+ █ │
200
+ █ █ │
201
+
202
+ usage: tangle [OPTS] SOURCE-FILES(S) ...
203
+ tangle --help
204
+
205
+ Flags:
206
+
207
+ --dry-run Dry run (no changes applied)
208
+ --no-comments don't generate comments
209
+ -v, --verbose Display extra information
210
210
  ```
211
211
 
212
212
  ```bash
package/cli.js CHANGED
@@ -1,5 +1,8 @@
1
1
  import {
2
+ ARG_DRY_RUN,
3
+ ARG_VERBOSE,
2
4
  ParseError,
5
+ THING_HEADER,
3
6
  flag,
4
7
  parse,
5
8
  usage
@@ -9,26 +12,21 @@ import { ConsoleLogger } from "@thi.ng/logger";
9
12
  import { join } from "node:path";
10
13
  import { tangleFile } from "./tangle.js";
11
14
  const argOpts = {
12
- noComments: flag({ default: false, desc: "don't generate comments" }),
13
- debug: flag({ alias: "d", default: false, desc: "enable debug output" }),
14
- dryRun: flag({
15
- default: false,
16
- desc: "enable dry run (don't overwrite files)"
17
- })
15
+ ...ARG_DRY_RUN,
16
+ ...ARG_VERBOSE,
17
+ noComments: flag({ default: false, desc: "don't generate comments" })
18
18
  };
19
19
  const PKG = readJSON(join(process.argv[2], "package.json"));
20
20
  const APP_NAME = PKG.name.split("/")[1];
21
- const HEADER = `
22
- \u2588 \u2588 \u2588 \u2502
23
- \u2588\u2588 \u2588 \u2502
24
- \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${PKG.name} ${PKG.version}
25
- \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 Literate programming code block tangling
26
- \u2588 \u2502
27
- \u2588 \u2588 \u2502
28
- `;
21
+ const HEADER = THING_HEADER(
22
+ PKG.name,
23
+ PKG.version,
24
+ "Literate programming code block tangling"
25
+ );
29
26
  const usageOpts = {
30
27
  lineWidth: process.stdout.columns,
31
28
  prefix: `${HEADER}
29
+
32
30
  usage: ${APP_NAME} [OPTS] SOURCE-FILES(S) ...
33
31
  ${APP_NAME} --help
34
32
 
@@ -46,7 +44,7 @@ try {
46
44
  const { result: opts, rest } = result;
47
45
  if (!rest.length) showUsage();
48
46
  let ctx = {
49
- logger: new ConsoleLogger("tangle", opts.debug ? "DEBUG" : "INFO"),
47
+ logger: new ConsoleLogger("tangle", opts.verbose ? "DEBUG" : "INFO"),
50
48
  opts: {
51
49
  comments: opts.noComments !== true
52
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/tangle",
3
- "version": "1.1.33",
3
+ "version": "1.1.35",
4
4
  "description": "Literate programming code block tangling / codegen utility, inspired by org-mode & noweb",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -41,15 +41,15 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@thi.ng/api": "^8.12.1",
44
- "@thi.ng/args": "^2.8.6",
45
- "@thi.ng/checks": "^3.7.15",
44
+ "@thi.ng/args": "^2.9.1",
45
+ "@thi.ng/checks": "^3.7.16",
46
46
  "@thi.ng/compare": "^2.4.27",
47
- "@thi.ng/date": "^2.7.61",
47
+ "@thi.ng/date": "^2.7.62",
48
48
  "@thi.ng/errors": "^2.5.41",
49
- "@thi.ng/file-io": "^2.2.6",
49
+ "@thi.ng/file-io": "^2.2.7",
50
50
  "@thi.ng/logger": "^3.1.16",
51
51
  "@thi.ng/strings": "^3.9.21",
52
- "@thi.ng/transducers": "^9.6.6"
52
+ "@thi.ng/transducers": "^9.6.7"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/node": "^24.1.0",
@@ -103,5 +103,5 @@
103
103
  "thi.ng": {
104
104
  "year": 2022
105
105
  },
106
- "gitHead": "0bcedf8d1dd4f30cd06bb2c668599628f2f0141e\n"
106
+ "gitHead": "9a998c33c7a524c95b552b9cbdc2734d28a5dafc\n"
107
107
  }