diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-29 11:49:28 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-29 11:49:28 -0700 |
| commit | d55b767039605256c736166a942a9138e3eacfd7 (patch) | |
| tree | 947063b634c50d438a794325f13275e134aa5993 /node_modules/concurrently/dist/src/command-parser | |
| parent | 864ce67d89c77d8ef9c3361f80d619853abcf91c (diff) | |
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/concurrently/dist/src/command-parser')
10 files changed, 0 insertions, 217 deletions
diff --git a/node_modules/concurrently/dist/src/command-parser/command-parser.d.ts b/node_modules/concurrently/dist/src/command-parser/command-parser.d.ts deleted file mode 100644 index 37ab795..0000000 --- a/node_modules/concurrently/dist/src/command-parser/command-parser.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CommandInfo } from '../command'; -/** - * A command parser encapsulates a specific logic for mapping `CommandInfo` objects - * into another `CommandInfo`. - * - * A prime example is turning an abstract `npm:foo` into `npm run foo`, but it could also turn - * the prefix color of a command brighter, or maybe even prefixing each command with `time(1)`. - */ -export interface CommandParser { - /** - * Parses `commandInfo` and returns one or more `CommandInfo`s. - * - * Returning multiple `CommandInfo` is used when there are multiple possibilities of commands to - * run given the original input. - * An example of this is when the command contains a wildcard and it must be expanded into all - * viable options so that the consumer can decide which ones to run. - */ - parse(commandInfo: CommandInfo): CommandInfo | CommandInfo[]; -} diff --git a/node_modules/concurrently/dist/src/command-parser/command-parser.js b/node_modules/concurrently/dist/src/command-parser/command-parser.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/concurrently/dist/src/command-parser/command-parser.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/concurrently/dist/src/command-parser/expand-arguments.d.ts b/node_modules/concurrently/dist/src/command-parser/expand-arguments.d.ts deleted file mode 100644 index c88e731..0000000 --- a/node_modules/concurrently/dist/src/command-parser/expand-arguments.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { CommandInfo } from '../command'; -import { CommandParser } from './command-parser'; -/** - * Replace placeholders with additional arguments. - */ -export declare class ExpandArguments implements CommandParser { - private readonly additionalArguments; - constructor(additionalArguments: string[]); - parse(commandInfo: CommandInfo): { - command: string; - name: string; - env?: Record<string, unknown> | undefined; - cwd?: string | undefined; - prefixColor?: string | undefined; - raw?: boolean | undefined; - }; -} diff --git a/node_modules/concurrently/dist/src/command-parser/expand-arguments.js b/node_modules/concurrently/dist/src/command-parser/expand-arguments.js deleted file mode 100644 index 42c087c..0000000 --- a/node_modules/concurrently/dist/src/command-parser/expand-arguments.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExpandArguments = void 0; -const shell_quote_1 = require("shell-quote"); -/** - * Replace placeholders with additional arguments. - */ -class ExpandArguments { - constructor(additionalArguments) { - this.additionalArguments = additionalArguments; - } - parse(commandInfo) { - const command = commandInfo.command.replace(/\\?\{([@*]|[1-9][0-9]*)\}/g, (match, placeholderTarget) => { - // Don't replace the placeholder if it is escaped by a backslash. - if (match.startsWith('\\')) { - return match.slice(1); - } - // Replace numeric placeholder if value exists in additional arguments. - if (!isNaN(placeholderTarget) && - placeholderTarget <= this.additionalArguments.length) { - return (0, shell_quote_1.quote)([this.additionalArguments[placeholderTarget - 1]]); - } - // Replace all arguments placeholder. - if (placeholderTarget === '@') { - return (0, shell_quote_1.quote)(this.additionalArguments); - } - // Replace combined arguments placeholder. - if (placeholderTarget === '*') { - return (0, shell_quote_1.quote)([this.additionalArguments.join(' ')]); - } - // Replace placeholder with empty string - // if value doesn't exist in additional arguments. - return ''; - }); - return { ...commandInfo, command }; - } -} -exports.ExpandArguments = ExpandArguments; diff --git a/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.d.ts b/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.d.ts deleted file mode 100644 index 636018a..0000000 --- a/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CommandInfo } from '../command'; -import { CommandParser } from './command-parser'; -/** - * Expands commands prefixed with `npm:`, `yarn:`, `pnpm:`, or `bun:` into the full version `npm run <command>` and so on. - */ -export declare class ExpandNpmShortcut implements CommandParser { - parse(commandInfo: CommandInfo): CommandInfo; -} diff --git a/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js b/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js deleted file mode 100644 index 9a62362..0000000 --- a/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExpandNpmShortcut = void 0; -/** - * Expands commands prefixed with `npm:`, `yarn:`, `pnpm:`, or `bun:` into the full version `npm run <command>` and so on. - */ -class ExpandNpmShortcut { - parse(commandInfo) { - const [, npmCmd, cmdName, args] = commandInfo.command.match(/^(npm|yarn|pnpm|bun):(\S+)(.*)/) || []; - if (!cmdName) { - return commandInfo; - } - return { - ...commandInfo, - name: commandInfo.name || cmdName, - command: `${npmCmd} run ${cmdName}${args}`, - }; - } -} -exports.ExpandNpmShortcut = ExpandNpmShortcut; diff --git a/node_modules/concurrently/dist/src/command-parser/expand-npm-wildcard.d.ts b/node_modules/concurrently/dist/src/command-parser/expand-npm-wildcard.d.ts deleted file mode 100644 index cc5f413..0000000 --- a/node_modules/concurrently/dist/src/command-parser/expand-npm-wildcard.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { CommandInfo } from '../command'; -import { CommandParser } from './command-parser'; -/** - * Finds wildcards in npm/yarn/pnpm/bun run commands and replaces them with all matching scripts in the - * `package.json` file of the current directory. - */ -export declare class ExpandNpmWildcard implements CommandParser { - private readonly readPackage; - static readPackage(): any; - private scripts?; - constructor(readPackage?: typeof ExpandNpmWildcard.readPackage); - parse(commandInfo: CommandInfo): CommandInfo | CommandInfo[]; -} diff --git a/node_modules/concurrently/dist/src/command-parser/expand-npm-wildcard.js b/node_modules/concurrently/dist/src/command-parser/expand-npm-wildcard.js deleted file mode 100644 index 0109207..0000000 --- a/node_modules/concurrently/dist/src/command-parser/expand-npm-wildcard.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExpandNpmWildcard = void 0; -const fs_1 = __importDefault(require("fs")); -const lodash_1 = __importDefault(require("lodash")); -const OMISSION = /\(!([^)]+)\)/; -/** - * Finds wildcards in npm/yarn/pnpm/bun run commands and replaces them with all matching scripts in the - * `package.json` file of the current directory. - */ -class ExpandNpmWildcard { - static readPackage() { - try { - const json = fs_1.default.readFileSync('package.json', { encoding: 'utf-8' }); - return JSON.parse(json); - } - catch (e) { - return {}; - } - } - constructor(readPackage = ExpandNpmWildcard.readPackage) { - this.readPackage = readPackage; - } - parse(commandInfo) { - const [, npmCmd, cmdName, args] = commandInfo.command.match(/(npm|yarn|pnpm|bun) run (\S+)([^&]*)/) || []; - const wildcardPosition = (cmdName || '').indexOf('*'); - // If the regex didn't match an npm script, or it has no wildcard, - // then we have nothing to do here - if (!cmdName || wildcardPosition === -1) { - return commandInfo; - } - if (!this.scripts) { - this.scripts = Object.keys(this.readPackage().scripts || {}); - } - const omissionRegex = cmdName.match(OMISSION); - const cmdNameSansOmission = cmdName.replace(OMISSION, ''); - const preWildcard = lodash_1.default.escapeRegExp(cmdNameSansOmission.slice(0, wildcardPosition)); - const postWildcard = lodash_1.default.escapeRegExp(cmdNameSansOmission.slice(wildcardPosition + 1)); - const wildcardRegex = new RegExp(`^${preWildcard}(.*?)${postWildcard}$`); - // If 'commandInfo.name' doesn't match 'cmdName', this means a custom name - // has been specified and thus becomes the prefix (as described in the README). - const prefix = commandInfo.name !== cmdName ? commandInfo.name : ''; - return this.scripts - .map((script) => { - const match = script.match(wildcardRegex); - if (omissionRegex) { - const toOmit = script.match(new RegExp(omissionRegex[1])); - if (toOmit) { - return; - } - } - if (match) { - return { - ...commandInfo, - command: `${npmCmd} run ${script}${args}`, - // Will use an empty command name if no prefix has been specified and - // the wildcard match is empty, e.g. if `npm:watch-*` matches `npm run watch-`. - name: prefix + match[1], - }; - } - }) - .filter((commandInfo) => !!commandInfo); - } -} -exports.ExpandNpmWildcard = ExpandNpmWildcard; diff --git a/node_modules/concurrently/dist/src/command-parser/strip-quotes.d.ts b/node_modules/concurrently/dist/src/command-parser/strip-quotes.d.ts deleted file mode 100644 index 1a21b79..0000000 --- a/node_modules/concurrently/dist/src/command-parser/strip-quotes.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { CommandInfo } from '../command'; -import { CommandParser } from './command-parser'; -/** - * Strips quotes around commands so that they can run on the current shell. - */ -export declare class StripQuotes implements CommandParser { - parse(commandInfo: CommandInfo): { - command: string; - name: string; - env?: Record<string, unknown> | undefined; - cwd?: string | undefined; - prefixColor?: string | undefined; - raw?: boolean | undefined; - }; -} diff --git a/node_modules/concurrently/dist/src/command-parser/strip-quotes.js b/node_modules/concurrently/dist/src/command-parser/strip-quotes.js deleted file mode 100644 index 971a524..0000000 --- a/node_modules/concurrently/dist/src/command-parser/strip-quotes.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StripQuotes = void 0; -/** - * Strips quotes around commands so that they can run on the current shell. - */ -class StripQuotes { - parse(commandInfo) { - let { command } = commandInfo; - // Removes the quotes surrounding a command. - if (/^"(.+?)"$/.test(command) || /^'(.+?)'$/.test(command)) { - command = command.slice(1, command.length - 1); - } - return { ...commandInfo, command }; - } -} -exports.StripQuotes = StripQuotes; |
