Add capacitorjs runtime

This commit is contained in:
olcxja 2026-05-03 17:09:55 +02:00
commit f90c0e6c40
8362 changed files with 1502407 additions and 1 deletions

View file

@ -0,0 +1,19 @@
/**
* MIT License
from https://github.com/sindresorhus/detect-indent, copied here due to misconfigured package
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://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.
*/
export default function detectIndent(string: string): {
amount: number;
type: string | undefined;
indent: string;
};
//# sourceMappingURL=detect-indent.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"detect-indent.d.ts","sourceRoot":"","sources":["../../src/util/detect-indent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AA4HF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAM,EAAE,MAAM;;;;EA4BlD"}

View file

@ -0,0 +1,140 @@
"use strict";
/**
* MIT License
from https://github.com/sindresorhus/detect-indent, copied here due to misconfigured package
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
// Detect either spaces or tabs but not both to properly handle tabs for indentation and spaces for alignment
const INDENT_REGEX = /^(?:( )+|\t+)/;
const INDENT_TYPE_SPACE = 'space';
const INDENT_TYPE_TAB = 'tab';
/**
Make a Map that counts how many indents/unindents have occurred for a given size and how many lines follow a given indentation.
The key is a concatenation of the indentation type (s = space and t = tab) and the size of the indents/unindents.
```
indents = {
t3: [1, 0],
t4: [1, 5],
s5: [1, 0],
s12: [1, 0],
}
```
*/
function makeIndentsMap(string, ignoreSingleSpaces) {
const indents = new Map();
// Remember the size of previous line's indentation
let previousSize = 0;
let previousIndentType;
// Indents key (ident type + size of the indents/unindents)
let key;
for (const line of string.split(/\n/g)) {
if (!line) {
// Ignore empty lines
continue;
}
let indent;
let indentType;
let weight;
let entry;
const matches = line.match(INDENT_REGEX);
if (matches === null) {
previousSize = 0;
previousIndentType = '';
}
else {
indent = matches[0].length;
indentType = matches[1] ? INDENT_TYPE_SPACE : INDENT_TYPE_TAB;
// Ignore single space unless it's the only indent detected to prevent common false positives
if (ignoreSingleSpaces && indentType === INDENT_TYPE_SPACE && indent === 1) {
continue;
}
if (indentType !== previousIndentType) {
previousSize = 0;
}
previousIndentType = indentType;
weight = 0;
const indentDifference = indent - previousSize;
previousSize = indent;
// Previous line have same indent?
if (indentDifference === 0) {
weight++;
// We use the key from previous loop
}
else {
const absoluteIndentDifference = indentDifference > 0 ? indentDifference : -indentDifference;
key = encodeIndentsKey(indentType, absoluteIndentDifference);
}
// Update the stats
entry = indents.get(key);
entry = entry === undefined ? [1, 0] : [++entry[0], entry[1] + weight];
indents.set(key, entry);
}
}
return indents;
}
// Encode the indent type and amount as a string (e.g. 's4') for use as a compound key in the indents Map.
function encodeIndentsKey(indentType, indentAmount) {
const typeCharacter = indentType === INDENT_TYPE_SPACE ? 's' : 't';
return typeCharacter + String(indentAmount);
}
// Extract the indent type and amount from a key of the indents Map.
function decodeIndentsKey(indentsKey) {
const keyHasTypeSpace = indentsKey[0] === 's';
const type = keyHasTypeSpace ? INDENT_TYPE_SPACE : INDENT_TYPE_TAB;
const amount = Number(indentsKey.slice(1));
return { type, amount };
}
// Return the key (e.g. 's4') from the indents Map that represents the most common indent,
// or return undefined if there are no indents.
function getMostUsedKey(indents) {
let result;
let maxUsed = 0;
let maxWeight = 0;
for (const [key, [usedCount, weight]] of indents) {
if (usedCount > maxUsed || (usedCount === maxUsed && weight > maxWeight)) {
maxUsed = usedCount;
maxWeight = weight;
result = key;
}
}
return result;
}
function makeIndentString(type, amount) {
const indentCharacter = type === INDENT_TYPE_SPACE ? ' ' : '\t';
return indentCharacter.repeat(amount);
}
function detectIndent(string) {
if (typeof string !== 'string') {
throw new TypeError('Expected a string');
}
// Identify indents while skipping single space indents to avoid common edge cases (e.g. code comments)
// If no indents are identified, run again and include all indents for comprehensive detection
let indents = makeIndentsMap(string, true);
if (indents.size === 0) {
indents = makeIndentsMap(string, false);
}
const keyOfMostUsedIndent = getMostUsedKey(indents);
let type;
let amount = 0;
let indent = '';
if (keyOfMostUsedIndent !== undefined) {
({ type, amount } = decodeIndentsKey(keyOfMostUsedIndent));
indent = makeIndentString(type, amount);
}
return {
amount,
type,
indent,
};
}
exports.default = detectIndent;
//# sourceMappingURL=detect-indent.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"detect-indent.js","sourceRoot":"","sources":["../../src/util/detect-indent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;EAYE;;AAEF,6GAA6G;AAC7G,MAAM,YAAY,GAAG,eAAe,CAAC;AAErC,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAClC,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B;;;;;;;;;;;EAWE;AACF,SAAS,cAAc,CAAC,MAAc,EAAE,kBAA2B;IACjE,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAE1B,mDAAmD;IACnD,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,kBAAkB,CAAC;IAEvB,2DAA2D;IAC3D,IAAI,GAAG,CAAC;IAER,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACtC,IAAI,CAAC,IAAI,EAAE;YACT,qBAAqB;YACrB,SAAS;SACV;QAED,IAAI,MAAM,CAAC;QACX,IAAI,UAAU,CAAC;QACf,IAAI,MAAM,CAAC;QACX,IAAI,KAAK,CAAC;QACV,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAEzC,IAAI,OAAO,KAAK,IAAI,EAAE;YACpB,YAAY,GAAG,CAAC,CAAC;YACjB,kBAAkB,GAAG,EAAE,CAAC;SACzB;aAAM;YACL,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAC3B,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe,CAAC;YAE9D,6FAA6F;YAC7F,IAAI,kBAAkB,IAAI,UAAU,KAAK,iBAAiB,IAAI,MAAM,KAAK,CAAC,EAAE;gBAC1E,SAAS;aACV;YAED,I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,CAAC,CAAC;KACzC;IAED,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAEpD,IAAI,IAAI,CAAC;IACT,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,mBAAmB,KAAK,SAAS,EAAE;QACrC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAC3D,MAAM,GAAG,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KACzC;IAED,OAAO;QACL,MAAM;QACN,IAAI;QACJ,MAAM;KACP,CAAC;AACJ,CAAC;AA5BD,+BA4BC"}

