0
Fork 0
mirror of https://github.com/penpot/penpot-export.git synced 2025-01-08 16:00:08 -05:00
Commit graph

22 commits

Author SHA1 Message Date
Roberto Redradix
5392f8a4e0 build: bump version to 0.1.0-beta.0 2023-09-15 19:14:45 +02:00
Roberto Redradix
122c5b6071 docs: license under Apache License, Version 2.0 2023-09-15 19:14:42 +02:00
Roberto Redradix
7927ed8f98 build(core,cli): build TypeScript before packing 2023-09-15 19:00:55 +02:00
Roberto Redradix
8a39949ed0 feat!(core): follow W3C draft design tokens format spec for colors and typographies in JSON output
Draft spec (24 July 2023): https://tr.designtokens.org/format/

Deprecate JSON output for page components, since the spec is not flexible enough for arbitrary properties.
2023-09-15 18:51:35 +02:00
Roberto Redradix
660f2b9ae9 refactor(core): decouple name scoping logic from API adapters
Introduce the concept of transformer functions. A transformer function will receive an assets as an input and will output the same kind of asset.

Scoping class names in CSS was a transformation applied to typography and page components assets when the output is CSS.

Decoupling this transformation from the rest of the adapter results in cleaner API inbound adapters, without any project-specific logic, so now they can be co-located close to the PenpotClient code.
2023-09-13 11:35:18 +02:00
Roberto Redradix
1681cefb05 refactor(core): add better semantics with wrapper internal types
Additionally, throw runtime internal errors when TypeScript assumptions are not fulfilled.
2023-09-12 18:19:10 +02:00
Roberto Redradix
2b3381fa97 feat!(core): use 8-digit hexadecimal RGBA colors
The 8-digit hexadecimal RGBA syntax is a more standard way to represent colors than the rgba() color function, which is CSS-specific.

The 8-digit hex notation is valid CSS as of the CSS Level 4 spec: https://www.w3.org/TR/css-color-4/#hex-notation

Additionally, the CSS rgba() comma-separated color function is considered *legacy color syntax* as per the CSS Level 4 spec: https://www.w3.org/TR/css-color-4/#legacy-color-syntax

Sass has built-in support for CSS Level 4 color notations: https://sass-lang.com/documentation/values/colors/

The 8-digit hexadecimal RGBA is a drop-in replacement for rgba() values in both CSS and SCSS, so this is functionally compatible if the file is used directly.

BREAKING CHANGE: drops CSS rgba() values in all output formats. It's a soft breaking change for CSS and SCSS outputs, but a hard one for JSON.
2023-09-12 13:28:09 +02:00
Roberto Redradix
f7275f8e30 refactor(core): move all re-export declaration to the end of the files 2023-09-11 18:45:28 +02:00
Roberto Redradix
1fcb0e0860 feat(core): describe typography requirements and Google Fonts implementation aid 2023-09-11 18:45:28 +02:00
Roberto Redradix
af856a642e refactor(core): separate file writting logic from output adapters 2023-09-07 17:26:22 +02:00
Roberto Redradix
f33dc7a9b8 feat(core): allow to export SCSS files 2023-09-07 16:59:03 +02:00
Roberto Redradix
9a39da7a65 refactor(core): delegate CSS tokenization and serialization to the outputter 2023-09-07 16:58:39 +02:00
Roberto Redradix
b76d4d57ef refactor(core): serialize each CSS variable at a time 2023-09-07 10:50:33 +02:00
Roberto Redradix
70c3d9a665 refactor(core): sort config types 2023-09-05 17:56:42 +02:00
Roberto Redradix
98597dbf4c feat!(core): allow to export JSON files
BREAKING CHANGE: CSS variables (color) are no longer lowercase. Since CSS custom property names are case sensitive, this would break existing consumers.
2023-09-05 14:40:00 +02:00
Roberto Redradix
1fd8a579de chore(core): remove unused type imports 2023-09-05 12:08:32 +02:00
Roberto Redradix
bef9cd65ef refactor(core): remove PenpotExportFile cumbersome abstraction 2023-09-05 12:03:54 +02:00
Roberto Redradix
924d5bec7b refactor(core): colocate schemas, types and validators 2023-09-04 18:49:12 +02:00
Roberto Redradix
f7b972e032 chore(core): disallow empty arrays in user config 2023-09-04 17:42:36 +02:00
Roberto Redradix
83ba6f93d5 refactor(core): validate user config in a more expressive way
zod unions are exclusive, so the UserConfig type couldn't be kept as a union either for having at least a colors, typographies or pages output.

This check has been moved to a runtime zod refine custom validation.
2023-09-04 17:42:34 +02:00
Roberto Redradix
bf6f6a723a test(core): add tests for CSS ident tokens 2023-09-04 13:41:32 +02:00
Roberto Redradix
e35186eae9 refactor!: split penpot-export into cli and core modules 2023-09-01 17:43:45 +02:00