| 37 | } |
| 38 | |
| 39 | export const generatorOptions = (config: WorkspaceConfiguration): GeneratorOption[] => { |
| 40 | const preselected = config.get<string[]>("preselected") ?? []; |
| 41 | const allSelected = preselected.includes("all"); |
| 42 | return [ |
| 43 | { |
| 44 | key: "links", |
| 45 | label: "With links", |
| 46 | description: "Generate a links function inside the route", |
| 47 | picked: preselected.includes("links") || allSelected, |
| 48 | }, |
| 49 | { |
| 50 | key: "meta", |
| 51 | label: "With meta", |
| 52 | description: "Generate a meta function inside the route", |
| 53 | picked: preselected.includes("meta") || allSelected, |
| 54 | }, |
| 55 | { |
| 56 | key: "handler", |
| 57 | label: "With handle", |
| 58 | description: "Generate a handle function inside the route", |
| 59 | picked: preselected.includes("handler") || allSelected, |
| 60 | }, |
| 61 | |
| 62 | { |
| 63 | key: "headers", |
| 64 | label: "With headers", |
| 65 | description: "Generate a headers function inside the route", |
| 66 | picked: preselected.includes("headers") || allSelected, |
| 67 | }, |
| 68 | { |
| 69 | key: "loader", |
| 70 | label: "With loader", |
| 71 | description: "Generate a loader function inside the route", |
| 72 | picked: preselected.includes("loader") || allSelected, |
| 73 | }, |
| 74 | { |
| 75 | key: "clientLoader", |
| 76 | label: "With clientLoader", |
| 77 | description: "Generate a clientLoader function inside the route", |
| 78 | picked: preselected.includes("clientLoader") || allSelected, |
| 79 | }, |
| 80 | { |
| 81 | key: "action", |
| 82 | label: "With action", |
| 83 | description: "Generate an action function inside the route", |
| 84 | picked: preselected.includes("action") || allSelected, |
| 85 | }, |
| 86 | { |
| 87 | key: "clientAction", |
| 88 | label: "With clientAction", |
| 89 | description: "Generate a clientAction function inside the route", |
| 90 | picked: preselected.includes("clientAction") || allSelected, |
| 91 | }, |
| 92 | { |
| 93 | key: "errorBoundary", |
| 94 | label: "With ErrorBoundary", |
| 95 | description: "Generate an ErrorBoundary component inside the route", |
| 96 | picked: preselected.includes("errorBoundary") || allSelected, |