@bobfrankston/gcal 0.1.25 → 0.1.30

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/glib/gutils.ts CHANGED
@@ -42,8 +42,8 @@ export function getDataDir(): string {
42
42
  export const DATA_DIR = getDataDir();
43
43
  export const CONFIG_FILE = path.join(getAppDir(), 'config.json');
44
44
 
45
- /** Use credentials from gcards (shared OAuth app) */
46
- export const CREDENTIALS_FILE = path.join(path.dirname(APP_DIR), 'gcards', 'credentials.json');
45
+ /** OAuth credentials shipped with the package */
46
+ export const CREDENTIALS_FILE = path.join(APP_DIR, 'gcal-credentials.json');
47
47
 
48
48
  export function loadConfig(): GcalConfig {
49
49
  if (fs.existsSync(CONFIG_FILE)) {
@@ -242,16 +242,12 @@ export function parseDateTime(input: string): Date {
242
242
  return d;
243
243
  }
244
244
 
245
- // Handle weekday names (full or 3-letter abbreviations)
246
- const weekdayMap: Record<string, number> = {
247
- sun: 0, sunday: 0, mon: 1, monday: 1, tue: 2, tuesday: 2,
248
- wed: 3, wednesday: 3, thu: 4, thursday: 4, fri: 5, friday: 5,
249
- sat: 6, saturday: 6
250
- };
251
- const dayMatch = lower.match(/^(next\s+)?([a-z]+)\s+(?:at\s+)?(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/i);
252
- if (dayMatch && weekdayMap[dayMatch[2].toLowerCase()] !== undefined) {
245
+ // Handle weekday names
246
+ const weekdays = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
247
+ const dayMatch = lower.match(/^(next\s+)?(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s+(?:at\s+)?(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/i);
248
+ if (dayMatch) {
253
249
  const [, next, day, hour, min, ampm] = dayMatch;
254
- const targetDay = weekdayMap[day.toLowerCase()];
250
+ const targetDay = weekdays.indexOf(day.toLowerCase());
255
251
  const d = new Date(now);
256
252
  let daysUntil = targetDay - d.getDay();
257
253
  if (daysUntil <= 0 || next) daysUntil += 7;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/gcal",
3
- "version": "0.1.25",
3
+ "version": "0.1.30",
4
4
  "description": "Google Calendar CLI tool with ICS import support",
5
5
  "type": "module",
6
6
  "main": "gcal.js",
@@ -31,12 +31,12 @@
31
31
  "check": "tsc --noEmit",
32
32
  "prerelease:local": "git add -A && (git diff-index --quiet HEAD || git commit -m \"Pre-release commit\")",
33
33
  "preversion": "npm run build && git add -A",
34
- "postversion": "git push && git push --tags",
35
34
  "release": "npmglobalize",
36
35
  "release:local": "npm run prerelease:local && npm version patch && npm publish --access public --ignore-scripts",
37
36
  "installer": "npm run release && npm install -g .",
38
37
  "old-release": "npm run prerelease:local && npm version patch && npm publish --access public",
39
- "old-installer": "npm run release && npm install -g ."
38
+ "old-installer": "npm run release && npm install -g .",
39
+ "postversion": "git push && git push --tags"
40
40
  },
41
41
  "keywords": [
42
42
  "google",
@@ -52,7 +52,7 @@
52
52
  "@types/node": "^25.3.0"
53
53
  },
54
54
  "dependencies": {
55
- "@bobfrankston/oauthsupport": "^1.0.7",
55
+ "@bobfrankston/oauthsupport": "^1.0.10",
56
56
  "ical.js": "^2.1.0"
57
57
  },
58
58
  "publishConfig": {
package/tsconfig.json CHANGED
@@ -8,6 +8,7 @@
8
8
  "allowJs": true,
9
9
  "strict": true,
10
10
  "forceConsistentCasingInFileNames": true,
11
+ "resolveJsonModule": true,
11
12
  "skipLibCheck": true,
12
13
  "declaration": true,
13
14
  "declarationMap": true,