4060 Commits
Author SHA1 Message Date
Ivan Starkov 2de2cbecbb Update 0.93.0 (#2273)
## Description

1. What is this PR about (link the issue and add a short description)

## 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.example`
and the `builder/env-check.js` if mandatory
0.93.0
2023-09-07 22:20:07 +03:00
Ivan Starkov 20e1ff7bc9 Remove dev server from cli, add info about how to execute it (#2274)
## Description

Dev server no longer executed in cli

<img width="467" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/8054656a-8c73-4ed2-a9ce-20fabb1f525c">


## 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.example`
and the `builder/env-check.js` if mandatory
2023-09-07 22:19:26 +03:00
Ivan Starkov 47a3f3aaab Add export dialog to publish (#2269)
## Description

<img width="374" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/a76bdeeb-a1c4-4449-a9d4-673896e3309c">

<img width="368" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/ccd71fd1-8d1c-4fc1-b2a2-7534f3f1096e">


## 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.example`
and the `builder/env-check.js` if mandatory
2023-09-07 21:52:13 +03:00
Bogdan Chadkin e8c2da7da4 Add scope utility for code generation (#2267)
Here added `createScope()` utility to maintain collision free and
readable identifiers. Integrated it for component imports.

In the future will be used for jsx and data sources generation.
2023-09-07 22:37:05 +04:00
Jaya Krishna Namburu a1c82cd98b Improve help and run dev-server after init of a project while using cli (#2268)
## Description

- Improves the help message that is displayed for `webstudio --help`
- Runs the dev server if the user opts in for the dependencies
installation.

## Code Review
- [ ] hi @kof , I need you to do
  - detailed review (read every line)
  
## Before requesting a review
- [x] made a self-review
2023-09-07 18:50:52 +02:00
Bogdan Chadkin 82a8c62629 Release 0.92.0 (#2265) 2023-09-07 15:40:32 +04:00
Jaya Krishna Namburu 6b1cb53d24 Update text inside cli init flow (#2266)
## Description

This PR updates the text from the cli's init flow. The changes are
request from the #2263

## Code Review

- [ ] hi @TrySound , I need you to do
  - detailed review (read every line)
2023-09-07 13:31:24 +02:00
Bogdan Chadkin 544db22b14 Drop instances checks from form server logic (#2264)
Instances checks are excessive and requires instances data to be present
in runtime. We can remove it.
2023-09-07 14:55:51 +04:00
Jaya Krishna Namburu 1d97587a0c Show spinners after the prompts are responded and close the prompts on ctrl + c in the cli (#2263)
## Description

This PR
- Allows the prompts to be cancelable at any time.
- Prompts the user if the dependencies can be installed, when the
project is being connected for the first time.
- Shows the spinner once all the prompts are responded. Which was
previously clearing the prompts to be displayed.

## Code Review

- [ ] 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
- [x] made a self-review
2023-09-07 12:44:14 +02:00
Jaya Krishna Namburu 288062167a Install dependencies and run the dev server on webstudio command using cli (#2258)
## Description

This PR, will add two more step after the init flow. Once the project is
scaffolded. It installs the dependencies and then runs the dev server.

## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  
## Before requesting a review

- [x] made a self-review
2023-09-07 10:11:13 +02:00
Bogdan Chadkin 3f5d17aa6b Stop publishing sources and stories (#2261)
Here removed sources and stories from published packages. Sources were
used in the past instead off .d.ts. But since we generate them we can
reduce packages size significantly.

Cli install size

```diff
du -ck node_modules
- 33192
+ 29176
```
2023-09-07 10:53:34 +04:00
Bogdan Chadkin 1d8593f571 Mark unused packages as private (#2260)
We need to stop publishig all packages. Many of them not used and maybe
never be used in public. Though they bloat packages search, makes
publish step longer. Prisma client publishes 700MB package every time.
2023-09-07 10:47:20 +04:00
GoharAkram 96b433a551 Update README.md (#2259)
made some content changes to main page of repo

## Description

1. What is this PR about (link the issue and add a short description)

## 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.example`
and the `builder/env-check.js` if mandatory
2023-09-07 03:28:38 +05:00
Bogdan Chadkin f24007957f Fix radix tabs and accordion on published sites (#2257)
Missing piece to make accordion and tabs components work on published
sites.
2023-09-06 23:44:15 +04:00
Ivan Starkov 08b0bfad5d Add fixtures (#2254)
## Description

See readme. Project created to be able to test/develop cli app.
Whats changed in cli
- [x] - preview flag added (to use preview env to sownload assets)
- [x] - package.json is now merged (deepmerge) when added to the repo

- Next PR
- [ ] - Flag like `"customConditions": ["source"],` could not work

## 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.example`
and the `builder/env-check.js` if mandatory
2023-09-06 21:43:29 +03:00
Bogdan Chadkin dbbbf84c34 Drop commonjs (#2255)
Seems like we no longer need commonjs in most packages. Only prisma
cannot be bundled on server because has binary.

Now new package setup is easier and require only esbuild instead of
custom solution.

Cli install size

```diff
du -ck node_modules
- 35516
+ 33192
```
2023-09-06 20:47:13 +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
Jaya Krishna Namburu 81781ee199 Add guided flow using prompts for cli (#2252)
## Description

This PR adds prompts, when the cli is ran using `webstudio` and without
any commands. It requests the users if they want to create a folder. If
yes, it will create a folder and changes the directory to the newly
created ones.

This PR even allows `webstudio link` command to be executed without
prompts using

```sh
webstudio link -l <link>
```

## Code Review

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

## Before requesting a review
- [x] made a self-review
2023-09-06 14:34:36 +02:00
Bogdan Chadkin 87e69b2e85 Move style schema into css-engine (#2251)
Css-data now responsible for generated data and parsers which requires
heavy dependencies like csstree and openai.

Here moved style schema into css-engine which makes is responsible for
own input representation. So now schema and serialization are co-located
in single package.

Cli install size

```diff
du -ck node_modules
- 42680
+ 35516
```
2023-09-06 15:55:41 +04:00
Ivan Starkov 84db426a57 Switch the CLI to using yargs (#2250)
Switch on yargs in cli parser.

Shows help on specific commands too

<img width="695" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/3289697b-6788-4da0-b28b-3983f6e35d0c">
2023-09-06 11:24:20 +04:00
Ivan Starkov 5c3af9daec Update permission level tooltips to reflect recent changes (#2243)
## Description

ref #2226

<img width="379" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/ee316434-07f7-470c-9bee-1db68f1a9afa">

Everything except Button aligned to the design, we don't have Button
with Menu Item style

## 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.example`
and the `builder/env-check.js` if mandatory
2023-09-05 17:48:45 +03:00
Ivan Starkov 905b8287f3 Use pending state on button in Share panel (#2248)
## Description

closes #2225

## Steps for reproduction

Add/delete/update/load links see button has pending state

## 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-05 17:39:23 +03:00
Bogdan Chadkin 96348aaa5a Generate preparsed tailwind theme (#2249)
Here I replaced previous theming solution with generated code. It allows
us to not have tailwind in dependencies and not bloat cli installation.

Additionally all values are preparsed into our internal format to avoid
parsing at runtime when meta is imported and not have parsing
dependencies like csstree (still there for now).

Cli install size

```diff
du -ck node_modules
- 57880
+ 42680
```
2023-09-05 13:52:22 +04:00
Yordis PrietoandOleg Isonen ac72e48f93 Adjust share panel alignment to match design (#2234)
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

close #2224

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-09-04 20:12:30 +02:00
Ivan Starkov 0ef48794a7 Fix chromatic root token (#2246)
## Description

1. What is this PR about (link the issue and add a short description)

## 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.example`
and the `builder/env-check.js` if mandatory
2023-09-04 15:52:50 +03:00
Ivan Starkov 400161e735 Remove chromatic secrets (make public) (#2244)
## Description

1. What is this PR about (link the issue and add a short description)

## 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.example`
and the `builder/env-check.js` if mandatory
2023-09-04 15:29:39 +03:00
Bogdan Chadkin f506312a0d Move font parsing into asset uploader (#2242)
Here I moved font parsing into asset uploader as it is used only there
but bloats sdk and cli with big fontkit package.

Cli install size

```diff
du -ck node_modules
- 72464
+ 57880
```
2023-09-04 16:18:50 +04:00
Bogdan Chadkin 0313a20458 Fix cli package name 2023-09-04 15:54:20 +04:00
Bogdan Chadkin 05298f404a Prevent submit inside dialog in builder (#2238)
Ref https://github.com/webstudio-is/webstudio/issues/2233

Capture mode fixes unexpected submit of form when placed inside radix
dialog. Though didn't find a trace why this happen. There is
`form.method = 'dialog'` which has special behavior inside `<dialog>`
but it is not our case.
2023-09-04 15:51:49 +04:00
Jaya Krishna NamburuandBogdan Chadkin 484f0ab775 Add missing build files for npm publish for cli (#2232)
This PR will revert the name of the package back to `@webstudio/cli`.
And adds the `files` field in package.json. This will fix the publish of
files to npm

---------

Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>
2023-09-04 13:33:35 +04:00
Bogdan Chadkin 1b50873728 Bump checks (#2236)
- jest
- type-fest
- typescript
- prettier
- eslint
- typescript-eslint
2023-09-04 13:25:57 +04:00
Ivan Starkov f3f7f88df3 Add admin (publish) permissions to tokens (#2221)
## Description

Add admin permissions to shared links

<img width="328" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/972a46b9-154b-4426-9d8c-ab62ebf9a9e3">

<img width="283" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/d187da84-4d49-4308-b6ea-f09cb7a09e8c">


Share links for now disabled for admin role. Will do in the next
iteration after releasing above.


## Steps for reproduction

Create admin token link.
Open in incognito, see Publish is working.

## 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-04 12:10:29 +03:00
Bogdan Chadkin ee0e0f7e7a Drop prisma from cli (#2241)
Here moved types and utilities from project-build to sdk package. This
removed huge prisma from cli.

```
du -ck node_modules
137460
72464
```
2023-09-04 12:43:56 +04:00
Bogdan Chadkin 2ed1646dae Enforce local style source at the end (#2229)
Ref https://github.com/webstudio-is/webstudio/issues/1965

Tweaked logic and dnd to always put local style source in the end and
tokens before it.
2023-09-04 01:49:13 +04:00
Bogdan Chadkin 5794e8d1e7 Move app schema to sdk (#2237)
We are planning to decouple cli from prisma and all unrelated packages.
Here moved whole app schema into sdk package.
2023-09-03 22:27:30 +04:00
Ikko Eltociear Ashimine c4d7252f0a Fix comment in instance-selected.ts (#2235)
calulated -> calculated
2023-09-02 21:31:04 +04:00
Mayke 2a7a7bc3e5 Ensure no conflicts on undo and redo hotkeys (#2230)
Ref https://github.com/webstudio-is/webstudio/issues/2028

Changed `useHotkeys.enableOnFormTags` to be enabled just when in canvas
for undo/redo.
2023-09-02 16:20:59 +04:00
Bogdan Chadkin afc75f1d99 Drop unused db validation (#2231)
We had db data validation enabled before but it made api requests very
slow. We disabled this validation and seems like there is no need to
enable again.

Also dropped all zod list types of our data because validation was the
only use case.
2023-09-01 23:57:59 +04:00
Oleg Isonen f3ed732adb New package name for CLI (#2228)
- We decided to use `npx webstudio` for simplicity and new package name
is nicer
- Added the license
2023-09-01 13:50:24 +02:00
Jaya Krishna Namburu fb60ff5d04 Add typecript typechecking for the cli (#2227)
## Description

This PR adds, typescript type checking for the cli, which runs in the CI
pipeline too.

## Code Review

- [ ] hi @TrySound , I need you to do
  - detailed review (read every line)
 
## Before requesting a review

- [x] made a self-review
2023-09-01 10:43:01 +02:00
Jaya Krishna Namburu d63a1ec615 Add a default favicon for the projects generated using cli (#2222)
## Description

This PR adds a default favicon for the projects generated using `cli`.
Now there is a another build step, which holds all the default image
assets. And stores them as `base64`. And writes back to the destination
project.

The two things that are handled are

- favicon
- no-warnings flag to disable warnings when using cli

## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)

## Before requesting a review

- [x] made a self-review
- [x] added inline comments where things may be not obvious (the "why",
not "what")
2023-08-31 20:08:22 +02:00
Ivan Starkov d10e5272b7 Update trpc (#2223)
## Description

Update trpc

## 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.example`
and the `builder/env-check.js` if mandatory
2023-08-31 19:04:56 +03:00
Bogdan Chadkin f5882256b8 Move assets schema into sdk package (#2220)
We are planning to move all types necessary to represent generated site
into separate package. This way we will be able to make CLI as small as
possible.

Here moved only assets schema. Now we get rid of aws, sharp and one
prisma usage (project-build still use it)

```diff
- 99MB
+ 75MB
```
2023-08-31 19:39:20 +04:00
Bogdan Chadkin b6c4911e41 Remove generate-arg-types from direct dependencies (#2218)
Here moved PropMeta to react-sdk package. It was the only reason to
install generate-arg-types cli as direct dependency in all component
libraries.

This is the resulting install size of webstudio CLI. TypeScript and
react-docgen-typescript no longer installed.

```diff
- 141MB
+ 99MB
```
2023-08-31 15:59:45 +04:00
Bogdan Chadkin 2b0e9ae206 Remove assets stubbing (#2219)
We used to set undefined in assets map value to preserve the order
between uploading and uploaded states. Now we started sorting uploaded
assets by create time and stubbing no longer do anything useful.
2023-08-31 13:37:52 +04:00
Jaya Krishna Namburu 37dd701546 Add support for radix components in projects generated by cli (#2213)
## Description

This PR adds support for projects that uses radix components.

## Steps for reproduction

Generate a project that is using radix components. Everything should
work as expected.

## Code Review

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

Most of the code is taken from `webstudio-saas` repo itself. 

- Updated the templates to use latest version of the `@webstudio`
packages.
2023-08-31 04:27:28 +02:00
Oleg Isonen e757566e84 Use PlusIcon for new page (#2216)
Closes https://github.com/webstudio-is/webstudio/issues/1991
## Description

Updated new page icon to using Plus icon

## Steps for reproduction

1. open pages panel
2. see new icon

## Code Review

- [ ] hi @TrySound , 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-08-30 23:48:53 +02:00
Oleg Isonen 28f104c80e Hide additional states, they should go into a submenu (#2217)
Closes https://github.com/webstudio-is/webstudio/issues/2029

## Description

Once we add a submenu, all advanced states will go there

## Steps for reproduction

1. see that button, input, textarea no longer have these states on style
source

disabled", 
enabled", 
read-only",
read-write"



## Code Review

- [ ] hi @TrySound , 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-08-30 23:06:01 +02:00
Oleg Isonen 11e078b78f Update links after renaming the repository (#2214) 2023-08-30 12:09:03 +02:00
Jaya Krishna Namburu 7a77340da0 Update cli readme (#2168) 2023-08-30 00:08:13 +05:30