Skip to content

Commit b8ecccc

Browse files
authored
🔨 Refactor(init): rm init module and move it to picgo-init (#187)
1 parent c6046a1 commit b8ecccc

11 files changed

Lines changed: 67 additions & 517 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ package-lock.json
77
test.jpg
88
.serena/
99
.pnpm-store/
10-
test.js
10+
test.js
11+
specs/
12+
.env
13+
openspec/

AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!-- OPENSPEC:START -->
2+
# OpenSpec Instructions
3+
4+
These instructions are for AI assistants working in this project.
5+
6+
Always open `@/openspec/AGENTS.md` when the request:
7+
- Mentions planning or proposals (words like proposal, spec, change, plan)
8+
- Introduces new capabilities, breaking changes, architecture shifts, or big performance/security work
9+
- Sounds ambiguous and you need the authoritative spec before coding
10+
11+
Use `@/openspec/AGENTS.md` to learn:
12+
- How to create and apply change proposals
13+
- Spec format and conventions
14+
- Project structure and guidelines
15+
16+
Keep this managed block so 'openspec update' can refresh the instructions.
17+
18+
Always ask questions before create proposal files if unsure about anything in these instructions or the spec file.
19+
20+
<!-- OPENSPEC:END -->
21+
22+
# PicGo-Core: Agent Notes
23+
24+
## Package Manager / Dependency Installation
25+
- This repo uses `pnpm` (has `pnpm-lock.yaml`).
26+
- If dependencies change, do not only edit `package.json`; run `pnpm install` to ensure deps + lockfile are consistent. Only run this when the user explicitly asks/coordinates it.
27+
- In non-TTY environments, `pnpm install` may fail with `ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY`; use `CI=true pnpm install`. Only run this when the user explicitly asks/coordinates it.
28+
29+
## Code Conventions
30+
- **Exports**: do not use `export default` for new/modified modules. Prefer named exports (e.g. `export { ServerManager }`) and named imports (e.g. `import { ServerManager } from '...'`).
31+
- Keep TypeScript types explicit; avoid ad-hoc `any` when possible.
32+
- Don't write `as any` in TypeScript code unless absolutely necessary. Always prefer explicit types.
33+
- **Config persistence**: use `ctx.saveConfig(...)` for changes that must persist to disk; use `ctx.setConfig(...)` only for in-memory/session updates.
34+
35+
## Execution Rules
36+
- If a command fails due to insufficient permissions, rerun with elevated approval.
37+
- For `pnpm` commands that hit network issues, retry first.
38+
39+
## Serena MCP & Context7 Tools
40+
When starting work or if you hit issues, try checking MCP for Serena or Context7 tooling. If available, use those tools to navigate, edit, or fetch docs efficiently.

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,17 @@ $ picgo -h
7777
install|add <plugins...> install picgo plugin
7878
uninstall|rm <plugins...> uninstall picgo plugin
7979
update <plugins...> update picgo plugin
80-
set|config <module> [name] configure config of picgo modules
80+
set <module> [name] configure config of picgo modules
8181
upload|u [input...] upload, go go go
8282
use [module] use modules of picgo
83-
init [options] <template> [project] create picgo plugin\'s development templates
83+
```
84+
85+
Note: the plugin's template initializer has moved to the standalone [picgo-init](https://github.com/PicGo/PicGo-Init) package.
86+
87+
You can use the following command to init a picgo plugin template:
88+
89+
```bash
90+
npx picgo-init plugin <your-plugin-folder>
8491
```
8592

8693
#### Upload a picture from path

package.json

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
},
1414
"scripts": {
1515
"start": "node ./bin/picgo",
16-
"lint": "eslint src --ext .ts",
17-
"test": "echo \"Error: no test specified\" && exit 1",
16+
"lint": "eslint src --ext .ts && tsc --noEmit",
1817
"build": "cross-env NODE_ENV=production rimraf ./dist && rollup -c rollup.config.js",
1918
"dev": "cross-env NODE_ENV=development rollup -c rollup.config.js -w",
2019
"patch": "npm version patch && git push origin master && git push origin --tags",
@@ -56,19 +55,15 @@
5655
"@rollup/plugin-terser": "^0.4.4",
5756
"@rollup/plugin-typescript": "^12.3.0",
5857
"@types/cross-spawn": "^6.0.0",
59-
"@types/ejs": "^3.0.5",
6058
"@types/fs-extra": "^5.0.4",
61-
"@types/glob": "^7.2.0",
6259
"@types/image-size": "^0.0.29",
6360
"@types/inquirer": "^0.0.42",
6461
"@types/js-yaml": "^4.0.5",
6562
"@types/lodash": "^4.14.175",
6663
"@types/md5": "^2.1.32",
6764
"@types/mime-types": "^2.1.0",
68-
"@types/minimatch": "^3.0.3",
6965
"@types/node": "20.19.26",
7066
"@types/resolve": "^0.0.8",
71-
"@types/rimraf": "^3.0.0",
7267
"@types/tunnel": "^0.0.3",
7368
"@typescript-eslint/eslint-plugin": "^8.49.0",
7469
"@typescript-eslint/parser": "^8.49.0",
@@ -87,6 +82,7 @@
8782
"rollup": "^4.53.3",
8883
"rollup-plugin-copy": "^3.5.0",
8984
"rollup-plugin-string": "^3.0.0",
85+
"rimraf": "^6.1.2",
9086
"typescript": "^5.9.3"
9187
},
9288
"dependencies": {
@@ -95,25 +91,20 @@
9591
"axios": "^1.13.2",
9692
"chalk": "^2.4.1",
9793
"commander": "^8.1.0",
98-
"comment-json": "^2.3.1",
94+
"comment-json": "^4.5.1",
9995
"cross-spawn": "^6.0.5",
10096
"dayjs": "^1.7.4",
101-
"ejs": "^3.1.10",
10297
"form-data": "^4.0.5",
10398
"fs-extra": "^6.0.1",
104-
"giget": "^2.0.0",
105-
"globby": "^11.0.4",
10699
"image-size": "^0.8.3",
107100
"inquirer": "^6.0.0",
108101
"is-wsl": "^2.2.0",
109102
"js-yaml": "^4.1.0",
110103
"lodash": "^4.17.21",
111104
"md5": "^2.2.1",
112105
"mime-types": "3.0.2",
113-
"minimatch": "^3.0.4",
114106
"minimist": "^1.2.5",
115107
"resolve": "^1.8.1",
116-
"rimraf": "^6.1.2",
117108
"tunnel": "^0.0.6"
118109
},
119110
"repository": {
@@ -125,6 +116,6 @@
125116
},
126117
"plugins": {},
127118
"engines": {
128-
"node": ">= 20.0.0"
119+
"node": ">= 22.12.0"
129120
}
130121
}

0 commit comments

Comments
 (0)