Skip to content

Commit 32db45e

Browse files
committed
Security: require 2FA for publish
1 parent b1140f0 commit 32db45e

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ coverage
1212
!.yarn/versions
1313
.turbo
1414
.DS_Store
15+
publish.env

CONTRIBUTING.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,16 @@ yarn demo
7373

7474
## Publishing new versions
7575

76-
Note: This can only be done by someone with permission to the org on `npm`.
76+
Note: This can only be done by someone with permission to the org on `npm` and requires 2FA setup.
7777

7878
```sh
79-
yarn lerna publish
79+
yarn publish
8080
```
81+
82+
You'll need to add a `./publish.env` at the root of the repo. And inside define your 2FA codes:
83+
84+
```
85+
NPM_CONFIG_OTP=""
86+
```
87+
88+
The publish alias relies on 1password for developer to fetch the private information.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"internals/*"
5454
],
5555
"scripts": {
56+
"publish": "op run --env-file='./publish.env' -- yarn lerna publish",
5657
"demo": "node --watch-path=packages/ packages/demo/dist/esm/index.js",
5758
"dev": "turbo watch tsc",
5859
"prepare": "husky && turbo tsc attw",

0 commit comments

Comments
 (0)