@dotenvx/dotenvx-ops 0.23.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
[Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.23.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.23.1...main)
|
|
6
|
+
|
|
7
|
+
## [0.23.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.23.0...v0.23.1) (2025-12-03)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
* Stdout storageState with `rotate npm login` ([#10](https://github.com/dotenvx/dotenvx-ops/pull/10))
|
|
6
12
|
|
|
7
13
|
## [0.23.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.22.2...v0.23.0) (2025-12-03)
|
|
8
14
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.23.
|
|
2
|
+
"version": "0.23.1",
|
|
3
3
|
"name": "@dotenvx/dotenvx-ops",
|
|
4
4
|
"description": "Dotenvx Ops – commercial tooling for .env files",
|
|
5
5
|
"author": "@motdotla",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@clack/core": "^0.4.2",
|
|
44
44
|
"@dotenvx/dotenvx": "^1.48.1",
|
|
45
|
+
"@inquirer/prompts": "^7.10.1",
|
|
45
46
|
"arch": "^2.1.1",
|
|
46
47
|
"commander": "^11.1.0",
|
|
47
48
|
"conf": "^10.2.0",
|
|
@@ -6,14 +6,20 @@ const TIMEOUT = 1200 // visibility timeout
|
|
|
6
6
|
async function login () {
|
|
7
7
|
const options = this.opts()
|
|
8
8
|
logger.debug(`options: ${JSON.stringify(options)}`)
|
|
9
|
-
|
|
10
|
-
const { browser, page } = await playwrightConnect()
|
|
11
|
-
|
|
9
|
+
const { username, password } = options
|
|
10
|
+
const { browser, context, page } = await playwrightConnect()
|
|
12
11
|
await page.goto('https://npmjs.com/login', { waitUntil: 'domcontentloaded' })
|
|
13
12
|
await page.waitForTimeout(TIMEOUT)
|
|
13
|
+
await page.fill('input[type="text"]', username)
|
|
14
|
+
await page.waitForTimeout(TIMEOUT)
|
|
15
|
+
await page.fill('input[type="password"]', password)
|
|
16
|
+
await page.waitForTimeout(TIMEOUT)
|
|
17
|
+
await page.press('input[type="password"]', 'Enter')
|
|
18
|
+
await page.waitForNavigation({ timeout: 0 })
|
|
19
|
+
await page.waitForSelector('img[alt="avatar"]', { state: 'visible', timeout: 0 })
|
|
20
|
+
const storageState = JSON.stringify(await context.storageState())
|
|
14
21
|
await browser.close()
|
|
15
|
-
|
|
16
|
-
process.stdout.write('logged in')
|
|
22
|
+
process.stdout.write(storageState)
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
module.exports = login
|
|
@@ -11,6 +11,8 @@ const loginAction = require('./../../actions/rotate/npm/login')
|
|
|
11
11
|
npm
|
|
12
12
|
.command('login')
|
|
13
13
|
.description('interactive local login + cookie capture')
|
|
14
|
+
.requiredOption('--username <username>')
|
|
15
|
+
.requiredOption('--password <password>')
|
|
14
16
|
.action(loginAction)
|
|
15
17
|
|
|
16
18
|
//
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const { logger } = require('@dotenvx/dotenvx')
|
|
2
2
|
const { chromium } = require('playwright')
|
|
3
3
|
|
|
4
|
-
async function playwrightConnect () {
|
|
5
|
-
const browser = await ensurePlaywrightBrowser()
|
|
4
|
+
async function playwrightConnect (channel = 'chrome') {
|
|
5
|
+
const browser = await ensurePlaywrightBrowser(channel)
|
|
6
6
|
const context = await browser.newContext()
|
|
7
7
|
const page = await context.newPage()
|
|
8
8
|
|
|
9
9
|
return { browser, context, page }
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
async function ensurePlaywrightBrowser () {
|
|
12
|
+
async function ensurePlaywrightBrowser (channel = 'chrome') {
|
|
13
13
|
try {
|
|
14
|
-
return await chromium.launch({ headless: false })
|
|
14
|
+
return await chromium.launch({ headless: false, channel })
|
|
15
15
|
} catch (err) {
|
|
16
16
|
if (String(err).includes('Executable doesn\'t exist')) {
|
|
17
17
|
logger.info('Installing chromium...')
|