Skip to content
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

feat: panda preset package, ref leather-wallet/issues#62 #5429

Merged
merged 1 commit into from
May 29, 2024

Conversation

pete-watters
Copy link
Contributor

@pete-watters pete-watters commented May 23, 2024

Try out Leather build 473a393Extension build, Test report, Storybook, Chromatic

This DRAFT demonstrates replacing the extension panda configuration with a preset package from leather-io/mono#151

Summary by CodeRabbit

  • Chores

    • Added a new dependency @leather-wallet/panda-preset version 0.0.5.
  • Refactor

    • Simplified the theme configuration by consolidating multiple theme-related entities into a single preset @leather-wallet/panda-preset.

Copy link

coderabbitai bot commented May 23, 2024

Walkthrough

The recent updates simplify the configuration of the project's theme by incorporating the @leather-wallet/panda-preset dependency. This change streamlines the setup by removing individual theme-related imports and consolidating them into a single preset, thus reducing complexity and potentially improving maintainability.

Changes

File Change Summary
package.json Added a new dependency @leather-wallet/panda-preset version 0.0.5.
panda.config.ts Removed imports of various theme-related entities and replaced them with a single preset configuration.

Poem

In the code, a panda's grace,
Simplifies the theme's embrace.
No more tokens, no more keys,
Just one preset, if you please.
With a wallet, sleek and neat,
Our config's now a tidy feat.


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?

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>.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to full the review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

Documentation and Community

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

package.json Outdated
@@ -254,6 +254,7 @@
"@chromatic-com/storybook": "1.2.23",
"@leather-wallet/prettier-config": "0.0.5",
"@leather-wallet/rpc": "0.3.0",
"@leather-wallet/panda-preset": "link:../mono/packages/panda-preset/",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am using link here as I couldn't get file working, maybe I am missing something

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does pnpm link --global . in preset & pnpm link @leather-wallet/panda-preset in ext work?

Copy link
Contributor Author

@pete-watters pete-watters May 24, 2024

Choose a reason for hiding this comment

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

I gave that a try and it didn't work immediately. It could be possible to get it to work with some more investigation.

panda-preset
At first pnpm link --global . failed right away with:

 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In ../../../../../Library/pnpm/global/5: "@leather-wallet/tokens@workspace:*" is in the dependencies but no package named "@leather-wallet/tokens" is present in the workspace

I changed the import to "@leather-wallet/tokens": "0.4.0" and it then succeeded although with a different warning  ERR_PNPM_PATCH_NOT_APPLIED  The following patches were not applied: [email protected]

That's not something we want to do though as I think packages should refer to the workspace version workspace:*

extension
In the extension pnpm link @leather-wallet/panda-preset fails with:

 ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND  No package.json (or package.yaml, or package.json5) was found in "/Users/petew/src/leather/extension/node_modules/@leather-wallet/panda-preset".


 I can investigate more. It could be that I also need to add some pnpm overrides. I was following Edgar's guide but got it working just changing from the file: protocol to link:

@pete-watters pete-watters force-pushed the feat/62/panda-preset branch from a799663 to 97ea829 Compare May 27, 2024 15:58
@@ -254,6 +254,7 @@
"@chromatic-com/storybook": "1.2.23",
"@leather-wallet/prettier-config": "0.0.5",
"@leather-wallet/rpc": "0.3.0",
"@leather-wallet/panda-preset": "0.0.5",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I manually published the package in this PR - leather-io/mono#151

I did some testing first creating my own packages and wanted to try this properly.

@pete-watters pete-watters force-pushed the feat/62/panda-preset branch from 97ea829 to 03e73c2 Compare May 27, 2024 16:02
@pete-watters pete-watters marked this pull request as ready for review May 27, 2024 16:03
@pete-watters
Copy link
Contributor Author

This PR is consuming the new @leather-wallet/panda-preset package from - leather-io/mono#151

Copy link
Collaborator

@kyranjamie kyranjamie left a comment

Choose a reason for hiding this comment

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

Great work @pete-watters, big improvement. Love seeing the monorepo come alive

panda.config.ts Outdated Show resolved Hide resolved
@pete-watters pete-watters force-pushed the feat/62/panda-preset branch from 03e73c2 to 473a393 Compare May 28, 2024 08:17
@pete-watters
Copy link
Contributor Author

pete-watters commented May 28, 2024

Great work @pete-watters, big improvement. Love seeing the monorepo come alive

Thanks @kyranjamie . There was a lot of trial and error here. I got it working in codesandbox finally also - https://codesandbox.io/p/devbox/leather-wallet-panda-preset-6nm6kc

I don't have fonts added yet so will get working on that

Copy link

@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

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 3656acf and 473a393.
Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !pnpm-lock.yaml
Files selected for processing (2)
  • package.json (1 hunks)
  • panda.config.ts (2 hunks)
Files skipped from review due to trivial changes (1)
  • package.json
Additional comments not posted (1)
panda.config.ts (1)

14-14: The integration of @leather-wallet/panda-preset simplifies the theme configuration significantly.

Verification successful

The integration of @leather-wallet/panda-preset is successful and does not introduce any issues.

  • The preset is correctly listed in panda.config.ts, package.json, and pnpm-lock.yaml.
  • No errors or warnings related to the preset were found in the codebase.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the preset is correctly applied and does not introduce any issues.

# Test: Search for any errors or warnings related to the preset in the build logs.
rg --type log $'error|warning' ./logs/build.log

Length of output: 105



Script:

#!/bin/bash
# Description: Verify the integration of the `@leather-wallet/panda-preset` in the codebase.

# Search for the usage of the preset in the codebase.
rg '@leather-wallet/panda-preset'

# Search for any errors or warnings related to the preset in the codebase.
rg 'error|warning' --glob '*.ts' --glob '*.js' --glob '*.tsx' --glob '*.jsx'

Length of output: 65347

@pete-watters pete-watters added this pull request to the merge queue May 29, 2024
Merged via the queue into dev with commit 36e5238 May 29, 2024
30 checks passed
@pete-watters pete-watters deleted the feat/62/panda-preset branch May 29, 2024 12:36
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