MCPcopy Create free account
hub / github.com/deepnote/deepnote / run

Function run

packages/cli/scripts/generate-skill-schema.ts:42–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40]
41
42async function run() {
43 const parts: string[] = [HEADER]
44
45 for (const { name, schema } of schemas) {
46 const jsonSchema = zodToJsonSchema(schema, {
47 name,
48 target: 'jsonSchema7',
49 $refStrategy: 'none',
50 })
51
52 if (name === 'DeepnoteFile') {
53 // For DeepnoteFile, strip the massive notebooks.blocks array to keep it compact.
54 // The block schema is already defined in DeepnoteBlock above.
55 stripBlocksFromFile(jsonSchema)
56 }
57
58 // biome-ignore lint/suspicious/noExplicitAny: JSON schema types are incompatible between libraries
59 const ts = await compile(jsonSchema as any, name, {
60 bannerComment: '',
61 additionalProperties: false,
62 unknownAny: false,
63 style: { singleQuote: true },
64 })
65 parts.push(ts.trim())
66 }
67
68 const output = `${parts.join('\n\n')}\n`
69 const outPath = path.join('../../skills/deepnote/references/schema.ts')
70 await fs.mkdir(path.dirname(outPath), { recursive: true })
71 await fs.writeFile(outPath, output)
72 console.log(`Wrote ${outPath}`)
73}
74
75// biome-ignore lint/suspicious/noExplicitAny: walking arbitrary JSON schema structure
76function stripBlocksFromFile(schema: any) {

Callers 1

Calls 1

stripBlocksFromFileFunction · 0.85

Tested by

no test coverage detected