Skip to content

Commit

Permalink
Src dir, window-open event, and new Notice for no Dataview.
Browse files Browse the repository at this point in the history
Addressed comments for obsidian releases.
  • Loading branch information
natefrisch01 committed Jan 29, 2024
1 parent 04a66ab commit 3336e78
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["main.ts"],
entryPoints: ["src/main.ts"],
bundle: true,
external: [
"obsidian",
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "graph-link-types",
"name": "Graph Link Types",
"version": "0.2.3",
"version": "0.2.4",
"minAppVersion": "1.5.0",
"description": "Link types for Obsidian graph view.",
"description": "Link types for graph view.",
"author": "natefrisch01",
"authorUrl": "https://natesnote.com",
"fundingUrl": "https://www.buymeacoffee.com/natefrisch",
Expand Down
2 changes: 1 addition & 1 deletion linkManager.ts → src/linkManager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { ObsidianRenderer, ObsidianLink, LinkPair, GltLink, DataviewLinkType } from 'types';
import { ObsidianRenderer, ObsidianLink, LinkPair, GltLink, DataviewLinkType } from 'src/types';
import { getAPI } from 'obsidian-dataview';
import { Text, TextStyle } from 'pixi.js';
// @ts-ignore
Expand Down
12 changes: 9 additions & 3 deletions main.ts → src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Plugin, Notice} from 'obsidian';
import { getAPI } from 'obsidian-dataview';
import { ObsidianRenderer, ObsidianLink} from 'types';
import { LinkManager } from 'linkManager';
import { ObsidianRenderer, ObsidianLink} from 'src/types';
import { LinkManager } from 'src/linkManager';


export default class GraphLinkTypesPlugin extends Plugin {
Expand All @@ -17,6 +17,7 @@ export default class GraphLinkTypesPlugin extends Plugin {
// Check if the Dataview API is available
if (!this.api) {
console.error("Dataview plugin is not available.");
new Notice("Data plugin is not available.");
return;
}

Expand All @@ -25,9 +26,14 @@ export default class GraphLinkTypesPlugin extends Plugin {
this.handleLayoutChange();
}));

// Handle window changes
this.registerEvent(this.app.workspace.on('window-open', (win, window) => {
this.handleLayoutChange();
}));

// @ts-ignore
this.registerEvent(this.app.metadataCache.on("dataview:index-ready", () => {
this.handleLayoutChange();
console.log("Index Ready");
this.indexReady = true;
}));

Expand Down
File renamed without changes.
14 changes: 4 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@
"moduleResolution": "node",
"importHelpers": true,
"isolatedModules": true,
"strictNullChecks": true,
"lib": [
"DOM",
"ES5",
"ES6",
"ES7"
]
"strictNullChecks": true,
"lib": ["DOM", "ES5", "ES6", "ES7"],
"rootDir": "src" // Explicitly set the root directory
},
"include": [
"**/*.ts"
]
"include": ["src/**/*.ts"] // Adjust the include pattern to be more specific
}

0 comments on commit 3336e78

Please sign in to comment.