first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

21
node_modules/@expo/osascript/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
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.

31
node_modules/@expo/osascript/README.md generated vendored Normal file
View File

@@ -0,0 +1,31 @@
<!-- Title -->
<h1 align="center">
👋 Welcome to <br><code>@expo/osascript</code>
</h1>
<p align="center">Tools for running osascripts in Node.</p>
<p align="center">
<img src="https://flat.badgen.net/packagephobia/install/@expo/osascript">
<a href="https://www.npmjs.com/package/@expo/osascript">
<img src="https://flat.badgen.net/npm/dw/@expo/osascript" target="_blank" />
</a>
</p>
<!-- Body -->
## Example
```sh
ccheever@Charless-MacBook-Air:~/projects/osascript$nesh -y
.Node v4.1.0
Type .help for more information
nesh*> .require .
osascript = require("/Users/ccheever/projects/osascript")
nesh*> yield osascript.execAsync('tell app "System Events" to count processes whose name is "Simulator"')
'1\n'
nesh*> yield osascript.spawnAsync('quit app "Safari"')
0
nesh*>
```

16
node_modules/@expo/osascript/build/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import { SpawnOptions, SpawnResult } from '@expo/spawn-async';
declare function osascriptSpawnAsync(script: string | string[], opts?: SpawnOptions): Promise<SpawnResult>;
declare function isAppRunningAsync(appName: string): Promise<boolean>;
declare function safeIdOfAppAsync(appName: string): Promise<string | null>;
declare function openFinderToFolderAsync(dir: string, activate?: boolean): Promise<void>;
declare function openInAppAsync(appName: string, pth: string): Promise<SpawnResult>;
declare function chooseAppAsync(listOfAppNames: string[]): Promise<string | null>;
declare function chooseEditorAppAsync(preferredEditor?: string): Promise<string | null>;
declare function chooseTerminalAppAsync(): Promise<string | null>;
declare function openInEditorAsync(pth: string, preferredEditor?: string): Promise<SpawnResult>;
declare function openItermToSpecificFolderAsync(dir: string): Promise<SpawnResult>;
declare function openTerminalToSpecificFolderAsync(dir: string, inTab?: boolean): Promise<SpawnResult>;
declare function openFolderInTerminalAppAsync(dir: string, inTab?: boolean): Promise<SpawnResult>;
/** @deprecated */
declare function osascriptExecAsync(script: string | string[], opts?: SpawnOptions): Promise<string>;
export { chooseAppAsync, chooseEditorAppAsync, chooseTerminalAppAsync, osascriptExecAsync as execAsync, isAppRunningAsync, openFinderToFolderAsync, openFolderInTerminalAppAsync, openInAppAsync, openInEditorAsync, openItermToSpecificFolderAsync, openTerminalToSpecificFolderAsync, safeIdOfAppAsync, osascriptSpawnAsync as spawnAsync, };

184
node_modules/@expo/osascript/build/index.js generated vendored Normal file
View File

