@snelusha/noto 1.0.5 → 1.0.7

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +48 -13
  3. package/package.json +8 -7
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <h1 align="center">noto ✨</h1>
2
2
  <p align="center"><sup>(/nōto/, <em>notebook</em> in Japanese)</sup></p>
3
- <img src="https://github.com/snelusha/static/blob/main/noto/banner.png?raw=true" align="center"></img>
3
+ <img src="https://github.com/snelusha/static/blob/main/noto/banner-sharp.png?raw=true" align="center"></img>
4
4
 
5
5
  ## Features
6
6
 
package/dist/index.js CHANGED
@@ -64,7 +64,8 @@ var AvailableModelsSchema = z.enum([
64
64
  "gemini-1.5-pro-latest",
65
65
  "gemini-2.0-flash-lite-preview-02-05",
66
66
  "gemini-2.0-flash-exp",
67
- "gemini-2.0-pro-exp-02-05"
67
+ "gemini-2.0-pro-exp-02-05",
68
+ "gemini-2.5-pro-exp-03-25"
68
69
  ]);
69
70
 
70
71
  // src/utils/storage.ts
@@ -175,7 +176,7 @@ var isFirstCommit = async () => {
175
176
  };
176
177
  var getStagedDiff = async () => {
177
178
  try {
178
- return git.diff(["--cached"]);
179
+ return git.diff(["--cached", "--", ":!*.lock"]);
179
180
  } catch {
180
181
  return null;
181
182
  }
@@ -190,6 +191,14 @@ var commit = async (message) => {
190
191
  return false;
191
192
  }
192
193
  };
194
+ var push = async () => {
195
+ try {
196
+ const result = await git.push();
197
+ return result.update || result.pushed && result.pushed.length > 0;
198
+ } catch {
199
+ return false;
200
+ }
201
+ };
193
202
 
194
203
  // src/middleware/git.ts
