editor-js / document-model

❗️WIP❗️
Apache License 2.0
11 stars 2 forks source link

fix(build): use ts references, add hack for esbuild #70

Closed ilyamore88 closed 8 months ago

ilyamore88 commented 8 months ago

Typescript references

Now we're using the --build flag to build typescript projects. This flag supports project references. Because of that, we don't need to use Yarn Workspaces on CI to build package dependencies topologically. TSC is responsible for that.

Vite and ESBuild 🤡

ESBuild doesn't support all tsconfig fields. See https://esbuild.github.io/content-types/#tsconfig-json. I've fixed this problem by creating build:dependencies script in the playground package. This script builds all workspace dependencies.

github-actions[bot] commented 8 months ago

⏭️ No files to mutate for ./packages/model

github-actions[bot] commented 8 months ago

⏭️ No files to mutate for ./packages/dom-adapters

github-actions[bot] commented 8 months ago

Coverage report for ./packages/dom-adapters

St.:grey_question:
Category Percentage Covered / Total
🟢 Statements 100% 0/0
🟢 Branches 100% 0/0
🟢 Functions 100% 0/0
🟢 Lines 100% 0/0

Test suite run success

1 tests passing in 1 suite.

Report generated by 🧪jest coverage report action from f3cbc7366d78b0290d71e8308307df7d8744675e

github-actions[bot] commented 8 months ago

Coverage report for ./packages/model

St.:grey_question:
Category Percentage Covered / Total
🟢 Statements 96.27% 620/644
🟢 Branches 97.87% 138/141
🟢 Functions 91.52% 151/165
🟢 Lines 96.28% 595/618

Test suite run success

347 tests passing in 20 suites.

Report generated by 🧪jest coverage report action from f3cbc7366d78b0290d71e8308307df7d8744675e

neSpecc commented 8 months ago

Which problem was resolved by this PR?

ilyamore88 commented 8 months ago

Hi, @neSpecc. I've described it in the description. Previously, tsc didn't build packages from references. For example, if you try to build dom-adapters without building the model, you get an error. Now, if you build dom-adapters, tsc looks to their references and builds it first. Also, it improves the dev mode. If I run yarn dev (tsc build with --watch flag) in the dom-adapters package and change something in the model, tsc rebuilds the model and dom-adapters because it understands the references field now.