2
node_modules/@trapezedev/project/dist/util/fs.d.ts generated vendored Normal file
View file

@ -0,0 +1,2 @@
export declare function assertParentDirs(path: string): Promise<void>;
//# sourceMappingURL=fs.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/util/fs.ts"],"names":[],"mappings":"AAGA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,iBAGlD"}

11
node_modules/@trapezedev/project/dist/util/fs.js generated vendored Normal file
View file

@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertParentDirs = void 0;
const utils_fs_1 = require("@ionic/utils-fs");
const path_1 = require("path");
async function assertParentDirs(path) {
const dirs = (0, path_1.dirname)(path);
await (0, utils_fs_1.mkdirp)(dirs);
}
exports.assertParentDirs = assertParentDirs;
//# sourceMappingURL=fs.js.map

1
node_modules/@trapezedev/project/dist/util/fs.js.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/util/fs.ts"],"names":[],"mappings":";;;AAAA,8CAAqD;AACrD,+BAA+B;AAExB,KAAK,UAAU,gBAAgB,CAAC,IAAY;IACjD,MAAM,IAAI,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC;IAC3B,MAAM,IAAA,iBAAM,EAAC,IAAI,CAAC,CAAC;AACrB,CAAC;AAHD,4CAGC"}

View file

@ -0,0 +1,2 @@
export declare function compare(version1: string, version2: string): number;
//# sourceMappingURL=gradle-versions.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"gradle-versions.d.ts","sourceRoot":"","sources":["../../src/util/gradle-versions.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UA+BzD"}

View file

