Corrections based on feedback
This commit is contained in:
11
AGENTS.md
11
AGENTS.md
@@ -9,10 +9,12 @@
|
|||||||
## Environment & tooling
|
## Environment & tooling
|
||||||
|
|
||||||
- Node.js: use current LTS (Node 18+ recommended).
|
- Node.js: use current LTS (Node 18+ recommended).
|
||||||
- Package manager: npm.
|
- **Package manager: npm** (required for this sample - `package.json` defines npm scripts and dependencies).
|
||||||
- Bundler: esbuild (preferred). Rollup or webpack are acceptable if they bundle all external dependencies into `main.js`.
|
- **Bundler: esbuild** (required for this sample - `esbuild.config.mjs` and build scripts depend on it). Alternative bundlers like Rollup or webpack are acceptable for other projects if they bundle all external dependencies into `main.js`.
|
||||||
- Types: `obsidian` type definitions.
|
- Types: `obsidian` type definitions.
|
||||||
|
|
||||||
|
**Note**: This sample project has specific technical dependencies on npm and esbuild. If you're creating a plugin from scratch, you could choose different tools, but you'll need to replace the build configuration accordingly.
|
||||||
|
|
||||||
|
|
||||||
### Install
|
### Install
|
||||||
|
|
||||||
@@ -59,7 +61,7 @@ npm run build
|
|||||||
constants.ts
|
constants.ts
|
||||||
types.ts # TypeScript interfaces and types
|
types.ts # TypeScript interfaces and types
|
||||||
```
|
```
|
||||||
- Do not commit `node_modules/` or build artifacts.
|
- **Do not commit build artifacts**: Never commit `node_modules/`, `main.js`, or other generated files to version control.
|
||||||
- Keep the plugin small. Avoid large dependencies. Prefer browser-compatible packages.
|
- Keep the plugin small. Avoid large dependencies. Prefer browser-compatible packages.
|
||||||
- Generated output should be placed at the plugin root or `dist/` depending on your build setup. Release artifacts must end up at the top level of the plugin folder in the vault (`main.js`, `manifest.json`, `styles.css`).
|
- Generated output should be placed at the plugin root or `dist/` depending on your build setup. Release artifacts must end up at the top level of the plugin folder in the vault (`main.js`, `manifest.json`, `styles.css`).
|
||||||
|
|
||||||
@@ -94,7 +96,7 @@ npm run build
|
|||||||
## Versioning & releases
|
## Versioning & releases
|
||||||
|
|
||||||
- Bump `version` in `manifest.json` (SemVer) and update `versions.json` to map plugin version → minimum app version.
|
- Bump `version` in `manifest.json` (SemVer) and update `versions.json` to map plugin version → minimum app version.
|
||||||
- Create a GitHub release whose tag exactly matches `manifest.json`'s `version` (avoid a leading `v` unless your repo uses it consistently).
|
- Create a GitHub release whose tag exactly matches `manifest.json`'s `version`. Do not use a leading `v`.
|
||||||
- Attach `manifest.json`, `main.js`, and `styles.css` (if present) to the release as individual assets.
|
- Attach `manifest.json`, `main.js`, and `styles.css` (if present) to the release as individual assets.
|
||||||
- After the initial release, follow the process to add/update your plugin in the community catalog as required.
|
- After the initial release, follow the process to add/update your plugin in the community catalog as required.
|
||||||
|
|
||||||
@@ -235,6 +237,7 @@ this.registerInterval(window.setInterval(() => { /* ... */ }, 1000));
|
|||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
- Plugin doesn't load after build: ensure `main.js` and `manifest.json` are at the top level of the plugin folder under `<Vault>/.obsidian/plugins/<plugin-id>/`.
|
- Plugin doesn't load after build: ensure `main.js` and `manifest.json` are at the top level of the plugin folder under `<Vault>/.obsidian/plugins/<plugin-id>/`.
|
||||||
|
- Build issues: if `main.js` is missing, run `npm run build` or `npm run dev` to compile your TypeScript source code.
|
||||||
- Commands not appearing: verify `addCommand` runs after `onload` and IDs are unique.
|
- Commands not appearing: verify `addCommand` runs after `onload` and IDs are unique.
|
||||||
- Settings not persisting: ensure `loadData`/`saveData` are awaited and you re-render the UI after changes.
|
- Settings not persisting: ensure `loadData`/`saveData` are awaited and you re-render the UI after changes.
|
||||||
- Mobile-only issues: confirm you're not using desktop-only APIs; check `isDesktopOnly` and adjust.
|
- Mobile-only issues: confirm you're not using desktop-only APIs; check `isDesktopOnly` and adjust.
|
||||||
|
|||||||
Reference in New Issue
Block a user