piclist 2.4.0 → 2.4.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.
@@ -1,6 +1,6 @@
1
1
  import { Command } from 'commander';
2
- import { Inquirer } from 'inquirer';
3
2
  import { ICommander, IPicGo, IPlugin } from '../types';
3
+ import { IInquirerAdapter } from '../utils/inquirerShim';
4
4
  export declare class Commander implements ICommander {
5
5
  private readonly name;
6
6
  static currentPlugin: string | null;
@@ -8,7 +8,7 @@ export declare class Commander implements ICommander {
8
8
  private readonly pluginIdMap;
9
9
  private readonly ctx;
10
10
  program: Command;
11
- inquirer: Inquirer;
11
+ inquirer: IInquirerAdapter;
12
12
  constructor(ctx: IPicGo);
13
13
  getName(): string;
14
14
  init(): void;
@@ -2,6 +2,7 @@ import { IPicGo, IPluginHandler, IPluginHandlerOptions, IPluginHandlerResult, IP
2
2
  export declare class PluginHandler implements IPluginHandler {
3
3
  private readonly ctx;
4
4
  constructor(ctx: IPicGo);
5
+ getList(): Promise<string[]>;
5
6
  install(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
6
7
  uninstall(plugins: string[]): Promise<IPluginHandlerResult<boolean>>;
7
8
  update(plugins: string[], options?: IPluginHandlerOptions, env?: IProcessEnv): Promise<IPluginHandlerResult<boolean>>;
@@ -1,7 +1,7 @@
1
1
  import { Command } from 'commander';
2
- import { Inquirer } from 'inquirer';
3
2
  import { FormatEnum, GravityEnum } from 'sharp';
4
3
  import type { ConfigManager } from '../utils/configManager';
4
+ import type { IInquirerAdapter } from '../utils/inquirerShim';
5
5
  import { IRequestPromiseOptions } from './oldRequest';
6
6
  export interface IPicGo extends NodeJS.EventEmitter {
7
7
  configPath: string;
@@ -61,7 +61,7 @@ export interface IHelper {
61
61
  }
62
62
  export interface ICommander extends ILifecyclePlugins {
63
63
  program: Command;
64
- inquirer: Inquirer;
64
+ inquirer: IInquirerAdapter;
65
65
  }
66
66
  export interface IPluginLoader {
67
67
  registerPlugin: (name: string, plugin?: IPicGoPlugin) => Promise<void>;
@@ -427,6 +427,7 @@ export interface IPluginProcessResult {
427
427
  fullName: string;
428
428
  }
429
429
  export interface IPluginHandler {
430
+ getList: () => Promise<string[]>;
430
431
  install: (plugins: string[], options: IPluginHandlerOptions, env?: IProcessEnv) => Promise<IPluginHandlerResult<boolean>>;
431
432
  update: (plugins: string[], options: IPluginHandlerOptions, env?: IProcessEnv) => Promise<IPluginHandlerResult<boolean>>;
432
433
  uninstall: (plugins: string[]) => Promise<IPluginHandlerResult<boolean>>;
@@ -0,0 +1,23 @@
1
+ export interface IInquirerQuestion {
2
+ type: string;
3
+ name: string;
4
+ message?: string;
5
+ choices?: ({
6
+ name: string;
7
+ value: any;
8
+ } | string)[];
9
+ default?: any;
10
+ validate?: (val: any) => boolean | string | Promise<boolean | string>;
11
+ when?: boolean | ((answers: Record<string, any>) => boolean | Promise<boolean>);
12
+ filter?: (val: any) => any;
13
+ transformer?: (val: any) => string;
14
+ [key: string]: any;
15
+ }
16
+ export interface IInquirerAdapter {
17
+ prompt<T = Record<string, any>>(questions: IInquirerQuestion[]): Promise<T>;
18
+ }
19
+ /**
20
+ * Creates an adapter whose `.prompt()` method mirrors the legacy
21
+ * `inquirer.prompt(questions)` API.
22
+ */
23
+ export declare function createInquirerAdapter(): IInquirerAdapter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piclist",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "Modified PicGo core, A tool for picture uploading",
5
5
  "keywords": [
6
6
  "picture",
@@ -64,12 +64,13 @@
64
64
  "@aws-sdk/client-s3": "3.1042.0",
65
65
  "@aws-sdk/lib-storage": "3.1042.0",
66
66
  "@aws-sdk/s3-request-presigner": "3.1042.0",
67
+ "@inquirer/prompts": "^8.4.2",
67
68
  "@piclist/i18n": "^2.0.0",
68
69
  "@piclist/store": "^3.0.1",
69
70
  "@smithy/node-http-handler": "4.6.1",
70
71
  "axios": "^1.16.0",
71
72
  "chalk": "^5.6.2",
72
- "commander": "^8.1.0",
73
+ "commander": "^14.0.3",
73
74
  "cross-spawn": "^7.0.6",
74
75
  "dayjs": "^1.11.20",
75
76
  "dotenv": "^17.4.2",
@@ -79,7 +80,6 @@
79
80
  "heic-convert": "^2.1.0",
80
81
  "hpagent": "1.2.0",
81
82
  "image-size": "^2.0.2",
82
- "inquirer": "^6.0.0",
83
83
  "is-wsl": "^3.1.0",
84
84
  "js-yaml": "^4.1.1",
85
85
  "lodash-es": "^4.18.1",
@@ -92,7 +92,7 @@
92
92
  "sharp": "0.34.4",
93
93
  "text-to-svg": "^3.1.5",
94
94
  "tunnel": "^0.0.6",
95
- "uuid": "^13.0.0",
95
+ "uuid": "^14.0.0",
96
96
  "webdav": "^5.10.0"
97
97
  },
98
98
  "devDependencies": {
@@ -106,7 +106,6 @@
106
106
  "@types/cross-spawn": "^6.0.6",
107
107
  "@types/fs-extra": "^11.0.4",
108
108
  "@types/heic-convert": "^2.1.0",
109
- "@types/inquirer": "^0.0.42",
110
109
  "@types/js-yaml": "^4.0.9",
111
110
  "@types/lodash-es": "^4.17.12",
112
111
  "@types/node": "25.5.0",