fix: consistenly use static/data for 'npm run build' #661

Merged
Sainan merged 1 commits from static-data into main 2024-12-29 16:51:38 -08:00
Owner

Previously, buildConfig.json was loaded from build/static/data while cache files were loaded from static/data. Now all files are loaded from static/data and there is no build/static/data folder anymore.

Previously, buildConfig.json was loaded from build/static/data while cache files were loaded from static/data. Now all files are loaded from static/data and there is no build/static/data folder anymore.
coderabbitai[bot] commented 2024-12-29 14:54:31 -08:00 (Migrated from github.com)
Author
Owner

Walkthrough

The pull request introduces a significant architectural change in how build configuration is managed across multiple files. The primary modification involves transitioning from directly importing a static JSON configuration file to utilizing a new buildConfigService.ts service module. This service dynamically reads and exports the build configuration, providing a more flexible approach to configuration management.

The changes impact several key files including loginController.ts, worldStateController.ts, and routes/cache.ts, where the import statements for buildConfig have been uniformly updated. A new buildConfigService.ts file has been created to centralize the configuration loading process, which determines the repository directory and reads the configuration JSON file synchronously.

The modifications maintain the existing logic in the affected controllers and routes while introducing a more centralized and potentially more adaptable method of handling build configuration data.


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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.
<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- walkthrough_start --> ## Walkthrough The pull request introduces a significant architectural change in how build configuration is managed across multiple files. The primary modification involves transitioning from directly importing a static JSON configuration file to utilizing a new `buildConfigService.ts` service module. This service dynamically reads and exports the build configuration, providing a more flexible approach to configuration management. The changes impact several key files including `loginController.ts`, `worldStateController.ts`, and `routes/cache.ts`, where the import statements for `buildConfig` have been uniformly updated. A new `buildConfigService.ts` file has been created to centralize the configuration loading process, which determines the repository directory and reads the configuration JSON file synchronously. The modifications maintain the existing logic in the affected controllers and routes while introducing a more centralized and potentially more adaptable method of handling build configuration data. <!-- walkthrough_end --> <!-- internal state start --> <!-- FAHghAtBAEAqAWBLAztF0CGA7TBXALgPYQDmAplmQE4b5kAm0AxoQLasX4Bc0ADldEIAjAFZkm+RADcyqIQE9mhetQxChifADoMiaFAB8wY+CjGAxOegAFAErQAyrnYYq84wjJ9cAGx/QqM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N0zWjEJm5uMUSug1THc31evLpLC2mOc/IvxwBpV+sxICUX06Pusr4cK0egSi2ElEJw9BSBWRayRARDzXCBUDSEoHXgRj1BETdUIEIHwAABEFwG5Rc3xtIJB15ACysUxsxogZAfBAdeBa0qwoRAgRF5t8xlwGcPQE1CBMD6FcCOIcxkxqBBxbRCQWD3wGDLZIJ/owF+IUdv9kwxgvNtgxCvB/47dXViQ0C2CA1UBYgrxYgzgr9CDocUs2V/d7tUJuQOQH9CsCNnxF5YRu11oJgVI3UyBpZVCpEzCIRJRECcgRF0AC8gMQdTRSsS0AR/81t2Usg/4EhiR7UJhvwQDcdJhY1RsaEPN6xLEcArU8wV15B1UPQKQFUR81YXDciZ9Y48VqAUhEo7pYDQ5GA3gU0/YlIMwbDFF7dDDc9dp1J3df8p1TwVAfhAgvAgwVI1UNUoNml0dExnwo5fUVVNxI8eRLh8AEhLgr4UQ8iWgKR6A/RjBYk09P0b0s8UkmA0lc88QHgfDckFoQM+gwMy8ykYAbwkCxcPga8eRzjwgPCO4Cs3CrlDlb8d9iin9FMKlVgyiKiAQ/xUMQSqByjl0ij8iSjF8t8Z5+t4TASVklMflIZrpwMFoHgMACBHoTNuE3otoAgMAb80VRDwcgZToNBQZLoIZQBZoNoBh8AAB9ZYZANkwISyayNkvUapaaJkqAaAAADhSAOBSHoAAGZpShAAB2eU8XAAVmOBSAAE4MBjh6BJcyB5TlSyAAAmJgaXMgdU8qdU9UoQA4E0tQcGLE5kt6TQDk+gLknkl0Pk+ae0oAA= --> <!-- internal state end --> <!-- tips_start --> --- 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? <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <details> <summary>🪧 Tips</summary> ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - 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 generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR. ([Beta](https://docs.coderabbit.ai/early-access#beta)) - `@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. ### Documentation and Community - Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements. </details> <!-- tips_end -->
coderabbitai[bot] (Migrated from github.com) reviewed 2024-12-29 14:56:31 -08:00
coderabbitai[bot] (Migrated from github.com) left a comment
Author
Owner

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 212a5e7035 and 8f6fd33b77.

📒 Files selected for processing (4)
  • src/controllers/api/loginController.ts (1 hunks)
  • src/controllers/dynamic/worldStateController.ts (1 hunks)
  • src/routes/cache.ts (1 hunks)
  • src/services/buildConfigService.ts (1 hunks)
🔇 Additional comments (6)
src/services/buildConfigService.ts (3)

