cordova-lib.git
9 months agoUpdated RELEASENOTES.md & version for release 10.1.0 (lib-10.1.0) 10.1.x 10.1.0 rel/10.1.0
Erisu [Wed, 29 Sep 2021 08:59:41 +0000 (17:59 +0900)] 
Updated RELEASENOTES.md & version for release 10.1.0 (lib-10.1.0)

9 months agochore: update dependencies w/ package-lock rebuild & test update (#886)
エリス [Wed, 29 Sep 2021 07:08:01 +0000 (16:08 +0900)] 
chore: update dependencies w/ package-lock rebuild & test update (#886)

* chore: update dependencies with package-lock rebuild
* test: update spec regarding to cordova-android dependency update

9 months agofeat: bump platform pinning (#885)
エリス [Wed, 29 Sep 2021 06:14:03 +0000 (15:14 +0900)] 
feat: bump platform pinning (#885)

- cordova-ios@^6.2.0
- cordova-android@^9.1.0
- cordova-electron@^1.1.1

9 months agorefactor(addHelper): more concise package.json spec lookup (#882)
Raphael von der Grün [Mon, 27 Sep 2021 07:49:25 +0000 (09:49 +0200)] 
refactor(addHelper): more concise package.json spec lookup (#882)

* refactor(addHelper): more concise package.json spec lookup
* test(addHelper): isolate tests for getVersionFromPackageJson

9 months agofeat(cordova/util): support loading platform API from node_modules (#860)
Darryl Pogue [Sun, 26 Sep 2021 19:04:27 +0000 (12:04 -0700)] 
feat(cordova/util): support loading platform API from node_modules (#860)

* fix(cordova/util): Support requiring from node_modules

* Add a few comments

* fix: allow caching when loading from node_modules

* test(cordova/util): test loading platform API from node_modules

* refactor: terser way to build canonical platform name

* feat: improve logged errors

* feat: improve success message

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
9 months agofix(restore-util): properly support long and short platform names (#880)
Norman Breau [Sun, 26 Sep 2021 13:09:52 +0000 (10:09 -0300)] 
fix(restore-util): properly support long and short platform names (#880)

* fix(GH-878): Fix platform restoration from package.json

* fix(restore-util): support long and short platform names

i.e. both <PLATFORM> and cordova-<PLATFORM>

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
9 months agofix: Platforms restored from both dev and normal dependencies. (#874)
Aidanas Tamasauskas [Sun, 26 Sep 2021 12:37:29 +0000 (13:37 +0100)] 
fix: Platforms restored from both dev and normal dependencies. (#874)

* fix: Check for platform version in both normal and dev dependencies within package.json file.

* fix: added unit test for package.json devDependencies (#866)

Co-authored-by: Aidanas Tamasauskas <aidana.tamasauskas@nutshellapps.co.uk>
Co-authored-by: Richard Li <li.richard.2013@gmail.com>
9 months agochore: npmrc (#881)
Norman Breau [Fri, 17 Sep 2021 12:55:22 +0000 (09:55 -0300)] 
chore: npmrc (#881)

9 months agochore: package-lock update (#879)
Norman Breau [Sun, 12 Sep 2021 09:58:59 +0000 (06:58 -0300)] 
chore: package-lock update (#879)

10 months agodocs: correct linter command in Readme (#877)
Alexis THOMAS [Fri, 20 Aug 2021 10:17:28 +0000 (12:17 +0200)] 
docs: correct linter command in Readme (#877)

12 months agofix: remove undeclared dependency on underscore (#871)
Raphael von der Grün [Wed, 23 Jun 2021 10:08:30 +0000 (12:08 +0200)] 
fix: remove undeclared dependency on underscore (#871)

* refactor(serve): generate index w/out underscore
* refactor(requirements): transform results w/out underscore

12 months agoci: add node-14.x to workflow (#862)
エリス [Tue, 8 Jun 2021 10:07:29 +0000 (19:07 +0900)] 
ci: add node-14.x to workflow (#862)

12 months agotest(plugin.spec): fix version change in test fixture (#870)
Raphael von der Grün [Tue, 8 Jun 2021 06:47:31 +0000 (08:47 +0200)] 
test(plugin.spec): fix version change in test fixture (#870)

18 months agotest(pkgJson): make expectations work for npm 5 to 7 (#865)
Raphael von der Grün [Wed, 16 Dec 2020 22:05:31 +0000 (23:05 +0100)] 
test(pkgJson): make expectations work for npm 5 to 7 (#865)

This addresses the following changes in behavior.

Saved GitHub URL format in package.json:
- npm 6: git+https://github.com/apache/cordova-android.git#4.1.x
- npm 7: github:apache/cordova-android#4.1.x

Empty devDependencies format in package.json:
- npm 6: `{}`
- npm 7: `undefined`

18 months agotest(pkgJson): fix test after release of geolocation plugin v4.1.0 (#864)
Raphael von der Grün [Wed, 16 Dec 2020 15:48:27 +0000 (16:48 +0100)] 
test(pkgJson): fix test after release of geolocation plugin v4.1.0 (#864)

A test got hung up on whether the plugin defined any variables or not.
However, that was beside the point of the test in the first place. It
should only check that the key for the plugin is present. I updated the
test accordingly.

Fixes #863

20 months agochore(asf): Update GitHub repo metadata
Darryl Pogue [Wed, 7 Oct 2020 03:28:22 +0000 (20:28 -0700)] 
chore(asf): Update GitHub repo metadata

21 months agochore: clean up package.json (#858)
Raphael von der Grün [Fri, 2 Oct 2020 19:43:04 +0000 (21:43 +0200)] 
chore: clean up package.json (#858)

21 months agofix(cordova/util): version detection for legacy platforms (#856)
Raphael von der Grün [Thu, 24 Sep 2020 16:50:20 +0000 (18:50 +0200)] 
fix(cordova/util): version detection for legacy platforms (#856)

The new meachanism introduced in #815 relied on all platforms exporting
their version in their version script. This is not the case for the
browser platform though. Thus we need to revert to spawning an external
process for legacy platforms unfortunately.

21 months agotest: fix missing stack traces in jasmine output (#855)
Raphael von der Grün [Thu, 24 Sep 2020 11:39:41 +0000 (13:39 +0200)] 
test: fix missing stack traces in jasmine output (#855)

`true` is not a valid value for the `displayStacktrace` option of
jasmine-spec-reporter.

21 months agounit test deprecated platforms (#853)
Chris Brody [Sun, 6 Sep 2020 01:29:55 +0000 (21:29 -0400)] 
unit test deprecated platforms (#853)

23 months agoIncrement package version to 10.0.1-dev
Erisu [Mon, 27 Jul 2020 22:46:34 +0000 (07:46 +0900)] 
Increment package version to 10.0.1-dev

23 months agoUpdated RELEASENOTES.md & version for release 10.0.0 (lib-10.0.0) 10.0.x 10.0.0 rel/10.0.0
Erisu [Wed, 22 Jul 2020 07:42:14 +0000 (16:42 +0900)] 
Updated RELEASENOTES.md & version for release 10.0.0 (lib-10.0.0)

23 months agobreaking: remove cordova info logic from lib (#846)
エリス [Fri, 17 Jul 2020 07:31:08 +0000 (16:31 +0900)] 
breaking: remove cordova info logic from lib (#846)

* breaking: remove cordova info logic from lib
* chore: remove unused indent-string dependency

23 months agobreaking: bump dependencies (#849)
エリス [Fri, 17 Jul 2020 02:17:59 +0000 (11:17 +0900)] 
breaking: bump dependencies (#849)

* cordova-common@^4.0.2
* cordova-serve@^4.0.0
* execa@^4.0.3
* fs-extra@^9.0.1
* globby@^11.0.1
* md5-file@^5.0.0
* pify@^5.0.0
* semver@^7.3.2
* stringify-package@^1.0.1

23 months agochore: update dev dependencies (#847)
エリス [Fri, 17 Jul 2020 02:05:05 +0000 (11:05 +0900)] 
chore: update dev dependencies (#847)

* codecov@^3.7.0
* delay@^4.3.0
* jasmine-spec-reporter@^5.0.2
* nyc@^15.1.0
* rewire@^5.0.0

23 months agochore: bump cordova-eslint w/ automatic fixes (#848)
エリス [Thu, 16 Jul 2020 16:12:58 +0000 (01:12 +0900)] 
chore: bump cordova-eslint w/ automatic fixes (#848)

2 years agotest(fixture-helper): install android platform by name again (#843)
Raphael von der Grün [Thu, 2 Jul 2020 06:42:35 +0000 (08:42 +0200)] 
test(fixture-helper): install android platform by name again (#843)

This reverts an obsolete change from #833 which probably should have
been part of #839.

2 years agofix: remove unused dependency on cordova-create (#844)
Raphael von der Grün [Thu, 2 Jul 2020 06:41:16 +0000 (08:41 +0200)] 
fix: remove unused dependency on cordova-create (#844)

This should have been part of #820

2 years agochore: add package-lock.json (#841)
エリス [Mon, 29 Jun 2020 15:27:13 +0000 (00:27 +0900)] 
chore: add package-lock.json (#841)

2 years agochore: use short notation in package.json (#840)
エリス [Mon, 29 Jun 2020 12:56:17 +0000 (21:56 +0900)] 
chore: use short notation in package.json (#840)

2 years agochore: stop testing with nightly (#839)
エリス [Mon, 29 Jun 2020 03:47:30 +0000 (12:47 +0900)] 
chore: stop testing with nightly (#839)

2 years agochore: update android platform pinning to 9.0.0 (#838)
エリス [Mon, 29 Jun 2020 02:50:05 +0000 (11:50 +0900)] 
chore: update android platform pinning to 9.0.0 (#838)

2 years agochore: update osx platform pinning to 6.0.0 (#837)
エリス [Mon, 29 Jun 2020 02:49:52 +0000 (11:49 +0900)] 
chore: update osx platform pinning to 6.0.0 (#837)

2 years agochore: update ios platform pinning to 6.1.0 (#836)
エリス [Mon, 29 Jun 2020 02:49:37 +0000 (11:49 +0900)] 
chore: update ios platform pinning to 6.1.0 (#836)

2 years agoGH-832: Look at devDeps for restoring platforms (#835)
Darryl Pogue [Wed, 3 Jun 2020 05:08:43 +0000 (22:08 -0700)] 
GH-832: Look at devDeps for restoring platforms (#835)

* GH-832: Look at devDeps for restoring platforms

This also includes fixes for writing package.json with the correct
newlines, which should address the complaints raised in [1] and possibly
[2].

1. https://github.com/apache/cordova-cli/issues/353
2. https://github.com/apache/cordova-lib/issues/694

* Ensure a failure to restore stops the build

This has been a recurring frustration over several years, and nobody can
seem to explain why we would want to silently ignore restore failures
for platforms and plugins rather than surfacing them and failing the
remainder of the build steps.

2 years agobreaking: upgrade cordova dependencies for next major (#833)
エリス [Tue, 2 Jun 2020 17:54:10 +0000 (02:54 +0900)] 
breaking: upgrade cordova dependencies for next major (#833)

* breaking: upgrade cordova dependencies for next major

* ci: use the package's android dependency

* ci: check on devDependencies for installed platform and plugins

* ci: use fixed nightly platforms

* ci: modify correct version location

* ci: add back the disabled test

* ci: pin cordova-android to 9.0.0-nightly.2020.5.12.e86b211c

* ci: update api version mock

* chore: drop nightly from ios

2 years agochore(asf): update git notification settings
Erisu [Wed, 22 Apr 2020 04:36:40 +0000 (13:36 +0900)] 
chore(asf): update git notification settings

2 years agoUpdate CONTRIBUTING.md
Niklas Merz [Mon, 13 Apr 2020 12:39:33 +0000 (14:39 +0200)] 
Update CONTRIBUTING.md

2 years agotest: use expectAsync for rejections (#831)
Raphael von der Grün [Sun, 12 Jan 2020 12:34:15 +0000 (13:34 +0100)] 
test: use expectAsync for rejections (#831)

2 years agotest(e2e): improve HooksRunner.spec (#825)
Raphael von der Grün [Sun, 12 Jan 2020 12:10:10 +0000 (13:10 +0100)] 
test(e2e): improve HooksRunner.spec (#825)

* test(HooksRunner): properly setup temp dir

* test(HooksRunner): faster & simpler project setup

This is possible since we don't need an installed platform anymore
since we have dropped Test#012. We also needed to stop using
`util.preProcessOptions` because that expects platforms too. However,
its usage was irrelevant for the tests anyway.

* test(HooksRunner): remove unused hooks

* test(HooksRunner): reduce number of fixture files

* test(HooksRunner): make hook fixtures executable

* test(HooksRunner): cleanup & clarify "nohooks" tests

This also groups all "nohooks" tests in one describe block.

* test(HooksRunner): move tests to suitable block

* test(HooksRunner): only pass options where needed

* test(HooksRunner): cleanup "event handler" tests

- proper common test setup
- improve test descriptions
- test what the descriptions say
- replace the two last tests with a useful one

2 years agochore: consolidate eslint configs (#828)
エリス [Wed, 27 Nov 2019 12:23:37 +0000 (21:23 +0900)] 
chore: consolidate eslint configs (#828)

2 years agotest: move cordova/platform/{platform => addHelper} (#803)
Raphael von der Grün [Sat, 23 Nov 2019 01:46:56 +0000 (02:46 +0100)] 
test: move cordova/platform/{platform => addHelper} (#803)

Following an existing TODO to get rid of an obsolete spec file.

2 years agofix: plugin installation from git url w/ semver (#827)
Raphael von der Grün [Fri, 22 Nov 2019 11:42:11 +0000 (12:42 +0100)] 
fix: plugin installation from git url w/ semver (#827)

AFAICT, the check that is removed here was part of our previous plugin
fetching mechanism and was not removed when migrating to cordova-fetch.

Fixes #795

2 years agotest: use fs.copySync for increased performance (#826)
Raphael von der Grün [Sat, 16 Nov 2019 12:56:41 +0000 (13:56 +0100)] 
test: use fs.copySync for increased performance (#826)

2 years agotest(e2e): re-enable HooksRunner#12 and move it to plugin#14 (#823)
Raphael von der Grün [Fri, 15 Nov 2019 15:36:30 +0000 (16:36 +0100)] 
test(e2e): re-enable HooksRunner#12 and move it to plugin#14 (#823)

HooksRunner#12 did not actually test the HooksRunner class at all but
instead tested what arguments plugin (un)install hooks would receive.
Therefore it's a better fit for the plugin E2E tests.

The test code has been cleaned up in the process without making
essential changes to what is being tested.

2 years agostyle: fix linting violations (#824)
Raphael von der Grün [Fri, 15 Nov 2019 12:20:56 +0000 (13:20 +0100)] 
style: fix linting violations (#824)

2 years agofeat: proper support for scoped plugins (#821)
Raphael von der Grün [Fri, 15 Nov 2019 11:36:12 +0000 (12:36 +0100)] 
feat: proper support for scoped plugins (#821)

* Merge PluginSpec.scope into PluginSpec.id

* Store scoped plugins in same dir structure as in node_modules

* Update and extend E2E tests for adding scoped plugins

* Fix plugman.uninstall for scoped plugins

* Remove top_plugins override

* Pass pluginsDir to get_fetch_metadata to support scoped plugins

* Fix cordova/util.findPlugins for scoped plugins

* Update to cordova-common@4.0.0-nightly

2 years agorefactor: eslint setup (#822)
エリス [Fri, 15 Nov 2019 02:06:05 +0000 (11:06 +0900)] 
refactor: eslint setup (#822)

* refactor: eslint setup

* replace dependencies with @cordova/eslint-config
* update eslint config
* eslint corrections
* chore: readded linebreak-style & promise/catch-or-return

2 years agorefactor: remove stub interface to `cordova-create` (#820)
Raphael von der Grün [Mon, 11 Nov 2019 12:41:31 +0000 (13:41 +0100)] 
refactor: remove stub interface to `cordova-create` (#820)

Instead, `cordova-create` should be depended on directly by its users.

Follow-up to apache/cordova-cli#489

BREAKING CHANGE: removes export `cordova.create`

2 years agorefactor: use execa's cross-platform shebang support in HooksRunner (#819)
Raphael von der Grün [Mon, 11 Nov 2019 12:40:01 +0000 (13:40 +0100)] 
refactor: use execa's cross-platform shebang support in HooksRunner (#819)

Up until now, we have maintained code for shebang support in hook
scripts on Windows. Fortunately, execa comes with support for that out
of the box. So this commit drops our implementation and makes use of
execa's.

2 years agochore: replace superspawn with execa (#812)
エリス [Fri, 8 Nov 2019 09:46:19 +0000 (18:46 +0900)] 
chore: replace superspawn with execa (#812)

* chore: replace superspawn with execa
* chore: remove comments
* chore: move catch to onRejected
* chore: move catch to onRejected
* chore: bump execa dependency
* chore: remove unused execa require

Co-Authored-By: Raphael von der Grün <raphinesse@gmail.com>
* Remove duplicate spy strategy application
* Show error message instead of stderr in info command
* Fix failSafeSpawn to always return a string
This also minimizes the diff
* Change warning as error.message already includes exit code
* Remove chmod option that was unique to superspawn
* Replace superspawn's printCommand w/ manual logging
* Use execa's error message which is a better version of the current one
* Minimize diff

2 years agochore: remove plugin save (#781)
エリス [Thu, 7 Nov 2019 16:16:57 +0000 (01:16 +0900)] 
chore: remove plugin save (#781)

2 years agochore: deprecate plugin save command (#780)
エリス [Thu, 7 Nov 2019 15:55:11 +0000 (00:55 +0900)] 
chore: deprecate plugin save command (#780)

2 years agoExtend and improve plugin tests in preparation of supporting scoped plugins (#818)
Raphael von der Grün [Wed, 6 Nov 2019 19:20:05 +0000 (20:20 +0100)] 
Extend and improve plugin tests in preparation of supporting scoped plugins (#818)

* Extend tests for addHelper.installPluginsForNewPlatform

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
* Test plugin/add.getFetchVersion w/ scoped plugins

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
* Add passing unit tests for plugman/util/metadata

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
* Simplify and extend unit tests for cordova/util.findPlugins

* Less strict path comparison in plugman_fetch.spec

2 years agochore: bump production dependencies (#810)
エリス [Wed, 6 Nov 2019 06:50:02 +0000 (15:50 +0900)] 
chore: bump production dependencies (#810)

* detect-indent@^6.0.0
* fs-extra@^8.1.0
* globby@^10.0.1
* indent-string@^4.0.0
* read-chunk@^3.2.0
* semver@^6.3.0
* shebang-command@^2.0.0

2 years agoSimplify jasmine configuration (#816)
Raphael von der Grün [Sat, 2 Nov 2019 19:29:40 +0000 (20:29 +0100)] 
Simplify jasmine configuration (#816)

- use one shared jasmine.json for all tests
- remove key with default values from jasmine.json
- use default location spec/support/jasmine.json for configuration

2 years agoRemove dead code in integration-tests/plugin.spec (#817)
Raphael von der Grün [Sat, 2 Nov 2019 19:28:23 +0000 (20:28 +0100)] 
Remove dead code in integration-tests/plugin.spec (#817)

2 years agoDo not spawn child process to get platform version (#815)
Raphael von der Grün [Thu, 31 Oct 2019 07:10:18 +0000 (08:10 +0100)] 
Do not spawn child process to get platform version (#815)

2 years agoplugman_fetch.spec cleanup (#813)
Raphael von der Grün [Wed, 30 Oct 2019 15:15:26 +0000 (16:15 +0100)] 
plugman_fetch.spec cleanup (#813)

* Use Jasmine's built-in call counting

* Remove unnecessary wrapping in path.join

* Fix and re-enable disabled test

2 years agoRemove obsolete and duplicate ignore entries (#814)
Raphael von der Grün [Wed, 30 Oct 2019 15:14:41 +0000 (16:14 +0100)] 
Remove obsolete and duplicate ignore entries (#814)

2 years agochore: improve npm ignore list (#809)
エリス [Wed, 30 Oct 2019 01:36:57 +0000 (10:36 +0900)] 
chore: improve npm ignore list (#809)

= BEFORE =
npm notice package size:  105.7 kB
npm notice unpacked size: 487.6 kB
npm notice total files:   86

= AFTER =
npm notice package size:  88.3 kB
npm notice unpacked size: 394.7 kB
npm notice total files:   66

2 years agochore: update jasmine dependencies (#811)
エリス [Wed, 30 Oct 2019 01:30:51 +0000 (10:30 +0900)] 
chore: update jasmine dependencies (#811)

2 years agoRemove unused module plugman/platforms/common (#808)
Raphael von der Grün [Thu, 24 Oct 2019 09:54:52 +0000 (11:54 +0200)] 
Remove unused module plugman/platforms/common (#808)

2 years agoBreak dependency cycles (#807)
Raphael von der Grün [Mon, 21 Oct 2019 16:39:31 +0000 (18:39 +0200)] 
Break dependency cycles (#807)

* Break cycles caused by require-facade anti-pattern

All these dependency cycles were caused by sub-package members
requiring their respective sub-package facade module when all they
needed was another member from their own sub-package.

Cycles that were broken by this:
- cordova/{cordova > build}
- cordova/{cordova > emulate}
- cordova/{cordova > run}
- cordova/{cordova > serve}
- cordova/platform/{index > addHelper}
- plugman/{plugman > install}

* Break cycle between cordova/util and platforms/platforms

We do this by moving `cordova/util.hostSupports` to the `platforms`
sub-package. To not further pollute `platforms/platforms`, we introduce
a new facade module for the `platforms` sub-package.

`platforms/platforms` remains for the time being, especially because it
is part of our public interface (see `cordova-lib.js`).

This commit also simplifies the platforms.hostSupports utility function.
The support for indicating no host requirements by setting `hostos: '*'`
is dropped in favor of letting `hostos` undefined.

* Break cycles involving cordova/prepare.preparePlatforms

To achieve this, preparePlatforms had to be extracted into its own
module, so it could be required separately from cordova/prepare.
It now lives in cordova/prepare/platforms.

Cycles that were broken by this:

- cordova/{prepare > restore-util > ... > platform/addHelper}
- cordova/{prepare > restore-util > ... > plugin/add}
- cordova/{prepare > restore-util > ... > plugin/remove}

* Re-enable tests that needed to spy on preparePlatforms

These tests were disabled because it was difficult to spy on
preparePlatforms since it was only required during runtime.

The test in cordova/plugin/add.spec wasn't even implemented. I did my
best to follow the tests description with my implementation.

2 years agoFix cordova/emulate.spec (#804)
Raphael von der Grün [Sun, 20 Oct 2019 18:34:08 +0000 (20:34 +0200)] 
Fix cordova/emulate.spec (#804)

* Fix copy/paste errors in cordova/emulate.spec

* Remove filtering-out of non-existant platform

2 years agoRemove unused exports from cordova/util (#806)
Raphael von der Grün [Sun, 20 Oct 2019 11:31:39 +0000 (13:31 +0200)] 
Remove unused exports from cordova/util (#806)

* Remove unused support for global cordova config

* Remove unused exports and functions from cordova/util

2 years agoRemove support for obsolete <project>/.cordova/config.json (#805)
Raphael von der Grün [Sat, 19 Oct 2019 17:26:14 +0000 (19:26 +0200)] 
Remove support for obsolete <project>/.cordova/config.json (#805)

* Remove cordova/config module

* Remove obsolete function plugin.util.saveToConfigXmlOn

2 years agoMinor code cleanup (#802)
Raphael von der Grün [Mon, 14 Oct 2019 14:25:16 +0000 (16:25 +0200)] 
Minor code cleanup (#802)

* Simplify require path

* Break up overly long comment line

* Remove some mentions of --fetch in comments

* Remove commented out code

2 years agoDo not run legacy hooks from dirs anymore (#797)
Raphael von der Grün [Thu, 10 Oct 2019 17:57:42 +0000 (19:57 +0200)] 
Do not run legacy hooks from dirs anymore (#797)

2 years agoRemove platform.check (#800)
Raphael von der Grün [Thu, 10 Oct 2019 17:54:36 +0000 (19:54 +0200)] 
Remove platform.check (#800)

2 years agoRemove code to handle plugins that were added by cordova@<5.4.0 (#765)
Raphael von der Grün [Thu, 10 Oct 2019 17:40:14 +0000 (19:40 +0200)] 
Remove code to handle plugins that were added by cordova@<5.4.0 (#765)

2 years agoRemove parts of plugman that have been moved to the plugman repo (#766)
Raphael von der Grün [Thu, 10 Oct 2019 15:02:36 +0000 (17:02 +0200)] 
Remove parts of plugman that have been moved to the plugman repo (#766)

* Move CLI interface plugman.commands from cordova-lib to plugman

* Remove unused plugman.help (had been moved to plugman repo)

2 years agoReplace underscore with modern JS (#772)
Raphael von der Grün [Thu, 10 Oct 2019 14:58:48 +0000 (16:58 +0200)] 
Replace underscore with modern JS (#772)

* _.extend => Object.assign

* Rewrite plugman/variable-merge w/out underscore

* _.find => Array.prototype.find

* _.clone => Object.assign

* Rewrite plugman/util/dependencies w/out underscore

* Remove last occurence of underscore usage

* Remove dependency on underscore

2 years agochore: drop node 6 and 8 support (#799)
Raphael von der Grün [Thu, 10 Oct 2019 14:46:12 +0000 (16:46 +0200)] 
chore: drop node 6 and 8 support (#799)

2 years agochore: bump version to 10.0.0-dev (#798)
Raphael von der Grün [Thu, 10 Oct 2019 14:44:32 +0000 (16:44 +0200)] 
chore: bump version to 10.0.0-dev (#798)

2 years agoUse up-to-date fixtures in tests (#770)
Raphael von der Grün [Thu, 10 Oct 2019 13:26:00 +0000 (15:26 +0200)] 
Use up-to-date fixtures in tests (#770)

* Add helper to get up-to-date test fixtures

* Use up-to-date project fixture in E2E plugin dependency tests

* Use up-to-date platform fixture in plugman.install tests

* Use up-to-date platform in HooksRunner E2E tests

* Use up-to-date platform fixture in plugman.uninstall tests

* Use up-to-date project fixture in pkgJson plugin E2E tests

* Use up-to-date platform fixture in plugin.spec E2E tests

* Remove unused and outdated Android project fixture

* Remove unused project fixture "base"

* Use cordova-test-platform to test platform installation from local path

* Remove unused cordova-browser fixture

* Use cordova-test-platform to test getInstalledPlatformsWithVersions

* Remove unused cordova-android fixture

* Use testPlatformApp fixture to test cordova/util.getPlatformApiFunction

* Finally remove shelljs (again)

Had to be kept in devDeps before because of some outdated fixtures

* Make platformApi fixture project a minimal stub

2 years agoHooksRunner code & spec cleanup (#796)
Raphael von der Grün [Thu, 10 Oct 2019 08:50:51 +0000 (10:50 +0200)] 
HooksRunner code & spec cleanup (#796)

* Cleanup HooksRunner code

* Merge the 'plugin hooks' blocks in HooksRunner.spec

* Reduce amount of fixtures for HooksRunner test

2 years agofix: error message during plugin installation w/ missing engine (#791)
Geert Ijewski [Fri, 4 Oct 2019 14:39:27 +0000 (16:39 +0200)] 
fix: error message during plugin installation w/ missing engine (#791)

2 years agochore: add Node.js 12 to CI services (#777)
エリス [Sun, 21 Jul 2019 05:27:19 +0000 (14:27 +0900)] 
chore: add Node.js 12 to CI services (#777)

3 years agoQuick workaround for e2e failure on AppVeyor CI (#786)
Chris Brody [Tue, 18 Jun 2019 21:38:17 +0000 (17:38 -0400)] 
Quick workaround for e2e failure on AppVeyor CI (#786)

3 years agonyc@14 update in devDependencies (#783)
Chris Brody [Wed, 12 Jun 2019 21:42:56 +0000 (17:42 -0400)] 
nyc@14 update in devDependencies (#783)

3 years agoMerge pull request #775 from raphinesse/cpj-cleanup
Raphael von der Grün [Wed, 17 Apr 2019 00:11:14 +0000 (02:11 +0200)] 
Merge pull request #775 from raphinesse/cpj-cleanup

Cleanup plugman.createPackageJson

3 years agoSimpler and better cordova/util.getPlatformApiFunction (#767)
Raphael von der Grün [Wed, 17 Apr 2019 00:06:37 +0000 (02:06 +0200)] 
Simpler and better cordova/util.getPlatformApiFunction (#767)

* Simpler and better cordova/util.getPlatformApiFunction

* Apply suggestions from code review

Co-Authored-By: raphinesse <raphinesse@gmail.com>
3 years agoCollapse declaration of globals to a single line 775/head
Raphael von der Grün [Mon, 15 Apr 2019 11:37:05 +0000 (13:37 +0200)] 
Collapse declaration of globals to a single line

3 years agoGet rid of hacky default.json file for init-defaults
Raphael von der Grün [Sun, 14 Apr 2019 11:44:22 +0000 (13:44 +0200)] 
Get rid of hacky default.json file for init-defaults

3 years agoRemove unused parameter `test` from `readDeps`
Raphael von der Grün [Mon, 15 Apr 2019 11:15:28 +0000 (13:15 +0200)] 
Remove unused parameter `test` from `readDeps`

The parameter `test` was actually never used in `readDeps`. That means
that both `dependencies` and `devDependencies` will be populated with
_all_ packages installed to node_modules XD

3 years agoRemove unused key `defaults.bugs` in createpackagejson
Raphael von der Grün [Sun, 14 Apr 2019 13:33:57 +0000 (15:33 +0200)] 
Remove unused key `defaults.bugs` in createpackagejson

3 years agoRemove futile attempts to read npm config values
Raphael von der Grün [Sun, 14 Apr 2019 13:04:58 +0000 (15:04 +0200)] 
Remove futile attempts to read npm config values

Our init-defaults.js apparently is a slightly modified copy of
init-package-json/default-input.js. When npm calls `init-package-json`
they probably pass an object parsed from their configuration file.

We on the other hand always pass `{}`. Which means that any call to
`config.get` will return `undefined`.

This commit replaces all these calls in our code with `undefined` and
does some constant folding to tidy things up.

3 years agoMake src/plugman/init-defaults.js lintable (#774)
Raphael von der Grün [Mon, 15 Apr 2019 01:09:49 +0000 (03:09 +0200)] 
Make src/plugman/init-defaults.js lintable (#774)

Work around using the reserved word `package` to be able to lint
src/plugman/init-defaults.js

3 years agoHave plugman.createPackageJson create file in plugin dir, not in cwd (#773)
Raphael von der Grün [Sun, 14 Apr 2019 19:50:25 +0000 (21:50 +0200)] 
Have plugman.createPackageJson create file in plugin dir, not in cwd (#773)

Right now `plugman createpackagejson <plugin dir>` reads values from `plugin.xml` in `<plugin dir>` but creates the `package.json` in `process.cwd()`. This seems to be undocumented behavior, and is considered a bug.

With this patch, we always create the `package.json` in `<plugin dir>` next to `plugin.xml` instead.

3 years agoPrevent masking of errors during testing (#771)
Raphael von der Grün [Sun, 14 Apr 2019 10:47:53 +0000 (12:47 +0200)] 
Prevent masking of errors during testing (#771)

Node.js throws an Error if the error event is emitted on a EventEmitter instance that has no handlers attached for it. This is usually the case during testing and often masks the actual error that is causing the issue.

So we attach a listener to just log error events to console. During passing tests runs, no additional output is generated.

3 years agoProper async code in src/plugman/createpackagejson.js (#768)
Raphael von der Grün [Sun, 14 Apr 2019 10:45:49 +0000 (12:45 +0200)] 
Proper async code in src/plugman/createpackagejson.js (#768)

The existing code returned an instantly resolved promise despite the fact that it was doing async operations.

3 years agoMerge pull request #764 from raphinesse/expressive-pkgJson.spec
Raphael von der Grün [Sat, 13 Apr 2019 09:57:06 +0000 (11:57 +0200)] 
Merge pull request #764 from raphinesse/expressive-pkgJson.spec

Expressive pkg json.spec

3 years agoRemove unnecessary spy (#763)
Raphael von der Grün [Sat, 13 Apr 2019 09:42:33 +0000 (11:42 +0200)] 
Remove unnecessary spy (#763)

The stubbing is not actually needed for the tests. It rather causes problems if the tests are using an up-to-date cordova-android as that currently requires ActionStack.prototype.process to return a Q instance.

3 years agoRemove unused fixtures 764/head
Raphael von der Grün [Sat, 13 Apr 2019 00:14:37 +0000 (02:14 +0200)] 
Remove unused fixtures

3 years agoMerge describe blocks in pkgJson.spec
Raphael von der Grün [Sat, 13 Apr 2019 00:14:36 +0000 (02:14 +0200)] 
Merge describe blocks in pkgJson.spec

3 years agoCreate projects instead of asserting their properties in pkgJson.spec
Raphael von der Grün [Sat, 13 Apr 2019 00:14:35 +0000 (02:14 +0200)] 
Create projects instead of asserting their properties in pkgJson.spec

3 years agoFactor out common project test helpers
Raphael von der Grün [Sat, 13 Apr 2019 00:14:34 +0000 (02:14 +0200)] 
Factor out common project test helpers

3 years agoRemove unused fixtures (#762)
Raphael von der Grün [Fri, 12 Apr 2019 13:30:25 +0000 (15:30 +0200)] 
Remove unused fixtures (#762)

These are only test fixtures, so this is a patch-level change.

Related to #757

3 years agoMerge pull request #761 from raphinesse/misc-test-improvements
Raphael von der Grün [Mon, 1 Apr 2019 14:27:28 +0000 (16:27 +0200)] 
Merge pull request #761 from raphinesse/misc-test-improvements

Various test improvements