ScalablyTyped/Converter

converting chipmunk-ts npm package but the generated js file refer to "chipmunk-ts/dist/types/shapes" file that doesn't exist

yg1988 opened this issue · 1 comments

Hi, I am new to scala.js and I tried to use chipmunk's ts library (https://www.npmjs.com/package/chipmunk-ts?activeTab=versions), which is in pure .ts format and doesn't have "@types/xxxx" mapping. It seems by editing plugins.sbt and build.sbt as the tutorial, ScalablyTyped can convert the ts into scala facades and get the code to compile. However, when I tried to link the generated js in a node project using vite, it is giving the following error: """
[plugin:vite:import-analysis] Failed to resolve import "chipmunk-ts/dist/types/shapes" from "target\scala-3.2.2\livechart-fastopt\internal-3ebfae0cba70adf981029a0da5b1e4b5ab5d02c6.js". Does the file exist?
C:/Users/guang/Documents/2024code/scalajs-laminar/target/scala-3.2.2/livechart-fastopt/internal-3ebfae0cba70adf981029a0da5b1e4b5ab5d02c6.js:3:68
1 | 'use strict';
2 | import * as $i_chipmunk$002dts from "chipmunk-ts";
3 | import * as $i_chipmunk$002dts$002fdist$002ftypes$002fshapes from "chipmunk-ts/dist/types/shapes";
| ^
4 | var $linkingInfo = Object.freeze({
5 | "esVersion": 6,
"""
Is there a way to configure ScalablyTyped to generate the missing js files for chipmunk-ts library?

Hey, sorry I've been out of the loop for a while.

You'll likely have the same things exposed multiple times in the generated scala.js code, and you need to choose from the scala package which corresponds to another javascript module. Most of the time it's called mod, see https://scalablytyped.org/docs/usage#modules

Reopen if it doesn't help 👍