[GitHub] cordova-lib issue #597: CB-13451 (all platforms) "pkg not defined" exception...
Github user OminousWater commented on the issue: https://github.com/apache/cordova-lib/pull/597 Thanks for picking up on those problems -- how embarrassing! The lines removed from .eslintignore was a complete mistake on my part, thank you for spotting that. I've re-instated those lines, and revised the glob patterns at the same time, as the ones that were there didn't seem to be doing what they were intended to, with the latest version of eslint. I also removed the now-redundant eslint directives from init-default.js. Do you know how I can trigger another Continous Integration run on the server to check everything's good? --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib issue #597: CB-13451 (all platforms) "pkg not defined" exception...
Github user OminousWater commented on the issue: https://github.com/apache/cordova-lib/pull/597 I have committed my fix now, and think the pull-request is good to go. eslint is still reporting errors, but I've repro'd them locally and can confirm they're unrelated to my pull request. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib issue #597: CB-13451 (all platforms) "pkg not defined" exception...
Github user OminousWater commented on the issue: https://github.com/apache/cordova-lib/pull/597 @stevengill I have a working fix locally now (on advice from the eslint devs I've added a top-level .eslintignore file with a pattern that filters out any init-defaults.js files). The AppVeyor continuous integration step is still failing, though for a seemingly unrelated reason (to do with the 'qs' package?). I will try to repro locally in case it's related to my change, but I don't _think_ it is (famous last words). --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib pull request #597: CB-13451 (all platforms) "pkg not defined" ex...
GitHub user OminousWater reopened a pull request: https://github.com/apache/cordova-lib/pull/597 CB-13451 (all platforms) "pkg not defined" exception when running plugman with createpackagejson command-line A global js-lint pass on the cordova-lib codebase on the 30/8/2017 caused references to the global 'package' variable in init-default.js to be renamed to 'pkgâ, presumably because the cordova-lib source doesnât declare a global variable called âpackageâ but _does_ declare a global variable called âpkgâ (in src/cordova/info.js). However in this case, the âpackageâ variable refers to the one declared in the plugman source, specifically main.js, so it should have stayed as 'packageâ. To test the fix, run: plugman createpackagejson . Without the fix, this will trigger the following exception: 'pkg is not defined'. Having patched in the fix, running the command line should work as expected, prompting the user with questions and then spitting out a package.json file. ### Platforms affected All ### What does this PR do? Fixes an bug where an exception would be thrown when running 'plugman createpackagejson .' ### What testing has been done on this change? The command in question ('plugman createpackagejson .') has been tested with and without the fix to confirm that the fix fixes the problem. ### Checklist - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB- is the JIRA ID & "android" is the platform affected. - [ ] Added automated test coverage as appropriate for this change. You can merge this pull request into a Git repository by running: $ git pull https://github.com/OminousWater/cordova-lib master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-lib/pull/597.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #597 commit e321bc319b94c86b77d993981491f99bac6f27f9 Author: Roland Date: 2017-10-16T20:57:59Z Fix for 'pkg is not defined' exception A global js-lint pass on the cordova-lib codebase on the 30/8/2017 caused references to the global 'package' variable in init-default.js to be renamed to 'pkgâ, presumably because the cordova-lib source doesnât declare a global variable called âpackageâ but _does_ declare a global variable called âpkgâ (in cordova/info.js). However in this case, the âpackageâ variable refers to the one declared in the plugman source, specifically main.js, so it should have stayed as 'packageâ. To test the fix, run: plugman createpackagejson . Without the fix, this will trigger the following exception: 'pkg is not defined'. Having patched in the fix, running the command line should work as expected, prompting the user with questions and then spitting out a package.json file. commit 91614eb341735fde77661f3643c9a328fd09ac0c Author: Roland Date: 2017-10-18T19:45:23Z Revert "Fix for 'pkg is not defined' exception" This reverts commit e321bc319b94c86b77d993981491f99bac6f27f9. commit 62c5d2631c56ed40fda0576bc726b61bc0eb7806 Author: Roland Date: 2017-10-19T20:45:23Z Second attempt at fix for CB-13451 commit f3dec27bfe9e4e6dce2f8d5ef6d3997c1ca2b925 Author: Roland Date: 2017-10-20T07:00:32Z Make eslint ignore init-defaults.js file(s) as it will fail otherwise on 'package' keword that PromZard injects --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib issue #597: CB-13451 (all platforms) "pkg not defined" exception...
Github user OminousWater commented on the issue: https://github.com/apache/cordova-lib/pull/597 @stevengill I've been trying that as alternative solution, however it seems eslint doesn't support exceptions for parser errors. See their response to the issue I lodged here after a fair bit of fruitless experimentation with eslint exclude rules: https://github.com/eslint/eslint/issues/9483 --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib issue #597: CB-13451 (all platforms) "pkg not defined" exception...
Github user OminousWater commented on the issue: https://github.com/apache/cordova-lib/pull/597 OK I understand the problem better now. init-package-json (a separate npm module) initialises the global variable 'package' in init-package-json.js. So ideally init-package-json would use a different variable name, but I guess the maintainers of that package might not have as strict a requirement as the cordova-lib maintainers. I've opened a separate pull request with a compromise solution here: https://github.com/npm/init-package-json/pull/74, hopefully they will accept (or have a better solution). --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib issue #597: CB-13451 (all platforms) "pkg not defined" exception...
Github user OminousWater commented on the issue: https://github.com/apache/cordova-lib/pull/597 @zaq962 I think I have the "correct" fix now, am about to open another pull request. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib issue #597: CB-13451 (all platforms) "pkg not defined" exception...
Github user OminousWater commented on the issue: https://github.com/apache/cordova-lib/pull/597 @zaq962 if you apply the changes in my pull request (it's just one file) to your local checkout, it should work fine. The only reason it doesn't pass the continuous integration test is that 'package' is a reserved keyword, which eslint doesn't like. I've been experimenting with fixing the problem on the plugman side, by renaming the 'package' keyword there, which would be a better fix arguably. If I get that working then I'll re-open the pull request against the plugman source. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib pull request #597: CB-13451 (all platforms) "pkg not defined" ex...
Github user OminousWater closed the pull request at: https://github.com/apache/cordova-lib/pull/597 --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib issue #597: CB-13451 (all platforms) "pkg not defined" exception...
Github user OminousWater commented on the issue: https://github.com/apache/cordova-lib/pull/597 I see the CI has failed, because 'package' is a reserved keyword (this better explains the changes made as part of the js-lint pass a few months back). Perhaps the better fix, then, is to rename the variable in the plugman source; because that, too, would presumably fail a js-lint pass. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib pull request #597: CB-13451 (all platforms) "pkg not defined" ex...
GitHub user OminousWater opened a pull request: https://github.com/apache/cordova-lib/pull/597 CB-13451 (all platforms) "pkg not defined" exception when running plugman with createpackagejson command-line A global js-lint pass on the cordova-lib codebase on the 30/8/2017 caused references to the global 'package' variable in init-default.js to be renamed to 'pkgâ, presumably because the cordova-lib source doesnât declare a global variable called âpackageâ but _does_ declare a global variable called âpkgâ (in src/cordova/info.js). However in this case, the âpackageâ variable refers to the one declared in the plugman source, specifically main.js, so it should have stayed as 'packageâ. To test the fix, run: plugman createpackagejson . Without the fix, this will trigger the following exception: 'pkg is not defined'. Having patched in the fix, running the command line should work as expected, prompting the user with questions and then spitting out a package.json file. ### Platforms affected All ### What does this PR do? Fixes an bug where an exception would be thrown when running 'plugman createpackagejson .' ### What testing has been done on this change? The command in question ('plugman createpackagejson .') has been tested with and without the fix to confirm that the fix fixes the problem. ### Checklist - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB- is the JIRA ID & "android" is the platform affected. - [ ] Added automated test coverage as appropriate for this change. You can merge this pull request into a Git repository by running: $ git pull https://github.com/OminousWater/cordova-lib master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-lib/pull/597.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #597 commit e321bc319b94c86b77d993981491f99bac6f27f9 Author: Roland Date: 2017-10-16T20:57:59Z Fix for 'pkg is not defined' exception A global js-lint pass on the cordova-lib codebase on the 30/8/2017 caused references to the global 'package' variable in init-default.js to be renamed to 'pkgâ, presumably because the cordova-lib source doesnât declare a global variable called âpackageâ but _does_ declare a global variable called âpkgâ (in cordova/info.js). However in this case, the âpackageâ variable refers to the one declared in the plugman source, specifically main.js, so it should have stayed as 'packageâ. To test the fix, run: plugman createpackagejson . Without the fix, this will trigger the following exception: 'pkg is not defined'. Having patched in the fix, running the command line should work as expected, prompting the user with questions and then spitting out a package.json file. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org