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.js support #10763

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

Conversation

stevefan1999-personal
Copy link
Contributor

@stevefan1999-personal stevefan1999-personal commented Jul 13, 2022

Sometimes it would be better to use a full blown script for plugin manifest because we can use it to resolve some complicated stuff and future type stubs for code safety*. This practice is basically everywhere. SWC, ESLint, Mocha, Jest all allows such use.

For my own sake, this also added a slightly good benefit of lexicographically sorting the fields thanks to ESLint. My OCD hits when I see the fields not being sorted from A to Z.

*: if you used a TypeScript transpiler, that is what most people should start doing.

Missing

Signed-off-by: steve <29133953+stevefan1999-personal@users.noreply.github.com>
Signed-off-by: steve <29133953+stevefan1999-personal@users.noreply.github.com>
This is fine...

Signed-off-by: steve <29133953+stevefan1999-personal@users.noreply.github.com>
@julianlam
Copy link
Member

julianlam commented Jul 13, 2022

I am not opposed to defining plugin configuration information this way 👍

@stevefan1999-personal stevefan1999-personal marked this pull request as ready for review July 13, 2022 17:37
@stevefan1999-personal
Copy link
Contributor Author

@barisusakli @psychobunny what you guys think?

src/upgrade.js Outdated Show resolved Hide resolved
configPath = path.join(paths.nodeModules, plugin, 'plugin.js');
}
// eslint-disable-next-line no-await-in-loop
if (!await file.exists(configPath)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if block should move into the above if block, otherwise if there is a plugin.json we are doing 2x file.exists(configPath) checks with the same configPath value.

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

Successfully merging this pull request may close these issues.

None yet

3 participants