Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New plugin: MarkdownTodo #481

Open
wants to merge 3 commits into
base: plugin_api_v2
Choose a base branch
from

Conversation

YukiGasai
Copy link

Added a plugin to change todos of markdown files.

@cibere
Copy link
Contributor

cibere commented Mar 10, 2025

I am unable to use your plugin as I keep getting an error.

Please open new issue in: https://github.com/YukiGasai/Flow.Launcher.Plugin.MarkdownTodo/issues
1. upload log file: C:\Users\default.MyPC\AppData\Roaming\FlowLauncher\Logs\1.19.5\2025-03-10.txt
2. copy below exception message

Flow Launcher version: 1.19.5
OS Version: 22631.4890
IntPtr Length: 8
x64: True

Python Path: C:\Users\default.MyPC\AppData\Roaming\FlowLauncher\Environments\Python\PythonEmbeddable-v3.11.4\pythonw.exe
Node Path: C:\Program Files\nodejs\node.exe
Date: 03/10/2025 12:29:59
Exception:
MarkdownTodo Exception: 
Websites: https://github.com/YukiGasai/Flow.Launcher.Plugin.MarkdownTodo
Author: YukiGasai
Version: 0.0.1
Flow.Launcher.Core.ExternalPlugins.FlowPluginException: node:internal/modules/package_json_reader:268
  throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
        ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'flow-launcher-helper' imported from C:\Users\default.MyPC\AppData\Roaming\FlowLauncher\Plugins\Flow.Launcher.Plugin.MarkdownTodo-b59e1606-2b05-4432-882e-6597382a3305\dist\main.js
    at Object.getPackageJSONURL (node:internal/modules/package_json_reader:268:9)
    at packageResolve (node:internal/modules/esm/resolve:768:81)
    at moduleResolve (node:internal/modules/esm/resolve:854:18)
    at defaultResolve (node:internal/modules/esm/resolve:984:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:685:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:634:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:617:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:273:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:135:49) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v22.14.0

 ---> System.IO.InvalidDataException: node:internal/modules/package_json_reader:268
  throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
        ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'flow-launcher-helper' imported from C:\Users\default.MyPC\AppData\Roaming\FlowLauncher\Plugins\Flow.Launcher.Plugin.MarkdownTodo-b59e1606-2b05-4432-882e-6597382a3305\dist\main.js
    at Object.getPackageJSONURL (node:internal/modules/package_json_reader:268:9)
    at packageResolve (node:internal/modules/esm/resolve:768:81)
    at moduleResolve (node:internal/modules/esm/resolve:854:18)
    at defaultResolve (node:internal/modules/esm/resolve:984:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:685:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:634:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:617:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:273:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:135:49) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v22.14.0

   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 243
   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 248
   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.QueryAsync(Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 261
   at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass28_0.<<QueryForPluginAsync>b__0>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 248
--- End of stack trace from previous location ---
   at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 action) in C:\projects\flow-launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 34
   at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 247
   --- End of inner exception stack trace ---
   at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass28_1.<QueryForPluginAsync>b__1(ActionContext _) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 276
   at Flow.Launcher.Plugin.Result.ExecuteAsync(ActionContext context) in /_/Flow.Launcher.Plugin/Result.cs:line 246
   at Flow.Launcher.ViewModel.MainViewModel.OpenResultAsync(String index) in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 389
   at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

@YukiGasai
Copy link
Author

Hi,
I can't reproduce the error.
My current setup to try to get it is using pm install https://github.com/YukiGasai/Flow.Launcher.Plugin.MarkdownTodo/releases/download/v0.0.1/Flow.Launcher.Plugin.MarkdownTodo.zip
Did you use another way to install the plugin?

The zip has the the node_modules folder and the package is inside it.

@cibere
Copy link
Contributor

cibere commented Mar 10, 2025

Hi, I can't reproduce the error. My current setup to try to get it is using pm install https://github.com/YukiGasai/Flow.Launcher.Plugin.MarkdownTodo/releases/download/v0.0.1/Flow.Launcher.Plugin.MarkdownTodo.zip Did you use another way to install the plugin?

The zip has the the node_modules folder and the package is inside it.

I did indeed install it with pm install https://github.com/YukiGasai/Flow.Launcher.Plugin.MarkdownTodo/releases/download/v0.0.1/Flow.Launcher.Plugin.MarkdownTodo.zip.

I'm not too familiar with javascript plugins myself, so I'm not sure what is going on

@YukiGasai
Copy link
Author

Thank you for the fast response.
I removed the 'flow-launcher-helper' dependency so it should no longer error there and recreated the v0.0.1 release to include the latest commit.

@YukiGasai YukiGasai requested a review from cibere March 12, 2025 20:51
@cibere
Copy link
Contributor

cibere commented Mar 14, 2025

Thank you for the fast response. I removed the 'flow-launcher-helper' dependency so it should no longer error there and recreated the v0.0.1 release to include the latest commit.

Hey, sorry for taking so long to get back to you.

I'm honestly a little confused as to how the plugin is supposed to work. I gave it a folder, and it said that a certain file didn't exist, so I created a file with the same name. However I still get that same error. Is the plugin supposed to be used with a different program, or a certain method of storing todos in markdown?

image
image

@YukiGasai
Copy link
Author

Hi, no problem.

The file you have created is missing a 0 in the month section.
To explain the plugin a little bit. It is mostly for obsidian users who want to update their daily tasks without opening the program. They will have a file for each day so the date pattern is replaced with the current day.
I implemented it so you could also use a file without date pattern, then you would see the same todos every time or you could leave the filename empty and it will get the todos from all the files in the folder (no subfolders).
If the configuration is not straightforward enough and the README is not clear enough I could create a small tutorial/introduction video.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants