From a0f167d1f28a2a6faaf9b089841e6012a99cb2ae Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 13 Oct 2026 12:22:50 +0200 Subject: [PATCH] :sparkles: Build library files with current features and migrations The file builder behind @penpot/library pinned the features and migrations it writes to the ones Penpot 2.7 accepted, so its files could open there. It now writes the current defaults: the features a new file gets and every available migration. Generated files were already in the current format (paths, for one, are stored as path data), so they now declare fdata/path-data and components/swap-group as they should, and the import runs no migration on them. Files built this way need the Penpot version the library is built with, or a later one. AI-assisted-by: claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 (1M context) --- common/src/app/common/files/builder.cljc | 27 +++--------------------- library/CHANGES.md | 7 ++++++ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/common/src/app/common/files/builder.cljc b/common/src/app/common/files/builder.cljc index 49d93407a0..0cad5dc0f3 100644 --- a/common/src/app/common/files/builder.cljc +++ b/common/src/app/common/files/builder.cljc @@ -8,10 +8,10 @@ "Internal implementation of file builder. Mainly used as base impl for penpot library" (:require - ;; [app.common.features :as cfeat] [app.common.data :as d] [app.common.data.macros :as dm] [app.common.exceptions :as ex] + [app.common.features :as cfeat] [app.common.files.changes :as ch] [app.common.files.helpers :as cph] [app.common.files.migrations :as fmig] @@ -192,32 +192,11 @@ (-> (get-current-objects state) (get shape-id))) -;; WORKAROUND: A copy of features from staging for make the library -;; generate files compatible with version released right now. This -;; should be removed and replaced with cfeat/default-features when 2.8 -;; version is released - -(def default-features - #{"fdata/shape-data-type" - "styles/v2" - "layout/grid" - "components/v2" - "plugins/runtime" - "design-tokens/v1" - "variants/v1"}) - -;; WORKAROUND: the same as features -(def available-migrations - (-> fmig/available-migrations - (disj "003-convert-path-content") - (disj "0002-clean-shape-interactions") - (disj "0003-fix-root-shape"))) - (defn add-file [state params] (let [params (-> params - (assoc :features default-features) - (assoc :migrations available-migrations) + (assoc :features cfeat/default-features) + (assoc :migrations fmig/available-migrations) (update :id default-uuid)) file (types.file/make-file params :create-page false)] (-> state diff --git a/library/CHANGES.md b/library/CHANGES.md index b1f7acdc70..699edf43a4 100644 --- a/library/CHANGES.md +++ b/library/CHANGES.md @@ -1,5 +1,12 @@ # CHANGELOG +## Unreleased + +- Generate files with the features and migrations of the Penpot version + the library is built with, instead of a fixed set from Penpot 2.7. The + files need that Penpot version or a later one to open. + + ## 1.2.0 - Update deps and build it with penpot 2.18.3