[ 
https://issues.apache.org/jira/browse/CB-14148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16581538#comment-16581538
 ] 

ASF GitHub Bot commented on CB-14148:
-------------------------------------

brodybits closed pull request #620: CB-14148 remove nonsense "www" platform 
from Cordova listing
URL: https://github.com/apache/cordova-lib/pull/620
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/spec/cordova/build.spec.js b/spec/cordova/build.spec.js
index 5de833085..4740a8ae4 100644
--- a/spec/cordova/build.spec.js
+++ b/spec/cordova/build.spec.js
@@ -22,7 +22,7 @@ var HooksRunner = require('../../src/hooks/HooksRunner');
 var Q = require('q');
 var util = require('../../src/cordova/util');
 
-var supported_platforms = Object.keys(platforms).filter(function (p) { return 
p !== 'www'; });
+var supported_platforms = Object.keys(platforms);
 
 describe('build command', function () {
     var is_cordova;
diff --git a/spec/cordova/platforms/platforms.spec.js 
b/spec/cordova/platforms/platforms.spec.js
index d1b083ab5..d86fcdf0b 100644
--- a/spec/cordova/platforms/platforms.spec.js
+++ b/spec/cordova/platforms/platforms.spec.js
@@ -32,6 +32,19 @@ var PLATFORM_SYMLINK = path.join(os.tmpdir(), 
'cordova_windows_symlink');
 
 shell.ln('-sf', PLATFORM_WITH_API, PLATFORM_SYMLINK);
 
+describe('platforms object', function () {
+    it('should have getPlatformApi function as a property', function () {
+        expect(platforms.getPlatformApi).toBeDefined();
+        expect(typeof platforms.getPlatformApi).toBe('function');
+    });
+
+    it('should have all and only the supported platforms', function () {
+        expect(Object.keys(platforms)).toEqual(jasmine.arrayWithExactContents([
+            'android', 'browser', 'ios', 'osx', 'windows'
+        ]));
+    });
+});
+
 describe('getPlatformApi method', function () {
     var isCordova;
 
@@ -95,4 +108,8 @@ describe('getPlatformApi method', function () {
     it('should throw for unknown platform', function () {
         expect(function () { platforms.getPlatformApi('invalid_platform'); 
}).toThrow();
     });
+
+    it('should throw for nonsense www platform', function () {
+        expect(function () { platforms.getPlatformApi('www'); }).toThrow();
+    });
 });
diff --git a/src/platforms/platformsConfig.json 
b/src/platforms/platformsConfig.json
index a1d57cc36..4e541c477 100644
--- a/src/platforms/platformsConfig.json
+++ b/src/platforms/platformsConfig.json
@@ -19,13 +19,6 @@
         "apiCompatibleSince": "5.0.0",
         "deprecated": false
     },
-    "www": {
-        "hostos": [],
-        "url": 
"https://git-wip-us.apache.org/repos/asf?p=cordova-app-hello-world.git";,
-        "source": "git",
-        "version": "^3.12.0",
-        "deprecated": false
-    },
     "windows": {
         "hostos": ["win32"],
         "url": "https://git-wip-us.apache.org/repos/asf?p=cordova-windows.git";,


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> cordova platform ls shows nonsense www ^3.12.0 platform
> -------------------------------------------------------
>
>                 Key: CB-14148
>                 URL: https://issues.apache.org/jira/browse/CB-14148
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-cli, cordova-common, cordova-lib
>            Reporter: Chris Brody
>            Assignee: Chris Brody
>            Priority: Minor
>
> As I already reported inĀ 
> [apache/cordova-discuss#86|https://github.com/apache/cordova-discuss/issues/86]
>  and saw someone else report in Slack:
> {code:bash}
> $ cordova --version
> 8.0.0
> {code}
> {code:bash}
> $ cordova platform ls
> Installed platforms:
>  
> Available platforms: 
>  android ~7.0.0
>  browser ~5.0.1
>  ios ~4.5.4
>  osx ~4.0.1
>  windows ~5.0.0
>  www ^3.12.0
> {code}
> If I would do {{cordova platform add www}}:
> {code:bash}
> $ cordova platform add www
> (node:10383) UnhandledPromiseRejectionWarning: CordovaError: Error: npm: 
> Command failed with exit code 1 Error output:
> npm ERR! code ENOLOCAL
> npm ERR! Could not install from "www" as it does not contain a package.json 
> file.
> npm ERR! A complete log of this run can be found in:
> npm ERR! /Users/brodybits/.npm/_logs/2018-01-04T04_21_59_700Z-debug.log
>  at 
> /Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/cordova-fetch/index.js:104:29
>  at _rejected 
> (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:864:24)
>  at 
> /Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:890:30
>  at Promise.when 
> (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:1142:31)
>  at Promise.promise.promiseDispatch 
> (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:808:41)
>  at 
> /Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:624:44
>  at runSingle 
> (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:137:13)
>  at flush 
> (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:125:13)
>  at process._tickCallback (internal/process/next_tick.js:150:11)
> (node:10383) 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:10383) [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.
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to