apache / cordova-plugman

Apache Cordova Plugman
https://cordova.apache.org/
Apache License 2.0
400 stars 151 forks source link

Generated `plugin.xml` is unformatted #120

Open janpio opened 5 years ago

janpio commented 5 years ago
plugman create --name cordova-plugin-math --plugin_id cordova-plugin-math --plugin_version 0.0.1
plugman platform add --platform_name windows

results in

<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-math" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"><name>cordova-plugin-math</name><js-module name="cordova-plugin-math" src="www/cordova-plugin-math.js"><clobbers target="cordova.plugins.cordova-plugin-math" /></js-module><platform name="windows"><js-module name="cordova-plugin-math" src="src/windows/cordova-plugin-math.js"><runs target="" /></js-module></platform></plugin>
raphinesse commented 5 years ago

I am not surprised. I should have burned it instead of beginning to fix it. :unamused:

janpio commented 5 years ago

I don't think you have caused this - pure coincidence I started looking into this right now after you fixed it up. But I assume it would have been a lot worse without your fixes ;)

raphinesse commented 5 years ago

Proceed with caution, rant ahead

Nah, I'm pretty sure I'm not responsible for this bug. I just wanted to express my frustration about how broken plugman actually is. I think it is easily the most broken/outdated piece of s...oftware among the user facing tools. And even if it wasn't so broken, it still doesn't do that many useful things.

We provide a createpackagejson command to add a package.json file to existing plugins that don't have one. While we are using the npm registry as the primary distribution channel for plugins. Every plugin on npm has a package.json! But if you create a plugin via create, it of course has no package.json. But that's no problem, we have createpackagejson for that, right?

That's why I meant I shouldn't have begun fixing it. Because if it would still be so broken that it just errored out on nearly everything, people would not waste their time trying to accomplish something useful with it.

janpio commented 5 years ago

Well, young @raphinesse, there were times in Cordova land where this was not true, and I am sure plugman saw those times and lived through them...

If we had a "plugin template" with some documentation, we could actually easily get rid of create and such as described in #118 this is currently not properly documented. Because you have copying some semi outdated plugin template things together is not really worth a tool that you have to fix up first.

The only thing I stumbled over in multiple places, and that maybe might be useful to keep, is install and uninstall, although I don't know yet how that is different from the normal CLI anyway.

So I'm totally fine with getting rid of some stuff here.

raphinesse commented 5 years ago

Well, young @raphinesse, there were times in Cordova land where this was not true, and I am sure plugman saw those times and lived through them...

Well, a few years ago, when I, even younger than now, was the one wasting his time trying to do something worthwhile with it, it already was broken beyond repair. It probably was more relevant when Cordova had its own plugin registry.

If we had a "plugin template" with some documentation, we could actually easily get rid of create

:100: Agreed.

The only thing I stumbled over in multiple places, and that maybe might be useful to keep, is install and uninstall, although I don't know yet how that is different from the normal CLI anyway.

I think it's supposed to be used to install plugins when following the platform-centered workflow. Other than that, the library part of these commands, which lives in cordova-lib is also used as part of the plugin (un)installation of Cordova CLI

janpio commented 5 years ago

Ohhhh, that is the other plugman which is actually the same one. 🐒