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

Publish Webflow v1 components #14829

Merged
merged 1 commit into from
Dec 4, 2024
Merged

Publish Webflow v1 components #14829

merged 1 commit into from
Dec 4, 2024

Conversation

vunguyenhung
Copy link
Collaborator

@vunguyenhung vunguyenhung commented Dec 4, 2024

WHY

This PR is to publish the Webflow v1 inorder not to break existing flow

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced version updates for multiple Webflow actions and sources to enhance integration stability.
  • Improvements

    • Enhanced historical event handling in the new-ecommerce-order and new-site-published sources.
  • Bug Fixes

    • No significant bug fixes; however, the versioning ensures all components are up-to-date for better performance.
  • Documentation

    • Updated version numbers across various components to reflect the latest changes.

Copy link

vercel bot commented Dec 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Dec 4, 2024 8:58am
pipedream-docs ⬜️ Ignored (Inspect) Dec 4, 2024 8:58am
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Dec 4, 2024 8:58am

Copy link
Contributor

coderabbitai bot commented Dec 4, 2024

Walkthrough

This pull request includes updates to multiple files in the Webflow integration, primarily focusing on incrementing version numbers across various action and source modules. The changes span from create-collection-item.mjs to new-ticket-property-change.mjs, with all files maintaining their existing functionality, logic, and structure. The updates reflect a consistent effort to manage versioning without altering any operational aspects of the components.

Changes

File Path Change Summary
components/webflow/actions/create-collection-item/create-collection-item.mjs Version updated from "0.1.7" to "1.0.1"
components/webflow/actions/delete-collection-item/delete-collection-item.mjs Version updated from "0.0.5" to "1.0.1"
components/webflow/actions/fulfill-order/fulfill-order.mjs Version updated from "0.0.4" to "1.0.1"
components/webflow/actions/get-collection-item/get-collection-item.mjs Version updated from "0.1.7" to "1.0.1"
components/webflow/actions/get-collection/get-collection.mjs Version updated from "0.0.5" to "1.0.1"
components/webflow/actions/get-item-inventory/get-item-inventory.mjs Version updated from "0.0.5" to "1.0.1"
components/webflow/actions/get-order/get-order.mjs Version updated from "0.0.4" to "1.0.1"
components/webflow/actions/get-site/get-site.mjs Version updated from "0.0.4" to "1.0.1"
components/webflow/actions/list-collection-items/list-collection-items.mjs Version updated from "0.0.5" to "1.0.1"
components/webflow/actions/list-collections/list-collections.mjs Version updated from "0.0.4" to "1.0.1"
components/webflow/actions/list-orders/list-orders.mjs Version updated from "0.0.4" to "1.0.1"
components/webflow/actions/list-sites/list-sites.mjs Version updated from "0.0.4" to "1.0.1"
components/webflow/actions/publish-site/publish-site.mjs Version updated from "0.0.4" to "1.0.1"
components/webflow/actions/refund-order/refund-order.mjs Version updated from "0.0.4" to "1.0.1"
components/webflow/actions/unfulfill-order/unfulfill-order.mjs Version updated from "0.0.4" to "1.0.1"
components/webflow/actions/update-collection-item/update-collection-item.mjs Version updated from "0.1.7" to "1.0.1"
components/webflow/actions/update-item-inventory/update-item-inventory.mjs Version updated from "0.0.5" to "1.0.1"
components/webflow/actions/update-order/update-order.mjs Version updated from "0.0.4" to "1.0.1"
components/webflow/package.json Version updated from "0.4.6" to "0.4.7"
components/webflow/sources/changed-collection-item/changed-collection-item.mjs Version updated from "0.2.3" to "1.0.1"
components/webflow/sources/changed-ecommerce-inventory/changed-ecommerce-inventory.mjs Version updated from "0.2.3" to "1.0.1"
components/webflow/sources/changed-ecommerce-order/changed-ecommerce-order.mjs Version updated from "0.2.3" to "1.0.1"
components/webflow/sources/new-collection-item/new-collection-item.mjs Version updated from "0.2.3" to "1.0.1"
components/webflow/sources/new-deleted-collection-item/new-deleted-collection-item.mjs Version updated from "0.2.3" to "1.0.1"
components/webflow/sources/new-ecommerce-order/new-ecommerce-order.mjs Version updated from "0.2.3" to "1.0.1"
components/webflow/sources/new-form-submission/new-form-submission.mjs Version updated from "0.2.4" to "1.0.1"
components/webflow/sources/new-site-published/new-site-published.mjs Version updated from "0.2.3" to "1.0.1"