@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.compare = void 0;
function compare(version1, version2) {
// Split the version strings into arrays of individual version components
const version1Components = version1.split('.');
const version2Components = version2.split('.');
// Iterate through each component of the version strings
for (let i = 0; i < version1Components.length || i < version2Components.length; i++) {
// Convert the current component to a number (or NaN if it can't be converted)
const version1Component = Number(version1Components[i]);
const version2Component = Number(version2Components[i]);
// If one of the components is NaN (not a number), we need to handle it differently
if (isNaN(version1Component) || isNaN(version2Component)) {
// Compare the non-numeric components as strings
const stringCompareResult = compareStringComponents(version1Components[i], version2Components[i]);
if (stringCompareResult !== 0) {
return stringCompareResult;
}
}
else {
// Compare the numeric components
if (version1Component > version2Component) {
return 1;
}
else if (version1Component < version2Component) {
return -1;
}
}
}
// If we've made it this far, the versions are either equal or one is a prefix of the other
// In either case, we consider them equal
return 0;
}
exports.compare = compare;
function compareStringComponents(str1, str2) {
if (str1 === str2) {
return 0;
}
else if (str1 === undefined) {
return -1;
}
else if (str2 === undefined) {
return 1;
}
else {
return str1.localeCompare(str2);
}
}
//# sourceMappingURL=gradle-versions.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"gradle-versions.js","sourceRoot":"","sources":["../../src/util/gradle-versions.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,QAAgB,EAAE,QAAgB;IACxD,yEAAyE;IACzE,MAAM,kBAAkB,GAA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AC;KACV;SAAM;QACL,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KACjC;AACH,CAAC"}

10
node_modules/@trapezedev/project/dist/util/pbx.d.ts generated vendored Normal file
View file

@ -0,0 +1,10 @@
export declare function parsePbxProject(filename: string): Promise<any>;
/**
* PBX files are esoteric. Based on http://danwright.info/blog/2010/10/xcode-pbxproject-files/
* we try to quote strings that need to be quoted. Right now
* that test is just for a few characters but there may be
* more that we need here
*/
export declare function pbxSerializeString(value: string): string;
export declare function pbxReadString(value: string): string;
//# sourceMappingURL=pbx.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"pbx.d.ts","sourceRoot":"","sources":["../../src/util/pbx.ts"],"names":[],"mappings":"AAGA,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAOpE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,UAK/C;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,UAM1C"}

40
node_modules/@trapezedev/project/dist/util/pbx.js generated vendored Normal file
View file

@ -0,0 +1,40 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.pbxReadString = exports.pbxSerializeString = exports.parsePbxProject = void 0;
const xcode_1 = __importDefault(require("xcode"));
const utils_fs_1 = require("@ionic/utils-fs");
async function parsePbxProject(filename) {
if (!(await (0, utils_fs_1.pathExists)(filename))) {
throw new Error(`pbxproj file does not exist at ${filename}`);
}
const proj = xcode_1.default.project(filename);
return proj.parseSync();
}
exports.parsePbxProject = parsePbxProject;
/**
* PBX files are esoteric. Based on http://danwright.info/blog/2010/10/xcode-pbxproject-files/
* we try to quote strings that need to be quoted. Right now
* that test is just for a few characters but there may be
* more that we need here
*/
function pbxSerializeString(value) {
if (/[\s;]/.test(value)) {
return `"${value}"`;
}
return value;
}
exports.pbxSerializeString = pbxSerializeString;
// Remove any quotes at the beginning and end of the string value
function pbxReadString(value) {
if (typeof value === 'string') {
return value === null || value === void 0 ? void 0 : value.replace(/(^")+|("$)+/g, '');
}
else {
return value;
}
}
exports.pbxReadString = pbxReadString;
//# sourceMappingURL=pbx.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"pbx.js","sourceRoot":"","sources":["../../src/util/pbx.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8CAA6C;AAEtC,KAAK,UAAU,eAAe,CAAC,QAAgB;IACpD,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAU,EAAC,QAAQ,CAAC,CAAC,EAAE;QACjC,MAAM,IAAI,KAAK,CAAC,kCAAkC,QAAQ,EAAE,CAAC,CAAC;KAC/D;IAED,MAAM,IAAI,GAAG,eAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;AAC1B,CAAC;AAPD,0CAOC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QACvB,OAAO,IAAI,KAAK,GAAG,CAAC;KACrB;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,gDAKC;AAED,iEAAiE;AACjE,SAAgB,aAAa,CAAC,KAAa;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;KAC3C;SAAM;QACL,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAND,sCAMC"}

