Git Product home page Git Product logo

cordova-plugman's Issues

Documentation is incomplete and outdated

Missing:

Author plugins
    create               Create a plugin
    createpackagejson    Add a package.json file to a plugin
    platform             Add and remove platforms from a plugin

Outdated:

  • all the registry stuff can probably go

Set up CI

Should only be done once we have some tests (#114), so as not to give a wrong sense of security.

Replace outdated parts of plugman with cordova-plugin-template and documentation

Those can probably be removed:

Author plugins
    create               Create a plugin
    createpackagejson    Add a package.json file to a plugin
    platform             Add and remove platforms from a plugin

Some input:

Oh look, something like this already exists:
https://github.com/phonegap/phonegap-plugin-template
https://github.com/cesilva/cordova-plugin-template

Unfortunately this is gone:
https://www.npmjs.com/package/cordova-plugin-template
Although we probably don't need to publish this to npm anyway.

Generated `plugin.xml` is unformatted

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>

`create` with plugin IDs with `-` generates invalid `clobbers`

plugman create --name cordova-plugin-math --plugin_id cordova-plugin-math --plugin_version 0.0.1

leads to

<clobbers target="cordova.plugins.cordova-plugin-math" />

which is invalid.


Fixing manually to cordova.plugins.math or similar fixes the issue.

[Bug] Plugman does not work with latest version of Cordova iOS (5.0.1)

Bug Report

Problem

Plugman does not work with latest version of Cordova iOS (5.0.1), resulting in error:
Failed to install 'cordova-plugin-background-fetch': Error: Your ios platform does not have Api.js
When running:
plugman install --platform ios --project platforms/ios --plugin cordova-background-geolocation-lt

What is expected to happen?

The plugin will install to this specific platform correctly

What does actually happen?

Fails with error:
Failed to install 'cordova-plugin-background-fetch': Error: Your ios platform does not have Api.js

Information

Cordova Version 9.0.0
Cordova iOS version 5.0.1
Plugman version: Latest (unable to check using plugman --version)

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

NPM 16?

Can't install plugins on NPM 16.

Failed to fetch plugin cordova-clipboard via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Could not determine package name from output:
added 1 package, removed 7 packages, and audited 2 packages in 822ms

cordova-android version not detected - lacks script

Trying to add a new plugin only to android using plugman gives below error :

Installing "cordova-plugin-firebase-messaging" for android
cordova-android version not detected (lacks script <project path>/cordova/version ), continuing.
Plugin doesn't support this project's cordova version. cordova: 9.0.1, failed version requirement: >=10.0.0
Skipping 'cordova-plugin-firebase-messaging' for android

cordova platforms list
Installed platforms:
android 12.0.1
ios 7.0.1

cordova --version
12.0.0 ([email protected])

Mac OS

Unable to install plugman

When I try to install plugman with command npm install -g plugman in macOS, it gives error - Unexpected end of JSON input while parsing near '..."3.4.1":{"name":"modu'

Kindly find the entire stacktrace in attached file.

Node: v8.0.0
npm: 5.4.1
cordova: 6.5.0
OS: macOS Sierra

2018-11-22T07_18_01_475Z-debug.log

command not found: plugman

Bug Report

Problem

What is expected to happen?

Plugman command not recognised after plugman help executed.

What does actually happen?

command not found: plugman

Information

I am planning to create plugin for Android and iOS after following steps from your documentation.

  • npm install -g plugman
  • After successfully installed try to run plugman help : "recived plugman command not found".

Tried with sudo same happening.

Command or Code

plugman help -> command not found.

Environment, Platform, Device

MacOS Catalina 10.15

Version information

Cordova 10.0.0
Plugman 3.0.0
MacOS Catalina 10.15.
Node v15.3.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Plugin installation fails with a registry fetch error when run using through `execSync` and npm 8.15.0

Bug Report

Problem

What is expected to happen?

Plugin installation should succeed.

What does actually happen?

Plugin installation fails with a registry fetch error (but the plugin is in the registry). It sometimes succeeds on the second try, as if the first time it didn't wait for the fetch to finish before making sure the plugin exists on disk. Installation of all plugins fails in the same manner, it's not just this one.

Information

Here is the error:

Running command: npm install [email protected] --production --no-save
Command finished with error code 0: npm install,[email protected],--production,--no-save
Failed to fetch plugin [email protected] via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Could not determine package name from output:
added 1 package, removed 1 package, and audited 2 packages in 1s

found 0 vulnerabilities
CordovaError: Failed to fetch plugin [email protected] via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Could not determine package name from output:
added 1 package, removed 1 package, and audited 2 packages in 1s

found 0 vulnerabilities
    at /Users/michael/Projects/Software/Simbioz/Ripple.Base/ripple/rcc/node_modules/.pnpm/[email protected]/node_modules/cordova-lib/src/plugman/fetch.js:146:43
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
node:child_process:915
    throw err;
    ^

Error: Command failed: node_modules/.bin/plugman -d install --platform android --project platforms/android --plugin [email protected] --plugins_dir=plugins
    at checkExecSyncError (node:child_process:841:11)
    at execSync (node:child_process:912:15)
    at /Users/michael/Projects/Software/Simbioz/Ripple.Base/ripple/rcc/scripts/install-plugins.js:29:5
    at arrayEach (/Users/michael/Projects/Software/Simbioz/Ripple.Base/ripple/rcc/node_modules/.pnpm/[email protected]/node_modules/lodash/lodash.js:530:11)
    at Function.forEach (/Users/michael/Projects/Software/Simbioz/Ripple.Base/ripple/rcc/node_modules/.pnpm/[email protected]/node_modules/lodash/lodash.js:9410:14)
    at /Users/michael/Projects/Software/Simbioz/Ripple.Base/ripple/rcc/scripts/install-plugins.js:28:5
    at /Users/michael/Projects/Software/Simbioz/Ripple.Base/ripple/rcc/node_modules/.pnpm/[email protected]/node_modules/lodash/lodash.js:4967:15
    at baseForOwn (/Users/michael/Projects/Software/Simbioz/Ripple.Base/ripple/rcc/node_modules/.pnpm/[email protected]/node_modules/lodash/lodash.js:3032:24)
    at Function.forOwn (/Users/michael/Projects/Software/Simbioz/Ripple.Base/ripple/rcc/node_modules/.pnpm/[email protected]/node_modules/lodash/lodash.js:13082:24) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 37257,
  stdout: null,
  stderr: null
}
 ELIFECYCLE  Command failed with exit code 1.

