openpencil/.devcontainer/Dockerfile
Danila Poyarkov 9b418de13e
refactor: print OpenPencil JSX export as syntax trees (#799)
* refactor(codegen): share syntax-tree code generation between exporters

dom-css printed Tailwind JSX with its own esrap JSX builders and kept TypeScript template helpers under its Storybook export. The OpenPencil JSX exporter needs the same JSX builders, and design-jsx and dom-css may not depend on each other.

@open-pencil/codegen holds both: es for ESTree templates and modules (moved from dom-css) and jsx for JSX elements, attributes, text, and printing, including the literal rules that keep exported strings from being reinterpreted. dom-css no longer depends on acorn and esrap directly.

* refactor(design-jsx): print JSX export as syntax trees

sceneNodeToJSX concatenated strings with hand-written escaping and indentation. It now collects typed props (moved to export/props.ts) and prints them with @open-pencil/codegen's JSX builders. Output is unchanged except for text: special characters print as a string expression instead of entities, and multi-line text keeps its line breaks, which the old line-splitting lost on render.

* docs(codegen): fix package metadata and dependency rules

codegen's repository.directory still named design-jsx, the README mentioned es without showing it, and the design-jsx and dom-css guides still said they depend only on scene-graph.

* test(core): move the JSX export round-trips to the design-jsx test home

Covers tabs in layer names and text, which JSX keeps as written.
2026-10-01 21:22:43 +04:00

37 lines
1.5 KiB
Docker

FROM oven/bun@sha256:b86c67b531d87b4db11470d9b2bd0c519b1976eee6fcd71634e73abfa6230d2e
# Bun 1.3.10, pinned to the multi-platform image digest.
ARG CA_CERTIFICATES_VERSION=20250419
ARG GIT_VERSION=1:2.47.3-0+deb13u1
ARG GIT_LFS_VERSION=3.6.1-1+deb13u1
ARG OPENSSH_CLIENT_VERSION=1:10.0p1-7+deb13u4
USER root
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
ca-certificates=${CA_CERTIFICATES_VERSION} \
git=${GIT_VERSION} \
git-lfs=${GIT_LFS_VERSION} \
openssh-client=${OPENSSH_CLIENT_VERSION} \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install --system \
&& install -d -o bun -g bun \
/workspace/open-pencil/node_modules \
/workspace/open-pencil/packages/scene-graph/node_modules \
/workspace/open-pencil/packages/pen/node_modules \
/workspace/open-pencil/packages/kiwi/node_modules \
/workspace/open-pencil/packages/fig/node_modules \
/workspace/open-pencil/packages/core/node_modules \
/workspace/open-pencil/packages/dom-css/node_modules \
/workspace/open-pencil/packages/design-jsx/node_modules \
/workspace/open-pencil/packages/codegen/node_modules \
/workspace/open-pencil/packages/vue/node_modules \
/workspace/open-pencil/packages/cli/node_modules \
/workspace/open-pencil/packages/mcp/node_modules \
/workspace/open-pencil/packages/docs/node_modules \
/workspace/open-pencil/tools/docs/node_modules
USER bun