Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 10992fa

Browse files
authoredSep 13, 2024··
chore: update deps and some fixes (#562)
1 parent d9e16ed commit 10992fa

14 files changed

+111
-203
lines changed
 

‎explorer-v2/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@
1212
"preview": "vite preview"
1313
},
1414
"dependencies": {
15-
"@fontsource/fira-mono": "^5.0.13",
16-
"@typescript-eslint/parser": "^7.13.1",
15+
"@fontsource/fira-mono": "^5.1.0",
16+
"@typescript-eslint/parser": "^7.18.0",
1717
"eslint": "^8.57.0",
1818
"eslint-scope": "^7.2.2",
19-
"esquery": "^1.5.0",
19+
"esquery": "^1.6.0",
2020
"pako": "^2.1.0",
21-
"svelte": "^5.0.0-next.160",
21+
"svelte": "^5.0.0-next.245",
2222
"svelte-eslint-parser": "link:..",
23-
"tslib": "^2.6.3"
23+
"tslib": "^2.7.0"
2424
},
2525
"devDependencies": {
26-
"@sveltejs/adapter-static": "^3.0.2",
27-
"@sveltejs/kit": "^2.5.17",
28-
"@sveltejs/vite-plugin-svelte": "^3.1.1",
26+
"@sveltejs/adapter-static": "^3.0.4",
27+
"@sveltejs/kit": "^2.5.26",
28+
"@sveltejs/vite-plugin-svelte": "^3.1.2",
2929
"monaco-editor": "^0.50.0",
30-
"prettier": "^3.3.2",
31-
"prettier-plugin-svelte": "^3.2.4",
30+
"prettier": "^3.3.3",
31+
"prettier-plugin-svelte": "^3.2.6",
3232
"string-replace-loader": "^3.1.0",
33-
"typescript": "^5.4.5",
34-
"vite": "^5.3.1",
35-
"webpack": "^5.92.1",
33+
"typescript": "^5.6.2",
34+
"vite": "^5.4.4",
35+
"webpack": "^5.94.0",
3636
"webpack-cli": "^5.1.4",
3737
"wrapper-webpack-plugin": "^2.2.2"
3838
}

‎explorer-v2/src/lib/MonacoEditor.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script context="module">
1+
<script module>
22
const appStarting = new Promise((resolve) => setTimeout(resolve, 300));
33
</script>
44

