forked from olcxjas-softworks/LarpixClient
Add capacitorjs runtime
This commit is contained in:
parent
d0ece489ee
commit
f90c0e6c40
8362 changed files with 1502407 additions and 1 deletions
21
node_modules/@ionic/utils-process/LICENSE
generated
vendored
Normal file
21
node_modules/@ionic/utils-process/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
node_modules/@ionic/utils-process/README.md
generated
vendored
Normal file
1
node_modules/@ionic/utils-process/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
# @ionic/utils-process
|
||||
63
node_modules/@ionic/utils-process/dist/index.d.ts
generated
vendored
Normal file
63
node_modules/@ionic/utils-process/dist/index.d.ts
generated
vendored
Normal 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>;
|
||||
159
node_modules/@ionic/utils-process/dist/index.js
generated
vendored
Normal file
159
node_modules/@ionic/utils-process/dist/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
"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 tslib_1 = require("tslib");
|
||||
const utils_object_1 = require("@ionic/utils-object");
|
||||
const utils_terminal_1 = require("@ionic/utils-terminal");
|
||||
const debug_1 = require("debug");
|
||||
const pathlib = tslib_1.__importStar(require("path"));
|
||||
const signal_exit_1 = tslib_1.__importDefault(require("signal-exit"));
|
||||
const tree_kill_1 = tslib_1.__importDefault(require("tree-kill"));
|
||||
const debug = (0, debug_1.debug)('ionic:utils-process');
|
||||
exports.ERROR_TIMEOUT_REACHED = new Error('TIMEOUT_REACHED');
|
||||
function killProcessTree(pid, signal = 'SIGTERM') {
|
||||
return new Promise((resolve, reject) => {
|
||||
(0, tree_kill_1.default)(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 ? (0, 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) {
|
||||
(0, signal_exit_1.default)(() => {
|
||||
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;
|
||||
53
node_modules/@ionic/utils-process/package.json
generated
vendored
Normal file
53
node_modules/@ionic/utils-process/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"name": "@ionic/utils-process",
|
||||
"version": "2.1.12",
|
||||
"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": ">=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-object": "2.1.6",
|
||||
"@ionic/utils-terminal": "2.3.5",
|
||||
"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": "~16.0.0",
|
||||
"@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.8.0"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue