@thi.ng/tangle 1.0.8 → 1.1.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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-01-29T16:25:48Z
3
+ - **Last updated**: 2025-02-11T10:30:07Z
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,13 @@ 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.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/tangle@1.1.0) (2025-02-11)
15
+
16
+ #### 🚀 Features
17
+
18
+ - update CLI wrapper ([8fd0ffb](https://github.com/thi-ng/umbrella/commit/8fd0ffb))
19
+ - check if `bun` is available, otherwise fallback to `node`
20
+
14
21
  ### [0.2.17](https://github.com/thi-ng/umbrella/tree/@thi.ng/tangle@0.2.17) (2024-06-21)
15
22
 
16
23
  #### ♻️ Refactoring
package/bin/tangle CHANGED
@@ -2,11 +2,19 @@
2
2
 
3
3
  # https://stackoverflow.com/a/246128/294515
4
4
  SOURCE="${BASH_SOURCE[0]}"
5
- while [ -h "$SOURCE" ]; do
5
+ while [ -L "$SOURCE" ]; do
6
6
  DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
7
7
  SOURCE="$(readlink "$SOURCE")"
8
8
  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
9
9
  done
10
10
  DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
11
+ DIR="$(dirname $DIR)"
11
12
 
12
- /usr/bin/env node "$DIR/../cli.js" "$DIR" "$@"
13
+ # prefer using bun
14
+ if [ -x "$(command -v bun)" ]; then
15
+ CMD=bun
16
+ else
17
+ CMD=node
18
+ fi
19
+
20
+ /usr/bin/env $CMD "$DIR/cli.js" "$DIR" "$@"
package/cli.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export declare const INSTALL_DIR: string;
2
1
  export declare const PKG: any;
3
2
  export declare const APP_NAME: any;
4
3
  export declare const HEADER: string;
package/cli.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  } from "@thi.ng/args";
7
7
  import { readJSON, writeText } from "@thi.ng/file-io";
8
8
  import { ConsoleLogger } from "@thi.ng/logger";
9
- import { resolve } from "node:path";
9
+ import { join } from "node:path";
10
10
  import { tangleFile } from "./tangle.js";
11
11
  const argOpts = {
12
12
  noComments: flag({ default: false, desc: "don't generate comments" }),
@@ -16,8 +16,7 @@ const argOpts = {
16
16
  desc: "enable dry run (don't overwrite files)"
17
17
  })
18
18
  };
19
- const INSTALL_DIR = resolve(`${process.argv[2]}/..`);
20
- const PKG = readJSON(`${INSTALL_DIR}/package.json`);
19
+ const PKG = readJSON(join(process.argv[2], "package.json"));
21
20
  const APP_NAME = PKG.name.split("/")[1];
22
21
  const HEADER = `
23
22
  \u2588 \u2588 \u2588 \u2502
@@ -65,6 +64,5 @@ try {
65
64
  export {
66
65
  APP_NAME,
67
66
  HEADER,
68
- INSTALL_DIR,
69
67
  PKG
70
68
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/tangle",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
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,13 +41,13 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@thi.ng/api": "^8.11.19",
44
- "@thi.ng/args": "^2.3.57",
44
+ "@thi.ng/args": "^2.3.58",
45
45
  "@thi.ng/checks": "^3.6.22",
46
46
  "@thi.ng/compare": "^2.4.11",
47
47
  "@thi.ng/date": "^2.7.42",
48
48
  "@thi.ng/errors": "^2.5.25",
49
- "@thi.ng/file-io": "^2.1.25",
50
- "@thi.ng/logger": "^3.0.30",
49
+ "@thi.ng/file-io": "^2.1.26",
50
+ "@thi.ng/logger": "^3.1.0",
51
51
  "@thi.ng/strings": "^3.9.4",
52
52
  "@thi.ng/transducers": "^9.2.17"
53
53
  },
@@ -102,5 +102,5 @@
102
102
  "thi.ng": {
103
103
  "year": 2022
104
104
  },
105
- "gitHead": "fc1d498e8d4b690db873c30cc594352a804e7a65\n"
105
+ "gitHead": "035e34d5cbc5d1a7658ad9be0a1db160cee9ba52\n"
106
106
  }