View file

@ -0,0 +1,4 @@
import { PlistObject } from 'plist';
export declare function parsePlist(filename: string): Promise<PlistObject>;
export declare function parsePlistString(contents: string): PlistObject;
//# sourceMappingURL=plist.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"plist.d.ts","sourceRoot":"","sources":["../../src/util/plist.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAK3C,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAYvE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAS9D"}

31
node_modules/@trapezedev/project/dist/util/plist.js generated vendored Normal file
View file

@ -0,0 +1,31 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.parsePlistString = exports.parsePlist = void 0;
const plist_1 = __importDefault(require("plist"));
const utils_fs_1 = require("@ionic/utils-fs");
const lodash_1 = require("lodash");
async function parsePlist(filename) {
const contents = await (0, utils_fs_1.readFile)(filename, { encoding: 'utf-8' });
const parsed = plist_1.default.parse(contents);
// If the plist is empty an empty array will come back
// which is not what we want
if ((0, lodash_1.isEmpty)(parsed)) {
return {};
}
return parsed;
}
exports.parsePlist = parsePlist;
function parsePlistString(contents) {
const parsed = plist_1.default.parse(contents);
// If the plist is empty an empty array will come back
// which is not what we want
if ((0, lodash_1.isEmpty)(parsed)) {
return {};
}
return parsed;
}
exports.parsePlistString = parsePlistString;
//# sourceMappingURL=plist.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"plist.js","sourceRoot":"","sources":["../../src/util/plist.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA2C;AAC3C,8CAA2C;AAC3C,mCAAmD;AAG5C,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC/C,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAEjE,MAAM,MAAM,GAAG,eAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAErC,sDAAsD;IACtD,4BAA4B;IAC5B,IAAI,IAAA,gBAAO,EAAC,MAAM,CAAC,EAAE;QACnB,OAAO,EAAE,CAAC;KACX;IAED,OAAO,MAAqB,CAAC;AAC/B,CAAC;AAZD,gCAYC;AAED,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,MAAM,GAAG,eAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrC,sDAAsD;IACtD,4BAA4B;IAC5B,IAAI,IAAA,gBAAO,EAAC,MAAM,CAAC,EAAE;QACnB,OAAO,EAAE,CAAC;KACX;IAED,OAAO,MAAqB,CAAC;AAC/B,CAAC;AATD,4CASC"}

View file

@ -0,0 +1,5 @@
export declare function parseProperties(filename: string): Promise<{
[key: string]: any;
}>;
export declare function writeProperties(filename: string, data: any): Promise<void>;
//# sourceMappingURL=properties.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src/util/properties.ts"],"names":[],"mappings":"AAGA,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM;;GAGrD;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,iBAGhE"}

View file

@ -0,0 +1,19 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.writeProperties = exports.parseProperties = void 0;
const utils_fs_1 = require("@ionic/utils-fs");
const ini_1 = __importDefault(require("ini"));
async function parseProperties(filename) {
const data = await (0, utils_fs_1.readFile)(filename, { encoding: 'utf-8' });
return ini_1.default.parse(data);
}
exports.parseProperties = parseProperties;
async function writeProperties(filename, data) {
const serialized = ini_1.default.stringify(data);
return (0, utils_fs_1.writeFile)(filename, data);
}
exports.writeProperties = writeProperties;
//# sourceMappingURL=properties.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../src/util/properties.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsD;AACtD,8CAAsB;AAEf,KAAK,UAAU,eAAe,CAAC,QAAgB;IACpD,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAA;IAC5D,OAAO,aAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAHD,0CAGC;AAEM,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,IAAS;IAC/D,MAAM,UAAU,GAAG,aAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,IAAA,oBAAS,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAHD,0CAGC"}

View file

