Skip to content

Commit

Permalink
chore(core): add files pkg.json enforcement
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed May 13, 2024
1 parent b6cb4cd commit f5053b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/cloudfront-signer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"@smithy/url-parser": "^3.0.0",
"tslib": "^2.6.2"
},
"files": [
"dist-*/**"
],
"devDependencies": {
"@tsconfig/recommended": "1.0.1",
"concurrently": "7.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ module.exports = function (pkgJsonFilePath, overwrite = false) {
errors.push(`browser and react-native fields are different in ${pkgJson.name}`);
}

if (!pkgJson.files) {
errors.push(`no files entry in ${pkgJson.name}`);
}

if (typeof pkgJson.browser === "object" && typeof pkgJson["react-native"] === "object") {
const browserCanonical = Object.entries(pkgJson.browser).reduce((acc, [k, v]) => {
if (!k.includes("dist-cjs/") || typeof v === "boolean") {
Expand Down

0 comments on commit f5053b5

Please sign in to comment.