Possibly related PRs

Suggested reviewers

  • michelle0927

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.

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 (4)
components/webflow/sources/new-site-published/new-site-published.mjs (1)

Line range hint 21-24: Improve date comparison logic

The sort comparison using Date.parse() could be simplified and made more efficient by directly comparing the lastPublished strings since they appear to be ISO format dates.

-      const sorted = sliced.sort((a, b) => Date.parse(a.lastPublished) > Date.parse(b.lastPublished)
-        ? -1
-        : 1);
+      const sorted = sliced.sort((a, b) => b.lastPublished.localeCompare(a.lastPublished));
components/webflow/sources/new-collection-item/new-collection-item.mjs (1)

Line range hint 28-37: Add bounds checking for offset calculation

The offset calculation could potentially result in issues if total is very close to constants.LIMIT. Consider adding bounds checking.

       if (total > constants.LIMIT) {
         const offset = Math.floor(total / constants.LIMIT);
+        if (offset <= 1) {
+          events.reverse();
+          this.emitHistoricalEvents(events);
+          return;
+        }
 
         events = (await this._makeRequest(path, {
           offset,
         })).items.reverse();
 
         events.push(...(await this._makeRequest(path, {
-          offset: offset - 1,
+          offset: Math.max(0, offset - 1),
         })).items.reverse());
components/webflow/sources/new-ecommerce-order/new-ecommerce-order.mjs (2)

Line range hint 45-57: Optimize memory usage for large datasets

The current implementation accumulates all events in memory before slicing to the last 100. For large datasets, this could cause memory issues.

       let toEmit = [];
       let events = [];
       const params = {
         offset: 0,
+        limit: 100,  // Limit each request to reduce memory usage
       };
 
       do {
         events = await this._makeRequest(path, params);
 
-        if (toEmit.push(...events) > 100) {
-          toEmit = toEmit.slice(toEmit.length - 100, toEmit.length);
-        }
+        toEmit = [...events, ...toEmit.slice(0, 100 - events.length)];
 
         params.offset += 1;
       } while (events.length > 0);

Line range hint 11-19: Consider adding validation for historicalEventsNumber when emitMostRecent is true

When emitMostRecent is true, the historicalEventsNumber might not accurately reflect the number of events emitted due to the 100-event limit.

Add a warning in the description:

       description: "Defaults to `0`. Number of historical events to fetch and emit. Maximum is `100`. " +
-        "",
+        "Note: When emitMostRecent is true, the actual number of events emitted may be less than specified.",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6d72e75 and 0ea1337.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (27)
  • components/webflow/actions/create-collection-item/create-collection-item.mjs (1 hunks)
  • components/webflow/actions/delete-collection-item/delete-collection-item.mjs (1 hunks)
  • components/webflow/actions/fulfill-order/fulfill-order.mjs (1 hunks)
  • components/webflow/actions/get-collection-item/get-collection-item.mjs (1 hunks)
  • components/webflow/actions/get-collection/get-collection.mjs (1 hunks)
  • components/webflow/actions/get-item-inventory/get-item-inventory.mjs (1 hunks)
  • components/webflow/actions/get-order/get-order.mjs (1 hunks)
  • components/webflow/actions/get-site/get-site.mjs (1 hunks)
  • components/webflow/actions/list-collection-items/list-collection-items.mjs (1 hunks)
  • components/webflow/actions/list-collections/list-collections.mjs (1 hunks)
  • components/webflow/actions/list-orders/list-orders.mjs (1 hunks)
  • components/webflow/actions/list-sites/list-sites.mjs (1 hunks)
  • components/webflow/actions/publish-site/publish-site.mjs (1 hunks)
  • components/webflow/actions/refund-order/refund-order.mjs (1 hunks)
  • components/webflow/actions/unfulfill-order/unfulfill-order.mjs (1 hunks)
  • components/webflow/actions/update-collection-item/update-collection-item.mjs (1 hunks)
  • components/webflow/actions/update-item-inventory/update-item-inventory.mjs (1 hunks)
  • components/webflow/actions/update-order/update-order.mjs (1 hunks)
  • components/webflow/package.json (1 hunks)
  • components/webflow/sources/changed-collection-item/changed-collection-item.mjs (1 hunks)
  • components/webflow/sources/changed-ecommerce-inventory/changed-ecommerce-inventory.mjs (1 hunks)
  • components/webflow/sources/changed-ecommerce-order/changed-ecommerce-order.mjs (1 hunks)
  • components/webflow/sources/new-collection-item/new-collection-item.mjs (1 hunks)
  • components/webflow/sources/new-deleted-collection-item/new-deleted-collection-item.mjs (1 hunks)
  • components/webflow/sources/new-ecommerce-order/new-ecommerce-order.mjs (1 hunks)
  • components/webflow/sources/new-form-submission/new-form-submission.mjs (1 hunks)
  • components/webflow/sources/new-site-published/new-site-published.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (23)
  • components/webflow/package.json
  • components/webflow/actions/list-sites/list-sites.mjs
  • components/webflow/actions/get-collection/get-collection.mjs
  • components/webflow/actions/publish-site/publish-site.mjs
  • components/webflow/actions/list-collection-items/list-collection-items.mjs
  • components/webflow/actions/fulfill-order/fulfill-order.mjs
  • components/webflow/actions/get-item-inventory/get-item-inventory.mjs
  • components/webflow/actions/list-collections/list-collections.mjs
  • components/webflow/actions/get-order/get-order.mjs
  • components/webflow/actions/get-site/get-site.mjs
  • components/webflow/sources/new-deleted-collection-item/new-deleted-collection-item.mjs
  • components/webflow/actions/get-collection-item/get-collection-item.mjs
  • components/webflow/actions/unfulfill-order/unfulfill-order.mjs
  • components/webflow/sources/changed-ecommerce-inventory/changed-ecommerce-inventory.mjs
  • components/webflow/actions/list-orders/list-orders.mjs
  • components/webflow/actions/delete-collection-item/delete-collection-item.mjs
  • components/webflow/actions/refund-order/refund-order.mjs
  • components/webflow/sources/changed-collection-item/changed-collection-item.mjs
  • components/webflow/actions/create-collection-item/create-collection-item.mjs
  • components/webflow/sources/new-form-submission/new-form-submission.mjs
  • components/webflow/actions/update-order/update-order.mjs
  • components/webflow/sources/changed-ecommerce-order/changed-ecommerce-order.mjs
  • components/webflow/actions/update-item-inventory/update-item-inventory.mjs
🔇 Additional comments (4)
components/webflow/sources/new-site-published/new-site-published.mjs (1)

9-9: Version 1.0.1 indicates stable API

The version bump to 1.0.1 suggests this component is now considered stable. Ensure all breaking changes are documented and that the component's API is now considered stable.

✅ Verification successful

Version 1.0.1 is consistent across Webflow components

The version 1.0.1 is uniformly applied across all Webflow source components, indicating a coordinated versioning strategy. This is not an isolated version bump but rather part of a standardized versioning approach for the Webflow integration components. No breaking changes are evident in the implementation, and the component maintains consistency with other Webflow sources.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for potential breaking changes in git history
git log -S"version" --patch -- components/webflow/sources/new-site-published/new-site-published.mjs | grep -A 5 "^+"

Length of output: 0


Script:

#!/bin/bash
# Let's check the current file content and its git history using different commands
echo "=== Current file content ==="
cat components/webflow/sources/new-site-published/new-site-published.mjs

echo -e "\n=== Recent commits touching this file ==="
git log --oneline -- components/webflow/sources/new-site-published/new-site-published.mjs

echo -e "\n=== Checking for version patterns in the repository ==="
rg "version.*1\.0\." -A 2 -B 2 components/webflow/sources/

Length of output: 6492

components/webflow/sources/new-collection-item/new-collection-item.mjs (1)

9-9: Version 1.0.1 aligns with component suite

The version bump to 1.0.1 maintains consistency with other Webflow components in this release.

components/webflow/sources/new-ecommerce-order/new-ecommerce-order.mjs (1)

8-8: Version 1.0.1 aligns with component suite

The version bump to 1.0.1 maintains consistency with other Webflow components in this release.

components/webflow/actions/update-collection-item/update-collection-item.mjs (1)

7-7: LGTM! Verify version consistency across Webflow components.

The version bump to 1.0.1 aligns with the PR objective to publish v1 components.

Let's verify version consistency across all Webflow components:

✅ Verification successful

✅ Version consistency confirmed across Webflow action components

All Webflow action components are consistently using version "1.0.1", which aligns with the PR objective to publish v1 components. The package.json version (0.4.7) is a separate concern as it represents the overall component collection version.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check version numbers across all Webflow components
# Expected: All components should be at version 1.0.1

# Search for version declarations in all Webflow component files
rg '"version":' components/webflow/ -A 1

Length of output: 177


Script:

#!/bin/bash
# Let's check version fields in individual action/trigger files
rg '"version":' components/webflow/actions/ -A 1

Length of output: 50


Script:

#!/bin/bash
# Let's try a different approach to find version fields in mjs files
fd -e mjs . components/webflow/actions -x grep -A 1 'version:' {}

Length of output: 751

@@ -4,7 +4,7 @@ export default {
key: "webflow-update-collection-item",
name: "Update Collection Item",
description: "Update collection item. [See the documentation](https://developers.webflow.com/#update-collection-item)",
version: "0.1.7",
version: "1.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Version bump in individual action file needs documentation

The package.json shows the component is at version 0.4.7, while this individual action file shows version 1.0.1. Since there's no CHANGELOG.md file present and this appears to be an individual action version rather than a component-wide version bump, documentation of changes should be added either:

  • In a new CHANGELOG.md file in the components/webflow directory
  • Or as detailed comments in the action file itself explaining the breaking changes
  • components/webflow/actions/update-collection-item/update-collection-item.mjs: Add documentation for version 1.0.1 changes
  • components/webflow: Consider adding a CHANGELOG.md file for tracking significant changes
🔗 Analysis chain

Consider adding a CHANGELOG entry for the major version bump.

Since this is a major version bump (0.1.7 → 1.0.1), it would be helpful to document any breaking changes or significant updates in a CHANGELOG.md file.

Let's check if a CHANGELOG exists:


Let me verify the version history to confirm if this is actually a major version bump.


Let me check the git history to see the previous version:


Let me try one last approach to find version information:


Let me check the package.json for version information:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for CHANGELOG entries
# Expected: Should find CHANGELOG.md with v1.0.1 entry

# Look for CHANGELOG files in the Webflow component directory
fd -i changelog components/webflow/

# If found, check for version entries
if [ -f "components/webflow/CHANGELOG.md" ]; then
  rg "1.0.1" "components/webflow/CHANGELOG.md"
fi

Length of output: 82


Script:

#!/bin/bash
# Check the git history for previous version
rg -B 2 -A 2 'version:' components/webflow/actions/update-collection-item/update-collection-item.mjs

Length of output: 305


Script:

#!/bin/bash
# Check git history for version changes
git log -p components/webflow/actions/update-collection-item/update-collection-item.mjs | rg -B 2 -A 2 'version:'

Length of output: 0


Script:

#!/bin/bash
# Look for any version-related files or package.json in the webflow component
fd -e json package.json components/webflow/

# Check if there's any version tracking in the component's root
ls -la components/webflow/

Length of output: 605


Script:

#!/bin/bash
# Check package.json content
cat components/webflow/package.json

# Also check if there are any other version files in actions directory
fd -t f . components/webflow/actions/ | rg -i 'version|changelog'

Length of output: 613

@GTFalcao GTFalcao merged commit e2445aa into master Dec 4, 2024
10 of 11 checks passed
@GTFalcao GTFalcao deleted the feat/publish-webflow-v1 branch December 4, 2024 16:45
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