Skip to content

Commit

Permalink
Merge pull request #7722 from blink1073/access-config
Browse files Browse the repository at this point in the history
Add public access setting for public packages
  • Loading branch information
jasongrout committed Jan 2, 2020
2 parents 2648e13 + b15932c commit e43ebd5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions buildutils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,8 @@
"@types/webpack": "^4.41.0",
"@types/which": "^1.3.2",
"rimraf": "~3.0.0"
},
"publishConfig": {
"access": "public"
}
}
5 changes: 5 additions & 0 deletions buildutils/src/ensure-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ export async function ensurePackage(
// when a package is actually being published.
delete data.gitHead;

// Ensure that there is a public access set, if the package is not private.
if (data.private !== true) {
data['publishConfig'] = { access: 'public' };
}

// Ensure there is a minimal prepublishOnly script
if (!data.private && !data.scripts.prepublishOnly) {
messages.push(`prepublishOnly script missing in ${pkgPath}`);
Expand Down
3 changes: 3 additions & 0 deletions packages/celltags/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@
"@types/node": "^12.12.17",
"rimraf": "~3.0.0",
"typescript": "~3.7.3"
},
"publishConfig": {
"access": "public"
}
}
3 changes: 3 additions & 0 deletions testutils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,8 @@
"@types/node-fetch": "^2.5.4",
"lighthouse": "5.6.0",
"typescript": "~3.7.3"
},
"publishConfig": {
"access": "public"
}
}

0 comments on commit e43ebd5

Please sign in to comment.