Converts one source notebook to a single-notebook `.deepnote` file.
( absoluteInput: string, format: SourceNotebookFormat, outputPath: string | undefined, projectName: string | undefined )
| 126 | |
| 127 | /** Converts one source notebook to a single-notebook `.deepnote` file. */ |
| 128 | async function convertSingleFileToDeepnote( |
| 129 | absoluteInput: string, |
| 130 | format: SourceNotebookFormat, |
| 131 | outputPath: string | undefined, |
| 132 | projectName: string | undefined |
| 133 | ): Promise<ConvertToSuccessPayload> { |
| 134 | const finalOutputPath = await resolveConvertToOutputPath(outputPath, absoluteInput) |
| 135 | const finalProjectName = projectName || path.basename(absoluteInput, path.extname(absoluteInput)) |
| 136 | |
| 137 | await runToDeepnoteConversion(format, absoluteInput, { |
| 138 | projectName: finalProjectName, |
| 139 | outputPath: finalOutputPath, |
| 140 | }) |
| 141 | |
| 142 | return { |
| 143 | inputPath: absoluteInput, |
| 144 | outputPath: finalOutputPath, |
| 145 | detectedFormat: format, |
| 146 | projectName: finalProjectName, |
| 147 | inputFiles: [absoluteInput], |
| 148 | outputFiles: [finalOutputPath], |
| 149 | outputIsDirectory: false, |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | async function handleConvertTo(args: Record<string, unknown>) { |
| 154 | const parsedArgs = convertToArgsSchema.safeParse(args) |
no test coverage detected