mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 02:46:20 +00:00
Merge remote-tracking branch 'origin/staging' into staging-render
This commit is contained in:
commit
4282cdcd2c
61
.github/workflows/tests.yml
vendored
61
.github/workflows/tests.yml
vendored
@ -20,7 +20,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: "Code Linter"
|
name: "Linter"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
|
|
||||||
@ -30,10 +30,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Check clojure code format
|
- name: Check clojure code format
|
||||||
run: |
|
run: |
|
||||||
corepack enable;
|
./scripts/lint
|
||||||
corepack install;
|
|
||||||
yarn install
|
|
||||||
yarn run fmt:clj:check
|
|
||||||
|
|
||||||
test-common:
|
test-common:
|
||||||
name: "Common Tests"
|
name: "Common Tests"
|
||||||
@ -52,10 +49,7 @@ jobs:
|
|||||||
- name: Run tests on NODE
|
- name: Run tests on NODE
|
||||||
working-directory: ./common
|
working-directory: ./common
|
||||||
run: |
|
run: |
|
||||||
corepack enable;
|
./scripts/test
|
||||||
corepack install;
|
|
||||||
yarn install;
|
|
||||||
yarn run test;
|
|
||||||
|
|
||||||
test-frontend:
|
test-frontend:
|
||||||
name: "Frontend Tests"
|
name: "Frontend Tests"
|
||||||
@ -69,25 +63,12 @@ jobs:
|
|||||||
- name: Unit Tests
|
- name: Unit Tests
|
||||||
working-directory: ./frontend
|
working-directory: ./frontend
|
||||||
run: |
|
run: |
|
||||||
corepack enable;
|
./scripts/test
|
||||||
corepack install;
|
|
||||||
yarn install;
|
|
||||||
yarn run test;
|
|
||||||
|
|
||||||
- name: Component Tests
|
- name: Component Tests
|
||||||
working-directory: ./frontend
|
working-directory: ./frontend
|
||||||
run: |
|
run: |
|
||||||
yarn run playwright install chromium --with-deps;
|
./scripts/test-components
|
||||||
yarn run build:storybook
|
|
||||||
|
|
||||||
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
|
|
||||||
"npx http-server storybook-static --port 6006 --silent" \
|
|
||||||
"npx wait-on tcp:6006 && yarn test:storybook"
|
|
||||||
|
|
||||||
- name: Check SCSS Format
|
|
||||||
working-directory: ./frontend
|
|
||||||
run: |
|
|
||||||
yarn run lint:scss;
|
|
||||||
|
|
||||||
test-render-wasm:
|
test-render-wasm:
|
||||||
name: "Render WASM Tests"
|
name: "Render WASM Tests"
|
||||||
@ -164,11 +145,7 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
working-directory: ./library
|
working-directory: ./library
|
||||||
run: |
|
run: |
|
||||||
corepack enable;
|
./scripts/test
|
||||||
corepack install;
|
|
||||||
yarn install;
|
|
||||||
yarn run build:bundle;
|
|
||||||
yarn run test;
|
|
||||||
|
|
||||||
build-integration:
|
build-integration:
|
||||||
name: "Build Integration Bundle"
|
name: "Build Integration Bundle"
|
||||||
@ -219,11 +196,7 @@ jobs:
|
|||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
working-directory: ./frontend
|
working-directory: ./frontend
|
||||||
run: |
|
run: |
|
||||||
corepack enable;
|
./scripts/test-e2e --shard="1/4";
|
||||||
corepack install;
|
|
||||||
yarn install;
|
|
||||||
yarn run playwright install chromium --with-deps;
|
|
||||||
yarn run test:e2e -x --workers=2 --reporter=list --shard="1/4";
|
|
||||||
|
|
||||||
- name: Upload test result
|
- name: Upload test result
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -253,11 +226,7 @@ jobs:
|
|||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
working-directory: ./frontend
|
working-directory: ./frontend
|
||||||
run: |
|
run: |
|
||||||
corepack enable;
|
./scripts/test-e2e --shard="2/4";
|
||||||
corepack install;
|
|
||||||
yarn install;
|
|
||||||
yarn run playwright install chromium --with-deps;
|
|
||||||
yarn run test:e2e -x --workers=2 --reporter=list --shard "2/4";
|
|
||||||
|
|
||||||
- name: Upload test result
|
- name: Upload test result
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -287,11 +256,7 @@ jobs:
|
|||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
working-directory: ./frontend
|
working-directory: ./frontend
|
||||||
run: |
|
run: |
|
||||||
corepack enable;
|
./scripts/test-e2e --shard="3/4";
|
||||||
corepack install;
|
|
||||||
yarn install;
|
|
||||||
yarn run playwright install chromium --with-deps;
|
|
||||||
yarn run test:e2e -x --workers=2 --reporter=list --shard "3/4";
|
|
||||||
|
|
||||||
- name: Upload test result
|
- name: Upload test result
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -303,7 +268,7 @@ jobs:
|
|||||||
retention-days: 3
|
retention-days: 3
|
||||||
|
|
||||||
test-integration-4:
|
test-integration-4:
|
||||||
name: "Integration Tests 3/4"
|
name: "Integration Tests 4/4"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
needs: build-integration
|
needs: build-integration
|
||||||
@ -321,11 +286,7 @@ jobs:
|
|||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
working-directory: ./frontend
|
working-directory: ./frontend
|
||||||
run: |
|
run: |
|
||||||
corepack enable;
|
./scripts/test-e2e --shard="4/4";
|
||||||
corepack install;
|
|
||||||
yarn install;
|
|
||||||
yarn run playwright install chromium --with-deps;
|
|
||||||
yarn run test:e2e -x --workers=2 --reporter=list --shard "4/4";
|
|
||||||
|
|
||||||
- name: Upload test result
|
- name: Upload test result
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
@ -87,6 +87,7 @@ example. It's still usable as before, we just removed the example.
|
|||||||
- Fix problem with plugins generating code for pages different than current one [Taiga #12312](https://tree.taiga.io/project/penpot/issue/12312)
|
- Fix problem with plugins generating code for pages different than current one [Taiga #12312](https://tree.taiga.io/project/penpot/issue/12312)
|
||||||
- Fix input confirmation behavior is not uniform [Taiga #12294](https://tree.taiga.io/project/penpot/issue/12294)
|
- Fix input confirmation behavior is not uniform [Taiga #12294](https://tree.taiga.io/project/penpot/issue/12294)
|
||||||
- Fix copy/pasting application/transit+json [Taiga #12721](https://tree.taiga.io/project/penpot/issue/12721)
|
- Fix copy/pasting application/transit+json [Taiga #12721](https://tree.taiga.io/project/penpot/issue/12721)
|
||||||
|
- Fix problem with plugins content attribute [Plugins #209](https://github.com/penpot/penpot-plugins/issues/209)
|
||||||
|
|
||||||
## 2.11.1
|
## 2.11.1
|
||||||
|
|
||||||
|
|||||||
7
common/scripts/test
Executable file
7
common/scripts/test
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
corepack enable;
|
||||||
|
corepack install;
|
||||||
|
yarn install;
|
||||||
|
yarn run test;
|
||||||
@ -267,3 +267,4 @@
|
|||||||
(-> (stp/convert-to-path shape objects)
|
(-> (stp/convert-to-path shape objects)
|
||||||
(update :content impl/path-data))))
|
(update :content impl/path-data))))
|
||||||
|
|
||||||
|
(dm/export impl/decode-segments)
|
||||||
|
|||||||
@ -565,6 +565,9 @@
|
|||||||
(def check-content
|
(def check-content
|
||||||
(sm/check-fn schema:content))
|
(sm/check-fn schema:content))
|
||||||
|
|
||||||
|
(def decode-segments
|
||||||
|
(sm/lazy-decoder schema:segments sm/json-transformer))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; CONSTRUCTORS & PREDICATES
|
;; CONSTRUCTORS & PREDICATES
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|||||||
9
frontend/scripts/test
Executable file
9
frontend/scripts/test
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
corepack enable;
|
||||||
|
corepack install;
|
||||||
|
yarn install;
|
||||||
|
|
||||||
|
yarn run lint:scss;
|
||||||
|
yarn run test;
|
||||||
13
frontend/scripts/test-components
Executable file
13
frontend/scripts/test-components
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
corepack enable;
|
||||||
|
corepack install;
|
||||||
|
yarn install;
|
||||||
|
|
||||||
|
yarn run playwright install chromium --with-deps;
|
||||||
|
yarn run build:storybook
|
||||||
|
|
||||||
|
exec npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
|
||||||
|
"npx http-server storybook-static --port 6006 --silent" \
|
||||||
|
"npx wait-on tcp:6006 && yarn test:storybook"
|
||||||
8
frontend/scripts/test-e2e
Executable file
8
frontend/scripts/test-e2e
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
corepack enable;
|
||||||
|
corepack install;
|
||||||
|
yarn install;
|
||||||
|
yarn run playwright install chromium --with-deps;
|
||||||
|
yarn run test:e2e -x --workers=2 --reporter=list "$@";
|
||||||
@ -7,6 +7,8 @@
|
|||||||
(ns app.plugins.parser
|
(ns app.plugins.parser
|
||||||
(:require
|
(:require
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
|
[app.common.json :as json]
|
||||||
|
[app.common.types.path :as path]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]))
|
||||||
@ -514,3 +516,8 @@
|
|||||||
(case axis
|
(case axis
|
||||||
"horizontal" :y
|
"horizontal" :y
|
||||||
"vertical" :x))
|
"vertical" :x))
|
||||||
|
|
||||||
|
(defn parse-commands
|
||||||
|
[commands]
|
||||||
|
(-> (json/->clj commands)
|
||||||
|
(path/decode-segments)))
|
||||||
|
|||||||
@ -1034,8 +1034,8 @@
|
|||||||
(fn []
|
(fn []
|
||||||
(let [shape (u/locate-shape file-id page-id id)]
|
(let [shape (u/locate-shape file-id page-id id)]
|
||||||
(cond
|
(cond
|
||||||
(not (cfh/path-shape? shape))
|
(and (not (cfh/path-shape? shape)) (not (cfh/bool-shape? shape)))
|
||||||
(u/display-not-valid :makeMask (:type shape))
|
(u/display-not-valid :toD (:type shape))
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(.toString (:content shape)))))
|
(.toString (:content shape)))))
|
||||||
@ -1488,13 +1488,37 @@
|
|||||||
|
|
||||||
(cond-> (or (cfh/path-shape? data) (cfh/bool-shape? data))
|
(cond-> (or (cfh/path-shape? data) (cfh/bool-shape? data))
|
||||||
(crc/add-properties!
|
(crc/add-properties!
|
||||||
{:name "content"
|
{:name "commands"
|
||||||
|
:get #(-> % u/proxy->shape :content format/format-path-content)
|
||||||
|
:set
|
||||||
|
(fn [_ value]
|
||||||
|
(let [segments (parser/parse-commands value)]
|
||||||
|
(cond
|
||||||
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
(u/display-not-valid :content "Plugin doesn't have 'content:write' permission")
|
||||||
|
|
||||||
|
(not (sm/validate path/schema:segments segments))
|
||||||
|
(u/display-not-valid :content segments)
|
||||||
|
|
||||||
|
:else
|
||||||
|
(let [selrect (path/calc-selrect segments)
|
||||||
|
content (path/from-plain segments)
|
||||||
|
points (grc/rect->points selrect)]
|
||||||
|
(st/emit! (dwsh/update-shapes
|
||||||
|
[id]
|
||||||
|
(fn [shape]
|
||||||
|
(-> shape
|
||||||
|
(assoc :content content)
|
||||||
|
(assoc :selrect selrect)
|
||||||
|
(assoc :points points)))))))))}
|
||||||
|
{:name "d"
|
||||||
:get #(-> % u/proxy->shape :content str)
|
:get #(-> % u/proxy->shape :content str)
|
||||||
:set
|
:set
|
||||||
(fn [_ value]
|
(fn [_ value]
|
||||||
(let [segments (if (string? value)
|
(let [segments
|
||||||
(svg.path/parse value)
|
(if (string? value)
|
||||||
value)]
|
(svg.path/parse value)
|
||||||
|
value)]
|
||||||
(cond
|
(cond
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
(u/display-not-valid :content "Plugin doesn't have 'content:write' permission")
|
(u/display-not-valid :content "Plugin doesn't have 'content:write' permission")
|
||||||
@ -1514,4 +1538,7 @@
|
|||||||
(-> shape
|
(-> shape
|
||||||
(assoc :content content)
|
(assoc :content content)
|
||||||
(assoc :selrect selrect)
|
(assoc :selrect selrect)
|
||||||
(assoc :points points)))))))))}))))))
|
(assoc :points points)))))))))}
|
||||||
|
{:name "content"
|
||||||
|
:get #(.-d %)
|
||||||
|
:set (fn [self value] (set! (.-d self) value))}))))))
|
||||||
|
|||||||
9
library/scripts/test
Executable file
9
library/scripts/test
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
corepack enable;
|
||||||
|
corepack install;
|
||||||
|
yarn install;
|
||||||
|
|
||||||
|
yarn run build:bundle;
|
||||||
|
yarn run test;
|
||||||
10
package.json
10
package.json
@ -11,14 +11,8 @@
|
|||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"fmt:clj:check": "cljfmt check --parallel=true common/src/ common/test/ frontend/src/ frontend/test/ backend/src/ backend/test/ exporter/src/ library/src",
|
"lint": "./scripts/lint",
|
||||||
"fmt:clj": "cljfmt fix --parallel=true common/src/ common/test/ frontend/src/ frontend/test/ backend/src/ backend/test/ exporter/src/ library/src",
|
"fmt": "./scripts/fmt"
|
||||||
"lint:clj:common": "clj-kondo --parallel=true --lint common/src",
|
|
||||||
"lint:clj:frontend": "clj-kondo --parallel=true --lint frontend/src",
|
|
||||||
"lint:clj:backend": "clj-kondo --parallel=true --lint backend/src",
|
|
||||||
"lint:clj:exporter": "clj-kondo --parallel=true --lint exporter/src",
|
|
||||||
"lint:clj:library": "clj-kondo --parallel=true --lint library/src",
|
|
||||||
"lint:clj": "yarn run lint:clj:common && yarn run lint:clj:frontend && yarn run lint:clj:backend && yarn run lint:clj:exporter && yarn run lint:clj:library"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.12.7"
|
"@types/node": "^20.12.7"
|
||||||
|
|||||||
13
scripts/fmt
Executable file
13
scripts/fmt
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
cljfmt --parallel=true \
|
||||||
|
common/src/ \
|
||||||
|
common/test/ \
|
||||||
|
frontend/src/ \
|
||||||
|
frontend/test/ \
|
||||||
|
backend/src/ \
|
||||||
|
backend/test/ \
|
||||||
|
exporter/src/ \
|
||||||
|
library/src;
|
||||||
19
scripts/lint
Executable file
19
scripts/lint
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
cljfmt check --parallel=true \
|
||||||
|
common/src/ \
|
||||||
|
common/test/ \
|
||||||
|
frontend/src/ \
|
||||||
|
frontend/test/ \
|
||||||
|
backend/src/ \
|
||||||
|
backend/test/ \
|
||||||
|
exporter/src/ \
|
||||||
|
library/src;
|
||||||
|
|
||||||
|
clj-kondo --parallel=true --lint common/src;
|
||||||
|
clj-kondo --parallel=true --lint frontend/src;
|
||||||
|
clj-kondo --parallel=true --lint backend/src;
|
||||||
|
clj-kondo --parallel=true --lint exporter/src/;
|
||||||
|
clj-kondo --parallel=true --lint library/src;
|
||||||
Loading…
x
Reference in New Issue
Block a user