@ -0,0 +1,14 @@
export declare function parseStrings(contents: string): StringsEntries;
export interface StringsEntry {
comment?: string;
key?: string;
value?: string;
content?: string;
startLine: number;
startCol: number;
endLine: number;
endCol: number;
}
export type StringsEntries = StringsEntry[];
export declare function generateStrings(entries: StringsEntries): string;
//# sourceMappingURL=strings.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/util/strings.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAE7D;AAWD,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,cAAc,GAAG,YAAY,EAAE,CAAC;AAsJ5C,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,UAMtD"}

192
node_modules/@trapezedev/project/dist/util/strings.js generated vendored Normal file
View file

@ -0,0 +1,192 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateStrings = exports.parseStrings = void 0;
function parseStrings(contents) {
return parse(contents);
}
exports.parseStrings = parseStrings;
var State;
(function (State) {
State["None"] = "none";
State["Comment"] = "comment";
State["Key"] = "key";
State["AfterKey"] = "afterkey";
State["Value"] = "value";
State["AfterValue"] = "aftervalue";
})(State || (State = {}));
function parse(contents) {
let state = State.None;
let comment = "";
let whitespace = "";
let key = "";
let value = "";
let entries = [];
let line = 1;
let col = 1;
let startLine = 0;
let endLine = 0;
let startCol = 0;
let endCol = 0;
function setState(s) {
state = s;
}
for (let i = 0; i < contents.length; i++) {
const c = contents[i];
if (isNewLine(c)) {
// Keep track of lines
whitespace += c;
++line;
col = 0;
}
else if (isStartComment(c, contents[i + 1])) {
// Comment start, step forward one character
++i;
// Commit any whitespace up to this point
commitEntry(entries, {
content: whitespace,
startLine, startCol, endLine, endCol
});
// Mark starting source location
startCol = col;
startLine = line;
// Clear state
comment = "";
whitespace = "";
setState(State.Comment);
}
else if (isEndComment(c, contents[i + 1])) {
// Comment end, step forward one character
++i;
// Commit the comment
endLine = line;
endCol = col;
commitEntry(entries, {
comment, startLine, startCol, endLine, endCol
});
comment = "";
whitespace = "";
setState(State.None);
}
else if (state === State.Comment) {
// Build the comment
comment += c;
}
else if (isEquals(c) && (state === State.AfterKey || state === State.AfterValue)) {
// Valid state, do nothing
}
else if (isQuote(c)) {
// Quote encountered, check state
if (state === State.None) {
endLine = line;
endCol = col;
commitEntry(entries, {
content: whitespace,
startLine, startCol, endLine, endCol
});
startLine = line;
startCol = col;
setState(State.Key);
key = "";
whitespace = "";
}
else if (state === State.Key) {
// Key ends
setState(State.AfterKey);
}
else if (state === State.AfterKey) {
// Start of value
setState(State.Value);
value = "";
}
else if (state === State.Value) {
// End of value, commit it
setState(State.AfterValue);
}
}
else if (isSemi(c) && (state === State.AfterValue)) {
endLine = line;
endCol = col;
commitEntry(entries, {
key, value, startLine, startCol, endLine, endCol
});
// Clear state
comment = "";
whitespace = "";
key = "";
value = "";
setState(State.None);
}
else if (state === State.Key) {
// Build the key
key += c;
}
else if (state === State.Value) {
// Build the value
value += c;
}
else if (isWhitespace(c)) {
// Valid to have whitespace before/after lines
whitespace += c;
}
else if (isSemi(c)) {
// Valid state?
}
else {
throw new Error(`Error parsing .strings file: unknown character at ${line}:${col}`);
}
++col;
}
return entries;
}
function commitEntry(entries, entry) {
entries.push(entry);
}
function isNewLine(c) {
return c === '\n';
}
function isStartComment(c, c2) {
return c === '/' && c2 === '*';
}
function isEndComment(c, c2) {
return c === '*' && c2 === '/';
}
function isQuote(c) {
return c === '"';
}
function isEquals(c) {
return c === '=';
}
function isWhitespace(c) {
return isSpace(c) || isTab(c);
}
function isSpace(c) {
return c === ' ';
}
function isTab(c) {
return c === '\t';
}
function isSemi(c) {
return c === ';';
}
function generateStrings(entries) {
const lines = [];
for (const entry of entries) {
lines.push(...generateLines(entry));
}
return lines.join('');
}
exports.generateStrings = generateStrings;
function generateLines(entry) {
const lines = [];
if (entry.comment) {
lines.push(`/*${entry.comment}*/`);
}
else if (entry.key) {
lines.push(`"${entry.key}" = "${entry.value}";`);
}
else if (entry.content) {
lines.push(entry.content);
}
return lines;
}
//# sourceMappingURL=strings.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,3 @@
export declare function runCommand(command: string, args: string[], options?: {}): Promise<string>;
export declare function spawnCommand(command: string, args: string[], options?: any): Promise<string>;
//# sourceMappingURL=subprocess.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"subprocess.d.ts","sourceRoot":"","sources":["../../src/util/subprocess.ts"],"names":[],"mappings":"AAIA,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAwB/F;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,GAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BtG"}

