piclist 1.9.14 → 2.0.0

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 (80) hide show
  1. package/.github/workflows/docker.yml +5 -5
  2. package/CHANGELOG.md +13 -0
  3. package/License +22 -22
  4. package/README.md +1 -1
  5. package/README_cn.md +1 -1
  6. package/bin/picgo +9 -7
  7. package/bin/picgo-server +180 -161
  8. package/dist/core/Lifecycle.d.ts +35 -36
  9. package/dist/core/PicGo.d.ts +52 -52
  10. package/dist/i18n/en.d.ts +2 -2
  11. package/dist/i18n/index.d.ts +19 -17
  12. package/dist/i18n/zh-CN.d.ts +293 -289
  13. package/dist/i18n/zh-TW.d.ts +2 -2
  14. package/dist/index.d.ts +10 -10
  15. package/dist/index.js +2 -0
  16. package/dist/lib/Commander.d.ts +22 -22
  17. package/dist/lib/LifecyclePlugins.d.ts +26 -26
  18. package/dist/lib/Logger.d.ts +19 -19
  19. package/dist/lib/PluginHandler.d.ts +10 -10
  20. package/dist/lib/PluginLoader.d.ts +27 -27
  21. package/dist/lib/Request.d.ts +12 -12
  22. package/dist/plugins/beforetransformer/compress.d.ts +5 -5
  23. package/dist/plugins/beforetransformer/skipProcess.d.ts +5 -5
  24. package/dist/plugins/beforetransformer/watermark.d.ts +5 -5
  25. package/dist/plugins/beforeupload/buildInRename.d.ts +5 -5
  26. package/dist/plugins/commander/config.d.ts +3 -3
  27. package/dist/plugins/commander/i18n.d.ts +3 -3
  28. package/dist/plugins/commander/index.d.ts +3 -3
  29. package/dist/plugins/commander/pluginHandler.d.ts +3 -3
  30. package/dist/plugins/commander/proxy.d.ts +3 -3
  31. package/dist/plugins/commander/setting.d.ts +5 -5
  32. package/dist/plugins/commander/upload.d.ts +3 -3
  33. package/dist/plugins/commander/use.d.ts +3 -3
  34. package/dist/plugins/commander/utils.d.ts +2 -2
  35. package/dist/plugins/transformer/base64.d.ts +5 -5
  36. package/dist/plugins/transformer/index.d.ts +5 -5
  37. package/dist/plugins/transformer/path.d.ts +5 -5
  38. package/dist/plugins/uploader/advancedplist.d.ts +2 -2
  39. package/dist/plugins/uploader/alist.d.ts +2 -2
  40. package/dist/plugins/uploader/aliyun.d.ts +2 -2
  41. package/dist/plugins/uploader/awss3plist.d.ts +2 -2
  42. package/dist/plugins/uploader/github.d.ts +2 -2
  43. package/dist/plugins/uploader/imgur.d.ts +2 -2
  44. package/dist/plugins/uploader/index.d.ts +5 -5
  45. package/dist/plugins/uploader/local.d.ts +2 -2
  46. package/dist/plugins/uploader/lsky.d.ts +20 -21
  47. package/dist/plugins/uploader/piclist.d.ts +2 -2
  48. package/dist/plugins/uploader/qiniu.d.ts +2 -2
  49. package/dist/plugins/uploader/s3/uploader.d.ts +25 -24
  50. package/dist/plugins/uploader/s3/utils.d.ts +9 -10
  51. package/dist/plugins/uploader/sftp.d.ts +2 -2
  52. package/dist/plugins/uploader/smms.d.ts +2 -2
  53. package/dist/plugins/uploader/tcyun.d.ts +8 -8
  54. package/dist/plugins/uploader/upyun.d.ts +2 -2
  55. package/dist/plugins/uploader/utils.d.ts +26 -26
  56. package/dist/plugins/uploader/webdav.d.ts +2 -2
  57. package/dist/types/index.d.ts +572 -693
  58. package/dist/types/oldRequest.d.ts +15 -15
  59. package/dist/utils/common.d.ts +42 -119
  60. package/dist/utils/createContext.d.ts +6 -6
  61. package/dist/utils/db.d.ts +17 -15
  62. package/dist/utils/enum.d.ts +27 -27
  63. package/dist/utils/eventBus.d.ts +3 -4
  64. package/dist/utils/getClipboardImage.d.ts +4 -4
  65. package/dist/utils/sshClient.d.ts +16 -16
  66. package/dist/utils/static.d.ts +1 -1
  67. package/docker-compose.yaml +11 -11
  68. package/eslint.config.js +104 -0
  69. package/package.json +62 -78
  70. package/rollup.config.js +25 -42
  71. package/.eslintignore +0 -6
  72. package/.eslintrc.js +0 -50
  73. package/.github/workflows/alpha.yml +0 -22
  74. package/.github/workflows/main.yml +0 -22
  75. package/.github/workflows/manually.yml +0 -19
  76. package/dist/index.cjs.js +0 -2
  77. package/dist/index.esm.js +0 -2
  78. package/dist/plugins/commander/init.d.ts +0 -3
  79. package/dist/utils/initUtils.d.ts +0 -26
  80. package/dist/utils/interfaces.d.ts +0 -201
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piclist",
3
- "version": "1.9.14",
3
+ "version": "2.0.0",
4
4
  "description": "Modified PicGo core, A tool for picture uploading",
5
5
  "author": {
6
6
  "name": "Kuingsmile",
@@ -11,8 +11,9 @@
11
11
  "url": "https://github.com/Kuingsmile/PicList-core/issues",
12
12
  "email": "pkukuing@gmail.com"
13
13
  },
14
- "main": "dist/index.cjs.js",
15
- "module": "dist/index.esm.js",
14
+ "type": "module",
15
+ "main": "dist/index.js",
16
+ "module": "dist/index.js",
16
17
  "typings": "dist/index.d.ts",
17
18
  "bin": {
18
19
  "picgo": "./bin/picgo",
@@ -24,7 +25,7 @@
24
25
  "scripts": {
25
26
  "start": "node ./bin/picgo",
26
27
  "server": "node ./bin/picgo-server",
27
- "lint": "eslint src/**/*.ts",
28
+ "lint": "eslint",
28
29
  "lint:fix": "eslint src/**/*.ts --fix",
29
30
  "lint:dpdm": "dpdm -T --tsconfig ./tsconfig.json --no-tree --no-warning --exit-code circular:1 src/index.ts",
30
31
  "dev": "cross-env NODE_ENV=development rollup -c rollup.config.js -w",
@@ -38,111 +39,94 @@
38
39
  "upload",
39
40
  "util"
40
41
  ],
41
- "husky": {
42
- "hooks": {
43
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
44
- }
45
- },
46
42
  "config": {
47
43
  "commitizen": {
48
44
  "path": "./node_modules/cz-customizable"
49
45
  },
50
46
  "cz-customizable": {
51
- "config": "./node_modules/node-bump-version/.cz-config.js"
47
+ "config": "./node_modules/node-bump-version/.cz-config.cjs"
52
48
  }
53
49
  },
54
50
  "commitlint": {
55
51
  "extends": [
56
- "./node_modules/node-bump-version/commitlint-node"
52
+ "./node_modules/node-bump-version/dist/commitlint-node/index.js"
57
53
  ]
58
54
  },
59
55
  "license": "MIT",
60
56
  "devDependencies": {
61
- "@rollup/plugin-commonjs": "^25.0.7",
62
- "@rollup/plugin-json": "^6.0.1",
63
- "@rollup/plugin-node-resolve": "^15.2.3",
64
- "@rollup/plugin-replace": "^5.0.5",
65
- "@types/cross-spawn": "^6.0.5",
66
- "@types/ejs": "^3.1.5",
57
+ "@eslint/compat": "^1.3.2",
58
+ "@eslint/eslintrc": "^3.3.1",
59
+ "@eslint/js": "^9.33.0",
60
+ "@rollup/plugin-commonjs": "^28.0.6",
61
+ "@rollup/plugin-json": "^6.1.0",
62
+ "@rollup/plugin-node-resolve": "^16.0.1",
63
+ "@rollup/plugin-replace": "^6.0.2",
64
+ "@rollup/plugin-terser": "^0.4.4",
65
+ "@rollup/plugin-typescript": "^12.1.4",
66
+ "@types/cross-spawn": "^6.0.6",
67
67
  "@types/fs-extra": "^11.0.4",
68
- "@types/heic-convert": "^1.2.3",
68
+ "@types/heic-convert": "^2.1.0",
69
69
  "@types/image-size": "^0.8.0",
70
70
  "@types/inquirer": "^0.0.42",
71
71
  "@types/js-yaml": "^4.0.9",
72
- "@types/lodash": "^4.14.201",
73
- "@types/mime": "^3.0.4",
74
- "@types/mime-types": "^2.1.3",
75
- "@types/minimatch": "^3.0.3",
76
- "@types/node": "16.11.7",
77
- "@types/resolve": "^0.0.8",
72
+ "@types/lodash-es": "^4.17.12",
73
+ "@types/mime-types": "^3.0.1",
74
+ "@types/node": "24.2.1",
75
+ "@types/resolve": "^1.20.6",
78
76
  "@types/text-to-svg": "^3.1.4",
79
- "@types/tunnel": "^0.0.6",
80
- "@types/uuid": "^9.0.7",
81
- "@typescript-eslint/eslint-plugin": "^6.21.0",
82
- "@typescript-eslint/parser": "^6.21.0",
83
- "babel-eslint": "^10.1.0",
84
- "builtins": "^4.0.0",
85
- "conventional-changelog": "^3.0.6",
86
- "cross-env": "^7.0.3",
87
- "cz-customizable": "^5.10.0",
77
+ "@types/tunnel": "^0.0.7",
78
+ "@typescript-eslint/eslint-plugin": "^8.39.0",
79
+ "@typescript-eslint/parser": "^8.39.0",
80
+ "cross-env": "^10.0.0",
88
81
  "dpdm": "^3.14.0",
89
- "eslint": "^8.57.0",
90
- "eslint-config-prettier": "^9.1.0",
91
- "eslint-import-resolver-typescript": "^3.6.1",
92
- "eslint-plugin-import": "^2.29.1",
93
- "eslint-plugin-n": "^16.3.1",
94
- "eslint-plugin-prettier": "^5.1.3",
95
- "eslint-plugin-promise": "^6.2.0",
96
- "husky": "^1.3.1",
97
- "node-bump-version": "^1.0.2",
98
- "pre-commit": "^1.2.2",
99
- "prettier": "^3.3.2",
100
- "rollup": "^2.79.1",
82
+ "eslint": "^9.33.0",
83
+ "eslint-config-prettier": "^10.1.8",
84
+ "eslint-plugin-prettier": "^5.5.4",
85
+ "eslint-plugin-simple-import-sort": "^12.1.1",
86
+ "eslint-plugin-unicorn": "^60.0.0",
87
+ "husky": "^9.1.7",
88
+ "node-bump-version": "^2.0.0",
89
+ "prettier": "^3.6.2",
90
+ "rollup": "^4.46.1",
101
91
  "rollup-plugin-copy": "^3.5.0",
102
92
  "rollup-plugin-string": "^3.0.0",
103
- "rollup-plugin-terser": "^7.0.2",
104
- "rollup-plugin-typescript2": "^0.35.0",
105
- "typescript": "^4.9.5"
93
+ "typescript": "^5.8.3",
94
+ "typescript-eslint": "^8.39.0",
95
+ "rimraf": "^6.0.1"
106
96
  },
107
97
  "dependencies": {
108
- "@aws-sdk/client-s3": "3.421.0",
109
- "@aws-sdk/lib-storage": "3.421.0",
110
- "@aws-sdk/s3-request-presigner": "3.421.0",
111
- "@picgo/i18n": "^1.0.0",
112
- "@picgo/store": "^2.1.0",
113
- "@smithy/node-http-handler": "2.1.6",
114
- "axios": "^1.9.0",
115
- "chalk": "^2.4.1",
98
+ "@aws-sdk/client-s3": "3.864.0",
99
+ "@aws-sdk/lib-storage": "3.864.0",
100
+ "@aws-sdk/s3-request-presigner": "3.864.0",
101
+ "@piclist/store": "^3.0.0",
102
+ "@piclist/i18n": "^2.0.0",
103
+ "@smithy/node-http-handler": "4.1.1",
104
+ "axios": "^1.11.0",
105
+ "chalk": "^5.4.1",
116
106
  "commander": "^8.1.0",
117
- "cross-spawn": "^7.0.3",
107
+ "cross-spawn": "^7.0.6",
118
108
  "dayjs": "^1.11.13",
119
- "download-git-repo": "^3.0.2",
120
- "ejs": "^2.6.1",
121
- "file-type": "16.2.0",
122
- "form-data": "^4.0.0",
123
- "fs-extra": "^11.3.0",
124
- "globby": "^11.1.0",
125
- "heic-convert": "^1.2.4",
109
+ "file-type": "21.0.0",
110
+ "form-data": "^4.0.4",
111
+ "fs-extra": "^11.3.1",
112
+ "heic-convert": "^2.1.0",
126
113
  "hpagent": "1.2.0",
127
- "image-size": "^1.0.2",
114
+ "image-size": "^2.0.2",
128
115
  "inquirer": "^6.0.0",
129
- "is-wsl": "^2.2.0",
116
+ "is-wsl": "^3.1.0",
130
117
  "js-yaml": "^4.1.0",
131
- "lodash": "^4.17.21",
132
- "mime": "2.5.2",
133
- "mime-types": "2.1.35",
134
- "minimatch": "^3.0.4",
118
+ "lodash-es": "^4.17.21",
119
+ "mime-types": "3.0.1",
135
120
  "minimist": "^1.2.8",
136
- "multer": "^1.4.5-lts.1",
121
+ "multer": "^2.0.2",
137
122
  "node-ssh-no-cpu-features": "^2.0.0",
138
- "qiniu": "7.9.0",
139
- "resolve": "^1.8.1",
140
- "rimraf": "^5.0.1",
141
- "sharp": "^0.32.1",
123
+ "qiniu": "7.14.0",
124
+ "resolve": "^1.22.10",
125
+ "sharp": "^0.34.3",
142
126
  "text-to-svg": "^3.1.5",
143
127
  "tunnel": "^0.0.6",
144
- "uuid": "^9.0.1",
145
- "webdav": "^4.11.2"
128
+ "uuid": "^11.1.0",
129
+ "webdav": "^5.8.0"
146
130
  },
147
131
  "repository": {
148
132
  "type": "git",
@@ -153,6 +137,6 @@
153
137
  },
154
138
  "plugins": {},
155
139
  "engines": {
156
- "node": ">= 16.0.0"
140
+ "node": ">=20.0.0"
157
141
  }
158
142
  }
