( json: PersistedOptions, )
| 60 | } |
| 61 | |
| 62 | export async function createAppOptionsFromPersisted( |
| 63 | json: PersistedOptions, |
| 64 | ): Promise<Options> { |
| 65 | /* eslint-disable unused-imports/no-unused-vars */ |
| 66 | const { version, ...rest } = json |
| 67 | /* eslint-enable unused-imports/no-unused-vars */ |
| 68 | const framework = getFrameworkById(rest.framework) |
| 69 | const chosenAddOns = await finalizeAddOns(framework!, json.mode!, [ |
| 70 | ...json.chosenAddOns, |
| 71 | ]) |
| 72 | return { |
| 73 | ...rest, |
| 74 | mode: json.mode!, |
| 75 | projectName: json.projectName!, |
| 76 | typescript: json.typescript!, |
| 77 | tailwind: json.tailwind!, |
| 78 | git: json.git!, |
| 79 | packageManager: json.packageManager!, |
| 80 | targetDir: '', |
| 81 | framework: framework!, |
| 82 | starter: json.starter ? await loadStarter(json.starter) : undefined, |
| 83 | chosenAddOns, |
| 84 | addOnOptions: populateAddOnOptionsDefaults(chosenAddOns), |
| 85 | intent: json.intent ?? false, |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | export function createSerializedOptionsFromPersisted( |
| 90 | json: PersistedOptions, |
no test coverage detected