Skip to content

Commit

Permalink
prettier fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-hub committed Sep 10, 2023
1 parent cfef158 commit 0cdaffb
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
15 changes: 7 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## About



- [Making contributions](CONTRIBUTING.md) All kinds of Contributing is appreciated,
- maintaining the project code base, (more at the section below)
- recommending the plugin to your friends and connections,
Expand All @@ -26,25 +24,26 @@ The repo depends on the latest plugin API (obsidian.d.ts) in Typescript Definiti
### Before you start

Feel free to check out
- [Project Todo Column](https://github.com/users/tim-hub/projects/2)
- [Discussion](https://github.com/tim-hub/obsidian-bible-reference/discussions)

- [Project Todo Column](https://github.com/users/tim-hub/projects/2)
- [Discussion](https://github.com/tim-hub/obsidian-bible-reference/discussions)
- [Issues](https://github.com/tim-hub/obsidian-bible-reference/issues)

You can probably get some ideas from there to work on,
You can probably get some ideas from there to work on,
and you can also create a new discussion or issue to discuss your ideas.



## References

### Related Projects

- [find bible verse](https://github.com/tim-hub/FindBibleVerse) in development, this is a local node package for querying bible version
- [bible name converter](https://github.com/tim-hub/biblejs-name-converter/) Bible JS Name Converter, Normalize bible references, convert them to machine readable formats, query and manipulate them
- inspiring
- inspired by [obsidian emoji shortcodes](https://github.com/phibr0/obsidian-emoji-shortcodes)
- [obsidian sample plugin](https://github.com/obsidianmd/obsidian-sample-plugin) is template repo as obsidian sample plugin


### Bible API and Bible Source

> This plugin Bible Verse Query Functionality is currently powered by Public Bible API,
> Here is about the APIs used here, and what Bible version are supported
>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![CodeQL for Obsidain Bible Reference](https://github.com/tim-hub/obsidian-bible-reference/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/tim-hub/obsidian-bible-reference/actions/workflows/codeql-analysis.yml)
[![Build for Bible Reference Project](https://github.com/tim-hub/obsidian-bible-reference/actions/workflows/build.yml/badge.svg)](https://github.com/tim-hub/obsidian-bible-reference/actions/workflows/build.yml)
[![obsidian bible reference user discussion forum](https://img.shields.io/badge/Discussion-blue)](https://github.com/tim-hub/obsidian-bible-reference/discussions)
[![obsidain bible reference project kanban board and roadmap ](https://img.shields.io/badge/Project(Kanban)-orange)](https://github.com/users/tim-hub/projects/2/views/1)
[![obsidain bible reference project kanban board and roadmap ](<https://img.shields.io/badge/Project(Kanban)-orange>)](https://github.com/users/tim-hub/projects/2/views/1)
[![support button of obsidian bible reference](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/tim-hub)

> These will be very appreciate for the project development. 👍
Expand Down
15 changes: 7 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export default class BibleReferencePlugin extends Plugin {
}

private async getAndCachedVerseOfDay(): Promise<VerseOfDaySuggesting> {
const {ttl, timestamp, verseOfDaySuggesting} =
this?.cachedVerseOfDaySuggesting || {}
const { ttl, timestamp, verseOfDaySuggesting } =
this?.cachedVerseOfDaySuggesting || {}
if (!verseOfDaySuggesting || timestamp + ttl > Date.now()) {
const vodResp = await getVod()
const reference = splitBibleReference(vodResp.verse.details.reference)
Expand All @@ -99,7 +99,7 @@ export default class BibleReferencePlugin extends Plugin {
callback: () => {
EventStats.logUIOpen(
'lookupModalOpen',
{key: `command-lookup`, value: 1},
{ key: `command-lookup`, value: 1 },
this.settings.optOutToEvents
)
this.verseLookUpModal.open()
Expand All @@ -116,7 +116,7 @@ export default class BibleReferencePlugin extends Plugin {
const verse = await this.getAndCachedVerseOfDay()
EventStats.logUIOpen(
'vodEditorOpen',
{key: `command-vod`, value: 1},
{ key: `command-vod`, value: 1 },
this.settings.optOutToEvents
)
new Notice(
Expand All @@ -127,7 +127,6 @@ export default class BibleReferencePlugin extends Plugin {
)
},
})

}

private addVerseOfDayInsertCommand(): void {
Expand All @@ -138,7 +137,7 @@ export default class BibleReferencePlugin extends Plugin {
const vodSuggesting = await this.getAndCachedVerseOfDay()
EventStats.logUIOpen(
'vodEditorOpen',
{key: `command-vod-insert`, value: 1},
{ key: `command-vod-insert`, value: 1 },
this.settings.optOutToEvents
)
editor.replaceSelection(vodSuggesting.allFormattedContent)
Expand All @@ -155,7 +154,7 @@ export default class BibleReferencePlugin extends Plugin {
(_evt) => {
EventStats.logUIOpen(
'lookupModalOpen',
{key: `ribbon-click`, value: 1},
{ key: `ribbon-click`, value: 1 },
this.settings.optOutToEvents
)
this.verseLookUpModal.open()
Expand All @@ -167,7 +166,7 @@ export default class BibleReferencePlugin extends Plugin {
if (this.ribbonButton) {
EventStats.logUIOpen(
'lookupModalOpen',
{key: `ribbon-remove`, value: 1},
{ key: `ribbon-remove`, value: 1 },
this.settings.optOutToEvents
)
this.ribbonButton.parentNode?.removeChild(this.ribbonButton)
Expand Down
4 changes: 2 additions & 2 deletions src/provider/BaseBibleAPIProvider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IVerse } from '../interfaces/IVerse'
import { Notice } from 'obsidian'
import { EventStats } from './EventStats';
import { EventStats } from './EventStats'

export abstract class BaseBibleAPIProvider {
protected _key: string // the version selected
Expand Down Expand Up @@ -83,7 +83,7 @@ export abstract class BaseBibleAPIProvider {
} catch (e) {
console.error('error while querying', e)
new Notice(`Error while querying ${url}`)
EventStats.logError('errors', {key: url, value: 1})
EventStats.logError('errors', { key: url, value: 1 })
return await Promise.reject(e)
}
}
Expand Down
8 changes: 2 additions & 6 deletions src/provider/EventStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const EVENTS = {
// changeBookTagging: '',
// changeChapterTagging: '',

errors: '0d3fad56-4293-4691-b810-9a32cd1f6117'
errors: '0d3fad56-4293-4691-b810-9a32cd1f6117',
}

type VerseLookUp = 'verseLookUp' | 'vodLookUp'
Expand Down Expand Up @@ -102,14 +102,10 @@ class Logger {
}
}

async logError(
eventName: 'errors',
actionAttributes: ActionAttributes,
) {
async logError(eventName: 'errors', actionAttributes: ActionAttributes) {
this.fireEvent(this.getEventId(eventName), actionAttributes)
}


private async fireEvent(
eventId: EventsValues,
actionAttributes: ActionAttributes
Expand Down
6 changes: 3 additions & 3 deletions src/provider/FeatureFlag.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Flagsmith, { Flags } from 'flagsmith-nodejs'
import { EventStats } from './EventStats'; // Add this line if you're using flagsmith via npm
import { EventStats } from './EventStats' // Add this line if you're using flagsmith via npm

const flagsmith = new Flagsmith({
environmentKey: 'NJTKgnNToZxbe6TCksAcmD',
Expand All @@ -16,7 +16,7 @@ export class FlagService {
return FlagService.instance
}

public async init(id?:string) {
public async init(id?: string) {
if (id) {
this.flags = await flagsmith.getIdentityFlags(id)
} else {
Expand All @@ -34,7 +34,7 @@ export class FlagService {
return JSON.parse(value as string)
} catch (e) {
console.error('get feature flag value error')
EventStats.logError('errors', { key:'featureflag', value: 1 })
EventStats.logError('errors', { key: 'featureflag', value: 1 })
}
}
}
5 changes: 4 additions & 1 deletion src/suggesetor/VerseEditorSuggester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export class VerseEditorSuggester extends EditorSuggest<VerseSuggesting> {
)
EventStats.logLookup(
'verseLookUp',
{ key: `${this.settings.bibleVersion}-${context.query.toLowerCase()}`, value: 1 },
{
key: `${this.settings.bibleVersion}-${context.query.toLowerCase()}`,
value: 1,
},
this.settings.optOutToEvents
)
return suggestions
Expand Down
5 changes: 4 additions & 1 deletion src/suggesetor/VerseLookupSuggestModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export class VerseLookupSuggestModal extends SuggestModal<VerseSuggesting> {
console.debug('trigger on', query)
EventStats.logLookup(
'verseLookUp',
{ key: `${this.settings.bibleVersion}-${match.toLowerCase()}`, value: 1 },
{
key: `${this.settings.bibleVersion}-${match.toLowerCase()}`,
value: 1,
},
this.settings.optOutToEvents
)
return getSuggestionsFromQuery(`--${query}`, this.settings)
Expand Down
2 changes: 1 addition & 1 deletion src/ui/BibleReferenceSettingTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
import { FlagService } from '../provider/FeatureFlag'
import { BibleAPISourceCollection } from '../data/BibleApiSourceCollection'
import { EventStats } from '../provider/EventStats'
import { APP_NAMING } from '../data/constants';
import { APP_NAMING } from '../data/constants'

export class BibleReferenceSettingTab extends PluginSettingTab {
plugin: BibleReferencePlugin
Expand Down

0 comments on commit 0cdaffb

Please sign in to comment.