Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle complete types #2900

Open
cmahnke opened this issue Nov 19, 2024 · 1 comment
Open

Bundle complete types #2900

cmahnke opened this issue Nov 19, 2024 · 1 comment
Labels
feature New feature or request

Comments

@cmahnke
Copy link

cmahnke commented Nov 19, 2024

Is your feature request related to a problem? Please describe.
I have a directory setup using symlinks and usually use tsconfig.json paths like this:

"paths": {
      "three": ["./node_modules/three", "./node_modules/@types/three"],
      "three/webgpu": ["./node_modules/@types/three/src/Three.WebGPU.d.ts"],

For motion this currently looks like this:

      "motion": ["./node_modules/motion/types/index.d.ts"],
      "@motionone/types": ["./node_modules/@motionone/types/types/index.d.ts"],
      "@motionone/dom": ["./node_modules/@motionone/dom/types/index.d.ts"],
      "@motionone/animation": ["./node_modules/@motionone/animation/types/index.d.ts"],
      "@motionone/generators": ["./node_modules/@motionone/generators/types/index.d.ts"]

And this isn't even working:


1 export declare const animate: (elements: import("..").ElementOrSelector, keyframes: import("./types").MotionKeyframesDefinition, options?: import("./types").AnimationOptionsWithOverrides) => import("@motionone/types").AnimationControls;
                                                  ~~~~

node_modules/@motionone/types/types/MotionValue.d.ts:1:65 - error TS2792: Cannot find module './'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?

1 import type { AnimationGenerator, BasicAnimationControls } from "./";

Describe the solution you'd like
Just bundle complete type and don't scatter them across multiple packages for a simple reason: The code is also bundled...

That is: Either don't do a import of modules of index.d.ts or preferably build a dist/index.d.ts and include it in the package distributed by NPM.

Describe alternatives you've considered
Switching to a more friendly library

@cmahnke cmahnke added the feature New feature or request label Nov 19, 2024
@alagar-dev
Copy link

Did you find a workaround for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants