MCPcopy Create free account
hub / github.com/GrapesJS/cli / buildDeclaration

Function buildDeclaration

src/build.ts:66–78  ·  view source on GitHub ↗
(opts: BuildOptions = {})

Source from the content-addressed store, hash-verified

64 * @param {Object} opts
65 */
66 export const buildDeclaration = async (opts: BuildOptions = {}) => {
67 const filePath = rootResolve('src/index.ts');
68 if (!fs.existsSync(filePath)) return;
69
70 printRow('Start building TS declaration file...', { lineDown: 0 });
71
72 const entry = { filePath, output: { noBanner: true }};
73 const bundleOptions = { preferredConfigPath: rootResolve('tsconfig.json') };
74 const result = generateDtsBundle([entry], bundleOptions)[0];
75 await writeFile(rootResolve('dist/index.d.ts'), result);
76
77 printRow('TS declaration file building completed successfully!');
78 }
79
80/**
81 * Build the library files

Callers 1

buildWebpackFunction · 0.85

Calls 3

rootResolveFunction · 0.90
printRowFunction · 0.90
writeFileFunction · 0.90

Tested by

no test coverage detected