scripts/cp-pkgs.js
function dtsBundler() {
  const packageDirectories = fs.readdirSync(D_TS_DIRECTORY);
  packageDirectories.forEach((packageDirectory) => {
    const packagePath = path.join(PACKAGES_DIRECTORY, packageDirectory);
    const name = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json'), 'utf8')).name;
    const main = path.join(D_TS_DIRECTORY, packageDirectory, './index.d.ts');
    const isAllInOne = packageDirectory === ALL_IN_ONE_PACKAGE;
    const destBasename = isAllInOne ? packageDirectory : `mdc.${toCamelCase(packageDirectory.replace(/^mdc-/, ''))}`;
    const destFilename = path.join(packagePath, 'dist', `${destBasename}.d.ts`);

    console.log(`Writing UMD declarations in ${destFilename.replace(process.cwd() + '/', '')}`);
    dts.bundle({
      name,
      main,
      out: destFilename,
    });
  });
}
function dtsBundler() {
  const packageDirectories = fs.readdirSync(D_TS_DIRECTORY);
  packageDirectories.forEach((packageDirectory) => {
    const packagePath = path.join(PACKAGES_DIRECTORY, packageDirectory);
    const name = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json'), 'utf8')).name;
    const main = path.join(D_TS_DIRECTORY, packageDirectory, './index.d.ts');
    const isAllInOne = packageDirectory === ALL_IN_ONE_PACKAGE;
    const destBasename = isAllInOne ? packageDirectory : `mdc.${toCamelCase(packageDirectory.replace(/^mdc-/, ''))}`;
    const destFilename = path.join(packagePath, 'dist', `${destBasename}.d.ts`);

    console.log(`Writing UMD declarations in ${destFilename.replace(process.cwd() + '/', '')}`);
    dts.bundle({
      name,
      main,
      out: destFilename,
    });
  });
}
function dtsBundler ( ) { const packageDirectories = fs . readdirSync ( D_TS_DIRECTORY ) ; packageDirectories . forEach ( ( packageDirectory ) => { const packagePath = path . join ( PACKAGES_DIRECTORY , packageDirectory ) ; const name = JSON . parse ( fs . readFileSync ( path . join ( packagePath , 'package.json' ) , 'utf8' ) ) . name ; const main = path . join ( D_TS_DIRECTORY , packageDirectory , './index.d.ts' ) ; const isAllInOne = packageDirectory === ALL_IN_ONE_PACKAGE ; const destBasename = isAllInOne ? packageDirectory : ` ${ toCamelCase ( packageDirectory . replace ( / ^mdc- / , '' ) ) } ` ; const destFilename = path . join ( packagePath , 'dist' , ` ${ destBasename } ` ) ; console . log ( ` ${ destFilename . replace ( process . cwd ( ) + '/' , '' ) } ` ) ; dts . bundle ( { name , main , out : destFilename , } ) ; } ) ; }
Imports all files in index.d.ts and compiles a bundled .d.ts file for UMD bundles.
Imports all files in index . d . ts and compiles a bundled . d . ts file for UMD bundles .