package/rollup.config.js CHANGED
@@ -1,12 +1,15 @@
1
- import { terser } from 'rollup-plugin-terser'
2
- import pkg from './package.json'
3
- import typescript from 'rollup-plugin-typescript2'
1
+ import { readFileSync } from 'node:fs'
2
+ import { builtinModules } from 'node:module'
3
+
4
4
  import commonjs from '@rollup/plugin-commonjs'
5
- import copy from 'rollup-plugin-copy'
6
- import { string } from 'rollup-plugin-string'
7
5
  import json from '@rollup/plugin-json'
8
- import builtins from 'builtins'
9
6
  import replace from '@rollup/plugin-replace'
7
+ import terser from '@rollup/plugin-terser'
8
+ import typescript from '@rollup/plugin-typescript'
9
+ import copy from 'rollup-plugin-copy'
10
+ import { string } from 'rollup-plugin-string'
11
+
12
+ const pkg = JSON.parse(readFileSync('./package.json', 'utf8'))
10
13
 
11
14
  const version = process.env.VERSION || pkg.version
12
15
  const sourcemap = 'inline'
@@ -22,32 +25,21 @@ const commonOptions = {
22
25
  // packages such as `lowdb/adapters/FileSync` are also treated as external
23
26
  // See https://github.com/rollup/rollup/issues/3684#issuecomment-926558056
24
27
  external: [
25
- ...Object.keys(pkg.dependencies),
26
- ...builtins()
27
- ].map(packageName => new RegExp(`^${packageName}(/.*)?`)),
28
+ ...Object.keys(pkg.dependencies).map(packageName => new RegExp(`^${packageName}(/.*)?`)),
29
+ ...builtinModules.map(moduleName => new RegExp(`^(node:)?${moduleName}(/.*)?`))
30
+ ],
28
31
  plugins: [
29
32
  typescript({
30
- tsconfigOverride: {
31
- compilerOptions: {
32
- target: 'ES2017',
33
- module: 'ES2015'
34
- }
35
- }
33
+ tsconfig: './tsconfig.json'
36
34
  }),
37
35
  copy({
38
- targets: [
39
- { src: 'assets', dest: 'dist' }
40
- ]
36
+ targets: [{ src: 'assets', dest: 'dist' }]
41
37
  }),
42
38
  // terser(),
43
39
  commonjs(),
44
40
  string({
45
41
  // Required to be specified
46
- include: [
47
- '**/*.applescript',
48
- '**/*.ps1',
49
- '**/*.sh'
50
- ]
42
+ include: ['**/*.applescript', '**/*.ps1', '**/*.sh']
51
43
  }),
52
44
  json(),
53
45
  replace({
@@ -65,30 +57,21 @@ if (!isDev) {
65
57
  }
66
58
 
67
59
  /** @type import('rollup').RollupOptions */
68
- const nodeCjs = {
69
- output: [{
70
- file: 'dist/index.cjs.js',
71
- format: 'cjs',
72
- banner,
73
- sourcemap
74
- }],
75
- ...commonOptions
76
- }
77
60
 
78
61
  const nodeEsm = {
79
- output: [{
80
- file: 'dist/index.esm.js',
81
- format: 'esm',
82
- banner,
83
- sourcemap
84
- }],
62
+ output: [
63
+ {
64
+ file: 'dist/index.js',
65
+ format: 'esm',
66
+ banner,
67
+ sourcemap
68
+ }
69
+ ],
85
70
  ...commonOptions
86
71
  }
87
72
 
88
73
  const bundles = []
89
- const env = process.env.BUNDLES || ''
90
- if (env.includes('cjs')) bundles.push(nodeCjs)
91
- if (env.includes('esm')) bundles.push(nodeEsm)
92
- if (bundles.length === 0) bundles.push(nodeCjs, nodeEsm)
74
+
75
+ bundles.push(nodeEsm)
93
76
 
94
77
  export default bundles
package/.eslintignore DELETED
@@ -1,6 +0,0 @@
1
- node_modules
2
- dist
3
- webpack.config.js
4
- .eslintrc.js
5
- rollup.config.js
6
- bin/
package/.eslintrc.js DELETED
@@ -1,50 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- 'eslint:recommended',
4
- 'plugin:@typescript-eslint/recommended',
5
- 'plugin:import/recommended',
6
- 'plugin:import/typescript',
7
- 'plugin:n/recommended',
8
- 'plugin:prettier/recommended',
9
- ],
10
- parser: '@typescript-eslint/parser',
11
- plugins: ['@typescript-eslint', 'import'],
12
- rules: {
13
- // https://github.com/typescript-eslint/typescript-eslint/blob/ef88a696a157f617d38ce6d49207a4a4a089a19b/packages/eslint-plugin/docs/rules/naming-convention.md#enforce-that-interface-names-do-not-begin-with-an-i
14
- '@typescript-eslint/naming-convention': [
15
- 'error',
16
- {
17
- selector: 'interface',
18
- format: ['PascalCase'],
19
- custom: {
20
- regex: '^I[A-Z]',
21
- match: true,
22
- },
23
- },
24
- ],
25
- '@typescript-eslint/prefer-nullish-coalescing': 0,
26
- '@typescript-eslint/no-non-null-assertion': 0,
27
- '@typescript-eslint/no-explicit-any': 0,
28
- 'import/no-named-as-default': 0,
29
- 'n/no-missing-import': 0,
30
- 'n/no-process-exit': 0,
31
- 'prettier/prettier': [
32
- 'error',
33
- {},
34
- {
35
- usePrettierrc: true,
36
- },
37
- ],
38
- },
39
- settings: {
40
- 'import/parsers': {
41
- '@typescript-eslint/parser': ['.ts', '.tsx'],
42
- },
43
- 'import/resolver': {
44
- typescript: {
45
- alwaysTryTypes: true,
46
- project: './tsconfig.json',
47
- },
48
- }
49
- },
50
- }
@@ -1,22 +0,0 @@
1
- name: publish
2
- on:
3
- push:
4
- branches:
5
- - alpha
6
- jobs:
7
- build:
8
- runs-on: ubuntu-latest
9
- steps:
10
- - name: Clone repo
11
- uses: actions/checkout@v1
12
- - name: Setup node
13
- uses: actions/setup-node@v1
14
- with:
15
- node-version: '16.x'
16
- registry-url: 'https://registry.npmjs.org'
17
- - name: Install modules
18
- run: yarn
19
- - run: npm run build
20
- - run: npm publish --tag alpha --access public
21
- env:
22
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,22 +0,0 @@
1
- name: publish
2
- on:
3
- push:
4
- branches:
5
- - master
6
- jobs:
7
- build:
8
- runs-on: ubuntu-latest
9
- steps:
10
- - name: Clone repo
11
- uses: actions/checkout@v1
12
- - name: Setup node
13
- uses: actions/setup-node@v1
14
- with:
15
- node-version: '16.x'
16
- registry-url: 'https://registry.npmjs.org'
17
- - name: Install modules
18
- run: yarn
19
- - run: npm run build
20
- - run: npm publish --access public
21
- env:
22
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,19 +0,0 @@
1
- name: manually-trigger
2
- on: workflow_dispatch
3
- jobs:
4
- build:
5
- runs-on: ubuntu-latest
6
- steps:
7
- - name: Clone repo
8
- uses: actions/checkout@v1
9
- - name: Setup node
10
- uses: actions/setup-node@v1
11
- with:
12
- node-version: '16.x'
13
- registry-url: 'https://registry.npmjs.org'
14
- - name: Install modules
15
- run: yarn
16
- - run: npm run build
17
- - run: npm publish --access public
18
- env:
19
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}