Skip to content

Commit 34dcc4e

Browse files
committed
chore: bump version
2 parents 2df0136 + 9b3a09b commit 34dcc4e

52 files changed

Lines changed: 7522 additions & 1814 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,6 @@ translation-templates
4242

4343
styles.css
4444

45-
CLAUDE.md
45+
CLAUDE.md
46+
.kiro
47+
.claude

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = {
44
testMatch: ["**/__tests__/**/*.test.ts"],
55
moduleNameMapper: {
66
"^obsidian$": "<rootDir>/src/__mocks__/obsidian.ts",
7+
"^moment$": "<rootDir>/src/__mocks__/moment.js",
78
"^@codemirror/state$": "<rootDir>/src/__mocks__/codemirror-state.ts",
89
"^@codemirror/view$": "<rootDir>/src/__mocks__/codemirror-view.ts",
910
"^@codemirror/language$":

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "obsidian-task-progress-bar",
33
"name": "Task Genius",
4-
"version": "9.1.0-beta.9",
4+
"version": "9.1.0-beta.10",
55
"minAppVersion": "0.15.2",
66
"description": "Comprehensive task management that includes progress bars, task status cycling, and advanced task tracking features.",
77
"author": "Boninall",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "task-genius",
3-
"version": "9.1.0-beta.9",
3+
"version": "9.1.0-beta.10",
44
"description": "Comprehensive task management plugin for Obsidian with progress bars, task status cycling, and advanced task tracking features.",
55
"main": "main.js",
66
"scripts": {

src/__mocks__/moment.js

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
// Global moment.js mock
2+
const moment = function(input) {
3+
let date;
4+
if (input instanceof Date) {
5+
date = input;
6+
} else if (typeof input === "string") {
7+
date = new Date(input);
8+
} else if (typeof input === "number") {
9+
date = new Date(input);
10+
} else {
11+
date = new Date();
12+
}
13+
14+
return {
15+
format: function(format) {
16+
if (format === "YYYY-MM-DD") {
17+
return date.toISOString().split("T")[0];
18+
} else if (format === "D") {
19+
return date.getDate().toString();
20+
}
21+
return date.toISOString().split("T")[0];
22+
},
23+
diff: function() {
24+
return 0;
25+
},
26+
startOf: function(unit) {
27+
return this;
28+
},
29+
endOf: function(unit) {
30+
return this;
31+
},
32+
isSame: function(other, unit) {
33+
return true;
34+
},
35+
isSameOrBefore: function(other, unit) {
36+
return true;
37+
},
38+
isSameOrAfter: function(other, unit) {
39+
return true;
40+
},
41+
isBefore: function(other, unit) {
42+
return false;
43+
},
44+
isAfter: function(other, unit) {
45+
return false;
46+
},
47+
isBetween: function(start, end, unit, inclusivity) {
48+
return true;
49+
},
50+
clone: function() {
51+
return moment(date);
52+
},
53+
add: function(amount, unit) {
54+
return this;
55+
},
56+
subtract: function(amount, unit) {
57+
return this;
58+
},
59+
valueOf: function() {
60+
return date.getTime();
61+
},
62+
toDate: function() {
63+
return date;
64+
},
65+
weekday: function(day) {
66+
if (day !== undefined) {
67+
return this;
68+
}
69+
return 0;
70+
},
71+
day: function() {
72+
return date.getDay();
73+
},
74+
date: function() {
75+
return date.getDate();
76+
},
77+
_date: date,
78+
};
79+
};
80+
81+
// Static methods
82+
moment.utc = function() {
83+
return {
84+
format: function() {
85+
return "00:00:00";
86+
},
87+
};
88+
};
89+
90+
moment.duration = function() {
91+
return {
92+
asMilliseconds: function() {
93+
return 0;
94+
},
95+
};
96+
};
97+
98+
moment.locale = function(locale) {
99+
if (locale) {
100+
moment._currentLocale = locale;
101+
return locale;
102+
}
103+
return moment._currentLocale || "en";
104+
};
105+
106+
moment._currentLocale = "en";
107+
108+
moment.weekdaysShort = function(localeData) {
109+
return ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
110+
};
111+
112+
moment.weekdaysMin = function(localeData) {
113+
return ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
114+
};
115+
116+
moment.months = function() {
117+
return ["January", "February", "March", "April", "May", "June",
118+
"July", "August", "September", "October", "November", "December"];
119+
};
120+
121+
moment.monthsShort = function() {
122+
return ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
123+
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
124+
};
125+
126+
module.exports = moment;

src/__mocks__/obsidian.ts

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,36 @@ export class App {
2727
if (key === "useTab") return false;
2828
return null;
2929
},
30+
// Event system for vault
31+
_events: {} as Record<string, Function[]>,
32+
on: function (eventName: string, callback: Function) {
33+
if (!this._events[eventName]) {
34+
this._events[eventName] = [];
35+
}
36+
this._events[eventName].push(callback);
37+
return { unload: () => this.off(eventName, callback) };
38+
},
39+
off: function (eventName: string, callback: Function) {
40+
if (this._events[eventName]) {
41+
const index = this._events[eventName].indexOf(callback);
42+
if (index > -1) {
43+
this._events[eventName].splice(index, 1);
44+
}
45+
}
46+
},
47+
trigger: function (eventName: string, ...args: any[]) {
48+
if (this._events[eventName]) {
49+
this._events[eventName].forEach((callback: any) => callback(...args));
50+
}
51+
},
52+
getFileByPath: function (path: string) {
53+
// Mock implementation for getFileByPath
54+
return {
55+
path: path,
56+
name: path.split('/').pop() || path,
57+
children: [], // For directory-like behavior
58+
};
59+
},
3060
};
3161

3262
workspace = {
@@ -298,9 +328,16 @@ function momentFn(input?: any) {
298328
};
299329

300330
(momentFn as any).locale = function (locale?: string) {
301-
return locale || "en";
331+
if (locale) {
332+
(momentFn as any)._currentLocale = locale;
333+
return locale;
334+
}
335+
return (momentFn as any)._currentLocale || "en";
302336
};
303337

338+
// Initialize default locale
339+
(momentFn as any)._currentLocale = "en";
340+
304341
(momentFn as any).weekdaysShort = function (localeData?: boolean) {
305342
return ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
306343
};
@@ -309,6 +346,16 @@ function momentFn(input?: any) {
309346
return ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
310347
};
311348

349+
(momentFn as any).months = function () {
350+
return ["January", "February", "March", "April", "May", "June",
351+
"July", "August", "September", "October", "November", "December"];
352+
};
353+
354+
(momentFn as any).monthsShort = function () {
355+
return ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
356+
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
357+
};
358+
312359
export const moment = momentFn as any;
313360

314361
// Mock Component class
@@ -366,6 +413,12 @@ export class Component {
366413
// Mock implementation
367414
return id;
368415
}
416+
417+
private _events: Array<{ unload: () => void }> = [];
418+
419+
registerEvent(eventRef: { unload: () => void }): void {
420+
this._events.push(eventRef);
421+
}
369422
}
370423

371424
// Mock other common Obsidian utilities
@@ -391,4 +444,26 @@ export function debounce<T extends (...args: any[]) => any>(
391444
}) as T;
392445
}
393446

447+
// Mock EditorSuggest class
448+
export abstract class EditorSuggest<T> extends Component {
449+
app: App;
450+
451+
constructor(app: App) {
452+
super();
453+
this.app = app;
454+
}
455+
456+
abstract getSuggestions(context: any): T[] | Promise<T[]>;
457+
abstract renderSuggestion(suggestion: T, el: HTMLElement): void;
458+
abstract selectSuggestion(suggestion: T, evt: MouseEvent | KeyboardEvent): void;
459+
460+
onTrigger(cursor: any, editor: any, file: any): any {
461+
return null;
462+
}
463+
464+
close(): void {
465+
// Mock implementation
466+
}
467+
}
468+
394469
// Add any other Obsidian classes or functions needed for tests

src/__tests__/FileMetadataTaskParser.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ describe("FileMetadataTaskParser", () => {
2525
taskContentFromMetadata: "title",
2626
defaultTaskStatus: " ",
2727
enableWorkerProcessing: true,
28+
enableMtimeOptimization: false,
29+
mtimeCacheSize: 1000,
2830
};
2931
parser = new FileMetadataTaskParser(config);
3032
});
@@ -206,6 +208,8 @@ describe("FileMetadataTaskParser", () => {
206208
taskContentFromMetadata: "title",
207209
defaultTaskStatus: " ",
208210
enableWorkerProcessing: true,
211+
enableMtimeOptimization: false,
212+
mtimeCacheSize: 1000,
209213
};
210214
const disabledParser = new FileMetadataTaskParser(disabledConfig);
211215

@@ -358,6 +362,8 @@ describe("FileMetadataTaskUpdater", () => {
358362
taskContentFromMetadata: "title",
359363
defaultTaskStatus: " ",
360364
enableWorkerProcessing: true,
365+
enableMtimeOptimization: false,
366+
mtimeCacheSize: 1000,
361367
};
362368

363369
// Mock Obsidian App

0 commit comments

Comments
 (0)