Closed Adammatthiesen closed 3 months ago
That means AIK 0.7.0 will only support 4.5 and above I guess? That's a bit annoying 🤔 but maybe @Fryuni you know how to best deal with it? I mean is there a smart way with peer dependencies and stuff?
https://docs.astro.build/en/guides/astro-db/#building-astro-db-integrations, it's not part of the integrations api reference just yet
Oh I see! I saw both the cloudflare & ExpressiveCode repo's where having typing issues, kinda had the same issues locally with all my AIK integrations which made me think there might be a typing issue going on again... maybe its just pnpm being weird then...
on another note, maybe we need a AstroDB AIK plugin since its still external and not internal! which IMO is a good thing... I'd be willing to help with it! im just not to sure how how this advanced hooks work yet... still learning!
Actually, this is currently popping up in my astro-gists
playground when i look at the integrations list...
Type 'AstroIntegration' is not assignable to type 'false | AstroIntegration | (false | AstroIntegration | null | undefined)[] | null | undefined'.
Type 'import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/@types/astro").AstroIntegration' is not assignable to type 'import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro/dist/@types/astro").AstroIntegration'.
The types of 'hooks['astro:config:setup']' are incompatible between these types.
Type '((options: { config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/@types/astro").AstroConfig; command: "dev" | "build" | "preview"; ... 10 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/core/logger/core").AstroInteg...' is not assignable to type '((options: { config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro/dist/@types/astro").AstroConfig; ... 11 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astr...'.
Type '(options: { config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/@types/astro").AstroConfig; command: "dev" | "build" | "preview"; isRestart: boolean; ... 9 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/core/logger...' is not assignable to type '(options: { config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro/dist/@types/astro").AstroConfig; ... 11 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro...'.
Types of parameters 'options' and 'options' are incompatible.
Type '{ config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro/dist/@types/astro").AstroConfig; command: "dev" | ... 1 more ... | "preview"; ... 10 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_...' is not assignable to type '{ config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/@types/astro").AstroConfig; command: "dev" | "build" | "preview"; isRestart: boolean; ... 9 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/core/logger/core").As...'.
The types of 'config.integrations' are incompatible between these types.
Type 'import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro/dist/@types/astro").AstroIntegration[]' is not assignable to type 'import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/@types/astro").AstroIntegration[]'.
Type 'import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro/dist/@types/astro").AstroIntegration' is not assignable to type 'import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/@types/astro").AstroIntegration'.
The types of 'hooks['astro:config:setup']' are incompatible between these types.
Type '((options: { config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro/dist/@types/astro").AstroConfig; ... 11 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astr...' is not assignable to type '((options: { config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/@types/astro").AstroConfig; command: "dev" | "build" | "preview"; ... 10 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/core/logger/core").AstroInteg...'.
Type '(options: { config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro/dist/@types/astro").AstroConfig; ... 11 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro...' is not assignable to type '(options: { config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/@types/astro").AstroConfig; command: "dev" | "build" | "preview"; isRestart: boolean; ... 9 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/core/logger...'.
Types of parameters 'options' and 'options' are incompatible.
Type '{ config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/@types/astro").AstroConfig; command: "dev" | "build" | "preview"; isRestart: boolean; ... 9 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.4.11/node_modules/astro/dist/core/logger/core").As...' is not assignable to type '{ config: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_typescript@5.4.2/node_modules/astro/dist/@types/astro").AstroConfig; command: "dev" | ... 1 more ... | "preview"; ... 10 more ...; logger: import("E:/git-repo/astro-gists/node_modules/.pnpm/astro@4.5.0_@types+node@20.11.25_...'.
The types of 'config.markdown.shikiConfig' are incompatible between these types.
Property 'themes' is missing in type '{ langs: LanguageRegistration[]; theme: ("andromeeda" | "aurora-x" | "catppuccin-frappe" | "catppuccin-latte" | "catppuccin-macchiato" | "catppuccin-mocha" | ... 31 more ... | ThemeRegistrationRaw) & ("andromeeda" | ... 37 more ... | undefined); experimentalThemes: Record<...>; wrap: boolean | null; transformers: Sh...' but required in type '{ langs: LanguageRegistration[]; theme: ("andromeeda" | "aurora-x" | "ayu-dark" | "catppuccin-frappe" | "catppuccin-latte" | "catppuccin-macchiato" | "catppuccin-mocha" | ... 35 more ... | ThemeRegistrationRaw) & ("andromeeda" | ... 42 more ... | undefined); themes: Record<...>; wrap: boolean | null; transformers: S...'.ts(2322)
I will note, that it is still "working" just pops the error when i have a .mts saying this when hovered over.... so they are "close enough" to still work
Yeah this error is expected because the AstroIntegration type is different in 4.5 than previous versions. Given our current plugin system, having a plugin to support the hook won't work. I think it's a matter of optional deps really but I'm not comfortable enough to tell you what the solution is exactly
I have changed the main description to simply update to the new AstroIntegration type in that case, as IMO given what you mention about the plugin system option, It would probably just be simplier to use the DB's default hook option once the AstroIntegration type is updated...
To be clear, the work required to make it work is really small but this is not my main concern! I'm more concerned about the fact that upgrading aik astro peer dep to 4.5 means any integration author using aik will also have their minimal astro version st to 4.5. Not ideal
I understand, I kind of figured that would be the main concern. and I have no issue waiting! I'd be glad to! my only thing was to add the information here, for maybe a work-around by the Wizards who help maintain, or if the time comes a update to support the new hooks!
Things are still working so its not really a big deal.
I think there might be a way to add support without moving the peer requirement.
We just have to make the code work for subtypes and the types be derived from Astro (which I think they already are)
Do you have an example?
Since they added new support for Astro DB the hooks changed. would be nice to get a patch that
AIK
Extended hooks to use the new Astrov4.5
Hooks2. adds support to tie into@astrojs/db
's new hooks