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

Add plugin: Plugin REPL #5050

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add plugin: Plugin REPL #5050

wants to merge 6 commits into from

Conversation

talwrii
Copy link
Contributor

@talwrii talwrii commented Jan 3, 2025

I am submitting a new Community Plugin

Repo URL

Link to my plugin: https://github.com/talwrii/plugin-repl

Release Checklist

  • I have tested the plugin on
    • Windows
    • macOS
    • Linux
    • Android (if applicable)
    • iOS (if applicable)
  • My GitHub release contains all required files (as individual files, not just in the source.zip / source.tar.gz)
    • main.js
    • manifest.json
    • [ N/A] styles.css (optional)
  • GitHub release name matches the exact version number specified in my manifest.json (Note: Use the exact version number, don't include a prefix v)
  • The id in my manifest.json matches the id in the community-plugins.json file.
  • My README.md describes the plugin's purpose and provides clear usage instructions.
  • I have read the developer policies at https://docs.obsidian.md/Developer+policies, and have assessed my plugins's adherence to these policies.
  • I have read the tips in https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines and have self-reviewed my plugin to avoid these common pitfalls.
  • I have added a license in the LICENSE file.
  • My project respects and is compatible with the original license of any code from other plugins that I'm using.
  • I have given proper attribution to these other projects in my README.md.

Copy link

github-actions bot commented Jan 3, 2025

Hello!

I found the following issues in your plugin submission

Errors:

❌ Please don't include Obsidian in the plugin description


This check was done automatically. Do NOT open a new PR for re-validation. Instead, to trigger this check again, make a change to your PR and wait a few minutes, or close and re-open it.

@github-actions github-actions bot changed the title added talwrii/plugin-repl Add plugin: Plugin REPL Jan 3, 2025
@talwrii
Copy link
Contributor Author

talwrii commented Jan 3, 2025

Hello!

I found the following issues in your plugin submission

Errors:

❌ Please don't include Obsidian in the plugin description

This check was done automatically. Do NOT open a new PR for re-validation. Instead, to trigger this check again, make a change to your PR and wait a few minutes, or close and re-open it.

This should be fixed

@ObsidianReviewBot ObsidianReviewBot removed their assignment Jan 3, 2025
@ObsidianReviewBot
Copy link
Collaborator

The automated review has not found any issues with your code, ready for manual review.

Copy link

github-actions bot commented Jan 9, 2025

Hello!

I found the following issues in your plugin submission

Errors:

❌ Could not parse community-plugins.json, invalid JSON. Unexpected token ']', ..."epl"
},
]

" is not valid JSON


This check was done automatically. Do NOT open a new PR for re-validation. Instead, to trigger this check again, make a change to your PR and wait a few minutes, or close and re-open it.

@ObsidianReviewBot
Copy link
Collaborator

The automated review has not found any issues with your code, ready for manual review.

Copy link

Hello!

I found the following issues in your plugin submission

Errors:

❌ The newly added entry is not at the end, or you are submitting on someone else's behalf. The last plugin in the list is: webceoboy/moredraw-obsidian. If you are submitting from a GitHub org, you need to be a public member of the org.


This check was done automatically. Do NOT open a new PR for re-validation. Instead, to trigger this check again, make a change to your PR and wait a few minutes, or close and re-open it.

Copy link

Hello!

I found the following issues in your plugin submission

Errors:

❌ Please don't include Obsidian in the plugin description


This check was done automatically. Do NOT open a new PR for re-validation. Instead, to trigger this check again, make a change to your PR and wait a few minutes, or close and re-open it.

@ObsidianReviewBot
Copy link
Collaborator

The automated review has not found any issues with your code, ready for manual review.

@joethei
Copy link
Collaborator

joethei commented Jan 20, 2025

To make the manual review process and future plugin maintenance more efficient, we recommend that you move all source code files into a src directory.

this.app.workspace.on('active-leaf-change', () => { plugin.loadInit() })
Events need to be registered, so they can be properly unloaded when the plugin is disabled. https://docs.obsidian.md/Plugins/Events

let vaultPath = this.app.vault.adapter.basePath
You need to do a instanceof FileSystemAdapter and use the getBasePath() function instead of blindly adding the @ts-ignore

id: 'repl-enter',, id: 'repl-exec',, id: 'repl-prompt-exec',
No need to prefix this with repl, Obsidian already prefixes this with the plugin ID internally.

app: any, app: any, app: any, app: any, app: any, editor: any, app: any, app: any
Don't use any here, the type is known.

javascript, Javascript
Please use the proper capitalization of this word, which is JavaScript

@joethei joethei self-assigned this Jan 20, 2025
@joethei joethei added Changes requested Minor changes requested PR can be merged after some final changes have been requested labels Jan 20, 2025
@ObsidianReviewBot ObsidianReviewBot added Ready for review Changes made and removed Changes requested Minor changes requested PR can be merged after some final changes have been requested labels Jan 21, 2025
@talwrii
Copy link
Contributor Author

talwrii commented Jan 21, 2025

To make the manual review process and future plugin maintenance more efficient, we recommend that you move all source code files into a src directory.

Done in:talwrii/plugin-repl@2959a57

Events need to be registered

Done in: talwrii/plugin-repl@7acf21f

No need to prefix this with repl, Obsidian already prefixes this with the plugin ID internally.

Done in: talwrii/plugin-repl@2da8195

Please use the proper capitalization of this word, which is JavaScript

Done in: talwrii/plugin-repl@7c8b88b

You need to do a instanceof FileSystemAdapter and use the getBasePath() function instead of blindly adding the @ts-ignore
Don't use any here, the type is known.

Done in: talwrii/plugin-repl@e1e1360
I've replaced most of these, sometimes with a change of the method I'm using.

Sometimes I'm using methods and properties (particularly related to plugins and commands) which aren't part of the documented API, which was part of the reason I was using any. I've implemented my own "PrivateApp" interface which adds these methods.

Is there an analogue of getBasePath for CapacitorAdaptor. I'm mostly using this for my workaround require stuff.

Okay, I've given the new version a test and cut a new release: https://github.com/talwrii/plugin-repl/releases/tag/1.0.3

fix up name. "Automate the thing that shall not be named"
add back plugin (i accidentally removed it)
fix up description (again)
@talwrii
Copy link
Contributor Author

talwrii commented Jan 21, 2025

I did a force push (after rebasing onto upstream master) because there were complaints here about a rebase merge being impossible.

@ObsidianReviewBot
Copy link
Collaborator

Thank you for your submission, an automated scan of your plugin code's revealed the following issues:

Required

[1]:You should not cast this, instead use a instanceof check to make sure that it's actually the adapter you expect.


Optional

[1][2]:Casting to any should be avoided as much as possible.


Do NOT open a new PR for re-validation.
Once you have pushed all of the required changes to your repo, the bot will update the labels on this PR within 6 hours.
If you think some of the required changes are incorrect, please comment with /skip and the reason why you think the results are incorrect.

@ObsidianReviewBot ObsidianReviewBot added Changes requested Additional review required PR needs to be reviewed by another person, after the currently requested changes have been made and removed Ready for review labels Jan 22, 2025
@talwrii
Copy link
Contributor Author

talwrii commented Jan 23, 2025

I fixed the "as warnings". I'm still using "as casts" for some interfaces (specifically the wrappers I have for Templater and dataview) - the linting script Obsidian is using seems to allow those.

There does not seem to be a way to "test for" interfaces at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Additional review required PR needs to be reviewed by another person, after the currently requested changes have been made Changes made Changes requested plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants