penpot/frontend/shadow-cljs.edn
Miguel de Benito Delgado fb7fcd32fc ✨ Add retained renderer benchmark builds and host
Add prepared build artifacts, browser host and the build and
purge commands for the CLJS renderer benchmarks.

Each preparation attempt gets a build ID and a retained directory with
its manifest, log, Node case catalog, browser bundle, renderer files
and host page. Ready builds load their matching catalog in process and
serve only their own directory through an owned loopback host.

Own Chromium through a bounded process group, verify the compiled build
identity before execution and retain failed preparations for diagnosis.
Wire the diagnostic pilot to the same build, catalog, server and
browser APIs.

Add real boundary tests for artifacts, processes, servers, browsers and
CLI parsing, and register them with the performance test runner. Rename
the benchmark lint and test scripts to match the suite.

AI-assisted-by: deepseek-flash
2026-10-30 20:08:28 +01:00

267 lines
8.1 KiB
Clojure

{:deps {:aliases [:dev]}
:http {:port #shadow/env ["HTTP_PORT" :as :int :default 3448]}
:nrepl {:port #shadow/env ["NREPL_PORT" :as :int :default 3447] :host "0.0.0.0"}
:dev-http {#shadow/env ["DEV_PORT" :as :int :default 8888] "classpath:public"}
:cache-dir #shadow/env ["CACHE" :default ".shadow-cljs"]
:builds
{:main
{:target :esm
:output-dir "resources/public/js/"
:asset-path "/js"
:devtools {:watch-dir "resources/public"
:reload-strategy :full}
:dev {;; allows remote-relay per parallel environment
;; inside :dev so the integration tests won't use it
:devtools {:devtools-url #shadow/env ["SHADOW_SERVER_URL" :default ""]}}
:build-options {:manifest-name "manifest.json"}
:modules
{:shared
{:entries []}
:main
{:entries [app.main app.plugins.api]
:depends-on #{:shared}
:exports {init app.main/init}}
:util-highlight
{:entries [app.util.code-highlight]
:depends-on #{:shared}}
:main-auth
{:entries [app.main.ui.auth
app.main.ui.auth.verify-token]
:depends-on #{:shared}}
:main-viewer
{:entries [app.main.ui.viewer]
:depends-on #{:shared :main-auth}}
:main-workspace
{:entries [app.main.ui.workspace]
:depends-on #{:shared}}
:main-dashboard
{:entries [app.main.ui.dashboard]
:depends-on #{:shared}}
:main-settings
{:entries [app.main.ui.settings]
:depends-on #{:shared}}
:render
{:entries [app.render]
:depends-on #{:shared}
:exports {init app.render/init}}
:rasterizer
{:entries [app.rasterizer]
:depends-on #{:shared}
:exports {init app.rasterizer/init}}}
:js-options
{:entry-keys ["module" "browser" "main"]
:export-conditions ["module" "import", "browser" "require" "default"]
:js-provider :external
:external-index "target/index.js"
:external-index-format :esm}
:compiler-options
{:output-feature-set :es2020
:output-wrapper false
:warnings {:fn-deprecated false}}
:release
{:closure-defines {goog.DEBUG false
goog.debug.LOGGING_ENABLED true
app.config/compiled-version-tag #shadow/env ["VERSION_TAG" :default "develop"]}
:compiler-options
{:fn-invoke-direct true
:optimizations #shadow/env ["PENPOT_BUILD_OPTIMIZATIONS" :as :keyword :default :advanced]
:source-map true
:pseudo-names true
:elide-asserts true
:anon-fn-naming-policy :off
:cross-chunk-method-motion false
:source-map-detail-level :all}}}
:worker
{:target :browser
:output-dir "resources/public/js/worker/"
:asset-path "/js/worker"
:devtools {:watch-dir "resources/public"
:reload-strategy :full
:browser-inject :main}
:dev {;; allows remote-relay per parallel environment
;; inside :dev so the integration tests won't use it
:devtools {:devtools-url #shadow/env ["SHADOW_SERVER_URL" :default ""]}}
:build-options {:manifest-name "manifest.json"}
:modules
{:main
{:entries [app.worker]
:web-worker true
:prepend-js "importScripts('./render.js');"
:depends-on #{}}}
:js-options
{:entry-keys ["module" "browser" "main"]
:export-conditions ["module" "import", "browser" "require" "default"]}
:compiler-options
{:output-feature-set :es2020
:output-wrapper false
:warnings {:fn-deprecated false}}
:release
{:compiler-options
{:fn-invoke-direct true
:optimizations #shadow/env ["PENPOT_BUILD_OPTIMIZATIONS" :as :keyword :default :advanced]
:output-wrapper true
:rename-prefix-namespace "PENPOT"
:source-map true
:elide-asserts true
:anon-fn-naming-policy :off
:source-map-detail-level :all}}}
;; FIXME: maybe rename to :components ? (there are nothing storybook
;; related, is just an ESM export of components that will be used
;; initially on storybook but not limited to storybook)
:storybook
{:target :esm
:output-dir "target/storybook/"
:devtools {:enabled false
:console-support false}
:js-options
{:js-provider :import
:entry-keys ["module" "browser" "main"]
:export-conditions ["module" "import", "browser" "require" "default"]}
:modules
{:components
{:exports {default app.main.ui.ds/default
helpers app.main.ui.ds.helpers/default}
:prepend-js ";(globalThis.goog.provide = globalThis.goog.constructNamespace_);(globalThis.goog.require = globalThis.goog.module.get);"
:depends-on #{}}}
:compiler-options
{:output-feature-set :es-next
:output-wrapper false
:warnings {:fn-deprecated false}}}
:test
{:target :esm
:output-dir "target/tests"
:runtime :custom
:js-options {:js-provider :import}
:modules
{:test {:init-fn frontend-tests.runner/init
:prepend-js ";if (typeof globalThis.navigator?.userAgent === 'undefined') { globalThis.navigator = {userAgent: ''}; };"}}}
:bench
{:target :node-script
:output-to "target/bench.js"
:output-dir "target/bench/"
:main bench/main
:compiler-options
{:output-feature-set :es2020
:output-wrapper false
:warnings {:fn-deprecated false}}
:release
{:compiler-options
{:fn-invoke-direct true
:elide-asserts true
:anon-fn-naming-policy :off}}}
:performance-tests
{:target :esm
:output-dir "target/performance-tests"
:runtime :custom
:js-options {:js-provider :import}
:modules
{:test {:init-fn performance-tests.render-wasm.runner/init
:prepend-js ";if (typeof globalThis.navigator?.userAgent === 'undefined') { globalThis.navigator = {userAgent: ''}; };"}}
:release
{:compiler-options
{:fn-invoke-direct true
:elide-asserts true
:anon-fn-naming-policy :off}}}
:bench-render-wasm-runner
{:target :node-script
:output-to "target/performance/render-wasm/runner.cjs"
:output-dir "target/performance/render-wasm/runner/"
:main benches.render-wasm.node.runner/-main
:devtools {:autoload false}
:compiler-options
{:output-feature-set :es2020
:output-wrapper false
:warnings {:fn-deprecated false}}
:release
{:compiler-options
{:fn-invoke-direct true
:elide-asserts true
:anon-fn-naming-policy :off}}}
:bench-render-wasm-pilot
{:target :node-script
:output-to "target/performance/render-wasm/pilot.cjs"
:output-dir "target/performance/render-wasm/pilot/"
:main benches.render-wasm.node.pilot/-main
:devtools {:autoload false}
:compiler-options
{:output-feature-set :es2020
:output-wrapper false
:warnings {:fn-deprecated false}}
:release
{:compiler-options
{:fn-invoke-direct true
:elide-asserts true
:anon-fn-naming-policy :off}}}
:bench-render-wasm-browser
{:target :esm
:output-dir #shadow/env ["RENDER_BENCH_BROWSER_DIR" :default "target/performance/render-wasm/browser/"]
:closure-defines {benches.render-wasm.identity/build-id #shadow/env ["RENDER_BENCH_BUILD_ID" :default "unprepared"]}
;; Bundle npm dependencies for the dedicated static host.
:js-options {:js-provider :shadow}
:modules
{:browser
{:exports {default benches.render-wasm.browser.bridge/bridge}}}
:compiler-options
{:output-feature-set :es2020
:output-wrapper false
:warnings {:fn-deprecated false}}
:release
{:compiler-options
{:fn-invoke-direct true
:elide-asserts true
:anon-fn-naming-policy :off}}}
:bench-render-wasm-catalog
{:target :node-library
:output-to #shadow/env ["RENDER_BENCH_CASES_PATH" :default "target/performance/render-wasm/cases.cjs"]
:output-dir "target/performance/render-wasm/catalog/"
:exports {:collectCases benches.render-wasm.node.case-catalog/collect-cases
:buildIdentity benches.render-wasm.node.case-catalog/build-identity}
:closure-defines {benches.render-wasm.identity/build-id #shadow/env ["RENDER_BENCH_BUILD_ID" :default "unprepared"]}
:compiler-options {:output-feature-set :es2020
:warnings {:fn-deprecated false}}
:release {:compiler-options {:fn-invoke-direct true
:elide-asserts true
:anon-fn-naming-policy :off}}}}}