@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/gcal.d.ts +2 -1
- package/gcal.d.ts.map +1 -1
- package/gcal.js +35 -306
- package/gcal.js.map +1 -1
- package/gcal.ts +36 -318
- package/glib/gutils.d.ts +1 -1
- package/glib/gutils.d.ts.map +1 -1
- package/glib/gutils.js +7 -11
- package/glib/gutils.js.map +1 -1
- package/glib/gutils.ts +7 -11
- package/package.json +4 -4
- package/tsconfig.json +1 -0
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
|
-
/**
|
|
46
|
-
export const CREDENTIALS_FILE = path.join(
|
|
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
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
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 =
|
|
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.
|
|
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.
|
|
55
|
+
"@bobfrankston/oauthsupport": "^1.0.10",
|
|
56
56
|
"ical.js": "^2.1.0"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|