Skip to content

chore: update deps and some fixes #562

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

Merged
merged 5 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions explorer-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
"preview": "vite preview"
},
"dependencies": {
"@fontsource/fira-mono": "^5.0.13",
"@typescript-eslint/parser": "^7.13.1",
"@fontsource/fira-mono": "^5.1.0",
"@typescript-eslint/parser": "^7.18.0",
"eslint": "^8.57.0",
"eslint-scope": "^7.2.2",
"esquery": "^1.5.0",
"esquery": "^1.6.0",
"pako": "^2.1.0",
"svelte": "^5.0.0-next.160",
"svelte": "^5.0.0-next.245",
"svelte-eslint-parser": "link:..",
"tslib": "^2.6.3"
"tslib": "^2.7.0"
},
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.2",
"@sveltejs/kit": "^2.5.17",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@sveltejs/adapter-static": "^3.0.4",
"@sveltejs/kit": "^2.5.26",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"monaco-editor": "^0.50.0",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.4",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.6",
"string-replace-loader": "^3.1.0",
"typescript": "^5.4.5",
"vite": "^5.3.1",
"webpack": "^5.92.1",
"typescript": "^5.6.2",
"vite": "^5.4.4",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"wrapper-webpack-plugin": "^2.2.2"
}
Expand Down
2 changes: 1 addition & 1 deletion explorer-v2/src/lib/MonacoEditor.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script context="module">
<script module>
const appStarting = new Promise((resolve) => setTimeout(resolve, 300));
</script>

Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,51 +63,51 @@
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.7",
"@changesets/get-release-plan": "^4.0.3",
"@changesets/cli": "^2.27.8",
"@changesets/get-release-plan": "^4.0.4",
"@ota-meshi/eslint-plugin": "^0.15.3",
"@types/benchmark": "^2.1.5",
"@types/chai": "^4.3.16",
"@types/eslint": "^9.0.0",
"@types/chai": "^4.3.19",
"@types/eslint": "^9.6.1",
"@types/eslint-scope": "^3.7.7",
"@types/eslint-visitor-keys": "^3.3.0",
"@types/estree": "^1.0.5",
"@types/mocha": "^10.0.7",
"@types/node": "^20.14.11",
"@types/mocha": "^10.0.8",
"@types/node": "^20.16.5",
"@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "~7.18.0",
"@typescript-eslint/types": "~7.18.0",
"benchmark": "^2.1.4",
"chai": "^4.4.1",
"chai": "^4.5.0",
"env-cmd": "^10.1.0",
"esbuild": "^0.23.0",
"esbuild-register": "^3.5.0",
"esbuild": "^0.23.1",
"esbuild-register": "^3.6.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-json-schema-validator": "^5.1.2",
"eslint-plugin-jsonc": "^2.16.0",
"eslint-plugin-n": "^17.9.0",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-node-dependencies": "^0.12.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-svelte": "^2.42.0",
"eslint-plugin-svelte": "^2.43.0",
"eslint-plugin-yml": "^1.14.0",
"estree-walker": "^3.0.3",
"locate-character": "^3.0.0",
"magic-string": "^0.30.10",
"mocha": "^10.6.0",
"mocha-chai-jest-snapshot": "^1.1.4",
"magic-string": "^0.30.11",
"mocha": "^10.7.3",
"mocha-chai-jest-snapshot": "^1.1.6",
"nyc": "^17.0.0",
"prettier": "~3.3.3",
"prettier-plugin-pkg": "^0.18.1",
"prettier-plugin-svelte": "^3.2.6",
"rimraf": "^6.0.1",
"semver": "^7.6.3",
"svelte": "^5.0.0-next.191",
"svelte2tsx": "^0.7.13",
"typescript": "~5.5.3",
"svelte": "^5.0.0-next.245",
"svelte2tsx": "^0.7.19",
"typescript": "~5.6.2",
"typescript-eslint-parser-for-extra-files": "^0.7.0"
},
"publishConfig": {
Expand Down
2 changes: 0 additions & 2 deletions src/parser/compat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ export function getOptionsFromRoot(
fragment: {
type: "Fragment",
nodes: [],
transparent: true,
},
start: root.options.start,
end: root.options.end,
parent: null as any,
};
}
return null;
Expand Down
11 changes: 0 additions & 11 deletions src/parser/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ function parseAttribute(state: State): Compiler.Attribute {
value: true,
start,
end: keyEnd,
metadata: null as any,
parent: null,
};
}
state.skipSpaces();
Expand All @@ -98,8 +96,6 @@ function parseAttribute(state: State): Compiler.Attribute {
value: true,
start,
end: keyEnd,
metadata: null as any,
parent: null,
};
}
// parse value
Expand All @@ -110,8 +106,6 @@ function parseAttribute(state: State): Compiler.Attribute {
value: [value],
start,
end: state.index,
metadata: null as any,
parent: null,
};
}

