cordova-plugman icon indicating copy to clipboard operation
cordova-plugman copied to clipboard

Generated `plugin.xml` is unformatted

Open janpio opened this issue 5 years ago • 6 comments

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>

janpio avatar Apr 29 '19 14:04 janpio

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

raphinesse avatar Apr 29 '19 17:04 raphinesse

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 ;)

janpio avatar Apr 29 '19 18:04 janpio

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.

raphinesse avatar Apr 29 '19 19:04 raphinesse

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.

janpio avatar Apr 29 '19 19:04 janpio

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

raphinesse avatar Apr 29 '19 20:04 raphinesse

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

janpio avatar Apr 29 '19 20:04 janpio