{"id":13805132,"url":"https://github.com/broccolijs/broccoli-debug","last_synced_at":"2025-04-15T13:32:32.494Z","repository":{"id":16281912,"uuid":"19030362","full_name":"broccolijs/broccoli-debug","owner":"broccolijs","description":"Debugging tools for Broccoli","archived":false,"fork":false,"pushed_at":"2023-01-12T06:49:21.000Z","size":452,"stargazers_count":9,"open_issues_count":17,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-10T17:05:41.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/broccolijs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-22T13:22:45.000Z","updated_at":"2022-05-07T15:34:07.000Z","dependencies_parsed_at":"2023-01-14T12:40:43.605Z","dependency_job_id":null,"html_url":"https://github.com/broccolijs/broccoli-debug","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broccolijs%2Fbroccoli-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broccolijs%2Fbroccoli-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broccolijs%2Fbroccoli-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broccolijs%2Fbroccoli-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/broccolijs","download_url":"https://codeload.github.com/broccolijs/broccoli-debug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249080312,"owners_count":21209505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T01:00:57.825Z","updated_at":"2025-04-15T13:32:32.241Z","avatar_url":"https://github.com/broccolijs.png","language":"JavaScript","readme":"# broccoli-debug [![Build Status](https://travis-ci.org/broccolijs/broccoli-debug.svg?branch=master)](https://travis-ci.org/broccolijs/broccoli-debug) [![Build status](https://ci.appveyor.com/api/projects/status/u6tkot7ru19wntxr/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/broccoli-debug/branch/master)\n\n\nUtility for build pipeline authors to allow trivial debugging of the Broccoli\npipelines they author.\n\nHeavily inspired by [@stefanpenner](https://github.com/stefanpenner)'s\n[broccoli-stew's `debug`](https://github.com/stefanpenner/broccoli-stew/blob/v1.4.2/lib/debug.js)'s helper,\nbut improved in a few ways:\n\n* Supports leaving debug trees in the build with minimal cost when not being used.\n* Supports binary files (e.g. does not write `.png`'s as `utf8` text).\n* Adds [debug](https://github.com/visionmedia/debug) style debug matching.\n\n## Usage\n\n### Pipeline Authors\n\nTo allow consumers to debug the internals of various stages in your build pipeline,\nyou create a new instance of `BroccoliDebug` and return it instead.\n\nSomething like this:\n\n```js\nvar BroccoliDebug = require('broccoli-debug');\n\nlet tree = new BroccoliDebug(input, `ember-engines:${this.name}:addon-input`);\n```\n\nObviously, this would get quite verbose to do many times, so we have created a shortcut\nto easily create a number of debug trees with a shared prefix:\n\n```js\nlet debugTree = BroccoliDebug.buildDebugCallback(`ember-engines:${this.name}`);\n\nlet tree1 = debugTree(input1, 'addon-input');\n// tree1.debugLabel =\u003e 'ember-engines:\u003csome-name\u003e:addon-input'\n\nlet tree2 = debugTree(input2, 'addon-output');\n// tree2.debugLabel =\u003e 'ember-engines:\u003csome-name\u003e:addon-output\n```\n\n### Consumers\n\nFolks wanting to inspect the state of the build pipeline at that stage, would do the following:\n\n```js\nBROCCOLI_DEBUG=ember-engines:* ember b\n```\n\nNow you can take a look at the state of that input tree by:\n\n```js\nls DEBUG/ember-engines/*\n```\n\n### API\n\n```ts\ninterface BroccoliDebugOptions {\n  /**\n    The label to use for the debug folder. By default, will be placed in `DEBUG/*`.\n  */\n  label: string\n\n  /**\n    The base directory to place the input node contents when debugging is enabled.\n\n    Chooses the default in this order:\n\n    * `process.env.BROCCOLI_DEBUG_PATH`\n    * `path.join(process.cwd(), 'DEBUG')`\n  */\n  baseDir: string\n\n  /**\n    Should the tree be \"always on\" for debugging? This is akin to `debugger`, its very\n    useful while actively working on a build pipeline, but is likely something you would\n    remove before publishing.\n  */\n  force?: boolean\n}\n\nclass BroccoliDebug {\n  /**\n    Builds a callback function for easily generating `BroccoliDebug` instances\n    with a shared prefix.\n  */\n  static buildDebugCallback(prefix: string): (node: any, labelOrOptions: string | BroccoliDebugOptions) =\u003e BroccoliNode\n  constructor(node: BroccoliNode, labelOrOptions: string | BroccoliDebugOptions);\n  debugLabel: string;\n}\n```\n\n## Development\n\n### Installation\n\n* `git clone git@github.com:broccolijs/broccoli-debug.git`\n* `cd broccoli-debug`\n* `yarn`\n\n### Testing\n\n* `yarn test`\n","funding_links":[],"categories":["Packages"],"sub_categories":["Broccoli"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroccolijs%2Fbroccoli-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbroccolijs%2Fbroccoli-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroccolijs%2Fbroccoli-debug/lists"}