195
204
  var withRepository = (fn, options = { enabled: true }) => {
@@ -198,20 +207,22 @@ var withRepository = (fn, options = { enabled: true }) => {
198
207
  if (!isRepo && options.enabled) {
199
208
  p2.log.error(
200
209
  dedent2`${color2.red("no git repository found in cwd.")}
201
- ${color2.dim(`run ${color2.cyan("`git init`")} to initialize a new repository.`)}`
210
+ ${color2.dim(`run ${color2.cyan("`git init`")} to initialize a new repository.`)}`
202
211
  );
203
212
  return await exit(1);
204
213
  }
205
214
  opts.isRepo = isRepo;
206
- const diff = await getStagedDiff();
207
- if (!diff && options.enabled) {
208
- p2.log.error(
209
- dedent2`${color2.red("no staged changes found.")}
210
- ${color2.dim(`run ${color2.cyan("`git add <file>`")} or ${color2.cyan("`git add .`")} to stage changes.`)}`
211
- );
212
- return await exit(1);
215
+ if (isRepo) {
216
+ const diff = await getStagedDiff();
217
+ if (!diff && options.enabled) {
218
+ p2.log.error(
219
+ dedent2`${color2.red("no staged changes found.")}
220
+ ${color2.dim(`run ${color2.cyan("`git add <file>`")} or ${color2.cyan("`git add .`")} to stage changes.`)}`
221
+ );
222
+ return await exit(1);
223
+ }
224
+ opts.diff = diff;
213
225
  }
214
- opts.diff = diff;
215
226
  return fn(opts);
216
227
  };
217
228
  };
@@ -250,7 +261,8 @@ var models = {
250
261
  "gemini-2.0-flash-lite-preview-02-05"
251
262
  ),
252
263
  "gemini-2.0-flash-exp": google("gemini-2.0-flash-exp"),
253
- "gemini-2.0-pro-exp-02-05": google("gemini-2.0-pro-exp-02-05")
264
+ "gemini-2.0-pro-exp-02-05": google("gemini-2.0-pro-exp-02-05"),
265
+ "gemini-2.5-pro-exp-03-25": google("gemini-2.5-pro-exp-03-25")
254
266
  };
255
267
  var availableModels = Object.keys(models);
256
268
  var getModel = async () => {
@@ -350,6 +362,12 @@ var command = {
350
362
  alias: "-a",
351
363
  description: "commit the generated message directly"
352
364
  },
365
+ {
366
+ type: Boolean,
367
+ flag: "--push",
368
+ alias: "-p",
369
+ description: "commit and push the changes"
370
+ },
353
371
  {
354
372
  type: Boolean,
355
373
  flag: "--edit",
@@ -414,6 +432,14 @@ var command = {
414
432
  p3.log.error(color3.red("failed to commit changes"));
415
433
  }
416
434
  }
435
+ if (options["--push"]) {
436
+ const success = await push();
437
+ if (success) {
438
+ p3.log.step(color3.dim("push successful"));
439
+ } else {
440
+ p3.log.error(color3.red("failed to push changes"));
441
+ }
442
+ }
417
443
  return await exit(0);
418
444
  } catch {
419
445
  spin.stop(color3.red("failed to generate commit message"), 1);
@@ -574,6 +600,15 @@ var model = {
574
600
  p5.log.error(color5.red("nothing changed!"));
575
601
  return await exit(1);
576
602
  }
603
+ if (model2 === "gemini-2.5-pro-exp-03-25") {
604
+ const confirm2 = await p5.confirm({
605
+ message: "this model has a rate limit of 5 RPM (requests per minute) 50 requests per day, do you want to continue?"
606
+ });
607
+ if (p5.isCancel(confirm2) || !confirm2) {
608
+ p5.log.error(color5.red("nothing changed!"));
609
+ return await exit(1);
610
+ }
611
+ }
577
612
  await StorageManager.update((current) => ({
578
613
  ...current,
579
614
  llm: {
@@ -674,7 +709,7 @@ var listCommand = () => {
674
709
  };
675
710
 
676
711
  // package.json
677
- var version = "1.0.5";
712
+ var version = "1.0.7";
678
713
 
679
714
  // src/index.ts
680
715
  var globalSpec = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snelusha/noto",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Generate clean commit messages in a snap! ✨",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,10 +9,11 @@
9
9
  "email": "hello@snelusha.dev",
10
10
  "url": "https://snelusha.dev"
11
11
  },
12
- "homepage": "https://github.com/snelusha/noto",
12
+ "homepage": "https://noto.snelusha.dev",
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "git+https://github.com/snelusha/noto.git"
15
+ "url": "git+https://github.com/snelusha/noto.git",
16
+ "directory": "packages/cli"
16
17
  },
17
18
  "bugs": {
18
19
  "url": "https://github.com/snelusha/noto/issues"
@@ -41,21 +42,21 @@
41
42
  "cli"
42
43
  ],
43
44
  "devDependencies": {
44
- "@types/node": "^22.13.10",
45
+ "@types/node": "^22.13.13",
45
46
  "tsup": "^8.4.0",
46
47
  "typescript": "^5.8.2"
47
48
  },
48
49
  "dependencies": {
49
- "@ai-sdk/google": "^1.1.25",
50
+ "@ai-sdk/google": "^1.2.3",
50
51
  "@clack/prompts": "^0.10.0",
51
- "ai": "^4.1.61",
52
+ "ai": "^4.2.5",
52
53
  "arg": "^5.0.2",
53
54
  "clipboardy": "^4.0.0",
54
55
  "dedent": "^1.5.3",
55
56
  "picocolors": "^1.1.1",
56
57
  "simple-git": "^3.27.0",
57
58
  "tinyexec": "^0.3.2",
58
- "vitest": "^3.0.8",
59
+ "vitest": "^3.0.9",
59
60
  "zod": "^3.24.2"
60
61
  }
61
62
  }