Skip to content

Commit

Permalink
merge latest beta changes (#26)
Browse files Browse the repository at this point in the history
* feat: ✨ add options to "slugify" the filenames

implements jsonMartin#27
will work best together with the changes proposed in https://github.com/johannrichard/readwise-mirror/tree/deduplicate-files

* docs: 📝 add section on slugifying filenames in README

* refactor: 🎨 reduce chatter by using `console.debug()` more often

* build: 👷 move dev-dependency

* feat: ✨ implement deduplication and frontmatter validation

- implement deduplication based on `readwise_url` property from exports: user can select to eitehr delete or tag duplicate entries
- contents of the duplicate file will be overwritten
- exact filename match will be kept if existing,
- otherwise, the first match will be renamed in the vault so that links can be updated
- validate frontmatter yaml and display error messages or rendered frontmatter

* docs: ✨ introduce frontmatter validation and file deduplication

* chore: 💩 add todo to check whether the dataview plugin is the only viable way to find dupes

* ci: 💚 fix `package.json` version

* build: 💚 fix`semantic-release` build

* build: 💚 fix semantic-release on beta branch

* build: 🚀 deploy on `beta` branch automatically

* refactor: ➕ move to `yaml` from `js-yaml`

- change `yaml` library

* fix: ✅ improve robustness for data edge cases

- add line-break in sample data
- use `filenamify` to create valid filenames (incl. from titles with linebreaks) if `slugify` is disabled

* fix: 🐛 fix frontmatter validation (ui)

- run`YAML.parse()` when validating frontmatter template

* fix: 🐛 increase filename max length to 255 characters

* feat: ✨ update and protect frontmatter

with a new setting, it is now possible to keep existing, additional frontmatter in files, and to protect from specific fields to be updated even if they exists in the frontmatter template. This works best if you also enable deduplication.

* fix: 🐛 catch additional cases

- update frontmatter when deduplication is turned off
- catch case where deduplication is turned off and files are not written

* docs: 📝 add feature documentatio for frontmatter update and protection

add documentation for frontmatter updates and protection in the `README.md`

* docs: 🐛 fix documentation mistakes

* feat: 🚸 only protect fields that exist in the current frontmatter

- protected fields which are not present in the current file will be added (if set in the template during first sync), and
- will be protected in future syncs once they exist in the current file

* docs: 🚸 explain frontmatter protection in more detail

* refactor: 🚸 improve display of template blocks in settings

improve the display long templates in the settings screen by adjusting the textarea dynamically.

* refactor: 🚸 dynamically toggle slugify option visibility

only show slugify options if the option to slugify is enabled

* refactor: ♻️ refactor files and separate settings, definitions, and main plugin

* refactor: ♻️ refactor codebase into separate `src` directory

* refactor: ♻️ further refactoring of the code base

separate models from ui, services, and main

* chore: 🚚 move, refactor, and clean-up code

* perf: ⚡️ remove dataviee dependency and improve deduplication performance

- by implementing deduplication via metadatacache, we remove a dependency to another plugin *and* improve deduplication performance at the same time (approx. by a factor of 10 for 10 duplicates of one file).

* fix: 🐛 correctly update frontmatter when deduplicating

when multiple files exist, make sure we properly update the frontmatter for all duplicate files if setting is enabled

* style: 🎨 format code

* build: 🐛 fix local deploy system after refactor

* fix: 🚑️ account for filename normalization

ensure we get files with a compatible composed normalized path

* fix: 👽 implement fix for dealing with `js-yaml` parsing

implement a fix to avoid line-breaks in long titles until platers/obsidian-linter#1227 is implemented in `platers/obsidian-linter`.

* refactor: use Obsidian's buil-in `normalizePath()` function when working with filenames (e.g. to find duplicates with `getAbstractFilePath()`)

* feat: ✨ deduplicate Readwise duplicates

implement code to treat the case of multiple Readwise items with the same title (i.e. the same filename in Obsidian)

* docs: 📝 improve the deduplication documentation

explain the use-case for deduplication better and explain *local* and *remote* duplicates in the documentation

* style: 🎨 improve some of the new code and remove unused comments

* refactor: 🔀 merging some upstream changes

* build: 🐛 fix release packaging

add missing `src/ui/styles/styles.css` from src refactoring to release

* feat: ✨ implement more robust error-handling for Readwise API

catch error 429 (Rate Limit) in case header can't be read, catch (rare) empty results, handle other HTTP errors than 429 (@coderrabbit suggestions)

* fix: 🐛 fix wrong variable names

correctly catch missing `created_at` and `updated_at` (was `highlighted_at`)

* fix: 📌 pin `semantic-release-obsidian-plugin`

pin osbidian release plugin in build scripts and use npm version instead of github version
  • Loading branch information
johannrichard authored Jan 24, 2025
1 parent c859c86 commit f6e5de2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"dev": "rollup --config rollup.config.js -w",
"build": "rollup --config rollup.config.js --environment BUILD:production",
"deploy:local": "npm run build && cross-env PACKAGE_NAME=$npm_package_name node deploy-local.js",
"release:local": "npm ci && npm run build && npx -p github:brianrodri/semantic-release-obsidian-plugin semantic-release --dry-run false",
"release:dry-run": "npm ci && npm run build && npx -p github:brianrodri/semantic-release-obsidian-plugin semantic-release --dry-run"
"release:local": "npm ci && npm run build && npx -p semantic-release-obsidian-plugin@1.1.0 semantic-release --dry-run false",
"release:dry-run": "npm ci && npm run build && npx -p semantic-release-obsidian-plugin@1.1.0 semantic-release --dry-run"
},
"keywords": [],
"author": "",
Expand All @@ -31,9 +31,10 @@
},
"dependencies": {
"@sindresorhus/slugify": "^2.2.1",
"nunjucks": "^3.2.3",
"filenamify": "^6.0.0",
"nunjucks": "^3.2.3",
"spacetime": "^6.16.0",
"unused-filename": "^4.0.1",
"yaml": "^2.7.0"
}
}

0 comments on commit f6e5de2

Please sign in to comment.