‎package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,51 +63,51 @@
6363
},
6464
"devDependencies": {
6565
"@changesets/changelog-github": "^0.5.0",
66-
"@changesets/cli": "^2.27.7",
67-
"@changesets/get-release-plan": "^4.0.3",
66+
"@changesets/cli": "^2.27.8",
67+
"@changesets/get-release-plan": "^4.0.4",
6868
"@ota-meshi/eslint-plugin": "^0.15.3",
6969
"@types/benchmark": "^2.1.5",
70-
"@types/chai": "^4.3.16",
71-
"@types/eslint": "^9.0.0",
70+
"@types/chai": "^4.3.19",
71+
"@types/eslint": "^9.6.1",
7272
"@types/eslint-scope": "^3.7.7",
7373
"@types/eslint-visitor-keys": "^3.3.0",
7474
"@types/estree": "^1.0.5",
75-
"@types/mocha": "^10.0.7",
76-
"@types/node": "^20.14.11",
75+
"@types/mocha": "^10.0.8",
76+
"@types/node": "^20.16.5",
7777
"@types/semver": "^7.5.8",
78-
"@typescript-eslint/eslint-plugin": "^7.16.1",
78+
"@typescript-eslint/eslint-plugin": "^7.18.0",
7979
"@typescript-eslint/parser": "~7.18.0",
8080
"@typescript-eslint/types": "~7.18.0",
8181
"benchmark": "^2.1.4",
82-
"chai": "^4.4.1",
82+
"chai": "^4.5.0",
8383
"env-cmd": "^10.1.0",
84-
"esbuild": "^0.23.0",
85-
"esbuild-register": "^3.5.0",
84+
"esbuild": "^0.23.1",
85+
"esbuild-register": "^3.6.0",
8686
"eslint": "^8.57.0",
8787
"eslint-config-prettier": "^9.1.0",
8888
"eslint-plugin-eslint-comments": "^3.2.0",
8989
"eslint-plugin-json-schema-validator": "^5.1.2",
9090
"eslint-plugin-jsonc": "^2.16.0",
91-
"eslint-plugin-n": "^17.9.0",
91+
"eslint-plugin-n": "^17.10.2",
9292
"eslint-plugin-node-dependencies": "^0.12.0",
9393
"eslint-plugin-prettier": "^5.2.1",
9494
"eslint-plugin-regexp": "^2.6.0",
95-
"eslint-plugin-svelte": "^2.42.0",
95+
"eslint-plugin-svelte": "^2.43.0",
9696
"eslint-plugin-yml": "^1.14.0",
9797
"estree-walker": "^3.0.3",
9898
"locate-character": "^3.0.0",
99-
"magic-string": "^0.30.10",
100-
"mocha": "^10.6.0",
101-
"mocha-chai-jest-snapshot": "^1.1.4",
99+
"magic-string": "^0.30.11",
100+
"mocha": "^10.7.3",
101+
"mocha-chai-jest-snapshot": "^1.1.6",
102102
"nyc": "^17.0.0",
103103
"prettier": "~3.3.3",
104104
"prettier-plugin-pkg": "^0.18.1",
105105
"prettier-plugin-svelte": "^3.2.6",
106106
"rimraf": "^6.0.1",
107107
"semver": "^7.6.3",
108-
"svelte": "^5.0.0-next.191",
109-
"svelte2tsx": "^0.7.13",
110-
"typescript": "~5.5.3",
108+
"svelte": "^5.0.0-next.245",
109+
"svelte2tsx": "^0.7.19",
110+
"typescript": "~5.6.2",
111111
"typescript-eslint-parser-for-extra-files": "^0.7.0"
112112
},
113113
"publishConfig": {

‎src/parser/compat.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ export function getOptionsFromRoot(
4040
fragment: {
4141
type: "Fragment",
4242
nodes: [],
43-
transparent: true,
4443
},
4544
start: root.options.start,
4645
end: root.options.end,
47-
parent: null as any,
4846
};
4947
}
5048
return null;

‎src/parser/html.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ function parseAttribute(state: State): Compiler.Attribute {
8686
value: true,
8787
start,
8888
end: keyEnd,
89-
metadata: null as any,
90-
parent: null,
9189
};
9290
}
9391
state.skipSpaces();
@@ -98,8 +96,6 @@ function parseAttribute(state: State): Compiler.Attribute {
9896
value: true,
9997
start,
10098
end: keyEnd,
101-
metadata: null as any,
102-
parent: null,
10399
};
104100
}
105101
// parse value
@@ -110,8 +106,6 @@ function parseAttribute(state: State): Compiler.Attribute {
110106
value: [value],
111107
start,
112108
end: state.index,
113-
metadata: null as any,
114-
parent: null,
115109
};
116110
}
117111

@@ -149,8 +143,6 @@ function parseAttributeValue(
149143
expression,
150144
start,
151145
end,
152-
metadata: null as any,
153-
parent: null,
154146
};
155147
}
156148
}
@@ -164,7 +156,6 @@ function parseAttributeValue(
164156
raw: quote,
165157
start,
166158
end: state.index,
167-
parent: null,
168159
};
169160
}
170161
let c: string | undefined;
@@ -179,7 +170,6 @@ function parseAttributeValue(
179170
raw: data,
180171
start: start + 1,
181172
end: end - 1,
182-
parent: null,
183173
};
184174
}
185175
}
@@ -198,7 +188,6 @@ function parseAttributeValue(
198188
raw: data,
199189
start,
200190
end,
201-
parent: null,
202191
};
203192
}
204193

‎src/parser/svelte-ast-types-for-v5.ts

