Closed phritz closed 2 years ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
replicache | ✅ Ready (Inspect) | Visit Preview | Apr 18, 2022 at 11:38PM (UTC) |
Interesting that CI catches the problem (this time, it didn't a few weeks ago?!) bc it runs check-types
. But shouldn't build check the types?!
I think this is just a code factoring / terminology thing.
The build
step doesn't include type checking. That might seem crazy, but in js land everything is configurable, swappable, customizable, etc. And @arv has opted to use esbuild
for compilation for ... reasons ... instead of tsc (I think partly because it's super fast, but probably other reasons too), but esbuild doesn't do type checking. So we use tsc
to do that. But the build
script doesn't seem to include that step:
https://github.com/rocicorp/replicache/blob/main/tool/build.mjs
(I agree that intuitively, I would expect npm run build
to do type checking. Not sure if there's a reason it doesn't currently, or just accidental).
Seems weird to go out of our way to use a compile-time type language and then not use it at compile time!
@arv anything more that I should understand here?
I think we should change our build script to also run the type checking.
I think we should change our build script to also run the type checking.
do you mean just having a rule like:
"prebuild": "npm run check-types"
or do you mean monkeying with the esbuild parameters in https://github.com/rocicorp/replicache/blob/main/tool/build.mjs?
prebuild
works for me but there might be some reconciliation that should be done. I can take over if you want?
prebuild works for me but there might be some reconciliation that should be done. I can take over if you want?
yes please and thanks :)
This is a typescript thing I do not understand. The cli.ts file invokes
licensingCLI.main()
without the required argument. In VSCode that line is red showing me the expected errorExpected 1 arguments, but got 0. An argument for 'licenseServerURL' was not provided.
. However it compiles just fine and then fails at runtime when the missing argument is attempted to be used. To see this:rm $(which replicache)
rm out/cli.cjs
npm run build
npm link
npx replicache get-license
The "invalid url" is
undefined
.