Skip to content

Commit

Permalink
Merge pull request #4426 from systeminit/fix(sdf)-Update-authoring-sn…
Browse files Browse the repository at this point in the history
…ippets

fix(sdf): Update authoring snippets
  • Loading branch information
stack72 authored Aug 24, 2024
2 parents 3439f87 + dee4644 commit 6a933ec
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions app/web/src/utils/typescriptLinterSnippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import { snippetCompletion } from "@codemirror/autocomplete";
export const snippets = [
// new prop
snippetCompletion(
`const \${propName} = new PropBuilder()
`new PropBuilder()
.setName("\${name}")
.setKind("\${string}")
.setWidget(new PropWidgetDefinitionBuilder().setKind("\${text}")
.build())
.build();`,
.setWidget(new PropWidgetDefinitionBuilder().setKind("\${text}").build())
.build();`,
{
label: "New Prop Snippet",
type: "function",
Expand All @@ -17,7 +16,7 @@ export const snippets = [

// new secret prop
snippetCompletion(
`const \${secretPropName} = new SecretPropBuilder()
`new SecretPropBuilder()
.setName("\${name}")
.setSecretKind("\${Secret Kind}")
.build();`,
Expand All @@ -29,17 +28,14 @@ export const snippets = [

// new secret definition
snippetCompletion(
`const \${secretDefinition} = new SecretDefinitionBuilder()
`new SecretDefinitionBuilder()
.setName("\${name}")
.addProp(
new PropBuilder()
.setName("\${value}")
.setKind("\${string}")
.setWidget(
new PropWidgetDefinitionBuilder()
.setKind("password")
.build()
).build()
.setWidget(new PropWidgetDefinitionBuilder().setKind("password").build())
.build()
).build();`,
{
label: "New Secret Definition",
Expand All @@ -49,7 +45,7 @@ export const snippets = [

// basic socket
snippetCompletion(
`const \${socketName} = new SocketDefinitionBuilder()
`new SocketDefinitionBuilder()
.setName("\${name}")
.setArity("\${arity}")
.build();`,
Expand Down Expand Up @@ -96,16 +92,22 @@ export const snippets = [
},
),

// add prop widget definition
snippetCompletion(
`new PropWidgetDefinitionBuilder().setKind("\${text}").build()`,
{
label: "New PropertyWidget Snippet",
type: "function",
},
),

// aws region prop
snippetCompletion(
`const regionProp = new PropBuilder()
.setKind("string")
.setName("region")
.setWidget(new PropWidgetDefinitionBuilder().setKind("text").build())
.setValueFrom(new ValueFromBuilder()
.setKind("inputSocket")
.setSocketName("Region")
.build())
.setValueFrom(new ValueFromBuilder().setKind("inputSocket").setSocketName("Region").build())
.build();
const regionSocket = new SocketDefinitionBuilder()
Expand All @@ -127,10 +129,7 @@ export const snippets = [
.setWidget(new PropWidgetDefinitionBuilder().setKind("array").build())
.addMapKeyFunc(new MapKeyFuncBuilder()
.setKey("Name")
.setValueFrom(new ValueFromBuilder()
.setKind("prop")
.setPropPath(["root", "si", "name"])
.build())
.setValueFrom(new ValueFromBuilder().setKind("prop").setPropPath(["root", "si", "name"]).build())
.build())
.setEntry(new PropBuilder()
.setKind("string")
Expand Down

0 comments on commit 6a933ec

Please sign in to comment.