Last commit july 5th

This commit is contained in:
2024-07-05 13:46:23 +02:00
parent dad0d86e8c
commit b0e4dfbb76
24982 changed files with 2621219 additions and 413 deletions

37
spa/node_modules/cordova/CONTRIBUTING.md generated vendored Normal file
View File

@@ -0,0 +1,37 @@
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# Contributing to Apache Cordova
Anyone can contribute to Cordova. And we need your contributions.
There are multiple ways to contribute: report bugs, improve the docs, and
contribute code.
For instructions on this, start with the
[contribution overview](http://cordova.apache.org/contribute/).
The details are explained there, but the important items are:
- Check for Github issues that corresponds to your contribution and link or create them if necessary.
- Run the tests so your patch doesn't break existing functionality.
We look forward to your contributions!

202
spa/node_modules/cordova/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

5
spa/node_modules/cordova/NOTICE generated vendored Normal file
View File

@@ -0,0 +1,5 @@
Apache Cordova
Copyright 2012 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

89
spa/node_modules/cordova/README.md generated vendored Normal file
View File

@@ -0,0 +1,89 @@
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# Cordova CLI
[![NPM](https://nodei.co/npm/cordova.png)](https://nodei.co/npm/cordova/)
[![Node CI](https://github.com/apache/cordova-cli/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/apache/cordova-cli/actions?query=branch%3Amaster)
[![codecov.io](https://codecov.io/github/apache/cordova-cli/coverage.svg?branch=master)](https://codecov.io/github/apache/cordova-cli?branch=master)
> The command line tool to build, deploy and manage [Cordova](https://cordova.apache.org)-based applications.
[Apache Cordova](https://cordova.apache.org) allows for building native mobile applications using HTML, CSS and JavaScript.
This tool helps with management of multi-platform Cordova applications as well as Cordova plugin integration.
## Installation
In your command-line on Windows:
```bash
c:\> npm install -g cordova
```
In your terminal on Mac OS X/Linux:
```bash
$sudo npm install -g cordova
```
## Creating a new Cordova project
This simple example demonstrates how Cordova CLI can be used to create a `myApp` project with the `camera` plugin and run it for `android` platform:
```bash
cordova create myApp com.myCompany.myApp myApp
cd myApp
cordova plugin add cordova-plugin-camera --save
cordova platform add android --save
cordova requirements android
cordova build android --verbose
cordova run android
```
## Docs
- [Overview of Cordova]
- [Create your first Cordova app] guide
- [Full reference docs for Cordova CLI][Reference docs] has details of commands to add platforms, add plugins, build, package, and sign your HTML, JS apps.
- Cordova allows you to build apps for a number of platforms. Learn more about our [Supported platforms].
- [Project directory structure] documents the details of the directory structure created by Cordova CLI.
## Contributing
Cordova is an open source Apache project and contributors are needed to keep this project moving forward. Learn more on
[how to contribute on our website][contribute].
## Reporting Issues
If you find issues with the Cordova CLI, please follow our guidelines for [reporting issues]. Please bear in mind that most of `cordova-cli`'s functionality is implemented in [cordova-lib], so that could be the place to report your issue.
Platform-specific issues should be reported in the relevant repositories, such as [cordova-android] and [cordova-ios].
[Overview of Cordova]: http://cordova.apache.org/docs/en/latest/guide/overview/
[Create your first Cordova app]: http://cordova.apache.org/docs/en/latest/guide/cli/index.html
[Reference docs]: http://cordova.apache.org/docs/en/latest/cordova-cli/index.html
[Supported platforms]: http://cordova.apache.org/docs/en/latest/guide/support/index.html
[Project directory structure]: http://cordova.apache.org/docs/en/latest/cordova-cli/index.html#directory-structure
[Contribute]: http://cordova.apache.org/contribute/
[Reporting issues]: http://cordova.apache.org/contribute/issues.html
[cordova-lib]: https://github.com/apache/cordova-lib
[cordova-android]: https://github.com/apache/cordova-android
[cordova-ios]: https://github.com/apache/cordova-ios

711
spa/node_modules/cordova/RELEASENOTES.md generated vendored Normal file
View File

@@ -0,0 +1,711 @@
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# Cordova-cli Release Notes
### 12.0.0 (May 20, 2023)
**Breaking:**
* [GH-611](https://github.com/apache/cordova-cli/pull/611) feat!(run): call platform api to list targets
* [GH-595](https://github.com/apache/cordova-cli/pull/595) feat!: remove `update-notifier` support
* [GH-615](https://github.com/apache/cordova-cli/pull/615) dep!: bump `cordova-create@5.0.0` & `cordova-lib@12.0.0`
* [GH-613](https://github.com/apache/cordova-cli/pull/613) dep!: bump possible dependencies & set bump node requirement `>=16.13.0`
* `@cordova/eslint-config@^5.0.0`
* `jasmine@^4.6.0`
* `rewire@^6.0.0`
* `cordova-common@5.0.0`
* `fs-extra@11.1.1`
* `nopt@7.1.0`
* `semver@7.5.0`
* `systeminformation@5.17.12`
### 11.1.0 (Jan 11, 2023)
* [GH-603](https://github.com/apache/cordova-cli/pull/603) dep: bump to latest minor+patch w/ `package-lock` rebuild
* `cordova-common@^4.1.0`
* `cordova-create@^4.1.0`
* `cordova-lib@^11.1.0`
* `systeminformation@^5.17.3`
* [GH-599](https://github.com/apache/cordova-cli/pull/599) chore: remove unnecessary gendered text
* [GH-600](https://github.com/apache/cordova-cli/pull/600) ci: update codecov & run on node 14-18
* [GH-587](https://github.com/apache/cordova-cli/pull/587) dep(npm): bump packages to latest minor/patch revisions w/ `package-lock`
### 11.0.0 (Dec 17, 2021)
* [GH-575](https://github.com/apache/cordova-cli/pull/575) chore: rebuilt `package-lock.json`
* [GH-574](https://github.com/apache/cordova-cli/pull/574) dep: bump `@cordova/eslint-config@^4.0.0`
* [GH-573](https://github.com/apache/cordova-cli/pull/573) dep: update `insight` w/ updated code usage
* [GH-572](https://github.com/apache/cordova-cli/pull/572) dep: bump all dependencies
* [GH-570](https://github.com/apache/cordova-cli/pull/570) feat: rebuilt `package-lock.json` w/ v2
* [GH-571](https://github.com/apache/cordova-cli/pull/571) feat!: update node support
* [GH-564](https://github.com/apache/cordova-cli/pull/564) chore: `npmrc`
* [GH-559](https://github.com/apache/cordova-cli/pull/559) docs: remove plugin save command from CLI help
* [GH-550](https://github.com/apache/cordova-cli/pull/550) dep: `systeminformation@^5.5.0`
* [GH-535](https://github.com/apache/cordova-cli/pull/535) chore(pkg): remove deprecated `no-op` field `preferGlobal`
* [GH-534](https://github.com/apache/cordova-cli/pull/534) chore: clean up `package.json`
* [GH-533](https://github.com/apache/cordova-cli/pull/533) (android) Replace deprecated `android` command with `avdmanager`
### 10.0.0 (Jul 31, 2020)
* [GH-521](https://github.com/apache/cordova-cli/pull/521) test: fix node.js version check
* [GH-520](https://github.com/apache/cordova-cli/pull/520) chore: rebuilt `package-lock`
* [GH-519](https://github.com/apache/cordova-cli/pull/519) breaking: bump `cordova-lib@^10.0.0`
* [GH-402](https://github.com/apache/cordova-cli/pull/402) Tiny CLI docs improvements
* [GH-518](https://github.com/apache/cordova-cli/pull/518) feat(ci): migrate to `github-actions`
* [GH-516](https://github.com/apache/cordova-cli/pull/516) chore: drop `node-8` deprecation transition step
* [GH-517](https://github.com/apache/cordova-cli/pull/517) chore: add `package-lock.json`
* [GH-515](https://github.com/apache/cordova-cli/pull/515) chore: improve npm ignore
* [GH-513](https://github.com/apache/cordova-cli/pull/513) breaking: bump dev dependencies
* `mock-stdin@^1.0.0`
* `nyc@^15.1.0`
* `rewire@^5.0.0`
* [GH-514](https://github.com/apache/cordova-cli/pull/514) chore: cleanup `package.json`
* [GH-512](https://github.com/apache/cordova-cli/pull/512) breaking: bump dependencies
* `configstored@^5.0.1`
* `cordova-commond@^4.0.2`
* `cordova-created@^3.0.0`
* `cordova-libd@^9.0.1`
* `execad@^4.0.3`
* `insightd@^0.10.3`
* `loud-rejectiond@^2.2.0`
* `noptd@^4.0.3`
* `semverd@^7.3.2`
* `systeminformationd@^4.26.10`
* `update-notifierd@^4.1.0`
* [GH-511](https://github.com/apache/cordova-cli/pull/511) chore(`eslint`): bump to 3.0.0 w/ fix
* [GH-510](https://github.com/apache/cordova-cli/pull/510) feat: migrate "`cordova info`" lib logic to cli
* chore(asf): update git notification settings
* Update CONTRIBUTING.md
* [GH-495](https://github.com/apache/cordova-cli/pull/495) fix: cannot call `config` or `create` commands
* [GH-494](https://github.com/apache/cordova-cli/pull/494) refactor(`create`): use `cordova-create` 3.0.0-nightly
* [GH-493](https://github.com/apache/cordova-cli/pull/493) refactor: `eslint` setup
* [GH-490](https://github.com/apache/cordova-cli/pull/490) refactor(`create`): do not expand `~` to `$HOME` anymore
* [GH-489](https://github.com/apache/cordova-cli/pull/489) refactor(`create`): depend directly on `cordova-create`
* [GH-485](https://github.com/apache/cordova-cli/pull/485) docs(`config`): remove "`autosave`" setting
* [GH-484](https://github.com/apache/cordova-cli/pull/484) test(`config`): use generic config key name
* [GH-483](https://github.com/apache/cordova-cli/pull/483) refactor: remove dead code & simplify
* [GH-486](https://github.com/apache/cordova-cli/pull/486) docs: undocument "`plugin save`" command
* [GH-488](https://github.com/apache/cordova-cli/pull/488) docs: remove mentions of "`cordova create`" argument "config"
* [GH-487](https://github.com/apache/cordova-cli/pull/487) docs(`info`): remove outdated remark about `info.txt`
* [GH-482](https://github.com/apache/cordova-cli/pull/482) docs: undocument "`platform save`", again
* [GH-475](https://github.com/apache/cordova-cli/pull/475) refactor: Remove support for `<project>/.cordova/config.json`
* [GH-468](https://github.com/apache/cordova-cli/pull/468) docs: undocument "`hooks/`" directory
* [GH-467](https://github.com/apache/cordova-cli/pull/467) docs: undocument "`platform check`" command
* [GH-481](https://github.com/apache/cordova-cli/pull/481) chore: update `jasmine` dependencies
* [GH-480](https://github.com/apache/cordova-cli/pull/480) chore: drop node 6 and 8 support
* [GH-479](https://github.com/apache/cordova-cli/pull/479) chore: bump version to 10.0.0-dev
* [GH-477](https://github.com/apache/cordova-cli/pull/477) Avoid registering too many event listeners in tests
* [GH-476](https://github.com/apache/cordova-cli/pull/476) Undocument removed `platform save` command
* [GH-473](https://github.com/apache/cordova-cli/pull/473) Fix blocked `telemetry` calls
* [GH-472](https://github.com/apache/cordova-cli/pull/472) fix: argument filtering in `telemetry.track`
* [GH-474](https://github.com/apache/cordova-cli/pull/474) Remove unsupported option `--copy-from`
* [GH-458](https://github.com/apache/cordova-cli/pull/458) chore: node deprecation warning for <10
* [GH-471](https://github.com/apache/cordova-cli/pull/471) Add unit tests for the telemetry module
* [GH-469](https://github.com/apache/cordova-cli/pull/469) Use `semver` to check if using a prerelease version
* [GH-470](https://github.com/apache/cordova-cli/pull/470) chore: add codecov to display coverage in GH
* [GH-459](https://github.com/apache/cordova-cli/pull/459) chore: replace `istanbul` with `nyc`
* [GH-427](https://github.com/apache/cordova-cli/pull/427) Minor fixes in `README`
* [GH-454](https://github.com/apache/cordova-cli/pull/454) chore: node warning on version < 8
* [GH-430](https://github.com/apache/cordova-cli/pull/430) chore: add Node.js 12 to CI services
* [GH-440](https://github.com/apache/cordova-cli/pull/440) docs(readme): remove duplicated instructions
* [GH-433](https://github.com/apache/cordova-cli/pull/433) Updated the Supported Platforms
* [GH-426](https://github.com/apache/cordova-cli/pull/426) Handle output error strings
* [GH-423](https://github.com/apache/cordova-cli/pull/423) Cleaner solution to spy on latest CordovaLogger
* [GH-421](https://github.com/apache/cordova-cli/pull/421) Fix `cordova config list` command
* [GH-419](https://github.com/apache/cordova-cli/pull/419) Fix `cordova config list` command recognition
* [GH-365](https://github.com/apache/cordova-cli/pull/365) Start requirements unit testing
### 9.0.0 (Mar 20, 2019)
* [GH-414](https://github.com/apache/cordova-cli/pull/414) Cordova CLI Release Preparation (Cordova 9)
* **Bumped Dependencies**
* `cordova-lib@^9.0.0`
* `cordova-common@^3.1.0`
* `editor@^1.0.0` (Prepended `^` only)
* `loud-rejection@^2.0.0`
* **Bumped Dev Dependencies**
* `jasmine@^3.3.1`
* `eslint-plugin-promise@^4.0.1`
* `eslint-plugin-node@^8.0.1`
* `eslint-plugin-import@^2.16.0`
* `eslint-config-standard@^12.0.0`
* `eslint-config-semistandard@^13.0.0`
* `eslint@^5.15.2`
* Fix `logger[level]` spy in Jasmine
* [GH-397](https://github.com/apache/cordova-cli/pull/397) Update Node.js Deprecation Notice Message
* Add or update GitHub pull request and issue template
* [GH-395](https://github.com/apache/cordova-cli/pull/395) Fix typo: "esecially" to especially
* [GH-364](https://github.com/apache/cordova-cli/pull/364) Fix spec label for build tests
* [GH-344](https://github.com/apache/cordova-cli/pull/344) Check that `bin/cordova` works on Travis CI
* [CB-13740](https://issues.apache.org/jira/browse/CB-13740) gracefully handle platforms that don't pass back requirements to check
* [GH-327](https://github.com/apache/cordova-cli/pull/327) Stub telemetry calls during all tests
* [GH-322](https://github.com/apache/cordova-cli/pull/322) Remove support for `fetch` option
* [GH-321](https://github.com/apache/cordova-cli/pull/321) Remove support for `browserify`
* [GH-317](https://github.com/apache/cordova-cli/pull/317) cli.spec: Telemetry-Related Improvements
* [GH-316](https://github.com/apache/cordova-cli/pull/316) Remove `callback` parameter of main CLI function
* [GH-298](https://github.com/apache/cordova-cli/pull/298) Remove support for deprecated `--copy-from`
* [GH-298](https://github.com/apache/cordova-cli/pull/298) Cleanup code calling `cordova-create`
### 8.1.1 (Sep 27, 2018)
* [GH-339](https://github.com/apache/cordova-cli/issues/339) Fix bin/cordova on Node.js 4
* [GH-337](https://github.com/apache/cordova-cli/issues/337) Revert messing with transitive dependencies in `npm-shrinkwrap.json` (re-introduces a _low-severity_ `npm audit` warning)
### 8.1.0 (Sep 24, 2018)
* README.md fixes
* [GH-295](https://github.com/apache/cordova-cli/pull/GH-295) Proper error code and message when failing
* [GH-296](https://github.com/apache/cordova-cli/pull/GH-296) Remove leftover makeshift benchmarking code
* [GH-296](https://github.com/apache/cordova-cli/pull/GH-296) Use multi-line comment for license headers
* [CB-13772](https://issues.apache.org/jira/browse/CB-13772) print version numbers correctly in cordova requirements [GH-291](https://github.com/apache/cordova-cli/pull/291)
* [GH-307](https://github.com/apache/cordova-cli/pull/GH-307) Remove outdated docs translations
* [GH-306](https://github.com/apache/cordova-cli/pull/GH-306) Remove mentions of 'cordova plugin search' from docs
* [GH-312](https://github.com/apache/cordova-cli/pull/GH-312) Update ESLint and fix linting errors
* [GH-312](https://github.com/apache/cordova-cli/pull/GH-312) Update dependencies
* [GH-300](https://github.com/apache/cordova-cli/issues/300) Update `insight` to resolve `npm audit` warning
### 8.0.0 (Dec 14, 2017)
* [CB-13055](https://issues.apache.org/jira/browse/CB-13055): removed `--nofetch` flag
* Use native Promises instead of `Q`
* [CB-12853](https://issues.apache.org/jira/browse/CB-12853): re-check version before notifying.
* [CB-13501](https://issues.apache.org/jira/browse/CB-13501): updated to include node 8 to tests
### 7.1.0 (Oct 04, 2017)
* [CB-13303](https://issues.apache.org/jira/browse/CB-13303) added `--noprod` and `--production` flags as options, `--noprod` turns off our auto adding of `--production` flag
* [CB-13353](https://issues.apache.org/jira/browse/CB-13353) added `--save-exact` flag to cli and unit test
* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) Added `eslint` and removed `jshint`
* [CB-12862](https://issues.apache.org/jira/browse/CB-12862) Added `searchpath` as a config option
* [CB-12762](https://issues.apache.org/jira/browse/CB-12762) point `package.json` repo items to github mirrors instead of apache repos site
* [CB-12693](https://issues.apache.org/jira/browse/CB-12693) Included examples for `Browserify`, `fetch`, and `autosave` and include options with a more detailed description.
* [CB-12901](https://issues.apache.org/jira/browse/CB-12901) removed `.raw` from `cordova-lib` calls
### 7.0.1 (May 08, 2017)
* [CB-12769](https://issues.apache.org/jira/browse/CB-12769): Updated `cordova-lib` dependency to 7.0.1.
### 7.0.0 (May 02, 2017)
* [CB-12570](https://issues.apache.org/jira/browse/CB-12570): `cordova-fetch` is true by default. Use `--nofetch` flag to fetch platforms and plugins using old fetching logic.
* [CB-12665](https://issues.apache.org/jira/browse/CB-12665): removed `engineStrict` as it is no longer supported
* [CB-11982](https://issues.apache.org/jira/browse/CB-11982): added `edit` and `ls` to `cordova config`
* [CB-11982](https://issues.apache.org/jira/browse/CB-11982): added new `cordova config` command that `sets`, `gets`, and `deletes` global enviroment variables.
* [CB-12008](https://issues.apache.org/jira/browse/CB-12008): updated docs to reflect new autosave changes and removed variables missed due to rebase
* [CB-12008](https://issues.apache.org/jira/browse/CB-12008): made autosave the default for platform and plugin add/remove
* [CB-11977](https://issues.apache.org/jira/browse/CB-11977): removed support for `node 0.x`
### 6.5.0 (Jan 17, 2017)
* [CB-12018](https://issues.apache.org/jira/browse/CB-12018) : updated tests to function with `jasmine` instead of `jasmine-node`
### 6.4.0 (Oct 21, 2016)
* [CB-12039](https://issues.apache.org/jira/browse/CB-12039) updated `cordova-lib` to `6.4.0`
* [CB-11976](https://issues.apache.org/jira/browse/CB-11976) Updated `package.json` engine key
* [CB-11976](https://issues.apache.org/jira/browse/CB-11976) Add deprecated node version warning for 0.x
* Add github pull request template
* [CB-11607](https://issues.apache.org/jira/browse/CB-11607) breakout `cordova-create` from `cordova-lib`
* [CB-11623](https://issues.apache.org/jira/browse/CB-11623) added back linking
* Document cli - cordova plugin save
* [CB-11023](https://issues.apache.org/jira/browse/CB-11023) Add doc for conflicting plugins
### 6.3.1 (Aug 09, 2016)
* [CB-11685](https://issues.apache.org/jira/browse/CB-11685) Updated cordova-lib dependency to 6.3.1
### 6.3.0 (Jul 12, 2016)
* [CB-11412](https://issues.apache.org/jira/browse/CB-11412) removed link-to, aliased copy-from to template
* [CB-11349](https://issues.apache.org/jira/browse/CB-11349) passing --fetch to create
* [CB-11284](https://issues.apache.org/jira/browse/CB-11284) Telemetry: Track platforms/plugins subcommands(add/rm/etc...)
* [CB-11262](https://issues.apache.org/jira/browse/CB-11262) Add a warning about prerelease lib/cli usage
* [CB-11263](https://issues.apache.org/jira/browse/CB-11263) 'cordova telemetry help' should display help text
### 6.2.0 (May 12, 2016)
* [Telemetry](https://github.com/apache/cordova-cli/pull/247) Added telemetry to cordova-cli to collect data for data driven development
* [CB-11250](https://issues.apache.org/jira/browse/CB-11250) Fix CLI tests verifying the version
* [CB-9858](https://issues.apache.org/jira/browse/CB-9858) added `--fetch` option
* [CB-10986](https://issues.apache.org/jira/browse/CB-10986) Adding note about scoped npm packages for plugins
* [CB-11042](https://issues.apache.org/jira/browse/CB-11042) Add cordova run option to skip prepare
* [CB-10062](https://issues.apache.org/jira/browse/CB-10062) Error: `EACCES: permission denied - update-notifier-cordova.json`
* [CB-10679](https://issues.apache.org/jira/browse/CB-10679) Documenting how the CLI chooses plugin versions
### 6.1.1 (Mar 29, 2016)
* [CB-10980](https://issues.apache.org/jira/browse/CB-10980) Updated cordova-lib dependency to 6.1.1
### 6.1.0 (Mar 17, 2016)
* [CB-10902](https://issues.apache.org/jira/browse/CB-10902) Updated cordova-lib dependency to 6.1.0
* Simplify cordova CLI readme
* [CB-10860](https://issues.apache.org/jira/browse/CB-10860) avoid node complaining of too many event listener added when running tests
* Fix readme.md - directory structure
* [CB-10673](https://issues.apache.org/jira/browse/CB-10673) add `plugin add --force` option.
* Add Travis CI badge
* Specify valid `SPDX` license in `package.json`
* [CB-10748](https://issues.apache.org/jira/browse/CB-10748) Use `cordova-common.CordovaLogger` in CLI
* Adding and fixing some whitespace in CLI docs.
* [CB-10348](https://issues.apache.org/jira/browse/CB-10348) Update formatting of CLI reference readme
* [CB-10348](https://issues.apache.org/jira/browse/CB-10348) CLI reference readme
* [CB-10482](https://issues.apache.org/jira/browse/CB-10482) Remove references to **windows8** from cordova-lib/cli
* [CB-10348](https://issues.apache.org/jira/browse/CB-10348) CLI doc output tweaks
* Update help docs - add examples and make them consistent
### 6.0.0 (Jan 25, 2016)
* [CB-10424](https://issues.apache.org/jira/browse/CB-10424) Updated cordova-lib dependency to 6.0.0
* Remove browserify from experimental flags list
* [CB-8455](https://issues.apache.org/jira/browse/CB-8455) Added `--nohooks` option.
* [CB-9964](https://issues.apache.org/jira/browse/CB-9964) Added `--template` support to `cordova create`
* Removing the `--usegit` flag from `cordova platform`. Recommended method is to use `cordova platform add git_url#branch`
* [CB-9836](https://issues.apache.org/jira/browse/CB-9836) Add `.gitattributes` to prevent `CRLF` line endings in repos
* Message about deprecating **amazon-fireos** for **Fire OS 5.0+** devices. 2015 onwards **FireOS** devices should use **android** platform only.
* add **JIRA** issue tracker link.
### 5.4.1 (Nov 19, 2015)
* [CB-10049](https://issues.apache.org/jira/browse/CB-10049) updated cordova-lib dependency to 5.4.1
### 5.4.0 (Oct 30, 2015)
* [CB-9903](https://issues.apache.org/jira/browse/CB-9903) update cordova-lib dependency to 5.4.0
* [CB-9861](https://issues.apache.org/jira/browse/CB-9861) fixed failing tests
* [CB-9800](https://issues.apache.org/jira/browse/CB-9800) Fixing contribute link.
* [CB-9792](https://issues.apache.org/jira/browse/CB-9792) Make CLI logging system interrupt process on an error event
* [CB-9788](https://issues.apache.org/jira/browse/CB-9788) Add support of stderr/stdout split to CLI logger
* [CB-9784](https://issues.apache.org/jira/browse/CB-9784) Remove CLI logger levels prefixes
* [CB-8198](https://issues.apache.org/jira/browse/CB-8198) Unified console output logic for core platforms
* [CB-9523](https://issues.apache.org/jira/browse/CB-9523) Show out of date message for older cordova CLI
* [CB-9597](https://issues.apache.org/jira/browse/CB-9597) Updates cli to pass structured args to platform methods
### 5.3.1 (Aug 28, 2015)
* Updated cordova-lib dependency to 5.3.1
### 5.2.0 (Aug 06, 2015)
* docs: unify expression of Amazon Fire OS
* docs: delete duplicated Windows Phone SDK description
* [CB-9114](https://issues.apache.org/jira/browse/CB-9114): Deprecation Warning for --usegit flag. This closes #214
* Adding .ratignore file.
* [CB-9171](https://issues.apache.org/jira/browse/CB-9171) Support Plugin Variables with =
* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-cli documentation translation: cordova-cli
* [CB-5578](https://issues.apache.org/jira/browse/CB-5578) Adds `clean` command to cordova-cli.
* [CB-8993](https://issues.apache.org/jira/browse/CB-8993) Plugin restore ignores search path. This closes #213
* [CB-9121](https://issues.apache.org/jira/browse/CB-9121) Add support for build configuration to be specified using the CLI
* [CB-8898](https://issues.apache.org/jira/browse/CB-8898) Adds missing section about `requirements` to general cordova help
### 5.1.1 (June 4, 2015)
* [CB-8898](https://issues.apache.org/jira/browse/CB-8898) Adds missing section about `requirements` to general cordova help
* [CB-8898](https://issues.apache.org/jira/browse/CB-8898) Introduces `cordova requirements` command
* Updated cordova-lib dependency to 5.1.1
### 5.0.0 (Apr 16, 2015)
* Add information on Firefox OS to the README
* Update link to hooks README
* [CB-8634](https://issues.apache.org/jira/browse/CB-8634) Adds docs about support for custom branches for `cordova platform add`
### 4.3.0 (Feb 27, 2015)
* docs update for plugin --save
* Grunt "retire" task added (close #204)
* [CB-8439](https://issues.apache.org/jira/browse/CB-8439) Fix 'cordova platform update' documentation to include `<plat-spec>` (close #208)
* [CB-8379](https://issues.apache.org/jira/browse/CB-8379) Have --version print out cordova-lib version if it's not the same as CLI's version
* [CB-8211](https://issues.apache.org/jira/browse/CB-8211), [CB-8358](https://issues.apache.org/jira/browse/CB-8358) Update `--link` help text
* [CB-8168](https://issues.apache.org/jira/browse/CB-8168) --list support for CLI (close #205)
* [CB-8314](https://issues.apache.org/jira/browse/CB-8314) Speed up Travis CI (close #207)
* [CB-8301](https://issues.apache.org/jira/browse/CB-8301) Added CI configuration files (close #206)
* [CB-8227](https://issues.apache.org/jira/browse/CB-8227) [CB-8237](https://issues.apache.org/jira/browse/CB-8237) [CB-8238](https://issues.apache.org/jira/browse/CB-8238) Add --save option to 'cordova platform add', 'cordova platform remove' and 'cordova platform update'
* Add coverage/ to .npmignore
* [CB-5316](https://issues.apache.org/jira/browse/CB-5316) Spell Cordova as a brand unless it's a command or script
* [CB-7950](https://issues.apache.org/jira/browse/CB-7950) CLI make CordovaCliCreate.prototype.run vaguely correct
* [CB-7739](https://issues.apache.org/jira/browse/CB-7739) document installing specific version of platforms
* [CB-7950](https://issues.apache.org/jira/browse/CB-7950) CLI create.js misspells parseConfig
### 4.2.0 (Jan 06, 2015)
* [CB-6756](https://issues.apache.org/jira/browse/CB-6756) use cordova_lib.binname instead of cordova
* Fixed jshint issues with cli.js (close #199)
* [CB-8211](https://issues.apache.org/jira/browse/CB-8211) Add --link option to `cordova plugin add` (close #191)
* [CB-8129](https://issues.apache.org/jira/browse/CB-8129) Adds 'npm run cover' command to generate tests coverage report
* searchpath option is added to restore
### 4.1.2 (Nov 13, 2014)
* Expose cordova-lib and the cli from cordova-cli
* [CB-7636](https://issues.apache.org/jira/browse/CB-7636) Allow using --nobuild flag without screaning
### 4.0.0 (Oct 10, 2014)
* Made version semver complient and bumped to 4.0.0
* Pinned dependencies
* added missing AL header
### 3.6.1-0.2.13
* update shrinkwrap
### 3.6.1-0.2.12
* [CB-7383](https://issues.apache.org/jira/browse/CB-7383) depend on a newer version of cordova-lib
### 3.6.1-0.2.11
* bump version to 3.6.3-0.2.11
### 3.6.1-0.2.10 (Sep 05, 2014)
* updated Release notes
* updated version to include dev prefix
### 3.6.0-0.2.8 (Aug 29, 2014)
* adds missing 'fs' reference required for Windows (ln191)
* [CB-7355](https://issues.apache.org/jira/browse/CB-7355) re added single test to test call through to cordova-lib cordova raw create
* [CB-7364](https://issues.apache.org/jira/browse/CB-7364) remove duplicate logging initialization for cordova/plugman
* [CB-7363](https://issues.apache.org/jira/browse/CB-7363) Do not insist on precise version of cordova-lib
* [CB-7355](https://issues.apache.org/jira/browse/CB-7355) removed create tests which test behaviour of downstream dependencies
* [CB-7358](https://issues.apache.org/jira/browse/CB-7358) cli spec mocks console log to avoid polluting test output while testing
* [CB-7347](https://issues.apache.org/jira/browse/CB-7347) document cordova platform add /path/to support
* [CB-7345](https://issues.apache.org/jira/browse/CB-7345) add tests to validate documentation
* [CB-7345](https://issues.apache.org/jira/browse/CB-7345) improve cli documentation
* [] refactored test to make use of jasmine's 'toThrow' expectation
* correct object referenced in tests
* proper order of initializers, which indicates a bigger problem
* removed merge conflict
* moved custom www handling code to a separate function
* basic tests and structure added to create spec
* renamed cli create spec more sensibly
* parse config json moved to a function
* functional refactor of create with expected input from caller implemented
* updated tests and cli to pass all tests
* tracking cli create spec
* inital commit of cli create command logic in its own file
* added verbose mode initialization to set up event handlers
* created init function to handle initalization of underscore and nopt
* Fixed the tests
* Added browserify option "download_opts"
* [CB-7260](https://issues.apache.org/jira/browse/CB-7260) use newer cordova-lib to get cordova-android 3.5.1, bump version num
* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-cli documentation translation: cordova-cli
* [CB-7001](https://issues.apache.org/jira/browse/CB-7001) moved browserify help docs to proper locations
* [CB-7001](https://issues.apache.org/jira/browse/CB-7001) added browserify to cordova.txt help doc
* [CB-6024](https://issues.apache.org/jira/browse/CB-6024) Document -- for platform options
* Added browserify flag to cli options
* checking for browserify flag
* [CB-7220](https://issues.apache.org/jira/browse/CB-7220) Support cordova_lib.binname
* [CB-7220](https://issues.apache.org/jira/browse/CB-7220) Split cordova help into per feature help files
* [CB-6756](https://issues.apache.org/jira/browse/CB-6756) Adds the platforms subcommand for save and restore
* [CB-7100](https://issues.apache.org/jira/browse/CB-7100): Use npm based lazy-load by default
* [CB-6127](https://issues.apache.org/jira/browse/CB-6127)lisa7cordova-plugin-consolecordova-cli documentation translation: cordova-cli
* Call process.removeAllListeners() in cli spec
* Add --captureExceptions flag to jasmine
* Pin jasmine to older version temporarily
* Fix [CB-7069](https://issues.apache.org/jira/browse/CB-7069) copy-from & link-to custom uri -> url
* [CB-7002](https://issues.apache.org/jira/browse/CB-7002) Incremented package version to -dev
### 3.5.0-0.2.6 ()
* [CB-6976](https://issues.apache.org/jira/browse/CB-6976) Add support for Windows Universal apps (Windows 8.1 and WP 8.1)
* [CB-6728](https://issues.apache.org/jira/browse/CB-6728): Support chip architecture flag --archs
* [CB-6954](https://issues.apache.org/jira/browse/CB-6954): Use the unified cordova_lib.events
* [CB-6740](https://issues.apache.org/jira/browse/CB-6740): [amazon-fireos]Clean up error reporting when AmazonWebView SDK not found
* [CB-6943](https://issues.apache.org/jira/browse/CB-6943) Path can include the : if it is absolute, only test for http. Added tests
* Show full stack for CordovaError in verbose mode
* [CB-6024](https://issues.apache.org/jira/browse/CB-6024): Use nopt instead of optimist in cli
* [CB-6859](https://issues.apache.org/jira/browse/CB-6859) remove wp7 as platform
* Add --usenpm flag to activate npm based lazy_load
* [CB-6767](https://issues.apache.org/jira/browse/CB-6767) Allow `cordova` to be replacable in error messages
* CLI implementation & docs for the save and restore plugins
* Add --noregstry flag for disabling plugin lookup in the registry
### 3.5.0-0.2.4 (May 14, 2014)
* [CB-5941](https://issues.apache.org/jira/browse/CB-5941) Update link to hooks-README.md file from README.md
* Fix cordova help
* Fixing failing CLI tests by removing 'experimental' key
### 3.5.0-0.2.0 (May 09, 2014)
* [CB-6649](https://issues.apache.org/jira/browse/CB-6649) Removing experimental flag from positional arguments
* [CB-6648](https://issues.apache.org/jira/browse/CB-6648) Adding a flag for experimental features
* Fix require paths to use cordova-lib
* Update package.json to use cordova-lib
* Split out cordova-lib: move cordova-cli files
* [Windows8] re-added BOM : [CB-5421](https://issues.apache.org/jira/browse/CB-5421) Add BOM to all html, js, css files to ensure app can pass Windows Store Certification
* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
* Adding support for privileged
* Merge pull request #4 from rodms10/autoPermission
* android-parser: Add AndroidLaunchMode preference
* Fix CLI tests to work with node v0.11
* Update version of jasmine-node. Fixes test warnings util.print with node 0.11
* [CB-2606](https://issues.apache.org/jira/browse/CB-2606) Andriod icon - do not attempt copy to undefined path
* [CB-2606](https://issues.apache.org/jira/browse/CB-2606) Icons support for iOS, Android, BB10, WP8, Win8, FxOS
* [CB-6329](https://issues.apache.org/jira/browse/CB-6329) Delete unused info-utils.js
* [CB-6329](https://issues.apache.org/jira/browse/CB-6329) Clean-up of cordova info changes previously merged.
* [CB-6329](https://issues.apache.org/jira/browse/CB-6329) improve 'cordova info' command
* [CB-5847](https://issues.apache.org/jira/browse/CB-5847) strictSSL is no longer ignored
* [CB-6432](https://issues.apache.org/jira/browse/CB-6432) pre_package hook does not populate %CORDOVA_PLATFORMS%
* Revert "CB-6267 Windows8. Apply BackgroundColor from config.xml"
* Recreate "platforms" dir if it was deleted.
* [CB-5093](https://issues.apache.org/jira/browse/CB-5093): Add versionCode and CFBundleVersion during prepare
* [CB-6312](https://issues.apache.org/jira/browse/CB-6312) Use "landscape" instead of "userLandscape" in AndroidManifest.xml
* [CB-6421](https://issues.apache.org/jira/browse/CB-6421): Move tests from e2e to spec - cli test
* [CB-6377](https://issues.apache.org/jira/browse/CB-6377) superspawn: always wrap non .exe with spaces to cmd with /s /c
### 3.4.1-0.1.0 (Apr 03, 2014)
* updated to use iOS 3.4.1
* [CB-6377](https://issues.apache.org/jira/browse/CB-6377) Fix up superspawn's cmd fallback when there is a space in the args
* [CB-6377](https://issues.apache.org/jira/browse/CB-6377) Remove windowsVerbatimArguments from superspawn
* [CB-6344](https://issues.apache.org/jira/browse/CB-6344) Fix spy to return a default platform JSON instead of an empty object
* [CB-6382](https://issues.apache.org/jira/browse/CB-6382) platform list: sort output
* [CB-6377](https://issues.apache.org/jira/browse/CB-6377) Handle spaces in paths for cmd related scripts
* [CB-6292](https://issues.apache.org/jira/browse/CB-6292) Add a callback-based API for cordova info (in addition to promise API)
* [CB-6292](https://issues.apache.org/jira/browse/CB-6292) Revert commits that add explicit callbacks to APIs
* [CB-6322](https://issues.apache.org/jira/browse/CB-6322) Simplify platforms/platform code for platform specifics
* README.md: Getting Started guides link was broke. Fix.
* Make "cmd" executed more readable.
* [CB-6141](https://issues.apache.org/jira/browse/CB-6141) Fix Windows 8 tests
* Use smarter BOM-skipping logic when parsing XML.
* [CB-6357](https://issues.apache.org/jira/browse/CB-6357) platform check - install each platform to determine working + version number
* [CB-6357](https://issues.apache.org/jira/browse/CB-6357) platform: provide exports for functions
* [CB-6357](https://issues.apache.org/jira/browse/CB-6357) platform: Refactor into distinct functions
* [CB-6338](https://issues.apache.org/jira/browse/CB-6338) Improve error for missing template
* [CB-6337](https://issues.apache.org/jira/browse/CB-6337) Print nice error when cordova-cli hits various expected things
* This closes #147
* [CB-6267](https://issues.apache.org/jira/browse/CB-6267) Windows8. Apply BackgroundColor from config.xml
* [CB-6338](https://issues.apache.org/jira/browse/CB-6338) Improve error for missing template
* [CB-6030](https://issues.apache.org/jira/browse/CB-6030) - Automatically increment port for serve when default is in use
* [CB-6337](https://issues.apache.org/jira/browse/CB-6337) Print nice error when cordova-cli hits various expected things
* [CB-6323](https://issues.apache.org/jira/browse/CB-6323) Fix harmless typo in superspawn (cmd -> c)
* [CB-6323](https://issues.apache.org/jira/browse/CB-6323) Fix superspawn's resolve function on windows (was very broken)
* [CB-6306](https://issues.apache.org/jira/browse/CB-6306) Error creating project when path to project includes spaces
* Tweak error message when hooks fail (wasn't showing correct command)
* [CB-6296](https://issues.apache.org/jira/browse/CB-6296) callback/promise interface implemented
* [CB-6293](https://issues.apache.org/jira/browse/CB-6293) additional tests for run command
* [CB-6292](https://issues.apache.org/jira/browse/CB-6292) tests for build function's dual return method
* updated jasmine dependency for timing
* [CB-6211](https://issues.apache.org/jira/browse/CB-6211) 'cordova info' command fixed for Windows platform
* Fix prepare command from hiding failures.
* Fix ConfigParser.getPreference error + tests
* [CB-6209](https://issues.apache.org/jira/browse/CB-6209) Uplevel changes from android_parser to amazon_fireos_parser Added orientation related config changes from android_parser.
* [CB-6147](https://issues.apache.org/jira/browse/CB-6147) Enable CLI and Plugman with npm shrinkwrap
* When searchpath is specified in config and CLI, merge them.
* Add --searchpath to help.txt
* Fix node-style-callbacks form of the CLI api not passing through results.
### 3.4.0-0.1.3 (Mar 3, 2014)
* Update to plugman v0.20.2
### 3.4.0-0.1.2 (Feb 28, 2014)
* Update to plugman v0.20.1
### 3.4.0-0.1.1 (Feb 26, 2014)
* Update to plugman v0.20.0
* [CB-5647](https://issues.apache.org/jira/browse/CB-5647) Remove concept of .staging dir. Install directly to www/
* [CB-5299](https://issues.apache.org/jira/browse/CB-5299) Speed up prepare by using plugman's new reapply_global_munge()
* Refactored config_parser.js to simply both it and its tests.
* [CB-6076](https://issues.apache.org/jira/browse/CB-6076) Make "Generating config.xml from defaults" a verbose log
* [CB-5181](https://issues.apache.org/jira/browse/CB-5181) Use spawn helper for all sub-shelling.
* [CB-6049](https://issues.apache.org/jira/browse/CB-6049), [CB-5181](https://issues.apache.org/jira/browse/CB-5181) Enable stdio for build sub-commands and hooks
## 3.4.0-0.1.0 (Feb 14, 2014)
* [CB-5638](https://issues.apache.org/jira/browse/CB-5638) Clean-up: remove unreachable info case from function
* [CB-5937](https://issues.apache.org/jira/browse/CB-5937) Add "platform check" command: Shows platforms that are out of date
* [CB-5634](https://issues.apache.org/jira/browse/CB-5634) Minor refactoring + tests for Android's orientation preference.
* [CB-5634](https://issues.apache.org/jira/browse/CB-5634) Set Android orientation from config.xml
* Upleveled amazon_fireos_parser. Making it at par with android_parser.js
* [CB-5947](https://issues.apache.org/jira/browse/CB-5947) Throw when trying to create project inside custom www.
* [CB-4153](https://issues.apache.org/jira/browse/CB-4153) Update help.txt about --source -> --copy-from
## 3.3.1-0.3.1 (Jan 31, 2014)
* [CB-4153](https://issues.apache.org/jira/browse/CB-4153) Rename --source and --link flags to --copy-from and --link-to
## 3.3.1-0.3.0 (Jan 30, 2014)
* Updated plugman dependency to 0.19.0
* [CB-5913](https://issues.apache.org/jira/browse/CB-5913) Fail more gracefully on Windows when symlinks fail.
* Fix isWindows check in util.js to support win64
* [CB-5907](https://issues.apache.org/jira/browse/CB-5907) Make `cordova update` get version from platform's version script
* [CB-3612](https://issues.apache.org/jira/browse/CB-3612) Don't pass --device to "run" command by default.
* [CB-5493](https://issues.apache.org/jira/browse/CB-5493) lazy_load now downloads to a temp dir and then moves.
* [CB-5782](https://issues.apache.org/jira/browse/CB-5782) Hide stack trace for explicitly handled error conditions
* [CB-5590](https://issues.apache.org/jira/browse/CB-5590) Have config.xml version map to CFBundleShortVersionString instead of CFBundleVersion
* [CB-5299](https://issues.apache.org/jira/browse/CB-5299) Cache pbxproj to avoid re-parsing it for each plugin.
* [CB-5813](https://issues.apache.org/jira/browse/CB-5813) Fix missing quotes on update and ls commands
* [CB-5808](https://issues.apache.org/jira/browse/CB-5808) Fix lazy_load stripping off windows drive letters
* Expose util.isCordova as cordova.findProjectRoot()
* Allow lazy_load libs to work without an id and version for local paths.
* Add an option to config.js to not write config.json during create.
* Update node-xcode dependency to 0.6.6
## 3.3.1-0.2.0 (Jan 15, 2014)
* [CB-5006](https://issues.apache.org/jira/browse/CB-5006) Add --searchpath to "plugin add" so that installing by ID will search local paths before hitting the registry.
* [CB-4153](https://issues.apache.org/jira/browse/CB-4153) Add --src & --link to cordova create.
* [CB-5687](https://issues.apache.org/jira/browse/CB-5687) Make cordova commands work when CWD is inside of a symlink'ed www/
* [CB-4910](https://issues.apache.org/jira/browse/CB-4910) Default config.xml to the root instead of within www/
* [CB-5764](https://issues.apache.org/jira/browse/CB-5764) Move hooks/ to top-level instead of under .cordova
* [CB-5763](https://issues.apache.org/jira/browse/CB-5763) Don't create .cordova/ by default
* [CB-4871](https://issues.apache.org/jira/browse/CB-4871) Reduced package size significantly.
* [CB-4976](https://issues.apache.org/jira/browse/CB-4976) Don't use ~/.cordova/lib for local directory
* [CB-5777](https://issues.apache.org/jira/browse/CB-5777) Fix "platform update" not updating cordova.js
* [CB-5728](https://issues.apache.org/jira/browse/CB-5728) Files in merges must remain intact when removing platform
## 3.3.0-0.1.0
* [CB-5347](https://issues.apache.org/jira/browse/CB-5347) Handle dangling platform symlink in cordova platform add
* Added deprecation notice about wp7
* updated plugman version to 0.17.0
* [CB-5573](https://issues.apache.org/jira/browse/CB-5573) relies on stderr content and error codes to detect a problem with xcode installation.
* [CB-4382](https://issues.apache.org/jira/browse/CB-4382) Pass cli arguments to project-level hooks
* [CB-5362](https://issues.apache.org/jira/browse/CB-5362) blackberry parser: support local cordova-blackberry
* [CB-5345](https://issues.apache.org/jira/browse/CB-5345) Add pre_package event for windows8 parser.
## 3.2.0-0.4.0
* Make sure errors during prepare are reported
* [CB-5031](https://issues.apache.org/jira/browse/CB-5031) Add CLI help text for platform update and plugin search
* [CB-5298](https://issues.apache.org/jira/browse/CB-5298) Remove redundant requirements check for iOS and Android. The bin/create scripts check.
* windows8. fixes version number parsing logic
* [CB-4472](https://issues.apache.org/jira/browse/CB-4472) Remove preference from template config.xml
## 3.2.0-0.3.0
* [CB-5501](https://issues.apache.org/jira/browse/CB-5501) fix blackberry10 platform
* [android] fixing failing android parser spec tests
* [android] call out to platform check_req script
## 3.2.0-0.2.0
* [CB-5485](https://issues.apache.org/jira/browse/CB-5485) fixed issue with use of cordova cli api
## 3.2.0-0.1.0
* add the output of the plugman results to the console
* [CB-5363](https://issues.apache.org/jira/browse/CB-5363) Improve config_json error reporting
* [CB-5364](https://issues.apache.org/jira/browse/CB-5364) config_parser - check for null element text
* Fix issue not finding platform script when in subdir - check platforms which have subdir
* [CB-5377](https://issues.apache.org/jira/browse/CB-5377) serve: should only indicate listening when it is
* [CB-5368](https://issues.apache.org/jira/browse/CB-5368) Cordova serve deflate content breaks IE
* Change cordova serve's project.json to include etags.
* [CB-5280](https://issues.apache.org/jira/browse/CB-5280) Update serve's help text to remove platform arguments
* [CB-5364](https://issues.apache.org/jira/browse/CB-5364) config_parser - handle duplicates with children and text when merging
* [CB-5320](https://issues.apache.org/jira/browse/CB-5320) Document avoiding sudo
* [CB-4400](https://issues.apache.org/jira/browse/CB-4400): cd to project root in most cordova commands.
* [CB-5063](https://issues.apache.org/jira/browse/CB-5063): Revert to copying cordova.js before user www dir
* fix 3 failing tests for windows8 and wp8 and add assertions for wp7 too.
* Adding instructions for installing on master.
* [CB-5063](https://issues.apache.org/jira/browse/CB-5063): Keep cordova.js in platform_www to avoid copying it from lib.
* [CB-5307](https://issues.apache.org/jira/browse/CB-5307): Remove references to Callback and Incubator
* tests were failing attempting to match lib/dir and lib\\dir on windows
* [CB-5183](https://issues.apache.org/jira/browse/CB-5183) WP7/8 lib path is not correctly resolved by CLI (additional changes)
* [CB-5283](https://issues.apache.org/jira/browse/CB-5283) Improved cordova serve message to be more descriptive
* [CB-4866](https://issues.apache.org/jira/browse/CB-4866) Execute hooks in ascending order of any leading numbers
* [CB-5143](https://issues.apache.org/jira/browse/CB-5143) Locate the actual Android app .java file much more carefully.
* Cleaning up wp7+8 parsers' use of promises. Fix tests.
* serve: Fix doRoot() not being called & remove duplicated table.
* serve: provide basic entry point
* Code style (indentation)
* Wait for the pre_package event to finish, or the update_csproj function might give unexpected results
* Add pre_package event to wp8 project
* readability + code quality in wp7+8 parsers
* [CB-5183](https://issues.apache.org/jira/browse/CB-5183) WP7/8 custom_path is not correctly resolved by CLI
* [CB-4994](https://issues.apache.org/jira/browse/CB-4994) Update xcode dependency to handle Xcode 5 capabilities.
* [CB-5220](https://issues.apache.org/jira/browse/CB-5220) "An error occurred" is missing an "A" ...
## 3.1.0-0.2.0
* increased version of plugman to 0.14.0 in package.json
* [CB-5187](https://issues.apache.org/jira/browse/CB-5187): remove unused var os_platform
* CB:5187 on node windows broken compile, emulate, run
* [CB-4976](https://issues.apache.org/jira/browse/CB-4976) Don't symlink into ~/.cordova/lib for local libs
* [CB-5142](https://issues.apache.org/jira/browse/CB-5142) improve grammar of emulate description
* [CB-5147](https://issues.apache.org/jira/browse/CB-5147) emulate needs a space before error message
* [CB-5125](https://issues.apache.org/jira/browse/CB-5125) add tests for chil process spawn
* [CB-5125](https://issues.apache.org/jira/browse/CB-5125): replace child process exec with spawn
* [CB-4748](https://issues.apache.org/jira/browse/CB-4748): Fail quickly if dir passed to cordova create is not empty.
* [CB-5106](https://issues.apache.org/jira/browse/CB-5106): removed flood of cp error messages when running tests
* [CB-5106](https://issues.apache.org/jira/browse/CB-5106):[wp7] fixed broken wp7 tests
* [CB-5106](https://issues.apache.org/jira/browse/CB-5106):[win8] fixed tests for windows 8
* Using .find to grab visualelements instead
* [CB-5066](https://issues.apache.org/jira/browse/CB-5066): fixed issue with visual elements not being referenced correctly
* windows8: remove debug console.log
* windows8: fixed project parser issue, and updated tests
* Update tests for commit d1c8024: update_project() should not call update_www() directly
* begin firefoxos tests
* [CB-5066](https://issues.apache.org/jira/browse/CB-5066): dealing with windows8 issues
* config.xml helper function is used, removed error merge of wp folder.
* [CB-5066](https://issues.apache.org/jira/browse/CB-5066): continuing merge of windows 8 stuff
* [CB-5066](https://issues.apache.org/jira/browse/CB-5066): merged in windows 8 support into master from cordova-3.1.x
* config.xml helper function is used, removed error merge of wp folder.
* [CB-5066](https://issues.apache.org/jira/browse/CB-5066): continuing merge of windows 8 stuff
* [CB-5066](https://issues.apache.org/jira/browse/CB-5066): merged in windows 8 support into master from cordova-3.1.x
* [CB-2234](https://issues.apache.org/jira/browse/CB-2234) Add 'cordova info' command
* [CB-4774](https://issues.apache.org/jira/browse/CB-4774): Copy www assets before running plugin prepare
* cordova help should return a Q. fixes [CB-5070](https://issues.apache.org/jira/browse/CB-5070)
* updated to a version greater than our latest version on npm
* added not about platform+os restrictions
* added myself as a contributor, [CB-5042](https://issues.apache.org/jira/browse/CB-5042) added info on windows8
* [CB-5067](https://issues.apache.org/jira/browse/CB-5067): added exception incase no platform level config.xml or defaults.xml exisit
* added temp config path for ffos, fixed wp8 config_xml function
* [CB-4774](https://issues.apache.org/jira/browse/CB-4774) Updated prepare flow to make platform config.xml a build output - Adds a new method to
* [CB-5032](https://issues.apache.org/jira/browse/CB-5032): clarify the help text
* [CB-4621](https://issues.apache.org/jira/browse/CB-4621) Updating run and emulate commands to always provide default options
* Log requests in cordova serve
* Make cordova serve ignore dot files.
* [CB-4957](https://issues.apache.org/jira/browse/CB-4957): added fix for FFOS
* Update "cordova serve" to work with promises refactoring
* [CB-4774](https://issues.apache.org/jira/browse/CB-4774) Display proper error if cordova prepare run not in project dir.
* Fixes a bug where cordova prepare bombs on a config missing a content element - Changes an undefi
* Bumping elementtree version to 0.1.5 to match plugman and support namespaced xml elements
* Fix cli.js tests broken by --silent change.
* [CB-4877]: Add basic logging, --silent flag.
* Fix busted test.
* First pass
* [CB-4883]: Graceful handling of lazy loading errors.
* reapplied change to add event mid build to allow mods to www folder pre_package aka 775e969f9cc27a
* Remove two debugger; lines that snuck in.
* [CB-4604](https://issues.apache.org/jira/browse/CB-4604) Execute hooks directly (not .bat files) cross-platform
* Refactor to use Q.js promises in place of callbacks everywhere.
* [CB-4837]: Version 3.0.10. Depends on Plugman 0.12.x.
* Add missing license headers
* Update repo versions to 3.1.0-rc1
* Add `cordova update foo` command, with tests. [CB-4777](https://issues.apache.org/jira/browse/CB-4777)
* Add version numbers to `platform ls` output.
* [CB-4545](https://issues.apache.org/jira/browse/CB-4545) support for merges directory on both wp7 & wp8
* Rename CHANGELOG.md -> RELEASENOTES.md
* Fix expectation for platform ls test, for firefoxos
* Fix platforms.js: firefoxos.parser
* CB:4657 added ffos support to cli
* [CB-4657](https://issues.apache.org/jira/browse/CB-4657): added staging_dir function to ff parser
* add default manifest properties for firefox os platform
* make the firefoxos parser actually build the project
* change firefoxos link to tarball
* add firefox platform
* [CB-4797](https://issues.apache.org/jira/browse/CB-4797) Fix a crash on undefined platform in path.
* [CB-4797](https://issues.apache.org/jira/browse/CB-4797) Add missing return statement in cordova serve
* Fix broken tests due to lazy requiring change.
* [CB-4797](https://issues.apache.org/jira/browse/CB-4797) Change `serve` command to serve platforms keyed off of path component.
* [CB-4793](https://issues.apache.org/jira/browse/CB-4793) Lazily require modules in some places.
* [CB-4325](https://issues.apache.org/jira/browse/CB-4325) Run platform installs in serial instead of in parallel
* Version updated to 3.0.10-dev
## 3.0.10
Important note: This version targets Cordova version 3.1.0-rc1.
### Notable
- You can now `cordova platform update <platform>`, which calls the platform's update script. Android, iOS, WP7 and WP8 have update scripts. Please give this a try and report any problems!
### Features
- `platform ls` now shows the version of each installed platform.
- `merges` are now supported on WP7+8.
- `serve` now serves from `http://myhost.com/ios/www`, `/android/www`, etc., serving all platforms at once.
- Speed significantly improved by importing modules only on demand. `prepare` is much faster, `platform ls` more than 10x faster.
- Now with Firefox OS!
### Bugfixes
- Corner cases in `serve`.
## 3.0.9
### Features
- `platform ls` now shows both installed and available-to-install platforms. [CB-3904](https://issues.apache.org/jira/browse/CB-3904)
### Bugfixes
- Plugins are now installed serially across all installed platforms, rather than in parallel. This avoids race conditions in dependency installation. [CB-4184](https://issues.apache.org/jira/browse/CB-4184)
- (WP8) All files from project www dir are now copied into the binary, not the top-level www. This means merges and plugin assets are correctly handled.

37
spa/node_modules/cordova/bin/cordova generated vendored Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env node
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
require('loud-rejection/register');
const util = require('util');
const { events, CordovaError } = require('cordova-common');
const cli = require('../src/cli');
cli(process.argv).catch(err => {
if (!(err instanceof Error)) {
const errorOutput = typeof err === 'string' ? err : util.inspect(err);
throw new CordovaError('Promise rejected with non-error: ' + errorOutput);
}
process.exitCode = err.code || 1;
// We cannot emit an error event here, as that would cause another error
console.error(err.message);
events.emit('verbose', err.stack);
});

1
spa/node_modules/cordova/bin/cordova.cmd generated vendored Executable file
View File

@@ -0,0 +1 @@
@node "%~dpn0" %*

31
spa/node_modules/cordova/cordova.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
// All cordova js API moved to cordova-lib. If you don't need the cordova CLI,
// use cordova-lib directly.
const cordova_lib = require('cordova-lib');
module.exports = cordova_lib.cordova;
// Also export the cordova-lib so that downstream consumers of cordova lib and
// CLI will be able to use CLI's cordova-lib and avoid the risk of having two
// different versions of cordova-lib which would result in two instances of
// "events" and can cause bad event handling.
module.exports.cordova_lib = cordova_lib;
module.exports.cli = require('./src/cli');

65
spa/node_modules/cordova/doc/bash.md generated vendored Normal file
View File

@@ -0,0 +1,65 @@
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
Bash shell support
==================
Cordova CLI comes bundled with a script which provides command-line tab-completion for Bash. If you're running a sufficiently
Unix-y operating system (Linux, BSD, OS X) you can install this to make typing cordova command lines easier.
Installation
------------
### Linux
To install on a Linux or BSD system, copy the `scripts/cordova.completion` file to your `/etc/bash_completion.d` directory. This will be read the next time you start a new shell.
### OS X
On OS X, put the `scripts/cordova.completion` file anywhere readable, and add the following line to the end of your `~/.bashrc` file:
source <path to>/cordova.completion
This will be read the next time you start a new shell.
Usage
------
It's easy! As long as your command line begins with an executable called 'cordova', just hit `<TAB>` at any point to see a list of valid completions.
Examples:
$ cordova <TAB>
build compile create emulate platform plugin prepare serve
$ cordova pla<TAB>
$ cordova platform <TAB>
add ls remove rm
$ cordova platform a<TAB>
$ cordova platform add <TAB>
android blackberry ios wp8 www
$ cordova plugin rm <TAB>
$ cordova plugin rm org.apache.cordova.<TAB>
org.apache.cordova.file org.apache.cordova.inappbrowser

28
spa/node_modules/cordova/doc/build.txt generated vendored Normal file
View File

@@ -0,0 +1,28 @@
Synopsis
cordova-cli build [PROD] [TARGET] [PLATS] [BUILDCONFIG] [-- POPTS]
PROD: --debug|--release
TARGET: --device|--emulator
PLATS: PLATFORM [...]
BUILDCONFIG: --buildConfig=CONFIGFILE
POPTS: platformopts
Shortcut for `cordova prepare` + `cordova compile` for
all/the specified platforms.
--debug ............................ debug build
--release .......................... release build
--device ........................... Build it for a device
--emulator ......................... Build it for an emulator
--buildConfig....................... Use the specified build configuration
instead of default build.json
To provide platform specific options, you must include them after `--`.
Example
cordova-cli build android windows --debug --device
cordova-cli build android --release --buildConfig=..\myBuildConfig.json
cordova-cli build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey

11
spa/node_modules/cordova/doc/clean.txt generated vendored Normal file
View File

@@ -0,0 +1,11 @@
Synopsis
cordova-cli clean [PLATFORM..]
Cleans the build artifacts for the specified platform, or all platforms
by running platform-provided clean script.
To provide platform specific options, you must include them after `--`.
Example
cordova-cli clean android

26
spa/node_modules/cordova/doc/compile.txt generated vendored Normal file
View File

@@ -0,0 +1,26 @@
Synopsis
cordova-cli compile [PROD] [TARGET] [PLATS] [-- POPTS]
PROD: --debug|--release
TARGET: --device|--emulator|--target=FOO
PLATS: PLATFORM [...]
POPTS: platformopts
Builds the app for specified platforms, or all platforms
Options
--debug ............................ Deploy a debug build
--release .......................... Deploy a release build
--device ........................... Deploy to a device
--emulator ......................... Deploy to an emulator
--target ........................... Deploy to a specific target
To provide platform specific options, you must include them after `--`.
Examples
cordova-cli compile android windows --debug --device
cordova-cli compile android --release

26
spa/node_modules/cordova/doc/config.txt generated vendored Normal file
View File

@@ -0,0 +1,26 @@
Synopsis
cordova-cli config <command> [options]
The config command can be used to set, get, delete, edit, and list global cordova options.
Options
--set <key> <value> ... Sets the config key to the value. If value is omitted, then it sets it to "true".
--get <key> ........... Echo the config value to stdout.
--delete <key> ........ Deletes the key from all configuration files.
--edit ................ Opens the config file in an editor.
--ls .................. Lists contents of config file.
Syntax
cordova-cli config set <key> <value> ....... cordova config set save-exact true
cordova-cli config get <key> ............... cordova config get save-exact
cordova-cli config delete <key> ............ cordova config delete save-exact
cordova-cli config edit .................... cordova config edit
cordova-cli config ls ...................... cordova config ls
Options
save-exact ...................... default setting = false
Examples
cordova config set save-exact true

50
spa/node_modules/cordova/doc/cordova.txt generated vendored Normal file
View File

@@ -0,0 +1,50 @@
Synopsis
cordova-cli command [options]
Global Commands
create ............................. Create a project
help ............................... Get help for a command
telemetry .......................... Turn telemetry collection on or off
config ............................. Set, get, delete, edit, and list global cordova options
Project Commands
info ............................... Generate project information
requirements ....................... Checks and print out all the requirements
for platforms specified
platform ........................... Manage project platforms
plugin ............................. Manage project plugins
prepare ............................ Copy files into platform(s) for building
compile ............................ Build platform(s)
clean .............................. Cleanup project from build artifacts
run ................................ Run project
(including prepare && compile)
serve .............................. Run project with a local webserver
(including prepare)
Learn more about command options using 'cordova-cli help <command>'
Aliases
build -> cordova-cli prepare && cordova-cli compile
emulate -> cordova-cli run --emulator
Options
-v, --version ...................... prints out this utility's version
-d, --verbose ...................... debug mode produces verbose log output for all activity,
--nohooks .......................... suppress executing hooks
(taking RegExp hook patterns as parameters)
Examples
cordova-cli create myApp org.apache.cordova.myApp myApp
cordova-cli plugin add cordova-plugin-camera
cordova-cli platform add android
cordova-cli plugin add cordova-plugin-camera --nosave
cordova-cli platform add android --nosave
cordova-cli requirements android
cordova-cli build android --verbose
cordova-cli run android
cordova-cli build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey
cordova-cli config ls

16
spa/node_modules/cordova/doc/create.txt generated vendored Normal file
View File

@@ -0,0 +1,16 @@
Synopsis
cordova-cli create <PATH> [ID [NAME]] [options]
Create a Cordova project
PATH ......................... Where to create the project
ID ........................... Reverse-domain-style package name - used in <widget id>
NAME ......................... Human readable name
Options
--template=<PATH|NPM PACKAGE|GIT URL> ... use a custom template located locally, in NPM, or GitHub.
Example
cordova-cli create myapp com.mycompany.myteam.myapp MyApp

8
spa/node_modules/cordova/doc/emulate.txt generated vendored Normal file
View File

@@ -0,0 +1,8 @@
Synopsis
cordova-cli emulate [PLATFORM...] [-- [platformopts]]
Alias for `cordova-cli run --emulator`. Launches the emulator instead of device.
Use 'cordova-cli help run' for details on options.
To provide platform specific options, you must include them after `--`.

7
spa/node_modules/cordova/doc/help.txt generated vendored Normal file
View File

@@ -0,0 +1,7 @@
Synopsis
cordova-cli help [command]
cordova-cli [command] -h
cordova-cli -h [command]
Show syntax summary, or the help for a specific command.

6
spa/node_modules/cordova/doc/info.txt generated vendored Normal file
View File

@@ -0,0 +1,6 @@
Synopsis
cordova-cli info
Print out useful information helpful for submitting bug
reports and getting help.

49
spa/node_modules/cordova/doc/platform.txt generated vendored Normal file
View File

@@ -0,0 +1,49 @@
Synopsis
cordova-cli platform <command> [options]
Manage project platforms
add <plat-spec> [...].............. Add specified platforms and save platforms
into config.xml & package.json after installing them
--nosave ...................... Prevent saving platforms into
config.xml & package.json after installing them
--link ........................ When <plat-spec> is a local path, links the platform
library directly instead of making a copy of it (support
varies by platform; useful for platform development)
remove <platform> [...] ........... Remove specified platforms
--nosave ...................... Prevent deleting specified platforms from
config.xml & package.json after removing them
update <plat-spec> ................ Update the version of Cordova used for a specific platform;
update to the latest <version> if no <plat-spec> is specified
list .............................. List all installed and available platforms
nosave ............................ Prevents saving version of all platforms added to
config.xml & package.json
Syntax
<plat-spec> : <platform>[@<version>]|<path>|<url>[#<commit-ish>]
<platform> ........................ Platform name e.g. android, ios, windows etc.
<version> ......................... Major.minor.patch version specifier using semver
<path> ............................ Path to a directory containing a platform
<url> ............................. Url to a git repository containing a platform
<commit-ish> ...................... Commit/tag/bramch reference. If none is specified, 'master' is used
Aliases
platforms -> platform
rm -> remove
ls -> list
Examples
cordova-cli platform add android ios
cordova-cli platform add android@^5.0.0
cordova-cli platform add https://github.com/myfork/cordova-android.git#4.0.0
cordova-cli platform add ../android
cordova-cli platform add ../cordova-android.tgz
cordova-cli platform rm android --nosave
cordova-cli platform ls

57
spa/node_modules/cordova/doc/plugin.txt generated vendored Normal file
View File

@@ -0,0 +1,57 @@
Synopsis
cordova-cli plugin <command> [options]
Manage project plugins
add <plugin-spec> [...] ............ Add specified plugins and save them to
config.xml & package.json.
--searchpath <directory> ....... When looking up plugins by ID, look in this directory and
each of its subdirectories before hitting the registry.
Multiple search paths can be specified.
--noregistry ................... Don't search the registry for plugins
--link ......................... When installing from a local path, creates a symbolic link
instead of copying files. The extent to which files are linked
varies by platform. Useful for plugin development.
--nosave ....................... Prevent saving the information for specified plugin
into config.xml & package.json.
--shrinkwrap ................... Used together with --save, saves the
installed version numbers to config.xml
--force ........................ Forces copying source files from the plugin even if the
same file already exists in the target directory.
remove <pluginid>|<name> [...] ..... Remove plugins with the given IDs/name and
removes the information for specified plugin from config.xml & package.json.
--nosave ....................... Prevents removing the information for
specified plugin from config.xml & package.json.
list .............................. List currently installed plugins
Syntax
<plugin-spec> : <pluginID>[@<version>]|<directory>|<url>[#<commit-ish>][:subdir]
<plugin> .......................... Plugin id (id of plugin in npm registry or --searchPath)
<version> ......................... Major.minor.patch version specifier using semver
<directory> ....................... Directory containing plugin.xml
<url> ............................. Url to a git repository containing a plugin.xml
<commit-ish> ...................... Commit/tag/branch reference. If none is specified, 'master' is used
<subdir> .......................... Sub-directory to find plugin.xml for the specified plugin.
Aliases
plugins -> plugin
rm -> remove
ls -> list
Examples
cordova-cli plugin add cordova-plugin-camera cordova-plugin-file --nosave --searchpath ~/plugins
cordova-cli plugin add cordova-plugin-camera@^2.0.0 --nosave
cordova-cli plugin add https://github.com/myfork/cordova-plugin-camera.git#2.1.0 --nosave
cordova-cli plugin add ../cordova-plugin-camera --nosave
cordova-cli plugin add ../cordova-plugin-camera.tgz --nosave
cordova-cli plugin rm camera --nosave
cordova-cli plugin ls

9
spa/node_modules/cordova/doc/prepare.txt generated vendored Normal file
View File

@@ -0,0 +1,9 @@
Synopsis
cordova-cli prepare [PLATFORM..]
Copies files for specified platforms, or all platforms,
so that the project is ready to build with each SDK.
Example
cordova-cli prepare

625
spa/node_modules/cordova/doc/readme.md generated vendored Normal file
View File

@@ -0,0 +1,625 @@
---
title: CLI Reference
description: Learn how to use Cordova CLI commands and their options.
---
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# Cordova Command-line-interface (CLI) Reference
## Syntax
```bash
cordova <command> [options] -- [platformOpts]
```
## Global Command List
These commands are available at all times.
| Command | Description
|----------|--------------
| `create` | Create a project
| `help <command>` | Get help for a command
| `telemetry` | Turn telemetry collection on or off
| `config` | Set, get, delete, edit, and list global cordova options
## Project Command List
These commands are supported when the current working directory is a valid Cordova project.
| Command | Description
|--------------|--------------
| `info` | Generate project information
| `requirements` | Checks and print out all the installation requirements for platforms specified
| `platform` | Manage project platforms
| `plugin` | Manage project plugins
| `prepare` | Copy files into platform(s) for building
| `compile` | Compile project for platform(s)
| `build` | Build project for platform(s) (`prepare` + `compile`)
| `clean` | Cleanup project from build artifacts
| `run` | Run project (including prepare && compile)
| `serve` | Run project with a local webserver (including prepare)
## Common options
These options apply to all cordova-cli commands.
| Option | Description
|----------------------|------------------------
| -d or --verbose | Pipe out more verbose output to your shell. You can also subscribe to `log` and `warn` events if you are consuming `cordova-cli` as a node module by calling `cordova.on('log', function() {})` or `cordova.on('warn', function() {})`.
| -v or --version | Print out the version of your `cordova-cli` install.
|--nohooks | Suppress executing hooks (taking RegExp hook patterns as parameters)
| --no-telemetry | Disable telemetry collection for the current command.
## Platform-specific options
Certain commands have options (`platformOpts`) that are specific to a particular platform. They can be provided to the cordova-cli with a '--' separator that stops the command parsing within the cordova-lib module and passes through rest of the options for platforms to parse.
## Examples
- This example demonstrates how cordova-cli can be used to create a project with the `camera` plugin and run it for `android` platform. In particular, platform specific options like `--keystore` can be provided:
# Create a cordova project
cordova create myApp com.myCompany.myApp myApp
cd myApp
# Add camera plugin to the project and remember that in config.xml & package.json.
cordova plugin add cordova-plugin-camera
# Add android platform to the project and remember that in config.xml & package.json.
cordova platform add android
# Check to see if your system is configured for building android platform.
cordova requirements android
# Build the android and emit verbose logs.
cordova build android --verbose
# Run the project on the android platform.
cordova run android
# Build for android platform in release mode with specified signing parameters.
cordova build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey
## cordova create command
### Synopsis
Create the directory structure for the Cordova project in the specified path.
### Syntax
```
cordova create path [id [name]] [options]
```
| Value | Description |
|-------|---------------|
| path | Directory which should not already exist. Cordova will create this directory. For more details on the directory structure, see below. |
| id | _Default_: `io.cordova.hellocordova` <br/> Reverse domain-style identifier that maps to `id` attribute of `widget` element in `config.xml`. This can be changed but there may be code generated using this value, such as Java package names. It is recommended that you select an appropriate value. |
| name | _Default_: `HelloCordova` <br/> Application's display title that maps `name` element in `config.xml` file. This can be changed but there may be code generated using this value, such as Java class names. The default value is `HelloCordova`, but it is recommended that you select an appropriate value. |
### Options
| Option | Description |
|--------|-------------|
| --template | Use a custom template located locally, in NPM, or GitHub. |
### Directory structure
Cordova CLI works with the following directory structure:
```
myapp/
|-- config.xml
|-- merges/
| | |-- android/
| | |-- windows/
| | |-- ios/
|-- www/
|-- platforms/
| |-- android/
| |-- windows/
| |-- ios/
|-- plugins/
|--cordova-plugin-camera/
```
#### config.xml
Configures your application and allows you to customize the behavior of your project. See also [config.xml reference documentation][config.xml ref]
#### www/
Contains the project's web artifacts, such as .html, .css and .js files. As a cordova application developer, most of your code and assets will go here. They will be copied on a `cordova prepare` to each platform's www directory. The www source directory is reproduced within each platform's subdirectory, appearing for example in `platforms/ios/www` or `platforms/android/assets/www`. Because the CLI constantly copies over files from the source www folder, you should only edit these files and not the ones located under the platforms subdirectories. If you use version control software, you should add this source www folder, along with the merges folder, to your version control system.
#### platforms/
Contains all the source code and build scripts for the platforms that you add to your project.
> **WARNING:** When using the CLI to build your application, you should not edit any files in the /platforms/ directory unless you know what you are doing, or if documentation specifies otherwise. The files in this directory are routinely overwritten when preparing applications for building, or when plugins are re-installed.
#### plugins/
Any added plugins will be extracted or copied into this directory.
#### merges/
Platform-specific web assets (HTML, CSS and JavaScript files) are contained within appropriate subfolders in this directory. These are deployed during a `prepare` to the appropriate native directory. Files placed under `merges/` will override matching files in the `www/` folder for the relevant platform. A quick example, assuming a project structure of:
```
merges/
|-- ios/
| -- app.js
|-- android/
| -- android.js
www/
-- app.js
```
After building the Android and iOS projects, the Android application will contain both `app.js` and `android.js`. However, the iOS application will only contain an `app.js`, and it will be the one from `merges/ios/app.js`, overriding the "common" `app.js` located inside `www/`.
#### Version control
It is recommended not to check in `platforms/` and `plugins/` directories into version control as they are considered a build artifact. Your platforms and plugins will be saved in config.xml & package.json automatically. These platforms/plugins will be downloaded when `cordova prepare` is invoked.
### Examples
- Create a Cordova project in `myapp` directory using the specified ID and display name:
cordova create myapp com.mycompany.myteam.myapp MyApp
## cordova platform command
### Synopsis
Manage cordova platforms - allowing you to add, remove, update and list platforms. Running commands to add or remove platforms affects the contents of the project's platforms directory.
### Syntax
```bash
cordova {platform | platforms} [
add <platform-spec> [...] {--save | link=<path> } |
{remove | rm} platform [...] {--save}|
{list | ls} |
update ]
```
| Sub-command | Option | Description |
------------------------|-------------|------|
| add `<platform-spec>` [...] | | Add specified platforms |
| | --nosave | Do not save `<platform-spec>` into `config.xml` & `package.json` after installing them using `<engine>` tag |
| | --link=`<path>` | When `<platform-spec>` is a local path, links the platform library directly instead of making a copy of it (support varies by platform; useful for platform development)
| remove `<platform>` [...] | | Remove specified platforms |
| | --nosave | Do not delete specified platforms from `config.xml` & `package.json` after removing them |
| update `<platform>` [...] | | Update specified platforms |
| | --save | Updates the version specified in `config.xml` |
| list | | List all installed and available platforms |
### Platform-spec
There are a number of ways to specify a platform:
```
<platform-spec> : platform[@version] | path | url[#commit-ish]
```
| Value | Description |
|-----------|-------------|
| platform | Platform name e.g. android, ios, windows etc. to be added to the project. Every release of cordova CLI pins a version for each platform. When no version is specified this version is used to add the platform. |
| version | Major.minor.patch version specifier using semver |
| path | Path to a directory or tarball containing a platform |
| url | URL to a git repository or tarball containing a platform |
| commit-ish | Commit/tag/branch reference. If none is specified, 'master' is used |
### Supported Platforms
- `android`
- `ios`
- `windows`
- `browser`
- `electron`
### Examples
- Add pinned version of the `android` and `ios` platform and save the downloaded version to `config.xml` & `package.json`:
cordova platform add android ios
- Add `android` platform with [semver](http://semver.org/) version ^5.0.0 and save it to `config.xml` & `package.json`:
cordova platform add android@^5.0.0
- Add platform by cloning the specified git repo and checkout to the `4.0.0` tag:
cordova platform add https://github.com/myfork/cordova-android.git#4.0.0
- Add platform using a local directory named `android`:
cordova platform add ../android
- Add platform using the specified tarball:
cordova platform add ../cordova-android.tgz
- Remove `android` platform from the project and remove from `config.xml` & `package.json`:
cordova platform rm android
- Remove `android` platform from the project and do NOT remove from `config.xml` & `package.json`:
cordova platform rm android --nosave
- List available and installed platforms with version numbers. This is useful to find version numbers when reporting issues:
cordova platform ls
## cordova plugin command
### Synopsis
Manage project plugins
### Syntax
```bash
cordova {plugin | plugins} [
add <plugin-spec> [..] {--searchpath=<directory> | --noregistry | --link | --save | --force} |
{remove | rm} {<pluginid> | <name>} --save |
{list | ls}
]
```
| Sub-command | Option | Description
|------------------------|-------------|------
| add `<plugin-spec>` [...] | | Add specified plugins
| |--searchpath `<directory>` | When looking up plugins by ID, look in this directory and each of its subdirectories before hitting the registry. Multiple search paths can be specified. Use ':' as a separator in `*nix` based systems and ';' for Windows.
| |--noregistry | Don't search the registry for plugins.
| |--link | When installing from a local path, creates a symbolic link instead of copying files. The extent to which files are linked varies by platform. Useful for plugin development.
| |--nosave | Do NOT save the `<plugin-spec>` as part of the `plugin` element into `config.xml` or `package.json`.
| |--force | _Introduced in version 6.1._ Forces copying source files from the plugin even if the same file already exists in the target directory.
| remove `<pluginid>\|<name>` [...] | | Remove plugins with the given IDs/name.
| |--nosave | Do NOT remove the specified plugin from config.xml or package.json
|list | | List currently installed plugins
### Plugin-spec
There are a number of ways to specify a plugin:
<plugin-spec> : [@scope/]pluginID[@version]|directory|url[#commit-ish][:subdir]
| Value | Description
|-------------|--------------------
| scope | Scope of plugin published as a [scoped npm package]
| plugin | Plugin id (id of plugin in npm registry or in --searchPath)
| version | Major.minor.patch version specifier using semver
| directory | Directory containing plugin.xml
| url | Url to a git repository containing a plugin.xml
| commit-ish | Commit/tag/branch reference. If none is specified, 'master' is used
### Algorithm for resolving plugins
When adding a plugin to a project, the CLI will resolve the plugin
based on the following criteria (listed in order of precedence):
1. The `plugin-spec` given in the command (e.g. `cordova plugin add pluginID@version`)
2. The `plugin-spec` saved in `config.xml` & `package.json` (i.e. if the plugin was previously added without `--nosave`)
3. As of Cordova version 6.1, the latest plugin version published to npm that the current project can support (only applies to plugins that list their [Cordova dependencies] in their `package.json`)
4. The latest plugin version published to npm
### Examples
- Add `cordova-plugin-camera` and `cordova-plugin-file` to the project and save it to `config.xml` & `package.json`. Use `../plugins` directory to search for the plugins.
cordova plugin add cordova-plugin-camera cordova-plugin-file --save --searchpath ../plugins
- Add `cordova-plugin-camera` with [semver](http://semver.org/) version ^2.0.0 and save it to `config.xml` & `package.json`:
cordova plugin add cordova-plugin-camera@^2.0.0
- Add the plugin from the specified local directory:
cordova plugin add ../cordova-plugin-camera
- Add the plugin from the specified tarball file:
cordova plugin add ../cordova-plugin-camera.tgz
- Remove the plugin from the project and the `config.xml` & `package.json`:
cordova plugin rm camera
- Remove the plugin from the project, but not the `config.xml` or `package.json`:
cordova plugin rm camera --nosave
- List all plugins installed in the project:
cordova plugin ls
### Conflicting plugins
Conflicting plugins may occur when adding plugins that use `edit-config` tags in their plugin.xml file. `edit-config` allows plugins to add or replace attributes of XML elements.
This feature can cause issues with the application if more than one plugin tries to modify the same XML element. Conflict detection has been implemented to prevent plugins from being added so one plugin doesn't try to overwrite another plugin's `edit-config` changes. An error will be thrown when a conflict in `edit-config` has been found and the plugin won't be added. The error message will mention that all conflicts must be resolved before the plugin can be added. One option to resolving the `edit-config` conflict is to make changes to the affected plugins' plugin.xml so that they do not modify the same XML element. The other option is to use the `--force` flag to force add the plugin. This option should be used with caution as it ignores the conflict detection and will overwrite all conflicts it has with other plugins, thus may leave the other plugins in a bad state.
Refer to the [plugin.xml guide](https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#edit-config) for managing `edit-config`, resolving conflicts, and examples.
## cordova prepare command
### Synopsis
Transforms config.xml metadata to platform-specific manifest files, copies icons & splashscreens,
copies plugin files for specified platforms so that the project is ready to build with each native SDK.
### Syntax
```
cordova prepare [<platform> [..]]
```
### Options
| Option | Description
|------------|------------------
| `<platform> [..]` | Platform name(s) to prepare. If not specified, all platforms are prepared.
## cordova compile command
### Synopsis
`cordova compile` is a subset of the [cordova build command](#cordova-build-command).
It only performs the compilation step without doing prepare. It's common to invoke `cordova build` instead of this command - however, this stage is useful to allow extending using [hooks][Hooks guide].
### Syntax
```bash
cordova compile [<platform> [...]]
[--debug | --release]
[--device | --emulator | --target=<targetName>]
[--buildConfig=<configfile>]
[-- <platformOpts>]
```
For detailed documentation see [cordova build command](#cordova-build-command) docs below.
## cordova build command
### Synopsis
Shortcut for `cordova prepare` + `cordova compile` for all/the specified platforms. Allows you to build the app for the specified platform.
### Syntax
```bash
cordova build [<platform> [...]]
[--debug | --release]
[--device | --emulator]
[--buildConfig=<configfile>]
[-- <platformOpts>]
```
| Option | Description
|------------|------------------
| `<platform> [..]` | Platform name(s) to build. If not specified, all platforms are built.
| --debug | Perform a debug build. This typically translates to debug mode for the underlying platform being built.
| --release | Perform a release build. This typically translates to release mode for the underlying platform being built.
| --device | Build it for a device
| --emulator | Build it for an emulator. In particular, the platform architecture might be different for a device vs. emulator.
| --buildConfig=`<configFile>` | Default: build.json in cordova root directory. <br/> Use the specified build configuration file. `build.json` file is used to specify paramaters to customize the app build process especially related to signing the package.
| `<platformOpts>` | To provide platform specific options, you must include them after `--` separator. Review platform guide docs for more details.
### Examples
- Build for `android` and `windows` platform in `debug` mode for deployment to device:
cordova build android windows --debug --device
- Build for `android` platform in `release` mode and use the specified build configuration:
cordova build android --release --buildConfig=..\myBuildConfig.json
- Build for `android` platform in release mode and pass custom platform options to android build process:
cordova build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey
## cordova run command
### Synopsis
Prepares, builds, and deploys app on specified platform devices/emulators. If a device is connected it will be used, unless an eligible emulator is already running.
### Syntax
```bash
cordova run [<platform> [...]]
[--list | --debug | --release]
[--noprepare]
[--nobuild]
[--device | --emulator | --target=<targetName>]
[--buildConfig=<configfile>]
[-- <platformOpts>]
```
| Option | Description
|-------------|------------------
| `<platform> [..]` | Platform name(s) to run. If not specified, all platforms are run.
| --list | Lists available targets. Displays both device and emulator deployment targets unless specified
| --debug | Deploy a debug build. This is the default behavior unless `--release` is specified.
| --release | Deploy a release build
| --noprepare | Skip preparing (available in Cordova v6.2 or later)
| --nobuild | Skip building
| --device | Deploy to a device
| --emulator | Deploy to an emulator
| --target | Deploy to a specific target emulator/device. Use `--list` to display target options
| --buildConfig=`<configFile>` | Default: build.json in cordova root directory. <br/> Use the specified build configuration file. `build.json` file is used to specify paramaters to customize the app build process especially related to signing the package.
| `<platformOpts>` | To provide platform specific options, you must include them after `--` separator. Review platform guide docs for more details.
### Examples
- Run a release build of current cordova project on `android` platform emulator named `Nexus_5_API_23_x86`. Use the spcified build configuration when running:
cordova run android --release --buildConfig=..\myBuildConfig.json --target=Nexus_5_API_23_x86
- Run a debug build of current cordova project on `android` platform using a device or emulator (if no device is connected). Skip doing the build:
cordova run android --nobuild
- Run a debug build of current cordova project on an `ios` device:
cordova run ios --device
- Enumerate names of all the connected devices and available emulators that can be used to run this app:
cordova run ios --list
## cordova emulate command
### Synopsis
Alias for `cordova run --emulator`. Launches the emulator instead of device.
See [cordova run command docs](#cordova-run-command) for more details.
## cordova clean command
### Synopsis
Cleans the build artifacts for all the platforms, or the specified platform by running platform-specific build cleanup.
### Syntax
```
cordova clean [<platform> [...]]
```
### Example
- Clean `android` platform build artifacts:
cordova clean android
## cordova requirements command
### Synopsis
Checks and print out all the requirements for platforms specified (or all platforms added
to project if none specified). If all requirements for each platform are met, exits with code 0
otherwise exits with non-zero code.
This can be useful when setting up a machine for building a particular platform.
### Syntax
```
cordova requirements android
```
## cordova info command
### Synopsis
Print out useful information helpful for submitting bug
reports and getting help.
### Syntax
```
cordova info
```
## cordova serve command
### Synopsis
Run a local web server for www/ assets using specified `port` or default of 8000. Access projects at: `http://HOST_IP:PORT/PLATFORM/www`
### Syntax
```
cordova serve [port]
```
## cordova telemetry command
### Synopsis
Turns telemetry collection on or off.
### Syntax
```
cordova telemetry [STATE]
```
| Option | Description
|-------------|------------------
| on | Turn telemetry collection on.
| off | Turn telemetry collection off.
### Details
A timed prompt asking the user to opt-in or out is displayed the first time cordova is run.
It lasts for 30 seconds, after which the user is automatically opted-out if they don't provide any answer.
In CI environments, the `CI` environment variable can be set, which will prevent the prompt from showing up.
Telemetry collection can also be turned off on a single command by using the `--no-telemetry` flag.
### Examples
```
cordova telemetry on
cordova telemetry off
cordova build --no-telemetry
```
For details, see our privacy notice: https://cordova.apache.org/privacy
## cordova help command
### Synopsis
Show syntax summary, or the help for a specific command.
### Syntax
```
cordova help [command]
cordova [command] -h
cordova -h [command]
```
## cordova config command
### Synopsis
Set, get, delete, edit, and list global cordova options.
### Syntax
```
cordova config ls
cordova config edit
cordova config set <key> <value>
cordova config get <key>
cordova config delete <key>
```
### Examples
```
cordova config set save-exact true
```
[Hooks guide]: http://cordova.apache.org/docs/en/latest/guide_appdev_hooks_index.md.html
[config.xml ref]: http://cordova.apache.org/docs/en/latest/config_ref/index.html
[Cordova dependencies]: http://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html#specifying-project-requirements
[scoped npm package]: https://docs.npmjs.com/misc/scope

10
spa/node_modules/cordova/doc/requirements.txt generated vendored Normal file
View File

@@ -0,0 +1,10 @@
Synopsis
cordova-cli requirements [PLATFORM ...]
Checks and print out all the requirements for platforms specified (or all platforms added
to project if none specified). If all requirements for each platform are met, exits with code 0
otherwise exits with non-zero code.
Example
cordova-cli requirements android

43
spa/node_modules/cordova/doc/run.txt generated vendored Normal file
View File

@@ -0,0 +1,43 @@
Synopsis
cordova-cli run [MODE] [BUILDOPTS] [TARGET] [PLATS] [BUILDCONFIG] [-- POPTS]
MODE: --list|--debug|--release
BUILDOPTS: --noprepare --nobuild
TARGET: DEVICECLASS|--target=FOO
PLATS: PLATFORM [...]
BUILDCONFIG: --buildConfig=CONFIGFILE
POPTS: platformopts
DEVICECLASS: --device|--emulator
Deploys app on specified platform devices / emulators
--list ............................. Lists available targets
Will display both device and emulator
unless DEVICECLASS option is provided
--debug ............................ Deploy a debug build
--release .......................... Deploy a release build
--noprepare ........................ Don't prepare
--nobuild .......................... Don't build
--device ........................... Deploy to a device
--emulator ......................... Deploy to an emulator
--target ........................... Deploy to a specific target
--buildConfig....................... Use the specified build configuration
instead of default build.json
To provide platform specific options, you must include them after `--`.
Technical details
calls cordova prepare (unless --noprepare)
calls PLATFORM run
PLATFORM run calls PLATFORM build (unless --nobuild)
Examples
cordova-cli run android --release --buildConfig=..\myBuildConfig.json --target=myEmulator
cordova-cli run android --nobuild
cordova-cli run ios --device
cordova-cli run ios --list

7
spa/node_modules/cordova/doc/serve.txt generated vendored Normal file
View File

@@ -0,0 +1,7 @@
Synopsis
cordova-cli serve [PORT]
Run a local web server for www/ assets. Port defaults to 8000.
Access projects at: http://HOST_IP:PORT/PLATFORM/www

23
spa/node_modules/cordova/doc/telemetry.txt generated vendored Normal file
View File

@@ -0,0 +1,23 @@
Synopsis
cordova-cli telemetry [STATE]
STATE: on|off
Turns telemetry collection on or off
on ....................... Turns telemetry collection on
off ...................... Turns telemetry collection off
Details
A timed prompt asking the user to opt-in or out is displayed the first time cordova is run.
It lasts for 30 seconds, after which the user is automatically opted-out if they don't provide any answer.
In CI environments, the `CI` environment variable can be set, which will prevent the prompt from showing up.
Telemetry collection can also be turned off on a single command by using the `--no-telemetry` flag.
Examples
cordova-cli telemetry on
cordova-cli telemetry off
cordova-cli build --no-telemetry
For details, see our privacy notice: https://cordova.apache.org/privacy

1
spa/node_modules/cordova/node_modules/.bin/nopt generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../nopt/bin/nopt.js

1
spa/node_modules/cordova/node_modules/.bin/semver generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../semver/bin/semver.js

46
spa/node_modules/cordova/node_modules/abbrev/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,46 @@
This software is dual-licensed under the ISC and MIT licenses.
You may use this software under EITHER of the following licenses.
----------
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
----------
Copyright Isaac Z. Schlueter and Contributors
All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

23
spa/node_modules/cordova/node_modules/abbrev/README.md generated vendored Normal file
View File

@@ -0,0 +1,23 @@
# abbrev-js
Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
Usage:
var abbrev = require("abbrev");
abbrev("foo", "fool", "folding", "flop");
// returns:
{ fl: 'flop'
, flo: 'flop'
, flop: 'flop'
, fol: 'folding'
, fold: 'folding'
, foldi: 'folding'
, foldin: 'folding'
, folding: 'folding'
, foo: 'foo'
, fool: 'fool'
}
This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.

View File

@@ -0,0 +1,50 @@
module.exports = abbrev
function abbrev (...args) {
let list = args.length === 1 || Array.isArray(args[0]) ? args[0] : args
for (let i = 0, l = list.length; i < l; i++) {
list[i] = typeof list[i] === 'string' ? list[i] : String(list[i])
}
// sort them lexicographically, so that they're next to their nearest kin
list = list.sort(lexSort)
// walk through each, seeing how much it has in common with the next and previous
const abbrevs = {}
let prev = ''
for (let ii = 0, ll = list.length; ii < ll; ii++) {
const current = list[ii]
const next = list[ii + 1] || ''
let nextMatches = true
let prevMatches = true
if (current === next) {
continue
}
let j = 0
const cl = current.length
for (; j < cl; j++) {
const curChar = current.charAt(j)
nextMatches = nextMatches && curChar === next.charAt(j)
prevMatches = prevMatches && curChar === prev.charAt(j)
if (!nextMatches && !prevMatches) {
j++
break
}
}
prev = current
if (j === cl) {
abbrevs[current] = current
continue
}
for (let a = current.slice(0, j); j <= cl; j++) {
abbrevs[a] = current
a += current.charAt(j)
}
}
return abbrevs
}
function lexSort (a, b) {
return a === b ? 0 : a > b ? 1 : -1
}

View File

@@ -0,0 +1,43 @@
{
"name": "abbrev",
"version": "2.0.0",
"description": "Like ruby's abbrev module, but in js",
"author": "GitHub Inc.",
"main": "lib/index.js",
"scripts": {
"test": "tap",
"lint": "eslint \"**/*.js\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"snap": "tap",
"posttest": "npm run lint"
},
"repository": {
"type": "git",
"url": "https://github.com/npm/abbrev-js.git"
},
"license": "ISC",
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.8.0",
"tap": "^16.3.0"
},
"tap": {
"nyc-arg": [
"--exclude",
"tap-snapshots/**"
]
},
"files": [
"bin/",
"lib/"
],
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.8.0"
}
}

15
spa/node_modules/cordova/node_modules/nopt/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,15 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

213
spa/node_modules/cordova/node_modules/nopt/README.md generated vendored Normal file
View File

@@ -0,0 +1,213 @@
If you want to write an option parser, and have it be good, there are
two ways to do it. The Right Way, and the Wrong Way.
The Wrong Way is to sit down and write an option parser. We've all done
that.
The Right Way is to write some complex configurable program with so many
options that you hit the limit of your frustration just trying to
manage them all, and defer it with duct-tape solutions until you see
exactly to the core of the problem, and finally snap and write an
awesome option parser.
If you want to write an option parser, don't write an option parser.
Write a package manager, or a source control system, or a service
restarter, or an operating system. You probably won't end up with a
good one of those, but if you don't give up, and you are relentless and
diligent enough in your procrastination, you may just end up with a very
nice option parser.
## USAGE
```javascript
// my-program.js
var nopt = require("nopt")
, Stream = require("stream").Stream
, path = require("path")
, knownOpts = { "foo" : [String, null]
, "bar" : [Stream, Number]
, "baz" : path
, "bloo" : [ "big", "medium", "small" ]
, "flag" : Boolean
, "pick" : Boolean
, "many1" : [String, Array]
, "many2" : [path, Array]
}
, shortHands = { "foofoo" : ["--foo", "Mr. Foo"]
, "b7" : ["--bar", "7"]
, "m" : ["--bloo", "medium"]
, "p" : ["--pick"]
, "f" : ["--flag"]
}
// everything is optional.
// knownOpts and shorthands default to {}
// arg list defaults to process.argv
// slice defaults to 2
, parsed = nopt(knownOpts, shortHands, process.argv, 2)
console.log(parsed)
```
This would give you support for any of the following:
```console
$ node my-program.js --foo "blerp" --no-flag
{ "foo" : "blerp", "flag" : false }
$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag
{ bar: 7, foo: "Mr. Hand", flag: true }
$ node my-program.js --foo "blerp" -f -----p
{ foo: "blerp", flag: true, pick: true }
$ node my-program.js -fp --foofoo
{ foo: "Mr. Foo", flag: true, pick: true }
$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.
{ foo: "Mr. Foo", argv: { remain: ["-fp"] } }
$ node my-program.js --blatzk -fp # unknown opts are ok.
{ blatzk: true, flag: true, pick: true }
$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value
{ blatzk: 1000, flag: true, pick: true }
$ node my-program.js --no-blatzk -fp # unless they start with "no-"
{ blatzk: false, flag: true, pick: true }
$ node my-program.js --baz b/a/z # known paths are resolved.
{ baz: "/Users/isaacs/b/a/z" }
# if Array is one of the types, then it can take many
# values, and will always be an array. The other types provided
# specify what types are allowed in the list.
$ node my-program.js --many1 5 --many1 null --many1 foo
{ many1: ["5", "null", "foo"] }
$ node my-program.js --many2 foo --many2 bar
{ many2: ["/path/to/foo", "path/to/bar"] }
```
Read the tests at the bottom of `lib/nopt.js` for more examples of
what this puppy can do.
## Types
The following types are supported, and defined on `nopt.typeDefs`
* String: A normal string. No parsing is done.
* path: A file system path. Gets resolved against cwd if not absolute.
* url: A url. If it doesn't parse, it isn't accepted.
* Number: Must be numeric.
* Date: Must parse as a date. If it does, and `Date` is one of the options,
then it will return a Date object, not a string.
* Boolean: Must be either `true` or `false`. If an option is a boolean,
then it does not need a value, and its presence will imply `true` as
the value. To negate boolean flags, do `--no-whatever` or `--whatever
false`
* NaN: Means that the option is strictly not allowed. Any value will
fail.
* Stream: An object matching the "Stream" class in node. Valuable
for use when validating programmatically. (npm uses this to let you
supply any WriteStream on the `outfd` and `logfd` config options.)
* Array: If `Array` is specified as one of the types, then the value
will be parsed as a list of options. This means that multiple values
can be specified, and that the value will always be an array.
If a type is an array of values not on this list, then those are
considered valid values. For instance, in the example above, the
`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`,
and any other value will be rejected.
When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be
interpreted as their JavaScript equivalents.
You can also mix types and values, or multiple types, in a list. For
instance `{ blah: [Number, null] }` would allow a value to be set to
either a Number or null. When types are ordered, this implies a
preference, and the first type that can be used to properly interpret
the value will be used.
To define a new type, add it to `nopt.typeDefs`. Each item in that
hash is an object with a `type` member and a `validate` method. The
`type` member is an object that matches what goes in the type list. The
`validate` method is a function that gets called with `validate(data,
key, val)`. Validate methods should assign `data[key]` to the valid
value of `val` if it can be handled properly, or return boolean
`false` if it cannot.
You can also call `nopt.clean(data, types, typeDefs)` to clean up a
config object and remove its invalid properties.
## Error Handling
By default, nopt outputs a warning to standard error when invalid values for
known options are found. You can change this behavior by assigning a method
to `nopt.invalidHandler`. This method will be called with
the offending `nopt.invalidHandler(key, val, types)`.
If no `nopt.invalidHandler` is assigned, then it will console.error
its whining. If it is assigned to boolean `false` then the warning is
suppressed.
## Abbreviations
Yes, they are supported. If you define options like this:
```javascript
{ "foolhardyelephants" : Boolean
, "pileofmonkeys" : Boolean }
```
Then this will work:
```bash
node program.js --foolhar --pil
node program.js --no-f --pileofmon
# etc.
```
## Shorthands
Shorthands are a hash of shorter option names to a snippet of args that
they expand to.
If multiple one-character shorthands are all combined, and the
combination does not unambiguously match any other option or shorthand,
then they will be broken up into their constituent parts. For example:
```json
{ "s" : ["--loglevel", "silent"]
, "g" : "--global"
, "f" : "--force"
, "p" : "--parseable"
, "l" : "--long"
}
```
```bash
npm ls -sgflp
# just like doing this:
npm ls --loglevel silent --global --force --long --parseable
```
## The Rest of the args
The config object returned by nopt is given a special member called
`argv`, which is an object with the following fields:
* `remain`: The remaining args after all the parsing has occurred.
* `original`: The args as they originally appeared.
* `cooked`: The args after flags and shorthands are expanded.
## Slicing
Node programs are called with more or less the exact argv as it appears
in C land, after the v8 and node-specific options have been plucked off.
As such, `argv[0]` is always `node` and `argv[1]` is always the
JavaScript program being run.
That's usually not very useful to you. So they're sliced off by
default. If you want them, then you can pass in `0` as the last
argument, or any other number that you'd like to slice off the start of
the list.

29
spa/node_modules/cordova/node_modules/nopt/bin/nopt.js generated vendored Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env node
const nopt = require('../lib/nopt')
const path = require('path')
console.log('parsed', nopt({
num: Number,
bool: Boolean,
help: Boolean,
list: Array,
'num-list': [Number, Array],
'str-list': [String, Array],
'bool-list': [Boolean, Array],
str: String,
clear: Boolean,
config: Boolean,
length: Number,
file: path,
}, {
s: ['--str', 'astring'],
b: ['--bool'],
nb: ['--no-bool'],
tft: ['--bool-list', '--no-bool-list', '--bool-list', 'true'],
'?': ['--help'],
h: ['--help'],
H: ['--help'],
n: ['--num', '125'],
c: ['--config'],
l: ['--length'],
f: ['--file'],
}, process.argv, 2))

View File

@@ -0,0 +1,5 @@
/* istanbul ignore next */
module.exports = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
// eslint-disable-next-line no-console
? (...a) => console.error(...a)
: () => {}

View File

@@ -0,0 +1,479 @@
const abbrev = require('abbrev')
const debug = require('./debug')
const defaultTypeDefs = require('./type-defs')
const hasOwn = (o, k) => Object.prototype.hasOwnProperty.call(o, k)
const getType = (k, { types, dynamicTypes }) => {
let hasType = hasOwn(types, k)
let type = types[k]
if (!hasType && typeof dynamicTypes === 'function') {
const matchedType = dynamicTypes(k)
if (matchedType !== undefined) {
type = matchedType
hasType = true
}
}
return [hasType, type]
}
const isTypeDef = (type, def) => def && type === def
const hasTypeDef = (type, def) => def && type.indexOf(def) !== -1
const doesNotHaveTypeDef = (type, def) => def && !hasTypeDef(type, def)
function nopt (args, {
types,
shorthands,
typeDefs,
invalidHandler,
typeDefault,
dynamicTypes,
} = {}) {
debug(types, shorthands, args, typeDefs)
const data = {}
const argv = {
remain: [],
cooked: args,
original: args.slice(0),
}
parse(args, data, argv.remain, { typeDefs, types, dynamicTypes, shorthands })
// now data is full
clean(data, { types, dynamicTypes, typeDefs, invalidHandler, typeDefault })
data.argv = argv
Object.defineProperty(data.argv, 'toString', {
value: function () {
return this.original.map(JSON.stringify).join(' ')
},
enumerable: false,
})
return data
}
function clean (data, {
types = {},
typeDefs = {},
dynamicTypes,
invalidHandler,
typeDefault,
} = {}) {
const StringType = typeDefs.String?.type
const NumberType = typeDefs.Number?.type
const ArrayType = typeDefs.Array?.type
const BooleanType = typeDefs.Boolean?.type
const DateType = typeDefs.Date?.type
const hasTypeDefault = typeof typeDefault !== 'undefined'
if (!hasTypeDefault) {
typeDefault = [false, true, null]
if (StringType) {
typeDefault.push(StringType)
}
if (ArrayType) {
typeDefault.push(ArrayType)
}
}
const remove = {}
Object.keys(data).forEach((k) => {
if (k === 'argv') {
return
}
let val = data[k]
debug('val=%j', val)
const isArray = Array.isArray(val)
let [hasType, rawType] = getType(k, { types, dynamicTypes })
let type = rawType
if (!isArray) {
val = [val]
}
if (!type) {
type = typeDefault
}
if (isTypeDef(type, ArrayType)) {
type = typeDefault.concat(ArrayType)
}
if (!Array.isArray(type)) {
type = [type]
}
debug('val=%j', val)
debug('types=', type)
val = val.map((v) => {
// if it's an unknown value, then parse false/true/null/numbers/dates
if (typeof v === 'string') {
debug('string %j', v)
v = v.trim()
if ((v === 'null' && ~type.indexOf(null))
|| (v === 'true' &&
(~type.indexOf(true) || hasTypeDef(type, BooleanType)))
|| (v === 'false' &&
(~type.indexOf(false) || hasTypeDef(type, BooleanType)))) {
v = JSON.parse(v)
debug('jsonable %j', v)
} else if (hasTypeDef(type, NumberType) && !isNaN(v)) {
debug('convert to number', v)
v = +v
} else if (hasTypeDef(type, DateType) && !isNaN(Date.parse(v))) {
debug('convert to date', v)
v = new Date(v)
}
}
if (!hasType) {
if (!hasTypeDefault) {
return v
}
// if the default type has been passed in then we want to validate the
// unknown data key instead of bailing out earlier. we also set the raw
// type which is passed to the invalid handler so that it can be
// determined if during validation if it is unknown vs invalid
rawType = typeDefault
}
// allow `--no-blah` to set 'blah' to null if null is allowed
if (v === false && ~type.indexOf(null) &&
!(~type.indexOf(false) || hasTypeDef(type, BooleanType))) {
v = null
}
const d = {}
d[k] = v
debug('prevalidated val', d, v, rawType)
if (!validate(d, k, v, rawType, { typeDefs })) {
if (invalidHandler) {
invalidHandler(k, v, rawType, data)
} else if (invalidHandler !== false) {
debug('invalid: ' + k + '=' + v, rawType)
}
return remove
}
debug('validated v', d, v, rawType)
return d[k]
}).filter((v) => v !== remove)
// if we allow Array specifically, then an empty array is how we
// express 'no value here', not null. Allow it.
if (!val.length && doesNotHaveTypeDef(type, ArrayType)) {
debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(ArrayType))
delete data[k]
} else if (isArray) {
debug(isArray, data[k], val)
data[k] = val
} else {
data[k] = val[0]
}
debug('k=%s val=%j', k, val, data[k])
})
}
function validate (data, k, val, type, { typeDefs } = {}) {
const ArrayType = typeDefs?.Array?.type
// arrays are lists of types.
if (Array.isArray(type)) {
for (let i = 0, l = type.length; i < l; i++) {
if (isTypeDef(type[i], ArrayType)) {
continue
}
if (validate(data, k, val, type[i], { typeDefs })) {
return true
}
}
delete data[k]
return false
}
// an array of anything?
if (isTypeDef(type, ArrayType)) {
return true
}
// Original comment:
// NaN is poisonous. Means that something is not allowed.
// New comment: Changing this to an isNaN check breaks a lot of tests.
// Something is being assumed here that is not actually what happens in
// practice. Fixing it is outside the scope of getting linting to pass in
// this repo. Leaving as-is for now.
/* eslint-disable-next-line no-self-compare */
if (type !== type) {
debug('Poison NaN', k, val, type)
delete data[k]
return false
}
// explicit list of values
if (val === type) {
debug('Explicitly allowed %j', val)
data[k] = val
return true
}
// now go through the list of typeDefs, validate against each one.
let ok = false
const types = Object.keys(typeDefs)
for (let i = 0, l = types.length; i < l; i++) {
debug('test type %j %j %j', k, val, types[i])
const t = typeDefs[types[i]]
if (t && (
(type && type.name && t.type && t.type.name) ?
(type.name === t.type.name) :
(type === t.type)
)) {
const d = {}
ok = t.validate(d, k, val) !== false
val = d[k]
if (ok) {
data[k] = val
break
}
}
}
debug('OK? %j (%j %j %j)', ok, k, val, types[types.length - 1])
if (!ok) {
delete data[k]
}
return ok
}
function parse (args, data, remain, {
types = {},
typeDefs = {},
shorthands = {},
dynamicTypes,
} = {}) {
const StringType = typeDefs.String?.type
const NumberType = typeDefs.Number?.type
const ArrayType = typeDefs.Array?.type
const BooleanType = typeDefs.Boolean?.type
debug('parse', args, data, remain)
const abbrevs = abbrev(Object.keys(types))
debug('abbrevs=%j', abbrevs)
const shortAbbr = abbrev(Object.keys(shorthands))
for (let i = 0; i < args.length; i++) {
let arg = args[i]
debug('arg', arg)
if (arg.match(/^-{2,}$/)) {
// done with keys.
// the rest are args.
remain.push.apply(remain, args.slice(i + 1))
args[i] = '--'
break
}
let hadEq = false
if (arg.charAt(0) === '-' && arg.length > 1) {
const at = arg.indexOf('=')
if (at > -1) {
hadEq = true
const v = arg.slice(at + 1)
arg = arg.slice(0, at)
args.splice(i, 1, arg, v)
}
// see if it's a shorthand
// if so, splice and back up to re-parse it.
const shRes = resolveShort(arg, shortAbbr, abbrevs, { shorthands })
debug('arg=%j shRes=%j', arg, shRes)
if (shRes) {
args.splice.apply(args, [i, 1].concat(shRes))
if (arg !== shRes[0]) {
i--
continue
}
}
arg = arg.replace(/^-+/, '')
let no = null
while (arg.toLowerCase().indexOf('no-') === 0) {
no = !no
arg = arg.slice(3)
}
if (abbrevs[arg]) {
arg = abbrevs[arg]
}
let [hasType, argType] = getType(arg, { types, dynamicTypes })
let isTypeArray = Array.isArray(argType)
if (isTypeArray && argType.length === 1) {
isTypeArray = false
argType = argType[0]
}
let isArray = isTypeDef(argType, ArrayType) ||
isTypeArray && hasTypeDef(argType, ArrayType)
// allow unknown things to be arrays if specified multiple times.
if (!hasType && hasOwn(data, arg)) {
if (!Array.isArray(data[arg])) {
data[arg] = [data[arg]]
}
isArray = true
}
let val
let la = args[i + 1]
const isBool = typeof no === 'boolean' ||
isTypeDef(argType, BooleanType) ||
isTypeArray && hasTypeDef(argType, BooleanType) ||
(typeof argType === 'undefined' && !hadEq) ||
(la === 'false' &&
(argType === null ||
isTypeArray && ~argType.indexOf(null)))
if (isBool) {
// just set and move along
val = !no
// however, also support --bool true or --bool false
if (la === 'true' || la === 'false') {
val = JSON.parse(la)
la = null
if (no) {
val = !val
}
i++
}
// also support "foo":[Boolean, "bar"] and "--foo bar"
if (isTypeArray && la) {
if (~argType.indexOf(la)) {
// an explicit type
val = la
i++
} else if (la === 'null' && ~argType.indexOf(null)) {
// null allowed
val = null
i++
} else if (!la.match(/^-{2,}[^-]/) &&
!isNaN(la) &&
hasTypeDef(argType, NumberType)) {
// number
val = +la
i++
} else if (!la.match(/^-[^-]/) && hasTypeDef(argType, StringType)) {
// string
val = la
i++
}
}
if (isArray) {
(data[arg] = data[arg] || []).push(val)
} else {
data[arg] = val
}
continue
}
if (isTypeDef(argType, StringType)) {
if (la === undefined) {
la = ''
} else if (la.match(/^-{1,2}[^-]+/)) {
la = ''
i--
}
}
if (la && la.match(/^-{2,}$/)) {
la = undefined
i--
}
val = la === undefined ? true : la
if (isArray) {
(data[arg] = data[arg] || []).push(val)
} else {
data[arg] = val
}
i++
continue
}
remain.push(arg)
}
}
const SINGLES = Symbol('singles')
const singleCharacters = (arg, shorthands) => {
let singles = shorthands[SINGLES]
if (!singles) {
singles = Object.keys(shorthands).filter((s) => s.length === 1).reduce((l, r) => {
l[r] = true
return l
}, {})
shorthands[SINGLES] = singles
debug('shorthand singles', singles)
}
const chrs = arg.split('').filter((c) => singles[c])
return chrs.join('') === arg ? chrs : null
}
function resolveShort (arg, ...rest) {
const { types = {}, shorthands = {} } = rest.length ? rest.pop() : {}
const shortAbbr = rest[0] ?? abbrev(Object.keys(shorthands))
const abbrevs = rest[1] ?? abbrev(Object.keys(types))
// handle single-char shorthands glommed together, like
// npm ls -glp, but only if there is one dash, and only if
// all of the chars are single-char shorthands, and it's
// not a match to some other abbrev.
arg = arg.replace(/^-+/, '')
// if it's an exact known option, then don't go any further
if (abbrevs[arg] === arg) {
return null
}
// if it's an exact known shortopt, same deal
if (shorthands[arg]) {
// make it an array, if it's a list of words
if (shorthands[arg] && !Array.isArray(shorthands[arg])) {
shorthands[arg] = shorthands[arg].split(/\s+/)
}
return shorthands[arg]
}
// first check to see if this arg is a set of single-char shorthands
const chrs = singleCharacters(arg, shorthands)
if (chrs) {
return chrs.map((c) => shorthands[c]).reduce((l, r) => l.concat(r), [])
}
// if it's an arg abbrev, and not a literal shorthand, then prefer the arg
if (abbrevs[arg] && !shorthands[arg]) {
return null
}
// if it's an abbr for a shorthand, then use that
if (shortAbbr[arg]) {
arg = shortAbbr[arg]
}
// make it an array, if it's a list of words
if (shorthands[arg] && !Array.isArray(shorthands[arg])) {
shorthands[arg] = shorthands[arg].split(/\s+/)
}
return shorthands[arg]
}
module.exports = {
nopt,
clean,
parse,
validate,
resolveShort,
typeDefs: defaultTypeDefs,
}

30
spa/node_modules/cordova/node_modules/nopt/lib/nopt.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
const lib = require('./nopt-lib')
const defaultTypeDefs = require('./type-defs')
// This is the version of nopt's API that requires setting typeDefs and invalidHandler
// on the required `nopt` object since it is a singleton. To not do a breaking change
// an API that requires all options be passed in is located in `nopt-lib.js` and
// exported here as lib.
// TODO(breaking): make API only work in non-singleton mode
module.exports = exports = nopt
exports.clean = clean
exports.typeDefs = defaultTypeDefs
exports.lib = lib
function nopt (types, shorthands, args = process.argv, slice = 2) {
return lib.nopt(args.slice(slice), {
types: types || {},
shorthands: shorthands || {},
typeDefs: exports.typeDefs,
invalidHandler: exports.invalidHandler,
})
}
function clean (data, types, typeDefs = exports.typeDefs) {
return lib.clean(data, {
types: types || {},
typeDefs,
invalidHandler: exports.invalidHandler,
})
}

View File

@@ -0,0 +1,91 @@
const url = require('url')
const path = require('path')
const Stream = require('stream').Stream
const os = require('os')
const debug = require('./debug')
function validateString (data, k, val) {
data[k] = String(val)
}
function validatePath (data, k, val) {
if (val === true) {
return false
}
if (val === null) {
return true
}
val = String(val)
const isWin = process.platform === 'win32'
const homePattern = isWin ? /^~(\/|\\)/ : /^~\//
const home = os.homedir()
if (home && val.match(homePattern)) {
data[k] = path.resolve(home, val.slice(2))
} else {
data[k] = path.resolve(val)
}
return true
}
function validateNumber (data, k, val) {
debug('validate Number %j %j %j', k, val, isNaN(val))
if (isNaN(val)) {
return false
}
data[k] = +val
}
function validateDate (data, k, val) {
const s = Date.parse(val)
debug('validate Date %j %j %j', k, val, s)
if (isNaN(s)) {
return false
}
data[k] = new Date(val)
}
function validateBoolean (data, k, val) {
if (typeof val === 'string') {
if (!isNaN(val)) {
val = !!(+val)
} else if (val === 'null' || val === 'false') {
val = false
} else {
val = true
}
} else {
val = !!val
}
data[k] = val
}
function validateUrl (data, k, val) {
// Changing this would be a breaking change in the npm cli
/* eslint-disable-next-line node/no-deprecated-api */
val = url.parse(String(val))
if (!val.host) {
return false
}
data[k] = val.href
}
function validateStream (data, k, val) {
if (!(val instanceof Stream)) {
return false
}
data[k] = val
}
module.exports = {
String: { type: String, validate: validateString },
Boolean: { type: Boolean, validate: validateBoolean },
url: { type: url, validate: validateUrl },
Number: { type: Number, validate: validateNumber },
path: { type: path, validate: validatePath },
Stream: { type: Stream, validate: validateStream },
Date: { type: Date, validate: validateDate },
Array: { type: Array },
}

View File

@@ -0,0 +1,51 @@
{
"name": "nopt",
"version": "7.2.1",
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
"author": "GitHub Inc.",
"main": "lib/nopt.js",
"scripts": {
"test": "tap",
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"snap": "tap",
"posttest": "npm run lint"
},
"repository": {
"type": "git",
"url": "git+https://github.com/npm/nopt.git"
},
"bin": {
"nopt": "bin/nopt.js"
},
"license": "ISC",
"dependencies": {
"abbrev": "^2.0.0"
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.22.0",
"tap": "^16.3.0"
},
"tap": {
"nyc-arg": [
"--exclude",
"tap-snapshots/**"
]
},
"files": [
"bin/",
"lib/"
],
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"windowsCI": false,
"version": "4.22.0",
"publish": true
}
}

15
spa/node_modules/cordova/node_modules/semver/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,15 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

654
spa/node_modules/cordova/node_modules/semver/README.md generated vendored Normal file
View File

@@ -0,0 +1,654 @@
semver(1) -- The semantic versioner for npm
===========================================
## Install
```bash
npm install semver
````
## Usage
As a node module:
```js
const semver = require('semver')
semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // null
semver.clean(' =v1.2.3 ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
semver.gt('1.2.3', '9.8.7') // false
semver.lt('1.2.3', '9.8.7') // true
semver.minVersion('>=1.0.0') // '1.0.0'
semver.valid(semver.coerce('v2')) // '2.0.0'
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
```
You can also just load the module for the function that you care about if
you'd like to minimize your footprint.
```js
// load the whole API at once in a single object
const semver = require('semver')
// or just load the bits you need
// all of them listed here, just pick and choose what you want
// classes
const SemVer = require('semver/classes/semver')
const Comparator = require('semver/classes/comparator')
const Range = require('semver/classes/range')
// functions for working with versions
const semverParse = require('semver/functions/parse')
const semverValid = require('semver/functions/valid')
const semverClean = require('semver/functions/clean')
const semverInc = require('semver/functions/inc')
const semverDiff = require('semver/functions/diff')
const semverMajor = require('semver/functions/major')
const semverMinor = require('semver/functions/minor')
const semverPatch = require('semver/functions/patch')
const semverPrerelease = require('semver/functions/prerelease')
const semverCompare = require('semver/functions/compare')
const semverRcompare = require('semver/functions/rcompare')
const semverCompareLoose = require('semver/functions/compare-loose')
const semverCompareBuild = require('semver/functions/compare-build')
const semverSort = require('semver/functions/sort')
const semverRsort = require('semver/functions/rsort')
// low-level comparators between versions
const semverGt = require('semver/functions/gt')
const semverLt = require('semver/functions/lt')
const semverEq = require('semver/functions/eq')
const semverNeq = require('semver/functions/neq')
const semverGte = require('semver/functions/gte')
const semverLte = require('semver/functions/lte')
const semverCmp = require('semver/functions/cmp')
const semverCoerce = require('semver/functions/coerce')
// working with ranges
const semverSatisfies = require('semver/functions/satisfies')
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
const semverMinSatisfying = require('semver/ranges/min-satisfying')
const semverToComparators = require('semver/ranges/to-comparators')
const semverMinVersion = require('semver/ranges/min-version')
const semverValidRange = require('semver/ranges/valid')
const semverOutside = require('semver/ranges/outside')
const semverGtr = require('semver/ranges/gtr')
const semverLtr = require('semver/ranges/ltr')
const semverIntersects = require('semver/ranges/intersects')
const semverSimplifyRange = require('semver/ranges/simplify')
const semverRangeSubset = require('semver/ranges/subset')
```
As a command-line utility:
```
$ semver -h
A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter
Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence
Options:
-r --range <range>
Print versions that match the specified range.
-i --increment [<level>]
Increment a version by the specified level. Level can
be one of: major, minor, patch, premajor, preminor,
prepatch, or prerelease. Default level is 'patch'.
Only one version may be specified.
--preid <identifier>
Identifier to be used to prefix premajor, preminor,
prepatch or prerelease version increments.
-l --loose
Interpret versions and ranges loosely
-n <0|1>
This is the base to be used for the prerelease identifier.
-p --include-prerelease
Always include prerelease versions in range matching
-c --coerce
Coerce a string into SemVer if possible
(does not imply --loose)
--rtl
Coerce version strings right to left
--ltr
Coerce version strings left to right (default)
Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.
If no satisfying versions are found, then exits failure.
Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.
```
## Versions
A "version" is described by the `v2.0.0` specification found at
<https://semver.org/>.
A leading `"="` or `"v"` character is stripped off and ignored.
## Ranges
A `version range` is a set of `comparators` that specify versions
that satisfy the range.
A `comparator` is composed of an `operator` and a `version`. The set
of primitive `operators` is:
* `<` Less than
* `<=` Less than or equal to
* `>` Greater than
* `>=` Greater than or equal to
* `=` Equal. If no operator is specified, then equality is assumed,
so this operator is optional but MAY be included.
For example, the comparator `>=1.2.7` would match the versions
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and
would match the versions `2.0.0` and `3.1.0`, but not the versions
`1.0.1` or `1.1.0`.
Comparators can be joined by whitespace to form a `comparator set`,
which is satisfied by the **intersection** of all of the comparators
it includes.
A range is composed of one or more comparator sets, joined by `||`. A
version matches a range if and only if every comparator in at least
one of the `||`-separated comparator sets is satisfied by the version.
For example, the range `>=1.2.7 <1.3.0` would match the versions
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
or `1.1.0`.
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
### Prerelease Tags
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
it will only be allowed to satisfy comparator sets if at least one
comparator with the same `[major, minor, patch]` tuple also has a
prerelease tag.
For example, the range `>1.2.3-alpha.3` would be allowed to match the
version `1.2.3-alpha.7`, but it would *not* be satisfied by
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
range only accepts prerelease tags on the `1.2.3` version.
Version `3.4.5` *would* satisfy the range because it does not have a
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
The purpose of this behavior is twofold. First, prerelease versions
frequently are updated very quickly, and contain many breaking changes
that are (by the author's design) not yet fit for public consumption.
Therefore, by default, they are excluded from range-matching
semantics.
Second, a user who has opted into using a prerelease version has
indicated the intent to use *that specific* set of
alpha/beta/rc versions. By including a prerelease tag in the range,
the user is indicating that they are aware of the risk. However, it
is still not appropriate to assume that they have opted into taking a
similar risk on the *next* set of prerelease versions.
Note that this behavior can be suppressed (treating all prerelease
versions as if they were normal versions, for range-matching)
by setting the `includePrerelease` flag on the options
object to any
[functions](https://github.com/npm/node-semver#functions) that do
range matching.
#### Prerelease Identifiers
The method `.inc` takes an additional `identifier` string argument that
will append the value of the string as a prerelease identifier:
```javascript
semver.inc('1.2.3', 'prerelease', 'beta')
// '1.2.4-beta.0'
```
command-line example:
```bash
$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0
```
Which then can be used to increment further:
```bash
$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1
```
#### Prerelease Identifier Base
The method `.inc` takes an optional parameter 'identifierBase' string
that will let you let your prerelease number as zero-based or one-based.
Set to `false` to omit the prerelease number altogether.
If you do not specify this parameter, it will default to zero-based.
```javascript
semver.inc('1.2.3', 'prerelease', 'beta', '1')
// '1.2.4-beta.1'
```
```javascript
semver.inc('1.2.3', 'prerelease', 'beta', false)
// '1.2.4-beta'
```
command-line example:
```bash
$ semver 1.2.3 -i prerelease --preid beta -n 1
1.2.4-beta.1
```
```bash
$ semver 1.2.3 -i prerelease --preid beta -n false
1.2.4-beta
```
### Advanced Range Syntax
Advanced range syntax desugars to primitive comparators in
deterministic ways.
Advanced ranges may be combined in the same way as primitive
comparators using white space or `||`.
#### Hyphen Ranges `X.Y.Z - A.B.C`
Specifies an inclusive set.
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
If a partial version is provided as the first version in the inclusive
range, then the missing pieces are replaced with zeroes.
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
If a partial version is provided as the second version in the
inclusive range, then all versions that start with the supplied parts
of the tuple are accepted, but nothing that would be greater than the
provided tuple parts.
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
numeric values in the `[major, minor, patch]` tuple.
* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless
`includePrerelease` is specified, in which case any version at all
satisfies)
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
A partial version range is treated as an X-Range, so the special
character is in fact optional.
* `""` (empty string) := `*` := `>=0.0.0`
* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
Allows patch-level changes if a minor version is specified on the
comparator. Allows minor-level changes if not.
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
Allows changes that do not modify the left-most non-zero element in the
`[major, minor, patch]` tuple. In other words, this allows patch and
minor updates for versions `1.0.0` and above, patch updates for
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
Many authors treat a `0.x` version as if the `x` were the major
"breaking-change" indicator.
Caret ranges are ideal when an author may make breaking changes
between `0.2.4` and `0.3.0` releases, which is a common practice.
However, it presumes that there will *not* be breaking changes between
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
additive (but non-breaking), according to commonly observed practices.
* `^1.2.3` := `>=1.2.3 <2.0.0-0`
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
`0.0.3` version *only* will be allowed, if they are greater than or
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
When parsing caret ranges, a missing `patch` value desugars to the
number `0`, but will allow flexibility within that value, even if the
major and minor versions are both `0`.
* `^1.2.x` := `>=1.2.0 <2.0.0-0`
* `^0.0.x` := `>=0.0.0 <0.1.0-0`
* `^0.0` := `>=0.0.0 <0.1.0-0`
A missing `minor` and `patch` values will desugar to zero, but also
allow flexibility within those values, even if the major version is
zero.
* `^1.x` := `>=1.0.0 <2.0.0-0`
* `^0.x` := `>=0.0.0 <1.0.0-0`
### Range Grammar
Putting all this together, here is a Backus-Naur grammar for ranges,
for the benefit of parser authors:
```bnf
range-set ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+
```
## Functions
All methods and classes take a final `options` object argument. All
options in this object are `false` by default. The options supported
are:
- `loose`: Be more forgiving about not-quite-valid semver strings.
(Any resulting output will always be 100% strict compliant, of
course.) For backwards compatibility reasons, if the `options`
argument is a boolean value instead of an object, it is interpreted
to be the `loose` param.
- `includePrerelease`: Set to suppress the [default
behavior](https://github.com/npm/node-semver#prerelease-tags) of
excluding prerelease tagged versions from ranges unless they are
explicitly opted into.
Strict-mode Comparators and Ranges will be strict about the SemVer
strings that they parse.
* `valid(v)`: Return the parsed version, or null if it's not valid.
* `inc(v, release, options, identifier, identifierBase)`:
Return the version incremented by the release
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
`prepatch`, or `prerelease`), or null if it's not valid
* `premajor` in one call will bump the version up to the next major
version and down to a prerelease of that major version.
`preminor`, and `prepatch` work the same way.
* If called from a non-prerelease version, `prerelease` will work the
same as `prepatch`. It increments the patch version and then makes a
prerelease. If the input version is already a prerelease it simply
increments it.
* `identifier` can be used to prefix `premajor`, `preminor`,
`prepatch`, or `prerelease` version increments. `identifierBase`
is the base to be used for the `prerelease` identifier.
* `prerelease(v)`: Returns an array of prerelease components, or null
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
* `major(v)`: Return the major version number.
* `minor(v)`: Return the minor version number.
* `patch(v)`: Return the patch version number.
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
or comparators intersect.
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
a `SemVer` object or `null`.
### Comparison
* `gt(v1, v2)`: `v1 > v2`
* `gte(v1, v2)`: `v1 >= v2`
* `lt(v1, v2)`: `v1 < v2`
* `lte(v1, v2)`: `v1 <= v2`
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
even if they're not the same string. You already know how to
compare strings.
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
the corresponding function above. `"==="` and `"!=="` do simple
string comparison, but are included for completeness. Throws if an
invalid comparison string is provided.
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
* `rcompare(v1, v2)`: The reverse of `compare`. Sorts an array of versions
in descending order when passed to `Array.sort()`.
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
are equal. Sorts in ascending order if passed to `Array.sort()`.
* `compareLoose(v1, v2)`: Short for ``compare(v1, v2, { loose: true })`.
* `diff(v1, v2)`: Returns the difference between two versions by the release type
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
or null if the versions are the same.
### Sorting
* `sort(versions)`: Returns a sorted array of versions based on the `compareBuild`
function.
* `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on
the `compareBuild` function in descending order.
### Comparators
* `intersects(comparator)`: Return true if the comparators intersect
### Ranges
* `validRange(range)`: Return the valid range or null if it's not valid
* `satisfies(version, range)`: Return true if the version satisfies the
range.
* `maxSatisfying(versions, range)`: Return the highest version in the list
that satisfies the range, or `null` if none of them do.
* `minSatisfying(versions, range)`: Return the lowest version in the list
that satisfies the range, or `null` if none of them do.
* `minVersion(range)`: Return the lowest version that can match
the given range.
* `gtr(version, range)`: Return `true` if the version is greater than all the
versions possible in the range.
* `ltr(version, range)`: Return `true` if the version is less than all the
versions possible in the range.
* `outside(version, range, hilo)`: Return true if the version is outside
the bounds of the range in either the high or low direction. The
`hilo` argument must be either the string `'>'` or `'<'`. (This is
the function called by `gtr` and `ltr`.)
* `intersects(range)`: Return true if any of the range comparators intersect.
* `simplifyRange(versions, range)`: Return a "simplified" range that
matches the same items in the `versions` list as the range specified. Note
that it does *not* guarantee that it would match the same versions in all
cases, only for the set of versions provided. This is useful when
generating ranges by joining together multiple versions with `||`
programmatically, to provide the user with something a bit more
ergonomic. If the provided range is shorter in string-length than the
generated range, then that is returned.
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
entirely contained by the `superRange` range.
Note that, since ranges may be non-contiguous, a version might not be
greater than a range, less than a range, *or* satisfy a range! For
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
until `2.0.0`, so version `1.2.10` would not be greater than the
range (because `2.0.1` satisfies, which is higher), nor less than the
range (since `1.2.8` satisfies, which is lower), and it also does not
satisfy the range.
If you want to know if a version satisfies or does not satisfy a
range, use the `satisfies(version, range)` function.
### Coercion
* `coerce(version, options)`: Coerces a string to semver if possible
This aims to provide a very forgiving translation of a non-semver string to
semver. It looks for the first digit in a string and consumes all
remaining characters which satisfy at least a partial semver (e.g., `1`,
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
is not valid). The maximum length for any semver component considered for
coercion is 16 characters; longer components will be ignored
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
components are invalid (`9999999999999999.4.7.4` is likely invalid).
If the `options.rtl` flag is set, then `coerce` will return the right-most
coercible tuple that does not share an ending index with a longer coercible
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
any other overlapping SemVer tuple.
If the `options.includePrerelease` flag is set, then the `coerce` result will contain
prerelease and build parts of a version. For example, `1.2.3.4-rc.1+rev.2`
will preserve prerelease `rc.1` and build `rev.2` in the result.
### Clean
* `clean(version)`: Clean a string to be a valid semver if possible
This will return a cleaned and trimmed semver version. If the provided
version is not valid a null will be returned. This does not work for
ranges.
ex.
* `s.clean(' = v 2.1.5foo')`: `null`
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
* `s.clean(' = v 2.1.5-foo')`: `null`
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
* `s.clean('=v2.1.5')`: `'2.1.5'`
* `s.clean(' =v2.1.5')`: `'2.1.5'`
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
* `s.clean('~1.0.0')`: `null`
## Constants
As a convenience, helper constants are exported to provide information about what `node-semver` supports:
### `RELEASE_TYPES`
- major
- premajor
- minor
- preminor
- patch
- prepatch
- prerelease
```
const semver = require('semver');
if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
console.log('This is a valid release type!');
} else {
console.warn('This is NOT a valid release type!');
}
```
### `SEMVER_SPEC_VERSION`
2.0.0
```
const semver = require('semver');
console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION);
```
## Exported Modules
<!--
TODO: Make sure that all of these items are documented (classes aren't,
eg), and then pull the module name into the documentation for that specific
thing.
-->
You may pull in just the part of this semver utility that you need if you
are sensitive to packing and tree-shaking concerns. The main
`require('semver')` export uses getter functions to lazily load the parts
of the API that are used.
The following modules are available:
* `require('semver')`
* `require('semver/classes')`
* `require('semver/classes/comparator')`
* `require('semver/classes/range')`
* `require('semver/classes/semver')`
* `require('semver/functions/clean')`
* `require('semver/functions/cmp')`
* `require('semver/functions/coerce')`
* `require('semver/functions/compare')`
* `require('semver/functions/compare-build')`
* `require('semver/functions/compare-loose')`
* `require('semver/functions/diff')`
* `require('semver/functions/eq')`
* `require('semver/functions/gt')`
* `require('semver/functions/gte')`
* `require('semver/functions/inc')`
* `require('semver/functions/lt')`
* `require('semver/functions/lte')`
* `require('semver/functions/major')`
* `require('semver/functions/minor')`
* `require('semver/functions/neq')`
* `require('semver/functions/parse')`
* `require('semver/functions/patch')`
* `require('semver/functions/prerelease')`
* `require('semver/functions/rcompare')`
* `require('semver/functions/rsort')`
* `require('semver/functions/satisfies')`
* `require('semver/functions/sort')`
* `require('semver/functions/valid')`
* `require('semver/ranges/gtr')`
* `require('semver/ranges/intersects')`
* `require('semver/ranges/ltr')`
* `require('semver/ranges/max-satisfying')`
* `require('semver/ranges/min-satisfying')`
* `require('semver/ranges/min-version')`
* `require('semver/ranges/outside')`
* `require('semver/ranges/simplify')`
* `require('semver/ranges/subset')`
* `require('semver/ranges/to-comparators')`
* `require('semver/ranges/valid')`

188
spa/node_modules/cordova/node_modules/semver/bin/semver.js generated vendored Executable file
View File

@@ -0,0 +1,188 @@
#!/usr/bin/env node
// Standalone semver comparison program.
// Exits successfully and prints matching version(s) if
// any supplied version is valid and passes all tests.
const argv = process.argv.slice(2)
let versions = []
const range = []
let inc = null
const version = require('../package.json').version
let loose = false
let includePrerelease = false
let coerce = false
let rtl = false
let identifier
let identifierBase
const semver = require('../')
const parseOptions = require('../internal/parse-options')
let reverse = false
let options = {}
const main = () => {
if (!argv.length) {
return help()
}
while (argv.length) {
let a = argv.shift()
const indexOfEqualSign = a.indexOf('=')
if (indexOfEqualSign !== -1) {
const value = a.slice(indexOfEqualSign + 1)
a = a.slice(0, indexOfEqualSign)
argv.unshift(value)
}
switch (a) {
case '-rv': case '-rev': case '--rev': case '--reverse':
reverse = true
break
case '-l': case '--loose':
loose = true
break
case '-p': case '--include-prerelease':
includePrerelease = true
break
case '-v': case '--version':
versions.push(argv.shift())
break
case '-i': case '--inc': case '--increment':
switch (argv[0]) {
case 'major': case 'minor': case 'patch': case 'prerelease':
case 'premajor': case 'preminor': case 'prepatch':
inc = argv.shift()
break
default:
inc = 'patch'
break
}
break
case '--preid':
identifier = argv.shift()
break
case '-r': case '--range':
range.push(argv.shift())
break
case '-n':
identifierBase = argv.shift()
if (identifierBase === 'false') {
identifierBase = false
}
break
case '-c': case '--coerce':
coerce = true
break
case '--rtl':
rtl = true
break
case '--ltr':
rtl = false
break
case '-h': case '--help': case '-?':
return help()
default:
versions.push(a)
break
}
}
options = parseOptions({ loose, includePrerelease, rtl })
versions = versions.map((v) => {
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
}).filter((v) => {
return semver.valid(v)
})
if (!versions.length) {
return fail()
}
if (inc && (versions.length !== 1 || range.length)) {
return failInc()
}
for (let i = 0, l = range.length; i < l; i++) {
versions = versions.filter((v) => {
return semver.satisfies(v, range[i], options)
})
if (!versions.length) {
return fail()
}
}
versions
.sort((a, b) => semver[reverse ? 'rcompare' : 'compare'](a, b, options))
.map(v => semver.clean(v, options))
.map(v => inc ? semver.inc(v, inc, options, identifier, identifierBase) : v)
.forEach(v => console.log(v))
}
const failInc = () => {
console.error('--inc can only be used on a single version with no range')
fail()
}
const fail = () => process.exit(1)
const help = () => console.log(
`SemVer ${version}
A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter
Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence
Options:
-r --range <range>
Print versions that match the specified range.
-i --increment [<level>]
Increment a version by the specified level. Level can
be one of: major, minor, patch, premajor, preminor,
prepatch, or prerelease. Default level is 'patch'.
Only one version may be specified.
--preid <identifier>
Identifier to be used to prefix premajor, preminor,
prepatch or prerelease version increments.
-l --loose
Interpret versions and ranges loosely
-p --include-prerelease
Always include prerelease versions in range matching
-c --coerce
Coerce a string into SemVer if possible
(does not imply --loose)
--rtl
Coerce version strings right to left
--ltr
Coerce version strings left to right (default)
-n <base>
Base number to be used for the prerelease identifier.
Can be either 0 or 1, or false to omit the number altogether.
Defaults to 0.
Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.
If no satisfying versions are found, then exits failure.
Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.`)
main()

View File

@@ -0,0 +1,141 @@
const ANY = Symbol('SemVer ANY')
// hoisted class for cyclic dependency
class Comparator {
static get ANY () {
return ANY
}
constructor (comp, options) {
options = parseOptions(options)
if (comp instanceof Comparator) {
if (comp.loose === !!options.loose) {
return comp
} else {
comp = comp.value
}
}
comp = comp.trim().split(/\s+/).join(' ')
debug('comparator', comp, options)
this.options = options
this.loose = !!options.loose
this.parse(comp)
if (this.semver === ANY) {
this.value = ''
} else {
this.value = this.operator + this.semver.version
}
debug('comp', this)
}
parse (comp) {
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
const m = comp.match(r)
if (!m) {
throw new TypeError(`Invalid comparator: ${comp}`)
}
this.operator = m[1] !== undefined ? m[1] : ''
if (this.operator === '=') {
this.operator = ''
}
// if it literally is just '>' or '' then allow anything.
if (!m[2]) {
this.semver = ANY
} else {
this.semver = new SemVer(m[2], this.options.loose)
}
}
toString () {
return this.value
}
test (version) {
debug('Comparator.test', version, this.options.loose)
if (this.semver === ANY || version === ANY) {
return true
}
if (typeof version === 'string') {
try {
version = new SemVer(version, this.options)
} catch (er) {
return false
}
}
return cmp(version, this.operator, this.semver, this.options)
}
intersects (comp, options) {
if (!(comp instanceof Comparator)) {
throw new TypeError('a Comparator is required')
}
if (this.operator === '') {
if (this.value === '') {
return true
}
return new Range(comp.value, options).test(this.value)
} else if (comp.operator === '') {
if (comp.value === '') {
return true
}
return new Range(this.value, options).test(comp.semver)
}
options = parseOptions(options)
// Special cases where nothing can possibly be lower
if (options.includePrerelease &&
(this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
return false
}
if (!options.includePrerelease &&
(this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
return false
}
// Same direction increasing (> or >=)
if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
return true
}
// Same direction decreasing (< or <=)
if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
return true
}
// same SemVer and both sides are inclusive (<= or >=)
if (
(this.semver.version === comp.semver.version) &&
this.operator.includes('=') && comp.operator.includes('=')) {
return true
}
// opposite directions less than
if (cmp(this.semver, '<', comp.semver, options) &&
this.operator.startsWith('>') && comp.operator.startsWith('<')) {
return true
}
// opposite directions greater than
if (cmp(this.semver, '>', comp.semver, options) &&
this.operator.startsWith('<') && comp.operator.startsWith('>')) {
return true
}
return false
}
}
module.exports = Comparator
const parseOptions = require('../internal/parse-options')
const { safeRe: re, t } = require('../internal/re')
const cmp = require('../functions/cmp')
const debug = require('../internal/debug')
const SemVer = require('./semver')
const Range = require('./range')

View File

@@ -0,0 +1,5 @@
module.exports = {
SemVer: require('./semver.js'),
Range: require('./range.js'),
Comparator: require('./comparator.js'),
}

View File

@@ -0,0 +1,540 @@
// hoisted class for cyclic dependency
class Range {
constructor (range, options) {
options = parseOptions(options)
if (range instanceof Range) {
if (
range.loose === !!options.loose &&
range.includePrerelease === !!options.includePrerelease
) {
return range
} else {
return new Range(range.raw, options)
}
}
if (range instanceof Comparator) {
// just put it in the set and return
this.raw = range.value
this.set = [[range]]
this.format()
return this
}
this.options = options
this.loose = !!options.loose
this.includePrerelease = !!options.includePrerelease
// First reduce all whitespace as much as possible so we do not have to rely
// on potentially slow regexes like \s*. This is then stored and used for
// future error messages as well.
this.raw = range
.trim()
.split(/\s+/)
.join(' ')
// First, split on ||
this.set = this.raw
.split('||')
// map the range to a 2d array of comparators
.map(r => this.parseRange(r.trim()))
// throw out any comparator lists that are empty
// this generally means that it was not a valid range, which is allowed
// in loose mode, but will still throw if the WHOLE range is invalid.
.filter(c => c.length)
if (!this.set.length) {
throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
}
// if we have any that are not the null set, throw out null sets.
if (this.set.length > 1) {
// keep the first one, in case they're all null sets
const first = this.set[0]
this.set = this.set.filter(c => !isNullSet(c[0]))
if (this.set.length === 0) {
this.set = [first]
} else if (this.set.length > 1) {
// if we have any that are *, then the range is just *
for (const c of this.set) {
if (c.length === 1 && isAny(c[0])) {
this.set = [c]
break
}
}
}
}
this.format()
}
format () {
this.range = this.set
.map((comps) => comps.join(' ').trim())
.join('||')
.trim()
return this.range
}
toString () {
return this.range
}
parseRange (range) {
// memoize range parsing for performance.
// this is a very hot path, and fully deterministic.
const memoOpts =
(this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
(this.options.loose && FLAG_LOOSE)
const memoKey = memoOpts + ':' + range
const cached = cache.get(memoKey)
if (cached) {
return cached
}
const loose = this.options.loose
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
debug('hyphen replace', range)
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
debug('comparator trim', range)
// `~ 1.2.3` => `~1.2.3`
range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
debug('tilde trim', range)
// `^ 1.2.3` => `^1.2.3`
range = range.replace(re[t.CARETTRIM], caretTrimReplace)
debug('caret trim', range)
// At this point, the range is completely trimmed and
// ready to be split into comparators.
let rangeList = range
.split(' ')
.map(comp => parseComparator(comp, this.options))
.join(' ')
.split(/\s+/)
// >=0.0.0 is equivalent to *
.map(comp => replaceGTE0(comp, this.options))
if (loose) {
// in loose mode, throw out any that are not valid comparators
rangeList = rangeList.filter(comp => {
debug('loose invalid filter', comp, this.options)
return !!comp.match(re[t.COMPARATORLOOSE])
})
}
debug('range list', rangeList)
// if any comparators are the null set, then replace with JUST null set
// if more than one comparator, remove any * comparators
// also, don't include the same comparator more than once
const rangeMap = new Map()
const comparators = rangeList.map(comp => new Comparator(comp, this.options))
for (const comp of comparators) {
if (isNullSet(comp)) {
return [comp]
}
rangeMap.set(comp.value, comp)
}
if (rangeMap.size > 1 && rangeMap.has('')) {
rangeMap.delete('')
}
const result = [...rangeMap.values()]
cache.set(memoKey, result)
return result
}
intersects (range, options) {
if (!(range instanceof Range)) {
throw new TypeError('a Range is required')
}
return this.set.some((thisComparators) => {
return (
isSatisfiable(thisComparators, options) &&
range.set.some((rangeComparators) => {
return (
isSatisfiable(rangeComparators, options) &&
thisComparators.every((thisComparator) => {
return rangeComparators.every((rangeComparator) => {
return thisComparator.intersects(rangeComparator, options)
})
})
)
})
)
})
}
// if ANY of the sets match ALL of its comparators, then pass
test (version) {
if (!version) {
return false
}
if (typeof version === 'string') {
try {
version = new SemVer(version, this.options)
} catch (er) {
return false
}
}
for (let i = 0; i < this.set.length; i++) {
if (testSet(this.set[i], version, this.options)) {
return true
}
}
return false
}
}
module.exports = Range
const LRU = require('../internal/lrucache')
const cache = new LRU()
const parseOptions = require('../internal/parse-options')
const Comparator = require('./comparator')
const debug = require('../internal/debug')
const SemVer = require('./semver')
const {
safeRe: re,
t,
comparatorTrimReplace,
tildeTrimReplace,
caretTrimReplace,
} = require('../internal/re')
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')
const isNullSet = c => c.value === '<0.0.0-0'
const isAny = c => c.value === ''
// take a set of comparators and determine whether there
// exists a version which can satisfy it
const isSatisfiable = (comparators, options) => {
let result = true
const remainingComparators = comparators.slice()
let testComparator = remainingComparators.pop()
while (result && remainingComparators.length) {
result = remainingComparators.every((otherComparator) => {
return testComparator.intersects(otherComparator, options)
})
testComparator = remainingComparators.pop()
}
return result
}
// comprised of xranges, tildes, stars, and gtlt's at this point.
// already replaced the hyphen ranges
// turn into a set of JUST comparators.
const parseComparator = (comp, options) => {
debug('comp', comp, options)
comp = replaceCarets(comp, options)
debug('caret', comp)
comp = replaceTildes(comp, options)
debug('tildes', comp)
comp = replaceXRanges(comp, options)
debug('xrange', comp)
comp = replaceStars(comp, options)
debug('stars', comp)
return comp
}
const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
// ~, ~> --> * (any, kinda silly)
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
// ~0.0.1 --> >=0.0.1 <0.1.0-0
const replaceTildes = (comp, options) => {
return comp
.trim()
.split(/\s+/)
.map((c) => replaceTilde(c, options))
.join(' ')
}
const replaceTilde = (comp, options) => {
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
return comp.replace(r, (_, M, m, p, pr) => {
debug('tilde', comp, _, M, m, p, pr)
let ret
if (isX(M)) {
ret = ''
} else if (isX(m)) {
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`
} else if (isX(p)) {
// ~1.2 == >=1.2.0 <1.3.0-0
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`
} else if (pr) {
debug('replaceTilde pr', pr)
ret = `>=${M}.${m}.${p}-${pr
} <${M}.${+m + 1}.0-0`
} else {
// ~1.2.3 == >=1.2.3 <1.3.0-0
ret = `>=${M}.${m}.${p
} <${M}.${+m + 1}.0-0`
}
debug('tilde return', ret)
return ret
})
}
// ^ --> * (any, kinda silly)
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
// ^1.2.3 --> >=1.2.3 <2.0.0-0
// ^1.2.0 --> >=1.2.0 <2.0.0-0
// ^0.0.1 --> >=0.0.1 <0.0.2-0
// ^0.1.0 --> >=0.1.0 <0.2.0-0
const replaceCarets = (comp, options) => {
return comp
.trim()
.split(/\s+/)
.map((c) => replaceCaret(c, options))
.join(' ')
}
const replaceCaret = (comp, options) => {
debug('caret', comp, options)
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
const z = options.includePrerelease ? '-0' : ''
return comp.replace(r, (_, M, m, p, pr) => {
debug('caret', comp, _, M, m, p, pr)
let ret
if (isX(M)) {
ret = ''
} else if (isX(m)) {
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
} else if (isX(p)) {
if (M === '0') {
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
} else {
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
}
} else if (pr) {
debug('replaceCaret pr', pr)
if (M === '0') {
if (m === '0') {
ret = `>=${M}.${m}.${p}-${pr
} <${M}.${m}.${+p + 1}-0`
} else {
ret = `>=${M}.${m}.${p}-${pr
} <${M}.${+m + 1}.0-0`
}
} else {
ret = `>=${M}.${m}.${p}-${pr
} <${+M + 1}.0.0-0`
}
} else {
debug('no pr')
if (M === '0') {
if (m === '0') {
ret = `>=${M}.${m}.${p
}${z} <${M}.${m}.${+p + 1}-0`
} else {
ret = `>=${M}.${m}.${p
}${z} <${M}.${+m + 1}.0-0`
}
} else {
ret = `>=${M}.${m}.${p
} <${+M + 1}.0.0-0`
}
}
debug('caret return', ret)
return ret
})
}
const replaceXRanges = (comp, options) => {
debug('replaceXRanges', comp, options)
return comp
.split(/\s+/)
.map((c) => replaceXRange(c, options))
.join(' ')
}
const replaceXRange = (comp, options) => {
comp = comp.trim()
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
debug('xRange', comp, ret, gtlt, M, m, p, pr)
const xM = isX(M)
const xm = xM || isX(m)
const xp = xm || isX(p)
const anyX = xp
if (gtlt === '=' && anyX) {
gtlt = ''
}
// if we're including prereleases in the match, then we need
// to fix this to -0, the lowest possible prerelease value
pr = options.includePrerelease ? '-0' : ''
if (xM) {
if (gtlt === '>' || gtlt === '<') {
// nothing is allowed
ret = '<0.0.0-0'
} else {
// nothing is forbidden
ret = '*'
}
} else if (gtlt && anyX) {
// we know patch is an x, because we have any x at all.
// replace X with 0
if (xm) {
m = 0
}
p = 0
if (gtlt === '>') {
// >1 => >=2.0.0
// >1.2 => >=1.3.0
gtlt = '>='
if (xm) {
M = +M + 1
m = 0
p = 0
} else {
m = +m + 1
p = 0
}
} else if (gtlt === '<=') {
// <=0.7.x is actually <0.8.0, since any 0.7.x should
// pass. Similarly, <=7.x is actually <8.0.0, etc.
gtlt = '<'
if (xm) {
M = +M + 1
} else {
m = +m + 1
}
}
if (gtlt === '<') {
pr = '-0'
}
ret = `${gtlt + M}.${m}.${p}${pr}`
} else if (xm) {
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
} else if (xp) {
ret = `>=${M}.${m}.0${pr
} <${M}.${+m + 1}.0-0`
}
debug('xRange return', ret)
return ret
})
}
// Because * is AND-ed with everything else in the comparator,
// and '' means "any version", just remove the *s entirely.
const replaceStars = (comp, options) => {
debug('replaceStars', comp, options)
// Looseness is ignored here. star is always as loose as it gets!
return comp
.trim()
.replace(re[t.STAR], '')
}
const replaceGTE0 = (comp, options) => {
debug('replaceGTE0', comp, options)
return comp
.trim()
.replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
}
// This function is passed to string.replace(re[t.HYPHENRANGE])
// M, m, patch, prerelease, build
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
// TODO build?
const hyphenReplace = incPr => ($0,
from, fM, fm, fp, fpr, fb,
to, tM, tm, tp, tpr) => {
if (isX(fM)) {
from = ''
} else if (isX(fm)) {
from = `>=${fM}.0.0${incPr ? '-0' : ''}`
} else if (isX(fp)) {
from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
} else if (fpr) {
from = `>=${from}`
} else {
from = `>=${from}${incPr ? '-0' : ''}`
}
if (isX(tM)) {
to = ''
} else if (isX(tm)) {
to = `<${+tM + 1}.0.0-0`
} else if (isX(tp)) {
to = `<${tM}.${+tm + 1}.0-0`
} else if (tpr) {
to = `<=${tM}.${tm}.${tp}-${tpr}`
} else if (incPr) {
to = `<${tM}.${tm}.${+tp + 1}-0`
} else {
to = `<=${to}`
}
return `${from} ${to}`.trim()
}
const testSet = (set, version, options) => {
for (let i = 0; i < set.length; i++) {
if (!set[i].test(version)) {
return false
}
}
if (version.prerelease.length && !options.includePrerelease) {
// Find the set of versions that are allowed to have prereleases
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
// That should allow `1.2.3-pr.2` to pass.
// However, `1.2.4-alpha.notready` should NOT be allowed,
// even though it's within the range set by the comparators.
for (let i = 0; i < set.length; i++) {
debug(set[i].semver)
if (set[i].semver === Comparator.ANY) {
continue
}
if (set[i].semver.prerelease.length > 0) {
const allowed = set[i].semver
if (allowed.major === version.major &&
allowed.minor === version.minor &&
allowed.patch === version.patch) {
return true
}
}
}
// Version has a -pre, but it's not one of the ones we like.
return false
}
return true
}

View File

@@ -0,0 +1,302 @@
const debug = require('../internal/debug')
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
const { safeRe: re, t } = require('../internal/re')
const parseOptions = require('../internal/parse-options')
const { compareIdentifiers } = require('../internal/identifiers')
class SemVer {
constructor (version, options) {
options = parseOptions(options)
if (version instanceof SemVer) {
if (version.loose === !!options.loose &&
version.includePrerelease === !!options.includePrerelease) {
return version
} else {
version = version.version
}
} else if (typeof version !== 'string') {
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
}
if (version.length > MAX_LENGTH) {
throw new TypeError(
`version is longer than ${MAX_LENGTH} characters`
)
}
debug('SemVer', version, options)
this.options = options
this.loose = !!options.loose
// this isn't actually relevant for versions, but keep it so that we
// don't run into trouble passing this.options around.
this.includePrerelease = !!options.includePrerelease
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
if (!m) {
throw new TypeError(`Invalid Version: ${version}`)
}
this.raw = version
// these are actually numbers
this.major = +m[1]
this.minor = +m[2]
this.patch = +m[3]
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
throw new TypeError('Invalid major version')
}
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
throw new TypeError('Invalid minor version')
}
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
throw new TypeError('Invalid patch version')
}
// numberify any prerelease numeric ids
if (!m[4]) {
this.prerelease = []
} else {
this.prerelease = m[4].split('.').map((id) => {
if (/^[0-9]+$/.test(id)) {
const num = +id
if (num >= 0 && num < MAX_SAFE_INTEGER) {
return num
}
}
return id
})
}
this.build = m[5] ? m[5].split('.') : []
this.format()
}
format () {
this.version = `${this.major}.${this.minor}.${this.patch}`
if (this.prerelease.length) {
this.version += `-${this.prerelease.join('.')}`
}
return this.version
}
toString () {
return this.version
}
compare (other) {
debug('SemVer.compare', this.version, this.options, other)
if (!(other instanceof SemVer)) {
if (typeof other === 'string' && other === this.version) {
return 0
}
other = new SemVer(other, this.options)
}
if (other.version === this.version) {
return 0
}
return this.compareMain(other) || this.comparePre(other)
}
compareMain (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
return (
compareIdentifiers(this.major, other.major) ||
compareIdentifiers(this.minor, other.minor) ||
compareIdentifiers(this.patch, other.patch)
)
}
comparePre (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
// NOT having a prerelease is > having one
if (this.prerelease.length && !other.prerelease.length) {
return -1
} else if (!this.prerelease.length && other.prerelease.length) {
return 1
} else if (!this.prerelease.length && !other.prerelease.length) {
return 0
}
let i = 0
do {
const a = this.prerelease[i]
const b = other.prerelease[i]
debug('prerelease compare', i, a, b)
if (a === undefined && b === undefined) {
return 0
} else if (b === undefined) {
return 1
} else if (a === undefined) {
return -1
} else if (a === b) {
continue
} else {
return compareIdentifiers(a, b)
}
} while (++i)
}
compareBuild (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
let i = 0
do {
const a = this.build[i]
const b = other.build[i]
debug('build compare', i, a, b)
if (a === undefined && b === undefined) {
return 0
} else if (b === undefined) {
return 1
} else if (a === undefined) {
return -1
} else if (a === b) {
continue
} else {
return compareIdentifiers(a, b)
}
} while (++i)
}
// preminor will bump the version up to the next minor release, and immediately
// down to pre-release. premajor and prepatch work the same way.
inc (release, identifier, identifierBase) {
switch (release) {
case 'premajor':
this.prerelease.length = 0
this.patch = 0
this.minor = 0
this.major++
this.inc('pre', identifier, identifierBase)
break
case 'preminor':
this.prerelease.length = 0
this.patch = 0
this.minor++
this.inc('pre', identifier, identifierBase)
break
case 'prepatch':
// If this is already a prerelease, it will bump to the next version
// drop any prereleases that might already exist, since they are not
// relevant at this point.
this.prerelease.length = 0
this.inc('patch', identifier, identifierBase)
this.inc('pre', identifier, identifierBase)
break
// If the input is a non-prerelease version, this acts the same as
// prepatch.
case 'prerelease':
if (this.prerelease.length === 0) {
this.inc('patch', identifier, identifierBase)
}
this.inc('pre', identifier, identifierBase)
break
case 'major':
// If this is a pre-major version, bump up to the same major version.
// Otherwise increment major.
// 1.0.0-5 bumps to 1.0.0
// 1.1.0 bumps to 2.0.0
if (
this.minor !== 0 ||
this.patch !== 0 ||
this.prerelease.length === 0
) {
this.major++
}
this.minor = 0
this.patch = 0
this.prerelease = []
break
case 'minor':
// If this is a pre-minor version, bump up to the same minor version.
// Otherwise increment minor.
// 1.2.0-5 bumps to 1.2.0
// 1.2.1 bumps to 1.3.0
if (this.patch !== 0 || this.prerelease.length === 0) {
this.minor++
}
this.patch = 0
this.prerelease = []
break
case 'patch':
// If this is not a pre-release version, it will increment the patch.
// If it is a pre-release it will bump up to the same patch version.
// 1.2.0-5 patches to 1.2.0
// 1.2.0 patches to 1.2.1
if (this.prerelease.length === 0) {
this.patch++
}
this.prerelease = []
break
// This probably shouldn't be used publicly.
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
case 'pre': {
const base = Number(identifierBase) ? 1 : 0
if (!identifier && identifierBase === false) {
throw new Error('invalid increment argument: identifier is empty')
}
if (this.prerelease.length === 0) {
this.prerelease = [base]
} else {
let i = this.prerelease.length
while (--i >= 0) {
if (typeof this.prerelease[i] === 'number') {
this.prerelease[i]++
i = -2
}
}
if (i === -1) {
// didn't increment anything
if (identifier === this.prerelease.join('.') && identifierBase === false) {
throw new Error('invalid increment argument: identifier already exists')
}
this.prerelease.push(base)
}
}
if (identifier) {
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
let prerelease = [identifier, base]
if (identifierBase === false) {
prerelease = [identifier]
}
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
if (isNaN(this.prerelease[1])) {
this.prerelease = prerelease
}
} else {
this.prerelease = prerelease
}
}
break
}
default:
throw new Error(`invalid increment argument: ${release}`)
}
this.raw = this.format()
if (this.build.length) {
this.raw += `+${this.build.join('.')}`
}
return this
}
}
module.exports = SemVer

View File

@@ -0,0 +1,6 @@
const parse = require('./parse')
const clean = (version, options) => {
const s = parse(version.trim().replace(/^[=v]+/, ''), options)
return s ? s.version : null
}
module.exports = clean

View File

@@ -0,0 +1,52 @@
const eq = require('./eq')
const neq = require('./neq')
const gt = require('./gt')
const gte = require('./gte')
const lt = require('./lt')
const lte = require('./lte')
const cmp = (a, op, b, loose) => {
switch (op) {
case '===':
if (typeof a === 'object') {
a = a.version
}
if (typeof b === 'object') {
b = b.version
}
return a === b
case '!==':
if (typeof a === 'object') {
a = a.version
}
if (typeof b === 'object') {
b = b.version
}
return a !== b
case '':
case '=':
case '==':
return eq(a, b, loose)
case '!=':
return neq(a, b, loose)
case '>':
return gt(a, b, loose)
case '>=':
return gte(a, b, loose)
case '<':
return lt(a, b, loose)
case '<=':
return lte(a, b, loose)
default:
throw new TypeError(`Invalid operator: ${op}`)
}
}
module.exports = cmp

View File

@@ -0,0 +1,60 @@
const SemVer = require('../classes/semver')
const parse = require('./parse')
const { safeRe: re, t } = require('../internal/re')
const coerce = (version, options) => {
if (version instanceof SemVer) {
return version
}
if (typeof version === 'number') {
version = String(version)
}
if (typeof version !== 'string') {
return null
}
options = options || {}
let match = null
if (!options.rtl) {
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
} else {
// Find the right-most coercible string that does not share
// a terminus with a more left-ward coercible string.
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
// With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
//
// Walk through the string checking with a /g regexp
// Manually set the index so as to pick up overlapping matches.
// Stop when we get a match that ends at the string end, since no
// coercible string can be more right-ward without the same terminus.
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
let next
while ((next = coerceRtlRegex.exec(version)) &&
(!match || match.index + match[0].length !== version.length)
) {
if (!match ||
next.index + next[0].length !== match.index + match[0].length) {
match = next
}
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
}
// leave it in a clean state
coerceRtlRegex.lastIndex = -1
}
if (match === null) {
return null
}
const major = match[2]
const minor = match[3] || '0'
const patch = match[4] || '0'
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
}
module.exports = coerce

View File

@@ -0,0 +1,7 @@
const SemVer = require('../classes/semver')
const compareBuild = (a, b, loose) => {
const versionA = new SemVer(a, loose)
const versionB = new SemVer(b, loose)
return versionA.compare(versionB) || versionA.compareBuild(versionB)
}
module.exports = compareBuild

View File

@@ -0,0 +1,3 @@
const compare = require('./compare')
const compareLoose = (a, b) => compare(a, b, true)
module.exports = compareLoose

View File

@@ -0,0 +1,5 @@
const SemVer = require('../classes/semver')
const compare = (a, b, loose) =>
new SemVer(a, loose).compare(new SemVer(b, loose))
module.exports = compare

View File

@@ -0,0 +1,65 @@
const parse = require('./parse.js')
const diff = (version1, version2) => {
const v1 = parse(version1, null, true)
const v2 = parse(version2, null, true)
const comparison = v1.compare(v2)
if (comparison === 0) {
return null
}
const v1Higher = comparison > 0
const highVersion = v1Higher ? v1 : v2
const lowVersion = v1Higher ? v2 : v1
const highHasPre = !!highVersion.prerelease.length
const lowHasPre = !!lowVersion.prerelease.length
if (lowHasPre && !highHasPre) {
// Going from prerelease -> no prerelease requires some special casing
// If the low version has only a major, then it will always be a major
// Some examples:
// 1.0.0-1 -> 1.0.0
// 1.0.0-1 -> 1.1.1
// 1.0.0-1 -> 2.0.0
if (!lowVersion.patch && !lowVersion.minor) {
return 'major'
}
// Otherwise it can be determined by checking the high version
if (highVersion.patch) {
// anything higher than a patch bump would result in the wrong version
return 'patch'
}
if (highVersion.minor) {
// anything higher than a minor bump would result in the wrong version
return 'minor'
}
// bumping major/minor/patch all have same result
return 'major'
}
// add the `pre` prefix if we are going to a prerelease version
const prefix = highHasPre ? 'pre' : ''
if (v1.major !== v2.major) {
return prefix + 'major'
}
if (v1.minor !== v2.minor) {
return prefix + 'minor'
}
if (v1.patch !== v2.patch) {
return prefix + 'patch'
}
// high and low are preleases
return 'prerelease'
}
module.exports = diff

View File

@@ -0,0 +1,3 @@
const compare = require('./compare')
const eq = (a, b, loose) => compare(a, b, loose) === 0
module.exports = eq

View File

@@ -0,0 +1,3 @@
const compare = require('./compare')
const gt = (a, b, loose) => compare(a, b, loose) > 0
module.exports = gt

View File

@@ -0,0 +1,3 @@
const compare = require('./compare')
const gte = (a, b, loose) => compare(a, b, loose) >= 0
module.exports = gte

View File

@@ -0,0 +1,19 @@
const SemVer = require('../classes/semver')
const inc = (version, release, options, identifier, identifierBase) => {
if (typeof (options) === 'string') {
identifierBase = identifier
identifier = options
options = undefined
}
try {
return new SemVer(
version instanceof SemVer ? version.version : version,
options
).inc(release, identifier, identifierBase).version
} catch (er) {
return null
}
}
module.exports = inc

View File

@@ -0,0 +1,3 @@
const compare = require('./compare')
const lt = (a, b, loose) => compare(a, b, loose) < 0
module.exports = lt

View File

@@ -0,0 +1,3 @@
const compare = require('./compare')
const lte = (a, b, loose) => compare(a, b, loose) <= 0
module.exports = lte

View File

@@ -0,0 +1,3 @@
const SemVer = require('../classes/semver')
const major = (a, loose) => new SemVer(a, loose).major
module.exports = major

View File

@@ -0,0 +1,3 @@
const SemVer = require('../classes/semver')
const minor = (a, loose) => new SemVer(a, loose).minor
module.exports = minor

View File

@@ -0,0 +1,3 @@
const compare = require('./compare')
const neq = (a, b, loose) => compare(a, b, loose) !== 0
module.exports = neq

View File

@@ -0,0 +1,16 @@
const SemVer = require('../classes/semver')
const parse = (version, options, throwErrors = false) => {
if (version instanceof SemVer) {
return version
}
try {
return new SemVer(version, options)
} catch (er) {
if (!throwErrors) {
return null
}
throw er
}
}
module.exports = parse

View File

@@ -0,0 +1,3 @@
const SemVer = require('../classes/semver')
const patch = (a, loose) => new SemVer(a, loose).patch
module.exports = patch

View File

@@ -0,0 +1,6 @@
const parse = require('./parse')
const prerelease = (version, options) => {
const parsed = parse(version, options)
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
}
module.exports = prerelease

View File

@@ -0,0 +1,3 @@
const compare = require('./compare')
const rcompare = (a, b, loose) => compare(b, a, loose)
module.exports = rcompare

View File

@@ -0,0 +1,3 @@
const compareBuild = require('./compare-build')
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
module.exports = rsort

View File

@@ -0,0 +1,10 @@
const Range = require('../classes/range')
const satisfies = (version, range, options) => {
try {
range = new Range(range, options)
} catch (er) {
return false
}
return range.test(version)
}
module.exports = satisfies

View File

@@ -0,0 +1,3 @@
const compareBuild = require('./compare-build')
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
module.exports = sort

View File

@@ -0,0 +1,6 @@
const parse = require('./parse')
const valid = (version, options) => {
const v = parse(version, options)
return v ? v.version : null
}
module.exports = valid

89
spa/node_modules/cordova/node_modules/semver/index.js generated vendored Normal file
View File

@@ -0,0 +1,89 @@
// just pre-load all the stuff that index.js lazily exports
const internalRe = require('./internal/re')
const constants = require('./internal/constants')
const SemVer = require('./classes/semver')
const identifiers = require('./internal/identifiers')
const parse = require('./functions/parse')
const valid = require('./functions/valid')
const clean = require('./functions/clean')
const inc = require('./functions/inc')
const diff = require('./functions/diff')
const major = require('./functions/major')
const minor = require('./functions/minor')
const patch = require('./functions/patch')
const prerelease = require('./functions/prerelease')
const compare = require('./functions/compare')
const rcompare = require('./functions/rcompare')
const compareLoose = require('./functions/compare-loose')
const compareBuild = require('./functions/compare-build')
const sort = require('./functions/sort')
const rsort = require('./functions/rsort')
const gt = require('./functions/gt')
const lt = require('./functions/lt')
const eq = require('./functions/eq')
const neq = require('./functions/neq')
const gte = require('./functions/gte')
const lte = require('./functions/lte')
const cmp = require('./functions/cmp')
const coerce = require('./functions/coerce')
const Comparator = require('./classes/comparator')
const Range = require('./classes/range')
const satisfies = require('./functions/satisfies')
const toComparators = require('./ranges/to-comparators')
const maxSatisfying = require('./ranges/max-satisfying')
const minSatisfying = require('./ranges/min-satisfying')
const minVersion = require('./ranges/min-version')
const validRange = require('./ranges/valid')
const outside = require('./ranges/outside')
const gtr = require('./ranges/gtr')
const ltr = require('./ranges/ltr')
const intersects = require('./ranges/intersects')
const simplifyRange = require('./ranges/simplify')
const subset = require('./ranges/subset')
module.exports = {
parse,
valid,
clean,
inc,
diff,
major,
minor,
patch,
prerelease,
compare,
rcompare,
compareLoose,
compareBuild,
sort,
rsort,
gt,
lt,
eq,
neq,
gte,
lte,
cmp,
coerce,
Comparator,
Range,
satisfies,
toComparators,
maxSatisfying,
minSatisfying,
minVersion,
validRange,
outside,
gtr,
ltr,
intersects,
simplifyRange,
subset,
SemVer,
re: internalRe.re,
src: internalRe.src,
tokens: internalRe.t,
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
RELEASE_TYPES: constants.RELEASE_TYPES,
compareIdentifiers: identifiers.compareIdentifiers,
rcompareIdentifiers: identifiers.rcompareIdentifiers,
}

View File

@@ -0,0 +1,35 @@
// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
const SEMVER_SPEC_VERSION = '2.0.0'
const MAX_LENGTH = 256
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
/* istanbul ignore next */ 9007199254740991
// Max safe segment length for coercion.
const MAX_SAFE_COMPONENT_LENGTH = 16
// Max safe length for a build identifier. The max length minus 6 characters for
// the shortest version with a build 0.0.0+BUILD.
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
const RELEASE_TYPES = [
'major',
'premajor',
'minor',
'preminor',
'patch',
'prepatch',
'prerelease',
]
module.exports = {
MAX_LENGTH,
MAX_SAFE_COMPONENT_LENGTH,
MAX_SAFE_BUILD_LENGTH,
MAX_SAFE_INTEGER,
RELEASE_TYPES,
SEMVER_SPEC_VERSION,
FLAG_INCLUDE_PRERELEASE: 0b001,
FLAG_LOOSE: 0b010,
}

View File

@@ -0,0 +1,9 @@
const debug = (
typeof process === 'object' &&
process.env &&
process.env.NODE_DEBUG &&
/\bsemver\b/i.test(process.env.NODE_DEBUG)
) ? (...args) => console.error('SEMVER', ...args)
: () => {}
module.exports = debug

View File

@@ -0,0 +1,23 @@
const numeric = /^[0-9]+$/
const compareIdentifiers = (a, b) => {
const anum = numeric.test(a)
const bnum = numeric.test(b)
if (anum && bnum) {
a = +a
b = +b
}
return a === b ? 0
: (anum && !bnum) ? -1
: (bnum && !anum) ? 1
: a < b ? -1
: 1
}
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
module.exports = {
compareIdentifiers,
rcompareIdentifiers,
}

View File

@@ -0,0 +1,40 @@
class LRUCache {
constructor () {
this.max = 1000
this.map = new Map()
}
get (key) {
const value = this.map.get(key)
if (value === undefined) {
return undefined
} else {
// Remove the key from the map and add it to the end
this.map.delete(key)
this.map.set(key, value)
return value
}
}
delete (key) {
return this.map.delete(key)
}
set (key, value) {
const deleted = this.delete(key)
if (!deleted && value !== undefined) {
// If cache is full, delete the least recently used item
if (this.map.size >= this.max) {
const firstKey = this.map.keys().next().value
this.delete(firstKey)
}
this.map.set(key, value)
}
return this
}
}
module.exports = LRUCache

View File

@@ -0,0 +1,15 @@
// parse out just the options we care about
const looseOption = Object.freeze({ loose: true })
const emptyOpts = Object.freeze({ })
const parseOptions = options => {
if (!options) {
return emptyOpts
}
if (typeof options !== 'object') {
return looseOption
}
return options
}
module.exports = parseOptions

View File

@@ -0,0 +1,217 @@
const {
MAX_SAFE_COMPONENT_LENGTH,
MAX_SAFE_BUILD_LENGTH,
MAX_LENGTH,
} = require('./constants')
const debug = require('./debug')
exports = module.exports = {}
// The actual regexps go on exports.re
const re = exports.re = []
const safeRe = exports.safeRe = []
const src = exports.src = []
const t = exports.t = {}
let R = 0
const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
// used internally via the safeRe object since all inputs in this library get
// normalized first to trim and collapse all extra whitespace. The original
// regexes are exported for userland consumption and lower level usage. A
// future breaking change could export the safer regex only with a note that
// all input should have extra whitespace removed.
const safeRegexReplacements = [
['\\s', 1],
['\\d', MAX_LENGTH],
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
]
const makeSafeRegex = (value) => {
for (const [token, max] of safeRegexReplacements) {
value = value
.split(`${token}*`).join(`${token}{0,${max}}`)
.split(`${token}+`).join(`${token}{1,${max}}`)
}
return value
}
const createToken = (name, value, isGlobal) => {
const safe = makeSafeRegex(value)
const index = R++
debug(name, index, value)
t[name] = index
src[index] = value
re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
}
// The following Regular Expressions can be used for tokenizing,
// validating, and parsing SemVer version strings.
// ## Numeric Identifier
// A single `0`, or a non-zero digit followed by zero or more digits.
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
// ## Non-numeric Identifier
// Zero or more digits, followed by a letter or hyphen, and then zero or
// more letters, digits, or hyphens.
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
// ## Main Version
// Three dot-separated numeric identifiers.
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
`(${src[t.NUMERICIDENTIFIER]})\\.` +
`(${src[t.NUMERICIDENTIFIER]})`)
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
`(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
`(${src[t.NUMERICIDENTIFIERLOOSE]})`)
// ## Pre-release Version Identifier
// A numeric identifier, or a non-numeric identifier.
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
}|${src[t.NONNUMERICIDENTIFIER]})`)
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
}|${src[t.NONNUMERICIDENTIFIER]})`)
// ## Pre-release Version
// Hyphen, followed by one or more dot-separated pre-release version
// identifiers.
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)
// ## Build Metadata Identifier
// Any combination of digits, letters, or hyphens.
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
// ## Build Metadata
// Plus sign, followed by one or more period-separated build metadata
// identifiers.
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)
// ## Full Version String
// A main version, followed optionally by a pre-release version and
// build metadata.
// Note that the only major, minor, patch, and pre-release sections of
// the version string are capturing groups. The build metadata is not a
// capturing group, because it should not ever be used in version
// comparison.
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
}${src[t.PRERELEASE]}?${
src[t.BUILD]}?`)
createToken('FULL', `^${src[t.FULLPLAIN]}$`)
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
// common in the npm registry.
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
}${src[t.PRERELEASELOOSE]}?${
src[t.BUILD]}?`)
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
createToken('GTLT', '((?:<|>)?=?)')
// Something like "2.*" or "1.2.x".
// Note that "x.x" is a valid xRange identifer, meaning "any version"
// Only the first item is strictly required.
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
`(?:${src[t.PRERELEASE]})?${
src[t.BUILD]}?` +
`)?)?`)
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
`(?:${src[t.PRERELEASELOOSE]})?${
src[t.BUILD]}?` +
`)?)?`)
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
// Coercion.
// Extract anything that could conceivably be a part of a valid semver
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
createToken('COERCEFULL', src[t.COERCEPLAIN] +
`(?:${src[t.PRERELEASE]})?` +
`(?:${src[t.BUILD]})?` +
`(?:$|[^\\d])`)
createToken('COERCERTL', src[t.COERCE], true)
createToken('COERCERTLFULL', src[t.COERCEFULL], true)
// Tilde ranges.
// Meaning is "reasonably at or greater than"
createToken('LONETILDE', '(?:~>?)')
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
exports.tildeTrimReplace = '$1~'
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)
// Caret ranges.
// Meaning is "at least and backwards compatible with"
createToken('LONECARET', '(?:\\^)')
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
exports.caretTrimReplace = '$1^'
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)
// A simple gt/lt/eq thing, or just "" to indicate "any version"
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)
// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
exports.comparatorTrimReplace = '$1$2$3'
// Something like `1.2.3 - 1.2.4`
// Note that these all use the loose form, because they'll be
// checked against either the strict or loose comparator form
// later.
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
`\\s+-\\s+` +
`(${src[t.XRANGEPLAIN]})` +
`\\s*$`)
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
`\\s+-\\s+` +
`(${src[t.XRANGEPLAINLOOSE]})` +
`\\s*$`)
// Star ranges basically just allow anything at all.
createToken('STAR', '(<|>)?=?\\s*\\*')
// >=0.0.0 is like a star
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')

View File

@@ -0,0 +1,77 @@
{
"name": "semver",
"version": "7.6.2",
"description": "The semantic version parser used by npm.",
"main": "index.js",
"scripts": {
"test": "tap",
"snap": "tap",
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"postlint": "template-oss-check",
"lintfix": "npm run lint -- --fix",
"posttest": "npm run lint",
"template-oss-apply": "template-oss-apply --force"
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.22.0",
"benchmark": "^2.1.4",
"tap": "^16.0.0"
},
"license": "ISC",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/node-semver.git"
},
"bin": {
"semver": "bin/semver.js"
},
"files": [
"bin/",
"lib/",
"classes/",
"functions/",
"internal/",
"ranges/",
"index.js",
"preload.js",
"range.bnf"
],
"tap": {
"timeout": 30,
"coverage-map": "map.js",
"nyc-arg": [
"--exclude",
"tap-snapshots/**"
]
},
"engines": {
"node": ">=10"
},
"author": "GitHub Inc.",
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.22.0",
"engines": ">=10",
"distPaths": [
"classes/",
"functions/",
"internal/",
"ranges/",
"index.js",
"preload.js",
"range.bnf"
],
"allowPaths": [
"/classes/",
"/functions/",
"/internal/",
"/ranges/",
"/index.js",
"/preload.js",
"/range.bnf",
"/benchmarks"
],
"publish": "true"
}
}

View File

@@ -0,0 +1,2 @@
// XXX remove in v8 or beyond
module.exports = require('./index.js')

16
spa/node_modules/cordova/node_modules/semver/range.bnf generated vendored Normal file
View File

@@ -0,0 +1,16 @@
range-set ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | [1-9] ( [0-9] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+

View File

@@ -0,0 +1,4 @@
// Determine if version is greater than all the versions possible in the range.
const outside = require('./outside')
const gtr = (version, range, options) => outside(version, range, '>', options)
module.exports = gtr

View File

@@ -0,0 +1,7 @@
const Range = require('../classes/range')
const intersects = (r1, r2, options) => {
r1 = new Range(r1, options)
r2 = new Range(r2, options)
return r1.intersects(r2, options)
}
module.exports = intersects

View File

@@ -0,0 +1,4 @@
const outside = require('./outside')
// Determine if version is less than all the versions possible in the range
const ltr = (version, range, options) => outside(version, range, '<', options)
module.exports = ltr

View File

@@ -0,0 +1,25 @@
const SemVer = require('../classes/semver')
const Range = require('../classes/range')
const maxSatisfying = (versions, range, options) => {
let max = null
let maxSV = null
let rangeObj = null
try {
rangeObj = new Range(range, options)
} catch (er) {
return null
}
versions.forEach((v) => {
if (rangeObj.test(v)) {
// satisfies(v, range, options)
if (!max || maxSV.compare(v) === -1) {
// compare(max, v, true)
max = v
maxSV = new SemVer(max, options)
}
}
})
return max
}
module.exports = maxSatisfying

View File

@@ -0,0 +1,24 @@
const SemVer = require('../classes/semver')
const Range = require('../classes/range')
const minSatisfying = (versions, range, options) => {
let min = null
let minSV = null
let rangeObj = null
try {
rangeObj = new Range(range, options)
} catch (er) {
return null
}
versions.forEach((v) => {
if (rangeObj.test(v)) {
// satisfies(v, range, options)
if (!min || minSV.compare(v) === 1) {
// compare(min, v, true)
min = v
minSV = new SemVer(min, options)
}
}
})
return min
}
module.exports = minSatisfying

View File

@@ -0,0 +1,61 @@
const SemVer = require('../classes/semver')
const Range = require('../classes/range')
const gt = require('../functions/gt')
const minVersion = (range, loose) => {
range = new Range(range, loose)
let minver = new SemVer('0.0.0')
if (range.test(minver)) {
return minver
}
minver = new SemVer('0.0.0-0')
if (range.test(minver)) {
return minver
}
minver = null
for (let i = 0; i < range.set.length; ++i) {
const comparators = range.set[i]
let setMin = null
comparators.forEach((comparator) => {
// Clone to avoid manipulating the comparator's semver object.
const compver = new SemVer(comparator.semver.version)
switch (comparator.operator) {
case '>':
if (compver.prerelease.length === 0) {
compver.patch++
} else {
compver.prerelease.push(0)
}
compver.raw = compver.format()
/* fallthrough */
case '':
case '>=':
if (!setMin || gt(compver, setMin)) {
setMin = compver
}
break
case '<':
case '<=':
/* Ignore maximum versions */
break
/* istanbul ignore next */
default:
throw new Error(`Unexpected operation: ${comparator.operator}`)
}
})
if (setMin && (!minver || gt(minver, setMin))) {
minver = setMin
}
}
if (minver && range.test(minver)) {
return minver
}
return null
}
module.exports = minVersion

View File

@@ -0,0 +1,80 @@
const SemVer = require('../classes/semver')
const Comparator = require('../classes/comparator')
const { ANY } = Comparator
const Range = require('../classes/range')
const satisfies = require('../functions/satisfies')
const gt = require('../functions/gt')
const lt = require('../functions/lt')
const lte = require('../functions/lte')
const gte = require('../functions/gte')
const outside = (version, range, hilo, options) => {
version = new SemVer(version, options)
range = new Range(range, options)
let gtfn, ltefn, ltfn, comp, ecomp
switch (hilo) {
case '>':
gtfn = gt
ltefn = lte
ltfn = lt
comp = '>'
ecomp = '>='
break
case '<':
gtfn = lt
ltefn = gte
ltfn = gt
comp = '<'
ecomp = '<='
break
default:
throw new TypeError('Must provide a hilo val of "<" or ">"')
}
// If it satisfies the range it is not outside
if (satisfies(version, range, options)) {
return false
}
// From now on, variable terms are as if we're in "gtr" mode.
// but note that everything is flipped for the "ltr" function.
for (let i = 0; i < range.set.length; ++i) {
const comparators = range.set[i]
let high = null
let low = null
comparators.forEach((comparator) => {
if (comparator.semver === ANY) {
comparator = new Comparator('>=0.0.0')
}
high = high || comparator
low = low || comparator
if (gtfn(comparator.semver, high.semver, options)) {
high = comparator
} else if (ltfn(comparator.semver, low.semver, options)) {
low = comparator
}
})
// If the edge version comparator has a operator then our version
// isn't outside it
if (high.operator === comp || high.operator === ecomp) {
return false
}
// If the lowest version comparator has an operator and our version
// is less than it then it isn't higher than the range
if ((!low.operator || low.operator === comp) &&
ltefn(version, low.semver)) {
return false
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
return false
}
}
return true
}
module.exports = outside

View File

@@ -0,0 +1,47 @@
// given a set of versions and a range, create a "simplified" range
// that includes the same versions that the original range does
// If the original range is shorter than the simplified one, return that.
const satisfies = require('../functions/satisfies.js')
const compare = require('../functions/compare.js')
module.exports = (versions, range, options) => {
const set = []
let first = null
let prev = null
const v = versions.sort((a, b) => compare(a, b, options))
for (const version of v) {
const included = satisfies(version, range, options)
if (included) {
prev = version
if (!first) {
first = version
}
} else {
if (prev) {
set.push([first, prev])
}
prev = null
first = null
}
}
if (first) {
set.push([first, null])
}
const ranges = []
for (const [min, max] of set) {
if (min === max) {
ranges.push(min)
} else if (!max && min === v[0]) {
ranges.push('*')
} else if (!max) {
ranges.push(`>=${min}`)
} else if (min === v[0]) {
ranges.push(`<=${max}`)
} else {
ranges.push(`${min} - ${max}`)
}
}
const simplified = ranges.join(' || ')
const original = typeof range.raw === 'string' ? range.raw : String(range)
return simplified.length < original.length ? simplified : range
}

View File

@@ -0,0 +1,247 @@
const Range = require('../classes/range.js')
const Comparator = require('../classes/comparator.js')
const { ANY } = Comparator
const satisfies = require('../functions/satisfies.js')
const compare = require('../functions/compare.js')
// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
// - Every simple range `r1, r2, ...` is a null set, OR
// - Every simple range `r1, r2, ...` which is not a null set is a subset of
// some `R1, R2, ...`
//
// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
// - If c is only the ANY comparator
// - If C is only the ANY comparator, return true
// - Else if in prerelease mode, return false
// - else replace c with `[>=0.0.0]`
// - If C is only the ANY comparator
// - if in prerelease mode, return true
// - else replace C with `[>=0.0.0]`
// - Let EQ be the set of = comparators in c
// - If EQ is more than one, return true (null set)
// - Let GT be the highest > or >= comparator in c
// - Let LT be the lowest < or <= comparator in c
// - If GT and LT, and GT.semver > LT.semver, return true (null set)
// - If any C is a = range, and GT or LT are set, return false
// - If EQ
// - If GT, and EQ does not satisfy GT, return true (null set)
// - If LT, and EQ does not satisfy LT, return true (null set)
// - If EQ satisfies every C, return true
// - Else return false
// - If GT
// - If GT.semver is lower than any > or >= comp in C, return false
// - If GT is >=, and GT.semver does not satisfy every C, return false
// - If GT.semver has a prerelease, and not in prerelease mode
// - If no C has a prerelease and the GT.semver tuple, return false
// - If LT
// - If LT.semver is greater than any < or <= comp in C, return false
// - If LT is <=, and LT.semver does not satisfy every C, return false
// - If GT.semver has a prerelease, and not in prerelease mode
// - If no C has a prerelease and the LT.semver tuple, return false
// - Else return true
const subset = (sub, dom, options = {}) => {
if (sub === dom) {
return true
}
sub = new Range(sub, options)
dom = new Range(dom, options)
let sawNonNull = false
OUTER: for (const simpleSub of sub.set) {
for (const simpleDom of dom.set) {
const isSub = simpleSubset(simpleSub, simpleDom, options)
sawNonNull = sawNonNull || isSub !== null
if (isSub) {
continue OUTER
}
}
// the null set is a subset of everything, but null simple ranges in
// a complex range should be ignored. so if we saw a non-null range,
// then we know this isn't a subset, but if EVERY simple range was null,
// then it is a subset.
if (sawNonNull) {
return false
}
}
return true
}
const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
const minimumVersion = [new Comparator('>=0.0.0')]
const simpleSubset = (sub, dom, options) => {
if (sub === dom) {
return true
}
if (sub.length === 1 && sub[0].semver === ANY) {
if (dom.length === 1 && dom[0].semver === ANY) {
return true
} else if (options.includePrerelease) {
sub = minimumVersionWithPreRelease
} else {
sub = minimumVersion
}
}
if (dom.length === 1 && dom[0].semver === ANY) {
if (options.includePrerelease) {
return true
} else {
dom = minimumVersion
}
}
const eqSet = new Set()
let gt, lt
for (const c of sub) {
if (c.operator === '>' || c.operator === '>=') {
gt = higherGT(gt, c, options)
} else if (c.operator === '<' || c.operator === '<=') {
lt = lowerLT(lt, c, options)
} else {
eqSet.add(c.semver)
}
}
if (eqSet.size > 1) {
return null
}
let gtltComp
if (gt && lt) {
gtltComp = compare(gt.semver, lt.semver, options)
if (gtltComp > 0) {
return null
} else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
return null
}
}
// will iterate one or zero times
for (const eq of eqSet) {
if (gt && !satisfies(eq, String(gt), options)) {
return null
}
if (lt && !satisfies(eq, String(lt), options)) {
return null
}
for (const c of dom) {
if (!satisfies(eq, String(c), options)) {
return false
}
}
return true
}
let higher, lower
let hasDomLT, hasDomGT
// if the subset has a prerelease, we need a comparator in the superset
// with the same tuple and a prerelease, or it's not a subset
let needDomLTPre = lt &&
!options.includePrerelease &&
lt.semver.prerelease.length ? lt.semver : false
let needDomGTPre = gt &&
!options.includePrerelease &&
gt.semver.prerelease.length ? gt.semver : false
// exception: <1.2.3-0 is the same as <1.2.3
if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
needDomLTPre = false
}
for (const c of dom) {
hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
if (gt) {
if (needDomGTPre) {
if (c.semver.prerelease && c.semver.prerelease.length &&
c.semver.major === needDomGTPre.major &&
c.semver.minor === needDomGTPre.minor &&
c.semver.patch === needDomGTPre.patch) {
needDomGTPre = false
}
}
if (c.operator === '>' || c.operator === '>=') {
higher = higherGT(gt, c, options)
if (higher === c && higher !== gt) {
return false
}
} else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
return false
}
}
if (lt) {
if (needDomLTPre) {
if (c.semver.prerelease && c.semver.prerelease.length &&
c.semver.major === needDomLTPre.major &&
c.semver.minor === needDomLTPre.minor &&
c.semver.patch === needDomLTPre.patch) {
needDomLTPre = false
}
}
if (c.operator === '<' || c.operator === '<=') {
lower = lowerLT(lt, c, options)
if (lower === c && lower !== lt) {
return false
}
} else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
return false
}
}
if (!c.operator && (lt || gt) && gtltComp !== 0) {
return false
}
}
// if there was a < or >, and nothing in the dom, then must be false
// UNLESS it was limited by another range in the other direction.
// Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
if (gt && hasDomLT && !lt && gtltComp !== 0) {
return false
}
if (lt && hasDomGT && !gt && gtltComp !== 0) {
return false
}
// we needed a prerelease range in a specific tuple, but didn't get one
// then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
// because it includes prereleases in the 1.2.3 tuple
if (needDomGTPre || needDomLTPre) {
return false
}
return true
}
// >=1.2.3 is lower than >1.2.3
const higherGT = (a, b, options) => {
if (!a) {
return b
}
const comp = compare(a.semver, b.semver, options)
return comp > 0 ? a
: comp < 0 ? b
: b.operator === '>' && a.operator === '>=' ? b
: a
}
// <=1.2.3 is higher than <1.2.3
const lowerLT = (a, b, options) => {
if (!a) {
return b
}
const comp = compare(a.semver, b.semver, options)
return comp < 0 ? a
: comp > 0 ? b
: b.operator === '<' && a.operator === '<=' ? b
: a
}
module.exports = subset

View File

@@ -0,0 +1,8 @@
const Range = require('../classes/range')
// Mostly just for testing and legacy API reasons
const toComparators = (range, options) =>
new Range(range, options).set
.map(comp => comp.map(c => c.value).join(' ').trim().split(' '))
module.exports = toComparators

View File

@@ -0,0 +1,11 @@
const Range = require('../classes/range')
const validRange = (range, options) => {
try {
// Return '*' instead of '' so that truthiness works.
// This will throw if it's invalid anyway
return new Range(range, options).range || '*'
} catch (er) {
return null
}
}
module.exports = validRange

57
spa/node_modules/cordova/package.json generated vendored Normal file
View File

@@ -0,0 +1,57 @@
{
"name": "cordova",
"version": "12.0.0",
"description": "Cordova command line interface tool",
"main": "cordova",
"engines": {
"node": ">=16.13.0"
},
"bin": {
"cordova": "./bin/cordova"
},
"scripts": {
"test": "npm run lint && npm run cover",
"lint": "eslint . bin/cordova",
"cover": "nyc jasmine"
},
"repository": "github:apache/cordova-cli",
"bugs": "https://github.com/apache/cordova-cli/issues",
"keywords": [
"cordova",
"client",
"cli"
],
"dependencies": {
"configstore": "^5.0.1",
"cordova-common": "^5.0.0",
"cordova-create": "^5.0.0",
"cordova-lib": "^12.0.0",
"editor": "^1.0.0",
"execa": "^5.1.1",
"fs-extra": "^11.1.1",
"insight": "^0.11.1",
"loud-rejection": "^2.2.0",
"nopt": "^7.1.0",
"semver": "^7.5.0",
"systeminformation": "^5.17.12"
},
"devDependencies": {
"@cordova/eslint-config": "^5.0.0",
"jasmine": "^4.6.0",
"mock-stdin": "^1.0.0",
"nyc": "^15.1.0",
"rewire": "^6.0.0"
},
"author": "Apache Software Foundation",
"license": "Apache-2.0",
"nyc": {
"include": [
"bin/**",
"src/**"
],
"reporter": [
"lcov",
"text"
]
}
}

124
spa/node_modules/cordova/scripts/cordova.completion generated vendored Normal file
View File

@@ -0,0 +1,124 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
platforms() {
get_cordova && COMPREPLY=( $(compgen -W "$(${CORDOVA_BIN} platform ls | tr -d "[]',")" -- $1) )
}
plugins() {
get_cordova && COMPREPLY=( $(compgen -W "$(${CORDOVA_BIN} plugin ls | tr -d "[]',")" -- $1) )
}
get_cordova() {
local cordova
if [[ -n "${CORDOVA_BIN}" ]]; then return 0; fi
cordova=$(eval echo ${COMP_WORDS[0]})
if [[ -x $cordova ]]; then CORDOVA_BIN=$cordova; return 0; fi
cordova=$(which cordova)
if [[ $? -eq 0 ]]; then CORDOVA_BIN=$cordova; return 0; fi
return 1
}
get_top_level_dir() {
local path
path=$(pwd)
while [ $path != '/' ]; do
if [ -d $path/.cordova ]; then
echo $path
return 0
fi
path=$(dirname $path)
done
return 1
}
_cordova()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
# Skip over any initial command line switches
local i=1
while [[ $i -lt ${#COMP_WORDS[*]} ]] && [[ "${COMP_WORDS[${i}]}" == -* ]]; do
i=$((i+1));
done
# For the first word, supply all of the valid top-level commands
if [[ ${COMP_CWORD} -eq $i ]]; then
opts="create platform plugin prepare compile build emulate serve"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
case "${COMP_WORDS[$i]}" in
create)
if [[ ${COMP_CWORD} -eq $((i+1)) ]]; then
COMPREPLY=( $(compgen -d -- ${cur}) )
return 0
fi
;;
platform)
if [[ ${COMP_CWORD} -eq $((i+1)) ]]; then
opts="add rm remove ls"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
case "${COMP_WORDS[$((i+1))]}" in
add)
opts="ios android wp7 wp8 blackberry www"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0;
;;
rm|remove)
platforms ${cur}
return 0
;;
esac
;;
plugin)
if [[ ${COMP_CWORD} -eq $((i+1)) ]]; then
opts="add rm remove ls"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
case "${COMP_WORDS[$((i+1))]}" in
add)
COMPREPLY=( $(compgen nospace -d -- ${cur}) )
return 0;
;;
rm|remove)
plugins ${cur}
return 0
;;
esac
;;
prepare|compile|build|emulate)
platforms ${cur}
return 0
;;
serve)
if [[ ${COMP_CWORD} -eq $((i+1)) ]]; then
platforms ${cur}
return 0
fi
;;
esac
}
complete -F _cordova cordova

447
spa/node_modules/cordova/src/cli.js generated vendored Normal file
View File

@@ -0,0 +1,447 @@
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
const nopt = require('nopt');
const pkg = require('../package.json');
const telemetry = require('./telemetry');
const help = require('./help');
const info = require('./info');
const cordova_lib = require('cordova-lib');
const CordovaError = cordova_lib.CordovaError;
const cordova = cordova_lib.cordova;
const events = cordova_lib.events;
const logger = require('cordova-common').CordovaLogger.get();
const cordovaCreate = require('cordova-create');
const Configstore = require('configstore');
const conf = new Configstore(pkg.name + '-config');
const editor = require('editor');
const semver = require('semver');
// process.version is not declared writable or has no setter so storing in const for Jasmine.
const NODE_VERSION = process.version;
// When there is no node version in the deprecation stage, set to null or false.
const NODE_VERSION_REQUIREMENT = false;
const NODE_VERSION_DEPRECATING_RANGE = '<10';
const knownOpts = {
verbose: Boolean,
version: Boolean,
help: Boolean,
silent: Boolean,
experimental: Boolean,
noregistry: Boolean,
nohooks: Array,
shrinkwrap: Boolean,
searchpath: String,
variable: Array,
link: Boolean,
force: Boolean,
'save-exact': Boolean,
// Flags to be passed to `cordova build/run/emulate`
debug: Boolean,
release: Boolean,
archs: String,
device: Boolean,
emulator: Boolean,
target: String,
noprepare: Boolean,
nobuild: Boolean,
list: Boolean,
buildConfig: String,
template: String,
production: Boolean,
noprod: Boolean
};
const shortHands = {
d: '--verbose',
v: '--version',
h: '--help',
t: '--template'
};
let shouldCollectTelemetry = false;
module.exports = function (inputArgs) {
// If no inputArgs given, use process.argv.
inputArgs = inputArgs || process.argv;
let cmd = inputArgs[2]; // e.g: inputArgs= 'node cordova run ios'
const subcommand = getSubCommand(inputArgs, cmd);
const isTelemetryCmd = (cmd === 'telemetry');
const isConfigCmd = (cmd === 'config');
// ToDO: Move nopt-based parsing of args up here
if (cmd === '--version' || cmd === '-v') {
cmd = 'version';
} else if (!cmd || cmd === '--help' || cmd === 'h') {
cmd = 'help';
}
// If "get" is called
if (isConfigCmd && inputArgs[3] === 'get') {
if (inputArgs[4]) {
logger.subscribe(events);
conf.get(inputArgs[4]);
if (conf.get(inputArgs[4]) !== undefined) {
events.emit('log', conf.get(inputArgs[4]).toString());
} else {
events.emit('log', 'undefined');
}
}
}
// If "set" is called
if (isConfigCmd && inputArgs[3] === 'set') {
if (inputArgs[5] === undefined) {
conf.set(inputArgs[4], true);
}
if (inputArgs[5]) {
conf.set(inputArgs[4], inputArgs[5]);
}
}
// If "delete" is called
if (isConfigCmd && inputArgs[3] === 'delete') {
if (inputArgs[4]) {
conf.del(inputArgs[4]);
}
}
// If "edit" is called
if (isConfigCmd && inputArgs[3] === 'edit') {
editor(conf.path, function (code, sig) {
logger.warn('Finished editing with code ' + code);
});
}
// If "ls" is called
if (isConfigCmd && (inputArgs[3] === 'ls' || inputArgs[3] === 'list')) {
logger.results(JSON.stringify(conf.all, null, 4));
}
return Promise.resolve().then(function () {
/**
* Skip telemetry prompt if:
* - CI environment variable is present
* - Command is run with `--no-telemetry` flag
* - Command ran is: `cordova telemetry on | off | ...`
*/
if (telemetry.isCI(process.env) || telemetry.isNoTelemetryFlag(inputArgs)) {
return Promise.resolve(false);
}
/**
* We shouldn't prompt for telemetry if user issues a command of the form: `cordova telemetry on | off | ...x`
* Also, if the user has already been prompted and made a decision, use his saved answer
*/
if (isTelemetryCmd) {
const isOptedIn = telemetry.isOptedIn();
return handleTelemetryCmd(subcommand, isOptedIn);
}
if (telemetry.hasUserOptedInOrOut()) {
return Promise.resolve(telemetry.isOptedIn());
}
/**
* Otherwise, prompt user to opt-in or out
* Note: the prompt is shown for 30 seconds. If no choice is made by that time, User is considered to have opted out.
*/
return telemetry.showPrompt();
}).then(function (collectTelemetry) {
shouldCollectTelemetry = collectTelemetry;
if (isTelemetryCmd) {
return Promise.resolve();
}
return cli(inputArgs);
}).then(function () {
if (shouldCollectTelemetry && !isTelemetryCmd) {
telemetry.track(cmd, subcommand, 'successful');
}
}).catch(function (err) {
if (shouldCollectTelemetry && !isTelemetryCmd) {
telemetry.track(cmd, subcommand, 'unsuccessful');
}
throw err;
});
};
function getSubCommand (args, cmd) {
if (['platform', 'platforms', 'plugin', 'plugins', 'telemetry', 'config'].indexOf(cmd) > -1) {
return args[3]; // e.g: args='node cordova platform rm ios', 'node cordova telemetry on'
}
return null;
}
function printHelp (command) {
const result = help([command]);
cordova.emit('results', result);
}
function handleTelemetryCmd (subcommand, isOptedIn) {
if (subcommand !== 'on' && subcommand !== 'off') {
logger.subscribe(events);
printHelp('telemetry');
return;
}
const turnOn = subcommand === 'on';
let cmdSuccess = true;
// turn telemetry on or off
try {
if (turnOn) {
telemetry.turnOn();
console.log('Thanks for opting into telemetry to help us improve cordova.');
} else {
telemetry.turnOff();
console.log('You have been opted out of telemetry. To change this, run: cordova telemetry on.');
}
} catch (ex) {
cmdSuccess = false;
}
// track or not track ?, that is the question
if (!turnOn) {
// Always track telemetry opt-outs (whether user opted out or not!)
telemetry.track('telemetry', 'off', 'via-cordova-telemetry-cmd', cmdSuccess ? 'successful' : 'unsuccessful');
return Promise.resolve();
}
if (isOptedIn) {
telemetry.track('telemetry', 'on', 'via-cordova-telemetry-cmd', cmdSuccess ? 'successful' : 'unsuccessful');
}
return Promise.resolve();
}
function cli (inputArgs) {
const args = nopt(knownOpts, shortHands, inputArgs);
process.on('uncaughtException', function (err) {
if (err.message) {
logger.error(err.message);
} else {
logger.error(err);
}
// Don't send exception details, just send that it happened
if (shouldCollectTelemetry) {
telemetry.track('uncaughtException');
}
process.exit(1);
});
logger.subscribe(events);
if (args.silent) {
logger.setLevel('error');
} else if (args.verbose) { // can't be both silent AND verbose, silent wins
logger.setLevel('verbose');
}
const cliVersion = pkg.version;
const usingPrerelease = !!semver.prerelease(cliVersion);
if (args.version || usingPrerelease) {
const libVersion = require('cordova-lib/package').version;
let toPrint = cliVersion;
if (cliVersion !== libVersion || usingPrerelease) {
toPrint += ' (cordova-lib@' + libVersion + ')';
}
if (args.version) {
logger.results(toPrint);
return Promise.resolve(); // Important! this will return and cease execution
} else { // must be usingPrerelease
// Show a warning and continue
logger.warn('Warning: using prerelease version ' + toPrint);
}
}
let warningPartial = null;
// If the Node.js versions does not meet our requirements or in a deprecation stage, display a warning.
if (
NODE_VERSION_REQUIREMENT &&
!semver.satisfies(NODE_VERSION, NODE_VERSION_REQUIREMENT)
) {
warningPartial = 'is no longer supported';
} else if (
NODE_VERSION_DEPRECATING_RANGE &&
semver.satisfies(NODE_VERSION, NODE_VERSION_DEPRECATING_RANGE)
) {
warningPartial = 'has been deprecated';
}
if (warningPartial) {
const upgradeMsg = 'Please upgrade to the latest Node.js version available (LTS version recommended).';
logger.warn(`Warning: Node.js ${NODE_VERSION} ${warningPartial}. ${upgradeMsg}`);
}
// If there were arguments protected from nopt with a double dash, keep
// them in unparsedArgs. For example:
// cordova build ios -- --verbose --whatever
// In this case "--verbose" is not parsed by nopt and args.vergbose will be
// false, the unparsed args after -- are kept in unparsedArgs and can be
// passed downstream to some scripts invoked by Cordova.
let unparsedArgs = [];
const parseStopperIdx = args.argv.original.indexOf('--');
if (parseStopperIdx !== -1) {
unparsedArgs = args.argv.original.slice(parseStopperIdx + 1);
}
// args.argv.remain contains both the undashed args (like platform names)
// and whatever unparsed args that were protected by " -- ".
// "undashed" stores only the undashed args without those after " -- " .
const remain = args.argv.remain;
const undashed = remain.slice(0, remain.length - unparsedArgs.length);
const cmd = undashed[0];
let subcommand;
if (!cmd || cmd === 'help' || args.help) {
if (!args.help && remain[0] === 'help') {
remain.shift();
}
return printHelp(remain);
}
if (cmd === 'info') return info();
// Don't need to do anything with cordova-lib since config was handled above
if (cmd === 'config') return true;
if (cmd === 'create') {
const [, dest, id, name] = undashed;
return cordovaCreate(dest, { id, name, events, template: args.template });
}
if (!Object.prototype.hasOwnProperty.call(cordova, cmd)) {
const msg2 = 'Cordova does not know ' + cmd + '; try `' + cordova_lib.binname +
' help` for a list of all the available commands.';
throw new CordovaError(msg2);
}
const opts = {
platforms: [],
options: [],
verbose: args.verbose || false,
silent: args.silent || false,
nohooks: args.nohooks || [],
searchpath: args.searchpath
};
const platformCommands = ['emulate', 'build', 'prepare', 'compile', 'run', 'clean'];
if (platformCommands.indexOf(cmd) !== -1) {
// All options without dashes are assumed to be platform names
opts.platforms = undashed.slice(1);
// Pass nopt-parsed args to PlatformApi through opts.options
opts.options = args;
opts.options.argv = unparsedArgs;
return cordova[cmd].call(null, opts);
} else if (cmd === 'requirements') {
// All options without dashes are assumed to be platform names
opts.platforms = undashed.slice(1);
return cordova[cmd].call(null, opts.platforms)
.then(function (platformChecks) {
const someChecksFailed = Object.keys(platformChecks).map(function (platformName) {
events.emit('log', '\nRequirements check results for ' + platformName + ':');
const platformCheck = platformChecks[platformName];
if (platformCheck instanceof CordovaError) {
events.emit('warn', 'Check failed for ' + platformName + ' due to ' + platformCheck);
return true;
}
let someChecksFailed = false;
// platformCheck is expected to be an array of conditions that must be met
// the browser platform currently returns nothing, which was breaking here.
if (platformCheck && platformCheck.forEach) {
platformCheck.forEach(function (checkItem) {
const checkSummary = checkItem.name + ': ' +
(checkItem.installed ? 'installed ' : 'not installed ') +
(checkItem.installed ? checkItem.metadata.version.version || checkItem.metadata.version : '');
events.emit('log', checkSummary);
if (!checkItem.installed) {
someChecksFailed = true;
events.emit('warn', checkItem.metadata.reason);
}
});
}
return someChecksFailed;
}).some(function (isCheckFailedForPlatform) {
return isCheckFailedForPlatform;
});
if (someChecksFailed) {
throw new CordovaError('Some of requirements check failed');
}
});
} else if (cmd === 'serve') {
const port = undashed[1];
return cordova.serve(port);
} else {
// platform/plugins add/rm [target(s)]
subcommand = undashed[1]; // sub-command like "add", "ls", "rm" etc.
const targets = undashed.slice(2); // array of targets, either platforms or plugins
const cli_vars = {};
if (args.variable) {
args.variable.forEach(function (strVar) {
// CB-9171
const keyVal = strVar.split('=');
if (keyVal.length < 2) {
throw new CordovaError('invalid variable format: ' + strVar);
} else {
const key = keyVal.shift().toUpperCase();
const val = keyVal.join('=');
cli_vars[key] = val;
}
});
}
args.save = !args.nosave;
args.production = !args.noprod;
if (args.searchpath === undefined) {
// User explicitly did not pass in searchpath
args.searchpath = conf.get('searchpath');
}
if (args['save-exact'] === undefined) {
// User explicitly did not pass in save-exact
args['save-exact'] = conf.get('save-exact');
}
const download_opts = {
searchpath: args.searchpath,
noregistry: args.noregistry,
nohooks: args.nohooks,
cli_variables: cli_vars,
link: args.link || false,
save: args.save,
save_exact: args['save-exact'] || false,
shrinkwrap: args.shrinkwrap || false,
force: args.force || false,
production: args.production
};
return cordova[cmd](subcommand, targets, download_opts);
}
}

41
spa/node_modules/cordova/src/help.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
const fs = require('fs');
const cordova_lib = require('cordova-lib');
const path = require('path');
module.exports = function help (args) {
args = args || [];
const command = ((args)[0] || 'cordova');
const docdir = path.join(__dirname, '..', 'doc');
const file = [
`${command}.md`,
`${command}.txt`,
'cordova.md',
'cordova.txt'
]
.map(f => path.join(docdir, f))
.filter(f => !!fs.existsSync(f));
const raw = fs.readFileSync(file[0]).toString('utf8').replace(/cordova-cli/g, cordova_lib.binname);
// cordova.emit('results', raw);
return raw;
};

224
spa/node_modules/cordova/src/info.js generated vendored Normal file
View File

@@ -0,0 +1,224 @@
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
const path = require('path');
const fs = require('fs-extra');
const execa = require('execa');
const { osInfo } = require('systeminformation');
const { cordova, cordova_platforms: { getPlatformApi } } = require('cordova-lib');
const cdvLibUtil = require('cordova-lib/src/cordova/util');
const cdvPluginUtil = require('cordova-lib/src/cordova/plugin/util');
// Cache
let _installedPlatformsList = null;
/*
* Sections
*/
async function getCordovaDependenciesInfo () {
// get self "Cordova CLI"
const cliPkg = require('../package');
const cliDependencies = await _getLibDependenciesInfo(cliPkg.dependencies);
const libPkg = require('cordova-lib/package');
const cliLibDep = cliDependencies.find(({ key }) => key === 'lib');
cliLibDep.children = await _getLibDependenciesInfo(libPkg.dependencies);
return {
key: 'Cordova Packages',
children: [{
key: 'cli',
value: cliPkg.version,
children: cliDependencies
}]
};
}
async function getInstalledPlatforms (projectRoot) {
return _getInstalledPlatforms(projectRoot).then(platforms => {
const key = 'Project Installed Platforms';
const children = Object.entries(platforms)
.map(([key, value]) => ({ key, value }));
return { key, children };
});
}
async function getInstalledPlugins (projectRoot) {
const key = 'Project Installed Plugins';
const children = cdvPluginUtil.getInstalledPlugins(projectRoot)
.map(plugin => ({ key: plugin.id, value: plugin.version }));
return { key, children };
}
async function getEnvironmentInfo () {
const [npmVersion, osInfoResult] = await Promise.all([_getNpmVersion(), osInfo()]);
const { platform, distro, release, codename, kernel, arch, build } = osInfoResult;
const optionalBuildSuffix = build ? ` (${build})` : '';
const osFormat = [
platform === 'darwin' ? codename : distro,
release + optionalBuildSuffix,
`(${platform} ${kernel})`,
`${arch}`
];
return {
key: 'Environment',
children: [
{ key: 'OS', value: osFormat.join(' ') },
{ key: 'Node', value: process.version },
{ key: 'npm', value: npmVersion }
]
};
}
async function getPlatformEnvironmentData (projectRoot) {
const installedPlatforms = await _getInstalledPlatforms(projectRoot);
return Object.keys(installedPlatforms)
.map(platform => {
const platformApi = getPlatformApi(platform);
const getPlatformInfo = platformApi && platformApi.getEnvironmentInfo
? () => platformApi.getEnvironmentInfo()
: _legacyPlatformInfo[platform];
return { platform, getPlatformInfo };
})
.filter(o => o.getPlatformInfo)
.map(async ({ platform, getPlatformInfo }) => ({
key: `${platform} Environment`,
children: await getPlatformInfo()
}));
}
async function getProjectSettingsFiles (projectRoot) {
const cfgXml = _fetchFileContents(cdvLibUtil.projectConfig(projectRoot));
// Create package.json snippet
const pkgJson = require(path.join(projectRoot, 'package'));
const pkgSnippet = [
'--- Start of Cordova JSON Snippet ---',
JSON.stringify(pkgJson.cordova, null, 2),
'--- End of Cordova JSON Snippet ---'
].join('\n');
return {
key: 'Project Setting Files',
children: [
{ key: 'config.xml', value: `${cfgXml}` },
{ key: 'package.json', value: pkgSnippet }
]
};
}
/*
* Section Data Helpers
*/
async function _getLibDependenciesInfo (dependencies) {
const cordovaPrefix = 'cordova-';
const versionFor = name => require(`${name}/package`).version;
return Object.keys(dependencies)
.filter(name => name.startsWith(cordovaPrefix))
.map(name => ({ key: name.slice(cordovaPrefix.length), value: versionFor(name) }));
}
async function _getInstalledPlatforms (projectRoot) {
if (!_installedPlatformsList) {
_installedPlatformsList = await cdvLibUtil.getInstalledPlatformsWithVersions(projectRoot);
}
return _installedPlatformsList;
}
async function _getNpmVersion () {
return (await execa('npm', ['-v'])).stdout;
}
function _fetchFileContents (filePath) {
if (!fs.existsSync(filePath)) return 'File Not Found';
return fs.readFileSync(filePath, 'utf-8');
}
/**
* @deprecated will be removed when platforms implement the calls.
*/
const _legacyPlatformInfo = {
ios: async () => [{
key: 'xcodebuild',
value: await _failSafeSpawn('xcodebuild', ['-version'])
}],
android: async () => [{
key: 'android',
value: await _failSafeSpawn('avdmanager', ['list', 'target'])
}]
};
const _failSafeSpawn = (command, args) => execa(command, args).then(
({ stdout }) => stdout,
err => `ERROR: ${err.message}`
);
function _formatNodeList (list, level = 0) {
const content = [];
for (const item of list) {
const indent = String.prototype.padStart((4 * level), ' ');
let itemString = `${indent}${item.key}:`;
if ('value' in item) {
// Pad multi-line values with a new line on either end
itemString += (/[\r\n]/.test(item.value))
? `\n${item.value.trim()}\n`
: ` ${item.value}`;
} else {
// Start of section
itemString = `\n${itemString}\n`;
}
content.push(itemString);
if (item.children) {
content.push(..._formatNodeList(item.children, level + 1));
}
}
return content;
}
module.exports = async function () {
const projectRoot = cdvLibUtil.cdProjectRoot();
const results = await Promise.all([
getCordovaDependenciesInfo(),
getInstalledPlatforms(projectRoot),
getInstalledPlugins(projectRoot),
getEnvironmentInfo(),
...(await getPlatformEnvironmentData(projectRoot)),
getProjectSettingsFiles(projectRoot)
]);
const content = _formatNodeList(results);
cordova.emit('results', content.join('\n'));
};

129
spa/node_modules/cordova/src/telemetry.js generated vendored Normal file
View File

@@ -0,0 +1,129 @@
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
// For further details on telemetry, see:
// https://github.com/cordova/cordova-discuss/pull/43
const { EOL } = require('os');
// Google Analytics tracking code
const GA_TRACKING_CODE = 'UA-64283057-7';
const pkg = require('../package.json');
const Insight = require('insight');
/**
* By redefining `get optOut` we trick Insight into tracking
* even though the user might have opted out.
*/
class RelentlessInsight extends Insight {
get optOut () { return false; }
set optOut (value) { super.optOut = value; }
get realOptOut () { return super.optOut; }
}
const insight = new RelentlessInsight({
trackingCode: GA_TRACKING_CODE,
pkg
});
/**
* Returns true if the user opted in, and false otherwise
*/
function showPrompt () {
insight._permissionTimeout = module.exports.timeoutInSecs || 30;
const msg = 'May Cordova anonymously report usage statistics to improve the tool over time?';
return insight.askPermission(msg).then(optIn => {
if (optIn) {
console.log(EOL + 'Thanks for opting into telemetry to help us improve cordova.');
module.exports.track('telemetry', 'on', 'via-cli-prompt-choice', 'successful');
} else {
console.log(EOL + 'You have been opted out of telemetry. To change this, run: cordova telemetry on.');
// Always track telemetry opt-outs! (whether opted-in or opted-out)
module.exports.track('telemetry', 'off', 'via-cli-prompt-choice', 'successful');
}
return optIn;
});
}
function track (...args) {
// Remove empty, null or undefined strings from arguments
const filteredArgs = args.filter(val => val && val.length !== 0);
insight.track(...filteredArgs);
}
function turnOn () {
insight.optOut = false;
}
function turnOff () {
insight.optOut = true;
}
/**
* Clears telemetry setting
* Has the same effect as if user never answered the telemetry prompt
* Useful for testing purposes
*/
function clear () {
insight.optOut = undefined;
}
function isOptedIn () {
return !insight.realOptOut;
}
/**
* Has the user already answered the telemetry prompt? (thereby opting in or out?)
*/
function hasUserOptedInOrOut () {
const insightOptOut = insight.realOptOut === undefined;
return !(insightOptOut);
}
/**
* Is the environment variable 'CI' specified ?
*/
function isCI (env) {
return !!env.CI;
}
/**
* Has the user ran a command of the form: `cordova run --no-telemetry` ?
*/
function isNoTelemetryFlag (args) {
return args.indexOf('--no-telemetry') > -1;
}
// this is to help testing, so we don't have to wait for the full 30
module.exports = {
track,
turnOn,
turnOff,
clear,
isOptedIn,
hasUserOptedInOrOut,
isCI,
showPrompt,
isNoTelemetryFlag,
timeoutInSecs: 30
};