Skip to content

Commit

Permalink
chore: changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Feb 27, 2024
1 parent 9c21a9d commit add4268
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-baboons-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/svelte": patch
---

Fixes editor intellisense not working in certain envs
7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,6 @@
}
}
},
"svelte2tsx": {
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"rehype-pretty-code": {
"peerDependenciesMeta": {
"shiki": {
Expand Down
6 changes: 4 additions & 2 deletions packages/integrations/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"exports": {
".": "./dist/index.js",
"./editor": "./dist/editor.cjs",
"./svelte2tsx.d.ts": "./svelte2tsx.d.ts",
"./*": "./*",
"./client.js": "./client.js",
"./client-v5.js": "./client-v5.js",
Expand All @@ -43,7 +44,7 @@
},
"dependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"svelte2tsx": "^0.6.25"
"svelte2tsx": "^0.6.27"
},
"devDependencies": {
"astro": "workspace:*",
Expand All @@ -53,7 +54,8 @@
},
"peerDependencies": {
"astro": "^4.0.0",
"svelte": "^4.0.0 || ^5.0.0-next.56"
"svelte": "^4.0.0 || ^5.0.0-next.56",
"typescript": "^5.3.3"
},
"engines": {
"node": ">=18.14.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/svelte/src/editor.cts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function toTSX(code: string, className: string): string {

try {
let tsx = svelte2tsx(code, { mode: 'ts' }).code;
tsx = '/// <reference types="svelte2tsx/svelte-shims" />\n' + tsx;
tsx = '/// <reference types="@astrojs/svelte/svelte2tsx" />\n' + tsx;
result = tsx.replace(
'export default class extends __sveltets_2_createSvelte2TsxComponent(',
`export default function ${className}__AstroComponent_(_props: typeof Component.props): any {}\nlet Component = `
Expand Down
2 changes: 2 additions & 0 deletions packages/integrations/svelte/svelte2tsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="./node_modules/svelte2tsx/svelte-shims.d.ts" />

0 comments on commit add4268

Please sign in to comment.