@replohq/sdk 1.11.0 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analytics/analytics-provider.d.ts +1 -1
- package/analytics/hooks/use-collection-viewed-analytics.js +1 -1
- package/analytics/hooks/use-product-viewed-analytics.js +1 -1
- package/cart/cart-loader.js +1 -1
- package/cart/gateways/cart-constants.js +1 -1
- package/content.js +2 -2
- package/env.js +1 -1
- package/gateways/canopy-api.js +2 -2
- package/lib/buildMetadata.js +3 -3
- package/loaders/loader-error-boundary.js +2 -2
- package/loaders/loader-error-details.js +1 -1
- package/loaders/preview-placeholder.js +1 -1
- package/next/image-loader.js +1 -1
- package/package.json +4 -4
|
@@ -8,7 +8,7 @@ export declare function AnalyticsProvider({ children, checkoutProvider, }: React
|
|
|
8
8
|
* Returns the AnalyticsSink from the nearest AnalyticsProvider.
|
|
9
9
|
* Throws if used outside of an AnalyticsProvider.
|
|
10
10
|
*/
|
|
11
|
-
export declare function useAnalytics(): AnalyticsSink
|
|
11
|
+
export declare function useAnalytics(): AnalyticsSink;
|
|
12
12
|
/**
|
|
13
13
|
* Returns the AnalyticsSink if an AnalyticsProvider is present, or null otherwise.
|
|
14
14
|
* Does not throw -- safe to use in components that may render with or without analytics.
|
|
@@ -9,7 +9,7 @@ function useCollectionViewedAnalytics({
|
|
|
9
9
|
const analytics = useAnalytics();
|
|
10
10
|
const lastTrackedRef = useRef(null);
|
|
11
11
|
useEffect(() => {
|
|
12
|
-
if (!
|
|
12
|
+
if (!collection || !products) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
if (lastTrackedRef.current === collection.id) {
|
|
@@ -8,7 +8,7 @@ function useProductViewedAnalytics({
|
|
|
8
8
|
const analytics = useAnalytics();
|
|
9
9
|
const lastTrackedRef = useRef(null);
|
|
10
10
|
useEffect(() => {
|
|
11
|
-
if (
|
|
11
|
+
if (product && selectedVariant) {
|
|
12
12
|
const trackingKey = `${product.id}-${selectedVariant.id}`;
|
|
13
13
|
if (lastTrackedRef.current !== trackingKey) {
|
|
14
14
|
lastTrackedRef.current = trackingKey;
|
package/cart/cart-loader.js
CHANGED
|
@@ -8,7 +8,7 @@ async function CartLoader({
|
|
|
8
8
|
country,
|
|
9
9
|
shouldReconcileSuppliedCart
|
|
10
10
|
}) {
|
|
11
|
-
const cart =
|
|
11
|
+
const cart = process.env.NODE_ENV === "development" ? null : await getCartAction().catch((error) => {
|
|
12
12
|
unstable_rethrow(error);
|
|
13
13
|
console.warn("[Replo] Failed to load cart:", error);
|
|
14
14
|
return null;
|
package/content.js
CHANGED
|
@@ -370,7 +370,7 @@ async function getEntryListingStatus({
|
|
|
370
370
|
slug,
|
|
371
371
|
contentSource
|
|
372
372
|
}) {
|
|
373
|
-
if (
|
|
373
|
+
if (process.env.NODE_ENV !== "development") {
|
|
374
374
|
return "published";
|
|
375
375
|
}
|
|
376
376
|
const [draft, publishedCopy] = await Promise.all([
|
|
@@ -445,7 +445,7 @@ async function readVisibleEntry({
|
|
|
445
445
|
if (getContentEntryFieldValidationIssues({
|
|
446
446
|
fields: collectionSchema.fields,
|
|
447
447
|
values,
|
|
448
|
-
requireRequiredFields:
|
|
448
|
+
requireRequiredFields: process.env.NODE_ENV !== "development"
|
|
449
449
|
}).length > 0) {
|
|
450
450
|
return null;
|
|
451
451
|
}
|
package/env.js
CHANGED
|
@@ -13,7 +13,7 @@ const wranglerConfigSchema = z.object({ vars: envSchema });
|
|
|
13
13
|
class MissingWranglerConfigError extends CanopyError {
|
|
14
14
|
}
|
|
15
15
|
const isDeployedWorker = () => {
|
|
16
|
-
return process.env.BUILD_ENV !== "build" && process.env.NEXT_PHASE !== "phase-production-build";
|
|
16
|
+
return process.env.NODE_ENV === "production" && process.env.BUILD_ENV !== "build" && process.env.NEXT_PHASE !== "phase-production-build";
|
|
17
17
|
};
|
|
18
18
|
const getEnv = async () => {
|
|
19
19
|
if (isDeployedWorker()) {
|
package/gateways/canopy-api.js
CHANGED
|
@@ -78,7 +78,7 @@ class CanopyApiGateway {
|
|
|
78
78
|
});
|
|
79
79
|
} catch (error) {
|
|
80
80
|
let message = `Failed to POST to canopy-api at ${url}: ${error}`;
|
|
81
|
-
if (
|
|
81
|
+
if (process.env.NODE_ENV !== "production") {
|
|
82
82
|
message += `
|
|
83
83
|
|
|
84
84
|
apiHost: ${this.apiHost}
|
|
@@ -98,7 +98,7 @@ If you're running locally, make sure the canopy-api cloudflare worker is running
|
|
|
98
98
|
return await fetch(url, { signal: abortController.signal });
|
|
99
99
|
} catch (error) {
|
|
100
100
|
let message = `Failed to GET from canopy-api at ${url}: ${error}`;
|
|
101
|
-
if (
|
|
101
|
+
if (process.env.NODE_ENV !== "production") {
|
|
102
102
|
message += `
|
|
103
103
|
|
|
104
104
|
apiHost: ${this.apiHost}
|
package/lib/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sdk",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.2",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-09-
|
|
5
|
+
"commit": "f02cf0301b5a644ce494911576c7640be6d43050",
|
|
6
|
+
"builtAt": "2026-09-21T23:29:22.214Z"
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
const LoaderErrorDetailsContext = React.createContext(false);
|
|
5
5
|
function LoaderErrorDetailsProvider({
|
|
@@ -52,7 +52,7 @@ class LoaderErrorBoundary extends React.Component {
|
|
|
52
52
|
if (!this.state.hasError) {
|
|
53
53
|
return this.props.children;
|
|
54
54
|
}
|
|
55
|
-
if (
|
|
55
|
+
if (process.env.NODE_ENV !== "production" && this.context) {
|
|
56
56
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
57
57
|
this.props.fallback,
|
|
58
58
|
/* @__PURE__ */ jsx(LoaderErrorDetails, { error: this.state.error })
|
|
@@ -180,7 +180,7 @@ function resolvePreviewPlaceholderData({
|
|
|
180
180
|
return null;
|
|
181
181
|
}
|
|
182
182
|
if (typeof window === "undefined") {
|
|
183
|
-
return
|
|
183
|
+
return process.env.NODE_ENV === "development" ? placeholderData : null;
|
|
184
184
|
}
|
|
185
185
|
return window.parent === window ? null : placeholderData;
|
|
186
186
|
}
|
package/next/image-loader.js
CHANGED
|
@@ -20,7 +20,7 @@ function cloudflareLoader({
|
|
|
20
20
|
width,
|
|
21
21
|
quality
|
|
22
22
|
}) {
|
|
23
|
-
const isDevelopment =
|
|
23
|
+
const isDevelopment = process.env.NODE_ENV === "development";
|
|
24
24
|
const params = [`width=${width}`, `quality=${quality ?? 75}`, "format=auto"];
|
|
25
25
|
if (/^https:\/\//i.test(src)) {
|
|
26
26
|
let hostname;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.2",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "1.11.
|
|
6
|
+
"version": "1.11.2",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-09-
|
|
8
|
+
"commit": "f02cf0301b5a644ce494911576c7640be6d43050",
|
|
9
|
+
"builtAt": "2026-09-21T23:29:22.214Z"
|
|
10
10
|
},
|
|
11
11
|
"description": "Replo SDK — cart, analytics, and data loaders for agent-built Next.js sites.",
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE",
|