@@ -0,0 +1,184 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.chooseAppAsync = chooseAppAsync;
exports.chooseEditorAppAsync = chooseEditorAppAsync;
exports.chooseTerminalAppAsync = chooseTerminalAppAsync;
exports.execAsync = osascriptExecAsync;
exports.isAppRunningAsync = isAppRunningAsync;
exports.openFinderToFolderAsync = openFinderToFolderAsync;
exports.openFolderInTerminalAppAsync = openFolderInTerminalAppAsync;
exports.openInAppAsync = openInAppAsync;
exports.openInEditorAsync = openInEditorAsync;
exports.openItermToSpecificFolderAsync = openItermToSpecificFolderAsync;
exports.openTerminalToSpecificFolderAsync = openTerminalToSpecificFolderAsync;
exports.safeIdOfAppAsync = safeIdOfAppAsync;
exports.spawnAsync = osascriptSpawnAsync;
const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
const path_1 = __importDefault(require("path"));
const util_1 = __importDefault(require("util"));
function osascriptArgs(script) {
if (!Array.isArray(script)) {
script = [script];
}
const args = [];
for (const line of script) {
args.push('-e');
args.push(line);
}
return args;
}
async function osascriptSpawnAsync(script, opts) {
return await (0, spawn_async_1.default)('osascript', osascriptArgs(script), opts);
}
async function isAppRunningAsync(appName) {
const { stdout } = await osascriptSpawnAsync(`tell app "System Events" to count processes whose name is ${JSON.stringify(appName)}`);
return stdout.trim() !== '0';
}
async function safeIdOfAppAsync(appName) {
try {
const { stdout } = await osascriptSpawnAsync(`id of app ${JSON.stringify(appName)}`);
return stdout.trim();
}
catch {
return null;
}
}
async function openFinderToFolderAsync(dir, activate = true) {
await osascriptSpawnAsync([
'tell application "Finder"',
'open POSIX file ' + JSON.stringify(dir),
(activate && 'activate') || '',
'end tell',
]);
}
async function openInAppAsync(appName, pth) {
const cmd = 'tell app ' + JSON.stringify(appName) + ' to open ' + JSON.stringify(path_1.default.resolve(pth));
// console.log("cmd=", cmd);
return await osascriptSpawnAsync(cmd);
}
async function chooseAppAsync(listOfAppNames) {
const runningAwaitables = [];
const appIdAwaitables = [];
for (const appName of listOfAppNames) {
runningAwaitables.push(isAppRunningAsync(appName));
appIdAwaitables.push(safeIdOfAppAsync(appName));
}
const running = await Promise.all(runningAwaitables);
const appIds = await Promise.all(appIdAwaitables);
let i;
for (i = 0; i < listOfAppNames.length; i++) {
if (running[i]) {
return listOfAppNames[i];
}
}
for (i = 0; i < listOfAppNames.length; i++) {
if (appIds[i]) {
return listOfAppNames[i];
}
}
return null;
}
async function chooseEditorAppAsync(preferredEditor) {
if (preferredEditor) {
// Make sure this editor exists
const appId = await safeIdOfAppAsync(preferredEditor);
if (appId) {
return preferredEditor;
}
else {
console.warn(`Your preferred editor (${preferredEditor}) isn't installed on this computer.`);
}
}
const editorsToTry = [
'Visual Studio Code',
'Atom',
'Sublime Text',
'TextMate',
'TextWrangler',
'Visual Studio Code',
'Brackets',
'SubEthaEdit',
'BBEdit',
'Textastic',
'UltraEdit',
'MacVim',
'CodeRunner 2',
'CodeRunner',
'TextEdit',
];
return await chooseAppAsync(editorsToTry);
}
async function chooseTerminalAppAsync() {
return await chooseAppAsync([
'iTerm 3',
'iTerm 2',
'iTerm',
'HyperTerm',
// 'Cathode',
// 'Terminator',
// 'MacTerm',
'Terminal',
]);
}
async function openInEditorAsync(pth, preferredEditor) {
const appName = await chooseEditorAppAsync(preferredEditor);
if (!appName) {
throw new Error('No editor found.');
}
console.log('Will open in ' + appName + ' -- ' + pth);
return await openInAppAsync(appName, pth);
}
async function openItermToSpecificFolderAsync(dir) {
return await osascriptSpawnAsync([
'tell application "iTerm"',
'make new terminal',
'tell the first terminal',
'activate current session',
'launch session "Default Session"',
'tell the last session',
'write text "cd ' + util_1.default.inspect(dir) + ' && clear"',
// 'write text "clear"',
'end tell',
'end tell',
'end tell',
]);
// exec("osascript -e 'tell application \"iTerm\"' -e 'make new terminal' -e 'tell the first terminal' -e 'activate current session' -e 'launch session \"Default Session\"' -e 'tell the last session' -e 'write text \"cd #{value}\"' -e 'write text \"clear\"' -e 'end tell' -e 'end tell' -e 'end tell' > /dev/null 2>&1")
}
async function openTerminalToSpecificFolderAsync(dir, inTab = false) {
if (inTab) {
return await osascriptSpawnAsync([
'tell application "terminal"',
'tell application "System Events" to tell process "terminal" to keystroke "t" using command down',
'do script with command "cd ' +
util_1.default.inspect(dir) +
' && clear" in selected tab of the front window',
'end tell',
]);
}
else {
return await osascriptSpawnAsync([
'tell application "terminal"',
'do script "cd ' + util_1.default.inspect(dir) + ' && clear"',
'end tell',
'tell application "terminal" to activate',
]);
}
}
async function openFolderInTerminalAppAsync(dir, inTab = false) {
const program = await chooseTerminalAppAsync();
switch (program) {
case 'iTerm':
return await openItermToSpecificFolderAsync(dir);
case 'Terminal':
default:
return await openTerminalToSpecificFolderAsync(dir, inTab);
}
}
/** @deprecated */
async function osascriptExecAsync(script, opts) {
return (await osascriptSpawnAsync(script, opts)).stdout.trim();
}
//# sourceMappingURL=index.js.map

