### Configure npm scripts with frunk for quickstart Source: https://github.com/ludicroushq/frunk/blob/main/README.md Define npm scripts in your `package.json` to leverage frunk's capabilities. This example shows basic script definitions, parallel execution with globs, sequential chains, and inline commands. ```json { "scripts": { "dev": "frunk [*:dev]", "build": "frunk [build:*]", "start": "frunk [build] -- node server.js", "test": "frunk [lint,typecheck]->[test:*]", "lint": "frunk -- eslint .", "typecheck": "frunk -- tsc --noEmit", "test:unit": "frunk -- vitest run", "test:playwright": "frunk [build] -- playwright test" } } ``` -------------------------------- ### frunk CLI Basic Syntax and Examples Source: https://github.com/ludicroushq/frunk/blob/main/AGENTS.md Demonstrates the fundamental command-line interface syntax for frunk, including pattern matching, sequential execution, and running commands with dependencies. It highlights the use of square brackets for patterns and the '--' separator for commands. ```bash f [patterns] [flags] -- command ``` ```bash f [test:*] # Run all test scripts ``` ```bash f [build:*,!build:slow] # Run build scripts except build:slow ``` ```bash f [lint,test]->[deploy] # Sequential: lint and test, then deploy ``` ```bash f [shared:dep,app:dep] -- vite dev # Run dependencies then command ``` -------------------------------- ### Advanced npm script configuration with frunk Source: https://github.com/ludicroushq/frunk/blob/main/README.md An extended example demonstrating frunk's features like shared dependency handling, parallel groups, sequential execution, and inline commands for various development and build tasks. ```json { "scripts": { "generate": "graphql-codegen", "dev": "f [*:dev]", "build": "f [*:build]", "start": "f [*:start]", "test": "frunk [lint,typecheck]->[test:*]", "lint": "frunk -- eslint .", "typecheck": "frunk -- tsc --noEmit", "test:unit": "frunk -- vitest run", "test:playwright": "frunk [build] -- playwright test", "worker:dev": "f -- tsx --watch ./src/worker/start.ts", "worker:start": "f -- tsx ./src/worker/start.ts", "api:dev": "f -- tsx --watch ./src/api/server.ts", "api:start": "f -- tsx ./src/api/server.ts", "app:dev": "f [generate] -- vite dev", "app:build": "f [generate] -- vite build", "app:start": "f -- vite serve" } } ``` -------------------------------- ### frunk Dependency Resolution Example in package.json Source: https://github.com/ludicroushq/frunk/blob/main/AGENTS.md Illustrates how frunk's automatic dependency resolution works within a `package.json` file. It shows nested frunk commands in scripts and explains how frunk deduplicates shared dependencies for efficient execution. ```json { "scripts": { "shared:dep": "f -- echo 'shared'", "app1:dev": "f [shared:dep] -- vite dev", "app2:dev": "f [shared:dep] -- tsx watch", "dev": "f [*:dev]" } } ``` -------------------------------- ### Install frunk with npm, pnpm, or yarn Source: https://github.com/ludicroushq/frunk/blob/main/README.md Install frunk as a development dependency for your project using your preferred package manager. This makes frunk available for use in your npm scripts. ```bash npm i -D frunk # pnpm add -D frunk # yarn add -D frunk ``` -------------------------------- ### Frunk Build Process with npm Source: https://github.com/ludicroushq/frunk/blob/main/AGENTS.md Commands to manage the build process for the Frunk project using npm scripts. Includes building, type checking, and development mode. ```bash npm run build # Build with tsdown npm run typecheck # TypeScript type checking npm run dev # Development mode with watch ``` -------------------------------- ### frunk Project Structure Overview Source: https://github.com/ludicroushq/frunk/blob/main/AGENTS.md Provides a hierarchical view of the frunk project's source code directory structure. This helps in understanding the organization of different modules and their purposes. ```bash src/ ├── core/ │ ├── parser.ts # Command-line parsing │ ├── pattern-matcher.ts # Glob pattern resolution │ └── graph-builder.ts # Dependency graph construction ├── execution/ │ ├── executor.ts # Task execution engine │ └── runner.ts # Main runner orchestrator ├── utils/ │ └── logger.ts # Colored output management ├── types.ts # TypeScript type definitions ├── cli.ts # CLI entry point └── index.ts # Library exports ``` -------------------------------- ### frunk Core Components - TypeScript File Paths Source: https://github.com/ludicroushq/frunk/blob/main/AGENTS.md Lists the primary TypeScript files within the `src/core` directory responsible for frunk's parsing, pattern matching, and graph building functionalities. This provides insight into the internal architecture. ```bash src/core/parser.ts # Command-line parsing ``` ```bash src/core/pattern-matcher.ts # Glob pattern resolution ``` ```bash src/core/graph-builder.ts # Dependency graph construction ``` -------------------------------- ### frunk Execution and Utility Components - TypeScript Paths Source: https://github.com/ludicroushq/frunk/blob/main/AGENTS.md Outlines the TypeScript files within the `src/execution` and `src/utils` directories that handle task execution, logging, and other utility functions. This maps functionality to specific code locations. ```bash src/execution/executor.ts # Task execution engine ``` ```bash src/execution/runner.ts # Main runner orchestrator ``` ```bash src/utils/logger.ts # Colored output management ``` -------------------------------- ### Running Tests with npm Source: https://github.com/ludicroushq/frunk/blob/main/AGENTS.md Commands to execute tests within the Frunk project. Supports watch mode for continuous testing or a single run. ```bash npm test # Run tests in watch mode npm test -- --run # Run once ``` -------------------------------- ### Package.json Scripts for Frunk Project Source: https://github.com/ludicroushq/frunk/blob/main/AGENTS.md Defines various npm scripts for managing dependencies, running development servers, building the project, and executing tests within the Frunk project. These scripts leverage the 'f' command for task orchestration. ```json { "scripts": { "// Dependencies": "", "shared:dep": "f -- echo 'Building shared'", "api:dep": "f -- tsc --build api", "// Development": "", "api:dev": "f [shared:dep,api:dep] -- nodemon api/server.ts", "web:dev": "f [shared:dep] -- vite dev", "worker:dev": "f [shared:dep] -- tsx watch worker.ts", "dev": "f [*:dev]", "// Building": "", "build": "f [clean]->[build:*]", "build:api": "f -- tsc --build", "build:web": "f -- vite build", "// Testing": "", "test": "f [lint,typecheck]->[test:*]", "test:unit": "f -- vitest", "test:e2e": "f [build] -- playwright test" } } ``` -------------------------------- ### Enabling Debug Logging in Frunk Source: https://github.com/ludicroushq/frunk/blob/main/AGENTS.md Instructions for enabling debug logging for the Frunk project. Allows for granular control over which parts of the application's execution are logged. ```bash DEBUG=frunk:* npm run dev DEBUG=frunk:graph npm run dev # Just graph builder DEBUG=frunk:executor npm run dev # Just executor ``` -------------------------------- ### frunk Flags for Output and Error Handling Source: https://github.com/ludicroushq/frunk/blob/main/AGENTS.md Details the available command-line flags for modifying frunk's behavior, such as suppressing output, continuing execution on errors, disabling or customizing output prefixes. These flags provide control over the execution process and its visibility. ```bash -q, --quiet - Suppress output ``` ```bash -c, --continue - Continue on error ``` ```bash --no-prefix - Disable output prefixes ``` ```bash --prefix= - Custom prefix string ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.