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/monorepo cleanup #455

Merged
merged 16 commits into from
Apr 8, 2024
Merged

Feat/monorepo cleanup #455

merged 16 commits into from
Apr 8, 2024

Conversation

carlbrugger
Copy link
Contributor

@carlbrugger carlbrugger commented Mar 29, 2024

Please explain how to summarize this PR for the Changelog:

  • Refactor
    • Improved code organization and import management across various plugins.
    • Replacement of axios with cross-fetch
    • Centralized Rollup configuration for better build management.
  • Bug Fixes
    • Enhanced type checking and error handling in several plugins.
  • New Features
    • Utilize console logging utility.
    • Added cleanup functionality for tests to ensure a clean state post-execution.
  • Documentation
    • Adjustments and enhancements were made to internal documentation, focusing on import statements and error handling practices.

Tell code reviewer how and what to test:

Summary by CodeRabbit

  • Refactor
    • Optimized import statements using TypeScript's type for type-only imports.
    • Centralized Rollup configuration for plugins and utilities.
  • New Features
    • Implemented setup generation for YAML schema workbooks.
  • Bug Fixes
    • Enhanced HTTP request handling by replacing axios with fetch.
  • Documentation
    • Updated build command instructions in README.md.
  • Chores
    • Increased timeout for "Test" job in GitHub workflows.
    • Introduced custom console.log for improved test output.
    • Added cleanup functionality in tests for better resource management.
  • Tests
    • Adjusted Jest configuration for optimized test execution.

Closes: https://github.com/FlatFilers/support-triage/issues/1166

Copy link
Contributor

coderabbitai bot commented Mar 29, 2024

Walkthrough

This update focuses on optimizing and refactoring the codebase across various plugins and utilities. Key changes include the adoption of TypeScript's type keyword for type-only imports, centralizing Rollup configuration via a shared buildConfig function, and transitioning from axios to cross-fetch for HTTP requests. The adjustments aim to enhance type safety, streamline configurations, and unify HTTP request handling across the project, resulting in a more maintainable and consistent code structure.

Changes

File(s) Change Summary
.plugins/.../rollup.config.mjs, utils/.../rollup.config.mjs, plugins/webhook-egress/rollup.config.mjs, plugins/webhook-event-forwarder/rollup.config.mjs Refactored to use buildConfig from @flatfile/rollup-config for Rollup configuration.
.plugins/record-hook/src/..., .plugins/space-configure/src/space.configure.spec.ts, .plugins/sql-ddl-converter/src/..., .plugins/tsv-extractor/src/index.ts, plugins/webhook-event-forwarder/src/..., plugins/pdf-extractor/src/..., plugins/psv-extractor/src/index.ts, utils/common/src/async.batch.spec.ts, utils/common/src/async.batch.ts, utils/fetch-schema/src/index.ts Modified import statements to use TypeScript's type keyword for type-only imports.
.plugins/sql-ddl-converter/src/setup.factory.ts, utils/fetch-schema/src/index.ts Converted type aliases to interfaces and made adjustments to configurations.
plugins/yaml-schema/src/... Streamlined code structure by moving functions to separate files and adjusting import statements.
test/..., utils/testing/src/... Introduced custom console.log implementation, removed logging function, added cleanup functionality for tests, replaced axios with cross-fetch, and adjusted error handling.
.changeset/dirty-poets-change.md, .github/workflows/test.yml, README.md Documented refactoring and optimization, increased "Test" job timeout, and updated build command.
bundlers/rollup-config/index.mjs, jest.config.js Introduced a new Rollup configuration for building JavaScript libraries and updated Jest configuration for testing.

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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/coderabbit-overrides.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.

@carlbrugger carlbrugger force-pushed the feat/monorepo-cleanup branch 11 times, most recently from 37819b7 to 8beba77 Compare April 4, 2024 18:47
@carlbrugger carlbrugger marked this pull request as ready for review April 4, 2024 19:03
@carlbrugger
Copy link
Contributor Author

@coderabbitai review

