Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hnykda committed Jan 5, 2025
0 parents commit 03c4a2a
Show file tree
Hide file tree
Showing 22 changed files with 5,567 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# 2 space indentation
[*.{ts,js}]
indent_style = space
indent_size = 2

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
release.config.js
17 changes: 17 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": "latest"
},
"plugins": ["@typescript-eslint"],
"rules": {
"semi": [2, "never"]
}
}
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release
on:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/[email protected]
with:
version: 9
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.parcel-cache
dist
node_modules
yarn-error.log
.DS_Store
.idea
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
110 changes: 110 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2021 hkgnp

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# logseq-wallabag

**Heavily under development, not ready for production use yet!**

This plugin is heavily based on https://github.com/omnivore-app/logseq-omnivore (thank you!). This is an attempt to migrate it to use wallabag. Me - the author - decided to give it a shot after Omnivore closed the shop and I migrated to Wallabag.

I am very open to accepting more authors and contributors!

## How to use
Currently you won't be able to install the plugin in other way then manually building it and loading it as in Development section. Once you have it installed though, you should be able to put in your Wallabag API credentials (similarly to the Chrome plugin, that is Client ID, Client secret, URL, username, password) and run `Cmd+K` and then `Sync wallabag`. It should sync your Wallabag articles.


### TODO:
- [ ] remove all necessary bloat from the old plugin (the original plugin had much more knobs and switches which we currently do not support). Note that it might be easier to just start from scratch and manually copying the functionality than going from the previous repo first.
- [ ] rename all functions appropriately, ideally in a way where fetching data would be located in the API and the rest of the codebase could be generic
- [ ] make a proper logseq plugin release to use for everyone
- [ ] add more cool features!

## Development
1. install `pnpm`
2. install dependencies `pnpm install`
3. run `pnpm run dev`, build should happen and a new `dist` repository should show up
4. go to logseq, enable developer mode, go to plugins, click `load unpacked` and locate the root repository (not just the nested `dist` folder)
5. set up the plugin using the settings

It should pick up the build and as you load it, and it should (re)fetch your articles. If running in a dev mode, all you need to do after a new build is to click the `Reload` button at the logseq Plugins page.

If you ever see a weird duplication, restart logseq, tehre might be hanging processes.
67 changes: 67 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "logseq-wallabag",
"version": "1.0.0",
"description": "Import wallabag highlights and articles into Logseq.",
"main": "dist/index.html",
"targets": {
"main": false
},
"default": "dist/index.html",
"author": "wallabag",
"repository": {
"type": "git",
"url": "https://github.com/hnykda/wallabag-logseq-sync"
},
"scripts": {
"dev": "vite build --watch --base ./ --sourcemap inline --minify false --outDir ../dist public",
"build": "vite build public --outDir ../dist --base=./",
"lint": "eslint --ext .ts src"
},
"license": "MIT",
"logseq": {
"id": "_logseq-wallabag",
"title": "wallabag",
"icon": "./public/icon.png"
},
"dependencies": {
"@logseq/libs": "^0.0.15",
"date-fns": "^2.29.3",
"diff-match-patch": "^1.0.5",
"lodash": "^4.17.21",
"logseq-l10n": "^0.2.0",
"luxon": "^3.2.1",
"markdown-escape": "^1.1.0",
"mustache": "^4.2.0",
"out-of-character": "^1.2.1"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/chai": "^4.3.4",
"@types/chai-string": "^1.4.2",
"@types/diff-match-patch": "^1.0.32",
"@types/lodash": "^4.14.194",
"@types/luxon": "^2.3.2",
"@types/markdown-escape": "^1.1.0",
"@types/mocha": "^10.0.1",
"@types/mustache": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"chai": "^4.3.7",
"chai-string": "^1.5.0",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"mocha": "^10.2.0",
"prettier": "^2.5.1",
"vite": "^4.5.3",
"vite-plugin-logseq": "^1.1.2",
"semantic-release": "^19.0.3",
"typescript": "^4.4.3"
},
"volta": {
"node": "18.16.1",
"pnpm": "8.9.2"
}
}
Loading

0 comments on commit 03c4a2a

Please sign in to comment.