15 Commits
Author SHA1 Message Date
Bogdan Chadkin 6500e01397 Move getBrowserStyle utility into builder (#2004)
getBrowserStyle is used only inside of builder and should not be part of
sdk importable by all component libraries. It also depends on global
types which need to be included in every package dependent on react-sdk.
2023-07-30 20:56:29 +04: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 6db60b7e7d Drop baseUrl from tsconfig in packages (#1530)
This should fix auto import from parent folders
which is very annoying right because tries to import from 'src'.
2023-04-26 18:59:43 +07:00
Bogdan Chadkin 9c316b0499 Enable typescript preserveValueImports (#1341)
This option forces all type imports to have "type" specifier even though
there are other value imports.

TS 5 forces it when new verbatimModuleSyntax is enabled.
2023-04-01 17:47:55 +07:00
Bogdan Chadkin 02d5f509dd Use build-package for http-client (#806)
Forgot to migrate it to our build-package script before. Now we got rid
of tsup.

```diff
du -ckd1 node_modules
-804060
+794324
```

```diff
root> pnpm build
-16s
+10s
```
2023-01-18 16:16:58 +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
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
Andras Bacsai e12b3c0753 fix: type CanvasData 2022-11-23 14:50:38 +01:00
Bogdan Chadkin 50010c7f0d Check all .ts and .tsx in packages src folder (#476)
Here "include" often have list of extensions and forgotten .tsx so such
modules are left unchecked. Replaced with just "src" which consider all
typescript extensions.

Ideally stop using tsc to build artifacts, switch to esbuild and remove
complex configuration from all tsconfig.json.
2022-11-19 21:21:38 +03:00
Mateusz Burzyński 03eab06fa9 Add a comment about references being auto-generated 2022-10-22 15:41:05 +02:00
Mateusz Burzyński 5318d995d6 Update references to use consistent formatting in the future 2022-10-22 13:12:10 +02:00
Mateusz Burzyński 75cb3252e5 Try to use golden-fleece to handle tsconfig containing comments 2022-10-22 12:52:51 +02:00
Mateusz Burzyński 470d5e1214 Update tsconfigs 2022-10-21 11:21:28 +02:00
Mateusz Burzyński 59ff5bf4d8 Use TS project references to improve the IDE experience 2022-10-20 20:53:40 +02:00
Andras Bacsai 2eb9781776 fix: rename http-api to http-client 2022-08-23 15:28:06 +02:00