packages/zent/scripts/new-component.js
function insertTs(name) {
  const tsIndexPath = path.resolve(__dirname, '../src/index.ts');
  const tsIndexFile = fs.readFileSync(tsIndexPath, { encoding: 'utf-8' });

  const moduleExports = tsIndexFile.trim().split('\n');
  moduleExports.push(`export * from './${name}';`);
  sortByModulePath(moduleExports);

  fs.writeFileSync(tsIndexPath, `${moduleExports.join('\n')}\n`);
}
function insertTs(name) {
  const tsIndexPath = path.resolve(__dirname, '../src/index.ts');
  const tsIndexFile = fs.readFileSync(tsIndexPath, { encoding: 'utf-8' });

  const moduleExports = tsIndexFile.trim().split('\n');
  moduleExports.push(`export * from './${name}';`);
  sortByModulePath(moduleExports);

  fs.writeFileSync(tsIndexPath, `${moduleExports.join('\n')}\n`);
}
ts