pomotty 1.0.0 → 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iririn1998
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ja.md ADDED
@@ -0,0 +1,53 @@
1
+ # pomotty
2
+
3
+ [English](./README.md) | 日本語
4
+
5
+ Node.js 22以降で利用できる、ターミナル用のポモドーロタイマーです。
6
+
7
+ ```shell
8
+ npx pomotty
9
+ ```
10
+
11
+ グローバルにインストールする場合は、次のコマンドを実行します。
12
+
13
+ ```shell
14
+ npm install --global pomotty
15
+ pomotty
16
+ ```
17
+
18
+ `pomotty`で作業開始の選択メニューを表示します。上下キーで`OK`を選んで
19
+ Enterを押すと15分の作業と5分の休憩を3セット実行し、`NG`を選ぶとタイマーを
20
+ 開始せず終了します。
21
+
22
+ ```shell
23
+ pomotty
24
+ ```
25
+
26
+ 作業時間と休憩時間は、1〜1440の整数(分)で指定できます。片方だけを指定した
27
+ 場合、もう片方には既定値が使われます。
28
+
29
+ ```shell
30
+ pomotty --work 30 --break 10
31
+ pomotty --work=45 --break=15
32
+ ```
33
+
34
+ `--loop`で作業・休憩の繰り返し回数を指定できます。既定値は3で、1以上の整数
35
+ (最大9007199254740991)を受け付けます。開始確認は最初の1回だけで、最後の休憩が
36
+ 完了すると終了します。
37
+
38
+ ```shell
39
+ pomotty --loop 5
40
+ pomotty --work=25 --break=5 --loop=2
41
+ ```
42
+
43
+ 利用可能なオプションは、次のコマンドで確認できます。
44
+
45
+ ```shell
46
+ pomotty --help
47
+ ```
48
+
49
+ 作業と休憩の完了時には、それぞれ異なる通知音を再生します。macOSでは
50
+ `afplay`、Linuxでは`paplay`または`aplay`、WindowsではPowerShellを利用し、
51
+ 再生できない環境では異なる回数のターミナルベルに切り替わります。
52
+
53
+ 開発手順とnpmへの公開・更新手順は[開発ガイド](./DEVELOPMENT.ja.md)を参照してください。
package/README.md CHANGED
@@ -1,77 +1,58 @@
1
1
  # pomotty
2
2
 
3
- Node.js 22以降で利用できる、ターミナル用のポモドーロタイマーです。
3
+ English | [日本語](./README.ja.md)
4
+
5
+ A Pomodoro timer for the terminal, available on Node.js `^22.18.0 || >=24.11.0`.
4
6
 
5
7
  ```shell
6
8
  npx pomotty
7
9
  ```
8
10
 
9
- グローバルにインストールする場合は、次のコマンドを実行します。
11
+ To install it globally, run:
10
12
 
11
13
  ```shell
12
14
  npm install --global pomotty
13
15
  pomotty
14
16
  ```
15
17
 
16
- `pomotty`で作業開始の選択メニューを表示します。上下キーで`OK`を選んで
17
- Enterを押すと15分の作業と5分の休憩を3セット実行し、`NG`を選ぶとタイマーを
18
- 開始せず終了します。
18
+ Run `pomotty` to display the start menu. Use the up and down arrow keys to select
19
+ `OK`, then press Enter to start 3 cycles of 15 minutes of work and 5 minutes of
20
+ break. Select `NG` to exit without starting the timer.
19
21
 
20
22
  ```shell
21
23
  pomotty
22
24
  ```
23
25
 
24
- 作業時間と休憩時間は、1〜1440の整数(分)で指定できます。片方だけを指定した
25
- 場合、もう片方には既定値が使われます。
26
+ Work and break durations accept whole numbers from 1 to 1440, in minutes. If you
27
+ specify only one duration, the other uses its default value.
26
28
 
27
29
  ```shell
28
30
  pomotty --work 30 --break 10
29
31
  pomotty --work=45 --break=15
30
32
  ```
31
33
 
