Commit Graph
14 Commits
Author SHA1 Message Date
Bogdan Chadkin 02ca084a0c refactor: upgrade to csstree v3 (#5455)
The new version is aware of modern colors and other new css features.
2025-11-23 14:32:12 +03:00
Bogdan Chadkin adadbe3aa2 refactor: enable isolated declatations in css data (#4476)
Moved transition related stuff into builder, simplified mdn-data and
added missing types to exports, removed popularity index.
2024-11-30 16:47:26 +07:00
Ivan Starkov e56995d7af feat: transform tailwind classes to webstudio format (#2386)
## Description

transform tailwind classes to webstudio format

Next PRs.
Postprocessing backgrounds and shadows support. As of now backgrounds
will be drawn but will not be visible at style panel


## Steps for reproduction

see tests

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-09-28 13:11:50 +00:00
Ivan Starkov 333f167c48 feat: Add helper functions for Tailwind support: shorthand expansion and variable substitution (#2371)
## Description

Gonna merge this before next step.

Helper functions to parse tailwind.

1. `expandTailwindShorthand` - Expands shorthand CSS properties into
their long-form equivalents. _'mx' is expanded to 'mr' (margin-right)
and 'ml' (margin-left)._
2. `substituteVariables` - Resolves CSS variables by replacing their
references with actual values. _Transforms `.class { --property: 1px;
margin: var(--property); }` into `.class { margin: 1px; }`._

## Steps for reproduction

See tests.

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-09-28 09:36:54 +00:00
Bogdan Chadkin f15339e002 Check types outside of src folder (#1789)
We generate dts type for each package on publish.
It requires us to include only "src" to output same structure as in src
folder. Though we have configs and cli scripts outside of it which
should be typechecked, they cannot be ignored.

Ideally would be to have one-line commands in package.json. Though
typescript always has problems with build step. In this case the CLI
have everything to configure this except "include" and "exclude" flags.

So here to workaround that I added tsconfig.dts.json to distinct dts
generation and typechecking.

Blocker for https://github.com/webstudio-is/webstudio-builder/pull/1634
2023-06-14 23:37:24 +03:00
Bogdan Chadkin c40f5e507d Replace @types/css-tree override with patch (#1783)
Split from https://github.com/webstudio-is/webstudio-builder/pull/1634

We may need more things from css-tree and reexporting everything is
harder to maintain so here added patch instead of types override.
2023-06-14 17:51:13 +03:00
Giuseppe 6a9c4c013c Initial CSS parser (#1652)
## Description

This PR moves the parse-css-value utility that was before part of the
builder app to the css-data package.

In this package we are adding an initial `parse-css` utility that will take
CSS and convert to a format that we can work on within Webstudio. For
now it is relatively simple and it supports only CSS classes parsing.
2023-05-23 09:47:13 +02:00
Bogdan Chadkin 6db60b7e7d Drop baseUrl from tsconfig in packages (#1530)
This should fix auto import from parent folders
which is very annoying right because tries to import from 'src'.
2023-04-26 18:59:43 +07:00
Ivan Starkov 8bf079d821 Add common keywords (#1385)
## Description

closes #1378

## Steps for reproduction

Take any css property, see it contains 
initial, inherit, unset

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-04-06 22:21:52 +04:00
Bogdan Chadkin d05b1bc21f Resolve tsconfig package (#643)
While migrating to pnpm I got an issue with our extends relying on
node_modules. pnpm have only symlinks and do not have hoisted
node_modules in the root.

Here I switched extends to package name as all tools can resolve it and
tweaked remix tsconfig to extend from packages folder instead of
node_modules.
2022-12-16 13:09:33 +03:00
Bogdan Chadkin 3e96357a2c Use sources as type deifnitions (#539)
Right now our build and CI take a lot of time. 1:40min - 2min on CI and
1min locally. We spend time on vercel, on main CI, on publish and
locally.

At the moment in packages anything outside of src folder is not checked
because of rootDir.

We have to generate "references" field on precommit.

All these issues can be avoided if remove .d.ts generation completely
and specify sources in "types" field. This way we get zero build time
for types and can switch to other build tool (like esbuild) for .js
generation and get almost instant build on vercel, on main CI and on
publish.

Downsides

- it can be slower (actually not really caz we delete .tsbuildinfo cache
anyway and we can still generate it with incremental flag)
- it contraditcs recommended practices for published packages (we can
generate .d.ts in publish script only and use "types" as source
internally)
2022-11-28 22:27:56 +03:00
Bogdan Chadkin ad04473f26 Migrate packages to native ESM (#493)
Our designer bundle heavily bloated with not analyzable commonjs
generated by typescript.

The biggest problem comes from bundled icons library which esbuild
cannot tree shake because of cjs.

Another issue is broken code splitting. Packages in one piece are appear
in chunks and always loaded even with dynamic import and React.lazy.

To solve this I migrated each package to native node es modules.
Storybook and jest work almost without changes. Though it's not possible
to run remix in esm project (while still esm packages can be bundled for
ssr). And as a result designer jest failed because of cjs tests requires
from esm packages. As a solution I generated additional commonjs
artifacts in lib/cjs.

du -ck public/build
2336
1736
2022-11-23 10:12:58 +03:00
Bogdan Chadkin 50010c7f0d Check all .ts and .tsx in packages src folder (#476)
Here "include" often have list of extensions and forgotten .tsx so such
modules are left unchecked. Replaced with just "src" which consider all
typescript extensions.

Ideally stop using tsc to build artifacts, switch to esbuild and remove
complex configuration from all tsconfig.json.
2022-11-19 21:21:38 +03:00
Oleg Isonen 33160e6632 move css-data to a package 2022-11-17 21:12:39 +01:00