utils/file-buffer/src/index.ts Show resolved Hide resolved
utils/file-buffer/src/index.ts Show resolved Hide resolved
plugins/yaml-schema/src/setup.factory.ts Show resolved Hide resolved
plugins/merge-connection/src/sync.workbook.ts Show resolved Hide resolved
plugins/pdf-extractor/src/plugin.ts Show resolved Hide resolved
utils/testing/src/test.helpers.ts Show resolved Hide resolved
@carlbrugger
Copy link
Contributor Author

@coderabbitai summarize this PR

Copy link
Contributor

coderabbitai bot commented Apr 4, 2024

Tip

For best results, initiate chat on the files or code changes.

@carlbrugger, the summary provided in the PR objectives and AI-generated overview offers a comprehensive overview of the changes made in the "Feat/monorepo cleanup" PR. It details the centralization of Rollup configuration, optimization of import statements, replacement of axios with cross-fetch, introduction of new functionalities like a custom console.log implementation, and general improvements in code structure and error handling across various plugins and utilities within the monorepo. This summary encapsulates the main objectives and changes, focusing on enhancing code maintainability, consistency, and efficiency. If you need further details or specific insights on any part of the PR, feel free to ask!

@carlbrugger carlbrugger force-pushed the feat/monorepo-cleanup branch 2 times, most recently from 405fa13 to 83357c5 Compare April 4, 2024 21:11
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@carlbrugger carlbrugger force-pushed the feat/monorepo-cleanup branch 4 times, most recently from c842b0c to 7482e51 Compare April 4, 2024 23:10
README.md Outdated Show resolved Hide resolved
@carlbrugger carlbrugger force-pushed the feat/monorepo-cleanup branch 2 times, most recently from 2363d98 to ad569ef Compare April 4, 2024 23:19
@carlbrugger carlbrugger marked this pull request as ready for review April 5, 2024 00:07
@bangarang
Copy link
Collaborator

This is so awesome! And glad that sucrase worked out :)

Only feedback is that I don't really like moving the rollup config to a rogue file that's accessed via relative path.
Can we make that a util/rollup-config package named something like @flatfile/rollup-config and then import it like a normal package? We could even share it to the flatfile-core-libraries then and manage the dependencies for it on it's own.

@bangarang
Copy link
Collaborator

import { buildConfig } from '../../rollup.config.mjs'

vs

import { buildConfig } from '@flatfile/rollup-config'

@carlbrugger carlbrugger force-pushed the feat/monorepo-cleanup branch from 166cb68 to d93b0ba Compare April 5, 2024 15:44
@carlbrugger carlbrugger force-pushed the feat/monorepo-cleanup branch from d47eac1 to 5b68f83 Compare April 5, 2024 17:58
@carlbrugger carlbrugger force-pushed the feat/monorepo-cleanup branch from 9b6b89f to 5455e52 Compare April 5, 2024 20:39
README.md Outdated
@@ -9,9 +9,9 @@ To get started building plugins:

Additional Commands

There are more commands that you can run on every plugin at the root level. For instance, the release is run by Github so you don't have to do this manually.
There are more commands that you can run on every plugin at the root level. For instance, the release is run by GitHub so you don't have to do this manually.
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a comma for clarity after "GitHub".

- For instance, the release is run by GitHub so you don't have to do this manually.
+ For instance, the release is run by GitHub, so you don't have to do this manually.

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.

Suggested change
There are more commands that you can run on every plugin at the root level. For instance, the release is run by GitHub so you don't have to do this manually.
There are more commands that you can run on every plugin at the root level. For instance, the release is run by GitHub, so you don't have to do this manually.

@carlbrugger carlbrugger force-pushed the feat/monorepo-cleanup branch from 5455e52 to ce61504 Compare April 5, 2024 20:48
@carlbrugger carlbrugger force-pushed the feat/monorepo-cleanup branch from ce61504 to 285fc7b Compare April 5, 2024 20:49
README.md Show resolved Hide resolved
.changeset/dirty-poets-change.md Show resolved Hide resolved
@carlbrugger carlbrugger merged commit e9ea2d8 into main Apr 8, 2024
2 checks passed
@carlbrugger carlbrugger deleted the feat/monorepo-cleanup branch April 8, 2024 12:08
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