piclist 1.3.9 → 1.6.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.
Files changed (56) hide show
  1. package/bin/{picgo.js → picgo} +4 -7
  2. package/bin/{picgo-server.js → picgo-server} +12 -13
  3. package/dist/core/Lifecycle.d.ts +1 -1
  4. package/dist/core/PicGo.d.ts +5 -5
  5. package/dist/i18n/en.d.ts +1 -1
  6. package/dist/i18n/index.d.ts +4 -3
  7. package/dist/i18n/zh-TW.d.ts +1 -1
  8. package/dist/index.cjs.js +2 -0
  9. package/dist/index.d.ts +10 -10
  10. package/dist/index.esm.js +2 -2
  11. package/dist/lib/Commander.d.ts +1 -1
  12. package/dist/lib/LifecyclePlugins.d.ts +1 -1
  13. package/dist/lib/Logger.d.ts +1 -1
  14. package/dist/lib/PluginHandler.d.ts +1 -1
  15. package/dist/lib/PluginLoader.d.ts +1 -1
  16. package/dist/lib/Request.d.ts +1 -1
  17. package/dist/plugins/beforetransformer/compress.d.ts +1 -1
  18. package/dist/plugins/beforetransformer/watermark.d.ts +1 -1
  19. package/dist/plugins/beforeupload/buildInRename.d.ts +1 -1
  20. package/dist/plugins/commander/config.d.ts +1 -1
  21. package/dist/plugins/commander/i18n.d.ts +1 -1
  22. package/dist/plugins/commander/index.d.ts +1 -1
  23. package/dist/plugins/commander/init.d.ts +1 -1
  24. package/dist/plugins/commander/pluginHandler.d.ts +1 -1
  25. package/dist/plugins/commander/proxy.d.ts +1 -1
  26. package/dist/plugins/commander/setting.d.ts +1 -1
  27. package/dist/plugins/commander/upload.d.ts +1 -1
  28. package/dist/plugins/commander/use.d.ts +1 -1
  29. package/dist/plugins/transformer/base64.d.ts +1 -1
  30. package/dist/plugins/transformer/index.d.ts +1 -1
  31. package/dist/plugins/transformer/path.d.ts +1 -1
  32. package/dist/plugins/uploader/aliyun.d.ts +1 -1
  33. package/dist/plugins/uploader/github.d.ts +1 -1
  34. package/dist/plugins/uploader/imgur.d.ts +1 -1
  35. package/dist/plugins/uploader/index.d.ts +1 -1
  36. package/dist/plugins/uploader/local.d.ts +1 -1
  37. package/dist/plugins/uploader/piclist.d.ts +1 -1
  38. package/dist/plugins/uploader/qiniu.d.ts +1 -1
  39. package/dist/plugins/uploader/sftp.d.ts +1 -1
  40. package/dist/plugins/uploader/smms.d.ts +1 -1
  41. package/dist/plugins/uploader/tcyun.d.ts +1 -1
  42. package/dist/plugins/uploader/telegraph.d.ts +1 -1
  43. package/dist/plugins/uploader/upyun.d.ts +1 -1
  44. package/dist/plugins/uploader/webdav.d.ts +1 -1
  45. package/dist/types/index.d.ts +1 -1
  46. package/dist/utils/common.d.ts +1 -1
  47. package/dist/utils/createContext.d.ts +1 -1
  48. package/dist/utils/db.d.ts +2 -2
  49. package/dist/utils/getClipboardImage.d.ts +1 -1
  50. package/dist/utils/initUtils.d.ts +1 -1
  51. package/dist/utils/interfaces.d.ts +3 -3
  52. package/dist/utils/sshClient.d.ts +1 -1
  53. package/package.json +9 -10
  54. package/rollup.config.js +19 -3
  55. package/dist/dirname.d.ts +0 -1
  56. /package/{.eslintrc.cjs → .eslintrc.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { Command } from 'commander';
2
2
  import { type Inquirer } from 'inquirer';
3
- import { type IPlugin, type ICommander, type IPicGo } from '../types/index.js';
3
+ import { type IPlugin, type ICommander, type IPicGo } from '../types';
4
4
  export declare class Commander implements ICommander {
5
5
  private readonly name;
6
6
  static currentPlugin: string | null;
@@ -1,4 +1,4 @@
1
- import { type IPlugin, type ILifecyclePlugins } from '../types/index.js';
1
+ import { type IPlugin, type ILifecyclePlugins } from '../types';
2
2
  export declare class LifecyclePlugins implements ILifecyclePlugins {
3
3
  static currentPlugin: string | null;
4
4
  private readonly list;
@@ -1,4 +1,4 @@
1
- import { type ILogArgvType, type ILogArgvTypeWithError, type ILogger, type IPicGo } from '../types/index.js';
1
+ import { type ILogArgvType, type ILogArgvTypeWithError, type ILogger, type IPicGo } from '../types';
2
2
  export declare class Logger implements ILogger {
3
3
  private readonly level;
4
4
  private readonly ctx;
@@ -1,4 +1,4 @@
1
- import { type IProcessEnv, type IPluginHandler, type IPluginHandlerOptions, type IPicGo, type IPluginHandlerResult } from '../types/index.js';
1
+ import { type IProcessEnv, type IPluginHandler, type IPluginHandlerOptions, type IPicGo, type IPluginHandlerResult } from '../types';
2
2
  export declare class PluginHandler implements IPluginHandler {
3
3
  private readonly ctx;
4
4
  constructor(ctx: IPicGo);
@@ -1,4 +1,4 @@
1
- import { type IPicGo, type IPicGoPlugin, type IPluginLoader, type IPicGoPluginInterface } from '../types/index.js';
1
+ import { type IPicGo, type IPicGoPlugin, type IPluginLoader, type IPicGoPluginInterface } from '../types/index';
2
2
  /**
3
3
  * Local plugin loader, file system is required
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { type AxiosRequestConfig } from 'axios';
2
- import { type IPicGo, type IRequestConfig, type IOldReqOptions, type IResponse, type IRequest } from '../types/index.js';
2
+ import { type IPicGo, type IRequestConfig, type IOldReqOptions, type IResponse, type IRequest } from '../types';
3
3
  export declare class Request implements IRequest {
4
4
  private readonly ctx;
5
5
  private proxy;
@@ -1,4 +1,4 @@
1
- import { type IPicGo, type IPluginConfig } from '../../types/index.js';
1
+ import { type IPicGo, type IPluginConfig } from '../../types';
2
2
  declare const _default: {
3
3
  config: (ctx: IPicGo) => IPluginConfig[];
4
4
  };
@@ -1,4 +1,4 @@
1
- import { type IPicGo, type IPluginConfig } from '../../types/index.js';
1
+ import { type IPicGo, type IPluginConfig } from '../../types';
2
2
  declare const _default: {
3
3
  config: (ctx: IPicGo) => IPluginConfig[];
4
4
  };
@@ -1,4 +1,4 @@
1
- import { type IPicGo, type IPluginConfig } from '../../types/index.js';
1
+ import { type IPicGo, type IPluginConfig } from '../../types';
2
2
  declare const _default: {
3
3
  config: (ctx: IPicGo) => IPluginConfig[];
4
4
  };
@@ -1,3 +1,3 @@
1
- import { type IPlugin } from '../../types/index.js';
1
+ import { type IPlugin } from '../../types';
2
2
  declare const config: IPlugin;
3
3
  export default config;
@@ -1,3 +1,3 @@
1
- import { type IPlugin } from '../../types/index.js';
1
+ import { type IPlugin } from '../../types';
2
2
  declare const i18n: IPlugin;
3
3
  export default i18n;
@@ -1,3 +1,3 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  declare const _default: (ctx: IPicGo) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import { type IPlugin } from '../../types/index.js';
1
+ import { type IPlugin } from '../../types';
2
2
  declare const init: IPlugin;
3
3
  export default init;
@@ -1,3 +1,3 @@
1
- import { type IPlugin } from '../../types/index.js';
1
+ import { type IPlugin } from '../../types';
2
2
  declare const pluginHandler: IPlugin;
3
3
  export default pluginHandler;
@@ -1,3 +1,3 @@
1
- import { type IPlugin } from '../../types/index.js';
1
+ import { type IPlugin } from '../../types';
2
2
  declare const proxy: IPlugin;
3
3
  export default proxy;
@@ -1,4 +1,4 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  declare const setting: {
3
3
  handle: (ctx: IPicGo) => void;
4
4
  };
@@ -1,3 +1,3 @@
1
- import { type IPlugin } from '../../types/index.js';
1
+ import { type IPlugin } from '../../types';
2
2
  declare const upload: IPlugin;
3
3
  export default upload;
@@ -1,3 +1,3 @@
1
- import { type IPlugin } from '../../types/index.js';
1
+ import { type IPlugin } from '../../types';
2
2
  declare const use: IPlugin;
3
3
  export default use;
@@ -1,4 +1,4 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  declare const _default: {
3
3
  handle: (ctx: IPicGo) => Promise<IPicGo>;
4
4
  };
@@ -1,3 +1,3 @@
1
- import { type IPicGoPlugin } from '../../types/index.js';
1
+ import { type IPicGoPlugin } from '../../types';
2
2
  declare const buildInTransformers: IPicGoPlugin;
3
3
  export default buildInTransformers;
@@ -1,4 +1,4 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  declare const _default: {
3
3
  handle: (ctx: IPicGo) => Promise<IPicGo>;
4
4
  };
@@ -1,2 +1,2 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -1,3 +1,3 @@
1
- import { type IPicGoPlugin } from '../../types/index.js';
1
+ import { type IPicGoPlugin } from '../../types';
2
2
  declare const buildInUploaders: IPicGoPlugin;
3
3
  export default buildInUploaders;
@@ -1,2 +1,2 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import type { IPicGo } from '../../types/index.js';
1
+ import type { IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -1,4 +1,4 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export interface ISignature {
3
3
  signature: string;
4
4
  appId: string;
@@ -1,2 +1,2 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -1,2 +1,2 @@
1
- import { type IPicGo } from '../../types/index.js';
1
+ import { type IPicGo } from '../../types';
2
2
  export default function register(ctx: IPicGo): void;
@@ -3,7 +3,7 @@
3
3
  import { type Command } from 'commander';
4
4
  import { type Inquirer } from 'inquirer';
5
5
  import { type FormatEnum, type GravityEnum } from 'sharp';
6
- import { type IRequestPromiseOptions } from './oldRequest.js';
6
+ import { type IRequestPromiseOptions } from './oldRequest';
7
7
  export interface IPicGo extends NodeJS.EventEmitter {
8
8
  /**
9
9
  * picgo configPath
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import { type IImgSize, type IPathTransformedImgInfo, type IPluginNameType, type ILogger, type IPicGo, type IBuildInCompressOptions, type IBuildInWaterMarkOptions } from '../types/index.js';
3
+ import { type IImgSize, type IPathTransformedImgInfo, type IPluginNameType, type ILogger, type IPicGo, type IBuildInCompressOptions, type IBuildInWaterMarkOptions } from '../types';
4
4
  import sharp from 'sharp';
5
5
  export declare function randomStringGenerator(length: number): string;
6
6
  export declare function renameFileNameWithTimestamp(oldName: string): string;
@@ -1,4 +1,4 @@
1
- import { type IPicGo } from '../types/index.js';
1
+ import { type IPicGo } from '../types';
2
2
  /**
3
3
  * create an unique context for each upload process
4
4
  * @param ctx
@@ -1,5 +1,5 @@
1
- import { type IConfig, type IPicGo } from '../types/index.js';
2
- import { type IJSON } from '@picgo/store/dist/types/index.js';
1
+ import { type IConfig, type IPicGo } from '../types';
2
+ import { type IJSON } from '@picgo/store/dist/types';
3
3
  declare class DB {
4
4
  private readonly ctx;
5
5
  private readonly db;
@@ -1,4 +1,4 @@
1
- import { type IPicGo, type IClipboardImage } from '../types/index.js';
1
+ import { type IPicGo, type IClipboardImage } from '../types';
2
2
  export type Platform = 'darwin' | 'win32' | 'win10' | 'linux' | 'wsl';
3
3
  declare const getClipboardImage: (ctx: IPicGo) => Promise<IClipboardImage>;
4
4
  export default getClipboardImage;
@@ -1,4 +1,4 @@
1
- import { type IPicGo, type IOptions } from '../types/index.js';
1
+ import { type IPicGo, type IOptions } from '../types';
2
2
  /**
3
3
  * Generate template files to destination files.
4
4
  * @param {PicGo} ctx
@@ -1,8 +1,8 @@
1
1
  /** This file is deprecated */
2
2
  /// <reference types="node" />
3
- import { type PicGo } from '../core/PicGo.js';
4
- import type LifecyclePlugins from '../lib/LifecyclePlugins.js';
5
- import { type IWebdavPlistConfig } from '../types/index.js';
3
+ import { type PicGo } from '../core/PicGo';
4
+ import type LifecyclePlugins from '../lib/LifecyclePlugins';
5
+ import { type IWebdavPlistConfig } from '../types';
6
6
  /**
7
7
  * for plugin config
8
8
  */
@@ -1,5 +1,5 @@
1
1
  import { NodeSSH } from 'node-ssh-no-cpu-features';
2
- import { type ISftpPlistConfig } from '../types/index.js';
2
+ import { type ISftpPlistConfig } from '../types';
3
3
  declare class SSHClient {
4
4
  private static _instance;
5
5
  private static _client;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piclist",
3
- "version": "1.3.9",
3
+ "version": "1.6.1",
4
4
  "description": "Modified PicGo core, A tool for picture uploading",
5
5
  "author": {
6
6
  "name": "Kuingsmile",
@@ -11,13 +11,12 @@
11
11
  "url": "https://github.com/Kuingsmile/PicList/issues",
12
12
  "email": "pkukuing@gmail.com"
13
13
  },
14
- "type":"module",
15
- "main": "dist/index.esm.js",
14
+ "main": "dist/index.cjs.js",
16
15
  "module": "dist/index.esm.js",
17
16
  "typings": "dist/index.d.ts",
18
17
  "bin": {
19
- "picgo": "./bin/picgo.js",
20
- "picgo-server": "./bin/picgo-server.js"
18
+ "picgo": "./bin/picgo",
19
+ "picgo-server": "./bin/picgo-server"
21
20
  },
22
21
  "publishConfig": {
23
22
  "access": "public"
@@ -47,17 +46,16 @@
47
46
  "path": "./node_modules/cz-customizable"
48
47
  },
49
48
  "cz-customizable": {
50
- "config": "./node_modules/@picgo/bump-version/.cz-config.js"
49
+ "config": "./node_modules/node-bump-version/.cz-config.js"
51
50
  }
52
51
  },
53
52
  "commitlint": {
54
53
  "extends": [
55
- "./node_modules/@picgo/bump-version/commitlint-picgo"
54
+ "./node_modules/node-bump-version/commitlint-node"
56
55
  ]
57
56
  },
58
57
  "license": "MIT",
59
58
  "devDependencies": {
60
- "@picgo/bump-version": "^1.1.2",
61
59
  "@rollup/plugin-commonjs": "^25.0.4",
62
60
  "@rollup/plugin-json": "^6.0.0",
63
61
  "@rollup/plugin-node-resolve": "^15.2.1",
@@ -93,6 +91,7 @@
93
91
  "eslint-plugin-promise": "^6.1.1",
94
92
  "eslint-plugin-standard": "^5.0.0",
95
93
  "husky": "^1.3.1",
94
+ "node-bump-version": "^1.0.0",
96
95
  "pre-commit": "^1.2.2",
97
96
  "rollup": "^2.79.1",
98
97
  "rollup-plugin-copy": "^3.5.0",
@@ -131,8 +130,8 @@
131
130
  "sharp": "^0.32.1",
132
131
  "text-to-svg": "^3.1.5",
133
132
  "tunnel": "^0.0.6",
134
- "uuid": "^9.0.1",
135
- "webdav": "^5.3.0"
133
+ "uuid": "^9.0.0",
134
+ "webdav": "^4.11.2"
136
135
  },
137
136
  "repository": {
138
137
  "type": "git",
package/rollup.config.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { terser } from 'rollup-plugin-terser'
2
2
  import pkg from './package.json'
3
3
  import typescript from 'rollup-plugin-typescript2'
4
+ import commonjs from '@rollup/plugin-commonjs'
4
5
  import copy from 'rollup-plugin-copy'
5
6
  import { string } from 'rollup-plugin-string'
6
7
  import json from '@rollup/plugin-json'
@@ -27,8 +28,8 @@ const commonOptions = {
27
28
  typescript({
28
29
  tsconfigOverride: {
29
30
  compilerOptions: {
30
- target: 'es2019',
31
- module: 'esnext'
31
+ target: 'ES2017',
32
+ module: 'ES2015'
32
33
  }
33
34
  }
34
35
  }),
@@ -38,6 +39,7 @@ const commonOptions = {
38
39
  ]
39
40
  }),
40
41
  // terser(),
42
+ commonjs(),
41
43
  string({
42
44
  // Required to be specified
43
45
  include: [
@@ -61,6 +63,17 @@ if (!isDev) {
61
63
  commonOptions.plugins.push(terser())
62
64
  }
63
65
 
66
+ /** @type import('rollup').RollupOptions */
67
+ const nodeCjs = {
68
+ output: [{
69
+ file: 'dist/index.cjs.js',
70
+ format: 'cjs',
71
+ banner,
72
+ sourcemap
73
+ }],
74
+ ...commonOptions
75
+ }
76
+
64
77
  const nodeEsm = {
65
78
  output: [{
66
79
  file: 'dist/index.esm.js',
@@ -72,6 +85,9 @@ const nodeEsm = {
72
85
  }
73
86
 
74
87
  const bundles = []
75
- bundles.push(nodeEsm)
88
+ const env = process.env.BUNDLES || ''
89
+ if (env.includes('cjs')) bundles.push(nodeCjs)
90
+ if (env.includes('esm')) bundles.push(nodeEsm)
91
+ if (bundles.length === 0) bundles.push(nodeCjs, nodeEsm)
76
92
 
77
93
  export default bundles
package/dist/dirname.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const projectRoot: string;
File without changes