playwright-java icon indicating copy to clipboard operation
playwright-java copied to clipboard

[Feature] Add jbang cli to the docs

Open OLibutzki opened this issue 3 years ago • 4 comments

For the Playwright Java CLI a jbang-catalog exists at https://github.com/microsoft/jbang-catalog

Unfortunately jbang is not used or mentioned in the Playwright Java docs, although it's a great and easy to use mvn alternative.

What about providing the jbang command line as a mvn alternative in the docs? I would prefer to have two tabs, so the reader can switch based on her preferences.

OLibutzki avatar Mar 24 '22 20:03 OLibutzki

Just saw that you use this approach in the node section. You can switch between JavaScript and Typescript. The very same approach could be a great way to solve this issue.

OLibutzki avatar Mar 24 '22 20:03 OLibutzki

Last time we looked into this it didn't feel like jbang was wildly adopted and it also requires extra setup which would have to be documented somewhere to help people unfamiliar with the framework. With that said, we are open to contributions, the documentation source lives here.

yury-s avatar Mar 24 '22 20:03 yury-s

Yes, you need an additional binary, but...

  1. Currently you need to have mvn in your path as well. There might be Gradle users which do not want to use maven
  2. Running a command like mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="codegen wikipedia.org" from an arbitrary path doesn't work as you need to have a pom.xml in that directory.
  3. In contrast, jbang playwright@microsoft codegen wikipedia.org is much shorter and works from anywhere.
  4. Installation jbang is very simple: https://www.jbang.dev/documentation/guide/latest/installation.html

OLibutzki avatar Mar 25 '22 09:03 OLibutzki

Agree with all that you said.

Currently you need to have mvn in your path as well. There might be Gradle users which do not want to use maven

There is an open request on this: https://github.com/microsoft/playwright-java/issues/571 This is not a top priority at the moment, but we accept patches.

Installation jbang is very simple: https://www.jbang.dev/documentation/guide/latest/installation.html

Awesome. Maybe it's enough to just add a link to that documentation somewhere in the intro section.

yury-s avatar Mar 25 '22 16:03 yury-s