Skip to content

Commit

Permalink
chore: remove d.ts bundles (#7287)
Browse files Browse the repository at this point in the history
  • Loading branch information
asyncLiz committed Aug 5, 2021
1 parent 115250c commit b47dd37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion scripts/cp-pkgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,15 @@ function dtsBundler() {
if (error) {
return;
}
const isAllInOne = packageDirectory === ALL_IN_ONE_PACKAGE;
if (!isAllInOne) {
// Only the all-in-one package should generate a d.ts bundle
return;
}

// d.ts file exists
const packagePath = path.join(PACKAGES_DIRECTORY, packageDirectory);
const name = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json'), 'utf8')).name;
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`);
Expand Down
4 changes: 3 additions & 1 deletion scripts/verify-pkg-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ globSync('packages/*/package.json').forEach((jsonPath) => {
}
verifyPath(packageJson, jsonPath, 'main');
verifyPath(packageJson, jsonPath, 'module');
verifyPath(packageJson, jsonPath, 'types');
if (jsonPath.includes('material-components-web')) {
verifyPath(packageJson, jsonPath, 'types');
}
});

if (invalidMains > 0 || invalidModules > 0 || invalidTypes > 0) {
Expand Down

0 comments on commit b47dd37

Please sign in to comment.