Skip to content
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

Script Adapter: Support importing TypeScript using a TypeScript loader (optionally) #10

Open
Lordfirespeed opened this issue Oct 3, 2024 · 4 comments · May be fixed by #11
Open

Script Adapter: Support importing TypeScript using a TypeScript loader (optionally) #10

Lordfirespeed opened this issue Oct 3, 2024 · 4 comments · May be fixed by #11

Comments

@Lordfirespeed
Copy link
Contributor

Lordfirespeed commented Oct 3, 2024

Hello, me again! Hope you're well.

Thinking of doing something like postcss-load-config whereby tsx and jiti are optional peer dependencies used to import TypeScript files from a JavaScript context.

In transpiled projects, this would have the benefit that changes to script config files would not require the project to be 'built (transpiled) for changes to the config to be reflected.

let me know what you think! I'll start working on the code for it either way, since I can just define the adapter in my project if you'd rather not bloat the library :)

@Lordfirespeed Lordfirespeed linked a pull request Oct 4, 2024 that will close this issue
@alexmarqs
Copy link
Owner

Hey @Lordfirespeed thanks for this! Any news regarding the usage of your own adapter? Just to understand if your PR is still valid 👍 or new findings or needs from your side. Cheers!

@Lordfirespeed
Copy link
Contributor Author

It works great! I ran into one issue with it when trying to load config in a next.js application - namely, ran into some error r.e. webpack trying to bundle esbuild, etc. but that's a separate issue.

As long as I specify the config directory to my dev server 'watch' option, my server auto reloads as I would usually expect.

And I don't have to recompile the project for configuration changes to be reflected in the built project.

Overall - success :)

@alexmarqs
Copy link
Owner

alexmarqs commented Oct 13, 2024

thanks @Lordfirespeed ! I will then clone + double check your PR ;), cheers!

@Lordfirespeed
Copy link
Contributor Author

I will then clone + double check your PR ;), cheers!

No worries! Keep #12 in mind - I am worried something I did may have broken the TypeScript types' compatibility with some versions of zod ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants