Open SNordlinger opened 4 years ago
Thanks!
It's listed as a peer dependency: https://github.com/udacity/cloudflare-typescript-workers/blob/c782815348ee378c703484d8714a5188de06c109/packages/cloudflare-worker-mock/package.json Which I think (open for arguments against) is correct, because cloudflare-worker-mock
can used in JS-only codebases too.
Ugh, I definitely missed the peer dependency dialog when installing... 🤦♂
My project is JS-only. Looking through my node modules, it seems the import '@udacity/types-service-worker-mock/global'
statement is not being erased by the typescript compiler and a require statement is making it into the published package. In JS, types-service-worker-mock/global.js is a no-op, but it is required to make things happy.
I feel like there's got to be a way to not have the dependency in JS, but I'm not all that familiar with global augmentation in typescript. Maybe the type-only imports in typescript 3.8 might help?
I'm not sure what the ideal solution for this is. :thinking:
It appears that cloudflare-worker-mock has a dependency on @udacity/types-service-worker-mock, which is not listed as a dependency in the package.json.
Requiring the module in JS gives this error:
Thanks for all your work on this!