View file

@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.spawnCommand = exports.runCommand = void 0;
const utils_subprocess_1 = require("@ionic/utils-subprocess");
const cross_spawn_1 = require("cross-spawn");
async function runCommand(command, args, options = {}) {
// console.log(chalk`> {bold ${command} ${args.join(" ")}}`);
const p = new utils_subprocess_1.Subprocess(command, args, options);
try {
// return await p.output();
await p.run();
return p.output();
}
catch (e) {
if (e instanceof utils_subprocess_1.SubprocessError) {
// old behavior of just throwing the stdout/stderr strings
throw e.output
? e.output
: e.code
? e.code
: e.error
? e.error.message
: "Unknown error";
}
throw e;
}
}
exports.runCommand = runCommand;
async function spawnCommand(command, args, options = {}) {
return new Promise((resolve, reject) => {
var _a, _b;
const child = (0, cross_spawn_1.spawn)(command, args, options);
const stderr = [];
const stdout = [];
(_a = child.stdout) === null || _a === void 0 ? void 0 : _a.addListener('data', e => {
stdout.push(e.toString());
});
(_b = child.stderr) === null || _b === void 0 ? void 0 : _b.addListener('data', e => {
if (options.combineStreams) {
stdout.push(e.toString());
}
else {
stderr.push(e.toString());
}
});
child.on('exit', e => {
});
child.on('error', e => {
reject(e);
});
child.on('close', e => {
if (e) {
reject(stderr.join());
}
else {
resolve(stdout.join(''));
}
});
});
}
exports.spawnCommand = spawnCommand;
//# sourceMappingURL=subprocess.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"subprocess.js","sourceRoot":"","sources":["../../src/util/subprocess.ts"],"names":[],"mappings":";;;AAAA,8DAAsE;AACtE,6CAAoC;AAG7B,KAAK,UAAU,UAAU,CAAC,OAAe,EAAE,IAAc,EAAE,OAAO,GAAG,EAAE;IAC5E,6DAA6D;IAE7D,MAAM,CAAC,GAAG,IAAI,6BAAU,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAEjD,IAA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AC3B;QACH,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;QACrB,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;YACpB,MAAM,CAAC,CAAC,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;YACpB,IAAI,CAAC,EAAE;gBACL,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;aACvB;iBAAM;gBACL,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;aAC1B;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AA5BD,oCA4BC"}

3
node_modules/@trapezedev/project/dist/util/text.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
export declare function indent(s: string, char: string, amount: number): string;
export declare function getIndentation(line: string): string | undefined;
//# sourceMappingURL=text.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/util/text.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAqB7D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,sBAE1C"}

32
node_modules/@trapezedev/project/dist/util/text.js generated vendored Normal file
View file