Lines changed: 40 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,49 @@
1-
// FIXME Since the node type is not provided by "svelte/compiler",
2-
// we work around this by extracting the type from the parse function.
3-
// See also https://github.com/sveltejs/svelte/issues/12292
1+
import type { AST } from "svelte/compiler";
42

5-
import type { parse } from "svelte/compiler";
3+
export type Root = AST.Root;
4+
export type Fragment = AST.Fragment;
5+
export type SvelteOptions = AST.SvelteOptions;
6+
export type Script = AST.Script;
67

7-
export type Root = ModernParseReturnType<typeof parse>;
8-
export type Fragment = Root["fragment"];
9-
export type SvelteOptions = Root["options"];
10-
export type Script = Root["instance"];
11-
type FragmentChild = Fragment["nodes"][number];
8+
export type Text = AST.Text;
129

13-
export type Text = Extract<FragmentChild, { type: "Text" }>;
10+
export type ExpressionTag = AST.ExpressionTag;
11+
export type HtmlTag = AST.HtmlTag;
12+
export type ConstTag = AST.ConstTag;
13+
export type DebugTag = AST.DebugTag;
14+
export type RenderTag = AST.RenderTag;
1415

15-
export type ExpressionTag = Extract<FragmentChild, { type: "ExpressionTag" }>;
16-
export type HtmlTag = Extract<FragmentChild, { type: "HtmlTag" }>;
17-
export type ConstTag = Extract<FragmentChild, { type: "ConstTag" }>;
18-
export type DebugTag = Extract<FragmentChild, { type: "DebugTag" }>;
19-
export type RenderTag = Extract<FragmentChild, { type: "RenderTag" }>;
16+
export type Component = AST.Component;
17+
export type TitleElement = AST.TitleElement;
18+
export type SlotElement = AST.SlotElement;
19+
export type RegularElement = AST.RegularElement;
20+
export type SvelteBody = AST.SvelteBody;
21+
export type SvelteComponent = AST.SvelteComponent;
22+
export type SvelteDocument = AST.SvelteDocument;
23+
export type SvelteElement = AST.SvelteElement;
24+
export type SvelteFragment = AST.SvelteFragment;
25+
export type SvelteHead = AST.SvelteHead;
26+
export type SvelteOptionsRaw = AST.SvelteOptionsRaw;
27+
export type SvelteSelf = AST.SvelteSelf;
28+
export type SvelteWindow = AST.SvelteWindow;
2029

21-
export type Component = Extract<FragmentChild, { type: "Component" }>;
22-
export type TitleElement = Extract<FragmentChild, { type: "TitleElement" }>;
23-
export type SlotElement = Extract<FragmentChild, { type: "SlotElement" }>;
24-
export type RegularElement = Extract<FragmentChild, { type: "RegularElement" }>;
25-
export type SvelteBody = Extract<FragmentChild, { type: "SvelteBody" }>;
26-
export type SvelteComponent = Extract<
27-
FragmentChild,
28-
{ type: "SvelteComponent" }
29-
>;
30-
export type SvelteDocument = Extract<FragmentChild, { type: "SvelteDocument" }>;
31-
export type SvelteElement = Extract<FragmentChild, { type: "SvelteElement" }>;
32-
export type SvelteFragment = Extract<FragmentChild, { type: "SvelteFragment" }>;
33-
export type SvelteHead = Extract<FragmentChild, { type: "SvelteHead" }>;
34-
export type SvelteOptionsRaw = Extract<
35-
FragmentChild,
36-
{ type: "SvelteOptions" }
37-
>;
38-
export type SvelteSelf = Extract<FragmentChild, { type: "SvelteSelf" }>;
39-
export type SvelteWindow = Extract<FragmentChild, { type: "SvelteWindow" }>;
30+
export type IfBlock = AST.IfBlock;
31+
export type EachBlock = AST.EachBlock;
32+
export type AwaitBlock = AST.AwaitBlock;
33+
export type KeyBlock = AST.KeyBlock;
34+
export type SnippetBlock = AST.SnippetBlock;
4035