1
node_modules/@expo/osascript/build/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAiME,wCAAc;AACd,oDAAoB;AACpB,wDAAsB;AACA,uCAAS;AAC/B,8CAAiB;AACjB,0DAAuB;AACvB,oEAA4B;AAC5B,wCAAc;AACd,8CAAiB;AACjB,wEAA8B;AAC9B,8EAAiC;AACjC,4CAAgB;AACO,yCAAU;AA7MnC,oEAA0E;AAC1E,gDAAwB;AACxB,gDAAwB;AAExB,SAAS,aAAa,CAAC,MAAyB;IAC9C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAED,MAAM,IAAI,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,KAAK,UAAU,mBAAmB,CAChC,MAAyB,EACzB,IAAmB;IAEnB,OAAO,MAAM,IAAA,qBAAU,EAAC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;AACpE,CAAC;AAED,KAAK,UAA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C;QACN,OAAO,MAAM,mBAAmB,CAAC;YAC/B,6BAA6B;YAC7B,gBAAgB,GAAG,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,YAAY;YACnD,UAAU;YACV,yCAAyC;SAC1C,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,KAAK,UAAU,4BAA4B,CAAC,GAAW,EAAE,KAAK,GAAG,KAAK;IACpE,MAAM,OAAO,GAAG,MAAM,sBAAsB,EAAE,CAAC;IAE/C,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,MAAM,8BAA8B,CAAC,GAAG,CAAC,CAAC;QAEnD,KAAK,UAAU,CAAC;QAChB;YACE,OAAO,MAAM,iCAAiC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC;AAED,kBAAkB;AAClB,KAAK,UAAU,kBAAkB,CAAC,MAAyB,EAAE,IAAmB;IAC9E,OAAO,CAAC,MAAM,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AACjE,CAAC"}

50
node_modules/@expo/osascript/package.json generated vendored Normal file
View File

@@ -0,0 +1,50 @@
{
"name": "@expo/osascript",
"version": "2.4.2",
"description": "Tools for running an osascripts in Node",
"license": "MIT",
"keywords": [
"osascript",
"mac",
"osx",
"spawn",
"exec"
],
"homepage": "https://github.com/expo/expo/tree/main/packages/@expo/osascript#readme",
"repository": {
"type": "git",
"url": "https://github.com/expo/expo.git",
"directory": "packages/@expo/osascript"
},
"bugs": {
"url": "https://github.com/expo/expo/issues"
},
"main": "build/index.js",
"files": [
"build"
],
"scripts": {
"build": "expo-module tsc",
"prepare": "yarn run clean && yarn run build",
"clean": "expo-module clean",
"lint": "expo-module lint",
"typecheck": "expo-module typecheck",
"test": "expo-module test",
"watch": "yarn run build --watch --preserveWatchOutput",
"prepublishOnly": "expo-module prepublishOnly"
},
"engines": {
"node": ">=12"
},
"dependencies": {
"@expo/spawn-async": "^1.7.2"
},
"devDependencies": {
"@types/node": "^22.14.0",
"expo-module-scripts": "^55.0.2"
},
"publishConfig": {
"access": "public"
},
"gitHead": "7d7f6762fc6907c27a329953c682134a84410dea"
}