Workaround

It seems like the problem occurs because something goes wrong when plugman uses npm 8.5 while being run by execSync (in a script). If I install npm 6.X locally in the project (npm install --save-dev [email protected]), the plugman script uses that internally and installation succeeds. However, it forces me to downgrade npm to v6 for my whole project instead of staying on npm 8 which is the default for node 16.

Command or Code

execSync(
    `node_modules/.bin/plugman -d install --platform android --project platforms/android --plugin [email protected] --plugins_dir=plugins`,
    { stdio: "inherit" }
);

Environment, Platform, Device

macOS 12.6 (21G115)

Version information

node 16.17.1
npm 8.15.0
plugman 3.0.1
cordova 11.0.0
cordova-android 10.1.2
cordova-ios 6.2.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

`plugman platform add --platform_name windows` generates crashing default

plugman create --name cordova-plugin-math --plugin_id cordova-plugin-math --plugin_version 0.0.1
plugman platform add --platform_name windows

leads to

    <js-module name="cordova-plugin-math" src="www/cordova-plugin-math.js">
        <clobbers target="cordova.plugins.math" />
    </js-module>
    <platform name="windows">
        <js-module name="cordova-plugin-math" src="src/windows/cordova-plugin-math.js">
            <runs target="" />
        </js-module>
    </platform>

Those files being named identical, leads to this exception:

image

SCRIPT5022: Unhandled exception at line 74, column 13 in ms-appx-web://io.cordova.hellocordova/www/cordova.js
0x800a139e - JavaScript runtime error: module cordova-plugin-math.cordova-plugin-math already defined

because both files begin with

cordova.define("cordova-plugin-math.cordova-plugin-math", function(require, exports, module) {

Updating js-module.name to mathProxy (and renaming src/windows/cordova-plugin-math.js to src/windows/mathProxy.js and updating the .src to that) fixes the problem. (Might have to remove and re-add the platform to get rid o the old file though)

-www option ignored

Bug Report

Problem

What is expected to happen?

When the -www option is used, plugins should be installed in the given directory instead of the default <project>/cordova/plugins

What does actually happen?

Plugins are still installed in the default directory.

Information

Command or Code

% ls
www myproj

% plugman install --platform ios --proj myproj --plugin cordova-plugin-device --www ./www
% plugman install --platform ios --proj myproj --plugin cordova-plugin-device --www .
% plugman install --platform ios --proj myproj --plugin cordova-plugin-device --www www

Plugins are installed in myproj/cordova/plugins, instead of the local www directory

Environment, Platform, Device

Using platofrm-ios directly, no cordova CLI. Happens with every plugin.

Version information

plugman 3.0.1
cordova-ios 6.2.0
npm 7.20.3
node 16.7.0
macOS 11.6

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

`plugman --version` doesn't work

λ plugman --version
Usage: plugman [OPTION]... <command>

These are the available plugman commands:

Manage plugins in a Cordova project
    install              Install a plugin into a Cordova project
    uninstall            Uninstall a plugin from a Cordova project

Author plugins
    create               Create a plugin
    createpackagejson    Add a package.json file to a plugin
    platform             Add and remove platforms from a plugin

Global options:
    --help, -h           Show help for <command> or this if none was given
    --debug, -d          Enable verbose output
    --version, -v        Display the plugman version

real version is 3.0.1

Fetch specific commit?

Is there a way to fetch a specific commit? I tried:

plugman install ... --plugin cordova-plugin-keyboard#1234
plugman install ... --plugin https://github.com/cjpearson/cordova-plugin-keyboard#1234

but they all "Failed to fetch plugin from registry".

Unable to Add Platform

I am getting this error when ever i am trying to add a platform by

plugman platform add --platform_name android

(node:17948) UnhandledPromiseRejectionWarning: Error: platform: true not yet supported
    at Object.add (E:\cordova-plugman\node_modules\cordova-lib\src\plugman\platform.js:51:35)
    at Object.module.exports [as platform] (E:\cordova-plugman\node_modules\cordova-lib\src\plugman\platform_operation.js:23:38)
    at Object.platform (E:\cordova-plugman\node_modules\cordova-lib\src\plugman\plugman.js:153:17)
    at Object.<anonymous> (E:\cordova-plugman\main.js:87:42)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
(node:17948) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:17948) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.