Liking cljdoc? Tell your friends :D

com.blockether.spel.codegen

Transforms Playwright JSONL recordings into idiomatic Clojure test code.

Reads JSONL produced by playwright codegen --target=jsonl and emits Clojure code using the com.blockether.spel API.

Two usage modes:

A) Library:

(set! warn-on-reflection true)

  (require '[com.blockether.spel.codegen :as codegen])
  (codegen/jsonl->clojure "recording.jsonl")
  (codegen/jsonl-str->clojure jsonl-string {:format :script})

B) CLI: clojure -M -m com.blockether.spel.codegen recording.jsonl clojure -M -m com.blockether.spel.codegen --format=script recording.jsonl cat recording.jsonl | clojure -M -m com.blockether.spel.codegen

Workflow: clojure -M -m com.blockether.spel.cli codegen --target=jsonl -o recording.jsonl https://example.com clojure -M -m com.blockether.spel.codegen recording.jsonl > test/my_test.clj

Any unrecognized action, unsupported signal, or unimplemented feature causes an IMMEDIATE hard error with details about what failed.

Transforms Playwright JSONL recordings into idiomatic Clojure test code.

   Reads JSONL produced by `playwright codegen --target=jsonl` and emits
   Clojure code using the com.blockether.spel API.

   Two usage modes:

   A) Library:

(set! *warn-on-reflection* true)

      (require '[com.blockether.spel.codegen :as codegen])
      (codegen/jsonl->clojure "recording.jsonl")
      (codegen/jsonl-str->clojure jsonl-string {:format :script})

   B) CLI:
      clojure -M -m com.blockether.spel.codegen recording.jsonl
      clojure -M -m com.blockether.spel.codegen --format=script recording.jsonl
      cat recording.jsonl | clojure -M -m com.blockether.spel.codegen

   Workflow:
      clojure -M -m com.blockether.spel.cli codegen --target=jsonl -o recording.jsonl https://example.com
      clojure -M -m com.blockether.spel.codegen recording.jsonl > test/my_test.clj

   Any unrecognized action, unsupported signal, or unimplemented feature
   causes an IMMEDIATE hard error with details about what failed.
raw docstring

*exit-on-error*clj

When true (default for CLI), errors call System/exit 1. Set to false for library use (throws ex-info instead).

When true (default for CLI), errors call System/exit 1.
Set to false for library use (throws ex-info instead).
sourceraw docstring

-mainclj

(-main & args)

CLI entry point. Transforms JSONL recording to Clojure code.

Usage: clojure -M -m com.blockether.spel.codegen recording.jsonl clojure -M -m com.blockether.spel.codegen --format=script recording.jsonl clojure -M -m com.blockether.spel.codegen --format=body recording.jsonl clojure -M -m com.blockether.spel.codegen --output=test.clj recording.jsonl cat recording.jsonl | clojure -M -m com.blockether.spel.codegen

CLI entry point. Transforms JSONL recording to Clojure code.

Usage:
  clojure -M -m com.blockether.spel.codegen recording.jsonl
  clojure -M -m com.blockether.spel.codegen --format=script recording.jsonl
  clojure -M -m com.blockether.spel.codegen --format=body recording.jsonl
  clojure -M -m com.blockether.spel.codegen --output=test.clj recording.jsonl
  cat recording.jsonl | clojure -M -m com.blockether.spel.codegen
sourceraw docstring

jsonl->clojureclj

(jsonl->clojure path)
(jsonl->clojure path opts)

Reads a JSONL file and returns Clojure test code as a string.

Params: path - String. Path to JSONL file. opts - Optional map (same as jsonl-str->clojure).

Reads a JSONL file and returns Clojure test code as a string.

Params:
`path` - String. Path to JSONL file.
`opts` - Optional map (same as jsonl-str->clojure).
sourceraw docstring

jsonl-str->clojureclj

(jsonl-str->clojure jsonl-str)
(jsonl-str->clojure jsonl-str opts)

Transforms a JSONL string into Clojure source code.

Params: jsonl-str - String. JSONL content from playwright codegen --target=jsonl. opts - Optional map: :format - :test (default), :script, or :body

Returns: String of Clojure source code.

Throws: Hard error (System/exit or ex-info) on any unsupported action.

Transforms a JSONL string into Clojure source code.

Params:
`jsonl-str` - String. JSONL content from `playwright codegen --target=jsonl`.
`opts`      - Optional map:
  :format - :test (default), :script, or :body

Returns:
String of Clojure source code.

Throws:
Hard error (System/exit or ex-info) on any unsupported action.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close