-
Notifications
You must be signed in to change notification settings - Fork 2
feat: support algolia alauda preset #51
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
🦋 Changeset detectedLatest commit: e11a54c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe changes introduce support for an "alauda" preset in the Algolia CLI option, allowing it to accept a boolean or the string "alauda". Documentation and type definitions are updated, a new parsing helper is added, and configuration logic is extended to apply the preset when specified. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Helpers
participant ConfigLoader
User->>CLI: Run command with --algolia=<value>
CLI->>Helpers: parseBooleanOrString(value)
Helpers-->>CLI: boolean | "alauda"
CLI->>ConfigLoader: getCommonConfig({ algolia: result })
alt algolia is true and config.algolia exists
ConfigLoader-->>CLI: Use config.algolia
else algolia == "alauda"
ConfigLoader-->>CLI: Use hardcoded "alauda" preset
else
ConfigLoader-->>CLI: algoliaOptions = null
end
Possibly related PRs
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (7)
🧰 Additional context used🧬 Code Graph Analysis (2)src/cli/helpers.ts (1)
src/cli/index.ts (1)
🪛 Gitleaks (8.26.0)src/cli/load-config.ts216-216: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) ⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (11)
✨ Finishing Touches
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 (
|
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.
Pull Request Overview
This PR adds support for an “alauda” preset when enabling Algolia search via the CLI.
- Extends the
--algoliaflag andGlobalCliOptionstype to accept a special"alauda"string - Implements fallback logic in
load-config.tsto inject preset credentials when"alauda"is selected - Updates CLI parsing helpers, documentation, and adds a changeset entry
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Allow algolia option to be `boolean |
| src/cli/load-config.ts | Fallback to preset Algolia config for 'alauda' |
| src/cli/index.ts | Update --algolia flag signature and parser |
| src/cli/helpers.ts | Introduce parseBooleanOrString for mixed flags |
| docs/zh/start.mdx | Reflect new `[boolean |
| docs/en/start.mdx | Reflect new `[boolean |
| .changeset/major-cameras-rule.md | Add release notes for the Algolia Alauda preset feature |
Comments suppressed due to low confidence (2)
src/cli/load-config.ts:213
- There are no tests covering the new 'alauda' preset fallback; add unit tests to verify that when
algolia==='alauda', theappId,apiKey, andindexNameare correctly injected.
((algolia && config.algolia) ??
.changeset/major-cameras-rule.md:2
- [nitpick] The changeset filename (
major-cameras-rule.md) doesn’t match this feature; consider renaming it to something likeminor-support-algolia-alauda-preset.mdfor clarity.
"@alauda/doom": minor
Summary by CodeRabbit
--algoliaoption, including support for the "alauda" preset.