@thi.ng/hdiff 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/hdiff@1.1.0) (2025-02-11)
15
+
16
+ #### 🚀 Features
17
+
18
+ - update CLI wrapper ([c92991c](https://github.com/thi-ng/umbrella/commit/c92991c))
19
+ - check if `bun` is available, otherwise fallback to `node`
20
+
14
21
  ### [0.3.129](https://github.com/thi-ng/umbrella/tree/@thi.ng/hdiff@0.3.129) (2024-06-21)
15
22
 
16
23
  #### ♻️ Refactoring
package/bin/hdiff 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" "$@"
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.js CHANGED
@@ -5,7 +5,7 @@ import { generateHtml } from "./html.js";
5
5
  let src1;
6
6
  let src2;
7
7
  let headerBody;
8
- const args = process.argv.slice(2);
8
+ const args = process.argv.slice(3);
9
9
  if (args.length === 3) {
10
10
  const [path, rev1, rev2] = args;
11
11
  src1 = execSync(`git show ${rev1}:${path}`).toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/hdiff",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "description": "String diffing w/ hiccup output for further processing, e.g. with @thi.ng/hdom, @thi.ng/hiccup. Includes CLI util to generate HTML, with theme support and code folding",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -96,5 +96,5 @@
96
96
  "status": "alpha",
97
97
  "year": 2018
98
98
  },
99
- "gitHead": "fc1d498e8d4b690db873c30cc594352a804e7a65\n"
99
+ "gitHead": "035e34d5cbc5d1a7658ad9be0a1db160cee9ba52\n"
100
100
  }