How to use the @effectful/core.babelPlugin function in @effectful/core

To help you get started, we’ve selected a few @effectful/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github awto / effectfuljs / packages / es / transform.js View on Github external
module.exports = require("@effectful/core").babelPlugin(require("./options"));
github awto / effectfuljs / packages / debugger / src / transform.js View on Github external
"frame",
  "unhandled",
  "unhandledA",
  "unhandledAG",
  "set",
  "del",
  "mcall"
];

let VERBOSE = process.env.EFFECTFUL_DEBUGGER_VERBOSE;

if (VERBOSE) {
  VERBOSE = VERBOSE[0].toLowerCase() === "t" || (!isNaN(VERBOSE) && +VERBOSE);
} else VERBOSE = false;

module.exports = require("@effectful/core").babelPlugin(
  (opts, { Tag, Kit, Transform: T, Policy: P, presets }) => {
    const moduleAliases = {};
    const importRT = opts.importRT || "@effectful/debugger/api";
    if (opts.preInstrumentedLibs) {
      const root = opts.preInstrumentedLibs.substr
        ? opts.preInstrumentedLibs
        : "@effectful/debugger";
      for (const i in require("./deps.json")) {
        const suffix = opts.timeTravel ? "-t" : "";
        const path = `${root}/deps/${i.replace(/\//g, "-")}${suffix}`;
        moduleAliases[i] = path;
        if (i.includes("/")) moduleAliases[`${i}.js`] = path;
      }
    }
    const brk = Kit.sysId("brk");
    const unwrapSym = Kit.sysId("unwrapImport");
github awto / effectfuljs / packages / js / transform.js View on Github external
module.exports = require("@effectful/core").babelPlugin(require("./options"));
github awto / effectfuljs / samples / react-do / transform.js View on Github external
module.exports = require("@effectful/core").babelPlugin(
  (opts, { Tag, Kit, presets }) => ({
    options: {
      /** using state's numbers instead of callbacks */
      ...presets.defunct,
      name: "@effectful/react-do",
      importRT: "@effectful/react-do",
      contextBy: "this",
      contextMethodOpsSpec: {
        join: false,
        pure: false
      },
      parShare: false,
      blockDirsFunc: "profile",
      ...opts
    },
    configure(s) {
github awto / effectfuljs / packages / es-inline / transform.js View on Github external
module.exports = require("@effectful/core").babelPlugin(require("./options"));
github awto / effectfuljs / packages / debugger / transform.js View on Github external
${tt ? "if (newTarget) unwrapPrototype(self);" : ""}
  return $3.top = ${tt ? "wrap" : ""}({
    $$$: proto.$$$,
    state: 0,
    meta: proto.meta,
    self,
    newTarget: new.target != null,
    $: ${tt ? "wrap({})" : "{}"},
    brk: null,
    exitBrk: null,
    next: $3.top
  })
}
`;

module.exports = require("@effectful/core").babelPlugin((opts, {
  Tag,
  Kit,
  Transform: T,
  Policy: P,
  presets
}) => {
  const moduleAliases = {};
  const importRT = opts.importRT || (opts.backend ? `@effectful/debugger/backends/${opts.backend}` : "@effectful/debugger/api");

  if (opts.preInstrumentedLibs) {
    const root = opts.preInstrumentedLibs.substr ? opts.preInstrumentedLibs : "@effectful/debugger";

    for (const i in require("./deps.json")) {
      moduleAliases[i] = `${root}/deps/${i.replace("/", "-")}`;
    }
  }

@effectful/core

Embedding effects in JavaScript using Monads

MIT
Latest version published 9 months ago

Package Health Score

56 / 100
Full package analysis