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

bug: Path aliases are present in the generated type declarations #4349

Closed
3 tasks done
sean-perkins opened this issue May 1, 2023 · 1 comment
Closed
3 tasks done
Assignees
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil

Comments

@sean-perkins
Copy link
Contributor

sean-perkins commented May 1, 2023

Prerequisites

Stencil Version

v3.2.2

Current Behavior

When using path aliases, both the src/components.d.ts and dist/types/components.d.ts reference the alias path instead of the relative path.

// dist/types/components.d.ts
import { MaskVisibility } from "@utils/input-masking/types";
export { MaskVisibility } from "@utils/input-masking/types";

Expected Behavior

The generated type declaration file should be relatively pathed and all import aliases should be replaced.

import { MaskVisibility } from "./utils/input-masking/types";
export { MaskVisibility } from "./utils/input-masking/types";

System Info

System: node 16.15.1
    Platform: darwin (22.2.0)
   CPU Model: Apple M1 (8 cpus)
    Compiler: /Users/sean/Documents/ionic/issues/stencil-alias-imports/node_modules/@stencil/core/compiler/stencil.js
       Build: 1682947516
     Stencil: 3.2.2 🏒
  TypeScript: 4.9.5
      Rollup: 2.42.3
      Parse5: 7.1.2
      Sizzle: 2.42.3
      Terser: 5.17.1

Steps to Reproduce

  1. Add a prop to a Stencil component, that has a type from an import alias.
import { MaskVisibility } from '@utils/input-masking/types';

...

@Prop() maskVisibility: MaskVisibility;
  1. Run stencil build to generate the type declaration files.
  2. Observe: The path aliases are still present in the compiled output.

Code Reproduction URL

https://github.com/sean-perkins/stencil-named-imports

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label May 1, 2023
@tanner-reits tanner-reits self-assigned this May 1, 2023
@tanner-reits tanner-reits added Bug: Validated This PR or Issue is verified to be a bug within Stencil and removed triage labels May 1, 2023
@rwaskiewicz
Copy link
Member

The fix for this has gone out in today's Stencil v3.3.0 release. As a result, I'm going to close out this ticket. If the issue should reappear, please feel free to open a new issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil
Projects
None yet
Development

No branches or pull requests

3 participants