From 6106e560527461486e80e2fdb7fcb8299a68db0c Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 30 Jan 2025 14:51:38 +0100 Subject: [PATCH 1/5] :paperclip: Import from develop github workflows --- .github/workflows/commit-checker.yml | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/commit-checker.yml diff --git a/.github/workflows/commit-checker.yml b/.github/workflows/commit-checker.yml new file mode 100644 index 000000000..7ad5c1101 --- /dev/null +++ b/.github/workflows/commit-checker.yml @@ -0,0 +1,50 @@ +name: 'Commit Message Check' +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + pull_request_target: + types: + - opened + - edited + - reopened + - synchronize + push: + branches: + - main + - develop + - staging + +jobs: + check-commit-message: + name: Check Commit Message + runs-on: ubuntu-latest + steps: + - name: Check Commit Type + uses: gsactions/commit-message-checker@v2 + with: + pattern: '^:(lipstick|globe_with_meridians|wrench|books|arrow_up|zap|ambulance|construction|boom|fire|whale|bug|sparkles|paperclip|tada|recycle):\s[A-Z].*[^.]$' + flags: 'gm' + error: 'Commit should match CONTRIBUTING.md guideline' + checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request + accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true + + # - name: Check Line Length + # uses: gsactions/commit-message-checker@v2 + # with: + # pattern: '^[^#].{74}' + # error: 'The maximum line length of 74 characters is exceeded.' + # excludeDescription: 'true' # optional: this excludes the description body of a pull request + # excludeTitle: 'true' # optional: this excludes the title of a pull request + # checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request + # accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is ue + # - name: Check for Resolves / Fixes + # uses: gsactions/commit-message-checker@v2 + # with: + # pattern: '^.+(Resolves|Fixes): \#[0-9]+$' + # error: 'You need at least one "Resolves|Fixes: #" line.' + + From b88ec134487a891d4c0448814ad65c86506f64e3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 30 Jan 2025 14:41:33 +0100 Subject: [PATCH 2/5] :paperclip: Fix linter issues --- .clj-kondo/config.edn | 6 ++++++ common/shadow-cljs.edn | 2 +- common/src/app/common/files/repair.cljc | 2 +- frontend/shadow-cljs.edn | 2 +- frontend/src/app/worker.cljs | 1 - frontend/src/app/worker/import.cljs | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn index 5675b9d5d..08c3cd7e8 100644 --- a/.clj-kondo/config.edn +++ b/.clj-kondo/config.edn @@ -58,6 +58,12 @@ :redundant-do {:level :off} + :redundant-ignore + {:level :off} + + :redundant-nested-call + {:level :off} + :earmuffed-var-not-dynamic {:level :off} diff --git a/common/shadow-cljs.edn b/common/shadow-cljs.edn index fc3f4be04..bd4cafa82 100644 --- a/common/shadow-cljs.edn +++ b/common/shadow-cljs.edn @@ -9,7 +9,7 @@ :modules {:test {:init-fn common-tests.runner/-main - :prepend-js "globalThis.navigator = {userAgent: \"\"}"}}} + :prepend-js ";if (typeof globalThis.navigator?.userAgent === 'undefined') { globalThis.navigator = {userAgent: ''}; };"}}} :bench {:target :node-script diff --git a/common/src/app/common/files/repair.cljc b/common/src/app/common/files/repair.cljc index 5d80c844f..2d486ba6c 100644 --- a/common/src/app/common/files/repair.cljc +++ b/common/src/app/common/files/repair.cljc @@ -494,7 +494,7 @@ (let [repair-shape (fn [shape] ;; Remove the swap slot - (log/debug :hint (str " -> remove swap-slot")) + (log/debug :hint " -> remove swap-slot") (ctk/remove-swap-slot shape))] (log/dbg :hint "repairing shape :misplaced-slot" :id (:id shape) :name (:name shape) :page-id page-id) diff --git a/frontend/shadow-cljs.edn b/frontend/shadow-cljs.edn index a0673a0e9..4aad071ae 100644 --- a/frontend/shadow-cljs.edn +++ b/frontend/shadow-cljs.edn @@ -144,7 +144,7 @@ :modules {:test {:init-fn frontend-tests.runner/init - :prepend-js "globalThis.navigator = {userAgent: \"\"}"}}} + :prepend-js ";if (typeof globalThis.navigator?.userAgent === 'undefined') { globalThis.navigator = {userAgent: ''}; };"}}} :lib-penpot {:target :esm diff --git a/frontend/src/app/worker.cljs b/frontend/src/app/worker.cljs index 502e3d67e..213d20ae2 100644 --- a/frontend/src/app/worker.cljs +++ b/frontend/src/app/worker.cljs @@ -168,7 +168,6 @@ (.removeEventListener js/self "message" on-message)) (defn ^:dev/after-load start [] - [] (set! process-message-sub (subscribe-buffer-messages)) (.addEventListener js/self "message" on-message)) diff --git a/frontend/src/app/worker/import.cljs b/frontend/src/app/worker/import.cljs index ebeb67daa..950c98ffb 100644 --- a/frontend/src/app/worker/import.cljs +++ b/frontend/src/app/worker/import.cljs @@ -72,7 +72,7 @@ ([context type id media] (let [file-id (:file-id context) path (case type - :manifest (str "manifest.json") + :manifest "manifest.json" :page (str file-id "/" id ".svg") :colors-list (str file-id "/colors.json") :colors (let [ext (cm/mtype->extension (:mtype media))] From 33da02421e786812148cb456cdd3cc6a0e86768c Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 3 Feb 2025 13:10:06 +0100 Subject: [PATCH 3/5] :bug: Fix unexepected exception on importing binfile Happens when importing binfile with files that has deleted_at property. --- backend/src/app/binfile/common.clj | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/app/binfile/common.clj b/backend/src/app/binfile/common.clj index d33792304..91de0eeaf 100644 --- a/backend/src/app/binfile/common.clj +++ b/backend/src/app/binfile/common.clj @@ -481,6 +481,7 @@ file) params (-> file + (dissoc :deleted-at) (update :features db/encode-pgarray conn "text") (update :data blob/encode))] From 6ca1a845579deb3575c6a9d3e20d59c06bad1507 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 10 Feb 2025 10:59:29 +0100 Subject: [PATCH 4/5] :bug: Backport build issue from staging Related to the devenv update --- frontend/scripts/build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/scripts/build b/frontend/scripts/build index 3ef7ce097..b29801545 100755 --- a/frontend/scripts/build +++ b/frontend/scripts/build @@ -16,7 +16,10 @@ export TS=$(date +%s); # performant code on macros (example: rumext) export NODE_ENV=production; +corepack enable; +corepack up || exit 1; yarn install || exit 1; + rm -rf resources/public; rm -rf target/dist; From ccce3bcb8f7de56386e72b4cd1f9f5627f98b050 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 10 Feb 2025 11:40:14 +0100 Subject: [PATCH 5/5] :bug: Fix exporter build script --- exporter/scripts/build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/exporter/scripts/build b/exporter/scripts/build index 7ad0aecf5..31b28f234 100755 --- a/exporter/scripts/build +++ b/exporter/scripts/build @@ -3,12 +3,13 @@ set -ex export CURRENT_VERSION=$1; - -yarn install -rm -rf target - export NODE_ENV=production; +corepack enable; +corepack up || exit 1; +yarn install || exit 1; +rm -rf target + # Build the application clojure -M:dev:shadow-cljs release main;