@deepnote/convert 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_src = require('./src-CrnuwKOU.cjs');
2
+ const require_src = require('./src-DfBtDvXJ.cjs');
3
3
  let cleye = require("cleye");
4
4
  cleye = require_src.__toESM(cleye);
5
5
  let node_fs_promises = require("node:fs/promises");
package/dist/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { G as convertDeepnoteFileToPercentFiles, I as readAndConvertIpynbFiles, R as isMarimoContent, S as mergeSnapshotIntoSource, T as loadLatestSnapshot, V as convertDeepnoteFileToQuartoFiles, Y as convertDeepnoteFileToMarimoFiles, d as readAndConvertPercentFiles, et as convertDeepnoteFileToJupyterFiles, g as readAndConvertMarimoFiles, o as readAndConvertQuartoFiles, t as writeDeepnoteFile, z as isPercentContent } from "./src-C0XPNDnj.js";
2
+ import { G as convertDeepnoteFileToPercentFiles, I as readAndConvertIpynbFiles, R as isMarimoContent, S as mergeSnapshotIntoSource, T as loadLatestSnapshot, V as convertDeepnoteFileToQuartoFiles, Y as convertDeepnoteFileToMarimoFiles, d as readAndConvertPercentFiles, et as convertDeepnoteFileToJupyterFiles, g as readAndConvertMarimoFiles, o as readAndConvertQuartoFiles, t as writeDeepnoteFile, z as isPercentContent } from "./src-D0_X_RDD.js";
3
3
  import { cli } from "cleye";
4
4
  import fs from "node:fs/promises";
5
5
  import { basename, dirname, extname, resolve } from "node:path";
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_src = require('./src-CrnuwKOU.cjs');
1
+ const require_src = require('./src-DfBtDvXJ.cjs');
2
2
 
3
3
  exports.addContentHashes = require_src.addContentHashes;
4
4
  exports.computeContentHash = require_src.computeContentHash;
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as convertBlocksToJupyterNotebook, A as addContentHashes, B as convertBlocksToQuartoDocument, C as findSnapshotsForProject, D as parseSnapshotFilename, E as loadSnapshotFile, F as convertJupyterNotebooksToDeepnote, G as convertDeepnoteFileToPercentFiles, H as convertDeepnoteToQuartoDocuments, I as readAndConvertIpynbFiles, J as convertBlocksToMarimoApp, K as convertDeepnoteToPercentNotebooks, L as detectFormat, M as computeSnapshotHash, N as convertIpynbFilesToDeepnoteFile, O as parseSourceFilePath, P as convertJupyterNotebookToBlocks, Q as convertBlockToJupyterCell, S as mergeSnapshotIntoSource, T as loadLatestSnapshot, U as serializeQuartoFormat, V as convertDeepnoteFileToQuartoFiles, W as convertBlocksToPercentNotebook, X as convertDeepnoteToMarimoApps, Y as convertDeepnoteFileToMarimoFiles, Z as serializeMarimoFormat, _ as generateSnapshotFilename, a as parseQuartoFormat, b as splitDeepnoteFile, c as convertPercentNotebookToBlocks, d as readAndConvertPercentFiles, et as convertDeepnoteFileToJupyterFiles, f as convertMarimoAppToBlocks, g as readAndConvertMarimoFiles, h as parseMarimoFormat, i as convertQuartoFilesToDeepnoteFile, j as computeContentHash, k as snapshotExists, l as convertPercentNotebooksToDeepnote, m as convertMarimoFilesToDeepnoteFile, n as convertQuartoDocumentToBlocks, o as readAndConvertQuartoFiles, p as convertMarimoAppsToDeepnote, q as serializePercentFormat, r as convertQuartoDocumentsToDeepnote, s as convertPercentFilesToDeepnoteFile, t as writeDeepnoteFile, tt as convertDeepnoteToJupyterNotebooks, u as parsePercentFormat, v as hasOutputs, w as getSnapshotDir, x as countBlocksWithOutputs, y as slugifyProjectName } from "./src-C0XPNDnj.js";
1
+ import { $ as convertBlocksToJupyterNotebook, A as addContentHashes, B as convertBlocksToQuartoDocument, C as findSnapshotsForProject, D as parseSnapshotFilename, E as loadSnapshotFile, F as convertJupyterNotebooksToDeepnote, G as convertDeepnoteFileToPercentFiles, H as convertDeepnoteToQuartoDocuments, I as readAndConvertIpynbFiles, J as convertBlocksToMarimoApp, K as convertDeepnoteToPercentNotebooks, L as detectFormat, M as computeSnapshotHash, N as convertIpynbFilesToDeepnoteFile, O as parseSourceFilePath, P as convertJupyterNotebookToBlocks, Q as convertBlockToJupyterCell, S as mergeSnapshotIntoSource, T as loadLatestSnapshot, U as serializeQuartoFormat, V as convertDeepnoteFileToQuartoFiles, W as convertBlocksToPercentNotebook, X as convertDeepnoteToMarimoApps, Y as convertDeepnoteFileToMarimoFiles, Z as serializeMarimoFormat, _ as generateSnapshotFilename, a as parseQuartoFormat, b as splitDeepnoteFile, c as convertPercentNotebookToBlocks, d as readAndConvertPercentFiles, et as convertDeepnoteFileToJupyterFiles, f as convertMarimoAppToBlocks, g as readAndConvertMarimoFiles, h as parseMarimoFormat, i as convertQuartoFilesToDeepnoteFile, j as computeContentHash, k as snapshotExists, l as convertPercentNotebooksToDeepnote, m as convertMarimoFilesToDeepnoteFile, n as convertQuartoDocumentToBlocks, o as readAndConvertQuartoFiles, p as convertMarimoAppsToDeepnote, q as serializePercentFormat, r as convertQuartoDocumentsToDeepnote, s as convertPercentFilesToDeepnoteFile, t as writeDeepnoteFile, tt as convertDeepnoteToJupyterNotebooks, u as parsePercentFormat, v as hasOutputs, w as getSnapshotDir, x as countBlocksWithOutputs, y as slugifyProjectName } from "./src-D0_X_RDD.js";
2
2
 
