-
Notifications
You must be signed in to change notification settings - Fork 0
Initialize package.json in content folder #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
|
@copilot 继续 |
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Completed! The implementation is now fully working: ✅ You can now use Commit: 2be2a4e |
🚀 Preview DeploymentThis pull request will be automatically deployed to Vercel. Preview Links
Build StatusCheck the CI workflow for build status and any errors. Automated preview information for PR #32 |
|
@copilot 注意,当前项目的 /content 目录不是给模版项目用的,是为了写当前项目的文档。 |
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
已修复!之前的测试不小心修改了 ObjectDocs 项目自己的文档内容( (Fixed! The previous testing accidentally modified ObjectDocs project's own documentation content in Commit: 2219503 |
🚀 Preview DeploymentThis pull request will be automatically deployed to Vercel. Preview Links
Build StatusCheck the CI workflow for build status and any errors. Automated preview information for PR #32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the ObjectDocs init flow so that running objectdocs init in any GitHub project keeps the project root clean by installing the documentation engine and scripts entirely under content/.
Changes:
- Updated the CLI
initcommand to scaffoldcontent/.objectdocs, create or updatecontent/package.jsonwith dev/build/start scripts, and add appropriate entries to.gitignore, while properly awaitingnpm install. - Adjusted the quick test script and starter example to build and run the site from
content/, aligning tests and docs with the new non-polluting structure. - Refreshed the main README and starter README to describe the new usage patterns for existing projects and standalone docs projects.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
test-quick.sh |
Fixes monorepo root detection and updates the quick build test to initialize ObjectDocs, then build from content/ and assert output in content/.objectdocs/.next, validating the new layout. |
pnpm-lock.yaml |
Enables autoInstallPeers in pnpm settings, affecting dependency resolution across the monorepo. |
packages/cli/src/commands/init.mjs |
Changes the init command to work under content/ (creating content if needed), copy the site into content/.objectdocs, manage content/package.json scripts, update .gitignore, and await npm install completion. |
examples/starter/package.json |
Updates example scripts so dev, build, and start run via cd content && npm run ..., delegating to the new content/package.json-managed scripts. |
examples/starter/README.md |
Documents the new starter structure (including content/package.json) and updates getting-started, build, and run instructions to match the content-based workflow. |
README.md |
Rewrites the Quick Start to emphasize initializing in any existing project without polluting the root, explains content/package.json and .objectdocs, and adds a standalone-project flow with updated scripts and project structure. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| Initialize ObjectDocs: | ||
|
|
||
| ```bash | ||
| pnpm dev | ||
| npm run init | ||
| # or | ||
| npx objectdocs init | ||
| ``` |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instructions here recommend running npm run init, but the earlier scripts snippet for a new standalone project only defines dev, build, and start scripts and does not include an init script. Either the scripts example should add an init script, or this command should be updated to use the CLI directly (for example via npx @objectdocs/cli init), otherwise npm run init will fail for users following these steps.
| "dev": "cd content && npm run dev", | ||
| "build": "cd content && npm run build", | ||
| "start": "cd content && npm run start" |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build script here has been changed to "build": "cd content && npm run build", but the starter README still references "build": "objectdocs build" and mentions Vercel using pnpm build (via objectdocs build) with .next at the project root. Please update the README (including the troubleshooting and Vercel deployment sections) so the documented scripts and expected output directory match this new script-based flow.
Implementation Plan for Non-Polluting Init
The goal is to ensure that running
objectdocs initin any GitHub project does not pollute the project root directory. All documentation-related files should be contained within thecontent/folder.Changes Made:
content/package.jsonwith npm scriptsImplementation Details:
Init Command (
packages/cli/src/commands/init.mjs):content/package.jsonwith scripts that reference.objectdocssubdirectorycontent/.objectdocsandcontent/node_modulesto.gitignoreTest Script (
test-quick.sh):Documentation:
Important Note:
/contentdirectory in the ObjectDocs repository itself contains the project's own documentation and was accidentally modified during initial testingExpected Outcome:
After running
objectdocs init:content/package.jsonexists with proper scripts (dev, build, start)content/.objectdocs/contains the Next.js site enginecontent/.objectdocsandcontent/node_modulesare gitignoredTesting:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.