41-
export type IfBlock = Extract<FragmentChild, { type: "IfBlock" }>;
42-
export type EachBlock = Extract<FragmentChild, { type: "EachBlock" }>;
43-
export type AwaitBlock = Extract<FragmentChild, { type: "AwaitBlock" }>;
44-
export type KeyBlock = Extract<FragmentChild, { type: "KeyBlock" }>;
45-
export type SnippetBlock = Extract<FragmentChild, { type: "SnippetBlock" }>;
46-
47-
export type Comment = Extract<FragmentChild, { type: "Comment" }>;
48-
type ComponentAttribute = Component["attributes"][number];
49-
export type Attribute = Extract<ComponentAttribute, { type: "Attribute" }>;
50-
export type SpreadAttribute = Extract<
51-
ComponentAttribute,
52-
{ type: "SpreadAttribute" }
53-
>;
54-
export type AnimateDirective = Extract<
55-
ComponentAttribute,
56-
{ type: "AnimateDirective" }
57-
>;
58-
export type BindDirective = Extract<
59-
ComponentAttribute,
60-
{ type: "BindDirective" }
61-
>;
62-
export type ClassDirective = Extract<
63-
ComponentAttribute,
64-
{ type: "ClassDirective" }
65-
>;
66-
export type LetDirective = Extract<
67-
ComponentAttribute,
68-
{ type: "LetDirective" }
69-
>;
70-
export type OnDirective = Extract<ComponentAttribute, { type: "OnDirective" }>;
71-
export type StyleDirective = Extract<
72-
ComponentAttribute,
73-
{ type: "StyleDirective" }
74-
>;
75-
export type TransitionDirective = Extract<
76-
ComponentAttribute,
77-
{ type: "TransitionDirective" }
78-
>;
79-
export type UseDirective = Extract<
80-
ComponentAttribute,
81-
{ type: "UseDirective" }
82-
>;
36+
export type Comment = AST.Comment;
37+
export type Attribute = AST.Attribute;
38+
export type SpreadAttribute = AST.SpreadAttribute;
39+
export type AnimateDirective = AST.AnimateDirective;
40+
export type BindDirective = AST.BindDirective;
41+
export type ClassDirective = AST.ClassDirective;
42+
export type LetDirective = AST.LetDirective;
43+
export type OnDirective = AST.OnDirective;
44+
export type StyleDirective = AST.StyleDirective;
45+
export type TransitionDirective = AST.TransitionDirective;
46+
export type UseDirective = AST.UseDirective;
8347

8448
export type Tag = ExpressionTag | HtmlTag | ConstTag | DebugTag | RenderTag;
8549
export type ElementLike =
@@ -107,10 +71,3 @@ export type Directive =
10771
| StyleDirective
10872
| TransitionDirective
10973
| UseDirective;
110-
111-
type ModernParseReturnType<T> = T extends {
112-
(source: string, options: { filename?: string; modern: true }): infer R;
113-
(...args: any[]): any;
114-
}
115-
? R
116-
: any;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"parse": {
3+
"svelte": "^4 || ^3"
4+
}
5+
}

‎tests/fixtures/parser/ast/svelte5/docs/snippets/10-typing-snippets-type-output.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<table>
1212
{#if children} <!-- children: Snippet<[]> -->
1313
<thead>
14-
<tr>{@render children()}</tr> <!-- children(): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
14+
<tr>{@render children()}</tr> <!-- children(): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
1515
</thead>
1616
{/if}
1717
<tbody>
1818
{#each data as d} <!-- data: any[], d: any -->
19-
<tr>{@render row(d)}</tr> <!-- row(d): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
19+
<tr>{@render row(d)}</tr> <!-- row(d): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
2020
{/each}
2121
</tbody>
2222
</table>

‎tests/fixtures/parser/ast/svelte5/docs/snippets/11-typing-snippets-type-output.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<table>
1212
{#if children} <!-- children: Snippet<[]> -->
1313
<thead>
14-
<tr>{@render children()}</tr> <!-- children(): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
14+
<tr>{@render children()}</tr> <!-- children(): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
1515
</thead>
1616
{/if}
1717
<tbody>
1818
{#each data as d} <!-- data: unknown[], d: unknown -->
19-
<tr>{@render row(d)}</tr> <!-- row(d): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
19+
<tr>{@render row(d)}</tr> <!-- row(d): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
2020
{/each}
2121
</tbody>
2222
</table>

‎tests/fixtures/parser/ast/svelte5/generics01-snippets-type-output.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<table>
1313
{#if children} <!-- children: Snippet<[]> -->
1414
<thead>
15-
<tr>{@render children()}</tr> <!-- children(): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
15+
<tr>{@render children()}</tr> <!-- children(): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
1616
</thead>
1717
{/if}
1818
<tbody>
1919
{#each data as d} <!-- data: unknown[], d: unknown -->
20-
<tr>{@render row(d)}</tr> <!-- row(d): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
20+
<tr>{@render row(d)}</tr> <!-- row(d): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
2121
{/each}
2222
</tbody>
2323
</table>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"parse": {
3+
"svelte": "^4 || ^3"
4+
}
5+
}

‎tests/src/parser/__snapshots__/html.ts.snap

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@ Object {
1212
"attributes": Array [
1313
Object {
1414
"end": 17,
15-
"metadata": null,
1615
"name": "lang",
17-
"parent": null,
1816
"start": 8,
1917
"type": "Attribute",
2018
"value": Array [
2119
Object {
2220
"data": "ts",
2321
"end": 16,
24-
"parent": null,
2522
"raw": "ts",
2623
"start": 14,
2724
"type": "Text",
@@ -38,16 +35,13 @@ Object {
3835
"attributes": Array [
3936
Object {
4037
"end": 17,
41-
"metadata": null,
4238
"name": "lang",
43-
"parent": null,
4439
"start": 8,
4540
"type": "Attribute",
4641
"value": Array [
4742
Object {
4843
"data": "ts",
4944
"end": 16,
50-
"parent": null,
5145
"raw": "ts",
5246
"start": 14,
5347
"type": "Text",
@@ -64,16 +58,13 @@ Object {
6458
"attributes": Array [
6559
Object {
6660
"end": 15,
67-
"metadata": null,
6861
"name": "lang",
69-
"parent": null,
7062
"start": 8,
7163
"type": "Attribute",
7264
"value": Array [
7365
Object {
7466
"data": "ts",
7567
"end": 15,
76-
"parent": null,
7768
"raw": "ts",
7869
"start": 13,
7970
"type": "Text",
@@ -90,9 +81,7 @@ Object {
9081
"attributes": Array [
9182
Object {
9283
"end": 13,
93-
"metadata": null,
9484
"name": "global",
95-
"parent": null,
9685
"start": 7,
9786
"type": "Attribute",
9887
"value": true,
@@ -107,9 +96,7 @@ Object {
10796
"attributes": Array [
10897
Object {
10998
"end": 13,
110-
"metadata": null,
11199
"name": "global",
112-
"parent": null,
113100
"start": 7,
114101
"type": "Attribute",
115102
"value": true,
@@ -124,9 +111,7 @@ Object {
124111
"attributes": Array [
125112
Object {
126113
"end": 4,
127-
"metadata": null,
128114
"name": "attr",
129-
"parent": null,
130115
"start": 0,
131116
"type": "Attribute",
132117
"value": true,
@@ -141,16 +126,13 @@ Object {
141126
"attributes": Array [
142127
Object {
143128
"end": 16,
144-
"metadata": null,
145129
"name": "attr",
146-
"parent": null,
147130
"start": 0,
148131
"type": "Attribute",
149132
"value": Array [
150133
Object {
151134
"data": "value",
152135
"end": 15,
153-
"parent": null,
154136
"raw": "value",
155137
"start": 10,
156138
"type": "Text",
@@ -167,9 +149,7 @@ Object {
167149
"attributes": Array [
168150
Object {
169151
"end": 4,
170-
"metadata": null,
171152
"name": "attr",
172-
"parent": null,
173153
"start": 0,
174154
"type": "Attribute",
175155
"value": true,
@@ -184,16 +164,13 @@ Object {
184164
"attributes": Array [
185165
Object {
186166
"end": 12,
187-
"metadata": null,
188167
"name": "attr",
189-
"parent": null,
190168
"start": 0,
191169
"type": "Attribute",
192170
"value": Array [
193171
Object {
194172
"data": "value",
195173
"end": 11,
196-
"parent": null,
197174
"raw": "value",
198175
"start": 6,
199176
"type": "Text",
@@ -210,16 +187,13 @@ Object {
210187
"attributes": Array [
211188
Object {
212189
"end": 8,
213-
"metadata": null,
214190
"name": "empty",
215-
"parent": null,
216191
"start": 0,
217192
"type": "Attribute",
218193
"value": Array [
219194
Object {
220195
"data": "",
221196
"end": 7,
222-
"parent": null,
223197
"raw": "",
224198
"start": 7,
225199
"type": "Text",
@@ -236,16 +210,13 @@ Object {
236210
"attributes": Array [
237211
Object {
238212
"end": 8,
239-
"metadata": null,
240213
"name": "empty",
241-
"parent": null,
242214
"start": 0,
243215
"type": "Attribute",
244216
"value": Array [
245217
Object {
246218
"data": "",
247219
"end": 7,
248-
"parent": null,
249220
"raw": "",
250221
"start": 7,
251222
"type": "Text",
@@ -262,9 +233,7 @@ Object {
262233
"attributes": Array [
263234
Object {
264235
"end": 13,
265-
"metadata": null,
266236
"name": "expr",
267-
"parent": null,
268237
"start": 0,
269238
"type": "Attribute",
270239
"value": Array [
@@ -278,8 +247,6 @@ Object {
278247
"type": "Literal",
279248
"value": true,
280249
},
281-
"metadata": null,
282-
"parent": null,
283250
"start": 5,
284251
"type": "ExpressionTag",
285252
},
@@ -295,9 +262,7 @@ Object {
295262
"attributes": Array [
296263
Object {
297264
"end": 13,
298-
"metadata": null,
299265
"name": "expr",
300-
"parent": null,
301266
"start": 0,
302267
"type": "Attribute",
303268
"value": Array [
@@ -311,8 +276,6 @@ Object {
311276
"type": "Literal",
312277
"value": true,
313278
},
314-
"metadata": null,
315-
"parent": null,
316279
"start": 5,
317280
"type": "ExpressionTag",
318281
},
@@ -328,9 +291,7 @@ Object {
328291
"attributes": Array [
329292
Object {
330293
"end": 10,
331-
"metadata": null,
332294
"name": "expr",
333-
"parent": null,
334295
"start": 0,
335296
"type": "Attribute",
336297
"value": Array [
@@ -344,8 +305,6 @@ Object {
344305
"type": "Literal",
345306
"value": "}",
346307
},
347-
"metadata": null,
348-
"parent": null,
349308
"start": 5,
350309
"type": "ExpressionTag",
351310
},
@@ -361,9 +320,7 @@ Object {
361320
"attributes": Array [
362321
Object {
363322
"end": 10,
364-
"metadata": null,
365323
"name": "expr",
366-
"parent": null,
367324
"start": 0,
368325
"type": "Attribute",
369326
"value": Array [
@@ -377,8 +334,6 @@ Object {
377334
"type": "Literal",
378335
"value": "s",
379336
},
380-
"metadata": null,
381-
"parent": null,
382337
"start": 5,
383338
"type": "ExpressionTag",
384339
},
@@ -394,9 +349,7 @@ Object {
394349
"attributes": Array [
395350
Object {
396351
"end": 15,
397-
"metadata": null,
398352
"name": "expr",
399-
"parent": null,
400353
"start": 0,
401354
"type": "Attribute",
402355
"value": Array [
@@ -417,8 +370,6 @@ Object {
417370
"type": "Literal",
418371
"value": "}",
419372
},
420-
"metadata": null,
421-
"parent": null,
422373
"start": 5,
423374
"type": "ExpressionTag",
424375
},
@@ -435,9 +386,7 @@ Object {
435386
"attributes": Array [
436387
Object {
437388
"end": 19,
438-
"metadata": null,
439389
"name": "expr",
440-
"parent": null,
441390
"start": 0,
442391
"type": "Attribute",
443392
"value": Array [
@@ -464,8 +413,6 @@ Object {
464413
"type": "Literal",
465414
"value": "}",
466415
},
467-
"metadata": null,
468-
"parent": null,
469416
"start": 5,
470417
"type": "ExpressionTag",
471418
},
@@ -481,9 +428,7 @@ Object {
481428
"attributes": Array [
482429
Object {
483430
"end": 11,
484-
"metadata": null,
485431
"name": "expr",
486-
"parent": null,
487432
"start": 0,
488433
"type": "Attribute",
489434
"value": Array [
@@ -497,8 +442,6 @@ Object {
497442
"type": "Literal",
498443
"value": true,
499444
},
500-
"metadata": null,
501-
"parent": null,
502445
"start": 5,
503446
"type": "ExpressionTag",
504447
},
@@ -514,16 +457,13 @@ Object {
514457
"attributes": Array [
515458
Object {
516459
"end": 9,
517-
"metadata": null,
518460
"name": "quote",
519-
"parent": null,
520461
"start": 0,
521462
"type": "Attribute",
522463
"value": Array [
523464
Object {
524465
"data": "'",
525466
"end": 8,
526-
"parent": null,
527467
"raw": "'",
528468
"start": 7,
529469
"type": "Text",
@@ -540,16 +480,13 @@ Object {
540480
"attributes": Array [
541481
Object {
542482
"end": 9,
543-
"metadata": null,
544483
"name": "quote",
545-
"parent": null,
546484
"start": 0,
547485
"type": "Attribute",
548486
"value": Array [
549487
Object {
550488
"data": "\\"",
551489
"end": 8,
552-
"parent": null,
553490
"raw": "\\"",
554491
"start": 7,
555492
"type": "Text",

‎tests/src/parser/style-context.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ describe("Check for AST.", () => {
2626
config,
2727
meetRequirements,
2828
} of listupFixtures(STYLE_CONTEXT_FIXTURE_ROOT)) {
29+
if (!meetRequirements("parse")) {
30+
continue;
31+
}
2932
describe(inputFileName, () => {
3033
let result: any;
3134

‎tools/update-fixtures.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,16 @@ for (const { input, inputFileName, outputFileName, config } of listupFixtures(
135135
}
136136
}
137137

138-
for (const { input, inputFileName, outputFileName, config } of listupFixtures(
139-
STYLE_CONTEXT_FIXTURE_ROOT,
140-
)) {
138+
for (const {
139+
input,
140+
inputFileName,
141+
outputFileName,
142+
config,
143+
meetRequirements,
144+
} of listupFixtures(STYLE_CONTEXT_FIXTURE_ROOT)) {
145+
if (!meetRequirements("parse")) {
146+
continue;
147+
}
141148
const result = parse(input, inputFileName, config);
142149
const styleContext = result.services.getStyleContext();
143150
fs.writeFileSync(
@@ -147,9 +154,16 @@ for (const { input, inputFileName, outputFileName, config } of listupFixtures(
147154
);
148155
}
149156

150-
for (const { input, inputFileName, outputFileName, config } of listupFixtures(
151-
STYLE_LOCATION_FIXTURE_ROOT,
152-
)) {
157+
for (const {
158+
input,
159+
inputFileName,
160+
outputFileName,
161+
config,
162+
meetRequirements,
163+
} of listupFixtures(STYLE_LOCATION_FIXTURE_ROOT)) {
164+
if (!meetRequirements("parse")) {
165+
continue;
166+
}
153167
const services = parse(input, inputFileName, config).services;
154168
if (!services.isSvelte) continue;
155169
const styleContext = services.getStyleContext();

0 commit comments

Comments
 (0)
Please sign in to comment.