44 Commits
Author SHA1 Message Date
Bogdan Chadkin 4c7cb84629 Release 0.96 (#2293) 2023-09-09 21:14:37 +04:00
Bogdan Chadkin 7d37d4ad9a Bundle cli packages (#2292)
Here changed build command to bundle all cli packages so we would not
need to resolve .js extensions in es modules. This will fix ubuntu,
windows and node 20 usages.
2023-09-09 20:42:34 +04:00
Jaya Krishna Namburu 0de3bca350 Escape special characters in route names in cli projects (#2288) 2023-09-09 16:03:11 +05:30
Bogdan Chadkin 88dd24ff7d Move pubsub from sdk to builder (#2280)
Pubsub is only used for builder/canvas communication while sdk is
responsible for rendering sites.
Here moved pubsub to builder. Now we can drop nanoevents from cli
dependencies.
2023-09-08 20:56:46 +04:00
Jaya Krishna Namburu ddff32b7ab Throw error message if the project config is missing in the users env when using cli (#2289)
…when using cli

## Description

Adds a error message when the project config like, `host` and `token`
are missing from the root.

## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
2023-09-08 16:56:32 +02:00
Bogdan Chadkin 7d7c56e73a Fix radix imports generation (#2287)
Used wrong import name.
Added accordion fixture to see issues in the future
2023-09-08 17:53:02 +04:00
Ivan Starkov 576382bd8d Fix local install of cli binaries (#2285)
## Description

Fixes local installation of cli 
The issue was that at `pnpm install` 
`./lib/bin.js` wasn't exists.

Solution is to create it and forward all calls to `./lib/bin`


## 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-08 15:01:44 +03:00
Bogdan Chadkin 813919baa1 Release 0.95 (#2284) 2023-09-08 14:46:36 +04:00
Bogdan Chadkin 9272b4eadf Simplify generated remix overrides (#2283)
Here replaced Object.assign logic with overriding components at build
time. This will simplify migration to jsx generator and let bundler load
less components.

Changed fixture to include link from remix overrides.

<img width="487" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5635476/8ba87f70-9edd-4b92-bf28-8457eea3b5c9">
2023-09-08 14:37:25 +04:00
Oleg Isonen f6460ae0bf Rename CLI to webstudio-cli (#2282)
As per discussion renaming it to be usable consistently with less typing
using npx webstudio-cli as well as pnpm webstudio-cli
2023-09-08 12:24:06 +02:00
Ivan Starkov 9724458417 Npm Update 0.94.0 (#2276)
## 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 23:57:27 +03:00
Ivan Starkov 08cbed3fcd Fix remix dev warnings (#2277)
## 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 23:57:16 +03:00
Oleg Isonen b564edc85f Better wording in CLI (#2275)
Just wording
2023-09-07 22:36:23 +02:00
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
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
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 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
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
Bogdan Chadkin 0313a20458 Fix cli package name 2023-09-04 15:54:20 +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
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 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
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
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
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 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
Oleg Isonen 37bd008428 Update main webstudio repo links (#2210)
We renamed webstudio-builder to webstudio
2023-08-29 14:10:43 +04:00
Bogdan Chadkin 440fc6b6de Release 0.91.0 (#2209) 2023-08-29 10:02:57 +04:00
Jaya Krishna Namburu 0e64ee80c8 Moving cli from apps folder into packages folder (#2198)
## Description

This PR moves the cli from `apps/cli` into `packages` folder. It was
initially started under `app/cli` from this
[comment](https://github.com/webstudio-is/webstudio-cli/pull/6#issuecomment-1657212350).
But looks like, `packages` is the good place for it.
2023-08-28 09:55:08 +02:00