@delorenj/pjangler 1.5.11 → 1.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/.mise/scripts/versioning.sh +26 -5
  2. package/README.md +25 -0
  3. package/dist/index.js +150 -27
  4. package/dist/mcp-server.js +134 -20
  5. package/dist/notebook/journal-service-main.js +4 -1
  6. package/dist/project-registry-service.js +1 -1
  7. package/package.json +1 -1
  8. package/templates/commonproject/copier.yml +102 -1
  9. package/templates/commonproject/template/.github/workflows/{% if is_obsidian_plugin %}lint.yml{% endif %} +29 -0
  10. package/templates/commonproject/template/.github/workflows/{% if is_obsidian_plugin %}release.yml{% endif %} +62 -0
  11. package/templates/commonproject/template/.mise/{% if is_obsidian_plugin %}tasks{% endif %}/plugin/link +27 -0
  12. package/templates/commonproject/template/AGENTS.md.jinja +67 -0
  13. package/templates/commonproject/template/{% if is_obsidian_plugin %}.editorconfig{% endif %} +15 -0
  14. package/templates/commonproject/template/{% if is_obsidian_plugin %}.npmrc{% endif %} +1 -0
  15. package/templates/commonproject/template/{% if is_obsidian_plugin %}esbuild.config.mjs{% endif %} +49 -0
  16. package/templates/commonproject/template/{% if is_obsidian_plugin %}eslint.config.mts{% endif %} +38 -0
  17. package/templates/commonproject/template/{% if is_obsidian_plugin %}manifest.json{% endif %}.jinja +9 -0
  18. package/templates/commonproject/template/{% if is_obsidian_plugin %}package-lock.json{% endif %}.jinja +5053 -0
  19. package/templates/commonproject/template/{% if is_obsidian_plugin %}package.json{% endif %}.jinja +28 -0
  20. package/templates/commonproject/template/{% if is_obsidian_plugin %}src{% endif %}/main.ts.jinja +105 -0
  21. package/templates/commonproject/template/{% if is_obsidian_plugin %}src{% endif %}/settings.ts.jinja +38 -0
  22. package/templates/commonproject/template/{% if is_obsidian_plugin %}styles.css{% endif %} +8 -0
  23. package/templates/commonproject/template/{% if is_obsidian_plugin %}tsconfig.json{% endif %} +19 -0
  24. package/templates/commonproject/template/{% if is_obsidian_plugin %}version-bump.mjs{% endif %} +17 -0
  25. package/templates/commonproject/template/{% if is_obsidian_plugin %}versions.json{% endif %} +3 -0
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": {{ project_slug | tojson }},
3
+ "version": "1.0.0",
4
+ "description": {{ plugin_description | tojson }},
5
+ "main": "main.js",
6
+ "type": "module",
7
+ "private": true,
8
+ "scripts": {
9
+ "dev": "node esbuild.config.mjs",
10
+ "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
11
+ "version": "node version-bump.mjs && git add manifest.json versions.json",
12
+ "lint": "eslint ."
13
+ },
14
+ "keywords": [],
15
+ "license": "UNLICENSED",
16
+ "devDependencies": {
17
+ "@eslint/js": "^9.39.4",
18
+ "@types/node": "^22.15.17",
19
+ "esbuild": "0.25.5",
20
+ "eslint": "^9.39.4",
21
+ "eslint-plugin-obsidianmd": "^0.4.0",
22
+ "globals": "^17.6.0",
23
+ "jiti": "^2.6.1",
24
+ "obsidian": "latest",
25
+ "typescript": "^5.8.3",
26
+ "typescript-eslint": "^8.59.1"
27
+ }
28
+ }
@@ -0,0 +1,105 @@
1
+ import {
2
+ Editor,
3
+ MarkdownView,
4
+ MarkdownFileInfo,
5
+ Modal,
6
+ Notice,
7
+ Plugin,
8
+ } from 'obsidian';
9
+ import {
10
+ DEFAULT_SETTINGS,
11
+ {{ plugin_class }}Settings,
12
+ {{ plugin_class }}SettingTab,
13
+ } from './settings';
14
+
15
+ export default class {{ plugin_class }}Plugin extends Plugin {
16
+ settings!: {{ plugin_class }}Settings;
17
+
18
+ async onload() {
19
+ await this.loadSettings();
20
+
21
+ // This creates an icon in the left ribbon.
22
+ this.addRibbonIcon('dice', 'Sample', (_evt: MouseEvent) => {
23
+ // Called when the user clicks the icon.
24
+ new Notice('This is a notice!');
25
+ });
26
+
27
+ // This adds a status bar item to the bottom of the app. Does not work on mobile apps.
28
+ const statusBarItemEl = this.addStatusBarItem();
29
+ statusBarItemEl.setText('Status bar text');
30
+
31
+ // This adds a simple command that can be triggered anywhere
32
+ this.addCommand({
33
+ id: 'open-modal-simple',
34
+ name: 'Open modal (simple)',
35
+ callback: () => {
36
+ new {{ plugin_class }}Modal(this.app).open();
37
+ },
38
+ });
39
+ // This adds an editor command that can perform some operation on the current editor instance
40
+ this.addCommand({
41
+ id: 'replace-selected',
42
+ name: 'Replace selected content',
43
+ editorCallback: (
44
+ editor: Editor,
45
+ _ctx: MarkdownView | MarkdownFileInfo,
46
+ ) => {
47
+ editor.replaceSelection('Sample editor command');
48
+ },
49
+ });
50
+ // This adds a complex command that can check whether the current state of the app allows execution of the command
51
+ this.addCommand({
52
+ id: 'open-modal-complex',
53
+ name: 'Open modal (complex)',
54
+ checkCallback: (checking: boolean) => {
55
+ // Conditions to check
56
+ const markdownView =
57
+ this.app.workspace.getActiveViewOfType(MarkdownView);
58
+ if (markdownView) {
59
+ // If checking is true, we're simply "checking" if the command can be run.
60
+ // If checking is false, then we want to actually perform the operation.
61
+ if (!checking) {
62
+ new {{ plugin_class }}Modal(this.app).open();
63
+ }
64
+
65
+ // This command will only show up in Command Palette when the check function returns true
66
+ return true;
67
+ }
68
+ return false;
69
+ },
70
+ });
71
+
72
+ // This adds a settings tab so the user can configure various aspects of the plugin
73
+ this.addSettingTab(new {{ plugin_class }}SettingTab(this.app, this));
74
+
75
+ // Register global DOM events, workspace events and intervals through
76
+ // this.registerDomEvent / this.registerEvent / this.registerInterval:
77
+ // Obsidian then removes them when the plugin is disabled.
78
+ }
79
+
80
+ onunload() {}
81
+
82
+ async loadSettings() {
83
+ this.settings = Object.assign(
84
+ {},
85
+ DEFAULT_SETTINGS,
86
+ (await this.loadData()) as Partial<{{ plugin_class }}Settings>,
87
+ );
88
+ }
89
+
90
+ async saveSettings() {
91
+ await this.saveData(this.settings);
92
+ }
93
+ }
94
+
95
+ class {{ plugin_class }}Modal extends Modal {
96
+ onOpen() {
97
+ const { contentEl } = this;
98
+ contentEl.setText('Woah!');
99
+ }
100
+
101
+ onClose() {
102
+ const { contentEl } = this;
103
+ contentEl.empty();
104
+ }
105
+ }
@@ -0,0 +1,38 @@
1
+ import { App, PluginSettingTab, Setting } from 'obsidian';
2
+ import {{ plugin_class }}Plugin from './main';
3
+
4
+ export interface {{ plugin_class }}Settings {
5
+ exampleSetting: string;
6
+ }
7
+
8
+ export const DEFAULT_SETTINGS: {{ plugin_class }}Settings = {
9
+ exampleSetting: 'default',
10
+ };
11
+
12
+ export class {{ plugin_class }}SettingTab extends PluginSettingTab {
13
+ plugin: {{ plugin_class }}Plugin;
14
+
15
+ constructor(app: App, plugin: {{ plugin_class }}Plugin) {
16
+ super(app, plugin);
17
+ this.plugin = plugin;
18
+ }
19
+
20
+ display(): void {
21
+ const { containerEl } = this;
22
+
23
+ containerEl.empty();
24
+
25
+ new Setting(containerEl)
26
+ .setName('Settings #1')
27
+ .setDesc("It's a secret")
28
+ .addText((text) =>
29
+ text
30
+ .setPlaceholder('Enter your secret')
31
+ .setValue(this.plugin.settings.exampleSetting)
32
+ .onChange(async (value) => {
33
+ this.plugin.settings.exampleSetting = value;
34
+ await this.plugin.saveSettings();
35
+ }),
36
+ );
37
+ }
38
+ }
@@ -0,0 +1,8 @@
1
+ /*
2
+
3
+ This CSS file will be included with your plugin, and
4
+ available in the app when your plugin is enabled.
5
+
6
+ If your plugin does not need CSS, delete this file.
7
+
8
+ */
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "inlineSourceMap": true,
4
+ "inlineSources": true,
5
+ "module": "ESNext",
6
+ "target": "ES2021",
7
+ "strict": true,
8
+ "noImplicitReturns": true,
9
+ "noFallthroughCasesInSwitch": true,
10
+ "noUncheckedIndexedAccess": true,
11
+ "moduleResolution": "node",
12
+ "isolatedModules": true,
13
+ "skipLibCheck": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "allowSyntheticDefaultImports": true,
16
+ "lib": ["ES2021", "DOM"]
17
+ },
18
+ "include": ["src/**/*.ts"]
19
+ }
@@ -0,0 +1,17 @@
1
+ import { readFileSync, writeFileSync } from 'fs';
2
+
3
+ const targetVersion = process.env.npm_package_version;
4
+
5
+ // read minAppVersion from manifest.json and bump version to target version
6
+ const manifest = JSON.parse(readFileSync('manifest.json', 'utf8'));
7
+ const { minAppVersion } = manifest;
8
+ manifest.version = targetVersion;
9
+ writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t'));
10
+
11
+ // update versions.json with target version and minAppVersion from manifest.json
12
+ // but only if the target version is not already in versions.json
13
+ const versions = JSON.parse(readFileSync('versions.json', 'utf8'));
14
+ if (!(targetVersion in versions)) {
15
+ versions[targetVersion] = minAppVersion;
16
+ writeFileSync('versions.json', JSON.stringify(versions, null, '\t'));
17
+ }