1-2: Imports look good.
Using path and fs is appropriate for file system operations.


4-6: Consider broader environment checks before deciding the repository root.
If the directory structure changes in the future, the logic that checks if the rootDir basename is "build" might not hold. You might consider using environment variables or a robust configuration approach for a more flexible setup.


9-13: Interface definition is clear.
The allowed properties in IBuildConfig are well-defined and typed.

src/routes/cache.ts (1)

2-2: Centralized config import is aligned with the new approach.
Migrating away from direct JSON imports makes maintenance more streamlined.

src/controllers/dynamic/worldStateController.ts (1)

3-3: Consistent configuration import.
Importing buildConfig from the new service centralizes configuration usage across the codebase.

src/controllers/api/loginController.ts (1)

4-4: Configuration import refactored.
Now that the config logic is moved to a service, it fosters consistency and reduces duplication.

**Actionable comments posted: 1** <details> <summary>📜 Review details</summary> **Configuration used: .coderabbit.yaml** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 212a5e703536cbea080765a46ec10bc220724005 and 8f6fd33b77451f9a1d0e75e2c04e966199b6c0ab. </details> <details> <summary>📒 Files selected for processing (4)</summary> * `src/controllers/api/loginController.ts` (1 hunks) * `src/controllers/dynamic/worldStateController.ts` (1 hunks) * `src/routes/cache.ts` (1 hunks) * `src/services/buildConfigService.ts` (1 hunks) </details> <details> <summary>🔇 Additional comments (6)</summary> <details> <summary>src/services/buildConfigService.ts (3)</summary> `1-2`: **Imports look good.** Using `path` and `fs` is appropriate for file system operations. --- `4-6`: **Consider broader environment checks before deciding the repository root.** If the directory structure changes in the future, the logic that checks if the `rootDir` basename is `"build"` might not hold. You might consider using environment variables or a robust configuration approach for a more flexible setup. --- `9-13`: **Interface definition is clear.** The allowed properties in `IBuildConfig` are well-defined and typed. </details> <details> <summary>src/routes/cache.ts (1)</summary> `2-2`: **Centralized config import is aligned with the new approach.** Migrating away from direct JSON imports makes maintenance more streamlined. </details> <details> <summary>src/controllers/dynamic/worldStateController.ts (1)</summary> `3-3`: **Consistent configuration import.** Importing `buildConfig` from the new service centralizes configuration usage across the codebase. </details> <details> <summary>src/controllers/api/loginController.ts (1)</summary> `4-4`: **Configuration import refactored.** Now that the config logic is moved to a service, it fosters consistency and reduces duplication. </details> </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
@ -0,0 +4,4 @@
const rootDir = path.join(__dirname, "../..");
const repoDir = path.basename(rootDir) == "build" ? path.join(rootDir, "..") : rootDir;
const buildConfigPath = path.join(repoDir, "static/data/buildConfig.json");
export const buildConfig = JSON.parse(fs.readFileSync(buildConfigPath, "utf-8")) as IBuildConfig;
coderabbitai[bot] (Migrated from github.com) commented 2024-12-29 14:56:30 -08:00
Author
Owner

🛠️ Refactor suggestion

Add error handling for file reading.
Synchronous file operations may block the event loop, and any read/parse failure will throw an error immediately. Consider wrapping this in a try/catch or using asynchronous I/O.

- export const buildConfig = JSON.parse(fs.readFileSync(buildConfigPath, "utf-8")) as IBuildConfig;
+ let parsedConfig: IBuildConfig;
+ try {
+   const raw = fs.readFileSync(buildConfigPath, "utf-8");
+   parsedConfig = JSON.parse(raw) as IBuildConfig;
+ } catch (e) {
+   throw new Error(`Failed to load build config: ${e.message}`);
+ }
+ export const buildConfig = parsedConfig;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

let parsedConfig: IBuildConfig;
try {
  const raw = fs.readFileSync(buildConfigPath, "utf-8");
  parsedConfig = JSON.parse(raw) as IBuildConfig;
} catch (e) {
  throw new Error(`Failed to load build config: ${e.message}`);
}
export const buildConfig = parsedConfig;
_:hammer_and_wrench: Refactor suggestion_ **Add error handling for file reading.** Synchronous file operations may block the event loop, and any read/parse failure will throw an error immediately. Consider wrapping this in a try/catch or using asynchronous I/O. ```diff - export const buildConfig = JSON.parse(fs.readFileSync(buildConfigPath, "utf-8")) as IBuildConfig; + let parsedConfig: IBuildConfig; + try { + const raw = fs.readFileSync(buildConfigPath, "utf-8"); + parsedConfig = JSON.parse(raw) as IBuildConfig; + } catch (e) { + throw new Error(`Failed to load build config: ${e.message}`); + } + export const buildConfig = parsedConfig; ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. `````suggestion let parsedConfig: IBuildConfig; try { const raw = fs.readFileSync(buildConfigPath, "utf-8"); parsedConfig = JSON.parse(raw) as IBuildConfig; } catch (e) { throw new Error(`Failed to load build config: ${e.message}`); } export const buildConfig = parsedConfig; ````` </details> <!-- suggestion_end --> <!-- This is an auto-generated comment by CodeRabbit -->
Sign in to join this conversation.
No description provided.