-
Notifications
You must be signed in to change notification settings - Fork 82
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
feat: tsup, pnpm and new build system #565
base: master
Are you sure you want to change the base?
Conversation
@@ -138,7 +138,7 @@ export async function assertThatBodyParserHasBeenUsedForExpressLikeRequest( | |||
let err = await new Promise((resolve) => { | |||
let resolvedCalled = false; | |||
if (request.readable) { | |||
jsonParser(request, new ServerResponse(request), (e) => { | |||
jsonParser(request, new ServerResponse(request), (e: any) => { |
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.
can we not use any
type?
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.
you can use, i did any as i don't know what types are
@@ -71,7 +71,10 @@ function defaultCreateAndSendCustomSms(_: NormalisedAppinfo) { | |||
* if the error is thrown from API, the response object | |||
* will be of type `{err: string}` | |||
*/ | |||
// TODO: check if this is the correct way to check for error | |||
// @ts-ignore |
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.
can we not add @ts-ignore
to so many files?
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.
there were ts errors in a few places only during the build, I closed them temporarily with this. We can do this better in the next pr.
hey @productdevbook could you also tell if this a breaking change for the user? For example, will the import statements for the user change in any way for any recipe / function etc? |
It should not affect it in any way, because I took the same paths. I can even create a playground for testing purposes. |
Okay. Im going to try and remove all the newly added Also, i see the you have removed the build folder and instead using |
"build-check": "cd lib && npx tsc -p tsconfig.json --noEmit && cd ../test/with-typescript && npx tsc -p tsconfig.json --noEmit", | ||
"build": "cd lib && rm -rf build && npx tsc -p tsconfig.json && cd ../test/with-typescript && npx tsc -p tsconfig.json --noEmit && cd ../.. && npm run post-build", | ||
"build-check": "npx tsc -p tsconfig.json --noEmit && cd ../test/with-typescript && npx tsc -p tsconfig.json --noEmit", | ||
"build": "tsup", |
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.
the build command earlier used to also check the compilation of ../test/with-typescript
- this was done as a way to make sure that the interface exposed to the user doesn't break unintentionally.
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.
you don't need them, tsup sets them all in dist. There is no need for that test, since that user will no longer have ts errors.
yes, used dist. example
only send data. |
I do not know about this. normally it should not be kept on dist vs github in any way. |
Right, we do have requirements that we need the sdk to work even with directly using the git repo. Therefore, we would need the If you can think of a better solution to this, it would be great. |
I can't find a solution to this, people who will use it will pr and create and export their github dist using their own url. This should not be in the main library. The solution is actually that simple. We already do the same thing in many libraries.
|
I'm afraid that won't work for us. Maybe we can add a post npm install hook to do the TS compilation for such users. But we do require some solution that universally works even when pulling the GH repo directly. This is a hard requirement for us i'm afraid. |
Since it will be an npm package and it is a suitable external build, people will use it according to the package versions anyway. In addition, users who want to use github url, which is a very special situation, should do as I said. It's a must. There is a postinstall structure in npm, but it is very inefficient in this structure. |
close #413
close #459
dist