Skip to content

Commit bbf11dd

Browse files
committed
fix: automatically type events emitted by actions
1 parent 51d8381 commit bbf11dd

File tree

9 files changed

+361
-95
lines changed

9 files changed

+361
-95
lines changed

.vscode/extensions.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@
22
"recommendations": [
33
// Svelte
44
"svelte.svelte-vscode",
5-
"fivethree.vscode-svelte-snippets",
65
// Styles
76
"antfu.iconify",
87
"antfu.unocss",
98
// Code quality
109
"dbaeumer.vscode-eslint",
1110
// Git
12-
"eamodio.gitlens",
1311
"github.vscode-pull-request-github",
1412
// Kitbook
1513
"yzhang.markdown-all-in-one",
1614
"foam.foam-vscode",
17-
"jacob-8.kitbook-vscode",
1815
// ---- You should definitely install the ones above, the ones below are recommended
19-
// Efficiency
20-
"usernamehw.errorlens"
21-
// Jacob's Recommendations
16+
// "usernamehw.errorlens",
17+
// "eamodio.gitlens",
18+
// "cschleiden.vscode-github-actions",
2219
// "aaron-bond.better-comments",
2320
// "vscode-icons-team.vscode-icons",
2421
// "wallabyjs.quokka-vscode",
2522
]
26-
}
23+
}

.vscode/svelte.code-snippets

Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
{
2+
// Place your living-dictionaries workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3+
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4+
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5+
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7+
// Placeholders with the same ids are connected.
8+
// Example:
9+
// "Print to console": {
10+
// "scope": "javascript,typescript",
11+
// "prefix": "log",
12+
// "body": [
13+
// "console.log('$1');",
14+
// "$2"
15+
// ],
16+
// "description": "Log output to console"
17+
// }
18+
19+
// TYPESCRIPT
20+
"Inline Vitest": {
21+
"scope": "javascript,typescript",
22+
"prefix": "v-inv",
23+
"body": [
24+
"if (import.meta.vitest) {",
25+
" $1",
26+
"}",
27+
]
28+
},
29+
"Vitest Test": {
30+
"scope": "javascript,typescript",
31+
"prefix": "v-test",
32+
"body": [
33+
"test('$1', () => {",
34+
" expect($2).toEqual();",
35+
" expect($3).toMatchInlineSnapshot();",
36+
"});",
37+
]
38+
},
39+
"Vitest Describe": {
40+
"scope": "javascript,typescript",
41+
"prefix": "v-desc",
42+
"body": [
43+
"describe('$1', () => {",
44+
" test('$2', () => {",
45+
" expect($3).toEqual();",
46+
" expect($4).toMatchInlineSnapshot();",
47+
" });",
48+
"});",
49+
]
50+
},
51+
52+
// SVELTE
53+
"svelte-script-tag": {
54+
"scope": "svelte",
55+
"prefix": "s-script",
56+
"body": [
57+
"<script lang=\"ts\">",
58+
" $1",
59+
"</script>",
60+
]
61+
},
62+
"svelte-json-stringify": {
63+
"scope": "svelte",
64+
"prefix": "s-json",
65+
"body": [
66+
"<pre>{JSON.stringify($1, null, 2)}</pre>",
67+
]
68+
},
69+
"svelte-html": {
70+
"scope": "svelte",
71+
"prefix": "s-html",
72+
"body": [
73+
"{@html ${1:content}}"
74+
],
75+
"description": "html content"
76+
},
77+
"svelte-if-block": {
78+
"scope": "svelte",
79+
"prefix": "s-if-block",
80+
"body": [
81+
"{#if ${1:condition}}",
82+
"$2{/if}"
83+
],
84+
"description": "if block"
85+
},
86+
"svelte-if-else-block": {
87+
"scope": "svelte",
88+
"prefix": "s-if-else-block",
89+
"body": [
90+
"{#if ${1:condition}}",
91+
" $2",
92+
"{:else}",
93+
" $3",
94+
"{/if}"
95+
],
96+
"description": "if else block"
97+
},
98+
"svelte-else-block": {
99+
"scope": "svelte",
100+
"prefix": "s-else-block",
101+
"body": [
102+
"{:else}",
103+
" $1"
104+
],
105+
"description": "else block"
106+
},
107+
"svelte-if-else-if-block": {
108+
"scope": "svelte",
109+
"prefix": "s-if-else-if-block",
110+
"body": [
111+
"{#if ${1:condition}}",
112+
" $2",
113+
"{:else if ${3: otherCondition}}",
114+
" $4",
115+
"{:else}",
116+
" $5",
117+
"{/if}"
118+
],
119+
"description": "if else if block"
120+
},
121+
"svelte-else-if-block": {
122+
"scope": "svelte",
123+
"prefix": "s-else-if-block",
124+
"body": [
125+
"{:else if ${1: otherCondition}}",
126+
" $2"
127+
],
128+
"description": "else if block"
129+
},
130+
"svelte-each-block": {
131+
"scope": "svelte",
132+
"prefix": "s-each-block",
133+
"body": [
134+
"{#each ${1:items} as ${2:item}}",
135+
" $3",
136+
"{/each}"
137+
],
138+
"description": "each block"
139+
},
140+
"svelte-each-else-block": {
141+
"scope": "svelte",
142+
"prefix": "s-each-else-block",
143+
"body": [
144+
"{#each ${1:items} as ${2:item}}",
145+
" $3",
146+
"{:else}",
147+
" $4",
148+
"{/each}"
149+
],
150+
"description": "each else block"
151+
},
152+
"svelte-each-index-block": {
153+
"scope": "svelte",
154+
"prefix": "s-each-index-block",
155+
"body": [
156+
"{#each ${1:items} as ${2:item},${3:i}}",
157+
" $4",
158+
"{/each}"
159+
],
160+
"description": "each index block"
161+
},
162+
"svelte-each-key-block": {
163+
"scope": "svelte",
164+
"prefix": "s-each-key-block",
165+
"body": [
166+
"{#each ${1:items} as ${2:item},(${3:key})}",
167+
" $4",
168+
"{/each}"
169+
],
170+
"description": "each index block"
171+
},
172+
"svelte-each-index-key-block": {
173+
"scope": "svelte",
174+
"prefix": "s-each-index-key-block",
175+
"body": [
176+
"{#each ${1:items} as ${2:item},i (${3:key})}",
177+
" $4",
178+
"{/each}"
179+
],
180+
"description": "each index key block"
181+
},
182+
"svelte-each-length": {
183+
"scope": "svelte",
184+
"prefix": "s-each-length",
185+
"body": [
186+
"{#each {length: ${1:count}} as _, ${2:index}}",
187+
" $3",
188+
"{/each}"
189+
],
190+
"description": "each index key block"
191+
},
192+
"svelte-await-then-block": {
193+
"scope": "svelte",
194+
"prefix": "s-await-then-block",
195+
"body": [
196+
"{#await ${1:promise}}",
197+
" <!-- pending -->",
198+
"{:then ${2:value}}",
199+
" <!-- fulfilled -->",
200+
"{/await}"
201+
],
202+
"description": "await then block"
203+
},
204+
"svelte-then-block": {
205+
"scope": "svelte",
206+
"prefix": "s-then-block",
207+
"body": [
208+
"{:then ${1:value}}",
209+
" <!-- promise was fulfilled -->"
210+
],
211+
"description": "then block"
212+
},
213+
"svelte-await-short-block": {
214+
"scope": "svelte",
215+
"prefix": "s-await-short-block",
216+
"body": [
217+
"{#await ${1:promise} then ${2:value}}",
218+
" <!-- promise was fulfilled -->",
219+
"{/await}"
220+
],
221+
"description": "await short block"
222+
},
223+
"svelte-await-catch-block": {
224+
"scope": "svelte",
225+
"prefix": "s-await-catch-block",
226+
"body": [
227+
"{#await ${1:promise}}",
228+
" <!-- ${1:promise} is pending -->",
229+
"{:then ${value}}",
230+
" <!-- ${1:promise} was fulfilled -->",
231+
"{:catch error}",
232+
" <!-- ${1:promise} was rejected -->",
233+
"{/await}"
234+
],
235+
"description": "await catch block"
236+
},
237+
"svelte-catch-block": {
238+
"scope": "svelte",
239+
"prefix": "s-catch-block",
240+
"body": [
241+
"{:catch error}",
242+
" <!-- promise was rejected -->"
243+
],
244+
"description": "catch block"
245+
},
246+
"svelte-const-block": {
247+
"scope": "svelte",
248+
"prefix": "s-const-block",
249+
"body": [
250+
"{@const ${1:derived} = ${2:ingredients}}"
251+
]
252+
},
253+
"svelte-key-block": {
254+
"scope": "svelte",
255+
"prefix": "s-key-block",
256+
"body": [
257+
"{#key ${1:expression}}",
258+
" $2",
259+
"{/key}"
260+
]
261+
}
262+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"bumpp": "^9.2.0",
7272
"kitbook": "1.0.0-beta.11",
7373
"publint": "^0.2.2",
74-
"svelte": "^4.2.0",
74+
"svelte": "^4.2.10",
7575
"svelte-check": "^3.5.1",
7676
"svelte2tsx": "^0.6.21",
7777
"tslib": "^2.6.2",

0 commit comments

Comments
 (0)