@johnowennixon/diffdash 1.1.0 → 1.2.1

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 (50) hide show
  1. package/dist/package.json +80 -0
  2. package/dist/src/diffdash.js +26 -0
  3. package/dist/src/lib_abort.js +21 -0
  4. package/dist/src/lib_ansi.js +21 -0
  5. package/dist/src/lib_char_box.js +3 -0
  6. package/dist/src/lib_char_control.js +8 -0
  7. package/dist/src/lib_char_digit.js +10 -0
  8. package/dist/src/lib_char_empty.js +1 -0
  9. package/dist/src/lib_char_punctuation.js +37 -0
  10. package/dist/src/lib_cli.js +187 -0
  11. package/dist/src/lib_datetime.js +62 -0
  12. package/dist/src/lib_debug.js +68 -0
  13. package/dist/src/lib_diffdash_add.js +23 -0
  14. package/dist/src/lib_diffdash_cli.js +34 -0
  15. package/dist/src/lib_diffdash_config.js +52 -0
  16. package/dist/src/lib_diffdash_llm.js +24 -0
  17. package/dist/src/lib_diffdash_sequence.js +199 -0
  18. package/dist/src/lib_duration.js +29 -0
  19. package/dist/src/lib_enabled.js +30 -0
  20. package/dist/src/lib_env.js +18 -0
  21. package/dist/src/lib_error.js +14 -0
  22. package/dist/src/lib_file_path.js +22 -0
  23. package/dist/src/lib_git_message_display.js +4 -0
  24. package/dist/src/lib_git_message_generate.js +55 -0
  25. package/dist/src/lib_git_message_prompt.js +72 -0
  26. package/dist/src/lib_git_message_schema.js +16 -0
  27. package/dist/src/lib_git_message_validate.js +61 -0
  28. package/dist/src/lib_git_simple_open.js +24 -0
  29. package/dist/src/lib_git_simple_staging.js +41 -0
  30. package/dist/src/lib_inspect.js +4 -0
  31. package/dist/src/lib_llm_access.js +69 -0
  32. package/dist/src/lib_llm_chat.js +66 -0
  33. package/dist/src/lib_llm_config.js +23 -0
  34. package/dist/src/lib_llm_list.js +21 -0
  35. package/dist/src/lib_llm_model.js +336 -0
  36. package/dist/src/lib_llm_provider.js +63 -0
  37. package/dist/src/lib_llm_tokens.js +14 -0
  38. package/dist/src/lib_package.js +7 -0
  39. package/dist/src/lib_parse_number.js +13 -0
  40. package/dist/src/lib_stdio_write.js +14 -0
  41. package/dist/src/lib_string_types.js +1 -0
  42. package/dist/src/lib_tell.js +58 -0
  43. package/dist/src/lib_tui_block.js +10 -0
  44. package/dist/src/lib_tui_justify.js +29 -0
  45. package/dist/src/lib_tui_readline.js +16 -0
  46. package/dist/src/lib_tui_table.js +20 -0
  47. package/dist/src/lib_tui_truncate.js +13 -0
  48. package/dist/src/lib_type_infer.js +1 -0
  49. package/package.json +30 -24
  50. package/out/diffdash.cjs +0 -32581
@@ -0,0 +1,16 @@
1
+ import { createInterface } from "node:readline";
2
+ import { ansi_blue, ansi_bold } from "./lib_ansi.js";
3
+ export async function tui_readline_confirm(message) {
4
+ const query = ansi_bold(ansi_blue(`${message} [Y/n] `));
5
+ const rl = createInterface({
6
+ input: process.stdin,
7
+ output: process.stdout,
8
+ });
9
+ return new Promise((resolve) => {
10
+ rl.question(query, (answer) => {
11
+ rl.close();
12
+ const normalized_answer = answer.trim().toLowerCase();
13
+ resolve(normalized_answer === "" || normalized_answer === "y" || normalized_answer === "yes");
14
+ });
15
+ });
16
+ }
@@ -0,0 +1,20 @@
1
+ import cli_table3 from "cli-table3";
2
+ import { ansi_bold } from "./lib_ansi.js";
3
+ export class TuiTable {
4
+ table;
5
+ count = 0;
6
+ constructor({ headings }) {
7
+ const constructor_options = { style: { head: [] } };
8
+ if (headings) {
9
+ constructor_options.head = headings.map((heading) => ansi_bold(heading));
10
+ }
11
+ this.table = new cli_table3(constructor_options);
12
+ }
13
+ push(row) {
14
+ this.table.push(row);
15
+ this.count++;
16
+ }
17
+ toString() {
18
+ return this.table.toString();
19
+ }
20
+ }
@@ -0,0 +1,13 @@
1
+ import { ELLIPSIS, SPACE } from "./lib_char_punctuation.js";
2
+ export function tui_truncate_plain(n, s, truncate = true) {
3
+ return truncate ? s.slice(0, n) : s;
4
+ }
5
+ export function tui_truncate_ellipsis(n, s, truncate = true) {
6
+ if (n === undefined || !truncate) {
7
+ return s.slice();
8
+ }
9
+ if (s.length <= n) {
10
+ return s.slice();
11
+ }
12
+ return s.slice(0, n - 2) + SPACE + ELLIPSIS;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnowennixon/diffdash",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "A command-line tool to generate Git commit messages using AI",
5
5
  "license": "0BSD",
6
6
  "author": "John Owen Nixon",
@@ -13,56 +13,62 @@
13
13
  },
