Commit Graph
20 Commits
Author SHA1 Message Date
Bogdan Chadkin a58f2eff04 build: run all tests and typechecks in CI (#3661)
Here improved our checks. No longet rely on "checks" script but run
"test" and "typescript" scripts from each package in monorepo.

Would also make each package less boilerplaty.
2024-07-02 18:21:05 +03:00
Bogdan Chadkin 7128bc9204 build: publish 0.151.0 (#3297) 2024-05-04 16:56:39 +04:00
Bogdan Chadkin ecc7c75e84 build: remove unused build scripts (#3123)
dev, build and dts are not necessary in not published packages and can
be removed. Builder vite setup is able to access webstudio export
conditions. Only prisma client need to be built before builder.

This will reduce CI time which runs build many times in various
workflows.
2024-04-09 20:46:22 +07: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
Ivan Starkov b538b74ef2 Enable CLI Usage in CI Environment (#2321)
## Description

- Allow overriding default templates with custom external or internal
ones.
- Ensure exact dependencies, e.g., workspace:* instead of workspace:^,
to address beta release issues.
- Enable passing buildId, authToken, and origin via flags during sync.
- Rename "host" to "origin" in the CLI.

Most code is custom template.

- [x] - Tested at SaaS

## 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-18 14:54:14 +03: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
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
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
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 e98fe09eda Optimize typechecking (#1971)
Before we run two configurations of typescript on CI. Though this leads
to very long checks. Here I enabled "typecheck" script to generate dummy
.d.ts files to enable additional checks.

```diff
pnpm run -r typecheck (serial)
- 239.13s
+ 262.94s
pnpm turbo run size-test build checks dts --force (parallel locally)
- 2m30.609s
+ 1m47.622s
- pnpm turbo run size-test build checks dts --force (Ci)
- 6m 5s
+ pnpm turbo run size-test build checks --force (Ci)
+ 3m 22s
```
2023-07-24 11:38:19 +03:00
Bogdan Chadkin c5f84b7822 Run eslint from the root with cache (#1854)
While turborepo does not work for us we can try to solve long checks
time with builtin caching. Eslint provides similar one to prettier we
already use.

```
pnpm -r lint
51.53s

pnpm eslint . --ext .ts,.tsx --max-warnings 0
18.10s

pnpm eslint . --ext .ts,.tsx --max-warnings 0 --cache (with cache)
1.82s
```

In this PR I removed all lint scripts in packages and added global one
in the to github workflow. It saves like 30s on my laptop because pnpm.
Already stored cache makes linting almost instant.

Also bumped all eslint dependencies.
2023-06-26 10:08:15 +03:00
Bogdan Chadkin f06b35e35d Move types above import/require conditions (#1801)
Ref
https://github.com/webstudio-is/webstudio-builder/pull/1708#discussion_r1229878400
2023-06-15 10:46:42 +03: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 274eabde4a Specify types with exports condition (#1708)
Saas is swithing to moduleResolution=bundler.
Here I replaced types top level field with exoprts condition in all our
packages. Thi should fix issues with new sdk components packages and
simplify using additional entry points.
2023-06-03 09:32:30 +03:00
Mateusz Burzyńskiandistarkov 133661dfcb Fixed location of emitted declarations (#1487)
Fixed a regression from
https://github.com/webstudio-is/webstudio-builder/pull/1470 . @TrySound
noticed that by putting `declarationDir` in the base config all
declaration were emitted relative to... that base config. By switching
back to the CLI argument the issue is fixed.

---------

Co-authored-by: istarkov <istarkov@gmail.com>
2023-04-19 09:52:34 +04:00
Mateusz Burzyński 4424add480 Make the base tsconfig.json to assume declaration emit (#1470)
## Description

This PR "swaps" the guiding principle behind what options are in the
base `tsconfig.json`.

Previously TS was configured to *not* emit declarations and we were
forcing for them to be emitted with CLI flags. This had an unfortunate
result - errors about "not portable type definitions" were not displayed
in the IDE because to its best knowledge the type definitions were never
supposed to be emitted. So it wasn't worthwhile to surface this error.

With the adjusted options those errors will be raised in the IDE which
should improve the feedback loop for those errors.

## Code Review

- [ ] hi @TrySound, @istarkov, @kof - you need to recheck if you have
any doubts about this approach, if you see anything wrong with it in the
context of this project

## Before merging

- [ ] test IDE setup
- [ ] test build script
- [ ] test typechecking and dts emit
2023-04-17 15:30:11 +02:00
Mateusz Burzyński 678c9a273f Generate declaration files before publishing packages (#1351) 2023-04-07 07:14:18 +02:00
Bogdan Chadkin 2757da21d6 Migrate storybook to vite (#1209)
Webpack builder is very slow and hard to use becaause of it. It gave us
a lot of issues recently.

So here I migrated to vite builder. The experience is great. It caught a
bug in shallow-equal package, though fixed in latest release.

There was one issue with reload. When modify packages and rebuild
storybook watcher detects a lot of changes and goes into infinite loop.
Solved by importing packages sources directly with export conditions
vite allows to configure. Now any changes in packages can be reflected
in builder storybook without manual reload, restart and additional
watching.

We would get much better experience with remix if they allow to
configure this.

Also had to remove @storybook/addon-interactions which are incompatible
with vite builder.
2023-03-10 12:51:38 +03:00
Bogdan Chadkin 2c8395b4d0 Add feature-flags package (#800)
Extracted from
https://github.com/webstudio-is/webstudio-designer/pull/797 for upcoming
dashboard split into separate app

## Code Review

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

## 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-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
2023-01-17 20:08:35 +01:00