32
- `--roop`で作業・休憩の繰り返し回数を指定できます。既定値は3で、1以上の整数
33
- (最大9007199254740991)を受け付けます。開始確認は最初の1回だけで、最後の休憩が
34
- 完了すると終了します。
34
+ Use `--loop` to set the number of work and break cycles. It defaults to 3 and
35
+ accepts whole numbers from 1 to 9007199254740991. The start confirmation appears
36
+ only once, and the timer exits after the final break finishes.
35
37
 
36
38
  ```shell
37
- pomotty --roop 5
38
- pomotty --work=25 --break=5 --roop=2
39
+ pomotty --loop 5
40
+ pomotty --work=25 --break=5 --loop=2
39
41
  ```
40
42
 
41
- 利用可能なオプションは、次のコマンドで確認できます。
43
+ To see the available options, run:
42
44
 
43
45
  ```shell
44
46
  pomotty --help
45
47
  ```
46
48
 
47
- 作業と休憩の完了時には、それぞれ異なる通知音を再生します。macOSでは
48
- `afplay`、Linuxでは`paplay`または`aplay`、WindowsではPowerShellを利用し、
49
- 再生できない環境では異なる回数のターミナルベルに切り替わります。
50
-
51
- ## 開発
52
-
53
- ```shell
54
- pnpm install --frozen-lockfile
55
- pnpm start
56
- pnpm test
57
- pnpm lint
58
- pnpm format:check
59
- ```
49
+ Different notification sounds play when work and break sessions end. Sound
50
+ playback uses `afplay` on macOS, `paplay` or `aplay` on Linux, and PowerShell on
51
+ Windows. If audio playback is unavailable, the timer falls back to different
52
+ numbers of terminal bells for work and break notifications.
60
53
 
61
- ## npmへの公開・更新
54
+ For development and npm publishing instructions, see the [development guide](./DEVELOPMENT.md).
62
55
 
63
- 開発と公開にはpnpmを使用します。初回または認証が切れた場合は
64
- `pnpm login --registry=https://registry.npmjs.org/`でnpmへログインします。
65
-
66
- 更新時は変更内容に応じて`pnpm version patch`、`pnpm version minor`、
67
- `pnpm version major`で未公開のバージョンへ更新します。
68
- これらのコマンドはGitコミットとタグも作成するため、先に変更をコミットしてください。
69
-
70
- ```shell
71
- pnpm publish --dry-run --no-git-checks
72
- pnpm publish
73
- ```
56
+ ## License
74
57
 
75
- 公開前にテスト・lint・フォーマット検証が実行され、パッケージ作成時にビルドされます。
76
- 配布物にはCLI、通知音、README、package.jsonが含まれます。
77
- 公開時にnpmから認証を求められたら、表示される案内に従って完了してください。
58
+ MIT
@@ -30,7 +30,7 @@ const OPTIONS = [
30
30
  },
31
31
  {
32
32
  description: `Work-break repetitions (positive integer, default: 3)`,
33
- name: "--roop",
33
+ name: "--loop",
34
34
  valueName: "<count>"
35
35
  },
