Commit Graph
69 Commits
Author SHA1 Message Date
Bogdan Chadkin ff7c1c923e Install missing deps with types (#647)
In https://github.com/webstudio-is/webstudio-designer/pull/646 I checked
with build. Now found more issues with typescript.

Also forgot to migrate to jest/globals "project" package.
2022-12-17 11:41:34 +03:00
Bogdan Chadkin 752768abbc Use explicit imports from @jest/globals (#645)
pnpm prevents access to jest and @types/jest from packages so we need to
explicitly install it. Though @types/jest is not officially maintained
and often late for months with new major which bloats node_modules with
two versions of jest transitives.

Here is alternative way to use official types. The only downside is
complains these types has less descriptions.
2022-12-16 16:35:22 +03: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
Ivan Starkov af90b31945 Bump versions (#616)
## Before requesting a review

- [ ] if the PR is WIP - use draft mode
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
- [ ] what kind of review is needed?
  - [ ] conceptual
  - [ ] detailed
  - [ ] with testing

## Test cases

- [ ] step by step interaction description and what is expected to
happen

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2022-12-12 23:56:10 +03:00
Mateusz Burzyński 35af8358e9 Move @webstudio-is/design-tokens to @webstudio-is/react-sdk prod deps (#602)
This should fix the problem reported on this line:
https://github.com/webstudio-is/webstudio-saas/actions/runs/3657427162/jobs/6181006430#step:6:52
, cc @andrasbacsai

Even though [you only reach for a
type](https://github.com/webstudio-is/webstudio-designer/blob/1a66acb79c8c560b3a54b55512c2779991a68eff/packages/react-sdk/src/tree/root.ts#L11),
you still should declare this package among your dependencies -
otherwise, it won't be installed by your consumers and thus the TS
compilation will fail for them.
2022-12-12 15:44:32 +01:00
Ivan Starkov 12a3da3140 Bump versions 2022-12-12 14:17:23 +03:00
Ivan Starkov 6cc2847cf6 Bump versions (#582)
For easier version change next time, now all has same version.
2022-12-09 21:52:10 +04:00
Andras Bacsai a995647084 fix:eslint, bump versions 2022-12-09 09:26:52 +01:00
Ivan Starkov cb7f22f7a4 Bump packages versions (#566)
## Before requesting a review

- [ ] if the PR is WIP - use draft mode
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
- [ ] what kind of review is needed?
  - [ ] conceptual
  - [ ] detailed
  - [ ] with testing

## Test cases

- [ ] step by step interaction description and what is expected to
happen

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2022-12-07 22:31:38 +04:00
Oleg Isonen 8d26bf781b move shared design tokens logic to a separate package 2022-12-03 12:09:22 +00:00
Bogdan Chadkin 6b761bb000 Replace tsc with esbuild to build packages (#543)
Build of whole monorepo without cache takes 1min or more on my laptop.
tsc is very slow tool for this. Also having rootDir in tsconfig prevents
checking outside of src folder.

Here I added "scripts" package with "build-package" bin. It does both
esm and cjs builds. --watch flag support completely replaces tsup for
us.

Now full rebuild of monorepo without cache takes only 10s including
prisma-client, http-client and designer builds.
2022-11-29 10:04:25 +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 a8f1f407b7 Bump saas packages (#527)
Added publish script to image package and bumped everything changed
since latest bump by checking `git log -1 -- .`
2022-11-27 13:48:26 +03:00
Roman Pominovandistarkov a9fede0a1d Ability to replace SDK components (#516)
Whats done:
- [x] - Added getComponent, getComponentMeta (old getComponenMeta
renamed to getComponentMetaProps)
- [x] - Added `registerComponents` (for now able only override existing
components)
- [x] - Renamed react-sd `remix` folder to `app`
- [x] - At the `app` folder added `custom-components/Image` wrapper
component, which reads assets etc, and use `webstudio/image`
- [x] `getParams`, `setParams` added at `react-sdk/app/` as they are app
level


TODO:
- [x] Create "normal" `useParams` to be able to use data.params
https://github.com/webstudio-is/webstudio-designer/blob/c05f40818beaac8a811fe0a97ba49e30f01f5045/packages/react-sdk/src/app/custom-components/image.tsx#L15-L23
- [x] Reuse props meta from imported image - created issue
https://github.com/webstudio-is/webstudio-designer/issues/521

Co-authored-by: istarkov <istarkov@gmail.com>
2022-11-27 02:47:14 +04:00
Ivan Starkov 843467a691 Image (#502)
- [x] - Image optimization component moved into standalone package
- [x] - generate-arg-types moved into standalone package - one issue
with current yarn https://github.com/yarnpkg/yarn/issues/4964 (you need
to delete root node_modules, then yarn and yarn build to make
generate-arg-types to work)
- [x] - move json into `__generated__` folder, (allow import json from
__generated__ folders only)
- [x] - Icons moved all gen into `__generated__`
- [x] - css-data generated content moved to `__generated__`
2022-11-25 12:27:44 +04:00
Bogdan Chadkin 7dbbfeb6b3 Fix sdk 2022-11-24 21:02:19 +03:00
Bogdan Chadkin 18d28b50cb Bump sass deps
We need to bump all sass deps to get esm support
and treeshake bundled code.
2022-11-24 20:59:41 +03:00
Bogdan Chadkin 16984b8bf7 Improve packages auto publish (#508)
Current solution often fails with

> You cannot publish over the previously published versions

Here I added small script which compares committed version and version
on npm and publish if do not match.

All scripts are run by turbo. So publishing new package is just changing
package script now.
2022-11-24 16:00:24 +03:00
Andras Bacsai b48d551e64 Merge pull request #491 from webstudio-is/feat/pages-updates
Pages update for Edge version
2022-11-23 13:49:44 +01:00
Andras Bacsai 3da21ede0e bump version 2022-11-23 09:38:03 +01: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 47a7bd6e4b Bump to jest 29 (#484)
The new version got more readable snapshots, no longer depends jsdom and
has much better esm support (will be enabled in next PR).

Had to switch to babel to support typescript, react and esm for now.
2022-11-21 19:10:18 +03:00
Andras Bacsai 9c2c0e6c42 fix: missing dependency (detect-font) 2022-11-21 11:30:01 +01:00
Oleg Isonen 24bc6be20d bump all updated package versions 2022-11-18 16:19:50 +01:00
Oleg Isonen 385ac6983b use zod as peer and dev deps 2022-11-18 14:26:26 +01:00
Oleg Isonen 33160e6632 move css-data to a package 2022-11-17 21:12:39 +01:00
Oleg Isonen 7d74fb51ef emove stitches from sdk 2022-11-17 03:39:37 +01:00
Oleg Isonen 66fa251fda use dynamicLinks from remix-utils to handle link tags and ssr generated css 2022-11-15 21:56:09 +01:00
istarkov 5d1452928d Image component 2022-11-09 06:07:48 +00:00
Mateusz Burzyński 0a0499a821 Add sideEffects: false to packages and revert some of the changes 2022-11-05 22:17:23 +01:00
Mateusz Burzyński 1b84fd65ef Generate actual /server entries in packages 2022-11-04 09:21:48 +01:00
Andras Bacsai 77722e7be2 version++ 2022-10-25 11:35:06 +02:00
Mateusz Burzyński 5179d71e81 Fixed the build script 2022-10-24 12:39:35 +02:00
Oleg Isonen b3a34adf5b Merge branch 'main' into 252-fonts-manager-and-fonts-selector 2022-09-26 11:25:07 +02:00
Oleg Isonen e1e2f6e53a add fontFamily css value type, render fallback fonts for system and uploaded fonts 2022-09-25 13:24:15 +03:00
Oleg Isonen 521876d33d don't build things that don't need to be built every time, those are commited anyways 2022-09-23 17:41:36 +03:00
Oleg Isonen 2cce1fe983 wip render fonts list and font-face 2022-09-22 16:31:19 +03:00
Andras Bacsai c87cee4e43 move canvasDocument to react-sdk 2022-09-15 10:13:47 +02:00
Mateusz Burzyński eedc0dd4a8 Upgrade to TS 4.7 2022-09-09 16:59:39 +02:00
Andras Bacsai 986b4572d1 remove esbuild-node-loader 2022-09-02 19:10:00 +00:00
Andras Bacsai 229558da96 fix: esm loader 2022-09-02 14:50:15 +02:00
Andras Bacsai 5af49dcaa8 fix: bump versions 2022-08-29 13:50:51 +02:00
Andras Bacsai e54c96110f fix: package.json 2022-07-28 16:15:12 +00:00
Andras Bacsai 5aa9925aa1 Merge branch 'main' into npm-for-all-packages 2022-07-28 09:42:32 +00:00
Oleg Isonen 1d22c0c63b fix dependencies 2022-07-28 00:04:56 +02:00
Oleg Isonen c72148bff5 moving design system into a package, adding linters in packages where me missed to add them 2022-07-27 23:47:06 +02:00
Oleg Isonen 6b5582776e merge webstudio meta for components with sdk react components 2022-07-27 19:52:39 +02:00
Andras Bacsai 7de66e65a4 Merge branch 'main' into npm-for-all-packages 2022-07-22 18:45:28 +00:00
Andras Bacsai ced3a73bec renaming all packages to @webstudio-is/* 2022-07-22 12:28:17 +00:00
Sara Vieira 525e9e3e94 remove prisma script 2022-07-22 14:22:15 +02:00