-
Notifications
You must be signed in to change notification settings - Fork 9
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
Rewrite extension scripts in TypeScript #598
Comments
If we are able to configure TypeScript to compile everything with one config, the one thing we have to watch out for is that users can't actually import or run the extension install script files. They should never be accessible outside of the package. |
While looking into an issue regarding making the extension use the transmitter (which relates to it, as it's in TS), I realised that the above is already the case in our current releases: const reportScript = require("@appsignal/nodejs/scripts/extension/report")
console.log("reportPath", reportScript.reportPath()) |
|
As just discussed in the call, this would not work for the local setup. Not from scratch. If you clone the repo, run |
That's true, but we could have I think the above issue, with the scripts being importable, is essentially inevitable. I've checked |
Let's postpone work on it for a bit until we've completed the work on the extension install script and are a bit more sure what we want here. |
Noemi and I discussed fixing the
What if instead we don't run This would only be for local builds, because the distributed package does need to have this flow, but it ships with the TypeScript compiled to JavaScript. |
The extension install script is written in JavaScript, while the rest of our codebase is in TypeScript. If we could move this to TypeScript as well, it would streamline using bits of the codebase, such as the Transmitter, from the extension script.
We may want to reconsider whether the separation between the scripts and the regular source code is necessary. If we keep this separation, this may mean our build process calls the TypeScript compiler twice. There may be some TSConfig toggle that allows us to work around this.
The text was updated successfully, but these errors were encountered: