cordova-common.git
7 months agorefactor(PlatformMunger): DRY & simplify config munging (#162) master
Raphael von der Grün [Mon, 18 Oct 2021 21:23:04 +0000 (23:23 +0200)] 
refactor(PlatformMunger): DRY & simplify config munging (#162)

* factor out private helper _getChanges

* factor out private helper _generateMunge

* DRY config_munge generation

* change _munge_helper signature

* use _munge_helper for removal too

* remove superfluous if-guards

* is_conflicting gets global_munge itself

* destructure & remove more superfluous guards

* simplify info collected & returned by _is_conflicting

* rename conflict props

* nicer _is_conflicting

7 months agorefactor(xml-helpers): document & check function signature types (#160)
Raphael von der Grün [Mon, 18 Oct 2021 21:12:32 +0000 (23:12 +0200)] 
refactor(xml-helpers): document & check function signature types  (#160)

* refactor(xml-helpers): use ES6 method syntax

* refactor(xml-helpers): document & check function signature types

see: https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html

* refactor(xml-helpers): satisfy TS type checks

- `et.ElementText` is not always a string but always has `#toString`
- `et.ElementTag` is not always a string, but converting it to one
should be sufficient for our purposes
- `et.Element` is not a constructor, so it should be called w/out new

8 months agochore: npmrc (#173)
Norman Breau [Fri, 17 Sep 2021 12:55:29 +0000 (09:55 -0300)] 
chore: npmrc (#173)

11 months agofix(ConfigChanges): do not pass PlistValue to xml_helpers.resolveParent (#158)
Raphael von der Grün [Tue, 8 Jun 2021 09:03:25 +0000 (11:03 +0200)] 
fix(ConfigChanges): do not pass PlistValue to xml_helpers.resolveParent (#158)

Fixes #156

11 months agotest: fix invalid config for jasmine-spec-reporter (#161)
Raphael von der Grün [Tue, 8 Jun 2021 08:40:29 +0000 (10:40 +0200)] 
test: fix invalid config for jasmine-spec-reporter (#161)

Fixes the following warning:
    WARN: jasmine-spec-reporter 'displayStacktrace' option supports
    value ('none', 'raw', 'pretty'), default to 'none'

14 months agorefactor(ConfigChanges): use for-of loop for iterating over array (#159)
Raphael von der Grün [Tue, 2 Mar 2021 14:04:38 +0000 (15:04 +0100)] 
refactor(ConfigChanges): use for-of loop for iterating over array (#159)

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

21 months agoci: add node 14 to workflow (#150)
エリス [Fri, 24 Jul 2020 16:57:13 +0000 (01:57 +0900)] 
ci: add node 14 to workflow (#150)

22 months agoIncrement package version to 4.0.3-dev
Erisu [Mon, 20 Jul 2020 05:07:34 +0000 (14:07 +0900)] 
Increment package version to 4.0.3-dev

22 months agoUpdated RELEASENOTES.md & version for release 4.0.2 (common-v4.0.2) 4.0.x 4.0.2 rel/4.0.2
Erisu [Wed, 1 Jul 2020 08:09:35 +0000 (17:09 +0900)] 
Updated RELEASENOTES.md & version for release 4.0.2 (common-v4.0.2)

23 months agoMerge pull request #148 from dpa99c/GH-144
Dave Alden [Fri, 12 Jun 2020 14:05:41 +0000 (15:05 +0100)] 
Merge pull request #148 from dpa99c/GH-144

fix: resolve correct path to app info plist when multiple plist files are present (#144)

23 months ago(ios) fix: resolve correct path to app info plist when multiple plist files are prese... 148/head
Dave Alden [Fri, 12 Jun 2020 13:21:41 +0000 (14:21 +0100)] 
(ios) fix: resolve correct path to app info plist when multiple plist files are present (#144).

When multiple plist files exists in a cordova-ios project (e.g. due to a plugin containing `<podspec>`), ConfigFile was updated under CB-5989 to select the app plist as the target for changes destined for *-Info.plist.
However, the change made under CB-5989 incorrectly constructed the path to the app plist by omitting the project name subdirectory from the path, causing the fix to fail to work.

This commit fixes this by correcting the constructed path to the app plist.

23 months agocleanup: remove trailing whitespace (#147)
Chris Brody [Mon, 8 Jun 2020 16:39:59 +0000 (12:39 -0400)] 
cleanup: remove trailing whitespace (#147)

* cleanup: remove trailing whitespace from .asf.yaml
* cleanup: remove trailing whitespace from .github/ISSUE_TEMPLATE.md
* cleanup: remove trailing whitespace from .github/ISSUE_TEMPLATE/BUG_REPORT.md
* cleanup: remove trailing whitespace from .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
* cleanup: remove trailing whitespace from CONTRIBUTING.md

23 months agoupdate nyc -> ^15.1.0 in devDependencies (#146)
Chris Brody [Mon, 8 Jun 2020 16:38:58 +0000 (12:38 -0400)] 
update nyc -> ^15.1.0 in devDependencies (#146)

23 months agotest: cleanup by removing unused test fixtures (#145)
エリス [Wed, 3 Jun 2020 07:29:16 +0000 (16:29 +0900)] 
test: cleanup by removing unused test fixtures (#145)

2 years agoIncrement package version to 4.0.2-dev
Erisu [Tue, 19 May 2020 00:20:08 +0000 (09:20 +0900)] 
Increment package version to 4.0.2-dev

2 years agochore: add missing LICENSE & NOTICE files 4.0.1 rel/4.0.1
Erisu [Fri, 15 May 2020 01:09:08 +0000 (10:09 +0900)] 
chore: add missing LICENSE & NOTICE files

2 years agoUpdated RELEASENOTES.md & version for release 4.0.1 (common-4.0.1)
Erisu [Thu, 14 May 2020 05:54:51 +0000 (14:54 +0900)] 
Updated RELEASENOTES.md & version for release 4.0.1 (common-4.0.1)

2 years agochore: apply random missing minor changes (#141)
エリス [Thu, 14 May 2020 05:44:23 +0000 (14:44 +0900)] 
chore: apply random missing minor changes  (#141)

* doc(README): fix markdown lint & unify layout
* chore(npm): use short notation & cleanup

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

2 years agofix: typo in access & allow navigation (#143)
エリス [Sun, 19 Apr 2020 02:17:29 +0000 (11:17 +0900)] 
fix: typo in access & allow navigation (#143)

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

2 years agofix(ConfigParser): ImageResources constructor (#142)
Raphael von der Grün [Sun, 12 Apr 2020 11:43:53 +0000 (13:43 +0200)] 
fix(ConfigParser): ImageResources constructor (#142)

The previous ImageResources constructor did not cover the case where a
single integer argument is given to construct an empty array of the
given length. This broke the `map` method since it uses that constructor
variant.

This commit fixes that situation by using a static factory method
instead of overriding the native Array constructor.

2 years agoIncrement package version to 4.0.1-dev
Erisu [Mon, 30 Mar 2020 14:34:34 +0000 (23:34 +0900)] 
Increment package version to 4.0.1-dev

2 years agoUpdated RELEASENOTES.md & version for release 4.0.0 (common-v4.0.0) 4.0.0 rel/4.0.0
Erisu [Thu, 26 Mar 2020 07:37:04 +0000 (16:37 +0900)] 
Updated RELEASENOTES.md & version for release 4.0.0 (common-v4.0.0)

2 years agobreaking: bump all dependencies to latest (#140)
エリス [Thu, 26 Mar 2020 06:54:48 +0000 (15:54 +0900)] 
breaking: bump all dependencies to latest (#140)

* breaking(dependencies): bump fs-extra@^9.0.0
* breaking(dependencies): bump dev dependencies to latest
  * @cordova/eslint-config@^3.0.0
  * jasmine-spec-reporter@^5.0.1
* breaking(dependencies): rebuilt package-lock.json
* chore: apply lint fixes
* breaking(ci): bump github-actions checkout dependency

2 years agochore: various cleanup tasks (#139)
エリス [Sun, 15 Mar 2020 13:38:19 +0000 (22:38 +0900)] 
chore: various cleanup tasks (#139)

* test(coverage): exclude coverage directory
* style(README): fix markdown violations
* doc(README): modernize code examples
* doc(README): minor text improvements
* style(RELEASENOTES): minor text visual improvement
* doc(README): apply suggestions & more
* doc(README): update CI badge to reference master

2 years agochore(dependency): update dev & non-dev dependencies (#138)
エリス [Sun, 15 Mar 2020 10:08:04 +0000 (19:08 +0900)] 
chore(dependency): update dev & non-dev dependencies (#138)

* chore(dependency): bump nyc@latest (^15.0.0)
* chore(dependency): bump rewire@latest (^5.0.0)
* chore(dependency): bump cross-spawn@latest (^7.0.1)
* chore(dependency): bump endent@latest (^1.4.1)
* chore(dependency): bump fast-glob@latest (^3.2.2)
* chore(dependency): bump underscore@latest (^1.9.2)
* chore(dependency): bump q@latest (^1.5.1)
* chore(dependency): rebuild package-lock.json

2 years agorefactor: transform var to let/const (#137)
エリス [Sun, 15 Mar 2020 10:02:07 +0000 (19:02 +0900)] 
refactor: transform var to let/const (#137)

2 years agoci: final migration to actions (#136)
エリス [Sun, 15 Mar 2020 09:40:01 +0000 (18:40 +0900)] 
ci: final migration to actions (#136)

2 years agostyle: improve line spacing & group like items (#85)
Chris Brody [Sun, 15 Mar 2020 07:17:35 +0000 (03:17 -0400)] 
style: improve line spacing & group like items (#85)

Co-authored-by: Christopher J. Brody <chris@brody.consulting>
Co-authored-by: Erisu <ellis.bryan@gmail.com>
2 years agofix(ConfigFile): correctly resolve *-Info.plist file path (#124)
Arman [Sun, 15 Mar 2020 05:46:15 +0000 (08:46 +0300)] 
fix(ConfigFile): correctly resolve *-Info.plist file path (#124)

* fix(ConfigParser): correctly resolve *-Info.plist file path
* test(ConfigFile): test Info.plist file resolve

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
2 years agofix(ConfigFile): Normalize globbed file paths (#135)
Raphael von der Grün [Sun, 15 Mar 2020 02:07:34 +0000 (03:07 +0100)] 
fix(ConfigFile): Normalize globbed file paths (#135)

2 years agotest(ConfigFile): minor improvements (#134)
Raphael von der Grün [Sun, 15 Mar 2020 02:04:52 +0000 (03:04 +0100)] 
test(ConfigFile): minor improvements (#134)

* test(ConfigFile): Fix module name
* test(ConfigFile): get fresh module for each test

2 years agofeat(CordovaError): support for error cause & more (#121)
Raphael von der Grün [Sat, 14 Mar 2020 14:37:17 +0000 (15:37 +0100)] 
feat(CordovaError): support for error cause & more (#121)

This commit bases CordovaError on the popular [joyent/node-verror].

We actually use @netflix/nerror, a VError fork, for now. That's because
we do not want printf style error formatting support and that fork
allows to disable it. There's [ongoing work][1] to integrate that change
into the original VError.

So basically CordovaError behaves like PError but with all the static
methods from VError and different parameter ordering for its
constructor.

One change that could break some existing tests in repositories that use
cordova-common is that `toString` (for errors without a cause argument)
now behaves like the Error default again:

    new CordovaError('foo').toString();
    // old result: 'foo'
    // new result: 'CordovaError: foo'

[joyent/node-verror]: https://github.com/joyent/node-verror
[1]: https://github.com/joyent/node-verror/issues/63#issuecomment-546067267

2 years agorefactor(ConfigParser): cleanup & simplify (#133)
Raphael von der Grün [Sat, 14 Mar 2020 14:21:53 +0000 (15:21 +0100)] 
refactor(ConfigParser): cleanup & simplify (#133)

* refactor: ConfigParser

* make use of et API

* factor out CDV_XMLNS_URI

* shorten some setters

* simplify addPlugin

* test: extend preferences tests

* fix & DRY preferences code

- fixes setGlobalPreference to be case-insensitive
- fixes setGlobalPreference to use the last preference if multiple exist

* simplify getCordovaNamespacePrefix

* simplify access methods

* DRY & simplify getFileResources

* simplify getHookScripts

* get rid of superfluous variables

* improve JSDocs

* destructure parseElementtreeSync

* simplify getPlugin

* introduce Resource types

* Add some platform remarks to JSDocs

Co-authored-by: Erisu <ellis.bryan@gmail.com>
2 years agorefactor(PluginInfo): cleanup & simplify (#132)
Raphael von der Grün [Thu, 9 Jan 2020 22:23:39 +0000 (23:23 +0100)] 
refactor(PluginInfo): cleanup & simplify (#132)

* refactor: PluginInfo

* _getTags: simplify

* _getTagsInPlatform: support a list of platforms

* getPodSpecs: remove useless undefined value filtering

* getPodSpecs: further improve formatting

* getPreferences: simplify

* getHookScripts: simplify

* getFrameworks: only determine vars once

* getFrameworks: improve readability

* ctor: improve

* ctor: better var name for root elem

* destructure xml-helpers

* inline addCordova helper

* apply lebab.destruct-params

* convert comments to JSDocs

* remove outdated TODO; sync is faster

* map tags explicitly

* make _getTags* private methods

Co-authored-by: エリス <erisu@users.noreply.github.com>
2 years agorefactor(misc): cleanup & simplify (#131)
Raphael von der Grün [Wed, 8 Jan 2020 12:05:04 +0000 (13:05 +0100)] 
refactor(misc): cleanup & simplify (#131)

* refactor: PlatformJson

* refactor: CordovaCheck

* refactor(plist-helpers): rename underscore variable

* refactor(plist-helpers): rename pruneOBJECT function

* refactor(plist-helpers): formatting

* refactor(CordovaCheck): simplify isCordova w/ pwd

* refactor(plist-helpers): simplify array merge

* refactor(plist-helpers): simplify dict merge

* refactor(PlatformJson): use readJsonSync

Co-authored-by: エリス <erisu@users.noreply.github.com>
2 years agorefactor(ConfigChanges): simplify (#130)
Raphael von der Grün [Wed, 8 Jan 2020 09:45:10 +0000 (10:45 +0100)] 
refactor(ConfigChanges): simplify (#130)

* refactor: ConfigChanges

* refactor: ConfigFile

* test(ConfigChanges): organize imports and constants

* refactor(ConfigChanges): reduce var scope

* refactor(ConfigChanges): remove unused statement

* refactor(ConfigChanges): simplify after removing useless statement

* refactor(ConfigChanges): drop useless if

* refactor(ConfigChanges): take method from variable

* refactor(ConfigFile): make use of Array#find

* refactor(ConfigFile): prefer cwd opt for glob

* refactor(ConfigFile): simplify return logic

* refactor(ConfigFile): use read-chunk in isBinaryPlist

* refactor: ConfigKeeper

* refactor(ConfigKeeper): use Map as cache

* refactor(ConfigKeeper): apply standard caching pattern

Co-authored-by: エリス <erisu@users.noreply.github.com>
2 years agorefactor(xml-helpers): DRY & simplify (#128)
Raphael von der Grün [Mon, 6 Jan 2020 17:14:46 +0000 (18:14 +0100)] 
refactor(xml-helpers): DRY & simplify (#128)

* refactor: xml-helpers

* DRY graftXML{Merge,Overwrite}

* Simplify graftXMLAttrs

* Simplify graftXML

* Simplify parseElementtreeSync

* Simplify removeDuplicatePreferences

* Better mergeXml

* Vastly simplify resolveParent

* Improve findInsertIdx formatting

* Simplify attribMatch

* Simplify equalNodes

* Simplify mergeChild

* Simplify pruneXMLRemove

* Simplify pruneXML

Co-authored-by: エリス <erisu@users.noreply.github.com>
2 years agofix: broken lock file from #95 (#129)
Raphael von der Grün [Mon, 6 Jan 2020 15:14:07 +0000 (16:14 +0100)] 
fix: broken lock file from #95 (#129)

This regenerates `package-lock.json` from scratch as the file that was committed
in #95 did not match the dependencies from `package.json`.

2 years agorefactor(munge-util): DRY & simplify (#127)
Raphael von der Grün [Mon, 6 Jan 2020 14:30:06 +0000 (15:30 +0100)] 
refactor(munge-util): DRY & simplify (#127)

* remove unused process_munge export

* DRY {increment,decrement}_munge

* refactor: munge-util

* replace _ with modern JS

- replace underscore find methods

- use Object.assign instead of _.extend

  The fact that we are now only cloning own properties should be OK since
  `oldAttributes` should be a plain object

* improve variable names

* simplify mungeItems

* simplify deep_remove

* refactor process_munge to processArgs & getElements

We simplify getElements since it's always called with a top-level munge

* add JSDocs & type checking

Co-authored-by: エリス <erisu@users.noreply.github.com>
2 years agoTEST: Test using GitHub workflows for CI (#95)
Darryl Pogue [Sun, 5 Jan 2020 12:19:44 +0000 (04:19 -0800)] 
TEST: Test using GitHub workflows for CI (#95)

* Test using GitHub workflows for CI
* Commit package-lock for CI runs

2 years agotest(ConfigFile): group & cleanup tests (#125)
Raphael von der Grün [Fri, 20 Dec 2019 11:59:11 +0000 (12:59 +0100)] 
test(ConfigFile): group & cleanup tests (#125)

* group tests in describe

* remove unused beforeEach

* reduce variable scope

* Make test titles unique

Co-Authored-By: エリス <erisu@users.noreply.github.com>
2 years agochore!: remove main export mungeUtil (#126)
Raphael von der Grün [Fri, 20 Dec 2019 00:59:09 +0000 (01:59 +0100)] 
chore!: remove main export mungeUtil (#126)

Removes `mungeUtil` from the list of modules that are exported by
`cordova-common`. It was documented as _internal_ and we did not use it in any
of our repos.

2 years agorefactor: FileUpdater (#123)
Raphael von der Grün [Wed, 18 Dec 2019 11:45:19 +0000 (12:45 +0100)] 
refactor: FileUpdater (#123)

* add missing changes from "refactor: FileUpdater"

* remove unnecessary OR expression

* remove unnecessary parent dir creation

* DRY logging function default

* test: get rid of now-obsolete nullLogger arguments

* simplify building sourceMaps in mergeAndUpdateDir

* simplify OR over all update indicators

* use fast-glob for file globbing

Until now we used our own glob implementation based on minimatch.

The only difference to the old implementation is, that not every parent
directory of a matched file is included in the result. However, since do
not pass the dirMaps out of this module and any missing dirs will be
created by fs-extra, that should be an advantage, if anything.

* Simplify mergePathMaps

* DRY file copying code

* Handle removals early & flatten logic

* Always show verbose log

* DRY file copying code further

* Improve comments

* Handle special files early & simplify

* Flatten logic

* Normalize dirMap keys to pass tests on Windows

2 years agorefactor: use ES6 classes where applicable (#119)
Raphael von der Grün [Sun, 15 Dec 2019 21:18:09 +0000 (22:18 +0100)] 
refactor: use ES6 classes where applicable (#119)

* chore(ConfigParser): move private helpers to bottom

* chore(PluginInfo): move ctor logic to top

* refactor(PluginInfo): drop useless intermediate vars

* refactor(PluginInfo): inline _parse* helpers

* refactor: use ES6 classes where applicable

* docs: remove obsolete JSDoc tags

2 years agorefactor: use template strings where applicable (#118)
Raphael von der Grün [Sun, 15 Dec 2019 20:50:48 +0000 (21:50 +0100)] 
refactor: use template strings where applicable (#118)

Applied `lebab --replace src --transform template` to the code and made some
minor adjustments.

2 years agorefactor: use property shorthand notation (#116)
Raphael von der Grün [Sun, 15 Dec 2019 20:46:25 +0000 (21:46 +0100)] 
refactor: use property shorthand notation (#116)

Applied `lebab --replace src --transform obj-shorthand` to the code.

2 years agorefactor: transform var to let/const (#115)
Raphael von der Grün [Sun, 15 Dec 2019 20:41:18 +0000 (21:41 +0100)] 
refactor: transform var to let/const (#115)

Applied `lebab --replace src --transform let` to the code with minimal manual
changes afterwards.

2 years agorefactor: do not alias `this` (#114)
Raphael von der Grün [Sat, 14 Dec 2019 01:58:13 +0000 (02:58 +0100)] 
refactor: do not alias `this` (#114)

After having switched to arrow functions everywhere in #113, this commit now
replaces all `this` aliases with lexical `this`.

2 years agorefactor: use arrow functions where applicable (#113)
Raphael von der Grün [Fri, 13 Dec 2019 11:55:38 +0000 (12:55 +0100)] 
refactor: use arrow functions where applicable (#113)

This commit makes use of arrow function expressions wherever applicable. Focus
is put on minimizing the diff instead of optimizing or formatting the code
touched by this commit.

2 years agorefactor: move CordovaError module up (#120)
Raphael von der Grün [Fri, 13 Dec 2019 10:43:25 +0000 (11:43 +0100)] 
refactor: move CordovaError module up (#120)

Moves the `CordovaError` module from `src/CordovaError/CordovaError.js` to `src/CordovaError.js`. The additional nesting makes no sense anymore since `src/CordovaError/CordovaExternalToolErrorContext.js` has been removed in #117.

2 years agorefactor(CordovaError)!: remove unused features (#117)
Raphael von der Grün [Thu, 12 Dec 2019 21:43:49 +0000 (22:43 +0100)] 
refactor(CordovaError)!: remove unused features (#117)

* Remove CordovaExternalToolErrorContext

* Remove unused CordovaError.UNKNOWN_ERROR

* Remove unused verbose mode

* Remove unused getErrorCodeName

* Remove unused support for error codes

* Fix JavaDocs

2 years agochore: remove support for ubuntu platform (#111)
Raphael von der Grün [Wed, 27 Nov 2019 20:12:58 +0000 (21:12 +0100)] 
chore: remove support for ubuntu platform (#111)

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

2 years agostyle: drop jasmine env workaround (#108)
Raphael von der Grün [Sun, 24 Nov 2019 10:19:26 +0000 (11:19 +0100)] 
style: drop jasmine env workaround (#108)

ESLint 6.7.0 has just been released and it contains the latest globals
for the jasmine environment. Thus we do not have to add them ourselves.

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

* replace dependencies with @cordova/eslint-config
* update eslint config
* eslint corrections
* chore: fix newline
* chore: re-add no-unused-vars after-used error
* chore: corrected no-unused-vars settings

2 years agotest: always run code coverage during `npm test` (#107)
Raphael von der Grün [Mon, 11 Nov 2019 12:38:15 +0000 (13:38 +0100)] 
test: always run code coverage during `npm test` (#107)

2 years agoci(travis): run codecov using npx in after_success (#106)
Raphael von der Grün [Mon, 11 Nov 2019 12:37:54 +0000 (13:37 +0100)] 
ci(travis): run codecov using npx in after_success (#106)

2 years agochore: bump production dependencies (#103)
エリス [Sun, 10 Nov 2019 23:41:50 +0000 (08:41 +0900)] 
chore: bump production dependencies (#103)

2 years agochore: update jasmine dependencies & config (#101)
エリス [Sun, 10 Nov 2019 23:41:10 +0000 (08:41 +0900)] 
chore: update jasmine dependencies & config (#101)

2 years agochore: replace instanbul w/ nyc (#100)
エリス [Sun, 10 Nov 2019 23:22:16 +0000 (08:22 +0900)] 
chore: replace instanbul w/ nyc (#100)

2 years agochore: drop unused & unneeded dependencies (#102)
エリス [Sun, 10 Nov 2019 23:06:14 +0000 (08:06 +0900)] 
chore: drop unused & unneeded dependencies (#102)

* chore: drop promise-matchers dependency

* chore: drop osenv dependency

* chore: drop dependency which

2 years agochore: improve npm ignore list (#104)
エリス [Sun, 10 Nov 2019 23:04:06 +0000 (08:04 +0900)] 
chore: improve npm ignore list (#104)

Drop From Package
* all dot file and folders with .* (.github, .travis.yml, .eslintrc.yml, etc...)
  * .github/
  * .travis.yml
  * .eslintrc.yml
  * .eslintignore
  * .ratignore
* appveyor.yml

== PACKAGE REPORT ==
* BEFORE
npm notice package size:  41.5 kB
npm notice unpacked size: 179.4 kB
npm notice total files:   34

* AFTER
npm notice package size:  39.1 kB
npm notice unpacked size: 173.8 kB
npm notice total files:   24

2 years agofeat: Replace addProperty with ES6 getters (#96)
Raphael von der Grün [Thu, 7 Nov 2019 16:06:45 +0000 (17:06 +0100)] 
feat: Replace addProperty with ES6 getters (#96)

* Replace addProperty with ES6 getters in main module

This allows static code analysis tools to better understand the module
dependencies. For example, you can use VS Code's code navigation feature
to jump to the module definition.

There's a slight difference in implementation, as the getters installed
by addProperty would only call `require` on first invocation and then
replace themselves with the actual module. But since require does
caching itself, I don't see how that would make a big difference in
terms of runtime.

* Replace addProperty with ES6 getters in ConfigFile

* Remove private module util/addProperty

2 years agofix: PluginInfoProvider for scoped plugins (#94)
Raphael von der Grün [Thu, 7 Nov 2019 16:05:55 +0000 (17:05 +0100)] 
fix: PluginInfoProvider for scoped plugins (#94)

* fix: PluginInfoProvider for scoped plugins
* Add test for PluginInfoProvider /w scoped plugin
* Normalize paths to use backslash on Windows

2 years agochore: update strip-bom@4 (#71)
Chris Brody [Thu, 7 Nov 2019 16:05:04 +0000 (11:05 -0500)] 
chore: update strip-bom@4 (#71)

2 years agochore: drop node 6 and 8 support (#90)
エリス [Wed, 6 Nov 2019 06:51:01 +0000 (15:51 +0900)] 
chore: drop node 6 and 8 support (#90)

2 years agoUse Array.prototype.find in CordovaError (#97)
Raphael von der Grün [Mon, 4 Nov 2019 14:28:52 +0000 (15:28 +0100)] 
Use Array.prototype.find in CordovaError (#97)

2 years agoIncrement package version to 4.0.0-dev
Erisu [Mon, 28 Oct 2019 09:07:16 +0000 (18:07 +0900)] 
Increment package version to 4.0.0-dev

2 years agoUpdate version & RELEASENOTES.md for 3.2.1
Erisu [Mon, 28 Oct 2019 08:26:16 +0000 (17:26 +0900)] 
Update version & RELEASENOTES.md for 3.2.1

2 years agoRe-apply fix for failing CordovaError test (#93)
Raphael von der Grün [Thu, 24 Oct 2019 11:33:53 +0000 (13:33 +0200)] 
Re-apply fix for failing CordovaError test (#93)

This fix was first introduced in #65 and reverted by #89

Fixes #49

2 years agoRemove obsolete JSHint comments (#92)
Raphael von der Grün [Thu, 24 Oct 2019 09:51:12 +0000 (11:51 +0200)] 
Remove obsolete JSHint comments (#92)

2 years agoConvert CordovaError to ES6 class (#87)
Raphael von der Grün [Thu, 10 Oct 2019 14:57:43 +0000 (16:57 +0200)] 
Convert CordovaError to ES6 class (#87)

2 years ago(windows) Add .jsproj as file extension for XML files (#62) (#78)
holyhoehle [Mon, 9 Sep 2019 02:53:59 +0000 (04:53 +0200)] 
(windows) Add .jsproj as file extension for XML files (#62) (#78)

Fixes #62

2 years agorevert: #24 CB-14108: fix incorrect count in config_munge (#89)
エリス [Wed, 21 Aug 2019 03:23:12 +0000 (12:23 +0900)] 
revert: #24 CB-14108: fix incorrect count in config_munge (#89)

* Revert "CB-14108: fix incorrect count in config_munge in ios.json and android.json"

This reverts commit ce3801a184d34cc4c3ea08aeecd159227c6ae9e9.

* chore: eslint object-curly-spacing fix
* add CordovaError spec
* chore: fix eslint warnings for CordovaError spec
* fix CordovaError spec test
* chore: added additional AS project path check

2 years agoMerge pull request #82 from brodybits/general-cleanup-with-eslint-update
Chris Brody [Fri, 19 Jul 2019 12:26:35 +0000 (08:26 -0400)] 
Merge pull request #82 from brodybits/general-cleanup-with-eslint-update

General cleanup with eslint updates

2 years agoeslint cleanup fixes for: padded-blocks 82/head
Christopher J. Brody [Thu, 18 Jul 2019 23:23:58 +0000 (19:23 -0400)] 
eslint cleanup fixes for: padded-blocks

and remove padded-blocks exception from .eslintrc.yml

with src & spec fixed by the following command:

    npm run eslint -- --fix

2 years ago(semi)standard eslint updates
Christopher J. Brody [Thu, 18 Jul 2019 23:15:23 +0000 (19:15 -0400)] 
(semi)standard eslint updates

- eslint-config-semistandard@14
- eslint-config-standard@13

with src & spec fixed by the following command:

    npm run eslint -- --fix

2 years agoeslint cleanup fix for: no-prototype-builtins
Christopher J. Brody [Thu, 18 Jul 2019 23:07:14 +0000 (19:07 -0400)] 
eslint cleanup fix for: no-prototype-builtins

as needed for the upcoming (semi)standard eslint package updates

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Co-authored-by: Christopher J. Brody <chris@brody.consulting>
2 years agoeslint cleanup fixes: operator-linebreak (#86)
Chris Brody [Thu, 18 Jul 2019 22:47:30 +0000 (18:47 -0400)] 
eslint cleanup fixes: operator-linebreak (#86)

- remove operator-linebreak exception from .eslintrc.yml
- reformat ternary expresssions according to (semi)standard
- reformat error message expressions according to (semi)standard

as done by the following command, with no operator-linebreak
exception enabled:

    npm run eslint -- --fix

2 years agoremove no-throw-literal lint exception not needed (#81)
Chris Brody [Thu, 18 Jul 2019 21:17:10 +0000 (17:17 -0400)] 
remove no-throw-literal lint exception not needed (#81)

2 years agoFix ESLint violations where applicable (#83)
Raphael von der Grün [Thu, 18 Jul 2019 10:22:34 +0000 (12:22 +0200)] 
Fix ESLint violations where applicable (#83)

Fixes most ESLint violations that were masked by ESLint comments. Two instances still remain. One is an acceptable usage of `eval` and is in `CordovaError` that should be fixed by its own commit.

2 years agoUpdate to jasmine 3.4 & fix resulting spec failures (#80)
Raphael von der Grün [Tue, 18 Jun 2019 09:04:37 +0000 (11:04 +0200)] 
Update to jasmine 3.4 & fix resulting spec failures (#80)

2 years agoPromise handling cleanup in specs (#79)
Raphael von der Grün [Tue, 18 Jun 2019 02:50:05 +0000 (04:50 +0200)] 
Promise handling cleanup in specs (#79)

* Proper expected rejection check in ActionStack spec

* Clean up Promise handling in PluginManager spec

* Remove usage of jasmine's done in sync specs

* Clean up Promise handling in superspawn spec

2 years agoDo not ignore AppVeyor failures on Node.js 12 (#77)
Chris Brody [Fri, 14 Jun 2019 15:06:17 +0000 (11:06 -0400)] 
Do not ignore AppVeyor failures on Node.js 12 (#77)

2 years agoIncrement package version to 3.2.1-dev
Christopher J. Brody [Wed, 12 Jun 2019 08:52:40 +0000 (04:52 -0400)] 
Increment package version to 3.2.1-dev

2 years agoUpdate version & RELEASENOTES.md for 3.2.0 3.2.0 rel/3.2.0
Christopher J. Brody [Wed, 12 Jun 2019 07:23:45 +0000 (03:23 -0400)] 
Update version & RELEASENOTES.md for 3.2.0

2 years agoAdd Node.js 12 to CI Services (#68)
Darryl Pogue [Tue, 11 Jun 2019 21:20:24 +0000 (14:20 -0700)] 
Add Node.js 12 to CI Services (#68)

* Add Node.js 12 to CI Services

* TMP: Allow Node.js 12 Failure on AppVeyor

2 years ago(ios) Plist document not indented with tabs
Oliver Salzburg [Wed, 8 May 2019 23:26:12 +0000 (01:26 +0200)] 
(ios) Plist document not indented with tabs

Xcode indents .plist documents with tabs, not spaces. Other parts of
Cordova already use tabs for indenting .plist documents and using spaces
directly conflicts with both cases.

2 years agoUpdate fs-extra to v8 (#70)
Darryl Pogue [Tue, 11 Jun 2019 15:23:28 +0000 (08:23 -0700)] 
Update fs-extra to v8 (#70)

3 years agoAdd example usage of podspec declarations
Piotr [Wed, 3 Apr 2019 09:07:02 +0000 (11:07 +0200)] 
Add example usage of podspec declarations

When trying to find more information about new `<podspec>` tag deprecating `<framework type="podspec" />` I found this example usage.
However it doesn't specify how to use declarations so I've copied example from [specs fixture](https://github.com/apache/cordova-common/blob/rel/3.1.0/spec/fixtures/plugins/org.test.plugins.withcocoapods/plugin.xml#L37-L47)

3 years agoimplement setPreference and setPlatformPreference
Luo Gang [Tue, 22 Jan 2019 09:12:43 +0000 (17:12 +0800)] 
implement setPreference and setPlatformPreference

3 years agoCatch leaked exceptions in superspawn and convert them to rejections
Raphael von der Grün [Mon, 1 Apr 2019 14:47:27 +0000 (16:47 +0200)] 
Catch leaked exceptions in superspawn and convert them to rejections

At least until Node.js 8, child_process.spawn will throw exceptions
instead of emitting error events in certain cases (like EACCES), Thus we
have to wrap the execution in try/catch to convert them into rejections.

3 years agoMerge pull request #65 from raphinesse/test-fixes 75/head
Raphael von der Grün [Mon, 1 Apr 2019 14:24:12 +0000 (16:24 +0200)] 
Merge pull request #65 from raphinesse/test-fixes

Test fixes

3 years agoFix failing CordovaError test 65/head
Raphael von der Grün [Mon, 1 Apr 2019 10:02:50 +0000 (12:02 +0200)] 
Fix failing CordovaError test

Fixes #49

3 years agoProperly handle promise in superspawn test
Raphael von der Grün [Mon, 1 Apr 2019 09:44:00 +0000 (11:44 +0200)] 
Properly handle promise in superspawn test

3 years agoAdd or update GitHub pull request and issue template
Jan Piotrowski [Mon, 11 Feb 2019 17:36:42 +0000 (18:36 +0100)] 
Add or update GitHub pull request and issue template

3 years agoSet version to 3.1.1-dev
Christopher J. Brody [Mon, 24 Dec 2018 18:36:08 +0000 (13:36 -0500)] 
Set version to 3.1.1-dev