-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Bug Summary
When I make the jsResource in the config.yaml a TypeScript file, it was failing to load the back-end resources and nothing was rendering on the API schema in the Harper Fabric UI
Reproduction Repository (if applicable)
https://github.com/tballard34/ConvoIQ
Steps to Reproduce
- Clone repo
- In
config.yamlchange the
jsResource:
files: 'operations/backend/resources.js'to
jsResource:
files: 'backend/resources.ts'- Run
npm run dev - Check Harper Fabric UI API OpenAPI Schema for routes
Here there should be the routes in the resources.ts file, but they should be blank. This is the bug.
Expected Behavior
So I expected Harper to be able to handle my TS file directly, but this was failing and the API endpoints I had in my resource TS file were not showing up in my Harper. For fabric UI on local. This proves that it was not able to read my resources.ts file.
Actual Behavior
Ideally, I would be able to reference the resources.ts file directly without having to make a build step to compile it from ts to js and then referencing the js file in my config.yaml.
Platform
No response
Console Errors
No response
Screenshots or Videos
No response
Additional Context
"build:backend": "tsc backend/agent-prompts.ts backend/agent-tools.ts backend/title-generators.ts backend/resources.ts backend/routes/spa-fallback.ts --outDir operations --rootDir . --module ESNext --target ES2022 --moduleResolution node --skipLibCheck --allowSyntheticDefaultImports",To solve this, I had to compile my resources file to .js and reference that instead of the .ts version directly. It's not the end of the world, but it would be nice to avoid this middle compilation step, and just use .ts directly
Doc on this
https://docs.harperdb.io/docs/reference/components/built-in-extensions#jsresource
https://docs.harperdb.io/docs/reference/components/plugins#api
Are you planning to fix this issue?
No, just reporting the issue
First-time contributor support
- I'm new to contributing and would appreciate guidance on the process
- I'd like help understanding the project structure
- I need assistance with setting up the development environment
- I'm comfortable contributing, but new to this project specifically