-
-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: typescript projects & docs generation #2804
Conversation
"build:quick": "bolt ws exec -- swc src --out-dir dist --quiet --extensions \".ts\" --config-file ../../../.swcrc", | ||
"clean": "rimraf dist && bolt ws exec -- rimraf dist tsconfig.tsbuildinfo", | ||
"build": "bolt ws exec -- swc src --out-dir dist --quiet --extensions \".ts\" --config-file ../../../.swcrc", | ||
"build:full": "bolt ws exec -- tsc -b", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the set of build commands from build:quick
and build
(which just calls the former) to build
(same as build:quick
before) and build:full
which makes a full typescript build, along with generated types, which I think should be in the distributed packages.
Codecov Report
@@ Coverage Diff @@
## master #2804 +/- ##
==========================================
- Coverage 75.62% 72.69% -2.93%
==========================================
Files 77 77
Lines 2359 2344 -15
Branches 438 442 +4
==========================================
- Hits 1784 1704 -80
+ Misses 462 419 -43
- Partials 113 221 +108
Continue to review full report at Codecov.
|
Co-authored-by: Calvin <clavin@users.noreply.github.com>
* This script creates `index.ts` files in each package directory that simply | ||
* re-export the exports of the real main file. This is necessary for when all | ||
* the packages are run under a common context (instead of each individually). | ||
* This is because the symlinks bolt makes for each package are descendants of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question(non-blocking): Interesting. So in theory when we move away from bolt in the future this would be unnecessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think other tools will still have this issue. The issue stems from when we run a command on "all packages" (run from the project root and have it traverse into everything including the packages), which is in contrast to running a command "per-package" (running the command in every package with that package as the root).
This difference is significant because if you start in root/
and traverse down to root/packages/my-package/node_modules/symlink-to-my-other-package
(a symlink) and that takes you to root/packages/my-other-package
, you're still under the root context root/
which means that tooling will not look for a package.json
file because it does not think you're checking a dependency. That is why the index file solution works, because the index file will be automatically checked when the dependency resolution thinks it's still under the root context (which is true because we chose the root to be the project, rather than a specific package).
Does that make more sense?
Summarize your changes:
As a precursor to getting docs automatically generated and pushed, this PR refactors how the typescript projects are set up & how docs are generated.
typedoc
needs that much memory, but it does. I was able to get around this by increasing the memory Node.js is allowed to use.