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

[Demo] Adds missing dependency: faker #960

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

uzyn
Copy link
Contributor

@uzyn uzyn commented Oct 14, 2024

Otherwise demo would not run:

$ cd demo
$ yarn server
yarn run v1.22.22
$ eleventy --serve --port=8085
[11ty] Cannot find module '@faker-js/faker'

Summary by CodeRabbit

  • New Features
    • Introduced a new dependency for enhanced data generation capabilities.

Copy link

coderabbitai bot commented Oct 14, 2024

📝 Walkthrough

Walkthrough

The package.json file for the demo project has been modified to include a new dependency. Specifically, the dependency @faker-js/faker has been added with version ^9.0.3 under the dependencies section. No other changes were made to existing dependencies, scripts, or configurations.

Changes

File Change Summary
demo/package.json Added new dependency @faker-js/faker version ^9.0.3 in dependencies section.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DemoApp
    participant Faker

    User->>DemoApp: Request for demo data
    DemoApp->>Faker: Generate fake data
    Faker-->>DemoApp: Return fake data
    DemoApp-->>User: Provide demo data
Loading

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c65aac8 and 5acf415.

⛔ Files ignored due to path filters (1)
  • demo/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • demo/package.json (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
demo/package.json (1)

23-23: LGTM: Dependency added correctly.

The addition of @faker-js/faker version ^9.0.3 is correct and aligns with the PR objectives. This dependency is commonly used for generating fake data in testing and demo environments, which is appropriate for a demo project.

A few points to note:

  1. The dependency is correctly placed in the dependencies section, as it's likely required for the demo to run.
  2. The version ^9.0.3 allows for compatible updates, which is generally good practice.
  3. There are no apparent conflicts with existing dependencies.

To ensure this change resolves the reported issue and doesn't introduce any new ones, please run the following verification script:

This script will confirm that the dependency is correctly added and that the demo server can now start without the previous error.


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>, please review it.
    • 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 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 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 using 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 do a full 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.

Other keywords and placeholders

  • Add @coderabbitai 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

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.

@flochtililoch
Copy link
Collaborator

@uzyn I'm surprised you're running into this issue, I just tried again deleting all node modules, re-installing and running the command, and it's not failing on my end. I wonder if this is an env-specific issue, could you paste the node version you're running?

@uzyn
Copy link
Contributor Author

uzyn commented Oct 19, 2024

Could it be that you have faker installed globally?

I'm on node v20.16.0

Here's the full log from a newly fresh clone of hyperview:

$ git clone [email protected]:Instawork/hyperview.git
Cloning into 'hyperview'...
remote: Enumerating objects: 21548, done.
remote: Counting objects: 100% (5708/5708), done.
remote: Compressing objects: 100% (2060/2060), done.
remote: Total 21548 (delta 3220), reused 5027 (delta 2885), pack-reused 15840 (from 1)
Receiving objects: 100% (21548/21548), 39.18 MiB | 6.70 MiB/s, done.
Resolving deltas: 100% (12547/12547), done.

$ cd hyperview/demo

$ node -v
v20.16.0

$ yarn server
yarn run v1.22.22

$ eleventy --serve --port=8085
/bin/sh: eleventy: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

$ yarn
yarn install v1.22.22
[1/4] 🔍  Resolving packages...
warning Resolution field "@typescript-eslint/[email protected]" is incompatible with requested version "@typescript-eslint/[email protected]"
warning Resolution field "@typescript-eslint/[email protected]" is incompatible with requested version "@typescript-eslint/[email protected]"
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "react@^17.0.2".
warning " > [email protected]" has incorrect peer dependency "react-native@^0.67.4".
warning " > [email protected]" has incorrect peer dependency "[email protected]".
[4/4] 🔨  Building fresh packages...
✨  Done in 7.79s.

$ yarn server
yarn run v1.22.22

$ eleventy --serve --port=8085
[11ty] Cannot find module '@faker-js/faker'
[11ty] Require stack:
[11ty] - /path/to/hyperview/demo/backend/_data/contacts.js
[11ty] - /path/to/hyperview/demo/node_modules/@11ty/eleventy/src/TemplateData.js
[11ty] - /path/to/hyperview/demo/node_modules/@11ty/eleventy/src/Eleventy.js
[11ty] - /path/to/hyperview/demo/node_modules/@11ty/eleventy/cmd.js (via Error)
[11ty] 
[11ty] Original error stack trace: Error: Cannot find module '@faker-js/faker'
[11ty] Require stack:
[11ty] - /path/to/hyperview/demo/backend/_data/contacts.js
[11ty] - /path/to/hyperview/demo/node_modules/@11ty/eleventy/src/TemplateData.js
[11ty] - /path/to/hyperview/demo/node_modules/@11ty/eleventy/src/Eleventy.js
[11ty] - /path/to/hyperview/demo/node_modules/@11ty/eleventy/cmd.js
[11ty]     at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
[11ty]     at Module._load (node:internal/modules/cjs/loader:986:27)
[11ty]     at Module.require (node:internal/modules/cjs/loader:1233:19)
[11ty]     at require (node:internal/modules/helpers:179:18)
[11ty]     at Object.<anonymous> (/path/to/hyperview/demo/backend/_data/contacts.js:1:19)
[11ty]     at Module._compile (node:internal/modules/cjs/loader:1358:14)
[11ty]     at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
[11ty]     at Module.load (node:internal/modules/cjs/loader:1208:32)
[11ty]     at Module._load (node:internal/modules/cjs/loader:1024:12)
[11ty]     at Module.require (node:internal/modules/cjs/loader:1233:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@flochtililoch
Copy link
Collaborator

Ok I see what went wrong, it's installed as part of hyperview package, but I recently moved some of 11ty deps to the demo package but forgot to move this one. Thanks for the PR!

@flochtililoch flochtililoch merged commit 8e3c837 into Instawork:master Oct 19, 2024
6 checks passed
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.

2 participants