# Development ## Architecture - `src/model.ts` contains pure parsing and text transforms. - `src/main.ts` connects those transforms to Obsidian and CodeMirror. - `styles.css` neutralizes Markdown list/code offsets only on parser-recognized editor lines decorated by `src/main.ts`. - `tests/model.test.ts` verifies numbering behavior without launching Obsidian. - `esbuild.config.mjs` creates the CommonJS `main.js` release artifact. `main.js` is generated and ignored by Git. Build it locally for testing; the release workflow rebuilds it from the tagged source and uploads it as a release attachment. The model returns the complete intended text and selection. The integration layer calculates a minimal change and dispatches exactly one transaction. Keep this rule for every new editor operation so Ctrl+Z remains atomic. ## Commands ```bash pnpm install pnpm test pnpm test:watch pnpm lint pnpm build pnpm dev ``` Development requires Node.js 22.13 or newer and pnpm 11. Use a disposable vault for manual testing. Copy `main.js`, `manifest.json`, and `styles.css` into `.obsidian/plugins/nested-ordered-numbering/`, reload Obsidian, and enable the plugin. ## Test matrix - Parser accepts only prefixes with the final period. - Enter creates same-depth siblings when the current item has content. - Enter on a prefix-only item exits numbering and leaves one plain blank line. - Tab and Shift+Tab preserve subtrees. - Root Shift+Tab produces plain text. - Multi-line selections remain atomic. - Insert/delete operations renumber neighboring blocks. - Inserting a root item and then indenting it restores every downstream root number, including across blank lines. - Legacy indentation normalizes to the fixed-width layout. - The first three Tab levels move by the same visible interval in Live Preview. - Outliner remains enabled during manual conflict testing.