pcu 1.1.7 → 1.1.9
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/dist/index.js +44 -517
- package/dist/index.js.map +1 -1
- package/package.json +19 -17
- package/src/cli/commandRegistrar.ts +2 -2
- package/src/cli/index.ts +9 -28
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pcu",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "CLI application for pnpm-catalog-updates",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,22 +32,24 @@
|
|
|
32
32
|
"clean": "rimraf dist bin/*.js"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@clack/prompts": "
|
|
36
|
-
"@inquirer/core": "
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
35
|
+
"@clack/prompts": "catalog:",
|
|
36
|
+
"@inquirer/core": "catalog:",
|
|
37
|
+
"@pcu/core": "workspace:*",
|
|
38
|
+
"@pcu/utils": "workspace:*",
|
|
39
|
+
"boxen": "catalog:",
|
|
40
|
+
"chalk": "catalog:",
|
|
41
|
+
"cli-table3": "catalog:",
|
|
42
|
+
"commander": "catalog:",
|
|
43
|
+
"fs-extra": "catalog:",
|
|
44
|
+
"glob": "catalog:",
|
|
45
|
+
"inquirer": "catalog:",
|
|
46
|
+
"lodash": "catalog:",
|
|
47
|
+
"npm-registry-fetch": "catalog:",
|
|
48
|
+
"ora": "catalog:",
|
|
49
|
+
"pacote": "catalog:",
|
|
50
|
+
"rxjs": "catalog:",
|
|
51
|
+
"semver": "catalog:",
|
|
52
|
+
"yaml": "catalog:"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
55
|
"@types/inquirer": "catalog:",
|
|
@@ -764,7 +764,7 @@ ${t('cli.help.tipLabel')} ${t('cli.help.tipContent', { locale: I18n.getLocale()
|
|
|
764
764
|
cliOutput.print(chalk.gray(t('command.selfUpdate.restartHint')))
|
|
765
765
|
} else {
|
|
766
766
|
cliOutput.error(chalk.red(t('command.selfUpdate.failed')))
|
|
767
|
-
cliOutput.print(chalk.gray(
|
|
767
|
+
cliOutput.print(chalk.gray('You can manually update with: npm install -g pcu@latest'))
|
|
768
768
|
exitProcess(1)
|
|
769
769
|
}
|
|
770
770
|
} catch (error) {
|
|
@@ -772,7 +772,7 @@ ${t('cli.help.tipLabel')} ${t('cli.help.tipContent', { locale: I18n.getLocale()
|
|
|
772
772
|
if (globalOptions.verbose) {
|
|
773
773
|
cliOutput.error(error)
|
|
774
774
|
}
|
|
775
|
-
cliOutput.print(chalk.gray(
|
|
775
|
+
cliOutput.print(chalk.gray('You can manually update with: npm install -g pcu@latest'))
|
|
776
776
|
exitProcess(1)
|
|
777
777
|
}
|
|
778
778
|
}
|
package/src/cli/index.ts
CHANGED
|
@@ -118,54 +118,35 @@ async function handleVersionFlag(
|
|
|
118
118
|
): Promise<void> {
|
|
119
119
|
if (!args.includes('--version')) return
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
const version = pkg.version
|
|
121
|
+
cliOutput.print(getPackageJson().version)
|
|
123
122
|
|
|
124
123
|
// Check for updates if not in CI and enabled in config
|
|
125
124
|
if (VersionChecker.shouldCheckForUpdates() && config.advanced?.checkForUpdates !== false) {
|
|
126
125
|
try {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
`${chalk.cyan('pcu')} ${chalk.bold(`v${version}`)} ${chalk.gray(t('cli.checkingUpdates'))}`
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
const versionResult = await VersionChecker.checkVersion(version, {
|
|
126
|
+
cliOutput.print(chalk.gray(t('cli.checkingUpdates')))
|
|
127
|
+
const versionResult = await VersionChecker.checkVersion(getPackageJson().version, {
|
|
133
128
|
skipPrompt: false,
|
|
134
|
-
timeout: 5000,
|
|
129
|
+
timeout: 5000, // Longer timeout for explicit version check
|
|
135
130
|
})
|
|
136
131
|
|
|
137
|
-
|
|
138
|
-
process.stdout.write('\r\x1b[K') // Clear current line
|
|
139
|
-
|
|
140
|
-
if (versionResult.shouldPrompt && versionResult.latestVersion) {
|
|
141
|
-
cliOutput.print(
|
|
142
|
-
`${chalk.cyan('pcu')} ${chalk.bold(`v${version}`)} ${chalk.yellow(`-> v${versionResult.latestVersion} ${t('cli.available')}`)}`
|
|
143
|
-
)
|
|
132
|
+
if (versionResult.shouldPrompt) {
|
|
144
133
|
const didUpdate = await VersionChecker.promptAndUpdate(versionResult)
|
|
145
134
|
if (didUpdate) {
|
|
146
135
|
cliOutput.print(chalk.blue(t('cli.runAgain')))
|
|
147
136
|
exitWithCleanup(0)
|
|
148
137
|
}
|
|
149
|
-
} else {
|
|
150
|
-
cliOutput.print(
|
|
151
|
-
`${chalk.cyan('pcu')} ${chalk.bold(`v${version}`)} ${chalk.green(t('cli.latestVersion'))}`
|
|
152
|
-
)
|
|
138
|
+
} else if (versionResult.isLatest) {
|
|
139
|
+
cliOutput.print(chalk.green(t('cli.latestVersion')))
|
|
153
140
|
}
|
|
154
141
|
} catch (error) {
|
|
155
|
-
//
|
|
156
|
-
process.stdout.write('\r\x1b[K')
|
|
157
|
-
cliOutput.print(`${chalk.cyan('pcu')} ${chalk.bold(`v${version}`)}`)
|
|
158
|
-
|
|
142
|
+
// Silently fail update check for version command
|
|
159
143
|
logger.debug('Version flag update check failed', {
|
|
160
144
|
error: error instanceof Error ? error.message : error,
|
|
161
145
|
})
|
|
162
146
|
if (args.includes('-v') || args.includes('--verbose')) {
|
|
163
|
-
cliOutput.warn(chalk.yellow(
|
|
147
|
+
cliOutput.warn(chalk.yellow(`⚠️ ${t('cli.couldNotCheckUpdates')}`), error)
|
|
164
148
|
}
|
|
165
149
|
}
|
|
166
|
-
} else {
|
|
167
|
-
// No update check, just show version
|
|
168
|
-
cliOutput.print(`${chalk.cyan('pcu')} ${chalk.bold(`v${version}`)}`)
|
|
169
150
|
}
|
|
170
151
|
|
|
171
152
|
exitWithCleanup(0)
|