Skip to content

feat: export-workbook refactor#512

Merged
carlbrugger merged 16 commits intomainfrom
feat/export-workbook-refactor
May 20, 2024
Merged

feat: export-workbook refactor#512
carlbrugger merged 16 commits intomainfrom
feat/export-workbook-refactor

Conversation

@carlbrugger
Copy link
Contributor

@carlbrugger carlbrugger commented Apr 23, 2024

Please explain how to summarize this PR for the Changelog:

Added:

  • New @private/sandbox package for development and testing of plugins
    • Includes README with setup instructions
    • Sandbox environment configuration using .env files
    • NPM scripts for running the sandbox with different environments and deploying/listing/deleting plugins

Updated:

  • @flatfile/plugin-export-workbook:
    • Added new plugin option: autoDownload
    • Refactored plugin to use @flatfile/plugin-job-handler for job handling and progress updates
    • Updated README with new usage instructions and parameter details
    • Switched to Rollup for build process
  • Updated @flatfile/api peer dependency to ^1.8.9 across all plugins
  • Minor dependency updates in several packages

Tell code reviewer how and what to test:

Test the PR changes in the new @private/sandbox package.

import type { FlatfileListener } from '@flatfile/listener'

import { exportWorkbookPlugin } from '@flatfile/plugin-export-workbook'

export default async function (listener: FlatfileListener) {
  listener.use(exportWorkbookPlugin({ autoDownload: true, debug: true }))
}

@carlbrugger carlbrugger force-pushed the feat/export-workbook-refactor branch 2 times, most recently from 89e54e5 to e2e316b Compare April 25, 2024 17:02
@carlbrugger carlbrugger force-pushed the feat/export-workbook-refactor branch 2 times, most recently from 718ff94 to 329c87c Compare May 15, 2024 22:25
@carlbrugger carlbrugger changed the title WIP: export-workbook refactor feat: export-workbook refactor May 20, 2024
@carlbrugger carlbrugger marked this pull request as ready for review May 20, 2024 20:56
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 20, 2024

Walkthrough

This update introduces significant enhancements and refactoring across various Flatfile plugins and utilities. Key changes include adding an automatic download option for exported workbooks, updating environment variable handling, and improving file sanitization and progress tracking. Additionally, the .gitignore file now excludes all .env.* files except for .env.example. The response-rejection utility has been patched to prevent erroneous deletions of valid records.

Changes

Files Change Summary
.gitignore Modified to exclude all .env.* files except for .env.example.
flatfilers/sandbox/.env.example Added environment variables for Flatfile API URL, environment ID, and API key.
flatfilers/sandbox/README.md Provided setup instructions for the development sandbox for plugins.
flatfilers/sandbox/src/index.ts Introduced an export of a default asynchronous function for exporting workbooks with auto-download and debug options.
plugins/export-workbook/README.md Updated parameter descriptions, usage instructions, and import examples to reflect new autoDownload option.
plugins/export-workbook/rollup.config.mjs Imported and exported configuration using buildConfig from @flatfile/rollup-config.
plugins/export-workbook/src/index.ts Refactored to use jobHandler for handling listener events and included a tick parameter for progress reporting.
plugins/export-workbook/src/plugin.ts Added autoDownload option to PluginOptions, updated function signatures, and refactored error handling and progress tracking logic.
plugins/export-workbook/src/utils.ts Introduced functions for sanitizing file names, Excel sheet names, and generating alpha patterns for worksheet cells.
utils/response-rejection/CHANGELOG.md Documented patch to prevent erroneous deletions of valid records when deleteSubmitted flag is set to "true".
utils/response-rejection/src/index.ts Updated function usage from @flatfile/util-common, modified record update and deletion logic based on deleteSubmitted flag.

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

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: 5

Out of diff range and nitpick comments (1)
utils/response-rejection/CHANGELOG.md (1)

Line range hint 67-67: Specify the language for the fenced code block to improve readability and syntax highlighting.

- ```
+ ```plaintext

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: 1

Outside diff range and nitpick comments (1)
flatfilers/sandbox/README.md (1)

Line range hint 31-31: Remove extra blank lines to maintain consistent formatting.

-

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

Outside diff range and nitpick comments (1)
flatfilers/sandbox/README.md (1)

Line range hint 31-31: Remove extra blank lines to maintain consistent formatting.

-

@carlbrugger carlbrugger force-pushed the feat/export-workbook-refactor branch from 1728c5e to e429fbb Compare May 20, 2024 22:10
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

Outside diff range and nitpick comments (1)
flatfilers/sandbox/README.md (1)

Line range hint 31-31: Remove extra blank lines to maintain consistent formatting.

- 

Other plugins installed as deps must be in devDeps for turbo to build in the correct order
@carlbrugger carlbrugger merged commit 1d253d8 into main May 20, 2024
@carlbrugger carlbrugger deleted the feat/export-workbook-refactor branch May 20, 2024 23:38
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