[WEB-4844] fix: export prople package dist#7712
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughType annotations were loosened to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the propel package exports by updating paths to point to the compiled dist directory instead of raw TypeScript source files. It also refactors the emoji icon picker from enum to const object and adds temporary type fixes.
- Update package exports to use
dist/paths for compiled output - Refactor
EmojiIconPickerTypesfrom enum to const object for better type safety - Add temporary type fixes with
anytype annotations
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/propel/package.json | Updates export paths from src/ to dist/ for compiled distribution |
| packages/propel/tsdown.config.ts | Reorganizes build entry points and adds new component entries |
| packages/propel/src/emoji-icon-picker/helper.tsx | Converts enum to const object for EmojiIconPickerTypes |
| apps/web/core/components/views/form.tsx | Adds temporary any type fix for onChange handler |
| apps/web/core/components/project/form.tsx | Removes unused imports and adds temporary any type fix |
| apps/web/core/components/profile/overview/priority-distribution.tsx | Adds temporary any type fix for fill function parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (5)
apps/web/core/components/project/form.tsx (1)
206-208: Type the EmojiPicker onChange param (replace any).Use the library’s change payload type.
- // TODO: fix types - onChange={(val: any) => { + // TODO: fix types + onChange={(val: TChangeHandlerProps) => {apps/web/core/components/views/form.tsx (1)
179-181: Type the EmojiPicker onChange param (replace any).Align with propel types to regain type-safety.
- // TODO: fix types - onChange={(val: any) => { + // TODO: fix types + onChange={(val: TChangeHandlerProps) => {Add (if not already exported) to imports:
import type { TChangeHandlerProps } from "@plane/propel/emoji-icon-picker";packages/propel/tsdown.config.ts (1)
8-8: Guard charts glob against unintended entries.If there are stories/tests or internal indexes under charts, they’ll be bundled. Consider excluding them.
Example:
- "src/charts/**/index.ts", + "src/charts/**/index.ts", + "!src/charts/**/__tests__/**", + "!src/charts/**/*.stories.ts*",packages/propel/src/emoji-icon-picker/helper.tsx (2)
10-15: Export a reusable union type; simplify usages.Expose a union for "emoji" | "icon" and use it for props.
+export type EmojiIconPickerOpen = typeof EmojiIconPickerTypes[keyof typeof EmojiIconPickerTypes]; export type TChangeHandlerProps = | { - type: typeof EmojiIconPickerTypes.EMOJI; + type: EmojiIconPickerOpen; value: string; } | { - type: typeof EmojiIconPickerTypes.ICON; + type: EmojiIconPickerOpen; value: { name: string; color: string; }; };- defaultOpen?: typeof EmojiIconPickerTypes.EMOJI | typeof EmojiIconPickerTypes.ICON; + defaultOpen?: EmojiIconPickerOpen;Also applies to: 28-28
94-100: Fix doc inconsistencies (hyphen vs comma).Comments say “comma-separated” but implementation uses “-”.
- * This creates a comma-separated string of decimal values + * This creates a hyphen-separated string of decimal values- * @param emojiString - Comma-separated string of decimal values + * @param emojiString - Hyphen-separated string of decimal valuesAlso applies to: 136-143
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (6)
apps/web/core/components/profile/overview/priority-distribution.tsx(1 hunks)apps/web/core/components/project/form.tsx(2 hunks)apps/web/core/components/views/form.tsx(1 hunks)packages/propel/package.json(1 hunks)packages/propel/src/emoji-icon-picker/helper.tsx(2 hunks)packages/propel/tsdown.config.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build and lint web apps
- GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
packages/propel/tsdown.config.ts (1)
5-19: Verify exports map matches build outputs: Buildpackages/propel(e.g.npm run build) and confirm that eachdist/**/index.*file—.js/.cjs/.mjsand.d.ts—exists, and updatepackage.jsonexportsentries to point to those artifacts instead of.tssources.packages/propel/package.json (2)
29-29: Confirm fonts CSS is copied to distVerify the build copies src/styles/fonts/index.css to dist so the export isn’t a 404 at runtime. If not, add a copy step to tsdown or a postbuild script.
19-34: Ensure exports point to built JS plus types—manual build‐artifact check required
The package.json currently maps exports to “.ts” files under “dist/…”, but consumers need “.js” with accompanying “.d.ts”. Since the repo doesn’t include a checked‐inpackages/propel/dist/directory, please build the package and confirm that for each export you have:
dist/.../index.jsdist/.../index.d.tsbefore merging.
|
Pull Request Linked with Plane Work Items
Comment Automatically Generated by Plane |
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
packages/propel/src/emoji-icon-picker/helper.tsx (1)
3-6: Good switch to const object with literal types.Using
as constpreserves"emoji" | "icon"literals and fixes downstream typing. This addresses the prior suggestion.
🧹 Nitpick comments (6)
packages/propel/src/emoji-icon-picker/helper.tsx (6)
10-19: Discriminated union looks correct; consider tightening the color type.Optional: introduce a
HexColortype and reuse it for the icon branch to prevent accidental non-hex inputs.| { type: typeof EmojiIconPickerTypes.ICON; value: { name: string; - color: string; + color: HexColor; }; };Add once (outside this hunk):
// Narrow hex color strings at the type level (runtime validation still needed) type HexColor = `#${string}`;
21-22: Simplify value-union type derivation.Derive the union from the const object in one step for maintainability.
-export type TEmojiIconPickerTypes = typeof EmojiIconPickerTypes.EMOJI | typeof EmojiIconPickerTypes.ICON; +export type TEmojiIconPickerTypes = + (typeof EmojiIconPickerTypes)[keyof typeof EmojiIconPickerTypes];
55-92: Optional: also handle very dark colors (not only too-light).Current logic only darkens light colors. To “ensure contrast,” also lighten when the input is very dark.
// If the color is too light, darken it - if (luminance > 0.5) { + if (luminance > 0.5) { r = Math.max(0, r - 50); g = Math.max(0, g - 50); b = Math.max(0, b - 50); + } else if (luminance < 0.35) { + // If the color is too dark, lighten it + r = Math.min(255, r + 50); + g = Math.min(255, g + 50); + b = Math.min(255, b + 50); }
94-94: Make default colors readonly literals (and optionally validate via type).This prevents accidental mutation and preserves precise literal types.
-export const DEFAULT_COLORS = ["#95999f", "#6d7b8a", "#5e6ad2", "#02b5ed", "#02b55c", "#f2be02", "#e57a00", "#f38e82"]; +export const DEFAULT_COLORS = ["#95999f", "#6d7b8a", "#5e6ad2", "#02b5ed", "#02b55c", "#f2be02", "#e57a00", "#f38e82"] as const;If you adopt
HexColor(see above), you can further assert:export const DEFAULT_COLORS = [ "#95999f", "#6d7b8a", "#5e6ad2", "#02b5ed", "#02b55c", "#f2be02", "#e57a00", "#f38e82", ] as const satisfies readonly HexColor[];
129-131: Fix docstring: delimiter is hyphen, not comma.Comment contradicts implementation (
join("-")).- * This creates a comma-separated string of decimal values + * This creates a hyphen-separated string of decimal values
140-141: Fix docstring: delimiter is hyphen, not comma.Align docs with
split("-").- * @param emojiString - Comma-separated string of decimal values + * @param emojiString - Hyphen-separated string of decimal values
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
packages/propel/src/emoji-icon-picker/helper.tsx(1 hunks)packages/propel/tsdown.config.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/propel/tsdown.config.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build and lint web apps
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
packages/propel/src/emoji-icon-picker/helper.tsx (1)
30-30: LGTM: defaultOpen uses the exported union type.Type aligns with the discriminant values.
Description
Type of Change
Summary by CodeRabbit