Skip to content

[WEB-4844] fix: export prople package dist#7712

Merged
sriramveeraghanta merged 2 commits intopreviewfrom
chore-propel-export-dist
Sep 3, 2025
Merged

[WEB-4844] fix: export prople package dist#7712
sriramveeraghanta merged 2 commits intopreviewfrom
chore-propel-export-dist

Conversation

@sriramveeraghanta
Copy link
Member

@sriramveeraghanta sriramveeraghanta commented Sep 3, 2025

Description

  • Export dist from propel

Type of Change

  • Improvement (change that would cause existing functionality to not work as expected)

Summary by CodeRabbit

  • Refactor
    • Minor type annotations and internal typing adjustments for emoji pickers and charts; no user-facing behavior changes.
    • Internal representation of emoji picker types standardized (no functional impact).
  • Chores
    • UI package exports updated to point to built distribution files.
    • Build configuration expanded to include additional modules and copy static styles; declaration generation retained.

Copilot AI review requested due to automatic review settings September 3, 2025 10:35
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 3, 2025

Note

Other AI code review bot(s) detected

CodeRabbit 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.

Walkthrough

Type annotations were loosened to any in several UI callbacks and TODO comments added; propel package exports now point to dist/* and tsdown entries were expanded/copied; the emoji-icon-picker enum was replaced by a const object with updated type aliases and usages.

Changes

Cohort / File(s) Summary
Web components: callback typing & minor import cleanup
apps/web/core/components/profile/overview/priority-distribution.tsx, apps/web/core/components/project/form.tsx, apps/web/core/components/views/form.tsx
Added explicit any types to callback parameters (BarChart fill, EmojiPicker onChange) and inserted // TODO: fix types comments. Removed an unused import in project/form.tsx. No runtime logic changes.
Propel build/export config
packages/propel/package.json, packages/propel/tsdown.config.ts
Redirected package exports from src/*dist/*; expanded tsdown entry points (including src/charts/*/index.ts), added copy: ["src/styles"]. Adjusts build/config resolution only.
Emoji icon picker: types refactor
packages/propel/src/emoji-icon-picker/helper.tsx
Replaced exported enum EmojiIconPickerTypes with export const EmojiIconPickerTypes = { ... } as const; added TEmojiIconPickerTypes alias and updated related type annotations (e.g., TChangeHandlerProps, TCustomEmojiPicker).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

🛠️refactor

Suggested reviewers

  • anmolsinghbhatia
  • prateekshourya29

Poem

I hopped through types with joyful cheer,
Swapped enums for consts, carrots near.
Exports moved to fields of gold,
Tiny TODOs left to hold.
This rabbit stamps — the changes clear! 🥕🐇

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-propel-export-dist

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

Copilot AI left a 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 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 EmojiIconPickerTypes from enum to const object for better type safety
  • Add temporary type fixes with any type 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 values

Also 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 59ace4f and 6cbe084.

📒 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: Build packages/propel (e.g. npm run build) and confirm that each dist/**/index.* file—.js/.cjs/.mjs and .d.ts—exists, and update package.json exports entries to point to those artifacts instead of .ts sources.

packages/propel/package.json (2)

29-29: Confirm fonts CSS is copied to dist

Verify 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‐in packages/propel/dist/ directory, please build the package and confirm that for each export you have:

  • dist/.../index.js
  • dist/.../index.d.ts

before merging.

@sriramveeraghanta sriramveeraghanta changed the title fix: export prople package dist [WEB-4844] fix: export prople package dist Sep 3, 2025
@makeplane
Copy link

makeplane bot commented Sep 3, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
packages/propel/src/emoji-icon-picker/helper.tsx (1)

3-6: Good switch to const object with literal types.

Using as const preserves "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 HexColor type 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 6cbe084 and f76f97d.

📒 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants