Update capacitor version
This commit is contained in:
parent
91155bce0a
commit
f3b3a86b32
610 changed files with 28718 additions and 7101 deletions
1
@capacitor/cli/node_modules/.bin/glob
generated
vendored
Symbolic link
1
@capacitor/cli/node_modules/.bin/glob
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../glob/dist/esm/bin.mjs
|
||||
2
@capacitor/cli/node_modules/.bin/rimraf
generated
vendored
2
@capacitor/cli/node_modules/.bin/rimraf
generated
vendored
|
|
@ -1 +1 @@
|
|||
../rimraf/dist/cjs/src/bin.js
|
||||
../rimraf/dist/esm/bin.mjs
|
||||
185
@capacitor/cli/node_modules/@ionic/utils-array/CHANGELOG.md
generated
vendored
Normal file
185
@capacitor/cli/node_modules/@ionic/utils-array/CHANGELOG.md
generated
vendored
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [2.1.6](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@2.1.5...@ionic/utils-array@2.1.6) (2023-03-29)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.1.5](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@2.1.4...@ionic/utils-array@2.1.5) (2020-08-28)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.1.4](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@2.1.3...@ionic/utils-array@2.1.4) (2020-08-25)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.1.3](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@2.1.2...@ionic/utils-array@2.1.3) (2020-05-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* pin tslib to avoid "Cannot set property pathExists" error ([689e1f0](https://github.com/ionic-team/ionic-cli/commit/689e1f038b907356ef855a067a76d4822e7072a8))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.1.2](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@2.1.1...@ionic/utils-array@2.1.2) (2020-05-06)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.1.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@2.1.0...@ionic/utils-array@2.1.1) (2020-03-03)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 2.1.0 (2020-02-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **start:** add new list starter option ([#4315](https://github.com/ionic-team/ionic-cli/issues/4315)) ([1df44c1](https://github.com/ionic-team/ionic-cli/commit/1df44c1591f37b89f2b672857740edd6cb2aea67))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.0.2](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@2.0.1...@ionic/utils-array@2.0.2) (2020-02-10)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.0.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@2.0.0...@ionic/utils-array@2.0.1) (2020-02-03)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [2.0.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@1.2.2...@ionic/utils-array@2.0.0) (2020-01-25)
|
||||
|
||||
|
||||
### chore
|
||||
|
||||
* require Node 10 ([5a47874](https://github.com/ionic-team/ionic-cli/commit/5a478746c074207b6dc96aa8771f04a606deb1ef))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* A minimum of Node.js 10.3.0 is required.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.2.2](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@1.2.1...@ionic/utils-array@1.2.2) (2019-12-05)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.2.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@1.2.0...@ionic/utils-array@1.2.1) (2019-09-18)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [1.2.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@1.1.1...@ionic/utils-array@1.2.0) (2019-08-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **replace:** add replace item in array by index function ([011ddf7](https://github.com/ionic-team/ionic-cli/commit/011ddf7))
|
||||
* **splice:** add non-mutating splice function ([758d287](https://github.com/ionic-team/ionic-cli/commit/758d287))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@1.1.0...@ionic/utils-array@1.1.1) (2019-08-23)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [1.1.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@1.0.2...@ionic/utils-array@1.1.0) (2019-08-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add new `move` function ([ba8da3b](https://github.com/ionic-team/ionic-cli/commit/ba8da3b))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.0.2](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@1.0.1...@ionic/utils-array@1.0.2) (2019-08-07)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.0.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@1.0.0...@ionic/utils-array@1.0.1) (2019-06-05)
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [1.0.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-array@0.0.1...@ionic/utils-array@1.0.0) (2019-05-29)
|
||||
|
||||
|
||||
### chore
|
||||
|
||||
* require Node 8 ([5670e68](https://github.com/ionic-team/ionic-cli/commit/5670e68))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* A minimum of Node.js 8.9.4 is required.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.0.1"></a>
|
||||
## 0.0.1 (2019-02-27)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ionic/utils-array
|
||||
21
@capacitor/cli/node_modules/@ionic/utils-array/LICENSE
generated
vendored
Normal file
21
@capacitor/cli/node_modules/@ionic/utils-array/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Drifty Co
|
||||
|
||||
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.
|
||||
1
@capacitor/cli/node_modules/@ionic/utils-array/README.md
generated
vendored
Normal file
1
@capacitor/cli/node_modules/@ionic/utils-array/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
# @ionic/utils-array
|
||||
39
@capacitor/cli/node_modules/@ionic/utils-array/dist/index.d.ts
generated
vendored
Normal file
39
@capacitor/cli/node_modules/@ionic/utils-array/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
export declare function conform<T>(t?: T | T[]): T[];
|
||||
export declare function concurrentFilter<T>(array: T[], callback: (currentValue: T) => Promise<boolean>): Promise<T[]>;
|
||||
export declare function filter<T>(array: T[], callback: (currentValue: T, currentIndex: number, array: readonly T[]) => Promise<boolean>): Promise<T[]>;
|
||||
export declare function filter<T>(array: readonly T[], callback: (currentValue: T, currentIndex: number, array: readonly T[]) => Promise<boolean>): Promise<readonly T[]>;
|
||||
export declare function map<T, U>(array: T[], callback: (currentValue: T, currentIndex: number, array: readonly T[]) => Promise<U>): Promise<U[]>;
|
||||
export declare function map<T, U>(array: T[], callback: (currentValue: T, currentIndex: number, array: readonly T[]) => Promise<U>): Promise<readonly U[]>;
|
||||
export declare function map<T, U>(array: readonly T[], callback: (currentValue: T, currentIndex: number, array: readonly T[]) => Promise<U>): Promise<U[]>;
|
||||
export declare function map<T, U>(array: readonly T[], callback: (currentValue: T, currentIndex: number, array: readonly T[]) => Promise<U>): Promise<readonly U[]>;
|
||||
export declare function reduce<T>(array: T[], callback: (accumulator: T, currentValue: T, currentIndex: number, array: readonly T[]) => Promise<T>): Promise<T>;
|
||||
export declare function reduce<T>(array: T[], callback: (accumulator: T, currentValue: T, currentIndex: number, array: readonly T[]) => Promise<T>, initialValue: T): Promise<T>;
|
||||
export declare function reduce<T, R>(array: T[], callback: (accumulator: R, currentValue: T, currentIndex: number, array: readonly T[]) => Promise<R>): Promise<R>;
|
||||
export declare function reduce<T, U>(array: T[], callback: (accumulator: U, currentValue: T, currentIndex: number, array: readonly T[]) => Promise<U>, initialValue: U): Promise<U>;
|
||||
export declare function reduce<T>(array: readonly T[], callback: (accumulator: T, currentValue: T, currentIndex: number, array: readonly T[]) => Promise<T>): Promise<T>;
|
||||
export declare function reduce<T>(array: readonly T[], callback: (accumulator: T, currentValue: T, currentIndex: number, array: readonly T[]) => Promise<T>, initialValue: T): Promise<T>;
|
||||
export declare function reduce<T, R>(array: readonly T[], callback: (accumulator: R, currentValue: T, currentIndex: number, array: readonly T[]) => Promise<R>): Promise<R>;
|
||||
export declare function reduce<T, U>(array: readonly T[], callback: (accumulator: U, currentValue: T, currentIndex: number, array: readonly T[]) => Promise<U>, initialValue: U): Promise<U>;
|
||||
/**
|
||||
* Splice an array.
|
||||
*
|
||||
* This function will return a new array with the standard splice behavior
|
||||
* applied. Unlike the standard array splice, the array of removed items is not
|
||||
* returned.
|
||||
*/
|
||||
export declare function splice<T>(array: readonly T[], start: number, deleteCount?: number, ...items: T[]): T[];
|
||||
/**
|
||||
* Move an item in an array by index.
|
||||
*
|
||||
* This function will return a new array with the item in the `fromIndex`
|
||||
* position moved to the `toIndex` position. If `fromIndex` or `toIndex` are
|
||||
* out of bounds, the array items remain unmoved.
|
||||
*/
|
||||
export declare function move<T>(array: readonly T[], fromIndex: number, toIndex: number): T[];
|
||||
/**
|
||||
* Replace an item in an array by index.
|
||||
*
|
||||
* This function will return a new array with the item in the `index` position
|
||||
* replaced with `item`. If `index` is out of bounds, the item is not replaced.
|
||||
*/
|
||||
export declare function replace<T>(array: readonly T[], index: number, item: T): T[];
|
||||
97
@capacitor/cli/node_modules/@ionic/utils-array/dist/index.js
generated
vendored
Normal file
97
@capacitor/cli/node_modules/@ionic/utils-array/dist/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.replace = exports.move = exports.splice = exports.reduce = exports.map = exports.filter = exports.concurrentFilter = exports.conform = void 0;
|
||||
function conform(t) {
|
||||
if (typeof t === 'undefined') {
|
||||
return [];
|
||||
}
|
||||
if (!Array.isArray(t)) {
|
||||
return [t];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
exports.conform = conform;
|
||||
async function concurrentFilter(array, callback) {
|
||||
const mapper = async (v) => [v, await callback(v)];
|
||||
const mapped = await Promise.all(array.map(mapper));
|
||||
return mapped
|
||||
.filter(([, f]) => f)
|
||||
.map(([v]) => v);
|
||||
}
|
||||
exports.concurrentFilter = concurrentFilter;
|
||||
async function filter(array, callback) {
|
||||
const initial = [];
|
||||
return reduce(array, async (acc, v, i, arr) => {
|
||||
if (await callback(v, i, arr)) {
|
||||
acc.push(v);
|
||||
}
|
||||
return acc;
|
||||
}, initial);
|
||||
}
|
||||
exports.filter = filter;
|
||||
async function map(array, callback) {
|
||||
const initial = [];
|
||||
return reduce(array, async (acc, v, i, arr) => {
|
||||
acc.push(await callback(v, i, arr));
|
||||
return acc;
|
||||
}, initial);
|
||||
}
|
||||
exports.map = map;
|
||||
async function reduce(array, callback, initialValue) {
|
||||
const hadInitialValue = typeof initialValue === 'undefined';
|
||||
const startingIndex = hadInitialValue ? 1 : 0;
|
||||
if (typeof initialValue === 'undefined') {
|
||||
if (array.length === 0) {
|
||||
throw new TypeError('Reduce of empty array with no initial value');
|
||||
}
|
||||
initialValue = array[0];
|
||||
}
|
||||
let value = initialValue;
|
||||
for (let i = startingIndex; i < array.length; i++) {
|
||||
const v = await callback(value, array[i], i, array);
|
||||
value = v;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
exports.reduce = reduce;
|
||||
/**
|
||||
* Splice an array.
|
||||
*
|
||||
* This function will return a new array with the standard splice behavior
|
||||
* applied. Unlike the standard array splice, the array of removed items is not
|
||||
* returned.
|
||||
*/
|
||||
function splice(array, start, deleteCount = array.length - start, ...items) {
|
||||
const result = [...array];
|
||||
result.splice(start, deleteCount, ...items);
|
||||
return result;
|
||||
}
|
||||
exports.splice = splice;
|
||||
/**
|
||||
* Move an item in an array by index.
|
||||
*
|
||||
* This function will return a new array with the item in the `fromIndex`
|
||||
* position moved to the `toIndex` position. If `fromIndex` or `toIndex` are
|
||||
* out of bounds, the array items remain unmoved.
|
||||
*/
|
||||
function move(array, fromIndex, toIndex) {
|
||||
const element = array[fromIndex];
|
||||
if (fromIndex < 0 || toIndex < 0 || fromIndex >= array.length || toIndex >= array.length) {
|
||||
return [...array];
|
||||
}
|
||||
return splice(splice(array, fromIndex, 1), toIndex, 0, element);
|
||||
}
|
||||
exports.move = move;
|
||||
/**
|
||||
* Replace an item in an array by index.
|
||||
*
|
||||
* This function will return a new array with the item in the `index` position
|
||||
* replaced with `item`. If `index` is out of bounds, the item is not replaced.
|
||||
*/
|
||||
function replace(array, index, item) {
|
||||
if (index < 0 || index > array.length) {
|
||||
return [...array];
|
||||
}
|
||||
return splice(array, index, 1, item);
|
||||
}
|
||||
exports.replace = replace;
|
||||
49
@capacitor/cli/node_modules/@ionic/utils-array/package.json
generated
vendored
Normal file
49
@capacitor/cli/node_modules/@ionic/utils-array/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"name": "@ionic/utils-array",
|
||||
"version": "2.1.6",
|
||||
"description": "Array utils",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ionic-team/ionic-cli.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ionic-team/ionic-cli/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"lint": "true",
|
||||
"build": "npm run clean && tsc",
|
||||
"watch": "tsc -w --preserveWatchOutput",
|
||||
"test": "jest --maxWorkers=4",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^4.0.0",
|
||||
"tslib": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/debug": "^4.1.1",
|
||||
"@types/jest": "^26.0.10",
|
||||
"@types/node": "~16.0.0",
|
||||
"jest": "^26.4.2",
|
||||
"jest-cli": "^26.0.1",
|
||||
"lint-staged": "^10.0.2",
|
||||
"rimraf": "^3.0.0",
|
||||
"ts-jest": "~26.3.0",
|
||||
"typescript": "~4.8.0"
|
||||
},
|
||||
"gitHead": "15ef6e7da4eace4fd55d16fd9508d156a4bc8203"
|
||||
}
|
||||
21
@capacitor/cli/node_modules/@ionic/utils-stream/LICENSE
generated
vendored
Normal file
21
@capacitor/cli/node_modules/@ionic/utils-stream/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Drifty Co
|
||||
|
||||
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.
|
||||
1
@capacitor/cli/node_modules/@ionic/utils-stream/README.md
generated
vendored
Normal file
1
@capacitor/cli/node_modules/@ionic/utils-stream/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
# @ionic/utils-stream
|
||||
39
@capacitor/cli/node_modules/@ionic/utils-stream/dist/index.d.ts
generated
vendored
Normal file
39
@capacitor/cli/node_modules/@ionic/utils-stream/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import { Readable, ReadableOptions, Writable, WritableOptions } from 'stream';
|
||||
export declare class NullStream extends Writable {
|
||||
_write(chunk: any, encoding: string, callback: () => void): void;
|
||||
}
|
||||
export interface ReadableStreamBufferOptions extends ReadableOptions {
|
||||
chunkSize?: number;
|
||||
allocSize?: number;
|
||||
growSize?: number;
|
||||
}
|
||||
export declare class ReadableStreamBuffer extends Readable {
|
||||
protected buffer: Buffer;
|
||||
protected _size: number;
|
||||
protected _stopped: boolean;
|
||||
protected chunkSize: number;
|
||||
protected growSize: number;
|
||||
constructor(opts?: ReadableStreamBufferOptions);
|
||||
get size(): number;
|
||||
get stopped(): boolean;
|
||||
_read(): void;
|
||||
feed(data: Buffer | string, encoding?: BufferEncoding): void;
|
||||
stop(): void;
|
||||
protected _send(): void;
|
||||
}
|
||||
export interface WritableStreamBufferOptions extends WritableOptions {
|
||||
allocSize?: number;
|
||||
growSize?: number;
|
||||
}
|
||||
export declare class WritableStreamBuffer extends Writable {
|
||||
protected buffer: Buffer;
|
||||
protected _size: number;
|
||||
protected growSize: number;
|
||||
constructor(opts?: WritableStreamBufferOptions);
|
||||
get size(): number;
|
||||
_write(chunk: any, encoding: string, callback: () => void): void;
|
||||
consume(bytes?: number): Buffer;
|
||||
}
|
||||
export declare function growBufferForAppendedData(buf: Buffer, actualsize: number, appendsize: number): Buffer;
|
||||
108
@capacitor/cli/node_modules/@ionic/utils-stream/dist/index.js
generated
vendored
Normal file
108
@capacitor/cli/node_modules/@ionic/utils-stream/dist/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.growBufferForAppendedData = exports.WritableStreamBuffer = exports.ReadableStreamBuffer = exports.NullStream = void 0;
|
||||
const stream_1 = require("stream");
|
||||
const DEFAULT_CHUNK_SIZE = 4;
|
||||
const DEFAULT_ALLOC_SIZE = 32;
|
||||
const DEFAULT_GROW_SIZE = 16;
|
||||
class NullStream extends stream_1.Writable {
|
||||
_write(chunk, encoding, callback) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
exports.NullStream = NullStream;
|
||||
class ReadableStreamBuffer extends stream_1.Readable {
|
||||
constructor(opts) {
|
||||
super(opts);
|
||||
this._size = 0;
|
||||
this._stopped = false;
|
||||
this.buffer = Buffer.alloc(opts && opts.allocSize ? opts.allocSize : DEFAULT_ALLOC_SIZE);
|
||||
this.chunkSize = opts && opts.chunkSize ? opts.chunkSize : DEFAULT_CHUNK_SIZE;
|
||||
this.growSize = opts && opts.growSize ? opts.growSize : DEFAULT_GROW_SIZE;
|
||||
}
|
||||
get size() {
|
||||
return this._size;
|
||||
}
|
||||
get stopped() {
|
||||
return this._stopped;
|
||||
}
|
||||
_read() {
|
||||
this._send();
|
||||
}
|
||||
feed(data, encoding = 'utf8') {
|
||||
if (this._stopped) {
|
||||
throw new Error('ReadableStreamBuffer is stopped. Can no longer feed.');
|
||||
}
|
||||
const datasize = typeof data === 'string' ? Buffer.byteLength(data) : data.length;
|
||||
this.buffer = growBufferForAppendedData(this.buffer, this._size, Math.ceil(datasize / this.growSize) * this.growSize);
|
||||
if (typeof data === 'string') {
|
||||
this.buffer.write(data, this._size, datasize, encoding);
|
||||
}
|
||||
else {
|
||||
this.buffer.copy(data, this._size, 0);
|
||||
}
|
||||
this._size += datasize;
|
||||
}
|
||||
stop() {
|
||||
if (this._stopped) {
|
||||
return;
|
||||
}
|
||||
this._stopped = true;
|
||||
if (this._size === 0) {
|
||||
this.push(null);
|
||||
}
|
||||
}
|
||||
_send() {
|
||||
const chunkSize = Math.min(this.chunkSize, this._size);
|
||||
let done = false;
|
||||
if (chunkSize > 0) {
|
||||
const chunk = Buffer.alloc(chunkSize);
|
||||
this.buffer.copy(chunk, 0, 0, chunkSize);
|
||||
done = !this.push(chunk);
|
||||
this.buffer.copy(this.buffer, 0, chunkSize, this._size);
|
||||
this._size -= chunkSize;
|
||||
}
|
||||
if (this._size === 0 && this._stopped) {
|
||||
this.push(null);
|
||||
}
|
||||
if (!done) {
|
||||
setTimeout(() => this._send(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.ReadableStreamBuffer = ReadableStreamBuffer;
|
||||
class WritableStreamBuffer extends stream_1.Writable {
|
||||
constructor(opts) {
|
||||
super(opts);
|
||||
this._size = 0;
|
||||
this.buffer = Buffer.alloc(opts && opts.allocSize ? opts.allocSize : DEFAULT_ALLOC_SIZE);
|
||||
this.growSize = opts && opts.growSize ? opts.growSize : DEFAULT_GROW_SIZE;
|
||||
}
|
||||
get size() {
|
||||
return this._size;
|
||||
}
|
||||
_write(chunk, encoding, callback) {
|
||||
this.buffer = growBufferForAppendedData(this.buffer, this._size, Math.ceil(chunk.length / this.growSize) * this.growSize);
|
||||
chunk.copy(this.buffer, this._size, 0);
|
||||
this._size += chunk.length;
|
||||
callback();
|
||||
}
|
||||
consume(bytes) {
|
||||
bytes = typeof bytes === 'number' ? bytes : this._size;
|
||||
const data = Buffer.alloc(bytes);
|
||||
this.buffer.copy(data, 0, 0, data.length);
|
||||
this.buffer.copy(this.buffer, 0, data.length);
|
||||
this._size -= data.length;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
exports.WritableStreamBuffer = WritableStreamBuffer;
|
||||
function growBufferForAppendedData(buf, actualsize, appendsize) {
|
||||
if ((buf.length - actualsize) >= appendsize) {
|
||||
return buf;
|
||||
}
|
||||
const newbuffer = Buffer.alloc(buf.length + appendsize);
|
||||
buf.copy(newbuffer, 0, 0, actualsize);
|
||||
return newbuffer;
|
||||
}
|
||||
exports.growBufferForAppendedData = growBufferForAppendedData;
|
||||
49
@capacitor/cli/node_modules/@ionic/utils-stream/package.json
generated
vendored
Normal file
49
@capacitor/cli/node_modules/@ionic/utils-stream/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"name": "@ionic/utils-stream",
|
||||
"version": "3.1.7",
|
||||
"description": "Stream utils for NodeJS",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ionic-team/ionic-cli.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ionic-team/ionic-cli/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"lint": "true",
|
||||
"build": "npm run clean && tsc",
|
||||
"watch": "tsc -w --preserveWatchOutput",
|
||||
"test": "jest --maxWorkers=4",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^4.0.0",
|
||||
"tslib": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/debug": "^4.1.1",
|
||||
"@types/jest": "^26.0.10",
|
||||
"@types/node": "~16.0.0",
|
||||
"jest": "^26.4.2",
|
||||
"jest-cli": "^26.0.1",
|
||||
"lint-staged": "^10.0.2",
|
||||
"rimraf": "^3.0.0",
|
||||
"stream-combiner2": "^1.1.1",
|
||||
"ts-jest": "~26.3.0",
|
||||
"typescript": "~4.8.0"
|
||||
}
|
||||
}
|
||||
21
@capacitor/cli/node_modules/@ionic/utils-subprocess/LICENSE
generated
vendored
Normal file
21
@capacitor/cli/node_modules/@ionic/utils-subprocess/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Drifty Co
|
||||
|
||||
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.
|
||||
1
@capacitor/cli/node_modules/@ionic/utils-subprocess/README.md
generated
vendored
Normal file
1
@capacitor/cli/node_modules/@ionic/utils-subprocess/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
# @ionic/utils-process
|
||||
98
@capacitor/cli/node_modules/@ionic/utils-subprocess/dist/index.d.ts
generated
vendored
Normal file
98
@capacitor/cli/node_modules/@ionic/utils-subprocess/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
/// <reference types="node" />
|
||||
import { ChildProcess, ForkOptions, SpawnOptions } from 'child_process';
|
||||
export declare const ERROR_COMMAND_NOT_FOUND = "ERR_SUBPROCESS_COMMAND_NOT_FOUND";
|
||||
export declare const ERROR_NON_ZERO_EXIT = "ERR_SUBPROCESS_NON_ZERO_EXIT";
|
||||
export declare const ERROR_SIGNAL_EXIT = "ERR_SUBPROCESS_SIGNAL_EXIT";
|
||||
export declare const TILDE_PATH_REGEX: RegExp;
|
||||
export declare function expandTildePath(p: string): string;
|
||||
/**
|
||||
* Prepare the PATH environment variable for use with subprocesses.
|
||||
*
|
||||
* If a raw tilde is found in PATH, e.g. `~/.bin`, it is expanded. The raw
|
||||
* tilde works in Bash, but not in Node's `child_process` outside of a shell.
|
||||
*
|
||||
* This is a utility method. You do not need to use it with `Subprocess`.
|
||||
*
|
||||
* @param path Defaults to `process.env.PATH`
|
||||
*/
|
||||
export declare function convertPATH(path?: string): string;
|
||||
export declare class SubprocessError extends Error {
|
||||
readonly name = "SubprocessError";
|
||||
code?: typeof ERROR_COMMAND_NOT_FOUND | typeof ERROR_NON_ZERO_EXIT | typeof ERROR_SIGNAL_EXIT;
|
||||
output?: string;
|
||||
signal?: string;
|
||||
exitCode?: number;
|
||||
}
|
||||
export interface SubprocessOptions extends SpawnOptions {
|
||||
}
|
||||
export interface SubprocessBashifyOptions {
|
||||
/**
|
||||
* Mask file path to first argument.
|
||||
*
|
||||
* The first argument to subprocesses is the program name or path, e.g.
|
||||
* `/path/to/bin/my-program`. If `true`, `bashify()` will return the program
|
||||
* name without a file path, e.g. `my-program`.
|
||||
*
|
||||
* The default is `true`.
|
||||
*/
|
||||
maskArgv0?: boolean;
|
||||
/**
|
||||
* Mask file path to second argument.
|
||||
*
|
||||
* In some subprocesses, the second argument is a script file to run, e.g.
|
||||
* `node ./scripts/post-install`. If `true`, `bashify()` will return the
|
||||
* script name without a file path, e.g. `node post-install`.
|
||||
*
|
||||
* The default is `false`.
|
||||
*/
|
||||
maskArgv1?: boolean;
|
||||
/**
|
||||
* Remove the first argument from output.
|
||||
*
|
||||
* Useful to make a command such as `node ./scripts/post-install` appear as
|
||||
* simply `post-install`.
|
||||
*
|
||||
* The default is `false`.
|
||||
*/
|
||||
shiftArgv0?: boolean;
|
||||
}
|
||||
export declare class Subprocess {
|
||||
name: string;
|
||||
args: readonly string[];
|
||||
protected readonly path?: string;
|
||||
protected _options: SpawnOptions;
|
||||
constructor(name: string, args: readonly string[], options?: SubprocessOptions);
|
||||
get options(): Readonly<SpawnOptions>;
|
||||
output(): Promise<string>;
|
||||
combinedOutput(): Promise<string>;
|
||||
run(): Promise<void> & {
|
||||
p: ChildProcess;
|
||||
};
|
||||
spawn(): ChildProcess;
|
||||
bashify({ maskArgv0, maskArgv1, shiftArgv0 }?: SubprocessBashifyOptions): string;
|
||||
bashifyArg(arg: string): string;
|
||||
maskArg(arg: string): string;
|
||||
}
|
||||
export declare function spawn(command: string, args?: readonly string[], options?: SpawnOptions): ChildProcess;
|
||||
export declare function fork(modulePath: string, args?: readonly string[], options?: ForkOptions & Pick<SpawnOptions, 'stdio'>): ChildProcess;
|
||||
export interface WhichOptions {
|
||||
PATH?: string;
|
||||
PATHEXT?: string;
|
||||
}
|
||||
/**
|
||||
* Find the first instance of a program in PATH.
|
||||
*
|
||||
* If `program` contains a path separator, this function will merely return it.
|
||||
*
|
||||
* @param program A command name, such as `ionic`
|
||||
*/
|
||||
export declare function which(program: string, { PATH, PATHEXT }?: WhichOptions): Promise<string>;
|
||||
/**
|
||||
* Find all instances of a program in PATH.
|
||||
*
|
||||
* If `program` contains a path separator, this function will merely return it
|
||||
* inside an array.
|
||||
*
|
||||
* @param program A command name, such as `ionic`
|
||||
*/
|
||||
export declare function findExecutables(program: string, { PATH, PATHEXT }?: WhichOptions): Promise<string[]>;
|
||||
228
@capacitor/cli/node_modules/@ionic/utils-subprocess/dist/index.js
generated
vendored
Normal file
228
@capacitor/cli/node_modules/@ionic/utils-subprocess/dist/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,228 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.findExecutables = exports.which = exports.fork = exports.spawn = exports.Subprocess = exports.SubprocessError = exports.convertPATH = exports.expandTildePath = exports.TILDE_PATH_REGEX = exports.ERROR_SIGNAL_EXIT = exports.ERROR_NON_ZERO_EXIT = exports.ERROR_COMMAND_NOT_FOUND = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const utils_array_1 = require("@ionic/utils-array");
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const utils_process_1 = require("@ionic/utils-process");
|
||||
const utils_stream_1 = require("@ionic/utils-stream");
|
||||
const utils_terminal_1 = require("@ionic/utils-terminal");
|
||||
const child_process_1 = require("child_process");
|
||||
const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn"));
|
||||
const os = tslib_1.__importStar(require("os"));
|
||||
const pathlib = tslib_1.__importStar(require("path"));
|
||||
exports.ERROR_COMMAND_NOT_FOUND = 'ERR_SUBPROCESS_COMMAND_NOT_FOUND';
|
||||
exports.ERROR_NON_ZERO_EXIT = 'ERR_SUBPROCESS_NON_ZERO_EXIT';
|
||||
exports.ERROR_SIGNAL_EXIT = 'ERR_SUBPROCESS_SIGNAL_EXIT';
|
||||
exports.TILDE_PATH_REGEX = /^~($|\/|\\)/;
|
||||
function expandTildePath(p) {
|
||||
const h = os.homedir();
|
||||
return p.replace(exports.TILDE_PATH_REGEX, `${h}$1`);
|
||||
}
|
||||
exports.expandTildePath = expandTildePath;
|
||||
/**
|
||||
* Prepare the PATH environment variable for use with subprocesses.
|
||||
*
|
||||
* If a raw tilde is found in PATH, e.g. `~/.bin`, it is expanded. The raw
|
||||
* tilde works in Bash, but not in Node's `child_process` outside of a shell.
|
||||
*
|
||||
* This is a utility method. You do not need to use it with `Subprocess`.
|
||||
*
|
||||
* @param path Defaults to `process.env.PATH`
|
||||
*/
|
||||
function convertPATH(path = process.env.PATH || '') {
|
||||
return path.split(pathlib.delimiter).map(expandTildePath).join(pathlib.delimiter);
|
||||
}
|
||||
exports.convertPATH = convertPATH;
|
||||
class SubprocessError extends Error {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.name = 'SubprocessError';
|
||||
}
|
||||
}
|
||||
exports.SubprocessError = SubprocessError;
|
||||
class Subprocess {
|
||||
constructor(name, args, options = {}) {
|
||||
this.name = name;
|
||||
this.args = args;
|
||||
const masked = this.maskArg(name);
|
||||
if (masked !== name) {
|
||||
this.name = masked;
|
||||
this.path = name;
|
||||
}
|
||||
this._options = options;
|
||||
}
|
||||
get options() {
|
||||
const opts = this._options;
|
||||
if (!opts.env) {
|
||||
opts.env = process.env;
|
||||
}
|
||||
const env = (0, utils_process_1.createProcessEnv)(opts.env || {}, {
|
||||
PATH: convertPATH(typeof opts.env.PATH === 'string' ? opts.env.PATH : process.env.PATH),
|
||||
});
|
||||
return { ...opts, env };
|
||||
}
|
||||
async output() {
|
||||
this._options.stdio = 'pipe';
|
||||
const promise = this.run();
|
||||
const stdoutBuf = new utils_stream_1.WritableStreamBuffer();
|
||||
const stderrBuf = new utils_stream_1.WritableStreamBuffer();
|
||||
const combinedBuf = new utils_stream_1.WritableStreamBuffer();
|
||||
promise.p.stdout?.pipe(stdoutBuf);
|
||||
promise.p.stdout?.pipe(combinedBuf);
|
||||
promise.p.stderr?.pipe(stderrBuf);
|
||||
promise.p.stderr?.pipe(combinedBuf);
|
||||
try {
|
||||
await promise;
|
||||
}
|
||||
catch (e) {
|
||||
stdoutBuf.end();
|
||||
stderrBuf.end();
|
||||
e.output = combinedBuf.consume().toString();
|
||||
throw e;
|
||||
}
|
||||
stderrBuf.end();
|
||||
combinedBuf.end();
|
||||
return stdoutBuf.consume().toString();
|
||||
}
|
||||
async combinedOutput() {
|
||||
this._options.stdio = 'pipe';
|
||||
const promise = this.run();
|
||||
const buf = new utils_stream_1.WritableStreamBuffer();
|
||||
promise.p.stdout?.pipe(buf);
|
||||
promise.p.stderr?.pipe(buf);
|
||||
try {
|
||||
await promise;
|
||||
}
|
||||
catch (e) {
|
||||
e.output = buf.consume().toString();
|
||||
throw e;
|
||||
}
|
||||
return buf.consume().toString();
|
||||
}
|
||||
run() {
|
||||
const p = this.spawn();
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
p.on('error', (error) => {
|
||||
let err;
|
||||
if (error.code === 'ENOENT') {
|
||||
err = new SubprocessError('Command not found.', { cause: error });
|
||||
err.code = exports.ERROR_COMMAND_NOT_FOUND;
|
||||
}
|
||||
else {
|
||||
err = new SubprocessError('Command error.', { cause: error });
|
||||
}
|
||||
reject(err);
|
||||
});
|
||||
p.on('close', (code, signal) => {
|
||||
let err;
|
||||
if (code === 0) {
|
||||
return resolve();
|
||||
}
|
||||
else if (signal) {
|
||||
err = new SubprocessError('Signal exit from subprocess.');
|
||||
err.code = exports.ERROR_SIGNAL_EXIT;
|
||||
err.signal = signal;
|
||||
}
|
||||
else if (code) {
|
||||
err = new SubprocessError('Non-zero exit from subprocess.');
|
||||
err.code = exports.ERROR_NON_ZERO_EXIT;
|
||||
err.exitCode = code;
|
||||
}
|
||||
else {
|
||||
return resolve();
|
||||
}
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
Object.defineProperties(promise, {
|
||||
p: { value: p },
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
spawn() {
|
||||
return spawn(this.path ? this.path : this.name, this.args, this.options);
|
||||
}
|
||||
bashify({ maskArgv0 = true, maskArgv1 = false, shiftArgv0 = false } = {}) {
|
||||
const args = [this.path ? this.path : this.name, ...this.args];
|
||||
if (shiftArgv0) {
|
||||
args.shift();
|
||||
}
|
||||
if (args[0] && maskArgv0) {
|
||||
args[0] = this.maskArg(args[0]);
|
||||
}
|
||||
if (args[1] && maskArgv1) {
|
||||
args[1] = this.maskArg(args[1]);
|
||||
}
|
||||
return args.length > 0
|
||||
? args.map(arg => this.bashifyArg(arg)).join(' ')
|
||||
: '';
|
||||
}
|
||||
bashifyArg(arg) {
|
||||
return arg.includes(' ') ? `"${arg.replace(/\"/g, '\\"')}"` : arg;
|
||||
}
|
||||
maskArg(arg) {
|
||||
const i = arg.lastIndexOf(pathlib.sep);
|
||||
return i >= 0 ? arg.substring(i + 1) : arg;
|
||||
}
|
||||
}
|
||||
exports.Subprocess = Subprocess;
|
||||
function spawn(command, args = [], options) {
|
||||
return (0, cross_spawn_1.default)(command, [...args], options);
|
||||
}
|
||||
exports.spawn = spawn;
|
||||
function fork(modulePath, args = [], options = {}) {
|
||||
return (0, child_process_1.fork)(modulePath, [...args], options);
|
||||
}
|
||||
exports.fork = fork;
|
||||
const DEFAULT_PATHEXT = utils_terminal_1.TERMINAL_INFO.windows ? '.COM;.EXE;.BAT;.CMD' : undefined;
|
||||
/**
|
||||
* Find the first instance of a program in PATH.
|
||||
*
|
||||
* If `program` contains a path separator, this function will merely return it.
|
||||
*
|
||||
* @param program A command name, such as `ionic`
|
||||
*/
|
||||
async function which(program, { PATH = process.env.PATH, PATHEXT = process.env.PATHEXT || DEFAULT_PATHEXT } = {}) {
|
||||
if (program.includes(pathlib.sep)) {
|
||||
return program;
|
||||
}
|
||||
const results = await _findExecutables(program, { PATH });
|
||||
if (!results.length) {
|
||||
const err = new Error(`${program} cannot be found within PATH`);
|
||||
err.code = 'ENOENT';
|
||||
throw err;
|
||||
}
|
||||
return results[0];
|
||||
}
|
||||
exports.which = which;
|
||||
/**
|
||||
* Find all instances of a program in PATH.
|
||||
*
|
||||
* If `program` contains a path separator, this function will merely return it
|
||||
* inside an array.
|
||||
*
|
||||
* @param program A command name, such as `ionic`
|
||||
*/
|
||||
async function findExecutables(program, { PATH = process.env.PATH, PATHEXT = process.env.PATHEXT || DEFAULT_PATHEXT } = {}) {
|
||||
if (program.includes(pathlib.sep)) {
|
||||
return [program];
|
||||
}
|
||||
return _findExecutables(program, { PATH });
|
||||
}
|
||||
exports.findExecutables = findExecutables;
|
||||
async function _findExecutables(program, { PATH = process.env.PATH, PATHEXT = process.env.PATHEXT || DEFAULT_PATHEXT } = {}) {
|
||||
const pathParts = (0, utils_process_1.getPathParts)(PATH);
|
||||
let programNames;
|
||||
// if windows, cycle through all possible executable extensions
|
||||
// ex: node.exe, npm.cmd, etc.
|
||||
if (utils_terminal_1.TERMINAL_INFO.windows) {
|
||||
const exts = (0, utils_process_1.getPathParts)(PATHEXT).map(ext => ext.toLowerCase());
|
||||
// don't append extensions if one has already been provided
|
||||
programNames = exts.includes(pathlib.extname(program).toLowerCase()) ? [program] : exts.map(ext => program + ext);
|
||||
}
|
||||
else {
|
||||
programNames = [program];
|
||||
}
|
||||
return [].concat(...await (0, utils_array_1.map)(programNames, async (programName) => (0, utils_array_1.concurrentFilter)(pathParts.map(p => pathlib.join(p, programName)), async (p) => (0, utils_fs_1.isExecutableFile)(p))));
|
||||
}
|
||||
55
@capacitor/cli/node_modules/@ionic/utils-subprocess/package.json
generated
vendored
Normal file
55
@capacitor/cli/node_modules/@ionic/utils-subprocess/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
"name": "@ionic/utils-subprocess",
|
||||
"version": "3.0.1",
|
||||
"description": "Subprocess utils for NodeJS",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ionic-team/ionic-cli.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ionic-team/ionic-cli/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"lint": "true",
|
||||
"build": "npm run clean && tsc",
|
||||
"watch": "tsc -w --preserveWatchOutput",
|
||||
"test": "jest --maxWorkers=4",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ionic/utils-array": "2.1.6",
|
||||
"@ionic/utils-fs": "3.1.7",
|
||||
"@ionic/utils-process": "2.1.12",
|
||||
"@ionic/utils-stream": "3.1.7",
|
||||
"@ionic/utils-terminal": "2.3.5",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"debug": "^4.0.0",
|
||||
"tslib": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cross-spawn": "^6.0.0",
|
||||
"@types/debug": "^4.1.1",
|
||||
"@types/jest": "^26.0.10",
|
||||
"@types/node": "~16.0.0",
|
||||
"jest": "^26.4.2",
|
||||
"jest-cli": "^26.0.1",
|
||||
"lint-staged": "^10.0.2",
|
||||
"rimraf": "^3.0.0",
|
||||
"ts-jest": "~26.3.0",
|
||||
"typescript": "~4.8.0"
|
||||
}
|
||||
}
|
||||
2
@capacitor/cli/node_modules/brace-expansion/.github/FUNDING.yml
generated
vendored
2
@capacitor/cli/node_modules/brace-expansion/.github/FUNDING.yml
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
tidelift: "npm/brace-expansion"
|
||||
patreon: juliangruber
|
||||
135
@capacitor/cli/node_modules/brace-expansion/README.md
generated
vendored
135
@capacitor/cli/node_modules/brace-expansion/README.md
generated
vendored
|
|
@ -1,135 +0,0 @@
|
|||
# brace-expansion
|
||||
|
||||
[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
|
||||
as known from sh/bash, in JavaScript.
|
||||
|
||||
[](http://travis-ci.org/juliangruber/brace-expansion)
|
||||
[](https://www.npmjs.org/package/brace-expansion)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
[](https://ci.testling.com/juliangruber/brace-expansion)
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var expand = require('brace-expansion');
|
||||
|
||||
expand('file-{a,b,c}.jpg')
|
||||
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
|
||||
|
||||
expand('-v{,,}')
|
||||
// => ['-v', '-v', '-v']
|
||||
|
||||
expand('file{0..2}.jpg')
|
||||
// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
|
||||
|
||||
expand('file-{a..c}.jpg')
|
||||
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
|
||||
|
||||
expand('file{2..0}.jpg')
|
||||
// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
|
||||
|
||||
expand('file{0..4..2}.jpg')
|
||||
// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
|
||||
|
||||
expand('file-{a..e..2}.jpg')
|
||||
// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
|
||||
|
||||
expand('file{00..10..5}.jpg')
|
||||
// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
|
||||
|
||||
expand('{{A..C},{a..c}}')
|
||||
// => ['A', 'B', 'C', 'a', 'b', 'c']
|
||||
|
||||
expand('ppp{,config,oe{,conf}}')
|
||||
// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var expand = require('brace-expansion');
|
||||
```
|
||||
|
||||
### var expanded = expand(str)
|
||||
|
||||
Return an array of all possible and valid expansions of `str`. If none are
|
||||
found, `[str]` is returned.
|
||||
|
||||
Valid expansions are:
|
||||
|
||||
```js
|
||||
/^(.*,)+(.+)?$/
|
||||
// {a,b,...}
|
||||
```
|
||||
|
||||
A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
|
||||
|
||||
```js
|
||||
/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
|
||||
// {x..y[..incr]}
|
||||
```
|
||||
|
||||
A numeric sequence from `x` to `y` inclusive, with optional increment.
|
||||
If `x` or `y` start with a leading `0`, all the numbers will be padded
|
||||
to have equal length. Negative numbers and backwards iteration work too.
|
||||
|
||||
```js
|
||||
/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
|
||||
// {x..y[..incr]}
|
||||
```
|
||||
|
||||
An alphabetic sequence from `x` to `y` inclusive, with optional increment.
|
||||
`x` and `y` must be exactly one character, and if given, `incr` must be a
|
||||
number.
|
||||
|
||||
For compatibility reasons, the string `${` is not eligible for brace expansion.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```bash
|
||||
npm install brace-expansion
|
||||
```
|
||||
|
||||
## Contributors
|
||||
|
||||
- [Julian Gruber](https://github.com/juliangruber)
|
||||
- [Isaac Z. Schlueter](https://github.com/isaacs)
|
||||
|
||||
## Sponsors
|
||||
|
||||
This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
|
||||
|
||||
Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the
|
||||
[Tidelift security contact](https://tidelift.com/security).
|
||||
Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
## License
|
||||
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
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.
|
||||
203
@capacitor/cli/node_modules/brace-expansion/index.js
generated
vendored
203
@capacitor/cli/node_modules/brace-expansion/index.js
generated
vendored
|
|
@ -1,203 +0,0 @@
|
|||
var balanced = require('balanced-match');
|
||||
|
||||
module.exports = expandTop;
|
||||
|
||||
var escSlash = '\0SLASH'+Math.random()+'\0';
|
||||
var escOpen = '\0OPEN'+Math.random()+'\0';
|
||||
var escClose = '\0CLOSE'+Math.random()+'\0';
|
||||
var escComma = '\0COMMA'+Math.random()+'\0';
|
||||
var escPeriod = '\0PERIOD'+Math.random()+'\0';
|
||||
|
||||
function numeric(str) {
|
||||
return parseInt(str, 10) == str
|
||||
? parseInt(str, 10)
|
||||
: str.charCodeAt(0);
|
||||
}
|
||||
|
||||
function escapeBraces(str) {
|
||||
return str.split('\\\\').join(escSlash)
|
||||
.split('\\{').join(escOpen)
|
||||
.split('\\}').join(escClose)
|
||||
.split('\\,').join(escComma)
|
||||
.split('\\.').join(escPeriod);
|
||||
}
|
||||
|
||||
function unescapeBraces(str) {
|
||||
return str.split(escSlash).join('\\')
|
||||
.split(escOpen).join('{')
|
||||
.split(escClose).join('}')
|
||||
.split(escComma).join(',')
|
||||
.split(escPeriod).join('.');
|
||||
}
|
||||
|
||||
|
||||
// Basically just str.split(","), but handling cases
|
||||
// where we have nested braced sections, which should be
|
||||
// treated as individual members, like {a,{b,c},d}
|
||||
function parseCommaParts(str) {
|
||||
if (!str)
|
||||
return [''];
|
||||
|
||||
var parts = [];
|
||||
var m = balanced('{', '}', str);
|
||||
|
||||
if (!m)
|
||||
return str.split(',');
|
||||
|
||||
var pre = m.pre;
|
||||
var body = m.body;
|
||||
var post = m.post;
|
||||
var p = pre.split(',');
|
||||
|
||||
p[p.length-1] += '{' + body + '}';
|
||||
var postParts = parseCommaParts(post);
|
||||
if (post.length) {
|
||||
p[p.length-1] += postParts.shift();
|
||||
p.push.apply(p, postParts);
|
||||
}
|
||||
|
||||
parts.push.apply(parts, p);
|
||||
|
||||
return parts;
|
||||
}
|
||||
|
||||
function expandTop(str) {
|
||||
if (!str)
|
||||
return [];
|
||||
|
||||
// I don't know why Bash 4.3 does this, but it does.
|
||||
// Anything starting with {} will have the first two bytes preserved
|
||||
// but *only* at the top level, so {},a}b will not expand to anything,
|
||||
// but a{},b}c will be expanded to [a}c,abc].
|
||||
// One could argue that this is a bug in Bash, but since the goal of
|
||||
// this module is to match Bash's rules, we escape a leading {}
|
||||
if (str.substr(0, 2) === '{}') {
|
||||
str = '\\{\\}' + str.substr(2);
|
||||
}
|
||||
|
||||
return expand(escapeBraces(str), true).map(unescapeBraces);
|
||||
}
|
||||
|
||||
function embrace(str) {
|
||||
return '{' + str + '}';
|
||||
}
|
||||
function isPadded(el) {
|
||||
return /^-?0\d/.test(el);
|
||||
}
|
||||
|
||||
function lte(i, y) {
|
||||
return i <= y;
|
||||
}
|
||||
function gte(i, y) {
|
||||
return i >= y;
|
||||
}
|
||||
|
||||
function expand(str, isTop) {
|
||||
var expansions = [];
|
||||
|
||||
var m = balanced('{', '}', str);
|
||||
if (!m) return [str];
|
||||
|
||||
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
||||
var pre = m.pre;
|
||||
var post = m.post.length
|
||||
? expand(m.post, false)
|
||||
: [''];
|
||||
|
||||
if (/\$$/.test(m.pre)) {
|
||||
for (var k = 0; k < post.length; k++) {
|
||||
var expansion = pre+ '{' + m.body + '}' + post[k];
|
||||
expansions.push(expansion);
|
||||
}
|
||||
} else {
|
||||
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isSequence = isNumericSequence || isAlphaSequence;
|
||||
var isOptions = m.body.indexOf(',') >= 0;
|
||||
if (!isSequence && !isOptions) {
|
||||
// {a},b}
|
||||
if (m.post.match(/,.*\}/)) {
|
||||
str = m.pre + '{' + m.body + escClose + m.post;
|
||||
return expand(str);
|
||||
}
|
||||
return [str];
|
||||
}
|
||||
|
||||
var n;
|
||||
if (isSequence) {
|
||||
n = m.body.split(/\.\./);
|
||||
} else {
|
||||
n = parseCommaParts(m.body);
|
||||
if (n.length === 1) {
|
||||
// x{{a,b}}y ==> x{a}y x{b}y
|
||||
n = expand(n[0], false).map(embrace);
|
||||
if (n.length === 1) {
|
||||
return post.map(function(p) {
|
||||
return m.pre + n[0] + p;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// at this point, n is the parts, and we know it's not a comma set
|
||||
// with a single entry.
|
||||
var N;
|
||||
|
||||
if (isSequence) {
|
||||
var x = numeric(n[0]);
|
||||
var y = numeric(n[1]);
|
||||
var width = Math.max(n[0].length, n[1].length)
|
||||
var incr = n.length == 3
|
||||
? Math.abs(numeric(n[2]))
|
||||
: 1;
|
||||
var test = lte;
|
||||
var reverse = y < x;
|
||||
if (reverse) {
|
||||
incr *= -1;
|
||||
test = gte;
|
||||
}
|
||||
var pad = n.some(isPadded);
|
||||
|
||||
N = [];
|
||||
|
||||
for (var i = x; test(i, y); i += incr) {
|
||||
var c;
|
||||
if (isAlphaSequence) {
|
||||
c = String.fromCharCode(i);
|
||||
if (c === '\\')
|
||||
c = '';
|
||||
} else {
|
||||
c = String(i);
|
||||
if (pad) {
|
||||
var need = width - c.length;
|
||||
if (need > 0) {
|
||||
var z = new Array(need + 1).join('0');
|
||||
if (i < 0)
|
||||
c = '-' + z + c.slice(1);
|
||||
else
|
||||
c = z + c;
|
||||
}
|
||||
}
|
||||
}
|
||||
N.push(c);
|
||||
}
|
||||
} else {
|
||||
N = [];
|
||||
|
||||
for (var j = 0; j < n.length; j++) {
|
||||
N.push.apply(N, expand(n[j], false));
|
||||
}
|
||||
}
|
||||
|
||||
for (var j = 0; j < N.length; j++) {
|
||||
for (var k = 0; k < post.length; k++) {
|
||||
var expansion = pre + N[j] + post[k];
|
||||
if (!isTop || isSequence || expansion)
|
||||
expansions.push(expansion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return expansions;
|
||||
}
|
||||
|
||||
46
@capacitor/cli/node_modules/brace-expansion/package.json
generated
vendored
46
@capacitor/cli/node_modules/brace-expansion/package.json
generated
vendored
|
|
@ -1,46 +0,0 @@
|
|||
{
|
||||
"name": "brace-expansion",
|
||||
"description": "Brace expansion as known from sh/bash",
|
||||
"version": "2.0.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/juliangruber/brace-expansion.git"
|
||||
},
|
||||
"homepage": "https://github.com/juliangruber/brace-expansion",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tape test/*.js",
|
||||
"gentest": "bash test/generate.sh",
|
||||
"bench": "matcha test/perf/bench.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@c4312/matcha": "^1.3.1",
|
||||
"tape": "^4.6.0"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"license": "MIT",
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/20..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/25..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
}
|
||||
}
|
||||
98
@capacitor/cli/node_modules/commander/Readme.md
generated
vendored
98
@capacitor/cli/node_modules/commander/Readme.md
generated
vendored
|
|
@ -37,7 +37,7 @@ Read this in other languages: English | [简体中文](./Readme_zh-CN.md)
|
|||
- [.usage](#usage)
|
||||
- [.description and .summary](#description-and-summary)
|
||||
- [.helpOption(flags, description)](#helpoptionflags-description)
|
||||
- [.addHelpCommand()](#addhelpcommand)
|
||||
- [.helpCommand()](#helpcommand)
|
||||
- [More configuration](#more-configuration-2)
|
||||
- [Custom event listeners](#custom-event-listeners)
|
||||
- [Bits and pieces](#bits-and-pieces)
|
||||
|
|
@ -48,6 +48,7 @@ Read this in other languages: English | [简体中文](./Readme_zh-CN.md)
|
|||
- [createCommand()](#createcommand)
|
||||
- [Node options such as `--harmony`](#node-options-such-as---harmony)
|
||||
- [Debugging stand-alone executable subcommands](#debugging-stand-alone-executable-subcommands)
|
||||
- [npm run-script](#npm-run-script)
|
||||
- [Display error](#display-error)
|
||||
- [Override exit and output handling](#override-exit-and-output-handling)
|
||||
- [Additional documentation](#additional-documentation)
|
||||
|
|
@ -190,7 +191,7 @@ serve --port=80
|
|||
|
||||
You can use `--` to indicate the end of the options, and any remaining arguments will be used without being interpreted.
|
||||
|
||||
By default options on the command line are not positional, and can be specified before or after other arguments.
|
||||
By default, options on the command line are not positional, and can be specified before or after other arguments.
|
||||
|
||||
There are additional related routines for when `.opts()` is not enough:
|
||||
|
||||
|
|
@ -233,7 +234,7 @@ pizza details:
|
|||
- cheese
|
||||
```
|
||||
|
||||
Multiple boolean short options may be combined together following the dash, and may be followed by a single short option taking a value.
|
||||
Multiple boolean short options may be combined following the dash, and may be followed by a single short option taking a value.
|
||||
For example `-d -s -p cheese` may be written as `-ds -p cheese` or even `-dsp cheese`.
|
||||
|
||||
Options with an expected option-argument are greedy and will consume the following argument whatever the value.
|
||||
|
|
@ -326,7 +327,7 @@ add cheese type mozzarella
|
|||
Options with an optional option-argument are not greedy and will ignore arguments starting with a dash.
|
||||
So `id` behaves as a boolean option for `--id -5`, but you can use a combined form if needed like `--id=-5`.
|
||||
|
||||
For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-taking-varying-arguments.md).
|
||||
For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-in-depth.md).
|
||||
|
||||
### Required option
|
||||
|
||||
|
|
@ -378,7 +379,7 @@ Options: { number: [ '1', '2', '3' ], letter: true }
|
|||
Remaining arguments: [ 'operand' ]
|
||||
```
|
||||
|
||||
For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-taking-varying-arguments.md).
|
||||
For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-in-depth.md).
|
||||
|
||||
### Version option
|
||||
|
||||
|
|
@ -545,6 +546,8 @@ subcommand is specified ([example](./examples/defaultCommand.js)).
|
|||
|
||||
You can add alternative names for a command with `.alias()`. ([example](./examples/alias.js))
|
||||
|
||||
`.command()` automatically copies the inherited settings from the parent command to the newly created subcommand. This is only done during creation, any later setting changes to the parent are not inherited.
|
||||
|
||||
For safety, `.addCommand()` does not automatically copy the inherited settings from the parent command. There is a helper routine `.copyInheritedSettings()` for copying the settings when they are wanted.
|
||||
|
||||
### Command-arguments
|
||||
|
|
@ -675,7 +678,7 @@ async function main() {
|
|||
}
|
||||
```
|
||||
|
||||
A command's options and arguments on the command line are validated when the command is used. Any unknown options or missing arguments will be reported as an error. You can suppress the unknown option checks with `.allowUnknownOption()`. By default it is not an error to
|
||||
A command's options and arguments on the command line are validated when the command is used. Any unknown options or missing arguments will be reported as an error. You can suppress the unknown option checks with `.allowUnknownOption()`. By default, it is not an error to
|
||||
pass more arguments than declared, but you can make this an error with `.allowExcessArguments(false)`.
|
||||
|
||||
### Stand-alone executable (sub)commands
|
||||
|
|
@ -730,6 +733,8 @@ The supported events are:
|
|||
| `preAction`, `postAction` | before/after action handler for this command and its nested subcommands | `(thisCommand, actionCommand)` |
|
||||
| `preSubcommand` | before parsing direct subcommand | `(thisCommand, subcommand)` |
|
||||
|
||||
For an overview of the life cycle events see [parsing life cycle and hooks](./docs/parsing-and-hooks.md).
|
||||
|
||||
## Automated help
|
||||
|
||||
The help information is auto-generated based on the information commander already knows about your program. The default
|
||||
|
|
@ -761,6 +766,8 @@ shell help spawn
|
|||
shell spawn --help
|
||||
```
|
||||
|
||||
Long descriptions are wrapped to fit the available width. (However, a description that includes a line-break followed by whitespace is assumed to be pre-formatted and not wrapped.)
|
||||
|
||||
### Custom help
|
||||
|
||||
You can add extra text to be displayed along with the built-in help.
|
||||
|
|
@ -847,8 +854,8 @@ error: unknown option '--hepl'
|
|||
The command name appears in the help, and is also used for locating stand-alone executable subcommands.
|
||||
|
||||
You may specify the program name using `.name()` or in the Command constructor. For the program, Commander will
|
||||
fallback to using the script name from the full arguments passed into `.parse()`. However, the script name varies
|
||||
depending on how your program is launched so you may wish to specify it explicitly.
|
||||
fall back to using the script name from the full arguments passed into `.parse()`. However, the script name varies
|
||||
depending on how your program is launched, so you may wish to specify it explicitly.
|
||||
|
||||
```js
|
||||
program.name('pizza');
|
||||
|
|
@ -890,23 +897,27 @@ This may require additional disk space.
|
|||
|
||||
### .helpOption(flags, description)
|
||||
|
||||
By default every command has a help option. You may change the default help flags and description. Pass false to disable the built-in help option.
|
||||
By default, every command has a help option. You may change the default help flags and description. Pass false to disable the built-in help option.
|
||||
|
||||
```js
|
||||
program
|
||||
.helpOption('-e, --HELP', 'read more information');
|
||||
```
|
||||
|
||||
### .addHelpCommand()
|
||||
(Or use `.addHelpOption()` to add an option you construct yourself.)
|
||||
|
||||
A help command is added by default if your command has subcommands. You can explicitly turn on or off the implicit help command with `.addHelpCommand()` and `.addHelpCommand(false)`.
|
||||
### .helpCommand()
|
||||
|
||||
A help command is added by default if your command has subcommands. You can explicitly turn on or off the implicit help command with `.helpCommand(true)` and `.helpCommand(false)`.
|
||||
|
||||
You can both turn on and customise the help command by supplying the name and description:
|
||||
|
||||
```js
|
||||
program.addHelpCommand('assist [command]', 'show assistance');
|
||||
program.helpCommand('assist [command]', 'show assistance');
|
||||
```
|
||||
|
||||
(Or use `.addHelpCommand()` to add a command you construct yourself.)
|
||||
|
||||
### More configuration
|
||||
|
||||
The built-in help is formatted using the Help class.
|
||||
|
|
@ -919,7 +930,7 @@ The data properties are:
|
|||
- `sortOptions`: sort the options alphabetically
|
||||
- `showGlobalOptions`: show a section with the global options from the parent command(s)
|
||||
|
||||
There are methods getting the visible lists of arguments, options, and subcommands. There are methods for formatting the items in the lists, with each item having a _term_ and _description_. Take a look at `.formatHelp()` to see how they are used.
|
||||
You can override any method on the [Help](./lib/help.js) class. There are methods getting the visible lists of arguments, options, and subcommands. There are methods for formatting the items in the lists, with each item having a _term_ and _description_. Take a look at `.formatHelp()` to see how they are used.
|
||||
|
||||
Example file: [configure-help.js](./examples/configure-help.js)
|
||||
|
||||
|
|
@ -944,27 +955,31 @@ program.on('option:verbose', function () {
|
|||
|
||||
### .parse() and .parseAsync()
|
||||
|
||||
The first argument to `.parse` is the array of strings to parse. You may omit the parameter to implicitly use `process.argv`.
|
||||
Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
||||
|
||||
If the arguments follow different conventions than node you can pass a `from` option in the second parameter:
|
||||
Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
||||
|
||||
- 'node': default, `argv[0]` is the application and `argv[1]` is the script being run, with user parameters after that
|
||||
- 'electron': `argv[1]` varies depending on whether the electron application is packaged
|
||||
- 'user': all of the arguments from the user
|
||||
- `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
||||
- `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
||||
- `'user'`: just user arguments
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
program.parse(process.argv); // Explicit, node conventions
|
||||
program.parse(); // Implicit, and auto-detect electron
|
||||
program.parse(['-f', 'filename'], { from: 'user' });
|
||||
program.parse(); // parse process.argv and auto-detect electron and special node flags
|
||||
program.parse(process.argv); // assume argv[0] is app and argv[1] is script
|
||||
program.parse(['--port', '80'], { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
||||
```
|
||||
|
||||
Use parseAsync instead of parse if any of your action handlers are async.
|
||||
|
||||
If you want to parse multiple times, create a new program each time. Calling parse does not clear out any previous state.
|
||||
|
||||
### Parsing Configuration
|
||||
|
||||
If the default parsing does not suit your needs, there are some behaviours to support other usage patterns.
|
||||
|
||||
By default program options are recognised before and after subcommands. To only look for program options before subcommands, use `.enablePositionalOptions()`. This lets you use
|
||||
By default, program options are recognised before and after subcommands. To only look for program options before subcommands, use `.enablePositionalOptions()`. This lets you use
|
||||
an option for a different purpose in subcommands.
|
||||
|
||||
Example file: [positional-options.js](./examples/positional-options.js)
|
||||
|
|
@ -976,8 +991,8 @@ program -b subcommand
|
|||
program subcommand -b
|
||||
```
|
||||
|
||||
By default options are recognised before and after command-arguments. To only process options that come
|
||||
before the command-arguments, use `.passThroughOptions()`. This lets you pass the arguments and following options through to another program
|
||||
By default, options are recognised before and after command-arguments. To only process options that come
|
||||
before the command-arguments, use `.passThroughOptions()`. This lets you pass the arguments and following options through to another program
|
||||
without needing to use `--` to end the option processing.
|
||||
To use pass through options in a subcommand, the program needs to enable positional options.
|
||||
|
||||
|
|
@ -990,15 +1005,15 @@ program --port=80 arg
|
|||
program arg --port=80
|
||||
```
|
||||
|
||||
By default the option processing shows an error for an unknown option. To have an unknown option treated as an ordinary command-argument and continue looking for options, use `.allowUnknownOption()`. This lets you mix known and unknown options.
|
||||
By default, the option processing shows an error for an unknown option. To have an unknown option treated as an ordinary command-argument and continue looking for options, use `.allowUnknownOption()`. This lets you mix known and unknown options.
|
||||
|
||||
By default the argument processing does not display an error for more command-arguments than expected.
|
||||
By default, the argument processing does not display an error for more command-arguments than expected.
|
||||
To display an error for excess arguments, use`.allowExcessArguments(false)`.
|
||||
|
||||
### Legacy options as properties
|
||||
|
||||
Before Commander 7, the option values were stored as properties on the command.
|
||||
This was convenient to code but the downside was possible clashes with
|
||||
This was convenient to code, but the downside was possible clashes with
|
||||
existing properties of `Command`. You can revert to the old behaviour to run unmodified legacy code by using `.storeOptionsAsProperties()`.
|
||||
|
||||
```js
|
||||
|
|
@ -1022,7 +1037,7 @@ See [commander-js/extra-typings](https://github.com/commander-js/extra-typings)
|
|||
import { Command } from '@commander-js/extra-typings';
|
||||
```
|
||||
|
||||
ts-node: If you use `ts-node` and stand-alone executable subcommands written as `.ts` files, you need to call your program through node to get the subcommands called correctly. e.g.
|
||||
ts-node: If you use `ts-node` and stand-alone executable subcommands written as `.ts` files, you need to call your program through node to get the subcommands called correctly. e.g.
|
||||
|
||||
```sh
|
||||
node -r ts-node/register pm.ts
|
||||
|
|
@ -1052,11 +1067,22 @@ You can enable `--harmony` option in two ways:
|
|||
|
||||
An executable subcommand is launched as a separate child process.
|
||||
|
||||
If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) executable subcommands using `node --inspect` et al,
|
||||
If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) executable subcommands using `node --inspect` et al.,
|
||||
the inspector port is incremented by 1 for the spawned subcommand.
|
||||
|
||||
If you are using VSCode to debug executable subcommands you need to set the `"autoAttachChildProcesses": true` flag in your launch.json configuration.
|
||||
|
||||
### npm run-script
|
||||
|
||||
By default, when you call your program using run-script, `npm` will parse any options on the command-line and they will not reach your program. Use
|
||||
`--` to stop the npm option parsing and pass through all the arguments.
|
||||
|
||||
The synopsis for [npm run-script](https://docs.npmjs.com/cli/v9/commands/npm-run-script) explicitly shows the `--` for this reason:
|
||||
|
||||
```console
|
||||
npm run-script <command> [-- <args>]
|
||||
```
|
||||
|
||||
### Display error
|
||||
|
||||
This routine is available to invoke the Commander error handling for your own error conditions. (See also the next section about exit handling.)
|
||||
|
|
@ -1071,11 +1097,12 @@ program.error('Custom processing has failed', { exitCode: 2, code: 'my.custom.er
|
|||
|
||||
### Override exit and output handling
|
||||
|
||||
By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override
|
||||
By default, Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override
|
||||
this behaviour and optionally supply a callback. The default override throws a `CommanderError`.
|
||||
|
||||
The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`. The default override behaviour is to throw the error, except for async handling of executable subcommand completion which carries on. The normal display of error messages or version or help
|
||||
is not affected by the override which is called after the display.
|
||||
The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`.
|
||||
Commander expects the callback to terminate the normal program flow, and will call `process.exit` if the callback returns.
|
||||
The normal display of error messages or version or help is not affected by the override which is called after the display.
|
||||
|
||||
```js
|
||||
program.exitOverride();
|
||||
|
|
@ -1087,7 +1114,7 @@ try {
|
|||
}
|
||||
```
|
||||
|
||||
By default Commander is configured for a command-line application and writes to stdout and stderr.
|
||||
By default, Commander is configured for a command-line application and writes to stdout and stderr.
|
||||
You can modify this behaviour for custom applications. In addition, you can modify the display of error messages.
|
||||
|
||||
Example file: [configure-output.js](./examples/configure-output.js)
|
||||
|
|
@ -1113,11 +1140,12 @@ program
|
|||
There is more information available about:
|
||||
|
||||
- [deprecated](./docs/deprecated.md) features still supported for backwards compatibility
|
||||
- [options taking varying arguments](./docs/options-taking-varying-arguments.md)
|
||||
- [options taking varying arguments](./docs/options-in-depth.md)
|
||||
- [parsing life cycle and hooks](./docs/parsing-and-hooks.md)
|
||||
|
||||
## Support
|
||||
|
||||
The current version of Commander is fully supported on Long Term Support versions of Node.js, and requires at least v12.20.0.
|
||||
The current version of Commander is fully supported on Long Term Support versions of Node.js, and requires at least v18.
|
||||
(For older versions of Node.js, use an older version of Commander.)
|
||||
|
||||
The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub.
|
||||
|
|
|
|||
2
@capacitor/cli/node_modules/commander/esm.mjs
generated
vendored
2
@capacitor/cli/node_modules/commander/esm.mjs
generated
vendored
|
|
@ -12,5 +12,5 @@ export const {
|
|||
Command,
|
||||
Argument,
|
||||
Option,
|
||||
Help
|
||||
Help,
|
||||
} = commander;
|
||||
|
|
|
|||
19
@capacitor/cli/node_modules/commander/index.js
generated
vendored
19
@capacitor/cli/node_modules/commander/index.js
generated
vendored
|
|
@ -4,24 +4,21 @@ const { CommanderError, InvalidArgumentError } = require('./lib/error.js');
|
|||
const { Help } = require('./lib/help.js');
|
||||
const { Option } = require('./lib/option.js');
|
||||
|
||||
// @ts-check
|
||||
exports.program = new Command();
|
||||
|
||||
/**
|
||||
* Expose the root command.
|
||||
*/
|
||||
|
||||
exports = module.exports = new Command();
|
||||
exports.program = exports; // More explicit access to global command.
|
||||
// Implicit export of createArgument, createCommand, and createOption.
|
||||
exports.createCommand = (name) => new Command(name);
|
||||
exports.createOption = (flags, description) => new Option(flags, description);
|
||||
exports.createArgument = (name, description) => new Argument(name, description);
|
||||
|
||||
/**
|
||||
* Expose classes
|
||||
*/
|
||||
|
||||
exports.Argument = Argument;
|
||||
exports.Command = Command;
|
||||
exports.CommanderError = CommanderError;
|
||||
exports.Option = Option;
|
||||
exports.Argument = Argument;
|
||||
exports.Help = Help;
|
||||
|
||||
exports.CommanderError = CommanderError;
|
||||
exports.InvalidArgumentError = InvalidArgumentError;
|
||||
exports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated
|
||||
exports.Option = Option;
|
||||
|
|
|
|||
20
@capacitor/cli/node_modules/commander/lib/argument.js
generated
vendored
20
@capacitor/cli/node_modules/commander/lib/argument.js
generated
vendored
|
|
@ -1,7 +1,5 @@
|
|||
const { InvalidArgumentError } = require('./error.js');
|
||||
|
||||
// @ts-check
|
||||
|
||||
class Argument {
|
||||
/**
|
||||
* Initialize a new command argument with the given name and description.
|
||||
|
|
@ -52,7 +50,7 @@ class Argument {
|
|||
}
|
||||
|
||||
/**
|
||||
* @api private
|
||||
* @package
|
||||
*/
|
||||
|
||||
_concatValue(value, previous) {
|
||||
|
|
@ -66,7 +64,7 @@ class Argument {
|
|||
/**
|
||||
* Set the default value, and optionally supply the description to be displayed in the help.
|
||||
*
|
||||
* @param {any} value
|
||||
* @param {*} value
|
||||
* @param {string} [description]
|
||||
* @return {Argument}
|
||||
*/
|
||||
|
|
@ -100,7 +98,9 @@ class Argument {
|
|||
this.argChoices = values.slice();
|
||||
this.parseArg = (arg, previous) => {
|
||||
if (!this.argChoices.includes(arg)) {
|
||||
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(', ')}.`);
|
||||
throw new InvalidArgumentError(
|
||||
`Allowed choices are ${this.argChoices.join(', ')}.`,
|
||||
);
|
||||
}
|
||||
if (this.variadic) {
|
||||
return this._concatValue(arg, previous);
|
||||
|
|
@ -112,6 +112,8 @@ class Argument {
|
|||
|
||||
/**
|
||||
* Make argument required.
|
||||
*
|
||||
* @returns {Argument}
|
||||
*/
|
||||
argRequired() {
|
||||
this.required = true;
|
||||
|
|
@ -120,6 +122,8 @@ class Argument {
|
|||
|
||||
/**
|
||||
* Make argument optional.
|
||||
*
|
||||
* @returns {Argument}
|
||||
*/
|
||||
argOptional() {
|
||||
this.required = false;
|
||||
|
|
@ -132,15 +136,13 @@ class Argument {
|
|||
*
|
||||
* @param {Argument} arg
|
||||
* @return {string}
|
||||
* @api private
|
||||
* @private
|
||||
*/
|
||||
|
||||
function humanReadableArgName(arg) {
|
||||
const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');
|
||||
|
||||
return arg.required
|
||||
? '<' + nameOutput + '>'
|
||||
: '[' + nameOutput + ']';
|
||||
return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';
|
||||
}
|
||||
|
||||
exports.Argument = Argument;
|
||||
|
|
|
|||
1160
@capacitor/cli/node_modules/commander/lib/command.js
generated
vendored
1160
@capacitor/cli/node_modules/commander/lib/command.js
generated
vendored
File diff suppressed because it is too large
Load diff
6
@capacitor/cli/node_modules/commander/lib/error.js
generated
vendored
6
@capacitor/cli/node_modules/commander/lib/error.js
generated
vendored
|
|
@ -1,8 +1,5 @@
|
|||
// @ts-check
|
||||
|
||||
/**
|
||||
* CommanderError class
|
||||
* @class
|
||||
*/
|
||||
class CommanderError extends Error {
|
||||
/**
|
||||
|
|
@ -10,7 +7,6 @@ class CommanderError extends Error {
|
|||
* @param {number} exitCode suggested exit code which could be used with process.exit
|
||||
* @param {string} code an id string representing the error
|
||||
* @param {string} message human-readable description of the error
|
||||
* @constructor
|
||||
*/
|
||||
constructor(exitCode, code, message) {
|
||||
super(message);
|
||||
|
|
@ -25,13 +21,11 @@ class CommanderError extends Error {
|
|||
|
||||
/**
|
||||
* InvalidArgumentError class
|
||||
* @class
|
||||
*/
|
||||
class InvalidArgumentError extends CommanderError {
|
||||
/**
|
||||
* Constructs the InvalidArgumentError class
|
||||
* @param {string} [message] explanation of why argument is invalid
|
||||
* @constructor
|
||||
*/
|
||||
constructor(message) {
|
||||
super(1, 'commander.invalidArgument', message);
|
||||
|
|
|
|||
193
@capacitor/cli/node_modules/commander/lib/help.js
generated
vendored
193
@capacitor/cli/node_modules/commander/lib/help.js
generated
vendored
|
|
@ -8,8 +8,6 @@ const { humanReadableArgName } = require('./argument.js');
|
|||
* @typedef { import("./option.js").Option } Option
|
||||
*/
|
||||
|
||||
// @ts-check
|
||||
|
||||
// Although this is a class, methods are static in style to allow override using subclass or just functions.
|
||||
class Help {
|
||||
constructor() {
|
||||
|
|
@ -27,19 +25,14 @@ class Help {
|
|||
*/
|
||||
|
||||
visibleCommands(cmd) {
|
||||
const visibleCommands = cmd.commands.filter(cmd => !cmd._hidden);
|
||||
if (cmd._hasImplicitHelpCommand()) {
|
||||
// Create a command matching the implicit help command.
|
||||
const [, helpName, helpArgs] = cmd._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);
|
||||
const helpCommand = cmd.createCommand(helpName)
|
||||
.helpOption(false);
|
||||
helpCommand.description(cmd._helpCommandDescription);
|
||||
if (helpArgs) helpCommand.arguments(helpArgs);
|
||||
const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
|
||||
const helpCommand = cmd._getHelpCommand();
|
||||
if (helpCommand && !helpCommand._hidden) {
|
||||
visibleCommands.push(helpCommand);
|
||||
}
|
||||
if (this.sortSubcommands) {
|
||||
visibleCommands.sort((a, b) => {
|
||||
// @ts-ignore: overloaded return type
|
||||
// @ts-ignore: because overloaded return type
|
||||
return a.name().localeCompare(b.name());
|
||||
});
|
||||
}
|
||||
|
|
@ -51,12 +44,14 @@ class Help {
|
|||
*
|
||||
* @param {Option} a
|
||||
* @param {Option} b
|
||||
* @returns number
|
||||
* @returns {number}
|
||||
*/
|
||||
compareOptions(a, b) {
|
||||
const getSortKey = (option) => {
|
||||
// WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.
|
||||
return option.short ? option.short.replace(/^-/, '') : option.long.replace(/^--/, '');
|
||||
return option.short
|
||||
? option.short.replace(/^-/, '')
|
||||
: option.long.replace(/^--/, '');
|
||||
};
|
||||
return getSortKey(a).localeCompare(getSortKey(b));
|
||||
}
|
||||
|
|
@ -70,19 +65,23 @@ class Help {
|
|||
|
||||
visibleOptions(cmd) {
|
||||
const visibleOptions = cmd.options.filter((option) => !option.hidden);
|
||||
// Implicit help
|
||||
const showShortHelpFlag = cmd._hasHelpOption && cmd._helpShortFlag && !cmd._findOption(cmd._helpShortFlag);
|
||||
const showLongHelpFlag = cmd._hasHelpOption && !cmd._findOption(cmd._helpLongFlag);
|
||||
if (showShortHelpFlag || showLongHelpFlag) {
|
||||
let helpOption;
|
||||
if (!showShortHelpFlag) {
|
||||
helpOption = cmd.createOption(cmd._helpLongFlag, cmd._helpDescription);
|
||||
} else if (!showLongHelpFlag) {
|
||||
helpOption = cmd.createOption(cmd._helpShortFlag, cmd._helpDescription);
|
||||
} else {
|
||||
helpOption = cmd.createOption(cmd._helpFlags, cmd._helpDescription);
|
||||
// Built-in help option.
|
||||
const helpOption = cmd._getHelpOption();
|
||||
if (helpOption && !helpOption.hidden) {
|
||||
// Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.
|
||||
const removeShort = helpOption.short && cmd._findOption(helpOption.short);
|
||||
const removeLong = helpOption.long && cmd._findOption(helpOption.long);
|
||||
if (!removeShort && !removeLong) {
|
||||
visibleOptions.push(helpOption); // no changes needed
|
||||
} else if (helpOption.long && !removeLong) {
|
||||
visibleOptions.push(
|
||||
cmd.createOption(helpOption.long, helpOption.description),
|
||||
);
|
||||
} else if (helpOption.short && !removeShort) {
|
||||
visibleOptions.push(
|
||||
cmd.createOption(helpOption.short, helpOption.description),
|
||||
);
|
||||
}
|
||||
visibleOptions.push(helpOption);
|
||||
}
|
||||
if (this.sortOptions) {
|
||||
visibleOptions.sort(this.compareOptions);
|
||||
|
|
@ -101,8 +100,14 @@ class Help {
|
|||
if (!this.showGlobalOptions) return [];
|
||||
|
||||
const globalOptions = [];
|
||||
for (let parentCmd = cmd.parent; parentCmd; parentCmd = parentCmd.parent) {
|
||||
const visibleOptions = parentCmd.options.filter((option) => !option.hidden);
|
||||
for (
|
||||
let ancestorCmd = cmd.parent;
|
||||
ancestorCmd;
|
||||
ancestorCmd = ancestorCmd.parent
|
||||
) {
|
||||
const visibleOptions = ancestorCmd.options.filter(
|
||||
(option) => !option.hidden,
|
||||
);
|
||||
globalOptions.push(...visibleOptions);
|
||||
}
|
||||
if (this.sortOptions) {
|
||||
|
|
@ -121,14 +126,15 @@ class Help {
|
|||
visibleArguments(cmd) {
|
||||
// Side effect! Apply the legacy descriptions before the arguments are displayed.
|
||||
if (cmd._argsDescription) {
|
||||
cmd._args.forEach(argument => {
|
||||
argument.description = argument.description || cmd._argsDescription[argument.name()] || '';
|
||||
cmd.registeredArguments.forEach((argument) => {
|
||||
argument.description =
|
||||
argument.description || cmd._argsDescription[argument.name()] || '';
|
||||
});
|
||||
}
|
||||
|
||||
// If there are any arguments with a description then return all the arguments.
|
||||
if (cmd._args.find(argument => argument.description)) {
|
||||
return cmd._args;
|
||||
if (cmd.registeredArguments.find((argument) => argument.description)) {
|
||||
return cmd.registeredArguments;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
|
@ -142,11 +148,15 @@ class Help {
|
|||
|
||||
subcommandTerm(cmd) {
|
||||
// Legacy. Ignores custom usage string, and nested commands.
|
||||
const args = cmd._args.map(arg => humanReadableArgName(arg)).join(' ');
|
||||
return cmd._name +
|
||||
const args = cmd.registeredArguments
|
||||
.map((arg) => humanReadableArgName(arg))
|
||||
.join(' ');
|
||||
return (
|
||||
cmd._name +
|
||||
(cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +
|
||||
(cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option
|
||||
(args ? ' ' + args : '');
|
||||
(args ? ' ' + args : '')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -240,11 +250,15 @@ class Help {
|
|||
if (cmd._aliases[0]) {
|
||||
cmdName = cmdName + '|' + cmd._aliases[0];
|
||||
}
|
||||
let parentCmdNames = '';
|
||||
for (let parentCmd = cmd.parent; parentCmd; parentCmd = parentCmd.parent) {
|
||||
parentCmdNames = parentCmd.name() + ' ' + parentCmdNames;
|
||||
let ancestorCmdNames = '';
|
||||
for (
|
||||
let ancestorCmd = cmd.parent;
|
||||
ancestorCmd;
|
||||
ancestorCmd = ancestorCmd.parent
|
||||
) {
|
||||
ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;
|
||||
}
|
||||
return parentCmdNames + cmdName + ' ' + cmd.usage();
|
||||
return ancestorCmdNames + cmdName + ' ' + cmd.usage();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -255,7 +269,7 @@ class Help {
|
|||
*/
|
||||
|
||||
commandDescription(cmd) {
|
||||
// @ts-ignore: overloaded return type
|
||||
// @ts-ignore: because overloaded return type
|
||||
return cmd.description();
|
||||
}
|
||||
|
||||
|
|
@ -268,7 +282,7 @@ class Help {
|
|||
*/
|
||||
|
||||
subcommandDescription(cmd) {
|
||||
// @ts-ignore: overloaded return type
|
||||
// @ts-ignore: because overloaded return type
|
||||
return cmd.summary() || cmd.description();
|
||||
}
|
||||
|
||||
|
|
@ -285,15 +299,20 @@ class Help {
|
|||
if (option.argChoices) {
|
||||
extraInfo.push(
|
||||
// use stringify to match the display of the default value
|
||||
`choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);
|
||||
`choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,
|
||||
);
|
||||
}
|
||||
if (option.defaultValue !== undefined) {
|
||||
// default for boolean and negated more for programmer than end user,
|
||||
// but show true/false for boolean option as may be for hand-rolled env or config processing.
|
||||
const showDefault = option.required || option.optional ||
|
||||
const showDefault =
|
||||
option.required ||
|
||||
option.optional ||
|
||||
(option.isBoolean() && typeof option.defaultValue === 'boolean');
|
||||
if (showDefault) {
|
||||
extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`);
|
||||
extraInfo.push(
|
||||
`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
// preset for boolean and negated are more for programmer than end user
|
||||
|
|
@ -322,10 +341,13 @@ class Help {
|
|||
if (argument.argChoices) {
|
||||
extraInfo.push(
|
||||
// use stringify to match the display of the default value
|
||||
`choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);
|
||||
`choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,
|
||||
);
|
||||
}
|
||||
if (argument.defaultValue !== undefined) {
|
||||
extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`);
|
||||
extraInfo.push(
|
||||
`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,
|
||||
);
|
||||
}
|
||||
if (extraInfo.length > 0) {
|
||||
const extraDescripton = `(${extraInfo.join(', ')})`;
|
||||
|
|
@ -353,7 +375,11 @@ class Help {
|
|||
function formatItem(term, description) {
|
||||
if (description) {
|
||||
const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;
|
||||
return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);
|
||||
return helper.wrap(
|
||||
fullText,
|
||||
helpWidth - itemIndentWidth,
|
||||
termWidth + itemSeparatorWidth,
|
||||
);
|
||||
}
|
||||
return term;
|
||||
}
|
||||
|
|
@ -367,12 +393,18 @@ class Help {
|
|||
// Description
|
||||
const commandDescription = helper.commandDescription(cmd);
|
||||
if (commandDescription.length > 0) {
|
||||
output = output.concat([commandDescription, '']);
|
||||
output = output.concat([
|
||||
helper.wrap(commandDescription, helpWidth, 0),
|
||||
'',
|
||||
]);
|
||||
}
|
||||
|
||||
// Arguments
|
||||
const argumentList = helper.visibleArguments(cmd).map((argument) => {
|
||||
return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));
|
||||
return formatItem(
|
||||
helper.argumentTerm(argument),
|
||||
helper.argumentDescription(argument),
|
||||
);
|
||||
});
|
||||
if (argumentList.length > 0) {
|
||||
output = output.concat(['Arguments:', formatList(argumentList), '']);
|
||||
|
|
@ -380,24 +412,39 @@ class Help {
|
|||
|
||||
// Options
|
||||
const optionList = helper.visibleOptions(cmd).map((option) => {
|
||||
return formatItem(helper.optionTerm(option), helper.optionDescription(option));
|
||||
return formatItem(
|
||||
helper.optionTerm(option),
|
||||
helper.optionDescription(option),
|
||||
);
|
||||
});
|
||||
if (optionList.length > 0) {
|
||||
output = output.concat(['Options:', formatList(optionList), '']);
|
||||
}
|
||||
|
||||
if (this.showGlobalOptions) {
|
||||
const globalOptionList = helper.visibleGlobalOptions(cmd).map((option) => {
|
||||
return formatItem(helper.optionTerm(option), helper.optionDescription(option));
|
||||
});
|
||||
const globalOptionList = helper
|
||||
.visibleGlobalOptions(cmd)
|
||||
.map((option) => {
|
||||
return formatItem(
|
||||
helper.optionTerm(option),
|
||||
helper.optionDescription(option),
|
||||
);
|
||||
});
|
||||
if (globalOptionList.length > 0) {
|
||||
output = output.concat(['Global Options:', formatList(globalOptionList), '']);
|
||||
output = output.concat([
|
||||
'Global Options:',
|
||||
formatList(globalOptionList),
|
||||
'',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// Commands
|
||||
const commandList = helper.visibleCommands(cmd).map((cmd) => {
|
||||
return formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd));
|
||||
return formatItem(
|
||||
helper.subcommandTerm(cmd),
|
||||
helper.subcommandDescription(cmd),
|
||||
);
|
||||
});
|
||||
if (commandList.length > 0) {
|
||||
output = output.concat(['Commands:', formatList(commandList), '']);
|
||||
|
|
@ -419,7 +466,7 @@ class Help {
|
|||
helper.longestOptionTermLength(cmd, helper),
|
||||
helper.longestGlobalOptionTermLength(cmd, helper),
|
||||
helper.longestSubcommandTermLength(cmd, helper),
|
||||
helper.longestArgumentTermLength(cmd, helper)
|
||||
helper.longestArgumentTermLength(cmd, helper),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -436,25 +483,37 @@ class Help {
|
|||
*/
|
||||
|
||||
wrap(str, width, indent, minColumnWidth = 40) {
|
||||
// Detect manually wrapped and indented strings by searching for line breaks
|
||||
// followed by multiple spaces/tabs.
|
||||
if (str.match(/[\n]\s+/)) return str;
|
||||
// Full \s characters, minus the linefeeds.
|
||||
const indents =
|
||||
' \\f\\t\\v\u00a0\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff';
|
||||
// Detect manually wrapped and indented strings by searching for line break followed by spaces.
|
||||
const manualIndent = new RegExp(`[\\n][${indents}]+`);
|
||||
if (str.match(manualIndent)) return str;
|
||||
// Do not wrap if not enough room for a wrapped column of text (as could end up with a word per line).
|
||||
const columnWidth = width - indent;
|
||||
if (columnWidth < minColumnWidth) return str;
|
||||
|
||||
const leadingStr = str.slice(0, indent);
|
||||
const columnText = str.slice(indent);
|
||||
|
||||
const columnText = str.slice(indent).replace('\r\n', '\n');
|
||||
const indentString = ' '.repeat(indent);
|
||||
const regex = new RegExp('.{1,' + (columnWidth - 1) + '}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)', 'g');
|
||||
const zeroWidthSpace = '\u200B';
|
||||
const breaks = `\\s${zeroWidthSpace}`;
|
||||
// Match line end (so empty lines don't collapse),
|
||||
// or as much text as will fit in column, or excess text up to first break.
|
||||
const regex = new RegExp(
|
||||
`\n|.{1,${columnWidth - 1}}([${breaks}]|$)|[^${breaks}]+?([${breaks}]|$)`,
|
||||
'g',
|
||||
);
|
||||
const lines = columnText.match(regex) || [];
|
||||
return leadingStr + lines.map((line, i) => {
|
||||
if (line.slice(-1) === '\n') {
|
||||
line = line.slice(0, line.length - 1);
|
||||
}
|
||||
return ((i > 0) ? indentString : '') + line.trimRight();
|
||||
}).join('\n');
|
||||
return (
|
||||
leadingStr +
|
||||
lines
|
||||
.map((line, i) => {
|
||||
if (line === '\n') return ''; // preserve empty lines
|
||||
return (i > 0 ? indentString : '') + line.trimEnd();
|
||||
})
|
||||
.join('\n')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
42
@capacitor/cli/node_modules/commander/lib/option.js
generated
vendored
42
@capacitor/cli/node_modules/commander/lib/option.js
generated
vendored
|
|
@ -1,7 +1,5 @@
|
|||
const { InvalidArgumentError } = require('./error.js');
|
||||
|
||||
// @ts-check
|
||||
|
||||
class Option {
|
||||
/**
|
||||
* Initialize a new `Option` with the given `flags` and `description`.
|
||||
|
|
@ -40,7 +38,7 @@ class Option {
|
|||
/**
|
||||
* Set the default value, and optionally supply the description to be displayed in the help.
|
||||
*
|
||||
* @param {any} value
|
||||
* @param {*} value
|
||||
* @param {string} [description]
|
||||
* @return {Option}
|
||||
*/
|
||||
|
|
@ -59,7 +57,7 @@ class Option {
|
|||
* new Option('--color').default('GREYSCALE').preset('RGB');
|
||||
* new Option('--donate [amount]').preset('20').argParser(parseFloat);
|
||||
*
|
||||
* @param {any} arg
|
||||
* @param {*} arg
|
||||
* @return {Option}
|
||||
*/
|
||||
|
||||
|
|
@ -76,7 +74,7 @@ class Option {
|
|||
* new Option('--rgb').conflicts('cmyk');
|
||||
* new Option('--js').conflicts(['ts', 'jsx']);
|
||||
*
|
||||
* @param {string | string[]} names
|
||||
* @param {(string | string[])} names
|
||||
* @return {Option}
|
||||
*/
|
||||
|
||||
|
|
@ -95,11 +93,16 @@ class Option {
|
|||
* .addOption(new Option('--log', 'write logging information to file'))
|
||||
* .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
|
||||
*
|
||||
* @param {Object} impliedOptionValues
|
||||
* @param {object} impliedOptionValues
|
||||
* @return {Option}
|
||||
*/
|
||||
implies(impliedOptionValues) {
|
||||
this.implied = Object.assign(this.implied || {}, impliedOptionValues);
|
||||
let newImplied = impliedOptionValues;
|
||||
if (typeof impliedOptionValues === 'string') {
|
||||
// string is not documented, but easy mistake and we can do what user probably intended.
|
||||
newImplied = { [impliedOptionValues]: true };
|
||||
}
|
||||
this.implied = Object.assign(this.implied || {}, newImplied);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +158,7 @@ class Option {
|
|||
}
|
||||
|
||||
/**
|
||||
* @api private
|
||||
* @package
|
||||
*/
|
||||
|
||||
_concatValue(value, previous) {
|
||||
|
|
@ -177,7 +180,9 @@ class Option {
|
|||
this.argChoices = values.slice();
|
||||
this.parseArg = (arg, previous) => {
|
||||
if (!this.argChoices.includes(arg)) {
|
||||
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(', ')}.`);
|
||||
throw new InvalidArgumentError(
|
||||
`Allowed choices are ${this.argChoices.join(', ')}.`,
|
||||
);
|
||||
}
|
||||
if (this.variadic) {
|
||||
return this._concatValue(arg, previous);
|
||||
|
|
@ -205,7 +210,6 @@ class Option {
|
|||
* as a object attribute key.
|
||||
*
|
||||
* @return {string}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
attributeName() {
|
||||
|
|
@ -217,7 +221,7 @@ class Option {
|
|||
*
|
||||
* @param {string} arg
|
||||
* @return {boolean}
|
||||
* @api private
|
||||
* @package
|
||||
*/
|
||||
|
||||
is(arg) {
|
||||
|
|
@ -230,7 +234,7 @@ class Option {
|
|||
* Options are one of boolean, negated, required argument, or optional argument.
|
||||
*
|
||||
* @return {boolean}
|
||||
* @api private
|
||||
* @package
|
||||
*/
|
||||
|
||||
isBoolean() {
|
||||
|
|
@ -253,7 +257,7 @@ class DualOptions {
|
|||
this.positiveOptions = new Map();
|
||||
this.negativeOptions = new Map();
|
||||
this.dualOptions = new Set();
|
||||
options.forEach(option => {
|
||||
options.forEach((option) => {
|
||||
if (option.negate) {
|
||||
this.negativeOptions.set(option.attributeName(), option);
|
||||
} else {
|
||||
|
|
@ -270,7 +274,7 @@ class DualOptions {
|
|||
/**
|
||||
* Did the value come from the option, and not from possible matching dual option?
|
||||
*
|
||||
* @param {any} value
|
||||
* @param {*} value
|
||||
* @param {Option} option
|
||||
* @returns {boolean}
|
||||
*/
|
||||
|
|
@ -280,7 +284,7 @@ class DualOptions {
|
|||
|
||||
// Use the value to deduce if (probably) came from the option.
|
||||
const preset = this.negativeOptions.get(optionKey).presetArg;
|
||||
const negativeValue = (preset !== undefined) ? preset : false;
|
||||
const negativeValue = preset !== undefined ? preset : false;
|
||||
return option.negate === (negativeValue === value);
|
||||
}
|
||||
}
|
||||
|
|
@ -290,7 +294,7 @@ class DualOptions {
|
|||
*
|
||||
* @param {string} str
|
||||
* @return {string}
|
||||
* @api private
|
||||
* @private
|
||||
*/
|
||||
|
||||
function camelcase(str) {
|
||||
|
|
@ -302,7 +306,7 @@ function camelcase(str) {
|
|||
/**
|
||||
* Split the short and long flag out of something like '-m,--mixed <value>'
|
||||
*
|
||||
* @api private
|
||||
* @private
|
||||
*/
|
||||
|
||||
function splitOptionFlags(flags) {
|
||||
|
|
@ -311,7 +315,8 @@ function splitOptionFlags(flags) {
|
|||
// Use original very loose parsing to maintain backwards compatibility for now,
|
||||
// which allowed for example unintended `-sw, --short-word` [sic].
|
||||
const flagParts = flags.split(/[ |,]+/);
|
||||
if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift();
|
||||
if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1]))
|
||||
shortFlag = flagParts.shift();
|
||||
longFlag = flagParts.shift();
|
||||
// Add support for lone short flag without significantly changing parsing!
|
||||
if (!shortFlag && /^-[^-]$/.test(longFlag)) {
|
||||
|
|
@ -322,5 +327,4 @@ function splitOptionFlags(flags) {
|
|||
}
|
||||
|
||||
exports.Option = Option;
|
||||
exports.splitOptionFlags = splitOptionFlags;
|
||||
exports.DualOptions = DualOptions;
|
||||
|
|
|
|||
9
@capacitor/cli/node_modules/commander/lib/suggestSimilar.js
generated
vendored
9
@capacitor/cli/node_modules/commander/lib/suggestSimilar.js
generated
vendored
|
|
@ -6,7 +6,8 @@ function editDistance(a, b) {
|
|||
// (Simple implementation.)
|
||||
|
||||
// Quick early exit, return worst case.
|
||||
if (Math.abs(a.length - b.length) > maxDistance) return Math.max(a.length, b.length);
|
||||
if (Math.abs(a.length - b.length) > maxDistance)
|
||||
return Math.max(a.length, b.length);
|
||||
|
||||
// distance between prefix substrings of a and b
|
||||
const d = [];
|
||||
|
|
@ -32,7 +33,7 @@ function editDistance(a, b) {
|
|||
d[i][j] = Math.min(
|
||||
d[i - 1][j] + 1, // deletion
|
||||
d[i][j - 1] + 1, // insertion
|
||||
d[i - 1][j - 1] + cost // substitution
|
||||
d[i - 1][j - 1] + cost, // substitution
|
||||
);
|
||||
// transposition
|
||||
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
|
||||
|
|
@ -60,7 +61,7 @@ function suggestSimilar(word, candidates) {
|
|||
const searchingOptions = word.startsWith('--');
|
||||
if (searchingOptions) {
|
||||
word = word.slice(2);
|
||||
candidates = candidates.map(candidate => candidate.slice(2));
|
||||
candidates = candidates.map((candidate) => candidate.slice(2));
|
||||
}
|
||||
|
||||
let similar = [];
|
||||
|
|
@ -85,7 +86,7 @@ function suggestSimilar(word, candidates) {
|
|||
|
||||
similar.sort((a, b) => a.localeCompare(b));
|
||||
if (searchingOptions) {
|
||||
similar = similar.map(candidate => `--${candidate}`);
|
||||
similar = similar.map((candidate) => `--${candidate}`);
|
||||
}
|
||||
|
||||
if (similar.length > 1) {
|
||||
|
|
|
|||
84
@capacitor/cli/node_modules/commander/package.json
generated
vendored
84
@capacitor/cli/node_modules/commander/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "commander",
|
||||
"version": "9.5.0",
|
||||
"version": "12.1.0",
|
||||
"description": "the complete solution for node.js command-line programs",
|
||||
"keywords": [
|
||||
"commander",
|
||||
|
|
@ -16,65 +16,69 @@
|
|||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/tj/commander.js.git"
|
||||
"url": "git+https://github.com/tj/commander.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "npm run lint:javascript && npm run lint:typescript",
|
||||
"lint:javascript": "eslint index.js esm.mjs \"lib/*.js\" \"tests/**/*.js\"",
|
||||
"lint:typescript": "eslint typings/*.ts tests/*.ts",
|
||||
"test": "jest && npm run test-typings",
|
||||
"test-esm": "node --experimental-modules ./tests/esm-imports-test.mjs",
|
||||
"test-typings": "tsd",
|
||||
"typescript-checkJS": "tsc --allowJS --checkJS index.js lib/*.js --noEmit",
|
||||
"test-all": "npm run test && npm run lint && npm run typescript-checkJS && npm run test-esm"
|
||||
"check": "npm run check:type && npm run check:lint && npm run check:format",
|
||||
"check:format": "prettier --check .",
|
||||
"check:lint": "eslint .",
|
||||
"check:type": "npm run check:type:js && npm run check:type:ts",
|
||||
"check:type:ts": "tsd && tsc -p tsconfig.ts.json",
|
||||
"check:type:js": "tsc -p tsconfig.js.json",
|
||||
"fix": "npm run fix:lint && npm run fix:format",
|
||||
"fix:format": "prettier --write .",
|
||||
"fix:lint": "eslint --fix .",
|
||||
"test": "jest && npm run check:type:ts",
|
||||
"test-all": "jest && npm run test-esm && npm run check",
|
||||
"test-esm": "node ./tests/esm-imports-test.mjs"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib/*.js",
|
||||
"esm.mjs",
|
||||
"typings/index.d.ts",
|
||||
"typings/esm.d.mts",
|
||||
"package-support.json"
|
||||
],
|
||||
"type": "commonjs",
|
||||
"main": "./index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./typings/index.d.ts",
|
||||
"require": "./index.js",
|
||||
"import": "./esm.mjs"
|
||||
"require": {
|
||||
"types": "./typings/index.d.ts",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./typings/esm.d.mts",
|
||||
"default": "./esm.mjs"
|
||||
},
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./esm.mjs": "./esm.mjs"
|
||||
"./esm.mjs": {
|
||||
"types": "./typings/esm.d.mts",
|
||||
"import": "./esm.mjs"
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^28.1.4",
|
||||
"@types/node": "^16.11.15",
|
||||
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
||||
"@typescript-eslint/parser": "^5.30.6",
|
||||
"eslint": "^8.19.0",
|
||||
"eslint-config-standard": "^17.0.0",
|
||||
"eslint-config-standard-with-typescript": "^22.0.0",
|
||||
"eslint-plugin-import": "^2.25.3",
|
||||
"eslint-plugin-jest": "^26.5.3",
|
||||
"eslint-plugin-n": "^15.2.4",
|
||||
"eslint-plugin-promise": "^6.0.0",
|
||||
"jest": "^28.1.2",
|
||||
"ts-jest": "^28.0.5",
|
||||
"tsd": "^0.22.0",
|
||||
"typescript": "^4.7.4"
|
||||
"@eslint/js": "^8.56.0",
|
||||
"@types/jest": "^29.2.4",
|
||||
"@types/node": "^20.2.5",
|
||||
"eslint": "^8.30.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-jest": "^28.3.0",
|
||||
"eslint-plugin-jsdoc": "^48.1.0",
|
||||
"globals": "^13.24.0",
|
||||
"jest": "^29.3.1",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier-plugin-jsdoc": "^1.3.0",
|
||||
"ts-jest": "^29.0.3",
|
||||
"tsd": "^0.31.0",
|
||||
"typescript": "^5.0.4",
|
||||
"typescript-eslint": "^7.0.1"
|
||||
},
|
||||
"types": "typings/index.d.ts",
|
||||
"jest": {
|
||||
"testEnvironment": "node",
|
||||
"collectCoverage": true,
|
||||
"transform": {
|
||||
"^.+\\.tsx?$": "ts-jest"
|
||||
},
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20.0 || >=14"
|
||||
"node": ">=18"
|
||||
},
|
||||
"support": true
|
||||
}
|
||||
|
|
|
|||
3
@capacitor/cli/node_modules/commander/typings/esm.d.mts
generated
vendored
Normal file
3
@capacitor/cli/node_modules/commander/typings/esm.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
// Just reexport the types from cjs
|
||||
// This is a bit indirect. There is not an index.js, but TypeScript will look for index.d.ts for types.
|
||||
export * from './index.js';
|
||||
254
@capacitor/cli/node_modules/commander/typings/index.d.ts
generated
vendored
254
@capacitor/cli/node_modules/commander/typings/index.d.ts
generated
vendored
|
|
@ -5,6 +5,16 @@
|
|||
/* eslint-disable @typescript-eslint/method-signature-style */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
// This is a trick to encourage editor to suggest the known literals while still
|
||||
// allowing any BaseType value.
|
||||
// References:
|
||||
// - https://github.com/microsoft/TypeScript/issues/29729
|
||||
// - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts
|
||||
// - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts
|
||||
type LiteralUnion<LiteralType, BaseType extends string | number> =
|
||||
| LiteralType
|
||||
| (BaseType & Record<never, never>);
|
||||
|
||||
export class CommanderError extends Error {
|
||||
code: string;
|
||||
exitCode: number;
|
||||
|
|
@ -16,7 +26,6 @@ export class CommanderError extends Error {
|
|||
* @param exitCode - suggested exit code which could be used with process.exit
|
||||
* @param code - an id string representing the error
|
||||
* @param message - human-readable description of the error
|
||||
* @constructor
|
||||
*/
|
||||
constructor(exitCode: number, code: string, message: string);
|
||||
}
|
||||
|
|
@ -25,13 +34,13 @@ export class InvalidArgumentError extends CommanderError {
|
|||
/**
|
||||
* Constructs the InvalidArgumentError class
|
||||
* @param message - explanation of why argument is invalid
|
||||
* @constructor
|
||||
*/
|
||||
constructor(message: string);
|
||||
}
|
||||
export { InvalidArgumentError as InvalidOptionArgumentError }; // deprecated old name
|
||||
|
||||
export interface ErrorOptions { // optional parameter for error()
|
||||
export interface ErrorOptions {
|
||||
// optional parameter for error()
|
||||
/** an id string representing the error */
|
||||
code?: string;
|
||||
/** suggested exit code which could be used with process.exit */
|
||||
|
|
@ -42,6 +51,9 @@ export class Argument {
|
|||
description: string;
|
||||
required: boolean;
|
||||
variadic: boolean;
|
||||
defaultValue?: any;
|
||||
defaultValueDescription?: string;
|
||||
argChoices?: string[];
|
||||
|
||||
/**
|
||||
* Initialize a new command argument with the given name and description.
|
||||
|
|
@ -89,12 +101,13 @@ export class Option {
|
|||
optional: boolean; // A value is optional when the option is specified.
|
||||
variadic: boolean;
|
||||
mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.
|
||||
optionFlags: string;
|
||||
short?: string;
|
||||
long?: string;
|
||||
negate: boolean;
|
||||
defaultValue?: any;
|
||||
defaultValueDescription?: string;
|
||||
presetArg?: unknown;
|
||||
envVar?: string;
|
||||
parseArg?: <T>(value: string, previous: T) => T;
|
||||
hidden: boolean;
|
||||
argChoices?: string[];
|
||||
|
|
@ -150,11 +163,6 @@ export class Option {
|
|||
*/
|
||||
env(name: string): this;
|
||||
|
||||
/**
|
||||
* Calculate the full description, including defaultValue etc.
|
||||
*/
|
||||
fullDescription(): string;
|
||||
|
||||
/**
|
||||
* Set the custom handler for processing CLI option arguments into option values.
|
||||
*/
|
||||
|
|
@ -245,7 +253,12 @@ export class Help {
|
|||
* Wrap the given string to width characters per line, with lines after the first indented.
|
||||
* Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.
|
||||
*/
|
||||
wrap(str: string, width: number, indent: number, minColumnWidth?: number): string;
|
||||
wrap(
|
||||
str: string,
|
||||
width: number,
|
||||
indent: number,
|
||||
minColumnWidth?: number,
|
||||
): string;
|
||||
|
||||
/** Generate the built-in help text. */
|
||||
formatHelp(cmd: Command, helper: Help): string;
|
||||
|
|
@ -255,10 +268,12 @@ export type HelpConfiguration = Partial<Help>;
|
|||
export interface ParseOptions {
|
||||
from: 'node' | 'electron' | 'user';
|
||||
}
|
||||
export interface HelpContext { // optional parameter for .help() and .outputHelp()
|
||||
export interface HelpContext {
|
||||
// optional parameter for .help() and .outputHelp()
|
||||
error: boolean;
|
||||
}
|
||||
export interface AddHelpTextContext { // passed to text function used with .addHelpText()
|
||||
export interface AddHelpTextContext {
|
||||
// passed to text function used with .addHelpText()
|
||||
error: boolean;
|
||||
command: Command;
|
||||
}
|
||||
|
|
@ -268,21 +283,23 @@ export interface OutputConfiguration {
|
|||
getOutHelpWidth?(): number;
|
||||
getErrHelpWidth?(): number;
|
||||
outputError?(str: string, write: (str: string) => void): void;
|
||||
|
||||
}
|
||||
|
||||
export type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
|
||||
export type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
|
||||
export type OptionValueSource = 'default' | 'config' | 'env' | 'cli' | 'implied';
|
||||
// The source is a string so author can define their own too.
|
||||
export type OptionValueSource =
|
||||
| LiteralUnion<'default' | 'config' | 'env' | 'cli' | 'implied', string>
|
||||
| undefined;
|
||||
|
||||
export interface OptionValues {
|
||||
[key: string]: any;
|
||||
}
|
||||
export type OptionValues = Record<string, any>;
|
||||
|
||||
export class Command {
|
||||
args: string[];
|
||||
processedArgs: any[];
|
||||
commands: Command[];
|
||||
readonly commands: readonly Command[];
|
||||
readonly options: readonly Option[];
|
||||
readonly registeredArguments: readonly Argument[];
|
||||
parent: Command | null;
|
||||
|
||||
constructor(name?: string);
|
||||
|
|
@ -296,6 +313,10 @@ export class Command {
|
|||
* You can optionally supply the flags and description to override the defaults.
|
||||
*/
|
||||
version(str: string, flags?: string, description?: string): this;
|
||||
/**
|
||||
* Get the program version.
|
||||
*/
|
||||
version(): string | undefined;
|
||||
|
||||
/**
|
||||
* Define a command, implemented using an action handler.
|
||||
|
|
@ -317,7 +338,10 @@ export class Command {
|
|||
* @param opts - configuration options
|
||||
* @returns new command
|
||||
*/
|
||||
command(nameAndArgs: string, opts?: CommandOptions): ReturnType<this['createCommand']>;
|
||||
command(
|
||||
nameAndArgs: string,
|
||||
opts?: CommandOptions,
|
||||
): ReturnType<this['createCommand']>;
|
||||
/**
|
||||
* Define a command, implemented in a separate executable file.
|
||||
*
|
||||
|
|
@ -336,7 +360,11 @@ export class Command {
|
|||
* @param opts - configuration options
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
command(nameAndArgs: string, description: string, opts?: ExecutableCommandOptions): this;
|
||||
command(
|
||||
nameAndArgs: string,
|
||||
description: string,
|
||||
opts?: ExecutableCommandOptions,
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Factory routine to create a new unattached command.
|
||||
|
|
@ -377,7 +405,12 @@ export class Command {
|
|||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
argument<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
|
||||
argument<T>(
|
||||
flags: string,
|
||||
description: string,
|
||||
fn: (value: string, previous: T) => T,
|
||||
defaultValue?: T,
|
||||
): this;
|
||||
argument(name: string, description?: string, defaultValue?: unknown): this;
|
||||
|
||||
/**
|
||||
|
|
@ -402,23 +435,38 @@ export class Command {
|
|||
arguments(names: string): this;
|
||||
|
||||
/**
|
||||
* Override default decision whether to add implicit help command.
|
||||
* Customise or override default help command. By default a help command is automatically added if your command has subcommands.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* program.helpCommand('help [cmd]');
|
||||
* program.helpCommand('help [cmd]', 'show help');
|
||||
* program.helpCommand(false); // suppress default help command
|
||||
* program.helpCommand(true); // add help command even if no subcommands
|
||||
* ```
|
||||
* addHelpCommand() // force on
|
||||
* addHelpCommand(false); // force off
|
||||
* addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
addHelpCommand(enableOrNameAndArgs?: string | boolean, description?: string): this;
|
||||
helpCommand(nameAndArgs: string, description?: string): this;
|
||||
helpCommand(enable: boolean): this;
|
||||
|
||||
/**
|
||||
* Add prepared custom help command.
|
||||
*/
|
||||
addHelpCommand(cmd: Command): this;
|
||||
/** @deprecated since v12, instead use helpCommand */
|
||||
addHelpCommand(nameAndArgs: string, description?: string): this;
|
||||
/** @deprecated since v12, instead use helpCommand */
|
||||
addHelpCommand(enable?: boolean): this;
|
||||
|
||||
/**
|
||||
* Add hook for life cycle event.
|
||||
*/
|
||||
hook(event: HookEvent, listener: (thisCommand: Command, actionCommand: Command) => void | Promise<void>): this;
|
||||
hook(
|
||||
event: HookEvent,
|
||||
listener: (
|
||||
thisCommand: Command,
|
||||
actionCommand: Command,
|
||||
) => void | Promise<void>,
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Register callback to use as replacement for calling process.exit.
|
||||
|
|
@ -499,53 +547,43 @@ export class Command {
|
|||
action(fn: (...args: any[]) => void | Promise<void>): this;
|
||||
|
||||
/**
|
||||
* Define option with `flags`, `description` and optional
|
||||
* coercion `fn`.
|
||||
* Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
|
||||
*
|
||||
* The `flags` string contains the short and/or long flags,
|
||||
* separated by comma, a pipe or space. The following are all valid
|
||||
* all will output this way when `--help` is used.
|
||||
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
|
||||
* option-argument is indicated by `<>` and an optional option-argument by `[]`.
|
||||
*
|
||||
* "-p, --pepper"
|
||||
* "-p|--pepper"
|
||||
* "-p --pepper"
|
||||
* See the README for more details, and see also addOption() and requiredOption().
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* // simple boolean defaulting to false
|
||||
* program.option('-p, --pepper', 'add pepper');
|
||||
*
|
||||
* --pepper
|
||||
* program.pepper
|
||||
* // => Boolean
|
||||
*
|
||||
* // simple boolean defaulting to true
|
||||
* program.option('-C, --no-cheese', 'remove cheese');
|
||||
*
|
||||
* program.cheese
|
||||
* // => true
|
||||
*
|
||||
* --no-cheese
|
||||
* program.cheese
|
||||
* // => false
|
||||
*
|
||||
* // required argument
|
||||
* program.option('-C, --chdir <path>', 'change the working directory');
|
||||
*
|
||||
* --chdir /tmp
|
||||
* program.chdir
|
||||
* // => "/tmp"
|
||||
*
|
||||
* // optional argument
|
||||
* program.option('-c, --cheese [type]', 'add cheese [marble]');
|
||||
* ```js
|
||||
* program
|
||||
* .option('-p, --pepper', 'add pepper')
|
||||
* .option('-p, --pizza-type <TYPE>', 'type of pizza') // required option-argument
|
||||
* .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
|
||||
* .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
option(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
|
||||
option<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
|
||||
option(
|
||||
flags: string,
|
||||
description?: string,
|
||||
defaultValue?: string | boolean | string[],
|
||||
): this;
|
||||
option<T>(
|
||||
flags: string,
|
||||
description: string,
|
||||
parseArg: (value: string, previous: T) => T,
|
||||
defaultValue?: T,
|
||||
): this;
|
||||
/** @deprecated since v7, instead use choices or a custom function */
|
||||
option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
|
||||
option(
|
||||
flags: string,
|
||||
description: string,
|
||||
regexp: RegExp,
|
||||
defaultValue?: string | boolean | string[],
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Define a required option, which must have a value after parsing. This usually means
|
||||
|
|
@ -553,10 +591,24 @@ export class Command {
|
|||
*
|
||||
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
|
||||
*/
|
||||
requiredOption(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
|
||||
requiredOption<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
|
||||
requiredOption(
|
||||
flags: string,
|
||||
description?: string,
|
||||
defaultValue?: string | boolean | string[],
|
||||
): this;
|
||||
requiredOption<T>(
|
||||
flags: string,
|
||||
description: string,
|
||||
parseArg: (value: string, previous: T) => T,
|
||||
defaultValue?: T,
|
||||
): this;
|
||||
/** @deprecated since v7, instead use choices or a custom function */
|
||||
requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
|
||||
requiredOption(
|
||||
flags: string,
|
||||
description: string,
|
||||
regexp: RegExp,
|
||||
defaultValue?: string | boolean | string[],
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Factory routine to create a new unattached option.
|
||||
|
|
@ -581,7 +633,9 @@ export class Command {
|
|||
* @returns `this` command for chaining
|
||||
*/
|
||||
storeOptionsAsProperties<T extends OptionValues>(): this & T;
|
||||
storeOptionsAsProperties<T extends OptionValues>(storeAsProperties: true): this & T;
|
||||
storeOptionsAsProperties<T extends OptionValues>(
|
||||
storeAsProperties: true,
|
||||
): this & T;
|
||||
storeOptionsAsProperties(storeAsProperties?: boolean): this;
|
||||
|
||||
/**
|
||||
|
|
@ -597,7 +651,11 @@ export class Command {
|
|||
/**
|
||||
* Store option value and where the value came from.
|
||||
*/
|
||||
setOptionValueWithSource(key: string, value: unknown, source: OptionValueSource): this;
|
||||
setOptionValueWithSource(
|
||||
key: string,
|
||||
value: unknown,
|
||||
source: OptionValueSource,
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Get source of option value.
|
||||
|
|
@ -605,7 +663,7 @@ export class Command {
|
|||
getOptionValueSource(key: string): OptionValueSource | undefined;
|
||||
|
||||
/**
|
||||
* Get source of option value. See also .optsWithGlobals().
|
||||
* Get source of option value. See also .optsWithGlobals().
|
||||
*/
|
||||
getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;
|
||||
|
||||
|
|
@ -661,38 +719,49 @@ export class Command {
|
|||
/**
|
||||
* Parse `argv`, setting options and invoking commands when defined.
|
||||
*
|
||||
* The default expectation is that the arguments are from node and have the application as argv[0]
|
||||
* and the script being run in argv[1], with user parameters after that.
|
||||
* Use parseAsync instead of parse if any of your action handlers are async.
|
||||
*
|
||||
* Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
||||
*
|
||||
* Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
||||
* - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
||||
* - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
||||
* - `'user'`: just user arguments
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* program.parse(process.argv);
|
||||
* program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
|
||||
* program.parse(); // parse process.argv and auto-detect electron and special node flags
|
||||
* program.parse(process.argv); // assume argv[0] is app and argv[1] is script
|
||||
* program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
parse(argv?: readonly string[], options?: ParseOptions): this;
|
||||
parse(argv?: readonly string[], parseOptions?: ParseOptions): this;
|
||||
|
||||
/**
|
||||
* Parse `argv`, setting options and invoking commands when defined.
|
||||
*
|
||||
* Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
|
||||
* Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
||||
*
|
||||
* The default expectation is that the arguments are from node and have the application as argv[0]
|
||||
* and the script being run in argv[1], with user parameters after that.
|
||||
* Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
||||
* - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
||||
* - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
||||
* - `'user'`: just user arguments
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* program.parseAsync(process.argv);
|
||||
* program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions
|
||||
* program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
||||
* await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags
|
||||
* await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script
|
||||
* await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
||||
* ```
|
||||
*
|
||||
* @returns Promise
|
||||
*/
|
||||
parseAsync(argv?: readonly string[], options?: ParseOptions): Promise<this>;
|
||||
parseAsync(
|
||||
argv?: readonly string[],
|
||||
parseOptions?: ParseOptions,
|
||||
): Promise<this>;
|
||||
|
||||
/**
|
||||
* Parse options from `argv` removing known options,
|
||||
|
|
@ -724,7 +793,7 @@ export class Command {
|
|||
|
||||
description(str: string): this;
|
||||
/** @deprecated since v8, instead use .argument to add command argument with description */
|
||||
description(str: string, argsDescription: {[argName: string]: string}): this;
|
||||
description(str: string, argsDescription: Record<string, string>): this;
|
||||
/**
|
||||
* Get the description.
|
||||
*/
|
||||
|
|
@ -821,7 +890,7 @@ export class Command {
|
|||
/**
|
||||
* Get the executable search directory.
|
||||
*/
|
||||
executableDir(): string;
|
||||
executableDir(): string | null;
|
||||
|
||||
/**
|
||||
* Output help information for this command.
|
||||
|
|
@ -845,6 +914,12 @@ export class Command {
|
|||
*/
|
||||
helpOption(flags?: string | boolean, description?: string): this;
|
||||
|
||||
/**
|
||||
* Supply your own option to use for the built-in help option.
|
||||
* This is an alternative to using helpOption() to customise the flags and description etc.
|
||||
*/
|
||||
addHelpOption(option: Option): this;
|
||||
|
||||
/**
|
||||
* Output help information and exit.
|
||||
*
|
||||
|
|
@ -861,7 +936,10 @@ export class Command {
|
|||
* and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
|
||||
*/
|
||||
addHelpText(position: AddHelpTextPosition, text: string): this;
|
||||
addHelpText(position: AddHelpTextPosition, text: (context: AddHelpTextContext) => string): this;
|
||||
addHelpText(
|
||||
position: AddHelpTextPosition,
|
||||
text: (context: AddHelpTextContext) => string,
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Add a listener (callback) for when events occur. (Implemented using EventEmitter.)
|
||||
|
|
|
|||
20
@capacitor/cli/node_modules/debug/LICENSE
generated
vendored
Normal file
20
@capacitor/cli/node_modules/debug/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
||||
Copyright (c) 2018-2021 Josh Junon
|
||||
|
||||
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.
|
||||
|
||||
481
@capacitor/cli/node_modules/debug/README.md
generated
vendored
Normal file
481
@capacitor/cli/node_modules/debug/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,481 @@
|
|||
# debug
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
|
||||
|
||||
A tiny JavaScript debugging utility modelled after Node.js core's debugging
|
||||
technique. Works in Node.js and web browsers.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ npm install debug
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
|
||||
|
||||
Example [_app.js_](./examples/node/app.js):
|
||||
|
||||
```js
|
||||
var debug = require('debug')('http')
|
||||
, http = require('http')
|
||||
, name = 'My App';
|
||||
|
||||
// fake app
|
||||
|
||||
debug('booting %o', name);
|
||||
|
||||
http.createServer(function(req, res){
|
||||
debug(req.method + ' ' + req.url);
|
||||
res.end('hello\n');
|
||||
}).listen(3000, function(){
|
||||
debug('listening');
|
||||
});
|
||||
|
||||
// fake worker of some kind
|
||||
|
||||
require('./worker');
|
||||
```
|
||||
|
||||
Example [_worker.js_](./examples/node/worker.js):
|
||||
|
||||
```js
|
||||
var a = require('debug')('worker:a')
|
||||
, b = require('debug')('worker:b');
|
||||
|
||||
function work() {
|
||||
a('doing lots of uninteresting work');
|
||||
setTimeout(work, Math.random() * 1000);
|
||||
}
|
||||
|
||||
work();
|
||||
|
||||
function workb() {
|
||||
b('doing some work');
|
||||
setTimeout(workb, Math.random() * 2000);
|
||||
}
|
||||
|
||||
workb();
|
||||
```
|
||||
|
||||
The `DEBUG` environment variable is then used to enable these based on space or
|
||||
comma-delimited names.
|
||||
|
||||
Here are some examples:
|
||||
|
||||
<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
|
||||
<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
|
||||
<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
|
||||
|
||||
#### Windows command prompt notes
|
||||
|
||||
##### CMD
|
||||
|
||||
On Windows the environment variable is set using the `set` command.
|
||||
|
||||
```cmd
|
||||
set DEBUG=*,-not_this
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```cmd
|
||||
set DEBUG=* & node app.js
|
||||
```
|
||||
|
||||
##### PowerShell (VS Code default)
|
||||
|
||||
PowerShell uses different syntax to set environment variables.
|
||||
|
||||
```cmd
|
||||
$env:DEBUG = "*,-not_this"
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```cmd
|
||||
$env:DEBUG='app';node app.js
|
||||
```
|
||||
|
||||
Then, run the program to be debugged as usual.
|
||||
|
||||
npm script example:
|
||||
```js
|
||||
"windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
|
||||
```
|
||||
|
||||
## Namespace Colors
|
||||
|
||||
Every debug instance has a color generated for it based on its namespace name.
|
||||
This helps when visually parsing the debug output to identify which debug instance
|
||||
a debug line belongs to.
|
||||
|
||||
#### Node.js
|
||||
|
||||
In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
|
||||
the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
|
||||
otherwise debug will only use a small handful of basic colors.
|
||||
|
||||
<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">
|
||||
|
||||
#### Web Browser
|
||||
|
||||
Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
|
||||
option. These are WebKit web inspectors, Firefox ([since version
|
||||
31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
|
||||
and the Firebug plugin for Firefox (any version).
|
||||
|
||||
<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">
|
||||
|
||||
|
||||
## Millisecond diff
|
||||
|
||||
When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
|
||||
|
||||
When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">
|
||||
|
||||
|
||||
## Conventions
|
||||
|
||||
If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output.
|
||||
|
||||
## Wildcards
|
||||
|
||||
The `*` character may be used as a wildcard. Suppose for example your library has
|
||||
debuggers named "connect:bodyParser", "connect:compress", "connect:session",
|
||||
instead of listing all three with
|
||||
`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
|
||||
`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
|
||||
|
||||
You can also exclude specific debuggers by prefixing them with a "-" character.
|
||||
For example, `DEBUG=*,-connect:*` would include all debuggers except those
|
||||
starting with "connect:".
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When running through Node.js, you can set a few environment variables that will
|
||||
change the behavior of the debug logging:
|
||||
|
||||
| Name | Purpose |
|
||||
|-----------|-------------------------------------------------|
|
||||
| `DEBUG` | Enables/disables specific debugging namespaces. |
|
||||
| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). |
|
||||
| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
|
||||
| `DEBUG_DEPTH` | Object inspection depth. |
|
||||
| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
|
||||
|
||||
|
||||
__Note:__ The environment variables beginning with `DEBUG_` end up being
|
||||
converted into an Options object that gets used with `%o`/`%O` formatters.
|
||||
See the Node.js documentation for
|
||||
[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
|
||||
for the complete list.
|
||||
|
||||
## Formatters
|
||||
|
||||
Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
|
||||
Below are the officially supported formatters:
|
||||
|
||||
| Formatter | Representation |
|
||||
|-----------|----------------|
|
||||
| `%O` | Pretty-print an Object on multiple lines. |
|
||||
| `%o` | Pretty-print an Object all on a single line. |
|
||||
| `%s` | String. |
|
||||
| `%d` | Number (both integer and float). |
|
||||
| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
|
||||
| `%%` | Single percent sign ('%'). This does not consume an argument. |
|
||||
|
||||
|
||||
### Custom formatters
|
||||
|
||||
You can add custom formatters by extending the `debug.formatters` object.
|
||||
For example, if you wanted to add support for rendering a Buffer as hex with
|
||||
`%h`, you could do something like:
|
||||
|
||||
```js
|
||||
const createDebug = require('debug')
|
||||
createDebug.formatters.h = (v) => {
|
||||
return v.toString('hex')
|
||||
}
|
||||
|
||||
// …elsewhere
|
||||
const debug = createDebug('foo')
|
||||
debug('this is hex: %h', new Buffer('hello world'))
|
||||
// foo this is hex: 68656c6c6f20776f726c6421 +0ms
|
||||
```
|
||||
|
||||
|
||||
## Browser Support
|
||||
|
||||
You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
|
||||
or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
|
||||
if you don't want to build it yourself.
|
||||
|
||||
Debug's enable state is currently persisted by `localStorage`.
|
||||
Consider the situation shown below where you have `worker:a` and `worker:b`,
|
||||
and wish to debug both. You can enable this using `localStorage.debug`:
|
||||
|
||||
```js
|
||||
localStorage.debug = 'worker:*'
|
||||
```
|
||||
|
||||
And then refresh the page.
|
||||
|
||||
```js
|
||||
a = debug('worker:a');
|
||||
b = debug('worker:b');
|
||||
|
||||
setInterval(function(){
|
||||
a('doing some work');
|
||||
}, 1000);
|
||||
|
||||
setInterval(function(){
|
||||
b('doing some work');
|
||||
}, 1200);
|
||||
```
|
||||
|
||||
In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_.
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png">
|
||||
|
||||
## Output streams
|
||||
|
||||
By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
|
||||
|
||||
Example [_stdout.js_](./examples/node/stdout.js):
|
||||
|
||||
```js
|
||||
var debug = require('debug');
|
||||
var error = debug('app:error');
|
||||
|
||||
// by default stderr is used
|
||||
error('goes to stderr!');
|
||||
|
||||
var log = debug('app:log');
|
||||
// set this namespace to log via console.log
|
||||
log.log = console.log.bind(console); // don't forget to bind to console!
|
||||
log('goes to stdout');
|
||||
error('still goes to stderr!');
|
||||
|
||||
// set all output to go via console.info
|
||||
// overrides all per-namespace log settings
|
||||
debug.log = console.info.bind(console);
|
||||
error('now goes to stdout via console.info');
|
||||
log('still goes to stdout, but via console.info now');
|
||||
```
|
||||
|
||||
## Extend
|
||||
You can simply extend debugger
|
||||
```js
|
||||
const log = require('debug')('auth');
|
||||
|
||||
//creates new debug instance with extended namespace
|
||||
const logSign = log.extend('sign');
|
||||
const logLogin = log.extend('login');
|
||||
|
||||
log('hello'); // auth hello
|
||||
logSign('hello'); //auth:sign hello
|
||||
logLogin('hello'); //auth:login hello
|
||||
```
|
||||
|
||||
## Set dynamically
|
||||
|
||||
You can also enable debug dynamically by calling the `enable()` method :
|
||||
|
||||
```js
|
||||
let debug = require('debug');
|
||||
|
||||
console.log(1, debug.enabled('test'));
|
||||
|
||||
debug.enable('test');
|
||||
console.log(2, debug.enabled('test'));
|
||||
|
||||
debug.disable();
|
||||
console.log(3, debug.enabled('test'));
|
||||
|
||||
```
|
||||
|
||||
print :
|
||||
```
|
||||
1 false
|
||||
2 true
|
||||
3 false
|
||||
```
|
||||
|
||||
Usage :
|
||||
`enable(namespaces)`
|
||||
`namespaces` can include modes separated by a colon and wildcards.
|
||||
|
||||
Note that calling `enable()` completely overrides previously set DEBUG variable :
|
||||
|
||||
```
|
||||
$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
|
||||
=> false
|
||||
```
|
||||
|
||||
`disable()`
|
||||
|
||||
Will disable all namespaces. The functions returns the namespaces currently
|
||||
enabled (and skipped). This can be useful if you want to disable debugging
|
||||
temporarily without knowing what was enabled to begin with.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
let debug = require('debug');
|
||||
debug.enable('foo:*,-foo:bar');
|
||||
let namespaces = debug.disable();
|
||||
debug.enable(namespaces);
|
||||
```
|
||||
|
||||
Note: There is no guarantee that the string will be identical to the initial
|
||||
enable string, but semantically they will be identical.
|
||||
|
||||
## Checking whether a debug target is enabled
|
||||
|
||||
After you've created a debug instance, you can determine whether or not it is
|
||||
enabled by checking the `enabled` property:
|
||||
|
||||
```javascript
|
||||
const debug = require('debug')('http');
|
||||
|
||||
if (debug.enabled) {
|
||||
// do stuff...
|
||||
}
|
||||
```
|
||||
|
||||
You can also manually toggle this property to force the debug instance to be
|
||||
enabled or disabled.
|
||||
|
||||
## Usage in child processes
|
||||
|
||||
Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process.
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
worker = fork(WORKER_WRAP_PATH, [workerPath], {
|
||||
stdio: [
|
||||
/* stdin: */ 0,
|
||||
/* stdout: */ 'pipe',
|
||||
/* stderr: */ 'pipe',
|
||||
'ipc',
|
||||
],
|
||||
env: Object.assign({}, process.env, {
|
||||
DEBUG_COLORS: 1 // without this settings, colors won't be shown
|
||||
}),
|
||||
});
|
||||
|
||||
worker.stderr.pipe(process.stderr, { end: false });
|
||||
```
|
||||
|
||||
|
||||
## Authors
|
||||
|
||||
- TJ Holowaychuk
|
||||
- Nathan Rajlich
|
||||
- Andrew Rhyne
|
||||
- Josh Junon
|
||||
|
||||
## Backers
|
||||
|
||||
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
|
||||
|
||||
<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
|
||||
|
||||
|
||||
## Sponsors
|
||||
|
||||
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
|
||||
|
||||
<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
||||
Copyright (c) 2018-2021 Josh Junon
|
||||
|
||||
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.
|
||||
64
@capacitor/cli/node_modules/debug/package.json
generated
vendored
Normal file
64
@capacitor/cli/node_modules/debug/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
"name": "debug",
|
||||
"version": "4.4.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/debug-js/debug.git"
|
||||
},
|
||||
"description": "Lightweight debugging utility for Node.js and the browser",
|
||||
"keywords": [
|
||||
"debug",
|
||||
"log",
|
||||
"debugger"
|
||||
],
|
||||
"files": [
|
||||
"src",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"author": "Josh Junon (https://github.com/qix-)",
|
||||
"contributors": [
|
||||
"TJ Holowaychuk <tj@vision-media.ca>",
|
||||
"Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
|
||||
"Andrew Rhyne <rhyneandrew@gmail.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"lint": "xo",
|
||||
"test": "npm run test:node && npm run test:browser && npm run lint",
|
||||
"test:node": "mocha test.js test.node.js",
|
||||
"test:browser": "karma start --single-run",
|
||||
"test:coverage": "cat ./coverage/lcov.info | coveralls"
|
||||
},
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"brfs": "^2.0.1",
|
||||
"browserify": "^16.2.3",
|
||||
"coveralls": "^3.0.2",
|
||||
"karma": "^3.1.4",
|
||||
"karma-browserify": "^6.0.0",
|
||||
"karma-chrome-launcher": "^2.2.0",
|
||||
"karma-mocha": "^1.3.0",
|
||||
"mocha": "^5.2.0",
|
||||
"mocha-lcov-reporter": "^1.2.0",
|
||||
"sinon": "^14.0.0",
|
||||
"xo": "^0.23.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"main": "./src/index.js",
|
||||
"browser": "./src/browser.js",
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"xo": {
|
||||
"rules": {
|
||||
"import/extensions": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
272
@capacitor/cli/node_modules/debug/src/browser.js
generated
vendored
Normal file
272
@capacitor/cli/node_modules/debug/src/browser.js
generated
vendored
Normal file
|
|
@ -0,0 +1,272 @@
|
|||
/* eslint-env browser */
|
||||
|
||||
/**
|
||||
* This is the web browser implementation of `debug()`.
|
||||
*/
|
||||
|
||||
exports.formatArgs = formatArgs;
|
||||
exports.save = save;
|
||||
exports.load = load;
|
||||
exports.useColors = useColors;
|
||||
exports.storage = localstorage();
|
||||
exports.destroy = (() => {
|
||||
let warned = false;
|
||||
|
||||
return () => {
|
||||
if (!warned) {
|
||||
warned = true;
|
||||
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
/**
|
||||
* Colors.
|
||||
*/
|
||||
|
||||
exports.colors = [
|
||||
'#0000CC',
|
||||
'#0000FF',
|
||||
'#0033CC',
|
||||
'#0033FF',
|
||||
'#0066CC',
|
||||
'#0066FF',
|
||||
'#0099CC',
|
||||
'#0099FF',
|
||||
'#00CC00',
|
||||
'#00CC33',
|
||||
'#00CC66',
|
||||
'#00CC99',
|
||||
'#00CCCC',
|
||||
'#00CCFF',
|
||||
'#3300CC',
|
||||
'#3300FF',
|
||||
'#3333CC',
|
||||
'#3333FF',
|
||||
'#3366CC',
|
||||
'#3366FF',
|
||||
'#3399CC',
|
||||
'#3399FF',
|
||||
'#33CC00',
|
||||
'#33CC33',
|
||||
'#33CC66',
|
||||
'#33CC99',
|
||||
'#33CCCC',
|
||||
'#33CCFF',
|
||||
'#6600CC',
|
||||
'#6600FF',
|
||||
'#6633CC',
|
||||
'#6633FF',
|
||||
'#66CC00',
|
||||
'#66CC33',
|
||||
'#9900CC',
|
||||
'#9900FF',
|
||||
'#9933CC',
|
||||
'#9933FF',
|
||||
'#99CC00',
|
||||
'#99CC33',
|
||||
'#CC0000',
|
||||
'#CC0033',
|
||||
'#CC0066',
|
||||
'#CC0099',
|
||||
'#CC00CC',
|
||||
'#CC00FF',
|
||||
'#CC3300',
|
||||
'#CC3333',
|
||||
'#CC3366',
|
||||
'#CC3399',
|
||||
'#CC33CC',
|
||||
'#CC33FF',
|
||||
'#CC6600',
|
||||
'#CC6633',
|
||||
'#CC9900',
|
||||
'#CC9933',
|
||||
'#CCCC00',
|
||||
'#CCCC33',
|
||||
'#FF0000',
|
||||
'#FF0033',
|
||||
'#FF0066',
|
||||
'#FF0099',
|
||||
'#FF00CC',
|
||||
'#FF00FF',
|
||||
'#FF3300',
|
||||
'#FF3333',
|
||||
'#FF3366',
|
||||
'#FF3399',
|
||||
'#FF33CC',
|
||||
'#FF33FF',
|
||||
'#FF6600',
|
||||
'#FF6633',
|
||||
'#FF9900',
|
||||
'#FF9933',
|
||||
'#FFCC00',
|
||||
'#FFCC33'
|
||||
];
|
||||
|
||||
/**
|
||||
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
||||
* and the Firebug extension (any Firefox version) are known
|
||||
* to support "%c" CSS customizations.
|
||||
*
|
||||
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
function useColors() {
|
||||
// NB: In an Electron preload script, document will be defined but not fully
|
||||
// initialized. Since we know we're in Chrome, we'll just detect this case
|
||||
// explicitly
|
||||
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Internet Explorer and Edge do not support colors.
|
||||
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let m;
|
||||
|
||||
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
||||
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
||||
// eslint-disable-next-line no-return-assign
|
||||
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
||||
// Is firebug? http://stackoverflow.com/a/398120/376773
|
||||
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
||||
// Is firefox >= v31?
|
||||
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
||||
(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
|
||||
// Double check webkit in userAgent just in case we are in a worker
|
||||
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
||||
}
|
||||
|
||||
/**
|
||||
* Colorize log arguments if enabled.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function formatArgs(args) {
|
||||
args[0] = (this.useColors ? '%c' : '') +
|
||||
this.namespace +
|
||||
(this.useColors ? ' %c' : ' ') +
|
||||
args[0] +
|
||||
(this.useColors ? '%c ' : ' ') +
|
||||
'+' + module.exports.humanize(this.diff);
|
||||
|
||||
if (!this.useColors) {
|
||||
return;
|
||||
}
|
||||
|
||||
const c = 'color: ' + this.color;
|
||||
args.splice(1, 0, c, 'color: inherit');
|
||||
|
||||
// The final "%c" is somewhat tricky, because there could be other
|
||||
// arguments passed either before or after the %c, so we need to
|
||||
// figure out the correct index to insert the CSS into
|
||||
let index = 0;
|
||||
let lastC = 0;
|
||||
args[0].replace(/%[a-zA-Z%]/g, match => {
|
||||
if (match === '%%') {
|
||||
return;
|
||||
}
|
||||
index++;
|
||||
if (match === '%c') {
|
||||
// We only are interested in the *last* %c
|
||||
// (the user may have provided their own)
|
||||
lastC = index;
|
||||
}
|
||||
});
|
||||
|
||||
args.splice(lastC, 0, c);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes `console.debug()` when available.
|
||||
* No-op when `console.debug` is not a "function".
|
||||
* If `console.debug` is not available, falls back
|
||||
* to `console.log`.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
exports.log = console.debug || console.log || (() => {});
|
||||
|
||||
/**
|
||||
* Save `namespaces`.
|
||||
*
|
||||
* @param {String} namespaces
|
||||
* @api private
|
||||
*/
|
||||
function save(namespaces) {
|
||||
try {
|
||||
if (namespaces) {
|
||||
exports.storage.setItem('debug', namespaces);
|
||||
} else {
|
||||
exports.storage.removeItem('debug');
|
||||
}
|
||||
} catch (error) {
|
||||
// Swallow
|
||||
// XXX (@Qix-) should we be logging these?
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load `namespaces`.
|
||||
*
|
||||
* @return {String} returns the previously persisted debug modes
|
||||
* @api private
|
||||
*/
|
||||
function load() {
|
||||
let r;
|
||||
try {
|
||||
r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
|
||||
} catch (error) {
|
||||
// Swallow
|
||||
// XXX (@Qix-) should we be logging these?
|
||||
}
|
||||
|
||||
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
||||
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
||||
r = process.env.DEBUG;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Localstorage attempts to return the localstorage.
|
||||
*
|
||||
* This is necessary because safari throws
|
||||
* when a user disables cookies/localstorage
|
||||
* and you attempt to access it.
|
||||
*
|
||||
* @return {LocalStorage}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function localstorage() {
|
||||
try {
|
||||
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
||||
// The Browser also has localStorage in the global context.
|
||||
return localStorage;
|
||||
} catch (error) {
|
||||
// Swallow
|
||||
// XXX (@Qix-) should we be logging these?
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = require('./common')(exports);
|
||||
|
||||
const {formatters} = module.exports;
|
||||
|
||||
/**
|
||||
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
||||
*/
|
||||
|
||||
formatters.j = function (v) {
|
||||
try {
|
||||
return JSON.stringify(v);
|
||||
} catch (error) {
|
||||
return '[UnexpectedJSONParseError]: ' + error.message;
|
||||
}
|
||||
};
|
||||
292
@capacitor/cli/node_modules/debug/src/common.js
generated
vendored
Normal file
292
@capacitor/cli/node_modules/debug/src/common.js
generated
vendored
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
|
||||
/**
|
||||
* This is the common logic for both the Node.js and web browser
|
||||
* implementations of `debug()`.
|
||||
*/
|
||||
|
||||
function setup(env) {
|
||||
createDebug.debug = createDebug;
|
||||
createDebug.default = createDebug;
|
||||
createDebug.coerce = coerce;
|
||||
createDebug.disable = disable;
|
||||
createDebug.enable = enable;
|
||||
createDebug.enabled = enabled;
|
||||
createDebug.humanize = require('ms');
|
||||
createDebug.destroy = destroy;
|
||||
|
||||
Object.keys(env).forEach(key => {
|
||||
createDebug[key] = env[key];
|
||||
});
|
||||
|
||||
/**
|
||||
* The currently active debug mode names, and names to skip.
|
||||
*/
|
||||
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
|
||||
/**
|
||||
* Map of special "%n" handling functions, for the debug "format" argument.
|
||||
*
|
||||
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
||||
*/
|
||||
createDebug.formatters = {};
|
||||
|
||||
/**
|
||||
* Selects a color for a debug namespace
|
||||
* @param {String} namespace The namespace string for the debug instance to be colored
|
||||
* @return {Number|String} An ANSI color code for the given namespace
|
||||
* @api private
|
||||
*/
|
||||
function selectColor(namespace) {
|
||||
let hash = 0;
|
||||
|
||||
for (let i = 0; i < namespace.length; i++) {
|
||||
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
|
||||
hash |= 0; // Convert to 32bit integer
|
||||
}
|
||||
|
||||
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
||||
}
|
||||
createDebug.selectColor = selectColor;
|
||||
|
||||
/**
|
||||
* Create a debugger with the given `namespace`.
|
||||
*
|
||||
* @param {String} namespace
|
||||
* @return {Function}
|
||||
* @api public
|
||||
*/
|
||||
function createDebug(namespace) {
|
||||
let prevTime;
|
||||
let enableOverride = null;
|
||||
let namespacesCache;
|
||||
let enabledCache;
|
||||
|
||||
function debug(...args) {
|
||||
// Disabled?
|
||||
if (!debug.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const self = debug;
|
||||
|
||||
// Set `diff` timestamp
|
||||
const curr = Number(new Date());
|
||||
const ms = curr - (prevTime || curr);
|
||||
self.diff = ms;
|
||||
self.prev = prevTime;
|
||||
self.curr = curr;
|
||||
prevTime = curr;
|
||||
|
||||
args[0] = createDebug.coerce(args[0]);
|
||||
|
||||
if (typeof args[0] !== 'string') {
|
||||
// Anything else let's inspect with %O
|
||||
args.unshift('%O');
|
||||
}
|
||||
|
||||
// Apply any `formatters` transformations
|
||||
let index = 0;
|
||||
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
||||
// If we encounter an escaped % then don't increase the array index
|
||||
if (match === '%%') {
|
||||
return '%';
|
||||
}
|
||||
index++;
|
||||
const formatter = createDebug.formatters[format];
|
||||
if (typeof formatter === 'function') {
|
||||
const val = args[index];
|
||||
match = formatter.call(self, val);
|
||||
|
||||
// Now we need to remove `args[index]` since it's inlined in the `format`
|
||||
args.splice(index, 1);
|
||||
index--;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
|
||||
// Apply env-specific formatting (colors, etc.)
|
||||
createDebug.formatArgs.call(self, args);
|
||||
|
||||
const logFn = self.log || createDebug.log;
|
||||
logFn.apply(self, args);
|
||||
}
|
||||
|
||||
debug.namespace = namespace;
|
||||
debug.useColors = createDebug.useColors();
|
||||
debug.color = createDebug.selectColor(namespace);
|
||||
debug.extend = extend;
|
||||
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
|
||||
|
||||
Object.defineProperty(debug, 'enabled', {
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
get: () => {
|
||||
if (enableOverride !== null) {
|
||||
return enableOverride;
|
||||
}
|
||||
if (namespacesCache !== createDebug.namespaces) {
|
||||
namespacesCache = createDebug.namespaces;
|
||||
enabledCache = createDebug.enabled(namespace);
|
||||
}
|
||||
|
||||
return enabledCache;
|
||||
},
|
||||
set: v => {
|
||||
enableOverride = v;
|
||||
}
|
||||
});
|
||||
|
||||
// Env-specific initialization logic for debug instances
|
||||
if (typeof createDebug.init === 'function') {
|
||||
createDebug.init(debug);
|
||||
}
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
function extend(namespace, delimiter) {
|
||||
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
||||
newDebug.log = this.log;
|
||||
return newDebug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables a debug mode by namespaces. This can include modes
|
||||
* separated by a colon and wildcards.
|
||||
*
|
||||
* @param {String} namespaces
|
||||
* @api public
|
||||
*/
|
||||
function enable(namespaces) {
|
||||
createDebug.save(namespaces);
|
||||
createDebug.namespaces = namespaces;
|
||||
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
|
||||
const split = (typeof namespaces === 'string' ? namespaces : '')
|
||||
.trim()
|
||||
.replace(/\s+/g, ',')
|
||||
.split(',')
|
||||
.filter(Boolean);
|
||||
|
||||
for (const ns of split) {
|
||||
if (ns[0] === '-') {
|
||||
createDebug.skips.push(ns.slice(1));
|
||||
} else {
|
||||
createDebug.names.push(ns);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given string matches a namespace template, honoring
|
||||
* asterisks as wildcards.
|
||||
*
|
||||
* @param {String} search
|
||||
* @param {String} template
|
||||
* @return {Boolean}
|
||||
*/
|
||||
function matchesTemplate(search, template) {
|
||||
let searchIndex = 0;
|
||||
let templateIndex = 0;
|
||||
let starIndex = -1;
|
||||
let matchIndex = 0;
|
||||
|
||||
while (searchIndex < search.length) {
|
||||
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
|
||||
// Match character or proceed with wildcard
|
||||
if (template[templateIndex] === '*') {
|
||||
starIndex = templateIndex;
|
||||
matchIndex = searchIndex;
|
||||
templateIndex++; // Skip the '*'
|
||||
} else {
|
||||
searchIndex++;
|
||||
templateIndex++;
|
||||
}
|
||||
} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
|
||||
// Backtrack to the last '*' and try to match more characters
|
||||
templateIndex = starIndex + 1;
|
||||
matchIndex++;
|
||||
searchIndex = matchIndex;
|
||||
} else {
|
||||
return false; // No match
|
||||
}
|
||||
}
|
||||
|
||||
// Handle trailing '*' in template
|
||||
while (templateIndex < template.length && template[templateIndex] === '*') {
|
||||
templateIndex++;
|
||||
}
|
||||
|
||||
return templateIndex === template.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable debug output.
|
||||
*
|
||||
* @return {String} namespaces
|
||||
* @api public
|
||||
*/
|
||||
function disable() {
|
||||
const namespaces = [
|
||||
...createDebug.names,
|
||||
...createDebug.skips.map(namespace => '-' + namespace)
|
||||
].join(',');
|
||||
createDebug.enable('');
|
||||
return namespaces;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given mode name is enabled, false otherwise.
|
||||
*
|
||||
* @param {String} name
|
||||
* @return {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
function enabled(name) {
|
||||
for (const skip of createDebug.skips) {
|
||||
if (matchesTemplate(name, skip)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (const ns of createDebug.names) {
|
||||
if (matchesTemplate(name, ns)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Coerce `val`.
|
||||
*
|
||||
* @param {Mixed} val
|
||||
* @return {Mixed}
|
||||
* @api private
|
||||
*/
|
||||
function coerce(val) {
|
||||
if (val instanceof Error) {
|
||||
return val.stack || val.message;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* XXX DO NOT USE. This is a temporary stub function.
|
||||
* XXX It WILL be removed in the next major release.
|
||||
*/
|
||||
function destroy() {
|
||||
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
||||
}
|
||||
|
||||
createDebug.enable(createDebug.load());
|
||||
|
||||
return createDebug;
|
||||
}
|
||||
|
||||
module.exports = setup;
|
||||
10
@capacitor/cli/node_modules/debug/src/index.js
generated
vendored
Normal file
10
@capacitor/cli/node_modules/debug/src/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Detect Electron renderer / nwjs process, which is node, but we should
|
||||
* treat as a browser.
|
||||
*/
|
||||
|
||||
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
||||
module.exports = require('./browser.js');
|
||||
} else {
|
||||
module.exports = require('./node.js');
|
||||
}
|
||||
263
@capacitor/cli/node_modules/debug/src/node.js
generated
vendored
Normal file
263
@capacitor/cli/node_modules/debug/src/node.js
generated
vendored
Normal file
|
|
@ -0,0 +1,263 @@
|
|||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
const tty = require('tty');
|
||||
const util = require('util');
|
||||
|
||||
/**
|
||||
* This is the Node.js implementation of `debug()`.
|
||||
*/
|
||||
|
||||
exports.init = init;
|
||||
exports.log = log;
|
||||
exports.formatArgs = formatArgs;
|
||||
exports.save = save;
|
||||
exports.load = load;
|
||||
exports.useColors = useColors;
|
||||
exports.destroy = util.deprecate(
|
||||
() => {},
|
||||
'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
|
||||
);
|
||||
|
||||
/**
|
||||
* Colors.
|
||||
*/
|
||||
|
||||
exports.colors = [6, 2, 3, 4, 5, 1];
|
||||
|
||||
try {
|
||||
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
const supportsColor = require('supports-color');
|
||||
|
||||
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
||||
exports.colors = [
|
||||
20,
|
||||
21,
|
||||
26,
|
||||
27,
|
||||
32,
|
||||
33,
|
||||
38,
|
||||
39,
|
||||
40,
|
||||
41,
|
||||
42,
|
||||
43,
|
||||
44,
|
||||
45,
|
||||
56,
|
||||
57,
|
||||
62,
|
||||
63,
|
||||
68,
|
||||
69,
|
||||
74,
|
||||
75,
|
||||
76,
|
||||
77,
|
||||
78,
|
||||
79,
|
||||
80,
|
||||
81,
|
||||
92,
|
||||
93,
|
||||
98,
|
||||
99,
|
||||
112,
|
||||
113,
|
||||
128,
|
||||
129,
|
||||
134,
|
||||
135,
|
||||
148,
|
||||
149,
|
||||
160,
|
||||
161,
|
||||
162,
|
||||
163,
|
||||
164,
|
||||
165,
|
||||
166,
|
||||
167,
|
||||
168,
|
||||
169,
|
||||
170,
|
||||
171,
|
||||
172,
|
||||
173,
|
||||
178,
|
||||
179,
|
||||
184,
|
||||
185,
|
||||
196,
|
||||
197,
|
||||
198,
|
||||
199,
|
||||
200,
|
||||
201,
|
||||
202,
|
||||
203,
|
||||
204,
|
||||
205,
|
||||
206,
|
||||
207,
|
||||
208,
|
||||
209,
|
||||
214,
|
||||
215,
|
||||
220,
|
||||
221
|
||||
];
|
||||
}
|
||||
} catch (error) {
|
||||
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
||||
}
|
||||
|
||||
/**
|
||||
* Build up the default `inspectOpts` object from the environment variables.
|
||||
*
|
||||
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
||||
*/
|
||||
|
||||
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
||||
return /^debug_/i.test(key);
|
||||
}).reduce((obj, key) => {
|
||||
// Camel-case
|
||||
const prop = key
|
||||
.substring(6)
|
||||
.toLowerCase()
|
||||
.replace(/_([a-z])/g, (_, k) => {
|
||||
return k.toUpperCase();
|
||||
});
|
||||
|
||||
// Coerce string value into JS value
|
||||
let val = process.env[key];
|
||||
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
||||
val = true;
|
||||
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
||||
val = false;
|
||||
} else if (val === 'null') {
|
||||
val = null;
|
||||
} else {
|
||||
val = Number(val);
|
||||
}
|
||||
|
||||
obj[prop] = val;
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
/**
|
||||
* Is stdout a TTY? Colored output is enabled when `true`.
|
||||
*/
|
||||
|
||||
function useColors() {
|
||||
return 'colors' in exports.inspectOpts ?
|
||||
Boolean(exports.inspectOpts.colors) :
|
||||
tty.isatty(process.stderr.fd);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds ANSI color escape codes if enabled.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function formatArgs(args) {
|
||||
const {namespace: name, useColors} = this;
|
||||
|
||||
if (useColors) {
|
||||
const c = this.color;
|
||||
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
||||
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
||||
|
||||
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
||||
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
||||
} else {
|
||||
args[0] = getDate() + name + ' ' + args[0];
|
||||
}
|
||||
}
|
||||
|
||||
function getDate() {
|
||||
if (exports.inspectOpts.hideDate) {
|
||||
return '';
|
||||
}
|
||||
return new Date().toISOString() + ' ';
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
|
||||
*/
|
||||
|
||||
function log(...args) {
|
||||
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
|
||||
}
|
||||
|
||||
/**
|
||||
* Save `namespaces`.
|
||||
*
|
||||
* @param {String} namespaces
|
||||
* @api private
|
||||
*/
|
||||
function save(namespaces) {
|
||||
if (namespaces) {
|
||||
process.env.DEBUG = namespaces;
|
||||
} else {
|
||||
// If you set a process.env field to null or undefined, it gets cast to the
|
||||
// string 'null' or 'undefined'. Just delete instead.
|
||||
delete process.env.DEBUG;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load `namespaces`.
|
||||
*
|
||||
* @return {String} returns the previously persisted debug modes
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function load() {
|
||||
return process.env.DEBUG;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init logic for `debug` instances.
|
||||
*
|
||||
* Create a new `inspectOpts` object in case `useColors` is set
|
||||
* differently for a particular `debug` instance.
|
||||
*/
|
||||
|
||||
function init(debug) {
|
||||
debug.inspectOpts = {};
|
||||
|
||||
const keys = Object.keys(exports.inspectOpts);
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = require('./common')(exports);
|
||||
|
||||
const {formatters} = module.exports;
|
||||
|
||||
/**
|
||||
* Map %o to `util.inspect()`, all on a single line.
|
||||
*/
|
||||
|
||||
formatters.o = function (v) {
|
||||
this.inspectOpts.colors = this.useColors;
|
||||
return util.inspect(v, this.inspectOpts)
|
||||
.split('\n')
|
||||
.map(str => str.trim())
|
||||
.join(' ');
|
||||
};
|
||||
|
||||
/**
|
||||
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
||||
*/
|
||||
|
||||
formatters.O = function (v) {
|
||||
this.inspectOpts.colors = this.useColors;
|
||||
return util.inspect(v, this.inspectOpts);
|
||||
};
|
||||
15
@capacitor/cli/node_modules/fs-extra/LICENSE
generated
vendored
Normal file
15
@capacitor/cli/node_modules/fs-extra/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2011-2024 JP Richardson
|
||||
|
||||
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.
|
||||
292
@capacitor/cli/node_modules/fs-extra/README.md
generated
vendored
Normal file
292
@capacitor/cli/node_modules/fs-extra/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
Node.js: fs-extra
|
||||
=================
|
||||
|
||||
`fs-extra` adds file system methods that aren't included in the native `fs` module and adds promise support to the `fs` methods. It also uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs) to prevent `EMFILE` errors. It should be a drop in replacement for `fs`.
|
||||
|
||||
[](https://www.npmjs.org/package/fs-extra)
|
||||
[](https://github.com/jprichardson/node-fs-extra/blob/master/LICENSE)
|
||||
[](https://github.com/jprichardson/node-fs-extra/actions/workflows/ci.yml?query=branch%3Amaster)
|
||||
[](https://www.npmjs.org/package/fs-extra)
|
||||
[](https://standardjs.com)
|
||||
|
||||
Why?
|
||||
----
|
||||
|
||||
I got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects.
|
||||
|
||||
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
npm install fs-extra
|
||||
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
### CommonJS
|
||||
|
||||
`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed.
|
||||
|
||||
You don't ever need to include the original `fs` module again:
|
||||
|
||||
```js
|
||||
const fs = require('fs') // this is no longer necessary
|
||||
```
|
||||
|
||||
you can now do this:
|
||||
|
||||
```js
|
||||
const fs = require('fs-extra')
|
||||
```
|
||||
|
||||
or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want
|
||||
to name your `fs` variable `fse` like so:
|
||||
|
||||
```js
|
||||
const fse = require('fs-extra')
|
||||
```
|
||||
|
||||
you can also keep both, but it's redundant:
|
||||
|
||||
```js
|
||||
const fs = require('fs')
|
||||
const fse = require('fs-extra')
|
||||
```
|
||||
|
||||
### ESM
|
||||
|
||||
There is also an `fs-extra/esm` import, that supports both default and named exports. However, note that `fs` methods are not included in `fs-extra/esm`; you still need to import `fs` and/or `fs/promises` seperately:
|
||||
|
||||
```js
|
||||
import { readFileSync } from 'fs'
|
||||
import { readFile } from 'fs/promises'
|
||||
import { outputFile, outputFileSync } from 'fs-extra/esm'
|
||||
```
|
||||
|
||||
Default exports are supported:
|
||||
|
||||
```js
|
||||
import fs from 'fs'
|
||||
import fse from 'fs-extra/esm'
|
||||
// fse.readFileSync is not a function; must use fs.readFileSync
|
||||
```
|
||||
|
||||
but you probably want to just use regular `fs-extra` instead of `fs-extra/esm` for default exports:
|
||||
|
||||
```js
|
||||
import fs from 'fs-extra'
|
||||
// both fs and fs-extra methods are defined
|
||||
```
|
||||
|
||||
Sync vs Async vs Async/Await
|
||||
-------------
|
||||
Most methods are async by default. All async methods will return a promise if the callback isn't passed.
|
||||
|
||||
Sync methods on the other hand will throw if an error occurs.
|
||||
|
||||
Also Async/Await will throw an error if one occurs.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
const fs = require('fs-extra')
|
||||
|
||||
// Async with promises:
|
||||
fs.copy('/tmp/myfile', '/tmp/mynewfile')
|
||||
.then(() => console.log('success!'))
|
||||
.catch(err => console.error(err))
|
||||
|
||||
// Async with callbacks:
|
||||
fs.copy('/tmp/myfile', '/tmp/mynewfile', err => {
|
||||
if (err) return console.error(err)
|
||||
console.log('success!')
|
||||
})
|
||||
|
||||
// Sync:
|
||||
try {
|
||||
fs.copySync('/tmp/myfile', '/tmp/mynewfile')
|
||||
console.log('success!')
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
|
||||
// Async/Await:
|
||||
async function copyFiles () {
|
||||
try {
|
||||
await fs.copy('/tmp/myfile', '/tmp/mynewfile')
|
||||
console.log('success!')
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
||||
copyFiles()
|
||||
```
|
||||
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
### Async
|
||||
|
||||
- [copy](docs/copy.md)
|
||||
- [emptyDir](docs/emptyDir.md)
|
||||
- [ensureFile](docs/ensureFile.md)
|
||||
- [ensureDir](docs/ensureDir.md)
|
||||
- [ensureLink](docs/ensureLink.md)
|
||||
- [ensureSymlink](docs/ensureSymlink.md)
|
||||
- [mkdirp](docs/ensureDir.md)
|
||||
- [mkdirs](docs/ensureDir.md)
|
||||
- [move](docs/move.md)
|
||||
- [outputFile](docs/outputFile.md)
|
||||
- [outputJson](docs/outputJson.md)
|
||||
- [pathExists](docs/pathExists.md)
|
||||
- [readJson](docs/readJson.md)
|
||||
- [remove](docs/remove.md)
|
||||
- [writeJson](docs/writeJson.md)
|
||||
|
||||
### Sync
|
||||
|
||||
- [copySync](docs/copy-sync.md)
|
||||
- [emptyDirSync](docs/emptyDir-sync.md)
|
||||
- [ensureFileSync](docs/ensureFile-sync.md)
|
||||
- [ensureDirSync](docs/ensureDir-sync.md)
|
||||
- [ensureLinkSync](docs/ensureLink-sync.md)
|
||||
- [ensureSymlinkSync](docs/ensureSymlink-sync.md)
|
||||
- [mkdirpSync](docs/ensureDir-sync.md)
|
||||
- [mkdirsSync](docs/ensureDir-sync.md)
|
||||
- [moveSync](docs/move-sync.md)
|
||||
- [outputFileSync](docs/outputFile-sync.md)
|
||||
- [outputJsonSync](docs/outputJson-sync.md)
|
||||
- [pathExistsSync](docs/pathExists-sync.md)
|
||||
- [readJsonSync](docs/readJson-sync.md)
|
||||
- [removeSync](docs/remove-sync.md)
|
||||
- [writeJsonSync](docs/writeJson-sync.md)
|
||||
|
||||
|
||||
**NOTE:** You can still use the native Node.js methods. They are promisified and copied over to `fs-extra`. See [notes on `fs.read()`, `fs.write()`, & `fs.writev()`](docs/fs-read-write-writev.md)
|
||||
|
||||
### What happened to `walk()` and `walkSync()`?
|
||||
|
||||
They were removed from `fs-extra` in v2.0.0. If you need the functionality, `walk` and `walkSync` are available as separate packages, [`klaw`](https://github.com/jprichardson/node-klaw) and [`klaw-sync`](https://github.com/manidlou/node-klaw-sync).
|
||||
|
||||
|
||||
Third Party
|
||||
-----------
|
||||
|
||||
### CLI
|
||||
|
||||
[fse-cli](https://www.npmjs.com/package/@atao60/fse-cli) allows you to run `fs-extra` from a console or from [npm](https://www.npmjs.com) scripts.
|
||||
|
||||
### TypeScript
|
||||
|
||||
If you like TypeScript, you can use `fs-extra` with it: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra
|
||||
|
||||
|
||||
### File / Directory Watching
|
||||
|
||||
If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar).
|
||||
|
||||
### Obtain Filesystem (Devices, Partitions) Information
|
||||
|
||||
[fs-filesystem](https://github.com/arthurintelligence/node-fs-filesystem) allows you to read the state of the filesystem of the host on which it is run. It returns information about both the devices and the partitions (volumes) of the system.
|
||||
|
||||
### Misc.
|
||||
|
||||
- [fs-extra-debug](https://github.com/jdxcode/fs-extra-debug) - Send your fs-extra calls to [debug](https://npmjs.org/package/debug).
|
||||
- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls.
|
||||
|
||||
|
||||
|
||||
Hacking on fs-extra
|
||||
-------------------
|
||||
|
||||
Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project
|
||||
uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you,
|
||||
you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`.
|
||||
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
What's needed?
|
||||
- First, take a look at existing issues. Those are probably going to be where the priority lies.
|
||||
- More tests for edge cases. Specifically on different platforms. There can never be enough tests.
|
||||
- Improve test coverage.
|
||||
|
||||
Note: If you make any big changes, **you should definitely file an issue for discussion first.**
|
||||
|
||||
### Running the Test Suite
|
||||
|
||||
fs-extra contains hundreds of tests.
|
||||
|
||||
- `npm run lint`: runs the linter ([standard](http://standardjs.com/))
|
||||
- `npm run unit`: runs the unit tests
|
||||
- `npm run unit-esm`: runs tests for `fs-extra/esm` exports
|
||||
- `npm test`: runs the linter and all tests
|
||||
|
||||
When running unit tests, set the environment variable `CROSS_DEVICE_PATH` to the absolute path of an empty directory on another device (like a thumb drive) to enable cross-device move tests.
|
||||
|
||||
|
||||
### Windows
|
||||
|
||||
If you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's
|
||||
because on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's
|
||||
account by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7
|
||||
However, I didn't have much luck doing this.
|
||||
|
||||
Since I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows.
|
||||
I open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command:
|
||||
|
||||
net use z: "\\vmware-host\Shared Folders"
|
||||
|
||||
I can then navigate to my `fs-extra` directory and run the tests.
|
||||
|
||||
|
||||
Naming
|
||||
------
|
||||
|
||||
I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here:
|
||||
|
||||
* https://github.com/jprichardson/node-fs-extra/issues/2
|
||||
* https://github.com/flatiron/utile/issues/11
|
||||
* https://github.com/ryanmcgrath/wrench-js/issues/29
|
||||
* https://github.com/substack/node-mkdirp/issues/17
|
||||
|
||||
First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes.
|
||||
|
||||
For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc.
|
||||
|
||||
We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`?
|
||||
|
||||
My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too.
|
||||
|
||||
So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`.
|
||||
|
||||
|
||||
Credit
|
||||
------
|
||||
|
||||
`fs-extra` wouldn't be possible without using the modules from the following authors:
|
||||
|
||||
- [Isaac Shlueter](https://github.com/isaacs)
|
||||
- [Charlie McConnel](https://github.com/avianflu)
|
||||
- [James Halliday](https://github.com/substack)
|
||||
- [Andrew Kelley](https://github.com/andrewrk)
|
||||
|
||||
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Licensed under MIT
|
||||
|
||||
Copyright (c) 2011-2024 [JP Richardson](https://github.com/jprichardson)
|
||||
|
||||
[1]: http://nodejs.org/docs/latest/api/fs.html
|
||||
|
||||
|
||||
[jsonfile]: https://github.com/jprichardson/node-jsonfile
|
||||
171
@capacitor/cli/node_modules/fs-extra/lib/copy/copy-sync.js
generated
vendored
Normal file
171
@capacitor/cli/node_modules/fs-extra/lib/copy/copy-sync.js
generated
vendored
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
'use strict'
|
||||
|
||||
const fs = require('graceful-fs')
|
||||
const path = require('path')
|
||||
const mkdirsSync = require('../mkdirs').mkdirsSync
|
||||
const utimesMillisSync = require('../util/utimes').utimesMillisSync
|
||||
const stat = require('../util/stat')
|
||||
|
||||
function copySync (src, dest, opts) {
|
||||
if (typeof opts === 'function') {
|
||||
opts = { filter: opts }
|
||||
}
|
||||
|
||||
opts = opts || {}
|
||||
opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
|
||||
opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
|
||||
|
||||
// Warn about using preserveTimestamps on 32-bit node
|
||||
if (opts.preserveTimestamps && process.arch === 'ia32') {
|
||||
process.emitWarning(
|
||||
'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
|
||||
'\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
|
||||
'Warning', 'fs-extra-WARN0002'
|
||||
)
|
||||
}
|
||||
|
||||
const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
|
||||
stat.checkParentPathsSync(src, srcStat, dest, 'copy')
|
||||
if (opts.filter && !opts.filter(src, dest)) return
|
||||
const destParent = path.dirname(dest)
|
||||
if (!fs.existsSync(destParent)) mkdirsSync(destParent)
|
||||
return getStats(destStat, src, dest, opts)
|
||||
}
|
||||
|
||||
function getStats (destStat, src, dest, opts) {
|
||||
const statSync = opts.dereference ? fs.statSync : fs.lstatSync
|
||||
const srcStat = statSync(src)
|
||||
|
||||
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
|
||||
else if (srcStat.isFile() ||
|
||||
srcStat.isCharacterDevice() ||
|
||||
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
|
||||
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
|
||||
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
|
||||
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
|
||||
throw new Error(`Unknown file: ${src}`)
|
||||
}
|
||||
|
||||
function onFile (srcStat, destStat, src, dest, opts) {
|
||||
if (!destStat) return copyFile(srcStat, src, dest, opts)
|
||||
return mayCopyFile(srcStat, src, dest, opts)
|
||||
}
|
||||
|
||||
function mayCopyFile (srcStat, src, dest, opts) {
|
||||
if (opts.overwrite) {
|
||||
fs.unlinkSync(dest)
|
||||
return copyFile(srcStat, src, dest, opts)
|
||||
} else if (opts.errorOnExist) {
|
||||
throw new Error(`'${dest}' already exists`)
|
||||
}
|
||||
}
|
||||
|
||||
function copyFile (srcStat, src, dest, opts) {
|
||||
fs.copyFileSync(src, dest)
|
||||
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)
|
||||
return setDestMode(dest, srcStat.mode)
|
||||
}
|
||||
|
||||
function handleTimestamps (srcMode, src, dest) {
|
||||
// Make sure the file is writable before setting the timestamp
|
||||
// otherwise open fails with EPERM when invoked with 'r+'
|
||||
// (through utimes call)
|
||||
if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)
|
||||
return setDestTimestamps(src, dest)
|
||||
}
|
||||
|
||||
function fileIsNotWritable (srcMode) {
|
||||
return (srcMode & 0o200) === 0
|
||||
}
|
||||
|
||||
function makeFileWritable (dest, srcMode) {
|
||||
return setDestMode(dest, srcMode | 0o200)
|
||||
}
|
||||
|
||||
function setDestMode (dest, srcMode) {
|
||||
return fs.chmodSync(dest, srcMode)
|
||||
}
|
||||
|
||||
function setDestTimestamps (src, dest) {
|
||||
// The initial srcStat.atime cannot be trusted
|
||||
// because it is modified by the read(2) system call
|
||||
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
|
||||
const updatedSrcStat = fs.statSync(src)
|
||||
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
|
||||
}
|
||||
|
||||
function onDir (srcStat, destStat, src, dest, opts) {
|
||||
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)
|
||||
return copyDir(src, dest, opts)
|
||||
}
|
||||
|
||||
function mkDirAndCopy (srcMode, src, dest, opts) {
|
||||
fs.mkdirSync(dest)
|
||||
copyDir(src, dest, opts)
|
||||
return setDestMode(dest, srcMode)
|
||||
}
|
||||
|
||||
function copyDir (src, dest, opts) {
|
||||
const dir = fs.opendirSync(src)
|
||||
|
||||
try {
|
||||
let dirent
|
||||
|
||||
while ((dirent = dir.readSync()) !== null) {
|
||||
copyDirItem(dirent.name, src, dest, opts)
|
||||
}
|
||||
} finally {
|
||||
dir.closeSync()
|
||||
}
|
||||
}
|
||||
|
||||
function copyDirItem (item, src, dest, opts) {
|
||||
const srcItem = path.join(src, item)
|
||||
const destItem = path.join(dest, item)
|
||||
if (opts.filter && !opts.filter(srcItem, destItem)) return
|
||||
const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
|
||||
return getStats(destStat, srcItem, destItem, opts)
|
||||
}
|
||||
|
||||
function onLink (destStat, src, dest, opts) {
|
||||
let resolvedSrc = fs.readlinkSync(src)
|
||||
if (opts.dereference) {
|
||||
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
|
||||
}
|
||||
|
||||
if (!destStat) {
|
||||
return fs.symlinkSync(resolvedSrc, dest)
|
||||
} else {
|
||||
let resolvedDest
|
||||
try {
|
||||
resolvedDest = fs.readlinkSync(dest)
|
||||
} catch (err) {
|
||||
// dest exists and is a regular file or directory,
|
||||
// Windows may throw UNKNOWN error. If dest already exists,
|
||||
// fs throws error anyway, so no need to guard against it here.
|
||||
if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)
|
||||
throw err
|
||||
}
|
||||
if (opts.dereference) {
|
||||
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
||||
}
|
||||
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
||||
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
|
||||
}
|
||||
|
||||
// prevent copy if src is a subdir of dest since unlinking
|
||||
// dest in this case would result in removing src contents
|
||||
// and therefore a broken symlink would be created.
|
||||
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
||||
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
|
||||
}
|
||||
return copyLink(resolvedSrc, dest)
|
||||
}
|
||||
}
|
||||
|
||||
function copyLink (resolvedSrc, dest) {
|
||||
fs.unlinkSync(dest)
|
||||
return fs.symlinkSync(resolvedSrc, dest)
|
||||
}
|
||||
|
||||
module.exports = copySync
|
||||
182
@capacitor/cli/node_modules/fs-extra/lib/copy/copy.js
generated
vendored
Normal file
182
@capacitor/cli/node_modules/fs-extra/lib/copy/copy.js
generated
vendored
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
'use strict'
|
||||
|
||||
const fs = require('../fs')
|
||||
const path = require('path')
|
||||
const { mkdirs } = require('../mkdirs')
|
||||
const { pathExists } = require('../path-exists')
|
||||
const { utimesMillis } = require('../util/utimes')
|
||||
const stat = require('../util/stat')
|
||||
|
||||
async function copy (src, dest, opts = {}) {
|
||||
if (typeof opts === 'function') {
|
||||
opts = { filter: opts }
|
||||
}
|
||||
|
||||
opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
|
||||
opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
|
||||
|
||||
// Warn about using preserveTimestamps on 32-bit node
|
||||
if (opts.preserveTimestamps && process.arch === 'ia32') {
|
||||
process.emitWarning(
|
||||
'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
|
||||
'\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
|
||||
'Warning', 'fs-extra-WARN0001'
|
||||
)
|
||||
}
|
||||
|
||||
const { srcStat, destStat } = await stat.checkPaths(src, dest, 'copy', opts)
|
||||
|
||||
await stat.checkParentPaths(src, srcStat, dest, 'copy')
|
||||
|
||||
const include = await runFilter(src, dest, opts)
|
||||
|
||||
if (!include) return
|
||||
|
||||
// check if the parent of dest exists, and create it if it doesn't exist
|
||||
const destParent = path.dirname(dest)
|
||||
const dirExists = await pathExists(destParent)
|
||||
if (!dirExists) {
|
||||
await mkdirs(destParent)
|
||||
}
|
||||
|
||||
await getStatsAndPerformCopy(destStat, src, dest, opts)
|
||||
}
|
||||
|
||||
async function runFilter (src, dest, opts) {
|
||||
if (!opts.filter) return true
|
||||
return opts.filter(src, dest)
|
||||
}
|
||||
|
||||
async function getStatsAndPerformCopy (destStat, src, dest, opts) {
|
||||
const statFn = opts.dereference ? fs.stat : fs.lstat
|
||||
const srcStat = await statFn(src)
|
||||
|
||||
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
|
||||
|
||||
if (
|
||||
srcStat.isFile() ||
|
||||
srcStat.isCharacterDevice() ||
|
||||
srcStat.isBlockDevice()
|
||||
) return onFile(srcStat, destStat, src, dest, opts)
|
||||
|
||||
if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
|
||||
if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
|
||||
if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
|
||||
throw new Error(`Unknown file: ${src}`)
|
||||
}
|
||||
|
||||
async function onFile (srcStat, destStat, src, dest, opts) {
|
||||
if (!destStat) return copyFile(srcStat, src, dest, opts)
|
||||
|
||||
if (opts.overwrite) {
|
||||
await fs.unlink(dest)
|
||||
return copyFile(srcStat, src, dest, opts)
|
||||
}
|
||||
if (opts.errorOnExist) {
|
||||
throw new Error(`'${dest}' already exists`)
|
||||
}
|
||||
}
|
||||
|
||||
async function copyFile (srcStat, src, dest, opts) {
|
||||
await fs.copyFile(src, dest)
|
||||
if (opts.preserveTimestamps) {
|
||||
// Make sure the file is writable before setting the timestamp
|
||||
// otherwise open fails with EPERM when invoked with 'r+'
|
||||
// (through utimes call)
|
||||
if (fileIsNotWritable(srcStat.mode)) {
|
||||
await makeFileWritable(dest, srcStat.mode)
|
||||
}
|
||||
|
||||
// Set timestamps and mode correspondingly
|
||||
|
||||
// Note that The initial srcStat.atime cannot be trusted
|
||||
// because it is modified by the read(2) system call
|
||||
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
|
||||
const updatedSrcStat = await fs.stat(src)
|
||||
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
|
||||
}
|
||||
|
||||
return fs.chmod(dest, srcStat.mode)
|
||||
}
|
||||
|
||||
function fileIsNotWritable (srcMode) {
|
||||
return (srcMode & 0o200) === 0
|
||||
}
|
||||
|
||||
function makeFileWritable (dest, srcMode) {
|
||||
return fs.chmod(dest, srcMode | 0o200)
|
||||
}
|
||||
|
||||
async function onDir (srcStat, destStat, src, dest, opts) {
|
||||
// the dest directory might not exist, create it
|
||||
if (!destStat) {
|
||||
await fs.mkdir(dest)
|
||||
}
|
||||
|
||||
const promises = []
|
||||
|
||||
// loop through the files in the current directory to copy everything
|
||||
for await (const item of await fs.opendir(src)) {
|
||||
const srcItem = path.join(src, item.name)
|
||||
const destItem = path.join(dest, item.name)
|
||||
|
||||
promises.push(
|
||||
runFilter(srcItem, destItem, opts).then(include => {
|
||||
if (include) {
|
||||
// only copy the item if it matches the filter function
|
||||
return stat.checkPaths(srcItem, destItem, 'copy', opts).then(({ destStat }) => {
|
||||
// If the item is a copyable file, `getStatsAndPerformCopy` will copy it
|
||||
// If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively
|
||||
return getStatsAndPerformCopy(destStat, srcItem, destItem, opts)
|
||||
})
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
await Promise.all(promises)
|
||||
|
||||
if (!destStat) {
|
||||
await fs.chmod(dest, srcStat.mode)
|
||||
}
|
||||
}
|
||||
|
||||
async function onLink (destStat, src, dest, opts) {
|
||||
let resolvedSrc = await fs.readlink(src)
|
||||
if (opts.dereference) {
|
||||
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
|
||||
}
|
||||
if (!destStat) {
|
||||
return fs.symlink(resolvedSrc, dest)
|
||||
}
|
||||
|
||||
let resolvedDest = null
|
||||
try {
|
||||
resolvedDest = await fs.readlink(dest)
|
||||
} catch (e) {
|
||||
// dest exists and is a regular file or directory,
|
||||
// Windows may throw UNKNOWN error. If dest already exists,
|
||||
// fs throws error anyway, so no need to guard against it here.
|
||||
if (e.code === 'EINVAL' || e.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest)
|
||||
throw e
|
||||
}
|
||||
if (opts.dereference) {
|
||||
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
||||
}
|
||||
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
||||
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
|
||||
}
|
||||
|
||||
// do not copy if src is a subdir of dest since unlinking
|
||||
// dest in this case would result in removing src contents
|
||||
// and therefore a broken symlink would be created.
|
||||
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
||||
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
|
||||
}
|
||||
|
||||
// copy the link
|
||||
await fs.unlink(dest)
|
||||
return fs.symlink(resolvedSrc, dest)
|
||||
}
|
||||
|
||||
module.exports = copy
|
||||
7
@capacitor/cli/node_modules/fs-extra/lib/copy/index.js
generated
vendored
Normal file
7
@capacitor/cli/node_modules/fs-extra/lib/copy/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const u = require('universalify').fromPromise
|
||||
module.exports = {
|
||||
copy: u(require('./copy')),
|
||||
copySync: require('./copy-sync')
|
||||
}
|
||||
39
@capacitor/cli/node_modules/fs-extra/lib/empty/index.js
generated
vendored
Normal file
39
@capacitor/cli/node_modules/fs-extra/lib/empty/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
'use strict'
|
||||
|
||||
const u = require('universalify').fromPromise
|
||||
const fs = require('../fs')
|
||||
const path = require('path')
|
||||
const mkdir = require('../mkdirs')
|
||||
const remove = require('../remove')
|
||||
|
||||
const emptyDir = u(async function emptyDir (dir) {
|
||||
let items
|
||||
try {
|
||||
items = await fs.readdir(dir)
|
||||
} catch {
|
||||
return mkdir.mkdirs(dir)
|
||||
}
|
||||
|
||||
return Promise.all(items.map(item => remove.remove(path.join(dir, item))))
|
||||
})
|
||||
|
||||
function emptyDirSync (dir) {
|
||||
let items
|
||||
try {
|
||||
items = fs.readdirSync(dir)
|
||||
} catch {
|
||||
return mkdir.mkdirsSync(dir)
|
||||
}
|
||||
|
||||
items.forEach(item => {
|
||||
item = path.join(dir, item)
|
||||
remove.removeSync(item)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
emptyDirSync,
|
||||
emptydirSync: emptyDirSync,
|
||||
emptyDir,
|
||||
emptydir: emptyDir
|
||||
}
|
||||
66
@capacitor/cli/node_modules/fs-extra/lib/ensure/file.js
generated
vendored
Normal file
66
@capacitor/cli/node_modules/fs-extra/lib/ensure/file.js
generated
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
'use strict'
|
||||
|
||||
const u = require('universalify').fromPromise
|
||||
const path = require('path')
|
||||
const fs = require('../fs')
|
||||
const mkdir = require('../mkdirs')
|
||||
|
||||
async function createFile (file) {
|
||||
let stats
|
||||
try {
|
||||
stats = await fs.stat(file)
|
||||
} catch { }
|
||||
if (stats && stats.isFile()) return
|
||||
|
||||
const dir = path.dirname(file)
|
||||
|
||||
let dirStats = null
|
||||
try {
|
||||
dirStats = await fs.stat(dir)
|
||||
} catch (err) {
|
||||
// if the directory doesn't exist, make it
|
||||
if (err.code === 'ENOENT') {
|
||||
await mkdir.mkdirs(dir)
|
||||
await fs.writeFile(file, '')
|
||||
return
|
||||
} else {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
if (dirStats.isDirectory()) {
|
||||
await fs.writeFile(file, '')
|
||||
} else {
|
||||
// parent is not a directory
|
||||
// This is just to cause an internal ENOTDIR error to be thrown
|
||||
await fs.readdir(dir)
|
||||
}
|
||||
}
|
||||
|
||||
function createFileSync (file) {
|
||||
let stats
|
||||
try {
|
||||
stats = fs.statSync(file)
|
||||
} catch { }
|
||||
if (stats && stats.isFile()) return
|
||||
|
||||
const dir = path.dirname(file)
|
||||
try {
|
||||
if (!fs.statSync(dir).isDirectory()) {
|
||||
// parent is not a directory
|
||||
// This is just to cause an internal ENOTDIR error to be thrown
|
||||
fs.readdirSync(dir)
|
||||
}
|
||||
} catch (err) {
|
||||
// If the stat call above failed because the directory doesn't exist, create it
|
||||
if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)
|
||||
else throw err
|
||||
}
|
||||
|
||||
fs.writeFileSync(file, '')
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createFile: u(createFile),
|
||||
createFileSync
|
||||
}
|
||||
23
@capacitor/cli/node_modules/fs-extra/lib/ensure/index.js
generated
vendored
Normal file
23
@capacitor/cli/node_modules/fs-extra/lib/ensure/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
'use strict'
|
||||
|
||||
const { createFile, createFileSync } = require('./file')
|
||||
const { createLink, createLinkSync } = require('./link')
|
||||
const { createSymlink, createSymlinkSync } = require('./symlink')
|
||||
|
||||
module.exports = {
|
||||
// file
|
||||
createFile,
|
||||
createFileSync,
|
||||
ensureFile: createFile,
|
||||
ensureFileSync: createFileSync,
|
||||
// link
|
||||
createLink,
|
||||
createLinkSync,
|
||||
ensureLink: createLink,
|
||||
ensureLinkSync: createLinkSync,
|
||||
// symlink
|
||||
createSymlink,
|
||||
createSymlinkSync,
|
||||
ensureSymlink: createSymlink,
|
||||
ensureSymlinkSync: createSymlinkSync
|
||||
}
|
||||
64
@capacitor/cli/node_modules/fs-extra/lib/ensure/link.js
generated
vendored
Normal file
64
@capacitor/cli/node_modules/fs-extra/lib/ensure/link.js
generated
vendored
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
'use strict'
|
||||
|
||||
const u = require('universalify').fromPromise
|
||||
const path = require('path')
|
||||
const fs = require('../fs')
|
||||
const mkdir = require('../mkdirs')
|
||||
const { pathExists } = require('../path-exists')
|
||||
const { areIdentical } = require('../util/stat')
|
||||
|
||||
async function createLink (srcpath, dstpath) {
|
||||
let dstStat
|
||||
try {
|
||||
dstStat = await fs.lstat(dstpath)
|
||||
} catch {
|
||||
// ignore error
|
||||
}
|
||||
|
||||
let srcStat
|
||||
try {
|
||||
srcStat = await fs.lstat(srcpath)
|
||||
} catch (err) {
|
||||
err.message = err.message.replace('lstat', 'ensureLink')
|
||||
throw err
|
||||
}
|
||||
|
||||
if (dstStat && areIdentical(srcStat, dstStat)) return
|
||||
|
||||
const dir = path.dirname(dstpath)
|
||||
|
||||
const dirExists = await pathExists(dir)
|
||||
|
||||
if (!dirExists) {
|
||||
await mkdir.mkdirs(dir)
|
||||
}
|
||||
|
||||
await fs.link(srcpath, dstpath)
|
||||
}
|
||||
|
||||
function createLinkSync (srcpath, dstpath) {
|
||||
let dstStat
|
||||
try {
|
||||
dstStat = fs.lstatSync(dstpath)
|
||||
} catch {}
|
||||
|
||||
try {
|
||||
const srcStat = fs.lstatSync(srcpath)
|
||||
if (dstStat && areIdentical(srcStat, dstStat)) return
|
||||
} catch (err) {
|
||||
err.message = err.message.replace('lstat', 'ensureLink')
|
||||
throw err
|
||||
}
|
||||
|
||||
const dir = path.dirname(dstpath)
|
||||
const dirExists = fs.existsSync(dir)
|
||||
if (dirExists) return fs.linkSync(srcpath, dstpath)
|
||||
mkdir.mkdirsSync(dir)
|
||||
|
||||
return fs.linkSync(srcpath, dstpath)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createLink: u(createLink),
|
||||
createLinkSync
|
||||
}
|
||||
101
@capacitor/cli/node_modules/fs-extra/lib/ensure/symlink-paths.js
generated
vendored
Normal file
101
@capacitor/cli/node_modules/fs-extra/lib/ensure/symlink-paths.js
generated
vendored
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const fs = require('../fs')
|
||||
const { pathExists } = require('../path-exists')
|
||||
|
||||
const u = require('universalify').fromPromise
|
||||
|
||||
/**
|
||||
* Function that returns two types of paths, one relative to symlink, and one
|
||||
* relative to the current working directory. Checks if path is absolute or
|
||||
* relative. If the path is relative, this function checks if the path is
|
||||
* relative to symlink or relative to current working directory. This is an
|
||||
* initiative to find a smarter `srcpath` to supply when building symlinks.
|
||||
* This allows you to determine which path to use out of one of three possible
|
||||
* types of source paths. The first is an absolute path. This is detected by
|
||||
* `path.isAbsolute()`. When an absolute path is provided, it is checked to
|
||||
* see if it exists. If it does it's used, if not an error is returned
|
||||
* (callback)/ thrown (sync). The other two options for `srcpath` are a
|
||||
* relative url. By default Node's `fs.symlink` works by creating a symlink
|
||||
* using `dstpath` and expects the `srcpath` to be relative to the newly
|
||||
* created symlink. If you provide a `srcpath` that does not exist on the file
|
||||
* system it results in a broken symlink. To minimize this, the function
|
||||
* checks to see if the 'relative to symlink' source file exists, and if it
|
||||
* does it will use it. If it does not, it checks if there's a file that
|
||||
* exists that is relative to the current working directory, if does its used.
|
||||
* This preserves the expectations of the original fs.symlink spec and adds
|
||||
* the ability to pass in `relative to current working direcotry` paths.
|
||||
*/
|
||||
|
||||
async function symlinkPaths (srcpath, dstpath) {
|
||||
if (path.isAbsolute(srcpath)) {
|
||||
try {
|
||||
await fs.lstat(srcpath)
|
||||
} catch (err) {
|
||||
err.message = err.message.replace('lstat', 'ensureSymlink')
|
||||
throw err
|
||||
}
|
||||
|
||||
return {
|
||||
toCwd: srcpath,
|
||||
toDst: srcpath
|
||||
}
|
||||
}
|
||||
|
||||
const dstdir = path.dirname(dstpath)
|
||||
const relativeToDst = path.join(dstdir, srcpath)
|
||||
|
||||
const exists = await pathExists(relativeToDst)
|
||||
if (exists) {
|
||||
return {
|
||||
toCwd: relativeToDst,
|
||||
toDst: srcpath
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await fs.lstat(srcpath)
|
||||
} catch (err) {
|
||||
err.message = err.message.replace('lstat', 'ensureSymlink')
|
||||
throw err
|
||||
}
|
||||
|
||||
return {
|
||||
toCwd: srcpath,
|
||||
toDst: path.relative(dstdir, srcpath)
|
||||
}
|
||||
}
|
||||
|
||||
function symlinkPathsSync (srcpath, dstpath) {
|
||||
if (path.isAbsolute(srcpath)) {
|
||||
const exists = fs.existsSync(srcpath)
|
||||
if (!exists) throw new Error('absolute srcpath does not exist')
|
||||
return {
|
||||
toCwd: srcpath,
|
||||
toDst: srcpath
|
||||
}
|
||||
}
|
||||
|
||||
const dstdir = path.dirname(dstpath)
|
||||
const relativeToDst = path.join(dstdir, srcpath)
|
||||
const exists = fs.existsSync(relativeToDst)
|
||||
if (exists) {
|
||||
return {
|
||||
toCwd: relativeToDst,
|
||||
toDst: srcpath
|
||||
}
|
||||
}
|
||||
|
||||
const srcExists = fs.existsSync(srcpath)
|
||||
if (!srcExists) throw new Error('relative srcpath does not exist')
|
||||
return {
|
||||
toCwd: srcpath,
|
||||
toDst: path.relative(dstdir, srcpath)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
symlinkPaths: u(symlinkPaths),
|
||||
symlinkPathsSync
|
||||
}
|
||||
34
@capacitor/cli/node_modules/fs-extra/lib/ensure/symlink-type.js
generated
vendored
Normal file
34
@capacitor/cli/node_modules/fs-extra/lib/ensure/symlink-type.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
'use strict'
|
||||
|
||||
const fs = require('../fs')
|
||||
const u = require('universalify').fromPromise
|
||||
|
||||
async function symlinkType (srcpath, type) {
|
||||
if (type) return type
|
||||
|
||||
let stats
|
||||
try {
|
||||
stats = await fs.lstat(srcpath)
|
||||
} catch {
|
||||
return 'file'
|
||||
}
|
||||
|
||||
return (stats && stats.isDirectory()) ? 'dir' : 'file'
|
||||
}
|
||||
|
||||
function symlinkTypeSync (srcpath, type) {
|
||||
if (type) return type
|
||||
|
||||
let stats
|
||||
try {
|
||||
stats = fs.lstatSync(srcpath)
|
||||
} catch {
|
||||
return 'file'
|
||||
}
|
||||
return (stats && stats.isDirectory()) ? 'dir' : 'file'
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
symlinkType: u(symlinkType),
|
||||
symlinkTypeSync
|
||||
}
|
||||
67
@capacitor/cli/node_modules/fs-extra/lib/ensure/symlink.js
generated
vendored
Normal file
67
@capacitor/cli/node_modules/fs-extra/lib/ensure/symlink.js
generated
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
'use strict'
|
||||
|
||||
const u = require('universalify').fromPromise
|
||||
const path = require('path')
|
||||
const fs = require('../fs')
|
||||
|
||||
const { mkdirs, mkdirsSync } = require('../mkdirs')
|
||||
|
||||
const { symlinkPaths, symlinkPathsSync } = require('./symlink-paths')
|
||||
const { symlinkType, symlinkTypeSync } = require('./symlink-type')
|
||||
|
||||
const { pathExists } = require('../path-exists')
|
||||
|
||||
const { areIdentical } = require('../util/stat')
|
||||
|
||||
async function createSymlink (srcpath, dstpath, type) {
|
||||
let stats
|
||||
try {
|
||||
stats = await fs.lstat(dstpath)
|
||||
} catch { }
|
||||
|
||||
if (stats && stats.isSymbolicLink()) {
|
||||
const [srcStat, dstStat] = await Promise.all([
|
||||
fs.stat(srcpath),
|
||||
fs.stat(dstpath)
|
||||
])
|
||||
|
||||
if (areIdentical(srcStat, dstStat)) return
|
||||
}
|
||||
|
||||
const relative = await symlinkPaths(srcpath, dstpath)
|
||||
srcpath = relative.toDst
|
||||
const toType = await symlinkType(relative.toCwd, type)
|
||||
const dir = path.dirname(dstpath)
|
||||
|
||||
if (!(await pathExists(dir))) {
|
||||
await mkdirs(dir)
|
||||
}
|
||||
|
||||
return fs.symlink(srcpath, dstpath, toType)
|
||||
}
|
||||
|
||||
function createSymlinkSync (srcpath, dstpath, type) {
|
||||
let stats
|
||||
try {
|
||||
stats = fs.lstatSync(dstpath)
|
||||
} catch { }
|
||||
if (stats && stats.isSymbolicLink()) {
|
||||
const srcStat = fs.statSync(srcpath)
|
||||
const dstStat = fs.statSync(dstpath)
|
||||
if (areIdentical(srcStat, dstStat)) return
|
||||
}
|
||||
|
||||
const relative = symlinkPathsSync(srcpath, dstpath)
|
||||
srcpath = relative.toDst
|
||||
type = symlinkTypeSync(relative.toCwd, type)
|
||||
const dir = path.dirname(dstpath)
|
||||
const exists = fs.existsSync(dir)
|
||||
if (exists) return fs.symlinkSync(srcpath, dstpath, type)
|
||||
mkdirsSync(dir)
|
||||
return fs.symlinkSync(srcpath, dstpath, type)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createSymlink: u(createSymlink),
|
||||
createSymlinkSync
|
||||
}
|
||||
68
@capacitor/cli/node_modules/fs-extra/lib/esm.mjs
generated
vendored
Normal file
68
@capacitor/cli/node_modules/fs-extra/lib/esm.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
import _copy from './copy/index.js'
|
||||
import _empty from './empty/index.js'
|
||||
import _ensure from './ensure/index.js'
|
||||
import _json from './json/index.js'
|
||||
import _mkdirs from './mkdirs/index.js'
|
||||
import _move from './move/index.js'
|
||||
import _outputFile from './output-file/index.js'
|
||||
import _pathExists from './path-exists/index.js'
|
||||
import _remove from './remove/index.js'
|
||||
|
||||
// NOTE: Only exports fs-extra's functions; fs functions must be imported from "node:fs" or "node:fs/promises"
|
||||
|
||||
export const copy = _copy.copy
|
||||
export const copySync = _copy.copySync
|
||||
export const emptyDirSync = _empty.emptyDirSync
|
||||
export const emptydirSync = _empty.emptydirSync
|
||||
export const emptyDir = _empty.emptyDir
|
||||
export const emptydir = _empty.emptydir
|
||||
export const createFile = _ensure.createFile
|
||||
export const createFileSync = _ensure.createFileSync
|
||||
export const ensureFile = _ensure.ensureFile
|
||||
export const ensureFileSync = _ensure.ensureFileSync
|
||||
export const createLink = _ensure.createLink
|
||||
export const createLinkSync = _ensure.createLinkSync
|
||||
export const ensureLink = _ensure.ensureLink
|
||||
export const ensureLinkSync = _ensure.ensureLinkSync
|
||||
export const createSymlink = _ensure.createSymlink
|
||||
export const createSymlinkSync = _ensure.createSymlinkSync
|
||||
export const ensureSymlink = _ensure.ensureSymlink
|
||||
export const ensureSymlinkSync = _ensure.ensureSymlinkSync
|
||||
export const readJson = _json.readJson
|
||||
export const readJSON = _json.readJSON
|
||||
export const readJsonSync = _json.readJsonSync
|
||||
export const readJSONSync = _json.readJSONSync
|
||||
export const writeJson = _json.writeJson
|
||||
export const writeJSON = _json.writeJSON
|
||||
export const writeJsonSync = _json.writeJsonSync
|
||||
export const writeJSONSync = _json.writeJSONSync
|
||||
export const outputJson = _json.outputJson
|
||||
export const outputJSON = _json.outputJSON
|
||||
export const outputJsonSync = _json.outputJsonSync
|
||||
export const outputJSONSync = _json.outputJSONSync
|
||||
export const mkdirs = _mkdirs.mkdirs
|
||||
export const mkdirsSync = _mkdirs.mkdirsSync
|
||||
export const mkdirp = _mkdirs.mkdirp
|
||||
export const mkdirpSync = _mkdirs.mkdirpSync
|
||||
export const ensureDir = _mkdirs.ensureDir
|
||||
export const ensureDirSync = _mkdirs.ensureDirSync
|
||||
export const move = _move.move
|
||||
export const moveSync = _move.moveSync
|
||||
export const outputFile = _outputFile.outputFile
|
||||
export const outputFileSync = _outputFile.outputFileSync
|
||||
export const pathExists = _pathExists.pathExists
|
||||
export const pathExistsSync = _pathExists.pathExistsSync
|
||||
export const remove = _remove.remove
|
||||
export const removeSync = _remove.removeSync
|
||||
|
||||
export default {
|
||||
..._copy,
|
||||
..._empty,
|
||||
..._ensure,
|
||||
..._json,
|
||||
..._mkdirs,
|
||||
..._move,
|
||||
..._outputFile,
|
||||
..._pathExists,
|
||||
..._remove
|
||||
}
|
||||
146
@capacitor/cli/node_modules/fs-extra/lib/fs/index.js
generated
vendored
Normal file
146
@capacitor/cli/node_modules/fs-extra/lib/fs/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
'use strict'
|
||||
// This is adapted from https://github.com/normalize/mz
|
||||
// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
|
||||
const u = require('universalify').fromCallback
|
||||
const fs = require('graceful-fs')
|
||||
|
||||
const api = [
|
||||
'access',
|
||||
'appendFile',
|
||||
'chmod',
|
||||
'chown',
|
||||
'close',
|
||||
'copyFile',
|
||||
'cp',
|
||||
'fchmod',
|
||||
'fchown',
|
||||
'fdatasync',
|
||||
'fstat',
|
||||
'fsync',
|
||||
'ftruncate',
|
||||
'futimes',
|
||||
'glob',
|
||||
'lchmod',
|
||||
'lchown',
|
||||
'lutimes',
|
||||
'link',
|
||||
'lstat',
|
||||
'mkdir',
|
||||
'mkdtemp',
|
||||
'open',
|
||||
'opendir',
|
||||
'readdir',
|
||||
'readFile',
|
||||
'readlink',
|
||||
'realpath',
|
||||
'rename',
|
||||
'rm',
|
||||
'rmdir',
|
||||
'stat',
|
||||
'statfs',
|
||||
'symlink',
|
||||
'truncate',
|
||||
'unlink',
|
||||
'utimes',
|
||||
'writeFile'
|
||||
].filter(key => {
|
||||
// Some commands are not available on some systems. Ex:
|
||||
// fs.cp was added in Node.js v16.7.0
|
||||
// fs.statfs was added in Node v19.6.0, v18.15.0
|
||||
// fs.glob was added in Node.js v22.0.0
|
||||
// fs.lchown is not available on at least some Linux
|
||||
return typeof fs[key] === 'function'
|
||||
})
|
||||
|
||||
// Export cloned fs:
|
||||
Object.assign(exports, fs)
|
||||
|
||||
// Universalify async methods:
|
||||
api.forEach(method => {
|
||||
exports[method] = u(fs[method])
|
||||
})
|
||||
|
||||
// We differ from mz/fs in that we still ship the old, broken, fs.exists()
|
||||
// since we are a drop-in replacement for the native module
|
||||
exports.exists = function (filename, callback) {
|
||||
if (typeof callback === 'function') {
|
||||
return fs.exists(filename, callback)
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
return fs.exists(filename, resolve)
|
||||
})
|
||||
}
|
||||
|
||||
// fs.read(), fs.write(), fs.readv(), & fs.writev() need special treatment due to multiple callback args
|
||||
|
||||
exports.read = function (fd, buffer, offset, length, position, callback) {
|
||||
if (typeof callback === 'function') {
|
||||
return fs.read(fd, buffer, offset, length, position, callback)
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
|
||||
if (err) return reject(err)
|
||||
resolve({ bytesRead, buffer })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Function signature can be
|
||||
// fs.write(fd, buffer[, offset[, length[, position]]], callback)
|
||||
// OR
|
||||
// fs.write(fd, string[, position[, encoding]], callback)
|
||||
// We need to handle both cases, so we use ...args
|
||||
exports.write = function (fd, buffer, ...args) {
|
||||
if (typeof args[args.length - 1] === 'function') {
|
||||
return fs.write(fd, buffer, ...args)
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {
|
||||
if (err) return reject(err)
|
||||
resolve({ bytesWritten, buffer })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Function signature is
|
||||
// s.readv(fd, buffers[, position], callback)
|
||||
// We need to handle the optional arg, so we use ...args
|
||||
exports.readv = function (fd, buffers, ...args) {
|
||||
if (typeof args[args.length - 1] === 'function') {
|
||||
return fs.readv(fd, buffers, ...args)
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => {
|
||||
if (err) return reject(err)
|
||||
resolve({ bytesRead, buffers })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Function signature is
|
||||
// s.writev(fd, buffers[, position], callback)
|
||||
// We need to handle the optional arg, so we use ...args
|
||||
exports.writev = function (fd, buffers, ...args) {
|
||||
if (typeof args[args.length - 1] === 'function') {
|
||||
return fs.writev(fd, buffers, ...args)
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
|
||||
if (err) return reject(err)
|
||||
resolve({ bytesWritten, buffers })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// fs.realpath.native sometimes not available if fs is monkey-patched
|
||||
if (typeof fs.realpath.native === 'function') {
|
||||
exports.realpath.native = u(fs.realpath.native)
|
||||
} else {
|
||||
process.emitWarning(
|
||||
'fs.realpath.native is not a function. Is fs being monkey-patched?',
|
||||
'Warning', 'fs-extra-WARN0003'
|
||||
)
|
||||
}
|
||||
16
@capacitor/cli/node_modules/fs-extra/lib/index.js
generated
vendored
Normal file
16
@capacitor/cli/node_modules/fs-extra/lib/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
// Export promiseified graceful-fs:
|
||||
...require('./fs'),
|
||||
// Export extra methods:
|
||||
...require('./copy'),
|
||||
...require('./empty'),
|
||||
...require('./ensure'),
|
||||
...require('./json'),
|
||||
...require('./mkdirs'),
|
||||
...require('./move'),
|
||||
...require('./output-file'),
|
||||
...require('./path-exists'),
|
||||
...require('./remove')
|
||||
}
|
||||
16
@capacitor/cli/node_modules/fs-extra/lib/json/index.js
generated
vendored
Normal file
16
@capacitor/cli/node_modules/fs-extra/lib/json/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
'use strict'
|
||||
|
||||
const u = require('universalify').fromPromise
|
||||
const jsonFile = require('./jsonfile')
|
||||
|
||||
jsonFile.outputJson = u(require('./output-json'))
|
||||
jsonFile.outputJsonSync = require('./output-json-sync')
|
||||
// aliases
|
||||
jsonFile.outputJSON = jsonFile.outputJson
|
||||
jsonFile.outputJSONSync = jsonFile.outputJsonSync
|
||||
jsonFile.writeJSON = jsonFile.writeJson
|
||||
jsonFile.writeJSONSync = jsonFile.writeJsonSync
|
||||
jsonFile.readJSON = jsonFile.readJson
|
||||
jsonFile.readJSONSync = jsonFile.readJsonSync
|
||||
|
||||
module.exports = jsonFile
|
||||
11
@capacitor/cli/node_modules/fs-extra/lib/json/jsonfile.js
generated
vendored
Normal file
11
@capacitor/cli/node_modules/fs-extra/lib/json/jsonfile.js
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
'use strict'
|
||||
|
||||
const jsonFile = require('jsonfile')
|
||||
|
||||
module.exports = {
|
||||
// jsonfile exports
|
||||
readJson: jsonFile.readFile,
|
||||
readJsonSync: jsonFile.readFileSync,
|
||||
writeJson: jsonFile.writeFile,
|
||||
writeJsonSync: jsonFile.writeFileSync
|
||||
}
|
||||
12
@capacitor/cli/node_modules/fs-extra/lib/json/output-json-sync.js
generated
vendored
Normal file
12
@capacitor/cli/node_modules/fs-extra/lib/json/output-json-sync.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
'use strict'
|
||||
|
||||
const { stringify } = require('jsonfile/utils')
|
||||
const { outputFileSync } = require('../output-file')
|
||||
|
||||
function outputJsonSync (file, data, options) {
|
||||
const str = stringify(data, options)
|
||||
|
||||
outputFileSync(file, str, options)
|
||||
}
|
||||
|
||||
module.exports = outputJsonSync
|
||||
12
@capacitor/cli/node_modules/fs-extra/lib/json/output-json.js
generated
vendored
Normal file
12
@capacitor/cli/node_modules/fs-extra/lib/json/output-json.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
'use strict'
|
||||
|
||||
const { stringify } = require('jsonfile/utils')
|
||||
const { outputFile } = require('../output-file')
|
||||
|
||||
async function outputJson (file, data, options = {}) {
|
||||
const str = stringify(data, options)
|
||||
|
||||
await outputFile(file, str, options)
|
||||
}
|
||||
|
||||
module.exports = outputJson
|
||||
14
@capacitor/cli/node_modules/fs-extra/lib/mkdirs/index.js
generated
vendored
Normal file
14
@capacitor/cli/node_modules/fs-extra/lib/mkdirs/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
'use strict'
|
||||
const u = require('universalify').fromPromise
|
||||
const { makeDir: _makeDir, makeDirSync } = require('./make-dir')
|
||||
const makeDir = u(_makeDir)
|
||||
|
||||
module.exports = {
|
||||
mkdirs: makeDir,
|
||||
mkdirsSync: makeDirSync,
|
||||
// alias
|
||||
mkdirp: makeDir,
|
||||
mkdirpSync: makeDirSync,
|
||||
ensureDir: makeDir,
|
||||
ensureDirSync: makeDirSync
|
||||
}
|
||||
27
@capacitor/cli/node_modules/fs-extra/lib/mkdirs/make-dir.js
generated
vendored
Normal file
27
@capacitor/cli/node_modules/fs-extra/lib/mkdirs/make-dir.js
generated
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
'use strict'
|
||||
const fs = require('../fs')
|
||||
const { checkPath } = require('./utils')
|
||||
|
||||
const getMode = options => {
|
||||
const defaults = { mode: 0o777 }
|
||||
if (typeof options === 'number') return options
|
||||
return ({ ...defaults, ...options }).mode
|
||||
}
|
||||
|
||||
module.exports.makeDir = async (dir, options) => {
|
||||
checkPath(dir)
|
||||
|
||||
return fs.mkdir(dir, {
|
||||
mode: getMode(options),
|
||||
recursive: true
|
||||
})
|
||||
}
|
||||
|
||||
module.exports.makeDirSync = (dir, options) => {
|
||||
checkPath(dir)
|
||||
|
||||
return fs.mkdirSync(dir, {
|
||||
mode: getMode(options),
|
||||
recursive: true
|
||||
})
|
||||
}
|
||||
21
@capacitor/cli/node_modules/fs-extra/lib/mkdirs/utils.js
generated
vendored
Normal file
21
@capacitor/cli/node_modules/fs-extra/lib/mkdirs/utils.js
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Adapted from https://github.com/sindresorhus/make-dir
|
||||
// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
// 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.
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
|
||||
// https://github.com/nodejs/node/issues/8987
|
||||
// https://github.com/libuv/libuv/pull/1088
|
||||
module.exports.checkPath = function checkPath (pth) {
|
||||
if (process.platform === 'win32') {
|
||||
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''))
|
||||
|
||||
if (pathHasInvalidWinCharacters) {
|
||||
const error = new Error(`Path contains invalid characters: ${pth}`)
|
||||
error.code = 'EINVAL'
|
||||
throw error
|
||||
}
|
||||
}
|
||||
}
|
||||
7
@capacitor/cli/node_modules/fs-extra/lib/move/index.js
generated
vendored
Normal file
7
@capacitor/cli/node_modules/fs-extra/lib/move/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const u = require('universalify').fromPromise
|
||||
module.exports = {
|
||||
move: u(require('./move')),
|
||||
moveSync: require('./move-sync')
|
||||
}
|
||||
55
@capacitor/cli/node_modules/fs-extra/lib/move/move-sync.js
generated
vendored
Normal file
55
@capacitor/cli/node_modules/fs-extra/lib/move/move-sync.js
generated
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
'use strict'
|
||||
|
||||
const fs = require('graceful-fs')
|
||||
const path = require('path')
|
||||
const copySync = require('../copy').copySync
|
||||
const removeSync = require('../remove').removeSync
|
||||
const mkdirpSync = require('../mkdirs').mkdirpSync
|
||||
const stat = require('../util/stat')
|
||||
|
||||
function moveSync (src, dest, opts) {
|
||||
opts = opts || {}
|
||||
const overwrite = opts.overwrite || opts.clobber || false
|
||||
|
||||
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)
|
||||
stat.checkParentPathsSync(src, srcStat, dest, 'move')
|
||||
if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))
|
||||
return doRename(src, dest, overwrite, isChangingCase)
|
||||
}
|
||||
|
||||
function isParentRoot (dest) {
|
||||
const parent = path.dirname(dest)
|
||||
const parsedPath = path.parse(parent)
|
||||
return parsedPath.root === parent
|
||||
}
|
||||
|
||||
function doRename (src, dest, overwrite, isChangingCase) {
|
||||
if (isChangingCase) return rename(src, dest, overwrite)
|
||||
if (overwrite) {
|
||||
removeSync(dest)
|
||||
return rename(src, dest, overwrite)
|
||||
}
|
||||
if (fs.existsSync(dest)) throw new Error('dest already exists.')
|
||||
return rename(src, dest, overwrite)
|
||||
}
|
||||
|
||||
function rename (src, dest, overwrite) {
|
||||
try {
|
||||
fs.renameSync(src, dest)
|
||||
} catch (err) {
|
||||
if (err.code !== 'EXDEV') throw err
|
||||
return moveAcrossDevice(src, dest, overwrite)
|
||||
}
|
||||
}
|
||||
|
||||
function moveAcrossDevice (src, dest, overwrite) {
|
||||
const opts = {
|
||||
overwrite,
|
||||
errorOnExist: true,
|
||||
preserveTimestamps: true
|
||||
}
|
||||
copySync(src, dest, opts)
|
||||
return removeSync(src)
|
||||
}
|
||||
|
||||
module.exports = moveSync
|
||||
59
@capacitor/cli/node_modules/fs-extra/lib/move/move.js
generated
vendored
Normal file
59
@capacitor/cli/node_modules/fs-extra/lib/move/move.js
generated
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
'use strict'
|
||||
|
||||
const fs = require('../fs')
|
||||
const path = require('path')
|
||||
const { copy } = require('../copy')
|
||||
const { remove } = require('../remove')
|
||||
const { mkdirp } = require('../mkdirs')
|
||||
const { pathExists } = require('../path-exists')
|
||||
const stat = require('../util/stat')
|
||||
|
||||
async function move (src, dest, opts = {}) {
|
||||
const overwrite = opts.overwrite || opts.clobber || false
|
||||
|
||||
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, 'move', opts)
|
||||
|
||||
await stat.checkParentPaths(src, srcStat, dest, 'move')
|
||||
|
||||
// If the parent of dest is not root, make sure it exists before proceeding
|
||||
const destParent = path.dirname(dest)
|
||||
const parsedParentPath = path.parse(destParent)
|
||||
if (parsedParentPath.root !== destParent) {
|
||||
await mkdirp(destParent)
|
||||
}
|
||||
|
||||
return doRename(src, dest, overwrite, isChangingCase)
|
||||
}
|
||||
|
||||
async function doRename (src, dest, overwrite, isChangingCase) {
|
||||
if (!isChangingCase) {
|
||||
if (overwrite) {
|
||||
await remove(dest)
|
||||
} else if (await pathExists(dest)) {
|
||||
throw new Error('dest already exists.')
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// Try w/ rename first, and try copy + remove if EXDEV
|
||||
await fs.rename(src, dest)
|
||||
} catch (err) {
|
||||
if (err.code !== 'EXDEV') {
|
||||
throw err
|
||||
}
|
||||
await moveAcrossDevice(src, dest, overwrite)
|
||||
}
|
||||
}
|
||||
|
||||
async function moveAcrossDevice (src, dest, overwrite) {
|
||||
const opts = {
|
||||
overwrite,
|
||||
errorOnExist: true,
|
||||
preserveTimestamps: true
|
||||
}
|
||||
|
||||
await copy(src, dest, opts)
|
||||
return remove(src)
|
||||
}
|
||||
|
||||
module.exports = move
|
||||
31
@capacitor/cli/node_modules/fs-extra/lib/output-file/index.js
generated
vendored
Normal file
31
@capacitor/cli/node_modules/fs-extra/lib/output-file/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
'use strict'
|
||||
|
||||
const u = require('universalify').fromPromise
|
||||
const fs = require('../fs')
|
||||
const path = require('path')
|
||||
const mkdir = require('../mkdirs')
|
||||
const pathExists = require('../path-exists').pathExists
|
||||
|
||||
async function outputFile (file, data, encoding = 'utf-8') {
|
||||
const dir = path.dirname(file)
|
||||
|
||||
if (!(await pathExists(dir))) {
|
||||
await mkdir.mkdirs(dir)
|
||||
}
|
||||
|
||||
return fs.writeFile(file, data, encoding)
|
||||
}
|
||||
|
||||
function outputFileSync (file, ...args) {
|
||||
const dir = path.dirname(file)
|
||||
if (!fs.existsSync(dir)) {
|
||||
mkdir.mkdirsSync(dir)
|
||||
}
|
||||
|
||||
fs.writeFileSync(file, ...args)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
outputFile: u(outputFile),
|
||||
outputFileSync
|
||||
}
|
||||
12
@capacitor/cli/node_modules/fs-extra/lib/path-exists/index.js
generated
vendored
Normal file
12
@capacitor/cli/node_modules/fs-extra/lib/path-exists/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
'use strict'
|
||||
const u = require('universalify').fromPromise
|
||||
const fs = require('../fs')
|
||||
|
||||
function pathExists (path) {
|
||||
return fs.access(path).then(() => true).catch(() => false)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
pathExists: u(pathExists),
|
||||
pathExistsSync: fs.existsSync
|
||||
}
|
||||
17
@capacitor/cli/node_modules/fs-extra/lib/remove/index.js
generated
vendored
Normal file
17
@capacitor/cli/node_modules/fs-extra/lib/remove/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
'use strict'
|
||||
|
||||
const fs = require('graceful-fs')
|
||||
const u = require('universalify').fromCallback
|
||||
|
||||
function remove (path, callback) {
|
||||
fs.rm(path, { recursive: true, force: true }, callback)
|
||||
}
|
||||
|
||||
function removeSync (path) {
|
||||
fs.rmSync(path, { recursive: true, force: true })
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
remove: u(remove),
|
||||
removeSync
|
||||
}
|
||||
158
@capacitor/cli/node_modules/fs-extra/lib/util/stat.js
generated
vendored
Normal file
158
@capacitor/cli/node_modules/fs-extra/lib/util/stat.js
generated
vendored
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
'use strict'
|
||||
|
||||
const fs = require('../fs')
|
||||
const path = require('path')
|
||||
const u = require('universalify').fromPromise
|
||||
|
||||
function getStats (src, dest, opts) {
|
||||
const statFunc = opts.dereference
|
||||
? (file) => fs.stat(file, { bigint: true })
|
||||
: (file) => fs.lstat(file, { bigint: true })
|
||||
return Promise.all([
|
||||
statFunc(src),
|
||||
statFunc(dest).catch(err => {
|
||||
if (err.code === 'ENOENT') return null
|
||||
throw err
|
||||
})
|
||||
]).then(([srcStat, destStat]) => ({ srcStat, destStat }))
|
||||
}
|
||||
|
||||
function getStatsSync (src, dest, opts) {
|
||||
let destStat
|
||||
const statFunc = opts.dereference
|
||||
? (file) => fs.statSync(file, { bigint: true })
|
||||
: (file) => fs.lstatSync(file, { bigint: true })
|
||||
const srcStat = statFunc(src)
|
||||
try {
|
||||
destStat = statFunc(dest)
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') return { srcStat, destStat: null }
|
||||
throw err
|
||||
}
|
||||
return { srcStat, destStat }
|
||||
}
|
||||
|
||||
async function checkPaths (src, dest, funcName, opts) {
|
||||
const { srcStat, destStat } = await getStats(src, dest, opts)
|
||||
if (destStat) {
|
||||
if (areIdentical(srcStat, destStat)) {
|
||||
const srcBaseName = path.basename(src)
|
||||
const destBaseName = path.basename(dest)
|
||||
if (funcName === 'move' &&
|
||||
srcBaseName !== destBaseName &&
|
||||
srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
||||
return { srcStat, destStat, isChangingCase: true }
|
||||
}
|
||||
throw new Error('Source and destination must not be the same.')
|
||||
}
|
||||
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
||||
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
|
||||
}
|
||||
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
||||
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)
|
||||
}
|
||||
}
|
||||
|
||||
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
||||
throw new Error(errMsg(src, dest, funcName))
|
||||
}
|
||||
|
||||
return { srcStat, destStat }
|
||||
}
|
||||
|
||||
function checkPathsSync (src, dest, funcName, opts) {
|
||||
const { srcStat, destStat } = getStatsSync(src, dest, opts)
|
||||
|
||||
if (destStat) {
|
||||
if (areIdentical(srcStat, destStat)) {
|
||||
const srcBaseName = path.basename(src)
|
||||
const destBaseName = path.basename(dest)
|
||||
if (funcName === 'move' &&
|
||||
srcBaseName !== destBaseName &&
|
||||
srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
||||
return { srcStat, destStat, isChangingCase: true }
|
||||
}
|
||||
throw new Error('Source and destination must not be the same.')
|
||||
}
|
||||
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
||||
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
|
||||
}
|
||||
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
||||
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)
|
||||
}
|
||||
}
|
||||
|
||||
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
||||
throw new Error(errMsg(src, dest, funcName))
|
||||
}
|
||||
return { srcStat, destStat }
|
||||
}
|
||||
|
||||
// recursively check if dest parent is a subdirectory of src.
|
||||
// It works for all file types including symlinks since it
|
||||
// checks the src and dest inodes. It starts from the deepest
|
||||
// parent and stops once it reaches the src parent or the root path.
|
||||
async function checkParentPaths (src, srcStat, dest, funcName) {
|
||||
const srcParent = path.resolve(path.dirname(src))
|
||||
const destParent = path.resolve(path.dirname(dest))
|
||||
if (destParent === srcParent || destParent === path.parse(destParent).root) return
|
||||
|
||||
let destStat
|
||||
try {
|
||||
destStat = await fs.stat(destParent, { bigint: true })
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') return
|
||||
throw err
|
||||
}
|
||||
|
||||
if (areIdentical(srcStat, destStat)) {
|
||||
throw new Error(errMsg(src, dest, funcName))
|
||||
}
|
||||
|
||||
return checkParentPaths(src, srcStat, destParent, funcName)
|
||||
}
|
||||
|
||||
function checkParentPathsSync (src, srcStat, dest, funcName) {
|
||||
const srcParent = path.resolve(path.dirname(src))
|
||||
const destParent = path.resolve(path.dirname(dest))
|
||||
if (destParent === srcParent || destParent === path.parse(destParent).root) return
|
||||
let destStat
|
||||
try {
|
||||
destStat = fs.statSync(destParent, { bigint: true })
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') return
|
||||
throw err
|
||||
}
|
||||
if (areIdentical(srcStat, destStat)) {
|
||||
throw new Error(errMsg(src, dest, funcName))
|
||||
}
|
||||
return checkParentPathsSync(src, srcStat, destParent, funcName)
|
||||
}
|
||||
|
||||
function areIdentical (srcStat, destStat) {
|
||||
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev
|
||||
}
|
||||
|
||||
// return true if dest is a subdir of src, otherwise false.
|
||||
// It only checks the path strings.
|
||||
function isSrcSubdir (src, dest) {
|
||||
const srcArr = path.resolve(src).split(path.sep).filter(i => i)
|
||||
const destArr = path.resolve(dest).split(path.sep).filter(i => i)
|
||||
return srcArr.every((cur, i) => destArr[i] === cur)
|
||||
}
|
||||
|
||||
function errMsg (src, dest, funcName) {
|
||||
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
// checkPaths
|
||||
checkPaths: u(checkPaths),
|
||||
checkPathsSync,
|
||||
// checkParent
|
||||
checkParentPaths: u(checkParentPaths),
|
||||
checkParentPathsSync,
|
||||
// Misc
|
||||
isSrcSubdir,
|
||||
areIdentical
|
||||
}
|
||||
36
@capacitor/cli/node_modules/fs-extra/lib/util/utimes.js
generated
vendored
Normal file
36
@capacitor/cli/node_modules/fs-extra/lib/util/utimes.js
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
'use strict'
|
||||
|
||||
const fs = require('../fs')
|
||||
const u = require('universalify').fromPromise
|
||||
|
||||
async function utimesMillis (path, atime, mtime) {
|
||||
// if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)
|
||||
const fd = await fs.open(path, 'r+')
|
||||
|
||||
let closeErr = null
|
||||
|
||||
try {
|
||||
await fs.futimes(fd, atime, mtime)
|
||||
} finally {
|
||||
try {
|
||||
await fs.close(fd)
|
||||
} catch (e) {
|
||||
closeErr = e
|
||||
}
|
||||
}
|
||||
|
||||
if (closeErr) {
|
||||
throw closeErr
|
||||
}
|
||||
}
|
||||
|
||||
function utimesMillisSync (path, atime, mtime) {
|
||||
const fd = fs.openSync(path, 'r+')
|
||||
fs.futimesSync(fd, atime, mtime)
|
||||
return fs.closeSync(fd)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
utimesMillis: u(utimesMillis),
|
||||
utimesMillisSync
|
||||
}
|
||||
71
@capacitor/cli/node_modules/fs-extra/package.json
generated
vendored
Normal file
71
@capacitor/cli/node_modules/fs-extra/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
"name": "fs-extra",
|
||||
"version": "11.3.0",
|
||||
"description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.",
|
||||
"engines": {
|
||||
"node": ">=14.14"
|
||||
},
|
||||
"homepage": "https://github.com/jprichardson/node-fs-extra",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jprichardson/node-fs-extra"
|
||||
},
|
||||
"keywords": [
|
||||
"fs",
|
||||
"file",
|
||||
"file system",
|
||||
"copy",
|
||||
"directory",
|
||||
"extra",
|
||||
"mkdirp",
|
||||
"mkdir",
|
||||
"mkdirs",
|
||||
"recursive",
|
||||
"json",
|
||||
"read",
|
||||
"write",
|
||||
"extra",
|
||||
"delete",
|
||||
"remove",
|
||||
"touch",
|
||||
"create",
|
||||
"text",
|
||||
"output",
|
||||
"move",
|
||||
"promise"
|
||||
],
|
||||
"author": "JP Richardson <jprichardson@gmail.com>",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"klaw": "^2.1.1",
|
||||
"klaw-sync": "^3.0.2",
|
||||
"minimist": "^1.1.1",
|
||||
"mocha": "^10.1.0",
|
||||
"nyc": "^15.0.0",
|
||||
"proxyquire": "^2.0.1",
|
||||
"read-dir-files": "^0.1.1",
|
||||
"standard": "^17.0.0"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"exports": {
|
||||
".": "./lib/index.js",
|
||||
"./esm": "./lib/esm.mjs"
|
||||
},
|
||||
"files": [
|
||||
"lib/",
|
||||
"!lib/**/__tests__/"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha",
|
||||
"test": "npm run lint && npm run unit && npm run unit-esm",
|
||||
"unit": "nyc node test.js",
|
||||
"unit-esm": "node test.mjs"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
223
@capacitor/cli/node_modules/glob/README.md
generated
vendored
223
@capacitor/cli/node_modules/glob/README.md
generated
vendored
|
|
@ -17,7 +17,7 @@ npm i glob
|
|||
```
|
||||
|
||||
**Note** the npm package name is _not_ `node-glob` that's a
|
||||
different thing that was abandoned years ago. Just `glob`.
|
||||
different thing that was abandoned years ago. Just `glob`.
|
||||
|
||||
```js
|
||||
// load using import
|
||||
|
|
@ -31,12 +31,6 @@ const {
|
|||
Glob,
|
||||
} = require('glob')
|
||||
|
||||
// or default export is fine too, just returns the glob function
|
||||
// with all the aliases attached.
|
||||
import glob from 'glob'
|
||||
// or using commonjs
|
||||
const glob = require('glob')
|
||||
|
||||
// the main glob() and globSync() resolve/return array of filenames
|
||||
|
||||
// all js files, but don't look in node_modules
|
||||
|
|
@ -61,7 +55,7 @@ const filesStream = globStream(['**/*.dat', 'logs/**/*.log'])
|
|||
// construct a Glob object if you wanna do it that way, which
|
||||
// allows for much faster walks if you have to look in the same
|
||||
// folder multiple times.
|
||||
const g = new Glob('**/foo')
|
||||
const g = new Glob('**/foo', {})
|
||||
// glob objects are async iterators, can also do globIterate() or
|
||||
// g.iterate(), same deal
|
||||
for await (const file of g) {
|
||||
|
|
@ -83,19 +77,19 @@ g3.stream().on('data', path => {
|
|||
'got a path object',
|
||||
path.fullpath(),
|
||||
path.isDirectory(),
|
||||
path.readdirSync().map(e => e.name)
|
||||
path.readdirSync().map(e => e.name),
|
||||
)
|
||||
})
|
||||
|
||||
// if you use stat:true and withFileTypes, you can sort results
|
||||
// by things like modified time, filter by permission mode, etc.
|
||||
// All Stats fields will be avialable in that case. Slightly
|
||||
// All Stats fields will be available in that case. Slightly
|
||||
// slower, though.
|
||||
// For example:
|
||||
const results = await glob('**', { stat: true, withFileTypes: true })
|
||||
|
||||
const timeSortedFiles = results
|
||||
.sort((a, b) => a.mtimeMS - b.mtimeMS)
|
||||
.sort((a, b) => a.mtimeMs - b.mtimeMs)
|
||||
.map(path => path.fullpath())
|
||||
|
||||
const groupReadableFiles = results
|
||||
|
|
@ -106,8 +100,8 @@ const groupReadableFiles = results
|
|||
// you'll ignore all markdown files, and all folders named 'docs'
|
||||
const customIgnoreResults = await glob('**', {
|
||||
ignore: {
|
||||
ignored: (p) => /\.md$/.test(p.name),
|
||||
childrenIgnored: (p) => p.isNamed('docs'),
|
||||
ignored: p => /\.md$/.test(p.name),
|
||||
childrenIgnored: p => p.isNamed('docs'),
|
||||
},
|
||||
})
|
||||
|
||||
|
|
@ -115,11 +109,11 @@ const customIgnoreResults = await glob('**', {
|
|||
// their parent folder, plus either `.ts` or `.js`
|
||||
const folderNamedModules = await glob('**/*.{ts,js}', {
|
||||
ignore: {
|
||||
ignored: (p) => {
|
||||
ignored: p => {
|
||||
const pp = p.parent
|
||||
return !(p.isNamed(pp.name + '.ts') || p.isNamed(pp.name + '.js'))
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
// find all files edited in the last hour, to do this, we ignore
|
||||
|
|
@ -130,14 +124,14 @@ const newFiles = await glob('**', {
|
|||
// only want the files, not the dirs
|
||||
nodir: true,
|
||||
ignore: {
|
||||
ignored: (p) => {
|
||||
return (new Date() - p.mtime) > (60 * 60 * 1000)
|
||||
ignored: p => {
|
||||
return new Date() - p.mtime > 60 * 60 * 1000
|
||||
},
|
||||
// could add similar childrenIgnored here as well, but
|
||||
// directory mtime is inconsistent across platforms, so
|
||||
// probably better not to, unless you know the system
|
||||
// tracks this reliably.
|
||||
}
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
|
|
@ -149,6 +143,131 @@ set `windowsPathsNoEscape:true` in the options. In this mode,
|
|||
special glob characters cannot be escaped, making it impossible
|
||||
to match a literal `*` `?` and so on in filenames.
|
||||
|
||||
## Command Line Interface
|
||||
|
||||
```
|
||||
$ glob -h
|
||||
|
||||
Usage:
|
||||
glob [options] [<pattern> [<pattern> ...]]
|
||||
|
||||
Expand the positional glob expression arguments into any matching file system
|
||||
paths found.
|
||||
|
||||
-c<command> --cmd=<command>
|
||||
Run the command provided, passing the glob expression
|
||||
matches as arguments.
|
||||
|
||||
-A --all By default, the glob cli command will not expand any
|
||||
arguments that are an exact match to a file on disk.
|
||||
|
||||
This prevents double-expanding, in case the shell
|
||||
expands an argument whose filename is a glob
|
||||
expression.
|
||||
|
||||
For example, if 'app/*.ts' would match 'app/[id].ts',
|
||||
then on Windows powershell or cmd.exe, 'glob app/*.ts'
|
||||
will expand to 'app/[id].ts', as expected. However, in
|
||||
posix shells such as bash or zsh, the shell will first
|
||||
expand 'app/*.ts' to a list of filenames. Then glob
|
||||
will look for a file matching 'app/[id].ts' (ie,
|
||||
'app/i.ts' or 'app/d.ts'), which is unexpected.
|
||||
|
||||
Setting '--all' prevents this behavior, causing glob to
|
||||
treat ALL patterns as glob expressions to be expanded,
|
||||
even if they are an exact match to a file on disk.
|
||||
|
||||
When setting this option, be sure to enquote arguments
|
||||
so that the shell will not expand them prior to passing
|
||||
them to the glob command process.
|
||||
|
||||
-a --absolute Expand to absolute paths
|
||||
-d --dot-relative Prepend './' on relative matches
|
||||
-m --mark Append a / on any directories matched
|
||||
-x --posix Always resolve to posix style paths, using '/' as the
|
||||
directory separator, even on Windows. Drive letter
|
||||
absolute matches on Windows will be expanded to their
|
||||
full resolved UNC maths, eg instead of 'C:\foo\bar', it
|
||||
will expand to '//?/C:/foo/bar'.
|
||||
|
||||
-f --follow Follow symlinked directories when expanding '**'
|
||||
-R --realpath Call 'fs.realpath' on all of the results. In the case
|
||||
of an entry that cannot be resolved, the entry is
|
||||
omitted. This incurs a slight performance penalty, of
|
||||
course, because of the added system calls.
|
||||
|
||||
-s --stat Call 'fs.lstat' on all entries, whether required or not
|
||||
to determine if it's a valid match.
|
||||
|
||||
-b --match-base Perform a basename-only match if the pattern does not
|
||||
contain any slash characters. That is, '*.js' would be
|
||||
treated as equivalent to '**/*.js', matching js files
|
||||
in all directories.
|
||||
|
||||
--dot Allow patterns to match files/directories that start
|
||||
with '.', even if the pattern does not start with '.'
|
||||
|
||||
--nobrace Do not expand {...} patterns
|
||||
--nocase Perform a case-insensitive match. This defaults to
|
||||
'true' on macOS and Windows platforms, and false on all
|
||||
others.
|
||||
|
||||
Note: 'nocase' should only be explicitly set when it is
|
||||
known that the filesystem's case sensitivity differs
|
||||
from the platform default. If set 'true' on
|
||||
case-insensitive file systems, then the walk may return
|
||||
more or less results than expected.
|
||||
|
||||
--nodir Do not match directories, only files.
|
||||
|
||||
Note: to *only* match directories, append a '/' at the
|
||||
end of the pattern.
|
||||
|
||||
--noext Do not expand extglob patterns, such as '+(a|b)'
|
||||
--noglobstar Do not expand '**' against multiple path portions. Ie,
|
||||
treat it as a normal '*' instead.
|
||||
|
||||
--windows-path-no-escape
|
||||
Use '\' as a path separator *only*, and *never* as an
|
||||
escape character. If set, all '\' characters are
|
||||
replaced with '/' in the pattern.
|
||||
|
||||
-D<n> --max-depth=<n> Maximum depth to traverse from the current working
|
||||
directory
|
||||
|
||||
-C<cwd> --cwd=<cwd> Current working directory to execute/match in
|
||||
-r<root> --root=<root> A string path resolved against the 'cwd', which is used
|
||||
as the starting point for absolute patterns that start
|
||||
with '/' (but not drive letters or UNC paths on
|
||||
Windows).
|
||||
|
||||
Note that this *doesn't* necessarily limit the walk to
|
||||
the 'root' directory, and doesn't affect the cwd
|
||||
starting point for non-absolute patterns. A pattern
|
||||
containing '..' will still be able to traverse out of
|
||||
the root directory, if it is not an actual root
|
||||
directory on the filesystem, and any non-absolute
|
||||
patterns will still be matched in the 'cwd'.
|
||||
|
||||
To start absolute and non-absolute patterns in the same
|
||||
path, you can use '--root=' to set it to the empty
|
||||
string. However, be aware that on Windows systems, a
|
||||
pattern like 'x:/*' or '//host/share/*' will *always*
|
||||
start in the 'x:/' or '//host/share/' directory,
|
||||
regardless of the --root setting.
|
||||
|
||||
--platform=<platform> Defaults to the value of 'process.platform' if
|
||||
available, or 'linux' if not. Setting --platform=win32
|
||||
on non-Windows systems may cause strange behavior!
|
||||
|
||||
-i<ignore> --ignore=<ignore>
|
||||
Glob patterns to ignore Can be set multiple times
|
||||
-v --debug Output a huge amount of noisy debug information about
|
||||
patterns as they are parsed and used to match files.
|
||||
|
||||
-h --help Show this usage information
|
||||
```
|
||||
|
||||
## `glob(pattern: string | string[], options?: GlobOptions) => Promise<string[] | Path[]>`
|
||||
|
||||
Perform an asynchronous glob search for the pattern(s) specified.
|
||||
|
|
@ -239,6 +358,8 @@ An object that can perform glob pattern traversals.
|
|||
|
||||
### `const g = new Glob(pattern: string | string[], options: GlobOptions)`
|
||||
|
||||
Options object is required.
|
||||
|
||||
See full options descriptions below.
|
||||
|
||||
Note that a previous `Glob` object can be passed as the
|
||||
|
|
@ -301,7 +422,7 @@ share the previously loaded cache.
|
|||
`process.cwd()`. See also: "Windows, CWDs, Drive Letters, and
|
||||
UNC Paths", below.
|
||||
|
||||
This option may be eiher a string path or a `file://` URL
|
||||
This option may be either a string path or a `file://` URL
|
||||
object or string.
|
||||
|
||||
- `root` A string path resolved against the `cwd` option, which
|
||||
|
|
@ -388,14 +509,17 @@ share the previously loaded cache.
|
|||
- `nodir` Do not match directories, only files. (Note: to match
|
||||
_only_ directories, put a `/` at the end of the pattern.)
|
||||
|
||||
Note: when `follow` and `nodir` are both set, then symbolic
|
||||
links to directories are also omitted.
|
||||
|
||||
- `stat` Call `lstat()` on all entries, whether required or not
|
||||
to determine whether it's a valid match. When used with
|
||||
`withFileTypes`, this means that matches will include data such
|
||||
as modified time, permissions, and so on. Note that this will
|
||||
incur a performance cost due to the added system calls.
|
||||
|
||||
- `ignore` string or string[], or an object with `ignore` and
|
||||
`ignoreChildren` methods.
|
||||
- `ignore` string or string[], or an object with `ignored` and
|
||||
`childrenIgnored` methods.
|
||||
|
||||
If a string or string[] is provided, then this is treated as a
|
||||
glob pattern or array of glob patterns to exclude from matches.
|
||||
|
|
@ -418,6 +542,9 @@ share the previously loaded cache.
|
|||
it is not the first item in the pattern, or none if it is the
|
||||
first item in the pattern, following the same behavior as Bash.
|
||||
|
||||
Note: when `follow` and `nodir` are both set, then symbolic
|
||||
links to directories are also omitted.
|
||||
|
||||
- `realpath` Set to true to call `fs.realpath` on all of the
|
||||
results. In the case of an entry that cannot be resolved, the
|
||||
entry is omitted. This incurs a slight performance penalty, of
|
||||
|
|
@ -436,6 +563,13 @@ share the previously loaded cache.
|
|||
|
||||
`absolute` may not be used along with `withFileTypes`.
|
||||
|
||||
- `posix` Set to true to use `/` as the path separator in
|
||||
returned results. On posix systems, this has no effect. On
|
||||
Windows systems, this will return `/` delimited path results,
|
||||
and absolute paths will be returned in their full resolved UNC
|
||||
path form, eg insted of `'C:\\foo\\bar'`, it will return
|
||||
`//?/C:/foo/bar`.
|
||||
|
||||
- `platform` Defaults to value of `process.platform` if
|
||||
available, or `'linux'` if not. Setting `platform:'win32'` on
|
||||
non-Windows systems may cause strange behavior.
|
||||
|
|
@ -459,6 +593,51 @@ share the previously loaded cache.
|
|||
explicitly, then any provided `scurry` object must match this
|
||||
setting.
|
||||
|
||||
- `includeChildMatches` boolean, default `true`. Do not match any
|
||||
children of any matches. For example, the pattern `**\/foo`
|
||||
would match `a/foo`, but not `a/foo/b/foo` in this mode.
|
||||
|
||||
This is especially useful for cases like "find all
|
||||
`node_modules` folders, but not the ones in `node_modules`".
|
||||
|
||||
In order to support this, the `Ignore` implementation must
|
||||
support an `add(pattern: string)` method. If using the default
|
||||
`Ignore` class, then this is fine, but if this is set to
|
||||
`false`, and a custom `Ignore` is provided that does not have
|
||||
an `add()` method, then it will throw an error.
|
||||
|
||||
**Caveat** It _only_ ignores matches that would be a descendant
|
||||
of a previous match, and only if that descendant is matched
|
||||
_after_ the ancestor is encountered. Since the file system walk
|
||||
happens in indeterminate order, it's possible that a match will
|
||||
already be added before its ancestor, if multiple or braced
|
||||
patterns are used.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
const results = await glob(
|
||||
[
|
||||
// likely to match first, since it's just a stat
|
||||
'a/b/c/d/e/f',
|
||||
|
||||
// this pattern is more complicated! It must to various readdir()
|
||||
// calls and test the results against a regular expression, and that
|
||||
// is certainly going to take a little bit longer.
|
||||
//
|
||||
// So, later on, it encounters a match at 'a/b/c/d/e', but it's too
|
||||
// late to ignore a/b/c/d/e/f, because it's already been emitted.
|
||||
'a/[bdf]/?/[a-z]/*',
|
||||
],
|
||||
{ includeChildMatches: false },
|
||||
)
|
||||
```
|
||||
|
||||
It's best to only set this to `false` if you can be reasonably
|
||||
sure that no components of the pattern will potentially match
|
||||
one another's file system descendants, or if the occasional
|
||||
included child entry will not cause problems.
|
||||
|
||||
## Glob Primer
|
||||
|
||||
Much more information about glob pattern expansion can be found
|
||||
|
|
|
|||
1
@capacitor/cli/node_modules/glob/dist/cjs/glob.d.ts.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/glob.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"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"}
|
||||
1
@capacitor/cli/node_modules/glob/dist/cjs/glob.js.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/glob.js.map
generated
vendored
File diff suppressed because one or more lines are too long
1
@capacitor/cli/node_modules/glob/dist/cjs/has-magic.js.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/has-magic.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAGrC;;;;;;;;;;GAUG;AACI,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;KACpB;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,IAAI,IAAI,qBAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;KACtD;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {}\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]}
|
||||
1
@capacitor/cli/node_modules/glob/dist/cjs/ignore.d.ts.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/ignore.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;CACvC;AASD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;gBAG3B,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAiDnB,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"}
|
||||
1
@capacitor/cli/node_modules/glob/dist/cjs/ignore.js.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/ignore.js.map
generated
vendored
File diff suppressed because one or more lines are too long
75
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.d.ts
generated
vendored
75
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.d.ts
generated
vendored
|
|
@ -1,75 +0,0 @@
|
|||
declare const _default: typeof import("./index.js").glob & {
|
||||
glob: typeof import("./index.js").glob;
|
||||
globSync: typeof import("./index.js").globSync;
|
||||
sync: typeof import("./index.js").globSync & {
|
||||
stream: typeof import("./index.js").globStreamSync;
|
||||
iterate: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globStream: typeof import("./index.js").globStream;
|
||||
stream: typeof import("./index.js").globStream & {
|
||||
sync: typeof import("./index.js").globStreamSync;
|
||||
};
|
||||
globStreamSync: typeof import("./index.js").globStreamSync;
|
||||
streamSync: typeof import("./index.js").globStreamSync;
|
||||
globIterate: typeof import("./index.js").globIterate;
|
||||
iterate: typeof import("./index.js").globIterate & {
|
||||
sync: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globIterateSync: typeof import("./index.js").globIterateSync;
|
||||
iterateSync: typeof import("./index.js").globIterateSync;
|
||||
Glob: typeof import("./glob.js").Glob;
|
||||
hasMagic: (pattern: string | string[], options?: import("./glob.js").GlobOptions) => boolean;
|
||||
escape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
} & {
|
||||
default: typeof import("./index.js").glob & {
|
||||
glob: typeof import("./index.js").glob;
|
||||
globSync: typeof import("./index.js").globSync;
|
||||
sync: typeof import("./index.js").globSync & {
|
||||
stream: typeof import("./index.js").globStreamSync;
|
||||
iterate: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globStream: typeof import("./index.js").globStream;
|
||||
stream: typeof import("./index.js").globStream & {
|
||||
sync: typeof import("./index.js").globStreamSync;
|
||||
};
|
||||
globStreamSync: typeof import("./index.js").globStreamSync;
|
||||
streamSync: typeof import("./index.js").globStreamSync;
|
||||
globIterate: typeof import("./index.js").globIterate;
|
||||
iterate: typeof import("./index.js").globIterate & {
|
||||
sync: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globIterateSync: typeof import("./index.js").globIterateSync;
|
||||
iterateSync: typeof import("./index.js").globIterateSync;
|
||||
Glob: typeof import("./glob.js").Glob;
|
||||
hasMagic: (pattern: string | string[], options?: import("./glob.js").GlobOptions) => boolean;
|
||||
escape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
};
|
||||
glob: typeof import("./index.js").glob & {
|
||||
glob: typeof import("./index.js").glob;
|
||||
globSync: typeof import("./index.js").globSync;
|
||||
sync: typeof import("./index.js").globSync & {
|
||||
stream: typeof import("./index.js").globStreamSync;
|
||||
iterate: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globStream: typeof import("./index.js").globStream;
|
||||
stream: typeof import("./index.js").globStream & {
|
||||
sync: typeof import("./index.js").globStreamSync;
|
||||
};
|
||||
globStreamSync: typeof import("./index.js").globStreamSync;
|
||||
streamSync: typeof import("./index.js").globStreamSync;
|
||||
globIterate: typeof import("./index.js").globIterate;
|
||||
iterate: typeof import("./index.js").globIterate & {
|
||||
sync: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globIterateSync: typeof import("./index.js").globIterateSync;
|
||||
iterateSync: typeof import("./index.js").globIterateSync;
|
||||
Glob: typeof import("./glob.js").Glob;
|
||||
hasMagic: (pattern: string | string[], options?: import("./glob.js").GlobOptions) => boolean;
|
||||
escape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
};
|
||||
};
|
||||
export = _default;
|
||||
//# sourceMappingURL=index-cjs.d.ts.map
|
||||
1
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.d.ts.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index-cjs.d.ts","sourceRoot":"","sources":["../../src/index-cjs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAAqD"}
|
||||
7
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.js
generated
vendored
7
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.js
generated
vendored
|
|
@ -1,7 +0,0 @@
|
|||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
const index_js_1 = __importDefault(require("./index.js"));
|
||||
module.exports = Object.assign(index_js_1.default, { default: index_js_1.default, glob: index_js_1.default });
|
||||
//# sourceMappingURL=index-cjs.js.map
|
||||
1
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.js.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index-cjs.js","sourceRoot":"","sources":["../../src/index-cjs.ts"],"names":[],"mappings":";;;;AAAA,0DAA6B;AAE7B,iBAAS,MAAM,CAAC,MAAM,CAAC,kBAAI,EAAE,EAAE,OAAO,EAAE,kBAAI,EAAE,IAAI,EAAJ,kBAAI,EAAE,CAAC,CAAA","sourcesContent":["import glob from './index.js'\n\nexport = Object.assign(glob, { default: glob, glob })\n"]}
|
||||
1
@capacitor/cli/node_modules/glob/dist/cjs/index.d.ts.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/index.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}
|
||||
1
@capacitor/cli/node_modules/glob/dist/cjs/index.js.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
1
@capacitor/cli/node_modules/glob/dist/cjs/pattern.d.ts.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/pattern.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,QAAQ,CAAA;AAGzD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAC9D,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,GAAG,IAAI,EAAE,SAAS,EAAE;CACrB,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AACjE,MAAM,MAAM,mBAAmB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAChE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;AAMrD;;;GAGG;AACH,qBAAa,OAAO;;IAIlB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBAUrB,WAAW,EAAE,SAAS,EAAE,EACxB,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,CAAC,QAAQ;IA6D3B;;OAEG;IACH,OAAO,IAAI,SAAS;IAIpB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAGnB;;OAEG;IACH,UAAU,IAAI,OAAO;IAGrB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,UAAU,IAAI,MAAM;IAUpB;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,IAAI,IAAI,OAAO,GAAG,IAAI;IAetB;;OAEG;IACH,KAAK,IAAI,OAAO;IAoBhB;;OAEG;IACH,OAAO,IAAI,OAAO;IAelB;;OAEG;IACH,UAAU,IAAI,OAAO;IAUrB;;OAEG;IACH,IAAI,IAAI,MAAM;IAOd;;;OAGG;IACH,mBAAmB,IAAI,OAAO;IAQ9B;;OAEG;IACH,kBAAkB,IAAI,OAAO;CAM9B"}
|
||||
1
@capacitor/cli/node_modules/glob/dist/cjs/pattern.js.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/pattern.js.map
generated
vendored
File diff suppressed because one or more lines are too long
1
@capacitor/cli/node_modules/glob/dist/cjs/processor.js.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/processor.js.map
generated
vendored
File diff suppressed because one or more lines are too long
1
@capacitor/cli/node_modules/glob/dist/cjs/walker.d.ts.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/walker.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"walker.d.ts","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":"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"}
|
||||
1
@capacitor/cli/node_modules/glob/dist/cjs/walker.js.map
generated
vendored
1
@capacitor/cli/node_modules/glob/dist/cjs/walker.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,5 @@
|
|||
/// <reference types="node" />
|
||||
import { Minimatch } from 'minimatch';
|
||||
import Minipass from 'minipass';
|
||||
import { Minipass } from 'minipass';
|
||||
import { FSOption, Path, PathScurry } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
|
|
@ -74,7 +73,7 @@ export interface GlobOptions {
|
|||
*/
|
||||
follow?: boolean;
|
||||
/**
|
||||
* string or string[], or an object with `ignore` and `ignoreChildren`
|
||||
* string or string[], or an object with `ignored` and `childrenIgnored`
|
||||
* methods.
|
||||
*
|
||||
* If a string or string[] is provided, then this is treated as a glob
|
||||
|
|
@ -193,9 +192,9 @@ export interface GlobOptions {
|
|||
scurry?: PathScurry;
|
||||
/**
|
||||
* Call `lstat()` on all entries, whether required or not to determine
|
||||
* whether it's a valid match. When used with {@link withFileTypes}, this
|
||||
* means that matches will include data such as modified time, permissions,
|
||||
* and so on. Note that this will incur a performance cost due to the added
|
||||
* if it's a valid match. When used with {@link withFileTypes}, this means
|
||||
* that matches will include data such as modified time, permissions, and
|
||||
* so on. Note that this will incur a performance cost due to the added
|
||||
* system calls.
|
||||
*/
|
||||
stat?: boolean;
|
||||
|
|
@ -238,10 +237,65 @@ export interface GlobOptions {
|
|||
* matching operations slower and *extremely* noisy.
|
||||
*/
|
||||
debug?: boolean;
|
||||
/**
|
||||
* Return `/` delimited paths, even on Windows.
|
||||
*
|
||||
* On posix systems, this has no effect. But, on Windows, it means that
|
||||
* paths will be `/` delimited, and absolute paths will be their full
|
||||
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return
|
||||
* `'//?/C:/foo/bar'`
|
||||
*/
|
||||
posix?: boolean;
|
||||
/**
|
||||
* Do not match any children of any matches. For example, the pattern
|
||||
* `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.
|
||||
*
|
||||
* This is especially useful for cases like "find all `node_modules`
|
||||
* folders, but not the ones in `node_modules`".
|
||||
*
|
||||
* In order to support this, the `Ignore` implementation must support an
|
||||
* `add(pattern: string)` method. If using the default `Ignore` class, then
|
||||
* this is fine, but if this is set to `false`, and a custom `Ignore` is
|
||||
* provided that does not have an `add()` method, then it will throw an
|
||||
* error.
|
||||
*
|
||||
* **Caveat** It *only* ignores matches that would be a descendant of a
|
||||
* previous match, and only if that descendant is matched *after* the
|
||||
* ancestor is encountered. Since the file system walk happens in
|
||||
* indeterminate order, it's possible that a match will already be added
|
||||
* before its ancestor, if multiple or braced patterns are used.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* ```ts
|
||||
* const results = await glob([
|
||||
* // likely to match first, since it's just a stat
|
||||
* 'a/b/c/d/e/f',
|
||||
*
|
||||
* // this pattern is more complicated! It must to various readdir()
|
||||
* // calls and test the results against a regular expression, and that
|
||||
* // is certainly going to take a little bit longer.
|
||||
* //
|
||||
* // So, later on, it encounters a match at 'a/b/c/d/e', but it's too
|
||||
* // late to ignore a/b/c/d/e/f, because it's already been emitted.
|
||||
* 'a/[bdf]/?/[a-z]/*',
|
||||
* ], { includeChildMatches: false })
|
||||
* ```
|
||||
*
|
||||
* It's best to only set this to `false` if you can be reasonably sure that
|
||||
* no components of the pattern will potentially match one another's file
|
||||
* system descendants, or if the occasional included child entry will not
|
||||
* cause problems.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
includeChildMatches?: boolean;
|
||||
}
|
||||
export type GlobOptionsWithFileTypesTrue = GlobOptions & {
|
||||
withFileTypes: true;
|
||||
absolute?: undefined;
|
||||
mark?: undefined;
|
||||
posix?: undefined;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesFalse = GlobOptions & {
|
||||
withFileTypes?: false;
|
||||
|
|
@ -280,6 +334,7 @@ export declare class Glob<Opts extends GlobOptions> implements GlobOptions {
|
|||
signal?: AbortSignal;
|
||||
windowsPathsNoEscape: boolean;
|
||||
withFileTypes: FileTypes<Opts>;
|
||||
includeChildMatches: boolean;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
1
@capacitor/cli/node_modules/glob/dist/commonjs/glob.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/commonjs/glob.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAA;AAalE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAE5B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAElB;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IAEvC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IAE1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IAEnB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IAEpB;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAE9B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;OAGG;IACH,EAAE,CAAC,EAAE,QAAQ,CAAA;IAEb;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,MAAM,MAAM,4BAA4B,GAAG,WAAW,GAAG;IACvD,aAAa,EAAE,IAAI,CAAA;IAEnB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,WAAW,GAAG;IACxD,aAAa,CAAC,EAAE,KAAK,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,WAAW,GAAG;IACxD,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,MAAM,CAAC,IAAI,IACrB,IAAI,SAAS,4BAA4B,GAAG,IAAI,GAC9C,IAAI,SAAS,6BAA6B,GAAG,MAAM,GACnD,IAAI,SAAS,6BAA6B,GAAG,MAAM,GACnD,MAAM,GAAG,IAAI,CAAA;AACjB,MAAM,MAAM,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAA;AAE1C,MAAM,MAAM,SAAS,CAAC,IAAI,IACxB,IAAI,SAAS,4BAA4B,GAAG,IAAI,GAC9C,IAAI,SAAS,6BAA6B,GAAG,KAAK,GAClD,IAAI,SAAS,6BAA6B,GAAG,KAAK,GAClD,OAAO,CAAA;AAEX;;GAEG;AACH,qBAAa,IAAI,CAAC,IAAI,SAAS,WAAW,CAAE,YAAW,WAAW;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,OAAO,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IACvC,aAAa,EAAE,OAAO,CAAA;IACtB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,UAAU,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;IAC9B,mBAAmB,EAAE,OAAO,CAAA;IAE5B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;IAEV;;OAEG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAA;IAEnB;;;;;;;;;;;OAWG;gBACS,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI;IA2HlD;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAoBpC;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBzB;;OAEG;IACH,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAc9C;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAclD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"}
|
||||
|
|
@ -2,16 +2,16 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Glob = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const node_url_1 = require("node:url");
|
||||
const path_scurry_1 = require("path-scurry");
|
||||
const url_1 = require("url");
|
||||
const pattern_js_1 = require("./pattern.js");
|
||||
const walker_js_1 = require("./walker.js");
|
||||
// if no process global, just call it linux.
|
||||
// so we default to case-sensitive, / separators
|
||||
const defaultPlatform = typeof process === 'object' &&
|
||||
const defaultPlatform = (typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string'
|
||||
? process.platform
|
||||
typeof process.platform === 'string') ?
|
||||
process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
|
|
@ -41,6 +41,7 @@ class Glob {
|
|||
signal;
|
||||
windowsPathsNoEscape;
|
||||
withFileTypes;
|
||||
includeChildMatches;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
|
|
@ -62,6 +63,10 @@ class Glob {
|
|||
* again.
|
||||
*/
|
||||
constructor(pattern, opts) {
|
||||
/* c8 ignore start */
|
||||
if (!opts)
|
||||
throw new TypeError('glob options required');
|
||||
/* c8 ignore stop */
|
||||
this.withFileTypes = !!opts.withFileTypes;
|
||||
this.signal = opts.signal;
|
||||
this.follow = !!opts.follow;
|
||||
|
|
@ -73,7 +78,7 @@ class Glob {
|
|||
this.cwd = '';
|
||||
}
|
||||
else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
|
||||
opts.cwd = (0, url_1.fileURLToPath)(opts.cwd);
|
||||
opts.cwd = (0, node_url_1.fileURLToPath)(opts.cwd);
|
||||
}
|
||||
this.cwd = opts.cwd || '';
|
||||
this.root = opts.root;
|
||||
|
|
@ -82,6 +87,7 @@ class Glob {
|
|||
this.noext = !!opts.noext;
|
||||
this.realpath = !!opts.realpath;
|
||||
this.absolute = opts.absolute;
|
||||
this.includeChildMatches = opts.includeChildMatches !== false;
|
||||
this.noglobstar = !!opts.noglobstar;
|
||||
this.matchBase = !!opts.matchBase;
|
||||
this.maxDepth =
|
||||
|
|
@ -96,7 +102,8 @@ class Glob {
|
|||
}
|
||||
this.windowsPathsNoEscape =
|
||||
!!opts.windowsPathsNoEscape ||
|
||||
opts.allowWindowsEscape === false;
|
||||
opts.allowWindowsEscape ===
|
||||
false;
|
||||
if (this.windowsPathsNoEscape) {
|
||||
pattern = pattern.map(p => p.replace(/\\/g, '/'));
|
||||
}
|
||||
|
|
@ -117,12 +124,9 @@ class Glob {
|
|||
}
|
||||
}
|
||||
else {
|
||||
const Scurry = opts.platform === 'win32'
|
||||
? path_scurry_1.PathScurryWin32
|
||||
: opts.platform === 'darwin'
|
||||
? path_scurry_1.PathScurryDarwin
|
||||
: opts.platform
|
||||
? path_scurry_1.PathScurryPosix
|
||||
const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32
|
||||
: opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin
|
||||
: opts.platform ? path_scurry_1.PathScurryPosix
|
||||
: path_scurry_1.PathScurry;
|
||||
this.scurry = new Scurry(this.cwd, {
|
||||
nocase: opts.nocase,
|
||||
|
|
@ -130,6 +134,11 @@ class Glob {
|
|||
});
|
||||
}
|
||||
this.nocase = this.scurry.nocase;
|
||||
// If you do nocase:true on a case-sensitive file system, then
|
||||
// we need to use regexps instead of strings for non-magic
|
||||
// path portions, because statting `aBc` won't return results
|
||||
// for the file `AbC` for example.
|
||||
const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';
|
||||
const mmo = {
|
||||
// default nocase based on platform
|
||||
...opts,
|
||||
|
|
@ -137,7 +146,7 @@ class Glob {
|
|||
matchBase: this.matchBase,
|
||||
nobrace: this.nobrace,
|
||||
nocase: this.nocase,
|
||||
nocaseMagicOnly: true,
|
||||
nocaseMagicOnly,
|
||||
nocomment: true,
|
||||
noext: this.noext,
|
||||
nonegate: true,
|
||||
|
|
@ -153,7 +162,12 @@ class Glob {
|
|||
return set;
|
||||
}, [[], []]);
|
||||
this.patterns = matchSet.map((set, i) => {
|
||||
return new pattern_js_1.Pattern(set, globParts[i], 0, this.platform);
|
||||
const g = globParts[i];
|
||||
/* c8 ignore start */
|
||||
if (!g)
|
||||
throw new Error('invalid pattern object');
|
||||
/* c8 ignore stop */
|
||||
return new pattern_js_1.Pattern(set, g, 0, this.platform);
|
||||
});
|
||||
}
|
||||
async walk() {
|
||||
|
|
@ -164,11 +178,12 @@ class Glob {
|
|||
return [
|
||||
...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).walk()),
|
||||
];
|
||||
}
|
||||
|
|
@ -176,32 +191,35 @@ class Glob {
|
|||
return [
|
||||
...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).walkSync(),
|
||||
];
|
||||
}
|
||||
stream() {
|
||||
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).stream();
|
||||
}
|
||||
streamSync() {
|
||||
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).streamSync();
|
||||
}
|
||||
/**
|
||||
1
@capacitor/cli/node_modules/glob/dist/commonjs/glob.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/commonjs/glob.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
@capacitor/cli/node_modules/glob/dist/commonjs/has-magic.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/commonjs/has-magic.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAGrC;;;;;;;;;;GAUG;AACI,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,IAAI,qBAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;IACvD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {},\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]}
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
import { Minimatch } from 'minimatch';
|
||||
import { Minimatch, MinimatchOptions } from 'minimatch';
|
||||
import { Path } from 'path-scurry';
|
||||
import { GlobWalkerOpts } from './walker.js';
|
||||
export interface IgnoreLike {
|
||||
ignored?: (p: Path) => boolean;
|
||||
childrenIgnored?: (p: Path) => boolean;
|
||||
add?: (ignore: string) => void;
|
||||
}
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
|
|
@ -13,7 +14,10 @@ export declare class Ignore implements IgnoreLike {
|
|||
relativeChildren: Minimatch[];
|
||||
absolute: Minimatch[];
|
||||
absoluteChildren: Minimatch[];
|
||||
platform: NodeJS.Platform;
|
||||
mmopts: MinimatchOptions;
|
||||
constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts);
|
||||
add(ign: string): void;
|
||||
ignored(p: Path): boolean;
|
||||
childrenIgnored(p: Path): boolean;
|
||||
}
|
||||
1
@capacitor/cli/node_modules/glob/dist/commonjs/ignore.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/commonjs/ignore.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IACtC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAWD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,MAAM,EAAE,gBAAgB,CAAA;gBAGtB,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAqBnB,GAAG,CAAC,GAAG,EAAE,MAAM;IAyCf,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"}
|
||||
|
|
@ -7,10 +7,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
exports.Ignore = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const pattern_js_1 = require("./pattern.js");
|
||||
const defaultPlatform = typeof process === 'object' &&
|
||||
const defaultPlatform = (typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string'
|
||||
? process.platform
|
||||
typeof process.platform === 'string') ?
|
||||
process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
|
|
@ -20,12 +20,15 @@ class Ignore {
|
|||
relativeChildren;
|
||||
absolute;
|
||||
absoluteChildren;
|
||||
platform;
|
||||
mmopts;
|
||||
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) {
|
||||
this.relative = [];
|
||||
this.absolute = [];
|
||||
this.relativeChildren = [];
|
||||
this.absoluteChildren = [];
|
||||
const mmopts = {
|
||||
this.platform = platform;
|
||||
this.mmopts = {
|
||||
dot: true,
|
||||
nobrace,
|
||||
nocase,
|
||||
|
|
@ -36,6 +39,10 @@ class Ignore {
|
|||
nocomment: true,
|
||||
nonegate: true,
|
||||
};
|
||||
for (const ign of ignored)
|
||||
this.add(ign);
|
||||
}
|
||||
add(ign) {
|
||||
// this is a little weird, but it gives us a clean set of optimized
|
||||
// minimatch matchers, without getting tripped up if one of them
|
||||
// ends in /** inside a brace section, and it's only inefficient at
|
||||
|
|
@ -48,25 +55,34 @@ class Ignore {
|
|||
// for absolute-ness.
|
||||
// Yet another way, Minimatch could take an array of glob strings, and
|
||||
// a cwd option, and do the right thing.
|
||||
for (const ign of ignored) {
|
||||
const mm = new minimatch_1.Minimatch(ign, mmopts);
|
||||
for (let i = 0; i < mm.set.length; i++) {
|
||||
const parsed = mm.set[i];
|
||||
const globParts = mm.globParts[i];
|
||||
const p = new pattern_js_1.Pattern(parsed, globParts, 0, platform);
|
||||
const m = new minimatch_1.Minimatch(p.globString(), mmopts);
|
||||
const children = globParts[globParts.length - 1] === '**';
|
||||
const absolute = p.isAbsolute();
|
||||
const mm = new minimatch_1.Minimatch(ign, this.mmopts);
|
||||
for (let i = 0; i < mm.set.length; i++) {
|
||||
const parsed = mm.set[i];
|
||||
const globParts = mm.globParts[i];
|
||||
/* c8 ignore start */
|
||||
if (!parsed || !globParts) {
|
||||
throw new Error('invalid pattern object');
|
||||
}
|
||||
// strip off leading ./ portions
|
||||
// https://github.com/isaacs/node-glob/issues/570
|
||||
while (parsed[0] === '.' && globParts[0] === '.') {
|
||||
parsed.shift();
|
||||
globParts.shift();
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
const p = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform);
|
||||
const m = new minimatch_1.Minimatch(p.globString(), this.mmopts);
|
||||
const children = globParts[globParts.length - 1] === '**';
|
||||
const absolute = p.isAbsolute();
|
||||
if (absolute)
|
||||
this.absolute.push(m);
|
||||
else
|
||||
this.relative.push(m);
|
||||
if (children) {
|
||||
if (absolute)
|
||||
this.absolute.push(m);
|
||||
this.absoluteChildren.push(m);
|
||||
else
|
||||
this.relative.push(m);
|
||||
if (children) {
|
||||
if (absolute)
|
||||
this.absoluteChildren.push(m);
|
||||
else
|
||||
this.relativeChildren.push(m);
|
||||
}
|
||||
this.relativeChildren.push(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -94,7 +110,7 @@ class Ignore {
|
|||
}
|
||||
for (const m of this.absoluteChildren) {
|
||||
if (m.match(fullpath))
|
||||
true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue