-
Notifications
You must be signed in to change notification settings - Fork 0
fix: export utils directory from @pleaseai/docs layer #15
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
Add missing 'utils' directory to package.json exports to make utility functions available to consuming applications.
Summary of ChangesHello @amondnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a configuration oversight by explicitly adding the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
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.
Code Review
This pull request adds the utils directory to the files array in package.json, intending to make utility functions available to consuming applications. While the change correctly includes the directory in the published package for Nuxt's auto-import feature, the utility files themselves (git.ts, meta.ts) use Node.js-specific APIs. Because they are not marked as server-only, they would be auto-imported on the client as well, leading to runtime errors. My review provides a high-severity comment recommending a fix for this issue.
| "nuxt.schema.ts", | ||
| "server" | ||
| "server", | ||
| "utils" |
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.
By adding the utils directory, you are enabling Nuxt's auto-import feature for the utilities within. However, the files utils/git.ts and utils/meta.ts use Node.js-specific APIs (like process and child_process) that are not available in the browser.
When Nuxt auto-imports utilities, they are available on both client and server unless specified otherwise. This will cause runtime errors if these functions are ever used in client-side code.
To prevent this, you should rename the files to mark them as server-only, following Nuxt's convention:
utils/git.ts→utils/git.server.tsutils/meta.ts→utils/meta.server.ts
This ensures they are only auto-imported and available in a server context.



Summary
Add missing 'utils' directory to package.json exports to make utility functions available to consuming applications.
Changes
utilsto the exports array inpackages/layer/package.jsonTest plan
@pleaseai/docs/utilsin consuming applications