@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getIndentation = exports.indent = void 0;
function indent(s, char, amount) {
if (amount < 0) {
return '';
}
const lines = s.split(/\r?\n/);
const indentChars = new Array(amount).fill(char).join('');
const indentedLines = lines.map((l, i) => {
// Don't indent empty lines that are first/last as those are just filler newlines
if (l === '') {
// If this is the first line, return the indented line
if (i === 0) {
return indentChars;
}
else if (i === lines.length - 1) {
return '';
}
}
return indentChars + l;
});
return indentedLines.join('\n');
}
exports.indent = indent;
;
function getIndentation(line) {
var _a;
return (_a = line.match(/(^\s+)/)) === null || _a === void 0 ? void 0 : _a[0];
}
exports.getIndentation = getIndentation;
//# sourceMappingURL=text.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/util/text.ts"],"names":[],"mappings":";;;AAAA,SAAgB,MAAM,CAAC,CAAS,EAAE,IAAY,EAAE,MAAc;IAC5D,IAAI,MAAM,GAAG,CAAC,EAAE;QACd,OAAO,EAAE,CAAC;KACX;IACD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAE/B,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE1D,MAAM,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACvC,iFAAiF;QACjF,IAAI,CAAC,KAAK,EAAE,EAAE;YACZ,sDAAsD;YACtD,IAAI,CAAC,KAAK,CAAC,EAAE;gBACX,OAAO,WAAW,CAAC;aACpB;iBAAM,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBACjC,OAAO,EAAE,CAAC;aACX;SACF;QACD,OAAO,WAAW,GAAG,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AArBD,wBAqBC;AAAA,CAAC;AAEF,SAAgB,cAAc,CAAC,IAAY;;IACzC,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,0CAAG,CAAC,CAAC,CAAC;AACnC,CAAC;AAFD,wCAEC"}

7
node_modules/@trapezedev/project/dist/util/xml.d.ts generated vendored Normal file
View file

@ -0,0 +1,7 @@
/// <reference lib="dom" />
export declare function parseXml(filename: string): Promise<Document>;
export declare function parseXmlString(contents: string): Document;
export declare function serializeXml(doc: any): string;
export declare function formatXml(doc: any): Promise<string>;
export declare function writeXml(doc: any, filename: string): Promise<void>;
//# sourceMappingURL=xml.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"xml.d.ts","sourceRoot":"","sources":["../../src/util/xml.ts"],"names":[],"mappings":";AAQA,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,qBAM9C;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,YAE9C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,UAEpC;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,GAAG,mBAgBvC;AAED,wBAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,iBAGxD"}

72
node_modules/@trapezedev/project/dist/util/xml.js generated vendored Normal file
View file

@ -0,0 +1,72 @@
"use strict";
/// <reference lib="dom" />
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.writeXml = exports.formatXml = exports.serializeXml = exports.parseXmlString = exports.parseXml = void 0;
const path_1 = require("path");
const utils_fs_1 = require("@ionic/utils-fs");
const xmldom_1 = __importStar(require("@xmldom/xmldom"));
const standalone_1 = __importDefault(require("prettier/standalone"));
const plugin_xml_1 = __importDefault(require("@prettier/plugin-xml"));
async function parseXml(filename) {
let contents = await (0, utils_fs_1.readFile)(filename, { encoding: 'utf-8' });
if (!contents) {
contents = '<?xml version="1.0" encoding="utf-8" ?>\n<root />';
}
return new xmldom_1.default.DOMParser().parseFromString(contents);
}
exports.parseXml = parseXml;
function parseXmlString(contents) {
return new xmldom_1.default.DOMParser().parseFromString(contents);
}
exports.parseXmlString = parseXmlString;
function serializeXml(doc) {
return new xmldom_1.XMLSerializer().serializeToString(doc);
}
exports.serializeXml = serializeXml;
async function formatXml(doc) {
var xml = new xmldom_1.XMLSerializer().serializeToString(doc);
const p = (0, path_1.dirname)(require.resolve('@prettier/plugin-xml'));
const formatted = standalone_1.default.format(xml, {
parser: 'xml',
printWidth: 120,
bracketSameLine: true,
xmlWhitespaceSensitivity: 'ignore',
tabWidth: 4,
pluginSearchDirs: [p],
plugins: [plugin_xml_1.default]
});
return formatted;
}
exports.formatXml = formatXml;
async function writeXml(doc, filename) {
const formatted = await formatXml(doc);
return (0, utils_fs_1.writeFile)(filename, formatted);
}
exports.writeXml = writeXml;
//# sourceMappingURL=xml.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"xml.js","sourceRoot":"","sources":["../../src/util/xml.ts"],"names":[],"mappings":";AAAA,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3B,+BAA+B;AAC/B,8CAAsD;AACtD,yDAAuD;AACvD,qEAA2C;AAC3C,sEAA+C;AAExC,KAAK,UAAU,QAAQ,CAAC,QAAgB;IAC7C,IAAI,QAAQ,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,OAAO,E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