1- import chokidar from 'chokidar' ;
1+ // import chokidar from 'chokidar';
22import fs from 'fs/promises' ;
3- import { globSync } from 'glob' ;
3+ // import { globSync } from 'glob';
44import path from 'path' ;
55import * as prettier from 'prettier' ;
66
7- const INPUT_DIR = 'doc/**/demo.tsx' ;
7+ // const INPUT_DIR = 'doc/**/demo.tsx';
88const OUTPUT_FILE = 'source.auto.ts' ;
99
1010/**
@@ -61,6 +61,7 @@ function extractCodeSections(content) {
6161 return sections ;
6262}
6363
64+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
6465async function generate ( filePath ) {
6566 try {
6667 const content = await fs . readFile ( filePath , 'utf8' ) ;
@@ -100,7 +101,8 @@ export const source = ${JSON.stringify(source, null, 4)};
100101}
101102
102103export function run ( ) {
103- globSync ( INPUT_DIR ) . forEach ( async ( filePath ) => {
104+ /* @todo : improve this script to only build the changed file instead of rebuilding everything */
105+ /*globSync(INPUT_DIR).forEach(async (filePath) => {
104106 const watcher = chokidar.watch(filePath, { ignored: /^\./, persistent: true });
105107
106108 watcher
@@ -120,7 +122,7 @@ export function run() {
120122 .on('error', function () {
121123 //console.error('⛔Error happened', error);
122124 });
123- } ) ;
125+ });*/
124126}
125127
126128run ( ) ;
0 commit comments