Commit Graph
39 Commits
Author SHA1 Message Date
Ivan Starkov 6a930b1c0c feat: Compare server and client versions and prompt for reload. (#3833)
## Description

Reload if server and client versions do not match on patch

## Steps for reproduction

1. click button
2. expect xyz

## 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` file
2024-07-30 20:10:22 +03:00
Bogdan Chadkin b0726f1be1 build: bump storybook (#3731)
Storybook cut a lot of transitive packages. Now upgrades should be
easier. Future 8.3 promise to cut even more.
2024-07-17 13:32:18 +02:00
Bogdan Chadkin cf5c6b9f29 refactor: use jsx to represent instances in tests (#3568)
Added "@webstudio-is/sdk/testing" entry point with jsx utilities to
simplify instances representation.

React is used as runtime, then renderJsx traverse resulting tree and
converts into our data.
2024-06-15 00:06:20 +03:00
Bogdan Chadkin 93aeceac59 build: bump storybook (#3559)
Upgrade storybook and vite, esbuild and tsx with it.
2024-06-14 01:18:30 +03:00
Bogdan Chadkin df192e1c44 build: bump tsx and relax esbuild (#3489)
Upgraded both tsx and esbuild to the latest version and removed override
for esbuild. As a result we have 5 duplicates of esbuild but they will
go away with time.
2024-06-04 15:00:08 +03:00
Bogdan Chadkin e6695a84ac build: upgrade esbuild (#3086)
Need to bump storybook to use vite in remix.
2024-04-04 16:06:05 +07:00
Oleg Isonenandistarkov 9fd6660712 fix: don't render HTML Embed server-side in production if clientOnly option is used (#3051)
## Code Review

Following tests are added
```
Published site
    ✓ clientOnly === false (30 ms)
    ✓ clientOnly === true (7 ms)
  Builder renderer= canvas | preview
    ✓ script processing are not applied when clientOnly=true executeScriptOnCanvas=false and renderer=canvas (4 ms)
    ✓ script processing are not applied when clientOnly=true executeScriptOnCanvas=undefined and renderer=canvas (2 ms)
    ✓ script processing are not applied when clientOnly=false executeScriptOnCanvas=false and renderer=canvas (4 ms)
    ✓ script processing are not applied when clientOnly=false executeScriptOnCanvas=undefined and renderer=canvas (5 ms)
    ✓ script processing are not applied when clientOnly=undefined executeScriptOnCanvas=false and renderer=canvas (7 ms)
    ✓ script processing are not applied when clientOnly=undefined executeScriptOnCanvas=undefined and renderer=canvas (2 ms)
    ✓ In preview mode, script processing are applied when clientOnly=true and renderer="preview" and executeScriptOnCanvas=true (3 ms)
    ✓ In preview mode, script processing are applied when clientOnly=true and renderer="preview" and executeScriptOnCanvas=false (2 ms)
    ✓ In preview mode, script processing are applied when clientOnly=true and renderer="preview" and executeScriptOnCanvas=undefined (2 ms)
    ✓ In preview mode, script processing are applied when clientOnly=false and renderer="preview" and executeScriptOnCanvas=true (2 ms)
    ✓ In preview mode, script processing are applied when clientOnly=false and renderer="preview" and executeScriptOnCanvas=false (2 ms)
    ✓ In preview mode, script processing are applied when clientOnly=false and renderer="preview" and executeScriptOnCanvas=undefined (2 ms)
    ✓ In preview mode, script processing are applied when clientOnly=undefined and renderer="preview" and executeScriptOnCanvas=true (2 ms)
    ✓ In preview mode, script processing are applied when clientOnly=undefined and renderer="preview" and executeScriptOnCanvas=false (2 ms)
    ✓ In preview mode, script processing are applied when clientOnly=undefined and renderer="preview" and executeScriptOnCanvas=undefined (2 ms)
    ✓ In preview mode, script processing are applied when clientOnly=true and renderer="canvas" and executeScriptOnCanvas=true (1 ms)
    ✓ In preview mode, script processing are applied when clientOnly=false and renderer="canvas" and executeScriptOnCanvas=true (3 ms)
    ✓ In preview mode, script processing are applied when clientOnly=undefined and renderer="canvas" and executeScriptOnCanvas=true (2 ms)
    ✓ Code change cause scripts to be updated (2 ms)
    ✓ Placeholder is shown if code is "" (1 ms)
    ✓ Placeholder is shown if code is "   "
```

- [ ] hi @istarkov , 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

---------

Co-authored-by: istarkov <istarkov@gmail.com>
2024-03-26 20:38:09 +03:00
Bogdan Chadkin 7e824eb1e4 build: bump checks (#2425)
- esbuild
- jest
- eslint
- eslint-typescript

Also removed "jest" binary from packages and use the one installed in
the root
and deduplicated all deps (got a little messy recently).
2023-10-06 16:33:33 +04:00
Bogdan Chadkin fb5414f93d build: use webstudio export condition for tools (#2347)
This fixes the issue with eventsource-parser package having source
export condition with different setup.

Now everywhere "webstudio" is used to reference our sources.
2023-09-20 22:14:34 +04:00
Bogdan Chadkin 8402316908 Bump storybook and build tools (#2253)
- storybook
- vite
- react types
- tsx
- esbuild (glob entry points support)
2023-09-06 17:49:56 +04:00
Bogdan Chadkin 1b50873728 Bump checks (#2236)
- jest
- type-fest
- typescript
- prettier
- eslint
- typescript-eslint
2023-09-04 13:25:57 +04:00
Bogdan Chadkin b8a7a40dd5 Add utilities generator to sdk (#2098)
Here moved code generation of utilities from saas into sdk.

Now InstanceRoot accepts utils object with these 3 fields

- indexesWithinAncestors,
- executeComputingExpressions,
- executeEffectfulExpression,

Generation utility can be shared between cli and saas to simplify
maintenance.
2023-08-12 17:04:37 +04:00
Ivan Starkov 034709c44d release-0.84.0 (#2082)
## Description

npm packages update


## Steps for reproduction

1. click button
2. expect xyz

## 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-08-09 22:48:34 +03:00
Bogdan Chadkin 8c6b5cff82 Bump to remix 1.19.2 (#2062)
Ref https://github.com/remix-run/remix/releases/tag/remix%401.19.2

Here fixed a few vulnerabilities by upgrading proxy-agent dependency.
2023-08-06 19:46:19 +04:00
Bogdan Chadkin 107a2c0ce5 Bump to storybook 7.2 (#2059)
- https://github.com/storybookjs/storybook/releases/tag/v7.2.0
- https://storybook.js.org/blog/july-2023-update/
2023-08-06 14:20:05 +04:00
Bogdan Chadkin 004232da63 Bump checks packages (#2002)
- jest
- simple-git-hooks
- eslint
- size-limit
2023-07-28 23:37:33 +03:00
Bogdan Chadkin 36b5c5facb Migrate to custom jest transform (#1993)
Esbuild is not officially supported by jest
and all available packages do not fit all our need.

esbuild-jest we used for a long time have problems too.

The most important one is frigile heuristik to instrument any code with
`ock(` in text. And we have some `pointerLock(` in design-system.

The other problem is instrumentation converts to commonjs and result
goes to esbuild which tries to convert back to esm but with only default
export. So jest fails anywhere we try to import design-system in tests.

The other problem is lack of maintanance and very old packages inside.

Here refactored original package and removed everything we don't need
including mocks instrumentation.

This should fix the build in
https://github.com/webstudio-is/webstudio-builder/pull/1986

```diff
Packages:
- 1924
+ 1782
```
2023-07-26 21:16:55 +03:00
Oleg Isonen 9a52328d16 Change license from MIT to AGPL V3 (#1980)
The main reason for this change is the realization that a product needs
some more protection than a typical library. With this change it is
still an Open Source Core, but now corporations can't build on top of it
without contributing back to the OSS community or without buying a
license.
2023-07-26 01:06:21 +02:00
Bogdan Chadkin 7364b51210 Run jest with sources (#1930)
Here added custom condition to jest config to make it load source code
instead of build artifacts.

This means we no longer need to rebuild after changing code in other
package
and we may even no need to generate cjs anymore.
2023-07-14 17:30:31 +03:00
Ivan Starkov 70746774bf Release 0.61.0 (#1539)
## Description

Release 0.61.0
Npm packages update

## Steps for reproduction

1. click button
2. expect xyz

## 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-28 09:36:56 +04:00
Ivan Starkov a25f0da9b9 Release 0.58 (#1488)
## Description

Merge after #1487 

## Steps for reproduction

1. click button
2. expect xyz

## 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-19 10:29:07 +04:00
Ivan Starkov 8d68ba8b11 Release 0.57.0 (#1486)
## Description

NPM update

## Steps for reproduction

1. click button
2. expect xyz

## 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-18 21:05:43 +04:00
Bogdan Chadkin 845d53981c Improve packages publish (#676)
- all workspace dependencies are use with `workspace:^` protocol which
on publish is replaced with `^VERSION`. This will let us to upgrade
transitive packages in saas without shaman dancing around package.json
and lockfile.
- publish-to-npm script is replaced with `pnpm -r publish` which
recursively publishes all packages if version does not exist in npm
- dropped yarn lockfile
2022-12-22 17:06:27 +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
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 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
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
Mateusz Burzyński 2c39885160 Add a file transform to jest to handle assets (#392)
closes #387

Note that the issue mentions adding an asset import to a story in
`react-sdk`. Right now you also get type errors there on those. In the
designer app you don't get those because types for assets are declared
within the `@remix-run/dev` typedefs that you reference:

https://github.com/webstudio-is/webstudio-designer/blob/a9c2b0e6b9a82ea7f1ff626c47519b8404a67b04/apps/designer/remix.env.d.ts#L1

This is a separate problem though and should be handled separately.
2022-11-07 19:28:47 +01:00
istarkov ecdfcbde32 Allow inline snapshots 2022-11-06 14:16:08 +00:00
Oleg Isonen b8606d985c revert jest upgrade, resulted in failing tests 2022-09-24 22:21:09 +03:00
Oleg Isonen 23a980eb7d add test for getFontFaces 2022-09-24 16:57:32 +03:00
Mateusz Burzyński eedc0dd4a8 Upgrade to TS 4.7 2022-09-09 16:59:39 +02:00
Andras Bacsai 5af49dcaa8 fix: bump versions 2022-08-29 13:50:51 +02:00
Roman Pominov 9ba4cf2c0f add zod schema for components 2022-08-23 17:34:30 +03:00
Andras Bacsai 4466e747a8 rename jest.config.js to index.js in packages 2022-07-22 21:07:32 +00:00
Andras Bacsai 3760aa18ab bump packages version 2022-07-22 14:54:18 +00:00
Andras Bacsai ced3a73bec renaming all packages to @webstudio-is/* 2022-07-22 12:28:17 +00:00
Sara Vieira 8453bad2c2 make jest config 2022-07-18 21:51:00 +02:00