Closed Jollarvia closed 4 months ago
Thank you so much for sharing. We are currently cleaning up exactly this stuff in the build, and the next upcoming release of 0.16.x should be worth trying. Expect a release early next week if not sooner.
Awesome to hear. Thanks for the update. You guys are doing great work.
I have a test application that will not completely resolve the fireproof object.
test.zip
If I run the "run" script (without typescript) fireproof is located and the console statement is logged. (test.js)
If I run the "build-esm" script it (usually) fails with the error
File 'C:/Users/Julio/repos/test/node_modules/typescript/lib/package.json' does not exist according to earlier cached lookups. File 'C:/Users/Julio/repos/test/node_modules/typescript/package.json' exists according to earlier cached lookups. test.js(1,10): error TS2305: Module '"@fireproof/core/node"' has no exported member 'fireproof'.
running "build-esm-traceres" to have typescript do resolution tracing, I notice this in the file.
If I were to change the import to: import * as fireproof from "@fireproof/core/node" it works and database and types are present but there is no typescript type information found. This is unacceptable for my repo.
I am new to fireproof and fairly new to typescript. But I could not find an acceptable permutation between how I import the fireproof module and configuring the tsconfig and package.json for success. I define success as being able to run at runtime and having access to all type information at compile time.
Assumptions: C:/Users/Julio/repos/test/node_modules/@fireproof/core/dist/types/database does, in fact, exist as C:/Users/Julio/repos/test/node_modules/@fireproof/core/dist/types/database.d.ts but typescript does not pick it up.
I believe it is related my use of type:module in the package.json. This cannot be changed by me either.
See attached repo to try it out. Thanks for any guidance on this.