From cffdd945a29967f4fca891ccc3ff94d6e39fd14d Mon Sep 17 00:00:00 2001 From: Jason Swartz Date: Mon, 15 Jun 2026 18:15:47 -0700 Subject: [PATCH] Making version bumps easier --- CHANGELOG.md | 69 +++++++++++++++++++++++++++++++++++++ docs/release-notes/0.1.0.md | 31 ----------------- docs/release-notes/0.2.0.md | 34 ------------------ eslint.config.mts | 2 +- package.json | 1 + version-bump.mjs | 19 ++++++++++ 6 files changed, 90 insertions(+), 66 deletions(-) create mode 100644 CHANGELOG.md delete mode 100644 docs/release-notes/0.1.0.md delete mode 100644 docs/release-notes/0.2.0.md create mode 100644 version-bump.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3f2cdb3 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,69 @@ +# Changelog + +Changes to the Settings Float plugin for Obsidian. + + +# [0.2.0](https://github.com/swartzrock/obsidian-settings-float-plugin/releases/tag/0.2.0) + + +Maintenance release for Obsidian community plugin submission feedback and release workflow cleanup. + + +## Fixed + +- Uses Obsidian's `setCssStyles` helper for dynamic modal styles instead of assigning inline style properties directly. +- Uses Obsidian's `Setting(...).setHeading()` pattern for the plugin settings heading. +- Removes an unsafe iterator return in the open-enhancer lookup. +- Keeps numeric release tags aligned with `manifest.json` and `versions.json` instead of requiring a `v` prefix. +- Makes the narrow-window setting actually disable modal enhancement below the configured threshold. +- Corrects package repository, issues, and homepage metadata to the published repository URL. +- Uses Obsidian theme variables and focus-visible outlines for plugin controls. + +## Changed + +- Updates the plugin description to explicitly mention Settings, Theme, and Community Plugins dialogs. +- Adds test coverage support for Obsidian DOM helper methods in the JSDOM test environment. + +## Compatibility + +- Desktop-only release. +- Minimum Obsidian app version remains `1.6.0`. +- `versions.json` maps `0.2.0` to `1.6.0`. + +## Release Artifacts + +- `manifest.json` +- `main.js` +- `styles.css` + + + + +# [0.1.0](https://github.com/swartzrock/obsidian-settings-float-plugin/releases/tag/0.1.0) + +Initial desktop release for moving and resizing the core Obsidian Settings modal. + + +## Added + +- Detects and enhances only the main Obsidian Settings modal. +- Detects and enhances Obsidian's theme and community plugin browser dialogs. +- Moves Settings by dragging non-interactive empty space inside the dialog. +- Resizes Settings from a bottom-right corner grip. +- Persists valid Settings geometry per vault and restores it on reopen. +- Clamps geometry to the visible Obsidian window on open, resize, and host-window resize. +- Adds a plugin settings tab for movement, resizing, persistence, narrow-window, mobile, and reset controls. +- Leaves nested child dialogs, such as font pickers, untouched. + +## Compatibility + +- Desktop-only release. +- Mobile behavior is disabled. +- Settings modal selectors are centralized for future Obsidian DOM changes. +- Theme compatibility uses isolated CSS classes and Obsidian CSS variables, but custom themes still need manual validation. + +## Release Artifacts + +- `manifest.json` +- `main.js` +- `styles.css` diff --git a/docs/release-notes/0.1.0.md b/docs/release-notes/0.1.0.md deleted file mode 100644 index be201bd..0000000 --- a/docs/release-notes/0.1.0.md +++ /dev/null @@ -1,31 +0,0 @@ -# Settings Float 0.1.0 Release Notes - -Initial desktop release for moving and resizing the core Obsidian Settings modal. - -## Added - -- Detects and enhances only the main Obsidian Settings modal. -- Detects and enhances Obsidian's theme and community plugin browser dialogs. -- Moves Settings by dragging non-interactive empty space inside the dialog. -- Resizes Settings from a bottom-right corner grip. -- Persists valid Settings geometry per vault and restores it on reopen. -- Clamps geometry to the visible Obsidian window on open, resize, and host-window resize. -- Adds a plugin settings tab for movement, resizing, persistence, narrow-window, mobile, and reset controls. -- Leaves nested child dialogs, such as font pickers, untouched. - -## Compatibility - -- Desktop-only release. -- Mobile behavior is disabled. -- Settings modal selectors are centralized for future Obsidian DOM changes. -- Theme compatibility uses isolated CSS classes and Obsidian CSS variables, but custom themes still need manual validation. - -## Release Artifacts - -- `manifest.json` -- `main.js` -- `styles.css` - -## Manual QA Required - -Before publishing, verify Settings movement, resizing, persistence, nested dialogs, and host-window resize behavior in a real Obsidian vault. diff --git a/docs/release-notes/0.2.0.md b/docs/release-notes/0.2.0.md deleted file mode 100644 index fe71712..0000000 --- a/docs/release-notes/0.2.0.md +++ /dev/null @@ -1,34 +0,0 @@ -# Settings Float 0.2.0 Release Notes - -Maintenance release for Obsidian community plugin submission feedback and release workflow cleanup. - -## Fixed - -- Uses Obsidian's `setCssStyles` helper for dynamic modal styles instead of assigning inline style properties directly. -- Uses Obsidian's `Setting(...).setHeading()` pattern for the plugin settings heading. -- Removes an unsafe iterator return in the open-enhancer lookup. -- Keeps numeric release tags aligned with `manifest.json` and `versions.json` instead of requiring a `v` prefix. -- Makes the narrow-window setting actually disable modal enhancement below the configured threshold. -- Corrects package repository, issues, and homepage metadata to the published repository URL. -- Uses Obsidian theme variables and focus-visible outlines for plugin controls. - -## Changed - -- Updates the plugin description to explicitly mention Settings, Theme, and Community Plugins dialogs. -- Adds test coverage support for Obsidian DOM helper methods in the JSDOM test environment. - -## Compatibility - -- Desktop-only release. -- Minimum Obsidian app version remains `1.6.0`. -- `versions.json` maps `0.2.0` to `1.6.0`. - -## Release Artifacts - -- `manifest.json` -- `main.js` -- `styles.css` - -## Manual QA Required - -Before publishing, verify Settings, Theme, and Community Plugins dialogs can still be moved and resized in a real Obsidian vault. diff --git a/eslint.config.mts b/eslint.config.mts index 03c7af1..057e846 100644 --- a/eslint.config.mts +++ b/eslint.config.mts @@ -30,7 +30,7 @@ export default defineConfig([ }, ...obsidianmd.configs.recommended, { - files: ["*.config.mjs"], + files: ["*.config.mjs", "version-bump.mjs"], rules: typeAwareObsidianRules, }, { diff --git a/package.json b/package.json index 61e3a3e..44f72a9 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "build": "node esbuild.config.mjs production", "eslint": "eslint .", "lint": "eslint .", + "version": "node version-bump.mjs && git add manifest.json versions.json", "typecheck": "tsc --noEmit", "test": "vitest run --environment jsdom" }, diff --git a/version-bump.mjs b/version-bump.mjs new file mode 100644 index 0000000..1d0380b --- /dev/null +++ b/version-bump.mjs @@ -0,0 +1,19 @@ +import { readFileSync, writeFileSync } from 'fs'; + +const targetVersion = process.env.npm_package_version; + +// read minAppVersion from manifest.json and bump version to target version +const manifest = JSON.parse(readFileSync('manifest.json', 'utf8')); +const { minAppVersion } = manifest; + +manifest.version = targetVersion; + +writeFileSync('manifest.json', JSON.stringify(manifest, null, ' ')); + +// update versions.json with target version and minAppVersion from manifest.json +// but only if the target version is not already in versions.json +const versions = JSON.parse(readFileSync('versions.json', 'utf8')); +if (!(targetVersion in versions)) { + versions[targetVersion] = minAppVersion; + writeFileSync('versions.json', JSON.stringify(versions, null, ' ')); +}