anton.yakovets
How to create private packages in deno and not fall into ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING
Hi everyone! Maybe someone already solved this problem, but I could not find any information or "how to" guide, ChatGPT did not help as well.
The problem:
I have few private repositories in gitlab, all uses deno as runtime, I want to share some duplicated typscript code written in deno (i.e. all imports ends with .ts extension, also present libraries like "jsr:@std/testing/bdd"; ) so it cant just be launched with node. Have decided to move shared code to separate repository and make a npm package from it (keyword is npm here).
Solution (which did not worked):
* gitlab does not allow direct access to raw repository, but it has package registry, so I published my ts code as a npm package with 'main: index.ts' whick contains reexport of code form other files
* add .npmrc with scope definition and token from gitlab
* import the package in the repository with typescript code for deno
* VS Code was happy with type exports from my private package
* when I've tried to run deno test or deno run I got [ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING]
Here https://github.com/denoland/deno/issues/27782 dsherret mention that deno behaves like node for the sake of compatibility.
but code written in deno does not work in node, what is the point to restrict typescript import form node_modules in situations like mine or any other?
and how to do it right way (share common typescript codebase among projects which uses deno)?
I know about 'compile from ts to js with types definition file etc...' but want to emphasize, this is deno code, so imports ends with .ts and this approach also would not work when you import from your npm package.
1 replies