feat: estructura base OpenSpec + Skills + arquitectura limpia Capacitor+Dextie

This commit is contained in:
mono
2026-10-24 20:49:29 -05:00
parent 2e6262b5a5
commit 0c7cf651ce
1659 changed files with 265883 additions and 0 deletions

245
node_modules/@ionic/utils-process/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,245 @@
# 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.10](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.9...@ionic/utils-process@2.1.10) (2022-06-16)
**Note:** Version bump only for package @ionic/utils-process
## [2.1.9](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.8...@ionic/utils-process@2.1.9) (2022-05-09)
**Note:** Version bump only for package @ionic/utils-process
## [2.1.8](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.7...@ionic/utils-process@2.1.8) (2020-09-29)
**Note:** Version bump only for package @ionic/utils-process
## [2.1.7](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.6...@ionic/utils-process@2.1.7) (2020-09-24)
**Note:** Version bump only for package @ionic/utils-process
## [2.1.6](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.5...@ionic/utils-process@2.1.6) (2020-08-28)
**Note:** Version bump only for package @ionic/utils-process
## [2.1.5](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.4...@ionic/utils-process@2.1.5) (2020-08-27)
### Bug Fixes
* **onExit:** switch to signal-exit implementation ([95521e2](https://github.com/ionic-team/ionic-cli/commit/95521e2d4d47795020dc20b53bd4ce99e87e4f73))
## [2.1.4](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.3...@ionic/utils-process@2.1.4) (2020-08-25)
**Note:** Version bump only for package @ionic/utils-process
## [2.1.3](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.2...@ionic/utils-process@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-process@2.1.1...@ionic/utils-process@2.1.2) (2020-05-06)
**Note:** Version bump only for package @ionic/utils-process
## [2.1.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.1.0...@ionic/utils-process@2.1.1) (2020-03-03)
**Note:** Version bump only for package @ionic/utils-process
# 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-process@2.0.1...@ionic/utils-process@2.0.2) (2020-02-10)
**Note:** Version bump only for package @ionic/utils-process
## [2.0.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@2.0.0...@ionic/utils-process@2.0.1) (2020-02-03)
**Note:** Version bump only for package @ionic/utils-process
# [2.0.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@1.0.9...@ionic/utils-process@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.0.9](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@1.0.8...@ionic/utils-process@1.0.9) (2020-01-13)
**Note:** Version bump only for package @ionic/utils-process
## [1.0.8](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@1.0.7...@ionic/utils-process@1.0.8) (2019-12-10)
**Note:** Version bump only for package @ionic/utils-process
## [1.0.7](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@1.0.6...@ionic/utils-process@1.0.7) (2019-12-05)
**Note:** Version bump only for package @ionic/utils-process
## [1.0.6](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@1.0.5...@ionic/utils-process@1.0.6) (2019-11-21)
**Note:** Version bump only for package @ionic/utils-process
## [1.0.5](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@1.0.4...@ionic/utils-process@1.0.5) (2019-09-18)
**Note:** Version bump only for package @ionic/utils-process
## [1.0.4](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@1.0.3...@ionic/utils-process@1.0.4) (2019-08-23)
**Note:** Version bump only for package @ionic/utils-process
## [1.0.3](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@1.0.2...@ionic/utils-process@1.0.3) (2019-08-14)
**Note:** Version bump only for package @ionic/utils-process
## [1.0.2](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@1.0.1...@ionic/utils-process@1.0.2) (2019-08-07)
**Note:** Version bump only for package @ionic/utils-process
## [1.0.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@1.0.0...@ionic/utils-process@1.0.1) (2019-06-05)
**Note:** Version bump only for package @ionic/utils-process
# [1.0.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@0.1.0...@ionic/utils-process@1.0.0) (2019-05-29)
### Bug Fixes
* **process:** re-raise captured signals ([d82bfde](https://github.com/ionic-team/ionic-cli/commit/d82bfde))
### 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.1.0"></a>
# [0.1.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-process@0.0.1...@ionic/utils-process@0.1.0) (2019-03-06)
### Features
* **process:** add `getPathParts` to split path into parts ([7dfbbc2](https://github.com/ionic-team/ionic-cli/commit/7dfbbc2))
<a name="0.0.1"></a>
## 0.0.1 (2019-02-27)
**Note:** Version bump only for package @ionic/utils-process

21
node_modules/@ionic/utils-process/LICENSE generated vendored Normal file
View 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
node_modules/@ionic/utils-process/README.md generated vendored Normal file
View File

@@ -0,0 +1 @@
# @ionic/utils-process

63
node_modules/@ionic/utils-process/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,63 @@
/// <reference types="node" />
export declare const ERROR_TIMEOUT_REACHED: Error;
export declare function killProcessTree(pid: number, signal?: string | number): Promise<void>;
/**
* Creates an alternative implementation of `process.env` object.
*
* On a Windows shell, `process.env` is a magic object that offers
* case-insensitive environment variable access. On other platforms, case
* sensitivity matters. This method creates an empty "`process.env`" object
* type that works for all platforms.
*/
export declare function createProcessEnv(...sources: {
[key: string]: string | undefined;
}[]): NodeJS.ProcessEnv;
/**
* Split a PATH string into path parts.
*/
export declare function getPathParts(envpath?: string): string[];
/**
* Resolves when the given amount of milliseconds has passed.
*/
export declare function sleep(ms: number): Promise<void>;
/**
* Resolves when a given predicate is true or a timeout is reached.
*
* Configure `interval` to set how often the `predicate` is called.
*
* By default, `timeout` is Infinity. If given a value (in ms), and that
* timeout value is reached, this function will reject with
* the `ERROR_TIMEOUT_REACHED` error.
*/
export declare function sleepUntil(predicate: () => boolean, { interval, timeout }: {
interval?: number;
timeout?: number;
}): Promise<void>;
/**
* Never resolves and keeps Node running.
*/
export declare function sleepForever(): Promise<never>;
/**
* Register a synchronous function to be called once the process exits.
*/
export declare function onExit(fn: () => void): void;
export declare type ExitFn = () => Promise<void>;
/**
* Register an asynchronous function to be called when the process wants to
* exit.
*
* A handler will be registered for the 'SIGINT', 'SIGTERM', 'SIGHUP',
* 'SIGBREAK' signals. If any of the signal events is emitted, `fn` will be
* called exactly once, awaited upon, and then the process will exit once all
* registered functions are resolved.
*/
export declare function onBeforeExit(fn: ExitFn): void;
/**
* Remove a function that was registered with `onBeforeExit`.
*/
export declare function offBeforeExit(fn: ExitFn): void;
/**
* Asynchronous `process.exit()`, for running functions registered with
* `onBeforeExit`.
*/
export declare function processExit(exitCode?: number): Promise<void>;

158
node_modules/@ionic/utils-process/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,158 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.processExit = exports.offBeforeExit = exports.onBeforeExit = exports.onExit = exports.sleepForever = exports.sleepUntil = exports.sleep = exports.getPathParts = exports.createProcessEnv = exports.killProcessTree = exports.ERROR_TIMEOUT_REACHED = void 0;
const utils_object_1 = require("@ionic/utils-object");
const utils_terminal_1 = require("@ionic/utils-terminal");
const Debug = require("debug");
const pathlib = require("path");
const onSignalExit = require("signal-exit");
const kill = require("tree-kill");
const debug = Debug('ionic:utils-process');
exports.ERROR_TIMEOUT_REACHED = new Error('TIMEOUT_REACHED');
function killProcessTree(pid, signal = 'SIGTERM') {
return new Promise((resolve, reject) => {
kill(pid, signal, err => {
if (err) {
debug('error while killing process tree for %d: %O', pid, err);
return reject(err);
}
resolve();
});
});
}
exports.killProcessTree = killProcessTree;
/**
* Creates an alternative implementation of `process.env` object.
*
* On a Windows shell, `process.env` is a magic object that offers
* case-insensitive environment variable access. On other platforms, case
* sensitivity matters. This method creates an empty "`process.env`" object
* type that works for all platforms.
*/
function createProcessEnv(...sources) {
return Object.assign(utils_terminal_1.TERMINAL_INFO.windows ? utils_object_1.createCaseInsensitiveObject() : {}, ...sources);
}
exports.createProcessEnv = createProcessEnv;
/**
* Split a PATH string into path parts.
*/
function getPathParts(envpath = process.env.PATH || '') {
return envpath.split(pathlib.delimiter);
}
exports.getPathParts = getPathParts;
/**
* Resolves when the given amount of milliseconds has passed.
*/
async function sleep(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
}
exports.sleep = sleep;
/**
* Resolves when a given predicate is true or a timeout is reached.
*
* Configure `interval` to set how often the `predicate` is called.
*
* By default, `timeout` is Infinity. If given a value (in ms), and that
* timeout value is reached, this function will reject with
* the `ERROR_TIMEOUT_REACHED` error.
*/
async function sleepUntil(predicate, { interval = 30, timeout = Infinity }) {
let ms = 0;
while (!predicate()) {
await sleep(interval);
ms += interval;
if (ms > timeout) {
throw exports.ERROR_TIMEOUT_REACHED;
}
}
}
exports.sleepUntil = sleepUntil;
/**
* Never resolves and keeps Node running.
*/
async function sleepForever() {
return new Promise(() => {
setInterval(() => { }, 1000);
});
}
exports.sleepForever = sleepForever;
/**
* Register a synchronous function to be called once the process exits.
*/
function onExit(fn) {
onSignalExit(() => {
debug('onExit: process.exit/normal shutdown');
fn();
});
}
exports.onExit = onExit;
const exitFns = new Set();
/**
* Register an asynchronous function to be called when the process wants to
* exit.
*
* A handler will be registered for the 'SIGINT', 'SIGTERM', 'SIGHUP',
* 'SIGBREAK' signals. If any of the signal events is emitted, `fn` will be
* called exactly once, awaited upon, and then the process will exit once all
* registered functions are resolved.
*/
function onBeforeExit(fn) {
exitFns.add(fn);
}
exports.onBeforeExit = onBeforeExit;
/**
* Remove a function that was registered with `onBeforeExit`.
*/
function offBeforeExit(fn) {
exitFns.delete(fn);
}
exports.offBeforeExit = offBeforeExit;
const once = (fn) => {
let called = false;
return async () => {
if (!called) {
await fn();
called = true;
}
};
};
const beforeExitHandlerWrapper = (signal) => once(async () => {
debug('onBeforeExit handler: %O received', signal);
debug('onBeforeExit handler: running %O functions', exitFns.size);
await Promise.all([...exitFns.values()].map(async (fn) => {
try {
await fn();
}
catch (e) {
debug('onBeforeExit handler: error from function: %O', e);
}
}));
if (signal !== 'process.exit') {
debug('onBeforeExit handler: killing self (exit code %O, signal %O)', process.exitCode ? process.exitCode : 0, signal);
process.removeListener(signal, BEFORE_EXIT_SIGNAL_LISTENERS[signal]);
process.kill(process.pid, signal);
}
});
const BEFORE_EXIT_SIGNAL_LISTENERS = {
SIGINT: beforeExitHandlerWrapper('SIGINT'),
SIGTERM: beforeExitHandlerWrapper('SIGTERM'),
SIGHUP: beforeExitHandlerWrapper('SIGHUP'),
SIGBREAK: beforeExitHandlerWrapper('SIGBREAK'),
};
for (const [signal, fn] of Object.entries(BEFORE_EXIT_SIGNAL_LISTENERS)) {
process.on(signal, fn);
}
const processExitHandler = beforeExitHandlerWrapper('process.exit');
/**
* Asynchronous `process.exit()`, for running functions registered with
* `onBeforeExit`.
*/
async function processExit(exitCode = 0) {
process.exitCode = exitCode;
await processExitHandler();
debug('processExit: exiting (exit code: %O)', process.exitCode);
process.exit();
}
exports.processExit = processExit;

View File

@@ -0,0 +1,244 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.3.3](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.3.2...@ionic/utils-terminal@2.3.3) (2022-06-16)
**Note:** Version bump only for package @ionic/utils-terminal
## [2.3.2](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.3.1...@ionic/utils-terminal@2.3.2) (2022-05-09)
**Note:** Version bump only for package @ionic/utils-terminal
## [2.3.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.3.0...@ionic/utils-terminal@2.3.1) (2020-09-29)
### Bug Fixes
* add signal-exit dependency in correct place ([178e5e5](https://github.com/ionic-team/ionic-cli/commit/178e5e51cdc3593e3d096a5197e1dc0e17292bbd))
# [2.3.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.2.1...@ionic/utils-terminal@2.3.0) (2020-09-24)
### Features
* **format:** add more formatting utilities ([d30f099](https://github.com/ionic-team/ionic-cli/commit/d30f099f50df18816fb1d3064c434f1b318518a2))
* **format:** terminal prose formatting utils ([8912348](https://github.com/ionic-team/ionic-cli/commit/8912348ca348ae6192ddfff1af88f9c9443d205d))
## [2.2.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.2.0...@ionic/utils-terminal@2.2.1) (2020-08-28)
**Note:** Version bump only for package @ionic/utils-terminal
# [2.2.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.1.4...@ionic/utils-terminal@2.2.0) (2020-08-27)
### Features
* add some ansi escape codes + cursor wrapper ([edbdb57](https://github.com/ionic-team/ionic-cli/commit/edbdb572bfe2fb5710eff7e49a483c86601ba425))
## [2.1.4](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.1.3...@ionic/utils-terminal@2.1.4) (2020-08-25)
**Note:** Version bump only for package @ionic/utils-terminal
## [2.1.3](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.1.2...@ionic/utils-terminal@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-terminal@2.1.1...@ionic/utils-terminal@2.1.2) (2020-05-06)
**Note:** Version bump only for package @ionic/utils-terminal
## [2.1.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.1.0...@ionic/utils-terminal@2.1.1) (2020-03-03)
**Note:** Version bump only for package @ionic/utils-terminal
# 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-terminal@2.0.1...@ionic/utils-terminal@2.0.2) (2020-02-10)
**Note:** Version bump only for package @ionic/utils-terminal
## [2.0.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@2.0.0...@ionic/utils-terminal@2.0.1) (2020-02-03)
**Note:** Version bump only for package @ionic/utils-terminal
# [2.0.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@1.1.2...@ionic/utils-terminal@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.1.2](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@1.1.1...@ionic/utils-terminal@1.1.2) (2019-12-10)
### Bug Fixes
* **windows:** do not check TERM for windows detection ([ac4b417](https://github.com/ionic-team/ionic-cli/commit/ac4b417385c0c7859674e2ba59e495e9abc5bce4))
## [1.1.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@1.1.0...@ionic/utils-terminal@1.1.1) (2019-12-05)
**Note:** Version bump only for package @ionic/utils-terminal
# [1.1.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@1.0.5...@ionic/utils-terminal@1.1.0) (2019-11-21)
### Bug Fixes
* **shell:** use shell from NodeJS if available ([53d0afa](https://github.com/ionic-team/ionic-cli/commit/53d0afaea8966f7742220896a98da570c706fb63))
### Features
* **ci:** support GitHub Actions detection ([5646c8e](https://github.com/ionic-team/ionic-cli/commit/5646c8e083862dbf976cd6cdecabe209c0ad8cfd))
## [1.0.5](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@1.0.4...@ionic/utils-terminal@1.0.5) (2019-09-18)
**Note:** Version bump only for package @ionic/utils-terminal
## [1.0.4](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@1.0.3...@ionic/utils-terminal@1.0.4) (2019-08-23)
**Note:** Version bump only for package @ionic/utils-terminal
## [1.0.3](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@1.0.2...@ionic/utils-terminal@1.0.3) (2019-08-14)
**Note:** Version bump only for package @ionic/utils-terminal
## [1.0.2](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@1.0.1...@ionic/utils-terminal@1.0.2) (2019-08-07)
**Note:** Version bump only for package @ionic/utils-terminal
## [1.0.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@1.0.0...@ionic/utils-terminal@1.0.1) (2019-06-05)
**Note:** Version bump only for package @ionic/utils-terminal
# [1.0.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-terminal@0.0.1...@ionic/utils-terminal@1.0.0) (2019-05-29)
### chore
* require Node 8 ([5670e68](https://github.com/ionic-team/ionic-cli/commit/5670e68))
### Features
* include path to shell in terminal info ([79480b9](https://github.com/ionic-team/ionic-cli/commit/79480b9))
### 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-terminal

View 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.

View File

@@ -0,0 +1 @@
# @ionic/utils-terminal

View File

@@ -0,0 +1,19 @@
/**
* ANSI escape codes (WIP)
*
* @see https://en.wikipedia.org/wiki/ANSI_escape_code
*/
export declare class EscapeCode {
static readonly cursorLeft: () => string;
static readonly cursorUp: (count?: number) => string;
static readonly cursorDown: (count?: number) => string;
static readonly cursorForward: (count?: number) => string;
static readonly cursorBackward: (count?: number) => string;
static readonly cursorHide: () => string;
static readonly cursorShow: () => string;
static readonly eraseLine: () => string;
static readonly eraseLines: (count: number) => string;
static readonly eraseUp: () => string;
static readonly eraseDown: () => string;
static readonly eraseScreen: () => string;
}

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EscapeCode = void 0;
const ESC = '\u001B[';
/**
* ANSI escape codes (WIP)
*
* @see https://en.wikipedia.org/wiki/ANSI_escape_code
*/
class EscapeCode {
}
exports.EscapeCode = EscapeCode;
EscapeCode.cursorLeft = () => `${ESC}G`;
EscapeCode.cursorUp = (count = 1) => `${ESC}${count}A`;
EscapeCode.cursorDown = (count = 1) => `${ESC}${count}B`;
EscapeCode.cursorForward = (count = 1) => `${ESC}${count}C`;
EscapeCode.cursorBackward = (count = 1) => `${ESC}${count}D`;
EscapeCode.cursorHide = () => `${ESC}?25l`;
EscapeCode.cursorShow = () => `${ESC}?25h`;
EscapeCode.eraseLine = () => `${ESC}2K`;
EscapeCode.eraseLines = (count) => {
let seq = '';
for (let i = 0; i < count; i++) {
seq += EscapeCode.eraseLine();
if (i < count - 1) {
seq += EscapeCode.cursorUp();
}
}
return `${seq}${EscapeCode.cursorLeft()}`;
};
EscapeCode.eraseUp = () => `${ESC}1J`;
EscapeCode.eraseDown = () => `${ESC}J`;
EscapeCode.eraseScreen = () => `${ESC}2J`;

View File

@@ -0,0 +1,9 @@
/// <reference types="node" />
export declare class Cursor {
static stream: NodeJS.WriteStream;
private static _isVisible;
private static _listenerAttached;
static show(): void;
static hide(): void;
static toggle(): void;
}

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Cursor = void 0;
const onExit = require("signal-exit");
const ansi_1 = require("./ansi");
class Cursor {
static show() {
if (Cursor.stream.isTTY) {
Cursor._isVisible = true;
Cursor.stream.write(ansi_1.EscapeCode.cursorShow());
}
}
static hide() {
if (Cursor.stream.isTTY) {
if (!Cursor._listenerAttached) {
onExit(() => {
Cursor.show();
});
Cursor._listenerAttached = true;
}
Cursor._isVisible = false;
Cursor.stream.write(ansi_1.EscapeCode.cursorHide());
}
}
static toggle() {
if (Cursor._isVisible) {
Cursor.hide();
}
else {
Cursor.show();
}
}
}
exports.Cursor = Cursor;
Cursor.stream = process.stderr;
Cursor._isVisible = true;
Cursor._listenerAttached = false;

View File

@@ -0,0 +1,35 @@
import sliceAnsi = require('slice-ansi');
import stringWidth = require('string-width');
import stripAnsi = require('strip-ansi');
export { sliceAnsi, stringWidth, stripAnsi };
export declare const TTY_WIDTH: number;
export declare function indent(n?: number): string;
export interface WordWrapOptions {
width?: number;
indentation?: number;
append?: string;
}
export declare function wordWrap(msg: string, { width, indentation, append }: WordWrapOptions): string;
export declare function prettyPath(p: string): string;
export declare function expandPath(p: string): string;
export declare function generateFillSpaceStringList(list: string[], optimalLength?: number, fillCharacter?: string): string[];
export interface ColumnarOptions {
hsep?: string;
vsep?: string;
headers?: string[];
}
/**
* Basic CLI table generator with support for ANSI colors.
*
* @param rows 2-dimensional matrix containing cells. An array of columns,
* which are arrays of cells.
* @param options.vsep The vertical separator character, default is
* `chalk.dim('|')`. Supply an empty string to hide
* the separator altogether.
* @param options.hsep The horizontal separator character, default is
* `chalk.dim('-')`. This is used under the headers,
* if supplied. Supply an empty string to hide the
* separator altogether.
* @param options.headers An array of header cells.
*/
export declare function columnar(rows: string[][], { hsep, vsep, headers }: ColumnarOptions): string;

View File

@@ -0,0 +1,122 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.columnar = exports.generateFillSpaceStringList = exports.expandPath = exports.prettyPath = exports.wordWrap = exports.indent = exports.TTY_WIDTH = exports.stripAnsi = exports.stringWidth = exports.sliceAnsi = void 0;
const os = require("os");
const path = require("path");
const sliceAnsi = require("slice-ansi");
exports.sliceAnsi = sliceAnsi;
const stringWidth = require("string-width");
exports.stringWidth = stringWidth;
const stripAnsi = require("strip-ansi");
exports.stripAnsi = stripAnsi;
const wrapAnsi = require("wrap-ansi");
const untildify = require("untildify");
const MIN_TTY_WIDTH = 80;
const MAX_TTY_WIDTH = 120;
exports.TTY_WIDTH = process.stdout.columns ? Math.max(MIN_TTY_WIDTH, Math.min(process.stdout.columns, MAX_TTY_WIDTH)) : Infinity;
function indent(n = 4) {
return ' '.repeat(n);
}
exports.indent = indent;
function wordWrap(msg, { width = exports.TTY_WIDTH, indentation = 0, append = '' }) {
return wrapAnsi(msg, width - indentation - append.length, { trim: true }).split('\n').join(`${append}\n${indent(indentation)}`);
}
exports.wordWrap = wordWrap;
function prettyPath(p) {
p = expandPath(p);
const cwd = process.cwd();
const d = path.dirname(p);
const h = os.homedir();
const distanceFromCwd = Math.abs(d.split(path.sep).length - cwd.split(path.sep).length);
if (cwd === d) {
return '.' + path.sep + path.basename(p);
}
else if (d.startsWith(cwd)) {
return '.' + path.sep + p.substring(cwd.length + 1);
}
else if (distanceFromCwd <= 2) {
const rel = path.relative(cwd, p);
return rel ? rel : '.';
}
else if (p === h) {
return '~';
}
else if (p.indexOf(h) === 0) {
return '~' + path.sep + p.substring(h.length + 1);
}
return p;
}
exports.prettyPath = prettyPath;
function expandPath(p) {
return path.resolve(untildify(p));
}
exports.expandPath = expandPath;
function generateFillSpaceStringList(list, optimalLength = 1, fillCharacter = ' ') {
if (optimalLength < 2) {
optimalLength = 2;
}
const longestItem = Math.max(...list.map(item => stringWidth(item)));
const fullLength = longestItem > optimalLength ? longestItem + 1 : optimalLength;
const fullLengthString = fillCharacter.repeat(fullLength);
return list.map(item => sliceAnsi(fullLengthString, 0, fullLength - stringWidth(item)));
}
exports.generateFillSpaceStringList = generateFillSpaceStringList;
/**
* Basic CLI table generator with support for ANSI colors.
*
* @param rows 2-dimensional matrix containing cells. An array of columns,
* which are arrays of cells.
* @param options.vsep The vertical separator character, default is
* `chalk.dim('|')`. Supply an empty string to hide
* the separator altogether.
* @param options.hsep The horizontal separator character, default is
* `chalk.dim('-')`. This is used under the headers,
* if supplied. Supply an empty string to hide the
* separator altogether.
* @param options.headers An array of header cells.
*/
function columnar(rows, { hsep = '-', vsep = '|', headers }) {
const includeHeaders = headers ? true : false;
if (!rows[0]) {
return '';
}
const columnCount = headers ? headers.length : rows[0].length;
const columns = headers ?
headers.map(header => [header]) :
rows[0].map(() => []);
for (const row of rows) {
let highestLineCount = 0;
const splitRows = row.map(cell => {
const lines = cell.split('\n');
highestLineCount = Math.max(highestLineCount, lines.length);
return lines;
});
for (const rowIndex in row) {
if (columns[rowIndex]) {
columns[rowIndex].push(...splitRows[rowIndex], ...Array(highestLineCount - splitRows[rowIndex].length).fill(''));
}
}
}
const paddedColumns = columns.map((col, columnIndex) => {
if (columnIndex < columnCount - 1) {
const spaceCol = generateFillSpaceStringList(col);
return col.map((cell, cellIndex) => `${cell}${spaceCol[cellIndex]}${vsep === '' ? '' : `${vsep} `}`);
}
else {
return col;
}
});
let longestRowLength = 0;
const singleColumn = paddedColumns.reduce((a, b) => {
return a.map((_, i) => {
const r = a[i] + b[i];
longestRowLength = Math.max(longestRowLength, stringWidth(r));
return r;
});
});
if (includeHeaders && hsep !== '') {
singleColumn.splice(1, 0, hsep.repeat(longestRowLength));
}
return singleColumn.join('\n');
}
exports.columnar = columnar;

View File

@@ -0,0 +1,4 @@
export * from './ansi';
export * from './cursor';
export * from './format';
export * from './info';

View File

@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./ansi"), exports);
tslib_1.__exportStar(require("./cursor"), exports);
tslib_1.__exportStar(require("./format"), exports);
tslib_1.__exportStar(require("./info"), exports);

View File

@@ -0,0 +1,26 @@
/**
* These environment variables work for: GitHub Actions, Travis CI, CircleCI,
* Gitlab CI, AppVeyor, CodeShip, Jenkins, TeamCity, Bitbucket Pipelines, AWS
* CodeBuild
*/
export declare const CI_ENVIRONMENT_VARIABLES: readonly string[];
export declare const CI_ENVIRONMENT_VARIABLES_DETECTED: string[];
export interface TerminalInfo {
/**
* Whether this is in CI or not.
*/
readonly ci: boolean;
/**
* Path to the user's shell program.
*/
readonly shell: string;
/**
* Whether the terminal is an interactive TTY or not.
*/
readonly tty: boolean;
/**
* Whether this is a Windows shell or not.
*/
readonly windows: boolean;
}
export declare const TERMINAL_INFO: TerminalInfo;

View File

@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TERMINAL_INFO = exports.CI_ENVIRONMENT_VARIABLES_DETECTED = exports.CI_ENVIRONMENT_VARIABLES = void 0;
const Debug = require("debug");
const os = require("os");
const debug = Debug('ionic:utils-terminal:info');
/**
* These environment variables work for: GitHub Actions, Travis CI, CircleCI,
* Gitlab CI, AppVeyor, CodeShip, Jenkins, TeamCity, Bitbucket Pipelines, AWS
* CodeBuild
*/
exports.CI_ENVIRONMENT_VARIABLES = ['CI', 'BUILD_ID', 'BUILD_NUMBER', 'BITBUCKET_COMMIT', 'CODEBUILD_BUILD_ARN', 'GITHUB_ACTIONS'];
exports.CI_ENVIRONMENT_VARIABLES_DETECTED = exports.CI_ENVIRONMENT_VARIABLES.filter(v => !!process.env[v]);
function getShell() {
const { shell } = os.userInfo();
if (shell) {
return shell;
}
if (process.env.SHELL) {
return process.env.SHELL;
}
if (process.platform === 'darwin') {
return '/bin/bash';
}
if (process.platform === 'win32') {
return process.env.COMSPEC ? process.env.COMSPEC : 'cmd.exe';
}
return '/bin/sh';
}
if (exports.CI_ENVIRONMENT_VARIABLES_DETECTED.length > 0) {
debug(`Environment variables for CI detected: ${exports.CI_ENVIRONMENT_VARIABLES_DETECTED.join(', ')}`);
}
exports.TERMINAL_INFO = Object.freeze({
ci: exports.CI_ENVIRONMENT_VARIABLES_DETECTED.length > 0,
shell: getShell(),
tty: Boolean(process.stdin.isTTY && process.stdout.isTTY && process.stderr.isTTY),
windows: process.platform === 'win32' || !!(process.env.OSTYPE && /^(msys|cygwin)$/.test(process.env.OSTYPE) ||
process.env.MSYSTEM && /^MINGW(32|64)$/.test(process.env.MSYSTEM)),
});

View File

@@ -0,0 +1,58 @@
{
"name": "@ionic/utils-terminal",
"version": "2.3.3",
"description": "Terminal 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": ">=10.3.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": {
"@types/slice-ansi": "^4.0.0",
"debug": "^4.0.0",
"signal-exit": "^3.0.3",
"slice-ansi": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0",
"tslib": "^2.0.1",
"untildify": "^4.0.0",
"wrap-ansi": "^7.0.0"
},
"devDependencies": {
"@types/debug": "^4.1.1",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/signal-exit": "^3.0.0",
"@types/wrap-ansi": "^3.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.0.2"
},
"gitHead": "f090194e755912d7b8e659f4323c5c2804115c81"
}

54
node_modules/@ionic/utils-process/package.json generated vendored Normal file
View File

@@ -0,0 +1,54 @@
{
"name": "@ionic/utils-process",
"version": "2.1.10",
"description": "Process 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": ">=10.3.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-object": "2.1.5",
"@ionic/utils-terminal": "2.3.3",
"debug": "^4.0.0",
"signal-exit": "^3.0.3",
"tree-kill": "^1.2.2",
"tslib": "^2.0.1"
},
"devDependencies": {
"@types/debug": "^4.1.1",
"@types/jest": "^26.0.10",
"@types/node": "~10.17.13",
"@types/signal-exit": "^3.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.0.2"
},
"gitHead": "f090194e755912d7b8e659f4323c5c2804115c81"
}