Expand Down Expand Up @@ -149,8 +143,6 @@ function parseAttributeValue(
expression,
start,
end,
metadata: null as any,
parent: null,
};
}
}
Expand All @@ -164,7 +156,6 @@ function parseAttributeValue(
raw: quote,
start,
end: state.index,
parent: null,
};
}
let c: string | undefined;
Expand All @@ -179,7 +170,6 @@ function parseAttributeValue(
raw: data,
start: start + 1,
end: end - 1,
parent: null,
};
}
}
Expand All @@ -198,7 +188,6 @@ function parseAttributeValue(
raw: data,
start,
end,
parent: null,
};
}

Expand Down
123 changes: 40 additions & 83 deletions src/parser/svelte-ast-types-for-v5.ts
Original file line number Diff line number Diff line change
@@ -1,85 +1,49 @@
// FIXME Since the node type is not provided by "svelte/compiler",
// we work around this by extracting the type from the parse function.
// See also https://github.com/sveltejs/svelte/issues/12292
import type { AST } from "svelte/compiler";

import type { parse } from "svelte/compiler";
export type Root = AST.Root;
export type Fragment = AST.Fragment;
export type SvelteOptions = AST.SvelteOptions;
export type Script = AST.Script;

export type Root = ModernParseReturnType<typeof parse>;
export type Fragment = Root["fragment"];
export type SvelteOptions = Root["options"];
export type Script = Root["instance"];
type FragmentChild = Fragment["nodes"][number];
export type Text = AST.Text;

export type Text = Extract<FragmentChild, { type: "Text" }>;
export type ExpressionTag = AST.ExpressionTag;
export type HtmlTag = AST.HtmlTag;
export type ConstTag = AST.ConstTag;
export type DebugTag = AST.DebugTag;
export type RenderTag = AST.RenderTag;

export type ExpressionTag = Extract<FragmentChild, { type: "ExpressionTag" }>;
export type HtmlTag = Extract<FragmentChild, { type: "HtmlTag" }>;
export type ConstTag = Extract<FragmentChild, { type: "ConstTag" }>;
export type DebugTag = Extract<FragmentChild, { type: "DebugTag" }>;
export type RenderTag = Extract<FragmentChild, { type: "RenderTag" }>;
export type Component = AST.Component;
export type TitleElement = AST.TitleElement;
export type SlotElement = AST.SlotElement;
export type RegularElement = AST.RegularElement;
export type SvelteBody = AST.SvelteBody;
export type SvelteComponent = AST.SvelteComponent;
export type SvelteDocument = AST.SvelteDocument;
export type SvelteElement = AST.SvelteElement;
export type SvelteFragment = AST.SvelteFragment;
export type SvelteHead = AST.SvelteHead;
export type SvelteOptionsRaw = AST.SvelteOptionsRaw;
export type SvelteSelf = AST.SvelteSelf;
export type SvelteWindow = AST.SvelteWindow;

export type Component = Extract<FragmentChild, { type: "Component" }>;
export type TitleElement = Extract<FragmentChild, { type: "TitleElement" }>;
export type SlotElement = Extract<FragmentChild, { type: "SlotElement" }>;
export type RegularElement = Extract<FragmentChild, { type: "RegularElement" }>;
export type SvelteBody = Extract<FragmentChild, { type: "SvelteBody" }>;
export type SvelteComponent = Extract<
FragmentChild,
{ type: "SvelteComponent" }
>;
export type SvelteDocument = Extract<FragmentChild, { type: "SvelteDocument" }>;
export type SvelteElement = Extract<FragmentChild, { type: "SvelteElement" }>;
export type SvelteFragment = Extract<FragmentChild, { type: "SvelteFragment" }>;
export type SvelteHead = Extract<FragmentChild, { type: "SvelteHead" }>;
export type SvelteOptionsRaw = Extract<
FragmentChild,
{ type: "SvelteOptions" }
>;
export type SvelteSelf = Extract<FragmentChild, { type: "SvelteSelf" }>;
export type SvelteWindow = Extract<FragmentChild, { type: "SvelteWindow" }>;
export type IfBlock = AST.IfBlock;
export type EachBlock = AST.EachBlock;
export type AwaitBlock = AST.AwaitBlock;
export type KeyBlock = AST.KeyBlock;
export type SnippetBlock = AST.SnippetBlock;

export type IfBlock = Extract<FragmentChild, { type: "IfBlock" }>;
export type EachBlock = Extract<FragmentChild, { type: "EachBlock" }>;
export type AwaitBlock = Extract<FragmentChild, { type: "AwaitBlock" }>;
export type KeyBlock = Extract<FragmentChild, { type: "KeyBlock" }>;
export type SnippetBlock = Extract<FragmentChild, { type: "SnippetBlock" }>;

export type Comment = Extract<FragmentChild, { type: "Comment" }>;
type ComponentAttribute = Component["attributes"][number];
export type Attribute = Extract<ComponentAttribute, { type: "Attribute" }>;
export type SpreadAttribute = Extract<
ComponentAttribute,
{ type: "SpreadAttribute" }
>;
export type AnimateDirective = Extract<
ComponentAttribute,
{ type: "AnimateDirective" }
>;
export type BindDirective = Extract<
ComponentAttribute,
{ type: "BindDirective" }
>;
export type ClassDirective = Extract<
ComponentAttribute,
{ type: "ClassDirective" }
>;
export type LetDirective = Extract<
ComponentAttribute,
{ type: "LetDirective" }
>;
export type OnDirective = Extract<ComponentAttribute, { type: "OnDirective" }>;
export type StyleDirective = Extract<
ComponentAttribute,
{ type: "StyleDirective" }
>;
export type TransitionDirective = Extract<
ComponentAttribute,
{ type: "TransitionDirective" }
>;
export type UseDirective = Extract<
ComponentAttribute,
{ type: "UseDirective" }
>;
export type Comment = AST.Comment;
export type Attribute = AST.Attribute;
export type SpreadAttribute = AST.SpreadAttribute;
export type AnimateDirective = AST.AnimateDirective;
export type BindDirective = AST.BindDirective;
export type ClassDirective = AST.ClassDirective;
export type LetDirective = AST.LetDirective;
export type OnDirective = AST.OnDirective;
export type StyleDirective = AST.StyleDirective;
export type TransitionDirective = AST.TransitionDirective;
export type UseDirective = AST.UseDirective;

export type Tag = ExpressionTag | HtmlTag | ConstTag | DebugTag | RenderTag;
export type ElementLike =
Expand Down Expand Up @@ -107,10 +71,3 @@ export type Directive =
| StyleDirective
| TransitionDirective
| UseDirective;

type ModernParseReturnType<T> = T extends {
(source: string, options: { filename?: string; modern: true }): infer R;
(...args: any[]): any;
}
? R
: any;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"parse": {
"svelte": "^4 || ^3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
<table>
{#if children} <!-- children: Snippet<[]> -->
<thead>
<tr>{@render children()}</tr> <!-- children(): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
<tr>{@render children()}</tr> <!-- children(): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
</thead>
{/if}
<tbody>
{#each data as d} <!-- data: any[], d: any -->
<tr>{@render row(d)}</tr> <!-- row(d): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
<tr>{@render row(d)}</tr> <!-- row(d): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
{/each}
</tbody>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
<table>
{#if children} <!-- children: Snippet<[]> -->
<thead>
<tr>{@render children()}</tr> <!-- children(): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
<tr>{@render children()}</tr> <!-- children(): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
</thead>
{/if}
<tbody>
{#each data as d} <!-- data: unknown[], d: unknown -->
<tr>{@render row(d)}</tr> <!-- row(d): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
<tr>{@render row(d)}</tr> <!-- row(d): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
{/each}
</tbody>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<table>
{#if children} <!-- children: Snippet<[]> -->
<thead>
<tr>{@render children()}</tr> <!-- children(): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
<tr>{@render children()}</tr> <!-- children(): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
</thead>
{/if}
<tbody>
{#each data as d} <!-- data: unknown[], d: unknown -->
<tr>{@render row(d)}</tr> <!-- row(d): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
<tr>{@render row(d)}</tr> <!-- row(d): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
{/each}
</tbody>
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"parse": {
"svelte": "^4 || ^3"
}
}
Loading
Loading