14
14
  "type": "module",
15
15
  "files": [
16
- "out/diffdash.cjs"
16
+ "dist"
17
17
  ],
18
18
  "bin": {
19
- "diffdash": "out/diffdash.cjs"
19
+ "diffdash": "dist/src/diffdash.js"
20
20
  },
21
21
  "dependencies": {
22
22
  "@ai-sdk/anthropic": "1.2.12",
23
23
  "@ai-sdk/deepseek": "0.2.14",
24
- "@ai-sdk/google": "1.2.19",
24
+ "@ai-sdk/google": "1.2.21",
25
25
  "@ai-sdk/openai": "1.3.22",
26
- "@openrouter/ai-sdk-provider": "0.7.1",
27
- "@requesty/ai-sdk": "0.0.7",
26
+ "@openrouter/ai-sdk-provider": "0.7.2",
27
+ "@requesty/ai-sdk": "0.0.9",
28
28
  "ai": "4.3.16",
29
29
  "ansis": "4.1.0",
30
30
  "argparse": "2.0.1",
31
31
  "cli-table3": "0.6.5",
32
32
  "simple-git": "3.28.0",
33
- "zod": "3.25.55"
33
+ "zod": "3.25.67"
34
34
  },
35
35
  "devDependencies": {
36
- "@biomejs/biome": "1.9.4",
36
+ "@biomejs/biome": "2.0.6",
37
37
  "@eslint/eslintrc": "3.3.1",
38
- "@eslint/js": "9.28.0",
39
- "@stylistic/eslint-plugin": "4.4.1",
38
+ "@eslint/js": "9.30.0",
39
+ "@johnowennixon/add-shebangs": "1.1.0",
40
+ "@johnowennixon/chmodx": "2.0.0",
41
+ "@stylistic/eslint-plugin": "5.1.0",
40
42
  "@types/argparse": "2.0.17",
41
- "@types/node": "22.15.30",
42
- "@typescript-eslint/eslint-plugin": "8.33.1",
43
- "@typescript-eslint/parser": "8.33.1",
44
- "esbuild": "0.25.5",
45
- "eslint": "9.28.0",
46
- "eslint-import-resolver-typescript": "4.4.3",
47
- "eslint-plugin-import-x": "4.15.1",
48
- "eslint-plugin-sonarjs": "3.0.2",
43
+ "@types/node": "24.0.8",
44
+ "@typescript-eslint/eslint-plugin": "8.35.1",
45
+ "@typescript-eslint/parser": "8.35.1",
46
+ "eslint": "9.30.0",
47
+ "eslint-import-resolver-typescript": "4.4.4",
48
+ "eslint-plugin-import-x": "4.16.1",
49
+ "eslint-plugin-sonarjs": "3.0.4",
49
50
  "eslint-plugin-unicorn": "59.0.1",
50
- "globals": "16.2.0",
51
- "knip": "5.60.2",
51
+ "globals": "16.3.0",
52
+ "knip": "5.61.3",
52
53
  "markdownlint-cli2": "0.18.1",
53
54
  "npm-run-all2": "8.0.4",
54
- "oxlint": "0.17.0",
55
+ "oxlint": "1.4.0",
55
56
  "rimraf": "6.0.1",
56
57
  "typescript": "5.8.3",
57
- "typescript-eslint": "8.33.1"
58
+ "typescript-eslint": "8.35.1"
58
59
  },
59
60
  "scripts": {
60
- "build": "echo 'Building with esbuild' && rimraf out && node esbuild.config.js",
61
+ "build": "run-s -ls build:clean build:tsc build:shebang build:chmod",
62
+ "build:chmod": "echo 'Changing bin files to be executable' && chmodx --package",
63
+ "build:clean": "echo 'Removing dist' && rimraf dist",
64
+ "build:shebang": "echo 'Fixing the shebangs' && add-shebangs --node --exclude 'dist/**/lib_*.js' 'dist/**/*.js'",
65
+ "build:tsc": "echo 'Transpiling TypeScript to dist (using tsc)' && tsc --erasableSyntaxOnly --libReplacement false",
61
66
  "fix": "run-s -ls fix:biome fix:markdownlint",
62
67
  "fix:biome": "echo 'Fixing with Biome' && biome check --write",
68
+ "fix:eslint": "echo 'Fixing with ESLint' && eslint --fix",
63
69
  "fix:markdownlint": "echo 'Fixing with markdownlint' && markdownlint-cli2 '**/*.md' --fix",
64
70
  "fix:oxlint": "echo 'Fixing with oxlint' && oxlint --fix",
65
- "lint": "run-s -ls lint:biome lint:oxlint lint:tsc lint:knip lint:markdownlint",
71
+ "lint": "run-s -ls lint:biome lint:oxlint lint:knip lint:markdownlint",
66
72
  "lint:biome": "echo 'Linting with Biome' && biome check",
67
73
  "lint:eslint": "echo 'Linting with ESLint' && eslint",
68
74
  "lint:knip": "echo 'Linting with Knip' && knip",