mirror of
https://github.com/jacobtread/obsidian-timekeep.git
synced 2026-07-22 10:10:27 +00:00
refactor: remove index.ts from timekeep directory and use imports
directly
This commit is contained in:
parent
3ed554964d
commit
34fec579cb
16 changed files with 31 additions and 45 deletions
|
|
@ -11,7 +11,7 @@ import pdfMake from "pdfmake";
|
|||
import type { TimekeepSettings } from "@/settings";
|
||||
import type { TimeEntry, Timekeep } from "@/timekeep/schema";
|
||||
|
||||
import { getEntryDuration, getTotalDuration } from "@/timekeep";
|
||||
import { getEntryDuration, getTotalDuration } from "@/timekeep/queries";
|
||||
import {
|
||||
formatDurationLong,
|
||||
formatDurationShort,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,12 @@ import type { TimekeepSettings } from "@/settings";
|
|||
import type { Store } from "@/store";
|
||||
import type { Timekeep } from "@/timekeep/schema";
|
||||
|
||||
import { getEntryDuration, getRunningEntry, getTotalDuration, isKeepRunning } from "@/timekeep";
|
||||
import {
|
||||
getEntryDuration,
|
||||
getRunningEntry,
|
||||
getTotalDuration,
|
||||
isKeepRunning,
|
||||
} from "@/timekeep/queries";
|
||||
import { formatDuration } from "@/utils/time";
|
||||
|
||||
import { TimesheetTimer } from "./timesheetTimer";
|
||||
|
|
|
|||
|
|
@ -3,14 +3,10 @@ import { App, Component } from "obsidian";
|
|||
|
||||
import { TimekeepSettings } from "@/settings";
|
||||
import { Store } from "@/store";
|
||||
import {
|
||||
getRunningEntry,
|
||||
isEntryRunning,
|
||||
setEntryCollapsed,
|
||||
startNewNestedEntry,
|
||||
updateEntry,
|
||||
} from "@/timekeep";
|
||||
import { getRunningEntry, isEntryRunning } from "@/timekeep/queries";
|
||||
import { TimeEntry, Timekeep } from "@/timekeep/schema";
|
||||
import { startNewNestedEntry } from "@/timekeep/start";
|
||||
import { setEntryCollapsed, updateEntry } from "@/timekeep/update";
|
||||
import { formatTimestamp } from "@/utils/time";
|
||||
|
||||
import { createObsidianIcon } from "./obsidianIcon";
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { App, Component } from "obsidian";
|
|||
|
||||
import { TimekeepSettings } from "@/settings";
|
||||
import { Store } from "@/store";
|
||||
import { removeEntry, updateEntry } from "@/timekeep";
|
||||
import { TimeEntry, Timekeep } from "@/timekeep/schema";
|
||||
import { removeEntry, updateEntry } from "@/timekeep/update";
|
||||
import { formatEditableTimestamp, parseEditableTimestamp } from "@/utils/time";
|
||||
import { ConfirmModal } from "@/views/confirm-modal";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import moment from "moment";
|
||||
import { Component } from "obsidian";
|
||||
|
||||
import { getEntryDuration, isEntryRunning } from "@/timekeep";
|
||||
import { getEntryDuration, isEntryRunning } from "@/timekeep/queries";
|
||||
import { TimeEntry } from "@/timekeep/schema";
|
||||
import { formatDurationLong } from "@/utils/time";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ import type { Store } from "@/store";
|
|||
import type { Timekeep } from "@/timekeep/schema";
|
||||
|
||||
import { TimekeepAutocomplete } from "@/service/autocomplete";
|
||||
import { getRunningEntry, startNewEntry } from "@/timekeep";
|
||||
import { getRunningEntry } from "@/timekeep/queries";
|
||||
import { startNewEntry } from "@/timekeep/start";
|
||||
|
||||
import { createObsidianIcon } from "./obsidianIcon";
|
||||
import { TimesheetNameInput } from "./timesheetNameInput";
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ import type { TimekeepSettings } from "@/settings";
|
|||
import type { Store } from "@/store";
|
||||
import type { Timekeep } from "@/timekeep/schema";
|
||||
|
||||
import { getRunningEntry, updateEntry } from "@/timekeep";
|
||||
import { getRunningEntry } from "@/timekeep/queries";
|
||||
import { updateEntry } from "@/timekeep/update";
|
||||
|
||||
import { createObsidianIcon } from "./obsidianIcon";
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ import type { TimekeepSettings } from "@/settings";
|
|||
import type { Store } from "@/store";
|
||||
import type { TimeEntry, Timekeep } from "@/timekeep/schema";
|
||||
|
||||
import { getPathToEntry, stopRunningEntries } from "@/timekeep";
|
||||
import { getPathToEntry } from "@/timekeep/queries";
|
||||
import { stopRunningEntries } from "@/timekeep/update";
|
||||
import { formatTimestamp } from "@/utils/time";
|
||||
|
||||
import { createObsidianIcon } from "./obsidianIcon";
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import type { TimekeepSettings } from "@/settings";
|
|||
import type { Store } from "@/store";
|
||||
import type { Timekeep } from "@/timekeep/schema";
|
||||
|
||||
import { getEntriesSorted } from "@/timekeep";
|
||||
import { getEntriesSorted } from "@/timekeep/sort";
|
||||
|
||||
import { TimesheetRowContainer } from "./timesheetRowContainer";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import type { Moment } from "moment";
|
||||
|
||||
import { TimekeepSettings } from "@/settings";
|
||||
import { getEntryDuration, getEntriesSorted } from "@/timekeep";
|
||||
import { getEntryDuration } from "@/timekeep/queries";
|
||||
import { TimeEntry } from "@/timekeep/schema";
|
||||
import { getEntriesSorted } from "@/timekeep/sort";
|
||||
import { formatDuration, formatTimestamp } from "@/utils/time";
|
||||
|
||||
export { createCSV } from "./csv";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import type { Moment } from "moment";
|
|||
|
||||
import { RawTableRow, TOTAL_COLUMNS, createRawTable } from "@/export";
|
||||
import { DurationFormat, TimekeepSettings } from "@/settings";
|
||||
import { getTotalDuration } from "@/timekeep";
|
||||
import { getTotalDuration } from "@/timekeep/queries";
|
||||
import { Timekeep, TimeEntry } from "@/timekeep/schema";
|
||||
import { formatDuration } from "@/utils/time";
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import type { Vault, TFile, PluginManifest, App } from "obsidian";
|
|||
import { Plugin } from "obsidian";
|
||||
|
||||
import type { CustomOutputFormat } from "@/output";
|
||||
import type { Store } from "@/store";
|
||||
import type { Timekeep, TimeEntry } from "@/timekeep/schema";
|
||||
|
||||
import createMerged from "@/commands/createMerged";
|
||||
|
|
@ -16,15 +17,15 @@ import { TimekeepAutocomplete } from "@/service/autocomplete";
|
|||
import { TimekeepRegistry } from "@/service/registry";
|
||||
import { defaultSettings, TimekeepSettings, legacySettingsCompatibility } from "@/settings";
|
||||
import { TimekeepSettingsTab } from "@/settings-tab";
|
||||
import { type Store, createStore } from "@/store";
|
||||
import { createStore } from "@/store";
|
||||
import { replaceTimekeepCodeblock, extractTimekeepCodeblocks } from "@/timekeep/parser";
|
||||
import {
|
||||
isKeepRunning,
|
||||
isEntryRunning,
|
||||
getRunningEntry,
|
||||
getEntryDuration,
|
||||
getTotalDuration,
|
||||
} from "@/timekeep";
|
||||
import { replaceTimekeepCodeblock, extractTimekeepCodeblocks } from "@/timekeep/parser";
|
||||
} from "@/timekeep/queries";
|
||||
import { stopAllTimekeeps } from "@/timekeep/stopAllTimekeeps";
|
||||
import { stopFileTimekeeps } from "@/timekeep/stopFileTimekeeps";
|
||||
import { TimekeepMarkdownView } from "@/views/timekeep-markdown-view";
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
export { getEntriesSorted } from "./sort";
|
||||
export { startNewEntry, startNewNestedEntry } from "./start";
|
||||
export { withEntry, createEntry, withSubEntry } from "./create";
|
||||
|
||||
export {
|
||||
removeEntry,
|
||||
updateEntry,
|
||||
removeSubEntry,
|
||||
setEntryCollapsed,
|
||||
stopRunningEntries,
|
||||
} from "./update";
|
||||
|
||||
export {
|
||||
getEntryById,
|
||||
getStartTime,
|
||||
isKeepRunning,
|
||||
getPathToEntry,
|
||||
isEntryRunning,
|
||||
getRunningEntry,
|
||||
getEntryDuration,
|
||||
getTotalDuration,
|
||||
} from "./queries";
|
||||
|
|
@ -3,8 +3,9 @@ import type { TFile, Vault } from "obsidian";
|
|||
|
||||
import type { Timekeep } from "@/timekeep/schema";
|
||||
|
||||
import { getRunningEntry, stopRunningEntries } from "@/timekeep";
|
||||
import { replaceTimekeepCodeblock, extractTimekeepCodeblocksWithPosition } from "@/timekeep/parser";
|
||||
import { getRunningEntry } from "@/timekeep/queries";
|
||||
import { stopRunningEntries } from "@/timekeep/update";
|
||||
|
||||
/**
|
||||
* Stops all timekeeps in the provided file if there are any running.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { App, TFile, SuggestModal } from "obsidian";
|
||||
|
||||
import { getRunningEntry } from "@/timekeep";
|
||||
import { extractTimekeepCodeblocks } from "@/timekeep/parser";
|
||||
import { getRunningEntry } from "@/timekeep/queries";
|
||||
import { Timekeep, TimeEntry } from "@/timekeep/schema";
|
||||
|
||||
interface TimekeepResult {
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ import { App, Component, MarkdownView, Notice } from "obsidian";
|
|||
|
||||
import { TimesheetStatusBarItem } from "@/components/timesheetStatusBarItem";
|
||||
import { TimekeepRegistry, TimekeepRegistryEntry } from "@/service/registry";
|
||||
import { getRunningEntry, stopRunningEntries } from "@/timekeep";
|
||||
import {
|
||||
extractTimekeepCodeblocksWithPosition,
|
||||
replaceTimekeepCodeblock,
|
||||
TimekeepWithPosition,
|
||||
} from "@/timekeep/parser";
|
||||
import { getRunningEntry } from "@/timekeep/queries";
|
||||
import { stopRunningEntries } from "@/timekeep/update";
|
||||
|
||||
export class TimekeepStatusBarView extends Component {
|
||||
/** Parent container element */
|
||||
|
|
|
|||
Loading…
Reference in a new issue