diff --git a/library/README.md b/library/README.md index 584aa09baf..2243f8c2fd 100644 --- a/library/README.md +++ b/library/README.md @@ -52,7 +52,7 @@ await penpot.exportStream(context, writable); Build the library: ```bash -yarn run build +./scripts/build ``` Login on npm: diff --git a/library/scripts/build b/library/scripts/build new file mode 100755 index 0000000000..3e5e68ed5a --- /dev/null +++ b/library/scripts/build @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# NOTE: this script should be called from the parent directory to +# properly work. + +export CURRENT_VERSION=$(node -p "require('./package.json').version"); +export NODE_ENV=production; + +set -ex + +yarn run build + +sed -i -re "s/\%version\%/$CURRENT_VERSION/g" target/library/penpot.js diff --git a/library/src/lib/export.cljs b/library/src/lib/export.cljs index 55a11ae33a..1b81e3aa9f 100644 --- a/library/src/lib/export.cljs +++ b/library/src/lib/export.cljs @@ -190,8 +190,7 @@ :features (:features file)}))) params {:type "penpot/export-files" :version 1 - ;; FIXME: set proper placeholder for replacement on build - :generated-by "penpot-lib/develop" + :generated-by "penpot-library/%version%" :files files :relations []}] ["manifest.json" (delay (json/encode params))]))