All files / cli/src/build-tools experimental.js

100% Statements 5/5
100% Branches 5/5
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23          1x                   5x 1x 1x          
/**
 * Shared notice for the bundler integrations, which do not transform
 * anything yet.
 */
 
const warned = new Set();
 
/**
 * Warn once per process that `integration` is an experimental pass-through.
 * Pass `{ silent: true }` in the integration's options to suppress it.
 *
 * @param {string} integration - e.g. 'createVitePlugin'
 * @param {{ silent?: boolean }} [options]
 */
export function warnExperimental(integration, options = {}) {
  if (options?.silent || warned.has(integration)) return;
  warned.add(integration);
  console.warn(
    `[@coherent.js/cli] ${integration}() is experimental and currently a pass-through: ` +
    'it does not transform Coherent.js components. Pass { silent: true } to hide this notice.'
  );
}