cronfish 0.12.0 → 0.12.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.
package/README.md CHANGED
@@ -7,6 +7,7 @@
7
7
  <p align="center"><strong>A file-based job scheduler for macOS. Drop a script in a folder; launchd runs it on a schedule.</strong></p>
8
8
 
9
9
  <p align="center">
10
+ <a href="https://www.npmjs.com/package/cronfish"><img src="https://img.shields.io/npm/v/cronfish?logo=npm" alt="npm"></a>
10
11
  <a href="https://github.com/goldcaddy77/cronfish/actions/workflows/ci.yml"><img src="https://github.com/goldcaddy77/cronfish/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
11
12
  <img src="https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.0-black?logo=bun" alt="Bun >= 1.0">
12
13
  <img src="https://img.shields.io/badge/platform-macOS-lightgrey?logo=apple" alt="macOS">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cronfish",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "A file-based job scheduler for macOS. Drop a script in a folder; launchd runs it on a schedule.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.ts CHANGED
@@ -27,8 +27,11 @@ import {
27
27
  } from "./prune.ts";
28
28
  import { Database } from "bun:sqlite";
29
29
  import { startUiServer } from "./ui/server.ts";
30
+ import pkg from "../package.json" with { type: "json" };
30
31
 
31
- const VERSION = "0.11.0";
32
+ // Single source of truth: package.json. semantic-release bumps it on release,
33
+ // so `cronfish --version` can never drift from the published version again.
34
+ const VERSION = pkg.version;
32
35
 
33
36
  const CONSUMER_ROOT = process.env.CRONFISH_CONSUMER_ROOT || process.cwd();
34
37
  const CRON_DIR = join(CONSUMER_ROOT, "cron");
@@ -99,7 +99,33 @@ function splitTopLevelCommas(inner: string): string[] {
99
99
  function parseInlineList(raw: string, lineNo: number): string[] {
100
100
  const t = raw.trim();
101
101
  const lb = t.indexOf("[");
102
- const rb = t.lastIndexOf("]");
102
+ // Find the matching close bracket by scanning from `[`, respecting quotes
103
+ // and nesting — not lastIndexOf("]"), which a `]` inside a trailing comment
104
+ // (`[A, B] # arr[0]`) or a quoted item would defeat. Everything after the
105
+ // matched `]` (e.g. a trailing comment) is ignored.
106
+ let rb = -1;
107
+ let s: string | null = null;
108
+ let d = 0;
109
+ for (let i = lb; i >= 0 && i < t.length; i++) {
110
+ const c = t[i];
111
+ const prev = t[i - 1];
112
+ if (s) {
113
+ if (c === s && prev !== "\\") s = null;
114
+ continue;
115
+ }
116
+ if (c === '"' || c === "'" || c === "`") {
117
+ s = c;
118
+ continue;
119
+ }
120
+ if (c === "[") d++;
121
+ else if (c === "]") {
122
+ d--;
123
+ if (d === 0) {
124
+ rb = i;
125
+ break;
126
+ }
127
+ }
128
+ }
103
129
  if (lb < 0 || rb < lb) {
104
130
  throw new FrontmatterError(
105
131
  `line ${lineNo}: inline array must open with "[" and close with "]" on the same line`,