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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pcu",
3
- "version": "1.1.7",
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": "^0.11.0",
36
- "@inquirer/core": "^10.3.2",
37
- "boxen": "^8.0.1",
38
- "chalk": "^5.6.2",
39
- "cli-table3": "^0.6.5",
40
- "commander": "^14.0.2",
41
- "fs-extra": "^11.3.3",
42
- "glob": "^11.1.0",
43
- "inquirer": "^12.11.1",
44
- "lodash": "^4.17.21",
45
- "npm-registry-fetch": "^18.0.2",
46
- "ora": "^8.2.0",
47
- "pacote": "^21.0.4",
48
- "rxjs": "^7.8.2",
49
- "semver": "^7.7.3",
50
- "yaml": "^2.8.2"
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(t('command.selfUpdate.manualHint')))
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(t('command.selfUpdate.manualHint')))
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
- const pkg = getPackageJson()
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
- // Show version with checking status on same line
128
- process.stdout.write(
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
- // Clear the checking message and show final result
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
- // Clear line and show version without update status
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(` ${t('cli.couldNotCheckUpdates')}`), error)
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)