Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BCB7B200D37 for ; Thu, 26 Oct 2017 01:34:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BB522160BE0; Wed, 25 Oct 2017 23:34:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 09343160BDA for ; Thu, 26 Oct 2017 01:34:03 +0200 (CEST) Received: (qmail 27725 invoked by uid 500); 25 Oct 2017 23:34:03 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 27714 invoked by uid 99); 25 Oct 2017 23:34:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Oct 2017 23:34:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 763FF1A1592 for ; Wed, 25 Oct 2017 23:34:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -97.999 X-Spam-Level: X-Spam-Status: No, score=-97.999 tagged_above=-999 required=6.31 tests=[KAM_BADIPHTTP=2, KAM_SHORT=0.001, NORMAL_HTTP_TO_IP=0.001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100, WEIRD_PORT=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id jQKuTcVZ34I1 for ; Wed, 25 Oct 2017 23:34:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 06D355FD71 for ; Wed, 25 Oct 2017 23:34:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 79F30E0288 for ; Wed, 25 Oct 2017 23:34:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 15EB6212F5 for ; Wed, 25 Oct 2017 23:34:00 +0000 (UTC) Date: Wed, 25 Oct 2017 23:34:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-12774) cordova plugin add doesn't support npm scope MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 25 Oct 2017 23:34:04 -0000 [ https://issues.apache.org/jira/browse/CB-12774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16219735#comment-16219735 ] ASF GitHub Bot commented on CB-12774: ------------------------------------- Github user audreyso commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/602#discussion_r147014589 --- Diff: src/cordova/util.js --- @@ -255,11 +255,20 @@ function findPlugins (pluginDir) { var plugins = []; if (fs.existsSync(pluginDir)) { - plugins = fs.readdirSync(pluginDir).filter(function (fileName) { - var pluginPath = path.join(pluginDir, fileName); - var isPlugin = isDirectory(pluginPath) || isSymbolicLink(pluginPath); - return fileName !== '.svn' && fileName !== 'CVS' && isPlugin; - }); + plugins = fs.readdirSync(pluginDir) + .reduce(function (plugins, pluginOrScope) { + if (pluginOrScope[0] === '@') { + plugins.push(...fs.readdirSync(path.join(pluginDir, pluginOrScope)).map(s => path.join(pluginOrScope, s))); --- End diff -- Thanks for your question! We are sticking to the current style for now. We need to have a discussion on our mailing list about starting to use es2015 features/ which ones to use and get some consensus. > cordova plugin add doesn't support npm scope > -------------------------------------------- > > Key: CB-12774 > URL: https://issues.apache.org/jira/browse/CB-12774 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-fetch > Affects Versions: 1.1.0 > Reporter: Enrico Mazzucchelli > Labels: cordova-8.0.0 > Fix For: 1.1.1 > > > STEP TO REPRODUCE: > 1) setup a private repo (for example sinopia with docker: https://github.com/kfatehi/docker-sinopia) > 2) add scope in your npm config: npm config set @myco:registry http://0.0.0.0:4873/ > 3) create you plugin. In package.json set name: @myco/my.co.plugin.demo; in plugin.xml set plugin id: @myco/my.co.plugin.demo. > 3) publish plugin in your private repo: > - npm set registry http://0.0.0.0:4873 > - npm publish > - npm set registry https://registry.npmjs.org/ > 4) in your cordova project dir, exec: > cordova plugin add @myco/my.co.plugin.demo > EXPECTED BEHAVIOR: > cordova plugin are installed > ACTUAL BEHAVIOR: > cordova installation failed: > Error: Failed to fetch plugin my.co.plugin.demo via registry. > Probably this is either a connection problem, or plugin spec is incorrect. > Check your connection and plugin name/version/URL. > Error: npm: Command failed with exit code 1 Error output: > npm ERR! code E404 > npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/my.co.plugin.demo > npm ERR! 404 > npm ERR! 404 'com.vipera.de.foundation.commons' is not in the npm registry. > npm ERR! 404 You should bug the author to publish it (or use the name yourself!) > npm ERR! 404 > npm ERR! 404 Note that you can also install from a > npm ERR! 404 tarball, folder, http url, or git url. > However node module are correctly installed (verified with npm ls) and fetch.json have a new entry with key > @my.co.plugin.demo. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org