-
-
Notifications
You must be signed in to change notification settings - Fork 30
docs(pkg): add document about the new format options #474
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
|
""" WalkthroughConditional execution was added to the Changes
Possibly related PRs
Poem
""" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #474 +/- ##
=======================================
Coverage 85.78% 85.78%
=======================================
Files 10 10
Lines 197 197
Branches 55 55
=======================================
Hits 169 169
Misses 27 27
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
A documentation PR that adds a new section about Format Options while also adjusting size limits and adding owner-based conditions to workflow files.
- Added a new "Format Options" section in README with an example TypeScript interface.
- Modified size limit values in .size-limit.json for multiple packages.
- Added conditional deployment steps in Vercel and size-limit GitHub workflows.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/pkg/README.md | Added documentation with a code snippet for FormatOptions. |
.size-limit.json | Updated bundle size limits for several packages. |
.github/workflows/vercel.yml | Added condition to run deployment only when the repository owner is 'un-ts'. |
.github/workflows/size-limit.yml | Added condition to run the size-limit job only for the 'un-ts' owner. |
Comments suppressed due to low confidence (4)
packages/pkg/README.md:171
- [nitpick] Consider adding additional usage examples or explanatory text to clarify how the FormatOptions interface affects package configuration.
## Format Options
.size-limit.json:4
- Verify that the updated size limit for packages/autocorrect is aligned with current bundle outputs and performance targets.
"limit": "500B"
.size-limit.json:8
- Ensure the increased limit for packages/pkg is intentional and reflects updated benchmarks or requirements.
"limit": "600B"
.size-limit.json:12
- Confirm that the decreased limit for packages/sh is appropriate based on current bundle sizes and performance expectations.
"limit": "3kB"
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.
Important
Looks good to me! 👍
Reviewed everything up to 41747eb in 36 seconds. Click for details.
- Reviewed
69
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
4
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/size-limit.yml:14
- Draft comment:
Using a strict equality check to restrict the job to owner 'un-ts'. Confirm that triple equals (===) is desired and works as expected in GitHub Actions. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
2. .github/workflows/vercel.yml:15
- Draft comment:
Ensure the owner check (if: ${{ github.repository_owner === 'un-ts' }}) is intentional and consistent with your workflows. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
3. .size-limit.json:3
- Draft comment:
The size limits have been adjusted (e.g. 540B -> 500B, 500B -> 600B, 3.4kB -> 3kB). Verify that these new thresholds accurately reflect desired bundle sizes and unit consistency. - Reason this comment was not posted:
Confidence changes required:30%
<= threshold50%
None
4. packages/pkg/README.md:171
- Draft comment:
The new 'Format Options' section is clear. Consider adding a brief example or use-case on how to configure these options (e.g., in a .prettierrc or package.json) for better usability. - Reason this comment was not posted:
Confidence changes required:30%
<= threshold50%
None
Workflow ID: wflow_Jm2wMitBo51ZXEaO
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
prettier-plugin-autocorrect
prettier-plugin-pkg
prettier-plugin-sh
prettier-plugin-sql
prettier-plugin-toml
commit: |
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.
Actionable comments posted: 2
🔭 Outside diff range comments (2)
.github/workflows/size-limit.yml (1)
1-5
: 🛠️ Refactor suggestionAdd explicit permissions block.
Define minimalpermissions
for the workflow to scope theGITHUB_TOKEN
and satisfy CodeQL recommendations.permissions: contents: read name: Size Limit on: pull_request: branches: - master ....github/workflows/vercel.yml (1)
1-5
: 🛠️ Refactor suggestionAdd explicit permissions block.
ScopeGITHUB_TOKEN
privileges by adding apermissions
section and limit to required scopes.permissions: contents: read pull-requests: write name: Vercel Deploy ...
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/size-limit.yml
(1 hunks).github/workflows/vercel.yml
(1 hunks).size-limit.json
(1 hunks)packages/pkg/README.md
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/size-limit.yml
14-14: got unexpected character ' ' while lexing == operator, expecting '='
(expression)
.github/workflows/vercel.yml
15-15: got unexpected character ' ' while lexing == operator, expecting '='
(expression)
🪛 GitHub Check: CodeQL
.github/workflows/size-limit.yml
[warning] 14-33: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
.github/workflows/vercel.yml
[warning] 15-36: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
⏰ Context from checks skipped due to timeout of 90000ms (15)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Package Size Report
- GitHub Check: Lint and Test with Node.js 20 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 22 on macos-latest
- GitHub Check: Lint and Test with Node.js 22 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 24 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 on macos-latest
- GitHub Check: Lint and Test with Node.js 22 on windows-latest
- GitHub Check: Lint and Test with Node.js 18 on windows-latest
- GitHub Check: Lint and Test with Node.js 20 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 on macos-latest
- GitHub Check: Lint and Test with Node.js 22 on windows-latest
- GitHub Check: Lint and Test with Node.js 18 on windows-latest
🔇 Additional comments (4)
.size-limit.json (3)
4-4
: Verify updated size limit forautocorrect
package.
Ensure thatpackages/autocorrect/lib/index.js
remains under 500B after recent changes to avoid CI failures.
8-8
: Validate increased size limit forpkg
package.
Confirm thatpackages/pkg/lib/index.js
does not exceed the new 600B limit, reflecting additional features.
12-12
: Check reduced size limit forsh
package.
Verify thatpackages/sh/lib/index.js
stays within the tightened 3kB boundary.packages/pkg/README.md (1)
171-180
: EnsureFormatOptions
support in code.
The docs introduce theFormatOptions
interface; please verify that the package implementation exposes and honors these options at runtime.If needed, update usage examples or API docs to demonstrate default behaviors and integration points.
|
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.
Important
Looks good to me! 👍
Reviewed 2971f6e in 54 seconds. Click for details.
- Reviewed
69
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
4
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/size-limit.yml:14
- Draft comment:
Ensure 'if: ${{ github.repository_owner == 'un-ts' }}' is intentional to restrict the job to the repo owner. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
2. .github/workflows/vercel.yml:15
- Draft comment:
Confirm that limiting the deploy job to 'un-ts' with the if condition is as intended. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
3. .size-limit.json:4
- Draft comment:
Verify updated size limits are correct: autocorrect from '540B' to '500B', pkg from '500B' to '600B', sh from '3.4kB' to '3kB', and sql to '2.5kB'. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
4. packages/pkg/README.md:171
- Draft comment:
The new Format Options docs look clear; consider adding an example usage for clarity. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
Workflow ID: wflow_iIecWdxOdDPlzH88
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
size-limit report 📦
|
Deploy preview for prettier ready! ✅ Preview Built with commit 2971f6e. |
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.
Actionable comments posted: 0
♻️ Duplicate comments (2)
.github/workflows/vercel.yml (1)
15-15
: Duplicate repo-owner condition – extract into a variable
Consider centralizing thegithub.repository_owner == 'un-ts'
check into an environment variable (e.g.,REPO_OWNER
) to ensure consistency across workflows and avoid copy/paste.🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 15-36: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}.github/workflows/size-limit.yml (1)
14-14
: Duplicate repo-owner condition – extract into a variable
As above, you may extract thegithub.repository_owner == 'un-ts'
expression into a shared env var (e.g.,REPO_OWNER
) for maintainability across all workflows.🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 14-33: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
🧹 Nitpick comments (2)
.github/workflows/vercel.yml (1)
15-15
: Add explicit permissions for GITHUB_TOKEN
To follow least-privilege principles and resolve the CodeQL warning, declare apermissions
block at the top of the workflow (or within thedeploy
job) to scope downGITHUB_TOKEN
. For example:permissions: contents: read id-token: write # only if OIDC authentication is needed🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 15-36: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}.github/workflows/size-limit.yml (1)
14-14
: Add explicit permissions for GITHUB_TOKEN
To adhere to least-privilege security practices and address the CodeQL warning, include apermissions
block to scope downGITHUB_TOKEN
, for example:permissions: contents: read🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 14-33: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/size-limit.yml
(1 hunks).github/workflows/vercel.yml
(1 hunks).size-limit.json
(1 hunks)packages/pkg/README.md
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- .size-limit.json
- packages/pkg/README.md
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/size-limit.yml
[warning] 14-33: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
.github/workflows/vercel.yml
[warning] 15-36: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
⏰ Context from checks skipped due to timeout of 90000ms (16)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: publish
- GitHub Check: deploy
- GitHub Check: Lint and Test with Node.js 20 on macos-latest
- GitHub Check: Lint and Test with Node.js 22 on windows-latest
- GitHub Check: Lint and Test with Node.js 18 on windows-latest
- GitHub Check: size-limit
- GitHub Check: Lint and Test with Node.js 24 on windows-latest
- GitHub Check: Package Size Report
- GitHub Check: Lint and Test with Node.js 22 on macos-latest
- GitHub Check: Lint and Test with Node.js 20 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 on macos-latest
- GitHub Check: Lint and Test with Node.js 20 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 on windows-latest
- GitHub Check: Lint and Test with Node.js 18 on windows-latest
Important
Added format options documentation and updated workflow conditions and size limits.
README.md
for package formatting configuration..size-limit.json
to adjust size limits forautocorrect
,pkg
, andsh
packages.size-limit.yml
andvercel.yml
workflows to run jobs only if repository owner isun-ts
.This description was created by
for 2971f6e. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
Documentation
Chores