-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThis 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 Changes
Possibly related PRs
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 logicThe sort comparison using
Date.parse()
could be simplified and made more efficient by directly comparing thelastPublished
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 calculationThe offset calculation could potentially result in issues if
total
is very close toconstants.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 datasetsThe 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 trueWhen
emitMostRecent
is true, thehistoricalEventsNumber
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
⛔ 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", |
There was a problem hiding this comment.
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 changescomponents/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
WHY
This PR is to publish the Webflow v1 inorder not to break existing flow
Summary by CodeRabbit
Release Notes
New Features
Improvements
new-ecommerce-order
andnew-site-published
sources.Bug Fixes
Documentation