Skip to content

Commit 3336e78

Browse files
committed
Src dir, window-open event, and new Notice for no Dataview.
Addressed comments for obsidian releases.
1 parent 04a66ab commit 3336e78

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

esbuild.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const context = await esbuild.context({
1515
banner: {
1616
js: banner,
1717
},
18-
entryPoints: ["main.ts"],
18+
entryPoints: ["src/main.ts"],
1919
bundle: true,
2020
external: [
2121
"obsidian",

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"id": "graph-link-types",
33
"name": "Graph Link Types",
4-
"version": "0.2.3",
4+
"version": "0.2.4",
55
"minAppVersion": "1.5.0",
6-
"description": "Link types for Obsidian graph view.",
6+
"description": "Link types for graph view.",
77
"author": "natefrisch01",
88
"authorUrl": "https://natesnote.com",
99
"fundingUrl": "https://www.buymeacoffee.com/natefrisch",

linkManager.ts renamed to src/linkManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import { ObsidianRenderer, ObsidianLink, LinkPair, GltLink, DataviewLinkType } from 'types';
2+
import { ObsidianRenderer, ObsidianLink, LinkPair, GltLink, DataviewLinkType } from 'src/types';
33
import { getAPI } from 'obsidian-dataview';
44
import { Text, TextStyle } from 'pixi.js';
55
// @ts-ignore

main.ts renamed to src/main.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Plugin, Notice} from 'obsidian';
22
import { getAPI } from 'obsidian-dataview';
3-
import { ObsidianRenderer, ObsidianLink} from 'types';
4-
import { LinkManager } from 'linkManager';
3+
import { ObsidianRenderer, ObsidianLink} from 'src/types';
4+
import { LinkManager } from 'src/linkManager';
55

66

77
export default class GraphLinkTypesPlugin extends Plugin {
@@ -17,6 +17,7 @@ export default class GraphLinkTypesPlugin extends Plugin {
1717
// Check if the Dataview API is available
1818
if (!this.api) {
1919
console.error("Dataview plugin is not available.");
20+
new Notice("Data plugin is not available.");
2021
return;
2122
}
2223

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

29+
// Handle window changes
30+
this.registerEvent(this.app.workspace.on('window-open', (win, window) => {
31+
this.handleLayoutChange();
32+
}));
33+
2834
// @ts-ignore
2935
this.registerEvent(this.app.metadataCache.on("dataview:index-ready", () => {
30-
this.handleLayoutChange();
36+
console.log("Index Ready");
3137
this.indexReady = true;
3238
}));
3339

File renamed without changes.

tsconfig.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,9 @@
1010
"moduleResolution": "node",
1111
"importHelpers": true,
1212
"isolatedModules": true,
13-
"strictNullChecks": true,
14-
"lib": [
15-
"DOM",
16-
"ES5",
17-
"ES6",
18-
"ES7"
19-
]
13+
"strictNullChecks": true,
14+
"lib": ["DOM", "ES5", "ES6", "ES7"],
15+
"rootDir": "src" // Explicitly set the root directory
2016
},
21-
"include": [
22-
"**/*.ts"
23-
]
17+
"include": ["src/**/*.ts"] // Adjust the include pattern to be more specific
2418
}

0 commit comments

Comments
 (0)