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

Send PRs to all plugins #1068

Closed
15 of 23 tasks
ehmicky opened this issue Mar 27, 2020 · 7 comments
Closed
15 of 23 tasks

Send PRs to all plugins #1068

ehmicky opened this issue Mar 27, 2020 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@ehmicky
Copy link
Contributor

ehmicky commented Mar 27, 2020

We should go through each plugin from the list we have and send a PR with:

  • Add keywords "netlify" and "netlify-plugin" in the package.json if missing
  • Add repository "user/repo" in the package.json if missing
  • Add bugs { "url": "https://github.com/user/repo/issues" } in the package.json if missing
  • Ensure the latest names for the arguments passed to event handlers are used
  • Ensure the latest names for the constants are used
  • Ensure the latest names for the events are used
  • Use utils.build.* where possible
  • Remove the name and config properties from the main JavaScript file
  • Add a manifest.yml including the name and each inputs (name, default, required). Explain in the PR that we are working on adding more validation keywords.

For the following plugins:

@ehmicky ehmicky added the enhancement New feature or request label Mar 27, 2020
@ehmicky ehmicky self-assigned this Mar 27, 2020
@ehmicky
Copy link
Contributor Author

ehmicky commented Mar 27, 2020

As I go along each plugin, I will compile a list of common mistakes. This can used:

  • For QA check before adding the plugin to our list
  • For a future linting tool
  • For our documentation

The current list of mistakes follows.

Missing metadata:

Utilities:

Control flow:

  • Async event handlers should not end until all async operations have completed (success or failure)
  • process.exit() should not be used
  • Errors that are not bugs should be reported with utils.build.failPlugin() (if the build can continue) or utils.build.failBuild() (if the build should stop). Throwing errors should not be used.
  • Successful information that should be exposed in the UI build summary should use utils.status.show(), not console.*().
  • utils.build.failPlugin() should be used, not utils.status.show(), to log errors.
  • The JavaScript file should preferably export an object. A function should be exported instead only if some event handlers are enabled/disabled depending on user inputs.

Older syntax:

  • Plugin JavaScript files should not contain the name nor config properties
  • Ensure inputs are not called config nor pluginConfig
  • Ensure the constants names are valid
  • Ensure the events names are valid

Optional but recommended:

  • Repository name, package.json name and manifest name should be the same
  • Plugin name should start with netlify-plugin-
  • There should be automated tests

@Munter
Copy link

Munter commented Apr 7, 2020

@ehmicky netlify-plugin-hashfiles should be up to date now

@ehmicky
Copy link
Contributor Author

ehmicky commented May 20, 2020

PRs have been sent to all plugins currently in our plugins.json.

I went through the list of all those plugins and checked which ones were using any deprecated syntax described in #1303, that we intend to remove before GA as a breaking change. I have made a PR to fix each instance of those (marked as PR below). This is the list.

@Munter
Copy link

Munter commented May 21, 2020

netlify-plugin-hashfiles has been updated and released in v4.0.2

@Munter
Copy link

Munter commented May 21, 2020

netlify-plugin-checklinks has been updated and released in v4.1.1

@ehmicky
Copy link
Contributor Author

ehmicky commented May 25, 2020

Thanks a lot @Munter! 🎉

@ehmicky
Copy link
Contributor Author

ehmicky commented May 26, 2020

PR to temporarily disable the remaining plugins: netlify/plugins#45.
Closing this issue.

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

No branches or pull requests

2 participants