@delorenj/pjangler 1.5.11 → 1.5.13
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.
- package/.mise/scripts/versioning.sh +26 -5
- package/README.md +25 -0
- package/dist/index.js +169 -36
- package/dist/mcp-server.js +153 -29
- package/dist/notebook/journal-service-main.js +4 -1
- package/dist/project-registry-service.js +1 -1
- package/package.json +1 -1
- package/templates/commonproject/copier.yml +102 -1
- package/templates/commonproject/template/.github/workflows/{% if is_obsidian_plugin %}lint.yml{% endif %} +29 -0
- package/templates/commonproject/template/.github/workflows/{% if is_obsidian_plugin %}release.yml{% endif %} +62 -0
- package/templates/commonproject/template/.mise/{% if is_obsidian_plugin %}tasks{% endif %}/plugin/link +27 -0
- package/templates/commonproject/template/AGENTS.md.jinja +67 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}.editorconfig{% endif %} +15 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}.npmrc{% endif %} +1 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}esbuild.config.mjs{% endif %} +49 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}eslint.config.mts{% endif %} +38 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}manifest.json{% endif %}.jinja +9 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}package-lock.json{% endif %}.jinja +5053 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}package.json{% endif %}.jinja +28 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}src{% endif %}/main.ts.jinja +105 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}src{% endif %}/settings.ts.jinja +38 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}styles.css{% endif %} +8 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}tsconfig.json{% endif %} +19 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}version-bump.mjs{% endif %} +17 -0
- package/templates/commonproject/template/{% if is_obsidian_plugin %}versions.json{% endif %} +3 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#MISE description="Symlink this plugin into an Obsidian vault: plugin:link [vault] (default: $OBSIDIAN_VAULT)"
|
|
3
|
+
#MISE tools={node="24"}
|
|
4
|
+
# Obsidian loads a plugin from <vault>/.obsidian/plugins/<manifest id>/, reading
|
|
5
|
+
# main.js, manifest.json and styles.css. Linking the repo there means every
|
|
6
|
+
# `npm run dev` rebuild is live after a plugin reload (or instantly with the
|
|
7
|
+
# Hot-Reload community plugin). Replaces only a symlink it can recognise as a
|
|
8
|
+
# link; a real directory at the destination is left alone.
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
root="${MISE_CONFIG_ROOT:-$(pwd)}"
|
|
12
|
+
vault="${1:-${OBSIDIAN_VAULT:-}}"
|
|
13
|
+
[ -n "$vault" ] || { echo "plugin:link: pass the vault path or set OBSIDIAN_VAULT" >&2; exit 2; }
|
|
14
|
+
[ -d "$vault/.obsidian" ] || { echo "plugin:link: $vault is not an Obsidian vault (no .obsidian/)" >&2; exit 2; }
|
|
15
|
+
|
|
16
|
+
id="$(node -p 'JSON.parse(require("fs").readFileSync(process.argv[1], "utf8")).id' "$root/manifest.json")"
|
|
17
|
+
[ -n "$id" ] || { echo "plugin:link: manifest.json has no id" >&2; exit 1; }
|
|
18
|
+
|
|
19
|
+
dest="$vault/.obsidian/plugins/$id"
|
|
20
|
+
if [ -e "$dest" ] && [ ! -L "$dest" ]; then
|
|
21
|
+
echo "plugin:link: $dest already exists and is not a symlink; remove it first" >&2
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
mkdir -p "$vault/.obsidian/plugins"
|
|
25
|
+
ln -sfn "$root" "$dest"
|
|
26
|
+
echo "linked $dest -> $root"
|
|
27
|
+
[ -f "$root/main.js" ] || echo "plugin:link: no main.js yet; run npm run dev (or npm run build)" >&2
|
|
@@ -5,3 +5,70 @@
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
7
|
__TODO__
|
|
8
|
+
{%- if is_obsidian_plugin %}
|
|
9
|
+
|
|
10
|
+
## Obsidian community plugin
|
|
11
|
+
|
|
12
|
+
This project is an Obsidian community plugin, scaffolded from the canonical
|
|
13
|
+
[obsidian-sample-plugin](https://github.com/obsidianmd/obsidian-sample-plugin).
|
|
14
|
+
TypeScript in `src/` is bundled by esbuild into `main.js`, which Obsidian loads.
|
|
15
|
+
|
|
16
|
+
- Package manager: **npm** (`package.json` scripts, `package-lock.json`). Never bun or pnpm.
|
|
17
|
+
- Bundler: **esbuild** (`esbuild.config.mjs`). Types come from the `obsidian` package.
|
|
18
|
+
- Release artifacts: `main.js`, `manifest.json`, and `styles.css` (optional).
|
|
19
|
+
|
|
20
|
+
### Commands
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install # dev dependencies, pinned by the committed package-lock.json
|
|
24
|
+
npm run dev # watch build -> main.js (inline sourcemaps)
|
|
25
|
+
npm run build # type-check, then production build
|
|
26
|
+
npm run lint # eslint with eslint-plugin-obsidianmd
|
|
27
|
+
mise run plugin:link # symlink this repo into $OBSIDIAN_VAULT/.obsidian/plugins/<id>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Reload Obsidian (or use the Hot-Reload plugin) and enable the plugin under
|
|
31
|
+
**Settings → Community plugins**.
|
|
32
|
+
|
|
33
|
+
### Layout
|
|
34
|
+
|
|
35
|
+
- `src/main.ts` stays small: plugin lifecycle (`onload`/`onunload`) and registration only.
|
|
36
|
+
- Feature logic goes in focused modules under `src/` (`settings.ts`, `commands/`, `ui/`, `utils/`).
|
|
37
|
+
- Never commit `node_modules/`, `main.js`, `*.map`, or the vault's `data.json`.
|
|
38
|
+
- Bundle every runtime dependency into `main.js`; keep dependencies small and browser-compatible.
|
|
39
|
+
|
|
40
|
+
### Manifest rules (`manifest.json`)
|
|
41
|
+
|
|
42
|
+
- `id` is stable API: never change it after release. It must not contain "obsidian",
|
|
43
|
+
and for local development it must match the plugin folder name in the vault.
|
|
44
|
+
- `version` is SemVer `x.y.z`; keep `minAppVersion` accurate when you use newer APIs.
|
|
45
|
+
- `isDesktopOnly` must be `true` if you use Node or Electron APIs.
|
|
46
|
+
- Canonical checks: https://github.com/obsidianmd/obsidian-releases/blob/master/.github/workflows/validate-plugin-entry.yml
|
|
47
|
+
|
|
48
|
+
### Versioning and releases
|
|
49
|
+
|
|
50
|
+
- `npm version patch|minor|major` is the release step. It bumps `package.json`, and
|
|
51
|
+
`version-bump.mjs` syncs `manifest.json` and `versions.json` (plugin version → minimum
|
|
52
|
+
app version). It commits, then tags the bare version: no leading `v`, because `.npmrc`
|
|
53
|
+
sets `tag-version-prefix=""`.
|
|
54
|
+
- `mise run version:bump` keeps the same three files in step without committing or tagging.
|
|
55
|
+
- Push the tag. `.github/workflows/release.yml` drafts the GitHub release with `main.js`,
|
|
56
|
+
`manifest.json` and `styles.css` attached.
|
|
57
|
+
- The community catalog requires a public repo and a LICENSE; pick one before submitting.
|
|
58
|
+
|
|
59
|
+
### Plugin conventions
|
|
60
|
+
|
|
61
|
+
- Add commands with `this.addCommand(...)` and stable IDs; never rename a released ID.
|
|
62
|
+
- Persist settings with `this.loadData()` / `this.saveData()`, with defaults in `settings.ts`.
|
|
63
|
+
- Register every DOM event, workspace event, and interval through `this.register*`,
|
|
64
|
+
so the plugin unloads without leaking listeners.
|
|
65
|
+
- Keep `onload` light: defer heavy work, debounce vault events, batch disk access.
|
|
66
|
+
- Stay inside the vault, make no network calls without a user-visible reason, and never
|
|
67
|
+
fetch or eval remote code. These are Obsidian's developer policies, and review enforces them.
|
|
68
|
+
- UI copy uses sentence case, short imperative labels, and **Settings → Community plugins**
|
|
69
|
+
style arrow navigation.
|
|
70
|
+
|
|
71
|
+
References: [API docs](https://docs.obsidian.md) ·
|
|
72
|
+
[Plugin guidelines](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines) ·
|
|
73
|
+
[Developer policies](https://docs.obsidian.md/Developer+policies)
|
|
74
|
+
{%- endif %}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# top-most EditorConfig file
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
end_of_line = lf
|
|
7
|
+
insert_final_newline = true
|
|
8
|
+
indent_style = tab
|
|
9
|
+
indent_size = 4
|
|
10
|
+
quote_type = single
|
|
11
|
+
tab_width = 4
|
|
12
|
+
|
|
13
|
+
# YAML forbids tab indentation (workflows, .copier-answers.yml, BMAD config).
|
|
14
|
+
[*.{yml,yaml}]
|
|
15
|
+
indent_style = space
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tag-version-prefix=""
|
package/templates/commonproject/template/{% if is_obsidian_plugin %}esbuild.config.mjs{% endif %}
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import esbuild from 'esbuild';
|
|
2
|
+
import process from 'process';
|
|
3
|
+
import { builtinModules } from 'node:module';
|
|
4
|
+
|
|
5
|
+
const banner = `/*
|
|
6
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
7
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
8
|
+
*/
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
const prod = process.argv[2] === 'production';
|
|
12
|
+
|
|
13
|
+
const context = await esbuild.context({
|
|
14
|
+
banner: {
|
|
15
|
+
js: banner,
|
|
16
|
+
},
|
|
17
|
+
entryPoints: ['src/main.ts'],
|
|
18
|
+
bundle: true,
|
|
19
|
+
external: [
|
|
20
|
+
'obsidian',
|
|
21
|
+
'electron',
|
|
22
|
+
'@codemirror/autocomplete',
|
|
23
|
+
'@codemirror/collab',
|
|
24
|
+
'@codemirror/commands',
|
|
25
|
+
'@codemirror/language',
|
|
26
|
+
'@codemirror/lint',
|
|
27
|
+
'@codemirror/search',
|
|
28
|
+
'@codemirror/state',
|
|
29
|
+
'@codemirror/view',
|
|
30
|
+
'@lezer/common',
|
|
31
|
+
'@lezer/highlight',
|
|
32
|
+
'@lezer/lr',
|
|
33
|
+
...builtinModules,
|
|
34
|
+
],
|
|
35
|
+
format: 'cjs',
|
|
36
|
+
target: 'es2021',
|
|
37
|
+
logLevel: 'info',
|
|
38
|
+
sourcemap: prod ? false : 'inline',
|
|
39
|
+
treeShaking: true,
|
|
40
|
+
outfile: 'main.js',
|
|
41
|
+
minify: prod,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (prod) {
|
|
45
|
+
await context.rebuild();
|
|
46
|
+
process.exit(0);
|
|
47
|
+
} else {
|
|
48
|
+
await context.watch();
|
|
49
|
+
}
|
package/templates/commonproject/template/{% if is_obsidian_plugin %}eslint.config.mts{% endif %}
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import obsidianmd from 'eslint-plugin-obsidianmd';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
import { globalIgnores, defineConfig } from 'eslint/config';
|
|
4
|
+
|
|
5
|
+
export default defineConfig(
|
|
6
|
+
globalIgnores([
|
|
7
|
+
'node_modules',
|
|
8
|
+
'dist',
|
|
9
|
+
'esbuild.config.mjs',
|
|
10
|
+
'version-bump.mjs',
|
|
11
|
+
'versions.json',
|
|
12
|
+
'main.js',
|
|
13
|
+
'package.json',
|
|
14
|
+
'package-lock.json',
|
|
15
|
+
'tsconfig.json',
|
|
16
|
+
// CommonProject tooling: agent CLI roots, .mise, .github, the BMAD
|
|
17
|
+
// method tree and Hermes role dirs. None of it ships in the plugin.
|
|
18
|
+
'.*',
|
|
19
|
+
'_bmad',
|
|
20
|
+
'_bmad-output',
|
|
21
|
+
'agents',
|
|
22
|
+
]),
|
|
23
|
+
{
|
|
24
|
+
languageOptions: {
|
|
25
|
+
globals: {
|
|
26
|
+
...globals.browser,
|
|
27
|
+
},
|
|
28
|
+
parserOptions: {
|
|
29
|
+
projectService: {
|
|
30
|
+
allowDefaultProject: ['eslint.config.mts', 'manifest.json'],
|
|
31
|
+
},
|
|
32
|
+
tsconfigRootDir: import.meta.dirname,
|
|
33
|
+
extraFileExtensions: ['.json'],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
...obsidianmd.configs.recommended,
|
|
38
|
+
);
|