3
3
  export { addContentHashes, computeContentHash, computeSnapshotHash, convertBlockToJupyterCell, convertBlocksToJupyterNotebook, convertBlocksToMarimoApp, convertBlocksToPercentNotebook, convertBlocksToQuartoDocument, convertDeepnoteFileToJupyterFiles, convertDeepnoteFileToMarimoFiles, convertDeepnoteFileToPercentFiles, convertDeepnoteFileToQuartoFiles, convertDeepnoteToJupyterNotebooks, convertDeepnoteToMarimoApps, convertDeepnoteToPercentNotebooks, convertDeepnoteToQuartoDocuments, convertIpynbFilesToDeepnoteFile, convertJupyterNotebookToBlocks, convertJupyterNotebooksToDeepnote, convertMarimoAppToBlocks, convertMarimoAppsToDeepnote, convertMarimoFilesToDeepnoteFile, convertPercentFilesToDeepnoteFile, convertPercentNotebookToBlocks, convertPercentNotebooksToDeepnote, convertQuartoDocumentToBlocks, convertQuartoDocumentsToDeepnote, convertQuartoFilesToDeepnoteFile, countBlocksWithOutputs, detectFormat, findSnapshotsForProject, generateSnapshotFilename, getSnapshotDir, hasOutputs, loadLatestSnapshot, loadSnapshotFile, mergeSnapshotIntoSource, parseMarimoFormat, parsePercentFormat, parseQuartoFormat, parseSnapshotFilename, parseSourceFilePath, readAndConvertIpynbFiles, readAndConvertMarimoFiles, readAndConvertPercentFiles, readAndConvertQuartoFiles, serializeMarimoFormat, serializePercentFormat, serializeQuartoFormat, slugifyProjectName, snapshotExists, splitDeepnoteFile, writeDeepnoteFile };
@@ -839,7 +839,10 @@ function convertCellToBlock$3(cell, index, idGenerator) {
839
839
  const executionFinishedAt = cell.metadata?.deepnote_execution_finished_at;
840
840
  const blockGroup = cell.metadata?.deepnote_block_group ?? cell.block_group ?? idGenerator();
841
841
  const deepnoteSource = cell.metadata?.deepnote_source;
842
- if (deepnoteSource !== void 0) source = deepnoteSource;
842
+ const isPlainCodeBlock = cell.cell_type === "code" && (!deepnoteCellType || deepnoteCellType === "code");
843
+ if (deepnoteSource !== void 0) if (isPlainCodeBlock) {
844
+ if (deepnoteSource === source) source = deepnoteSource;
845
+ } else source = deepnoteSource;
843
846
  const blockType = deepnoteCellType ?? (cell.cell_type === "code" ? "code" : "markdown");
844
847
  const originalMetadata = { ...cell.metadata };
845
848
  delete originalMetadata.cell_id;
@@ -867,7 +867,10 @@ function convertCellToBlock$3(cell, index, idGenerator) {
867
867
  const executionFinishedAt = cell.metadata?.deepnote_execution_finished_at;
868
868
  const blockGroup = cell.metadata?.deepnote_block_group ?? cell.block_group ?? idGenerator();
869
869
  const deepnoteSource = cell.metadata?.deepnote_source;
870
- if (deepnoteSource !== void 0) source = deepnoteSource;
870
+ const isPlainCodeBlock = cell.cell_type === "code" && (!deepnoteCellType || deepnoteCellType === "code");
871
+ if (deepnoteSource !== void 0) if (isPlainCodeBlock) {
872
+ if (deepnoteSource === source) source = deepnoteSource;
873
+ } else source = deepnoteSource;
871
874
  const blockType = deepnoteCellType ?? (cell.cell_type === "code" ? "code" : "markdown");
872
875
  const originalMetadata = { ...cell.metadata };
873
876
  delete originalMetadata.cell_id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepnote/convert",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "repository": {