36
36
  {
@@ -236,12 +236,12 @@ const EQUALS_SIGN_NOT_FOUND = -1;
236
236
  const HELP_OPTIONS = ["--help", "-h"];
237
237
  const MAXIMUM_DURATION_MINUTES = 1440;
238
238
  const NEXT_ARGUMENT_OFFSET = 1;
239
- const ROOP_PATTERN = /^[1-9][0-9]*$/u;
240
- const isNumericOption = (value) => value === "--break" || value === "--work" || value === "--roop";
239
+ const LOOP_PATTERN = /^[1-9][0-9]*$/u;
240
+ const isNumericOption = (value) => value === "--break" || value === "--work" || value === "--loop";
241
241
  const isHelpOption = (value) => HELP_OPTIONS.some((option) => option === value);
242
242
  const createValueError = (option) => {
243
243
  let maximum = MAXIMUM_DURATION_MINUTES;
244
- if (option === "--roop") maximum = Number.MAX_SAFE_INTEGER;
244
+ if (option === "--loop") maximum = Number.MAX_SAFE_INTEGER;
245
245
  return {
246
246
  kind: "error",
247
247
  message: `Error: ${option} requires an integer from 1 to ${maximum}.\n`
@@ -253,8 +253,8 @@ const createDuplicateError = (option) => ({
253
253
  });
254
254
  const parseNumericValue = (option, value) => {
255
255
  let pattern = DURATION_PATTERN, maximum = MAXIMUM_DURATION_MINUTES;
256
- if (option === "--roop") {
257
- pattern = ROOP_PATTERN;
256
+ if (option === "--loop") {
257
+ pattern = LOOP_PATTERN;
258
258
  maximum = Number.MAX_SAFE_INTEGER;
259
259
  }
260
260
  if (typeof value !== "string" || !pattern.test(value)) return;
@@ -278,7 +278,7 @@ const parseNumericArgument = (argument, nextArgument) => {
278
278
  const parseCliArguments = (arguments_) => {
279
279
  if (arguments_.some((argument) => isHelpOption(argument))) return { kind: "help" };
280
280
  const specifiedOptions = /* @__PURE__ */ new Set();
281
- let breakDurationMinutes = 5, roopCount = 3, workDurationMinutes = 15;
281
+ let breakDurationMinutes = 5, loopCount = 3, workDurationMinutes = 15;
282
282
  for (let argumentIndex = ARGUMENTS_START_INDEX; argumentIndex < arguments_.length; argumentIndex += ARGUMENT_INDEX_INCREMENT) {
283
283
  const argument = arguments_[argumentIndex] ?? "", { consumesNextArgument, optionName, value } = parseNumericArgument(argument, arguments_[argumentIndex + NEXT_ARGUMENT_OFFSET]);
284
284
  if (!isNumericOption(optionName)) return {
@@ -291,13 +291,13 @@ const parseCliArguments = (arguments_) => {
291
291
  specifiedOptions.add(optionName);
292
292
  if (consumesNextArgument) argumentIndex += NEXT_ARGUMENT_OFFSET;
293
293
  if (optionName === "--work") workDurationMinutes = numericValue;
294
- else if (optionName === "--roop") roopCount = numericValue;
294
+ else if (optionName === "--loop") loopCount = numericValue;
295
295
  else breakDurationMinutes = numericValue;
296
296
  }
297
297
  return {
298
298
  breakDurationMinutes,
299
299
  kind: "run",
300
- roopCount,
300
+ loopCount,
301
301
  workDurationMinutes
302
302
  };
303
303
  };
@@ -454,7 +454,7 @@ const runCli = async ({ arguments_ = process$1.argv.slice(CLI_ARGUMENTS_START_IN
454
454
  writeOutput("⏹️ Work was not started.\n");
455
455
  return SUCCESS_EXIT_CODE;
456
456
  }
457
- for (let cycleIndex = 0; cycleIndex < parsedArguments.roopCount; cycleIndex += COUNT_INCREMENT) await runPomodoroCycle({
457
+ for (let cycleIndex = 0; cycleIndex < parsedArguments.loopCount; cycleIndex += COUNT_INCREMENT) await runPomodoroCycle({
458
458
  breakDurationMs: parsedArguments.breakDurationMinutes * MILLISECONDS_PER_MINUTE,
459
459
  onPhaseCompleted: (phase) => {
460
460
  writeOutput(`✅ ${PHASE_NAMES[phase]} complete.\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pomotty",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "An interactive terminal Pomodoro timer with configurable work and break sessions and sound notifications.",
5
5
  "keywords": [
6
6
  "cli",
@@ -12,8 +12,8 @@
12
12
  "bugs": {
13
13
  "url": "https://github.com/iririn1998/pomotty/issues"
14
14
  },
15
- "license": "ISC",
16
- "author": "",
15
+ "license": "MIT",
16
+ "author": "iririn1998",
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "git+https://github.com/iririn1998/pomotty.git"
@@ -45,7 +45,7 @@
45
45
  }
46
46
  },
47
47
  "engines": {
48
- "node": ">=22"
48
+ "node": "^22.18.0 || >=24.11.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "rolldown -c rolldown.config.mjs",