MCPcopy Index your code
hub / github.com/deepnote/deepnote / printDeepnoteFileMetadata

Function printDeepnoteFileMetadata

packages/cli/src/commands/inspect.ts:104–137  ·  view source on GitHub ↗
(
  absolutePath: string,
  deepnoteFile: ReturnType<typeof deserializeDeepnoteFile>
)

Source from the content-addressed store, hash-verified

102}
103
104function printDeepnoteFileMetadata(
105 absolutePath: string,
106 deepnoteFile: ReturnType<typeof deserializeDeepnoteFile>
107): void {
108 const { project, metadata, version: fileVersion } = deepnoteFile
109 const notebooks = project.notebooks
110 const totalBlocks = notebooks.reduce((sum, notebook) => sum + notebook.blocks.length, 0)
111 const c = getChalk()
112
113 output(`${c.dim('Path:')} ${absolutePath}`)
114 output(`${c.dim('Name:')} ${project.name}`)
115 output(`${c.dim('Project ID:')} ${project.id}`)
116 output(`${c.dim('Version:')} ${fileVersion}`)
117 output(`${c.dim('Created:')} ${metadata.createdAt}`)
118
119 if (metadata.modifiedAt) {
120 output(`${c.dim('Modified:')} ${metadata.modifiedAt}`)
121 }
122
123 if (metadata.exportedAt) {
124 output(`${c.dim('Exported:')} ${metadata.exportedAt}`)
125 }
126
127 output(`${c.dim('Notebooks count:')} ${notebooks.length}`)
128 output(`${c.dim('Blocks:')} ${totalBlocks}`)
129
130 if (notebooks.length > 0) {
131 output(`${c.dim('Notebooks:')}`)
132 for (const notebook of notebooks) {
133 const moduleSuffix = notebook.isModule ? ', module' : ''
134 output(`- ${notebook.name} (${notebook.blocks.length} blocks${moduleSuffix})`)
135 }
136 }
137}

Callers 1

inspectDeepnoteFileFunction · 0.85

Calls 2

getChalkFunction · 0.90
outputFunction · 0.90

Tested by

no test coverage detected