-
Notifications
You must be signed in to change notification settings - Fork 38
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
chore: add fluent editor version #153
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested labels
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
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
🧹 Nitpick comments (2)
packages/docs/fluent-editor/.vitepress/theme/insert-deps-version.ts (2)
12-12
: Add error handling for undefined versionConsider adding a fallback value or error handling in case the version is undefined.
- const FluentEditorVersion = packageJson.version + const FluentEditorVersion = packageJson.version ?? 'unknown'
Line range hint
3-11
: Consider adding TypeScript typesThe function could benefit from explicit TypeScript types for better maintainability and type safety.
-export function inertDepsVersion() { +export function inertDepsVersion(): void { if (typeof document === 'undefined') return const { npm_package_devDependencies_vite: ViteVersion, npm_package_devDependencies_vitepress: VitePressVersion, npm_package_dependencies_vue: VueVersion, npm_package_dependencies_quill: QuillVersion, - } = process.env + } = process.env as { + npm_package_devDependencies_vite: string; + npm_package_devDependencies_vitepress: string; + npm_package_dependencies_vue: string; + npm_package_dependencies_quill: string; + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/docs/fluent-editor/.vitepress/theme/insert-deps-version.ts
(2 hunks)
🔇 Additional comments (2)
packages/docs/fluent-editor/.vitepress/theme/insert-deps-version.ts (2)
18-18
: LGTM! Consistent with existing pattern
The attribute setting follows the established pattern used for other version attributes.
1-1
: Verify JSON import compatibility with the build setup
Direct imports of package.json files might require specific bundler configuration. Please ensure that your build setup (Vite/VitePress in this case) is configured to handle JSON imports correctly.
✅ Verification successful
JSON imports are supported in VitePress/Vite environment
The import of package.json is safe in this context as:
- VitePress is built on top of Vite which has built-in JSON import support
- The project's Vite configuration shows active usage of package.json parsing (via
getPackageManifest
) - This is a common pattern in VitePress/Vite projects for version management
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if JSON imports are configured in Vite config
rg -l "json[\"'\(]" -g "vite.config.*"
# Check if other files are also importing package.json similarly
rg "from ['\"].*package\.json['\"]"
Length of output: 122
Script:
#!/bin/bash
# Let's check the content of the Vite config to see JSON handling
cat packages/fluent-editor/vite.config.ts
# Check for any other package.json imports in different syntax
rg "require.*package\.json|import.*package\.json"
# Let's also check if VitePress has any built-in JSON handling
fd -g "config.*" -t f packages/docs/fluent-editor/.vitepress/ --exec cat {}
Length of output: 3972
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit