0.6.5 • Published 6 years ago

broccoli-debug v0.6.5

Weekly downloads
178,183
License
MIT
Repository
github
Last release
6 years ago

broccoli-debug Build Status Build status

Utility for build pipeline authors to allow trivial debugging of the Broccoli pipelines they author.

Heavily inspired by @stefanpenner's broccoli-stew's debug's helper, but improved in a few ways:

  • Supports leaving debug trees in the build with minimal cost when not being used.
  • Supports binary files (e.g. does not write .png's as utf8 text).
  • Adds debug style debug matching.

Usage

Pipeline Authors

To allow consumers to debug the internals of various stages in your build pipeline, you create a new instance of BroccoliDebug and return it instead.

Something like this:

var BroccoliDebug = require('broccoli-debug');

let tree = new BroccoliDebug(input, `ember-engines:${this.name}:addon-input`);

Obviously, this would get quite verbose to do many times, so we have created a shortcut to easily create a number of debug trees with a shared prefix:

let debugTree = BroccoliDebug.buildDebugCallback(`ember-engines:${this.name}`);

let tree1 = debugTree(input1, 'addon-input');
// tree1.debugLabel => 'ember-engines:<some-name>:addon-input'

let tree2 = debugTree(input2, 'addon-output');
// tree2.debugLabel => 'ember-engines:<some-name>:addon-output

Consumers

Folks wanting to inspect the state of the build pipeline at that stage, would do the following:

BROCCOLI_DEBUG=ember-engines:* ember b

Now you can take a look at the state of that input tree by:

ls DEBUG/ember-engines/*

API

interface BroccoliDebugOptions {
  /**
    The label to use for the debug folder. By default, will be placed in `DEBUG/*`.
  */
  label: string

  /**
    The base directory to place the input node contents when debugging is enabled.

    Chooses the default in this order:

    * `process.env.BROCCOLI_DEBUG_PATH`
    * `path.join(process.cwd(), 'DEBUG')`
  */
  baseDir: string

  /**
    Should the tree be "always on" for debugging? This is akin to `debugger`, its very
    useful while actively working on a build pipeline, but is likely something you would
    remove before publishing.
  */
  force?: boolean
}

class BroccoliDebug {
  /**
    Builds a callback function for easily generating `BroccoliDebug` instances
    with a shared prefix.
  */
  static buildDebugCallback(prefix: string): (node: any, labelOrOptions: string | BroccoliDebugOptions) => BroccoliNode
  constructor(node: BroccoliNode, labelOrOptions: string | BroccoliDebugOptions);
  debugLabel: string;
}

Development

Installation

  • git clone git@github.com:broccolijs/broccoli-debug.git
  • cd broccoli-debug
  • yarn

Testing

  • yarn test
@viviedu/ember-sourceember-source-vivi@unihorncorn/horn-styles@infinitebrahmanuniverse/nolb-broc@everything-registry/sub-chunk-1264@appknox/ember-cli-intl-tel-input@boundless-inc/ember-bootstrap@css-blocks/ember@css-blocks/ember-app@buschtoens/ember-auto-import@buschtoens/ember-enginespremberprember-beautify@vazgentigranich/parlor-glimmer-application-pipelinebroccoli-stewbroccoli-destinybroccoli-concatbroccoli-eyeglasseflex-ember-bootstrapember-bootstrapember-addon-viewerember-data-background-adaptersember-data-classicember-junkdrawerember-native-class-polyfillember-enginesember-gsapember-lodashember-leaflet-heatmapember-leaflet-marker-clusterember-simple-dom-toolsember-simulant-test-helpersember-sourceember-cli-prismicember-cli-rollup-packagerember-cli-scrollbarember-cli-sassdashember-cli-tree-shakerember-code-prettifyember-auto-importember-cliember-cli-addon-guardember-google-mapsember-template-styles-importember-theemoember-makeupember-scrollmagic@html-next/svg-icon-optimizerember-cli-cjs-transformember-cli-intl-tel-inputember-cli-htmlbarsember-cli-eyeglassember-cli-babelember-fetchember-exif-shimcopperinc-ember-auto-importselect-sass-theme@glimmer/build@glimmer/application-pipeline@ember/test-helpers@ember-data/private-build-infra@ember-data-mirror/private-build-infra@ember-data/-build-infra@runspired-forks/ember-auto-importkiwidave-ecffoode-ember-google-mapsfoodee-ember-google-mapsglimmer-application-pipelineglimmer-application-pipeline-mszglimmer-boolean-helpers-polyfillglimmer-v1-application-pipeline@skyrocketjs/compiler@skyrocketjs/ember@retail-architects/ember-data@rewardops-forks/ember-auto-import@rewardops-forks/ember-test-helpers@omarestrella/ember-auto-import@step2yeung/ember-cli-addon-guardlibkit
0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.1.1

10 years ago

0.1.0

10 years ago