🔨 Refactor(init): rm init module and move it to picgo-init#187
🔨 Refactor(init): rm init module and move it to picgo-init#187Molunerfinn merged 7 commits intodevfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the init command module from PicGo-Core and moves its functionality to a separate package called picgo-init. This is a refactoring change that extracts the plugin template initialization feature into a standalone tool.
Key Changes:
- Removed the
initcommand and all related template generation code from the core package - Cleaned up dependencies that were only used by the init functionality (ejs, giget, globby, minimatch)
- Added new dependencies for future features (hono, dotenv, open) and testing infrastructure (vitest)
- Updated Node.js engine requirement from ">= 20.0.0" to ">= 22.12.0"
Reviewed changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/plugins/commander/init.ts | Deleted: Removed the entire init command implementation |
| src/plugins/commander/index.ts | Removed init command registration |
| src/utils/initUtils.ts | Deleted: Removed utility functions for template generation |
| src/types/index.ts | Removed IOptions and IFileTree interfaces used by init |
| src/utils/interfaces.ts | Removed IOptions interface used by init |
| tsconfig.json | Removed "glob" from types array (no longer needed) |
| package.json | Updated dependencies, scripts, and Node engine requirement |
| pnpm-lock.yaml | Updated lockfile reflecting all dependency changes |
| README.md | Updated documentation to note init command moved to picgo-init package |
| AGENTS.md | Added AI assistant instructions for the project |
| .gitignore | Added specs/, .env, and openspec/ to ignored files |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
package.json:126
- The Node.js engine requirement has been bumped from ">= 20.0.0" to ">= 22.12.0", which is a significant breaking change. This represents a major version jump that may affect users who are still running Node.js 20.x or 21.x. Consider whether this aggressive version requirement is intentional and necessary, or if the project could still support Node.js 20.x (which is an LTS version until April 2026).
package.json:113 - New dependencies have been added (@hono/node-server, hono, dotenv, open) but they don't appear to be used anywhere in the src/ directory yet. If these are being added in anticipation of future features, consider documenting this in the PR description. Otherwise, they should not be added until they are actually needed to avoid increasing the package size unnecessarily.
"chalk": "^2.4.1",
"commander": "^8.1.0",
"comment-json": "^4.5.1",
"cross-spawn": "^6.0.5",
"dayjs": "^1.7.4",
"form-data": "^4.0.5",
"fs-extra": "^6.0.1",
"image-size": "^0.8.3",
"inquirer": "^6.0.0",
"is-wsl": "^2.2.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"md5": "^2.2.1",
"mime-types": "3.0.2",
"minimist": "^1.2.5",
"resolve": "^1.8.1",
"tunnel": "^0.0.6"
},
"repository": {
"type": "git",
"url": "git+https://github.com/PicGo/PicGo-Core.git"
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "start": "node ./bin/picgo", | ||
| "lint": "eslint src --ext .ts", | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "lint": "eslint src --ext .ts && tsc --noEmit", |
There was a problem hiding this comment.
The lint script now includes "tsc --noEmit" which is a good practice to catch TypeScript type errors during linting. However, this change should be explicitly mentioned in the PR description as it makes the lint step potentially slower and may catch new type errors that weren't detected before.
| "dayjs": "^1.7.4", | ||
| "ejs": "^3.1.10", | ||
| "form-data": "^4.0.5", | ||
| "fs-extra": "^6.0.1", |
There was a problem hiding this comment.
The comment-json dependency has been upgraded from "^2.3.1" to "^4.5.1", which represents a major version bump (v2 to v4). This could introduce breaking changes in how JSON with comments is parsed or handled. Ensure that all usages of comment-json throughout the codebase are compatible with version 4.x API changes.
| "build": "cross-env NODE_ENV=production rimraf ./dist && rollup -c rollup.config.js", | ||
| "dev": "cross-env NODE_ENV=development rollup -c rollup.config.js -w", |
There was a problem hiding this comment.
The test script has been changed to run "vitest run", and vitest has been added as a devDependency, but there is no vitest.config.ts file and no test files are present in the repository. Without a configuration file, vitest will use defaults which may not be appropriate for this project's structure. Consider adding a vitest.config.ts file or removing the test infrastructure until tests are actually implemented.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.