Skip to content

Run and ship

This is the working loop after scaffolding: watch, paste, preview, build, and hand off.

Release checklist

  • Run the watcher for the variation you are editing.
  • Paste the matching clipboard bundle into Adobe Target.
  • Refresh the Target preview after every meaningful change.
  • Run pnpm format before review or handoff.
  • Run pnpm build before shipping.
  • Copy the production bundle from dist/vN-index.jsx into the matching Target variation.

Choose a command

GoalCommandUse it when
Edit one variationpnpm start 0You are working on v1 and want the bundle copied to the clipboard after every save.
Edit all variationspnpm startYou want watch output for every generated variation.
Preview with injectionpnpm liveYou want the tool to open targetUrl and inject the watched bundle.
Prepare for shippingpnpm buildYou need final IIFE files in dist/ after the lint gate passes.

Watch and paste

Run watch mode for the variation you are editing:

bash
pnpm start 0

The command index is zero-based and follows discovered variation order. Numeric folders are ordered first, followed by named folders such as control:

Command indexVariation folderOutput bundle
0src/js/v1dist/v1-index.jsx
1src/js/v2dist/v2-index.jsx
2src/js/v3dist/v3-index.jsx
next indexsrc/js/controldist/control-index.jsx

On each successful rebuild, the generated IIFE is copied to your clipboard. Paste it into Adobe Target custom code and refresh the preview page.

WARNING

Paste the bundle into the matching Target variation. pnpm start 1 builds v2, not v1.

Live injection

Live injection opens the target page and inserts the watched bundle:

bash
pnpm live

pnpm live reads experiment.config.js, opens targetUrl, watches the bundle, injects it into the page, and shows an overlay with status information.

Injection succeeds when the bundle registers on window[globalObject][packageName]. The overlay may also show which selector from src/config.js matched, but a missing selector does not block injection. Experiments that only change text, styles, or tracking still preview correctly as long as runScript registers the package name.

To reuse one browser cache profile across experiments:

bash
pnpm live -- --profile shared

Use the shared profile when login, consent, or cached market state would otherwise slow down repeated checks.

You can override live options without editing config:

bash
pnpm live -- --variation v2
pnpm live -- --variation control
pnpm live -- --url https://www.samsung.com/de/
pnpm live -- --overlay hidden
pnpm live -- --profile shared

variation accepts a zero-based index or a discovered folder name such as v2 or control.

Production build

Run:

bash
pnpm build

The command:

  1. Runs the Biome lint gate.
  2. Builds each src/js/vN/index.jsx entry as an IIFE.
  3. Writes bundles to dist/vN-index.jsx.
  4. Prints raw and gzip bundle sizes.

If Biome reports errors, the build aborts before bundling. Run pnpm format first, then manually fix any diagnostics that remain.

Add another variation

Create a new variation from v1:

bash
pnpm new-variation 3
pnpm new-variation control
pnpm start 2

pnpm new-variation 3 creates src/js/v3/index.jsx from v1 and copies src/js/v1/styles.module.scss when present. pnpm new-variation control creates src/js/control/index.jsx from v1.

After creation:

  • Update labels in src/js/v3/index.jsx.
  • Change selector, props, or component logic for the variation.
  • Run pnpm start 2 while editing v3.
  • Use the printed pnpm start <index> command when editing a named variation such as control.
  • Run pnpm build before shipping.

Failure modes

SymptomCheck
Clipboard bundle appears in the wrong variationConfirm the command index and Target variation match.
Build stops before bundlingRun pnpm format, then fix remaining Biome diagnostics manually.
Live preview opens but does not injectCheck targetUrl, runtime.globalObject, and the selected live variation in experiment.config.js.
Target preview does not changeSave the Target custom code editor, refresh the preview page, and paste the latest clipboard bundle.

Internal tool - Samsung / Sogody experimentation team

Help improve the frameworkShare an idea or friction you encountered.Share framework feedback(opens in a new tab)