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

astro build to non-project directory adds TypeScript d.ts files #10610

Closed
1 task
m-radzikowski opened this issue Mar 29, 2024 · 6 comments · Fixed by #10861
Closed
1 task

astro build to non-project directory adds TypeScript d.ts files #10610

m-radzikowski opened this issue Mar 29, 2024 · 6 comments · Fixed by #10861
Labels
- P2: nice to have Not breaking anything but nice to have (priority)

Comments

@m-radzikowski
Copy link

Astro Info

Astro                    v4.5.12
Node                     v20.11.1
System                   macOS (arm64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         @astrojs/mdx
                         astro-icon
                         astro-meta-tags

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

In astro project with TypeScript, running astro build --outDir ../dist writes .d.ts files to the output dir.

The files include types.d.ts from .astro/ but also other types added by plugins, for example icon.d.ts from astro-icon.

This does not happen if we build to the dir ./dist or any child like ./sub/dir. But it always happen when we build to a dir outside the project, like ../dist.

What's the expected result?

The output dir should not contain .d.ts files.

Link to Minimal Reproducible Example

not reproducible online

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Mar 29, 2024
@Fryuni
Copy link
Member

Fryuni commented Mar 29, 2024

Can you make a minimal project where this happens? It could be a GH repo since you said this can't be reproduced online.

I tested with Astro 4.5.12 for the example projects (building statically and for SSR) and everything is being generated correctly, I got no .d.ts files. Maybe there is something in your Astro configuration or in your tsconfig.json that differs from the example projects and causes this.

@Fryuni Fryuni added needs response Issue needs response from OP and removed needs triage Issue needs to be triaged labels Mar 29, 2024
@matthewp matthewp added the needs repro Issue needs a reproduction label Apr 2, 2024
Copy link
Contributor

github-actions bot commented Apr 2, 2024

Hello @m-radzikowski. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

@m-radzikowski
Copy link
Author

Hey, sure, here is the repo with reproduction: https://github.com/m-radzikowski/astro-issue-10610

It's a fresh, clean project with all default options and only one file created in src/content.

@Fryuni Fryuni removed needs response Issue needs response from OP needs repro Issue needs a reproduction labels Apr 2, 2024
@Fryuni
Copy link
Member

Fryuni commented Apr 2, 2024

Confirming the reproduction. Thanks @m-radzikowski

@ematipico ematipico added the - P2: nice to have Not breaking anything but nice to have (priority) label Apr 3, 2024
@ematipico
Copy link
Member

If anyone wants to help, this should be an easy fix

@rishi-raj-jain
Copy link
Contributor

@ematipico

I am up for getting this done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants