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

Fixed incorrect types and imports #2630

Merged
merged 4 commits into from
Feb 23, 2022
Merged

Fixed incorrect types and imports #2630

merged 4 commits into from
Feb 23, 2022

Conversation

JuanM04
Copy link
Contributor

@JuanM04 JuanM04 commented Feb 20, 2022

Changes

When using pnpm + typescript without allowSyntheticDefaultImports, these errors where thrown:

node_modules/.pnpm/@[email protected]/node_modules/@astrojs/markdown-remark/dist/remark-shiki.d.ts:1:8 - error TS1192: Module '"/home/juanm04/dev/projects/portfolio/node_modules/.pnpm/[email protected]/node_modules/shiki/dist/index"' has no default export.

1 import shiki from 'shiki';
         ~~~~~

node_modules/.pnpm/[email protected][email protected]/node_modules/astro/dist/types/@types/astro.d.ts:1:13 - error TS1192: Module '"/home/juanm04/dev/projects/portfolio/node_modules/.pnpm/@[email protected]/node_modules/@types/babel__core/index"' has no default export.

1 import type babel from '@babel/core';
              ~~~~~

node_modules/.pnpm/[email protected][email protected]/node_modules/astro/dist/types/core/config.d.ts:2:41 - error TS7016: Could not find a declaration file for module 'yargs-parser'. '/home/juanm04/dev/projects/portfolio/node_modules/.pnpm/[email protected]/node_modules/yargs-parser/build/index.cjs' implicitly has an 'any' type.
  Try `npm i --save-dev @types/yargs-parser` if it exists or add a new declaration (.d.ts) file containing `declare module 'yargs-parser';`

2 import type { Arguments as Flags } from 'yargs-parser';
                                          ~~~~~~~~~~~~~~

node_modules/.pnpm/[email protected][email protected]/node_modules/astro/dist/types/core/vite.d.ts:2:10 - error TS2305: Module '"vite"' has no exported member 'default'.

2 export { default } from 'vite';

The first one is solved by #2628, while this PR aims to fix the rest of them

Testing

Docs

@changeset-bot
Copy link

changeset-bot bot commented Feb 20, 2022

🦋 Changeset detected

Latest commit: af8496b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Feb 20, 2022
import type { z } from 'zod';
import type { AstroConfigSchema } from '../core/config';
import type { AstroComponentFactory, Metadata } from '../runtime/server';
import type vite from '../core/vite';
import type * as vite from 'vite';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to make it easy to switch in & out our own fork of Vite, if we hit a blocking Vite bug. However, I checked out vite.ts and its a pretty simple file to add back in later, so I'm okay with this change. Just calling it out for others.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!

@natemoo-re natemoo-re merged commit a2128f8 into withastro:main Feb 23, 2022
@github-actions github-actions bot mentioned this pull request Feb 23, 2022
@JuanM04 JuanM04 deleted the type-fixes branch February 23, 2022 23:20
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* Fixed incorrect types and imports

* Changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants