refactor(snippets): adopt alias/title model and markdown UX
- rename snippet identity from name to alias and add required title fields - migrate snippet API, forms, cards, and detail views to alias/title semantics - render markdown descriptions with short card previews and split vendor chunks
This commit is contained in:
1 parent
11db983ea6
commit
7223371fae
21 files changed
+1821
-85
No files matched your search
@@ -104,18 +104,18 @@ export class CodeExecutorService {
|
||||
return value;
|
||||
},
|
||||
/**
|
||||
* Runs a named snippet by name. Snippets receive the same page/context/helpers
|
||||
* Runs a snippet by alias. Snippets receive the same page/context/helpers
|
||||
* as regular exec code, plus any positional args you pass.
|
||||
*
|
||||
* Example: await helpers.runSnippet('clickLoginButton', '#submit')
|
||||
*/
|
||||
runSnippet: async (
|
||||
name: string,
|
||||
alias: string,
|
||||
...args: unknown[]
|
||||
): Promise<unknown> => {
|
||||
const snippetCode = snippetMap[name];
|
||||
const snippetCode = snippetMap[alias];
|
||||
if (snippetCode == null) {
|
||||
throw new Error(`Snippet "${name}" not found`);
|
||||
throw new Error(`Snippet alias "${alias}" not found`);
|
||||
}
|
||||
const snippetFn = new Function(
|
||||
"page",
|
||||
|
||||
Reference in new issue
Block a user