@weaverse/hydrogen 5.17.0 → 5.18.0
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/dist/index.js +83 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +83 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/WeaverseHydrogenRoot.d.ts +218 -0
- package/dist/types/WeaverseHydrogenRoot.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/main.d.ts +7 -0
- package/dist/types/components/main.d.ts.map +1 -0
- package/dist/types/hooks/theme-text-context.d.ts +2 -0
- package/dist/types/hooks/theme-text-context.d.ts.map +1 -0
- package/dist/types/hooks/translation-context.d.ts +138 -0
- package/dist/types/hooks/translation-context.d.ts.map +1 -0
- package/dist/types/hooks/use-weaverse-data-context.d.ts +29 -0
- package/dist/types/hooks/use-weaverse-data-context.d.ts.map +1 -0
- package/dist/types/index.d.ts +99 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/seo.d.ts +43 -0
- package/dist/types/seo.d.ts.map +1 -0
- package/dist/types/types.d.ts +826 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +44 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/normalize-page-url.d.ts +16 -0
- package/dist/types/utils/normalize-page-url.d.ts.map +1 -0
- package/dist/types/utils/pick-weaverse-data.d.ts +44 -0
- package/dist/types/utils/pick-weaverse-data.d.ts.map +1 -0
- package/dist/types/utils/pixel.d.ts +16 -0
- package/dist/types/utils/pixel.d.ts.map +1 -0
- package/dist/types/utils/studio-request-info.d.ts +17 -0
- package/dist/types/utils/studio-request-info.d.ts.map +1 -0
- package/dist/types/utils/studio-script-src.d.ts +78 -0
- package/dist/types/utils/studio-script-src.d.ts.map +1 -0
- package/dist/types/utils/sync-reused-instance.d.ts +21 -0
- package/dist/types/utils/sync-reused-instance.d.ts.map +1 -0
- package/dist/types/utils/theme-text-store.d.ts +2 -0
- package/dist/types/utils/theme-text-store.d.ts.map +1 -0
- package/dist/types/utils/translation-store.d.ts +40 -0
- package/dist/types/utils/translation-store.d.ts.map +1 -0
- package/dist/types/utils/use-studio.d.ts +33 -0
- package/dist/types/utils/use-studio.d.ts.map +1 -0
- package/dist/types/utils/use-theme-settings-store.d.ts +39 -0
- package/dist/types/utils/use-theme-settings-store.d.ts.map +1 -0
- package/dist/types/weaverse-client.d.ts +227 -0
- package/dist/types/weaverse-client.d.ts.map +1 -0
- package/package.json +7 -6
- package/src/WeaverseHydrogenRoot.tsx +649 -0
- package/src/components/index.ts +10 -0
- package/src/components/main.tsx +28 -0
- package/src/hooks/theme-text-context.tsx +14 -0
- package/src/hooks/translation-context.tsx +275 -0
- package/src/hooks/use-weaverse-data-context.ts +69 -0
- package/src/index.ts +179 -0
- package/src/seo.ts +125 -0
- package/src/types.ts +1020 -0
- package/src/utils/index.ts +351 -0
- package/src/utils/normalize-page-url.ts +44 -0
- package/src/utils/pick-weaverse-data.ts +89 -0
- package/src/utils/pixel.ts +71 -0
- package/src/utils/studio-request-info.ts +66 -0
- package/src/utils/studio-script-src.ts +162 -0
- package/src/utils/sync-reused-instance.ts +57 -0
- package/src/utils/theme-text-store.ts +1 -0
- package/src/utils/translation-store.ts +65 -0
- package/src/utils/use-studio.ts +168 -0
- package/src/utils/use-theme-settings-store.ts +160 -0
- package/src/weaverse-client.ts +1179 -0
- package/dist/index.d.mts +0 -1269
- package/dist/index.d.ts +0 -1269
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { createWithCache } from '@shopify/hydrogen';
|
|
2
|
+
import type { CachingStrategy, CustomPageEntry, FetchProjectRequestBody, HydrogenComponentData, HydrogenPageData, LoadPageParams, ThemeSettingsResponse, WeaverseClientArgs, WeaverseLoaderData, WeaverseProjectConfigs } from './types';
|
|
3
|
+
/** Builder API resource whose freshness policy should be used for a request. */
|
|
4
|
+
export type BuilderApiCacheTarget = 'custom-pages' | 'merchant-overrides' | 'project' | 'theme-settings';
|
|
5
|
+
/** Fetch options accepted by {@link WeaverseClient.fetchWithCache}. */
|
|
6
|
+
export interface WeaverseFetchWithCacheOptions extends RequestInit {
|
|
7
|
+
/** Builder API resource whose default freshness policy should be used. */
|
|
8
|
+
cacheTarget?: BuilderApiCacheTarget;
|
|
9
|
+
/** Explicit Hydrogen caching strategy overriding the resource default. */
|
|
10
|
+
strategy?: CachingStrategy;
|
|
11
|
+
}
|
|
12
|
+
/** Pagination and locale options for {@link WeaverseClient.fetchCustomPages}. */
|
|
13
|
+
export interface FetchCustomPagesOptions {
|
|
14
|
+
/** Maximum number of custom pages requested per API page. */
|
|
15
|
+
limit?: number;
|
|
16
|
+
/** Locale whose published custom pages should be returned. */
|
|
17
|
+
locale?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Request-scoped client for loading Weaverse pages and theme settings in Hydrogen.
|
|
21
|
+
*
|
|
22
|
+
* Create one client from the Hydrogen app context, then call
|
|
23
|
+
* {@link WeaverseClient.loadPage} from route loaders and
|
|
24
|
+
* {@link WeaverseClient.loadThemeSettings} from the root loader.
|
|
25
|
+
*/
|
|
26
|
+
export declare class WeaverseClient {
|
|
27
|
+
/** Builder API version used by this client. */
|
|
28
|
+
API: "v1";
|
|
29
|
+
/** Stable project configuration shared by page requests. */
|
|
30
|
+
basePageConfigs: Omit<WeaverseProjectConfigs, 'requestInfo'>;
|
|
31
|
+
/** Stable request body fields shared by page requests. */
|
|
32
|
+
basePageRequestBody: Omit<FetchProjectRequestBody, 'url'>;
|
|
33
|
+
/** Resolved project and rendering-mode configuration. */
|
|
34
|
+
configs: WeaverseProjectConfigs;
|
|
35
|
+
/** Hydrogen cache wrapper used for Builder API requests. */
|
|
36
|
+
withCache: ReturnType<typeof createWithCache>;
|
|
37
|
+
/** Incoming request associated with this client instance. */
|
|
38
|
+
request: WeaverseClientArgs['request'];
|
|
39
|
+
/** Hydrogen customer-account client, when configured. */
|
|
40
|
+
customerAccount: WeaverseClientArgs['customerAccount'];
|
|
41
|
+
/** Hydrogen Storefront API client and locale context. */
|
|
42
|
+
storefront: WeaverseClientArgs['storefront'];
|
|
43
|
+
/** Components registered for page rendering and component loaders. */
|
|
44
|
+
components: WeaverseClientArgs['components'];
|
|
45
|
+
/** Theme schema used for defaults and Studio editing. */
|
|
46
|
+
themeSchema: WeaverseClientArgs['themeSchema'];
|
|
47
|
+
/** Hydrogen runtime environment variables. */
|
|
48
|
+
env: WeaverseClientArgs['env'];
|
|
49
|
+
/** Cache storage supplied by the Hydrogen runtime. */
|
|
50
|
+
cache: WeaverseClientArgs['cache'];
|
|
51
|
+
/** Background execution hook supplied by the Oxygen runtime. */
|
|
52
|
+
waitUntil: WeaverseClientArgs['waitUntil'];
|
|
53
|
+
private readonly parsedUrl;
|
|
54
|
+
private readonly componentsByType;
|
|
55
|
+
private readonly fetchTimeoutMs;
|
|
56
|
+
/** Creates a request-scoped client from the Hydrogen app context. */
|
|
57
|
+
constructor(args: WeaverseClientArgs);
|
|
58
|
+
/**
|
|
59
|
+
* Initialize Hydrogen cache with proper configuration.
|
|
60
|
+
* Logs warning if waitUntil is missing.
|
|
61
|
+
*/
|
|
62
|
+
private initializeCache;
|
|
63
|
+
/**
|
|
64
|
+
* Initialize configs with projectId resolution and fail-fast validation.
|
|
65
|
+
* Throws WeaverseError if projectId cannot be resolved.
|
|
66
|
+
*/
|
|
67
|
+
private initializeConfigs;
|
|
68
|
+
/**
|
|
69
|
+
* Build component lookup map for O(1) access by type.
|
|
70
|
+
* Significantly improves performance for large component lists.
|
|
71
|
+
*/
|
|
72
|
+
private buildComponentLookupMap;
|
|
73
|
+
/**
|
|
74
|
+
* Extract comprehensive error information from unknown error type.
|
|
75
|
+
* Preserves error context, codes, and stack traces for debugging.
|
|
76
|
+
*
|
|
77
|
+
* @param error - Unknown error to extract information from
|
|
78
|
+
* @returns Structured error information with message, code, stack, and context
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* try {
|
|
83
|
+
* // ... operation
|
|
84
|
+
* } catch (error) {
|
|
85
|
+
* const errorInfo = this.extractErrorInfo(error)
|
|
86
|
+
* console.error('Operation failed:', errorInfo.message, errorInfo.context)
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
private extractErrorInfo;
|
|
91
|
+
/**
|
|
92
|
+
* Extract error message only (for backward compatibility).
|
|
93
|
+
* Use extractErrorInfo() for more detailed error information.
|
|
94
|
+
*
|
|
95
|
+
* @deprecated Use extractErrorInfo() instead to preserve error context
|
|
96
|
+
*/
|
|
97
|
+
private extractErrorMessage;
|
|
98
|
+
/**
|
|
99
|
+
* Validates projectId format (alphanumeric, hyphens, underscores only).
|
|
100
|
+
* Returns detailed validation result with error message.
|
|
101
|
+
*
|
|
102
|
+
* @param projectId - Project identifier to validate
|
|
103
|
+
* @returns Validation result with error message if invalid
|
|
104
|
+
*/
|
|
105
|
+
private validateProjectId;
|
|
106
|
+
/**
|
|
107
|
+
* Resolves projectId with multi-project architecture support.
|
|
108
|
+
* Uses priority chain to determine the correct project ID.
|
|
109
|
+
*
|
|
110
|
+
* @param projectId - Project identifier (string, function, or undefined)
|
|
111
|
+
* @param request - HTTP request for context access
|
|
112
|
+
* @param env - Hydrogen environment with variables
|
|
113
|
+
* @param baseConfigs - Pre-fetched base configs to avoid duplicate calls
|
|
114
|
+
* @returns Resolved project ID string (empty string if none found)
|
|
115
|
+
*/
|
|
116
|
+
private resolveProjectIdSync;
|
|
117
|
+
/**
|
|
118
|
+
* Priority 1: Resolve projectId from URL query parameters.
|
|
119
|
+
* Used for design mode and preview mode overrides.
|
|
120
|
+
*/
|
|
121
|
+
private resolveFromQueryParams;
|
|
122
|
+
/**
|
|
123
|
+
* Priority 2: Resolve projectId from function parameter.
|
|
124
|
+
* Detects and rejects async functions with helpful error.
|
|
125
|
+
*/
|
|
126
|
+
private resolveFromFunction;
|
|
127
|
+
/**
|
|
128
|
+
* Priority 3: Resolve projectId from explicit string parameter.
|
|
129
|
+
*/
|
|
130
|
+
private resolveFromString;
|
|
131
|
+
/**
|
|
132
|
+
* Priority 4: Resolve projectId from environment variables.
|
|
133
|
+
*/
|
|
134
|
+
private resolveFromEnvironment;
|
|
135
|
+
/**
|
|
136
|
+
* Helper method for direct fetching in design mode.
|
|
137
|
+
* Returns same format as withCache.fetch for consistency.
|
|
138
|
+
* Includes 10-second timeout to prevent hanging requests.
|
|
139
|
+
*/
|
|
140
|
+
private readonly fetchOnce;
|
|
141
|
+
private readonly directFetch;
|
|
142
|
+
private getApiUrl;
|
|
143
|
+
private isExternalPublicApiUrl;
|
|
144
|
+
/**
|
|
145
|
+
* Fetch data with caching support for both design mode and production.
|
|
146
|
+
* Uses direct fetch in design mode, Hydrogen's withCache in production.
|
|
147
|
+
* Automatically includes projectId in cache key for multi-project isolation.
|
|
148
|
+
*
|
|
149
|
+
* @param url - The URL to fetch from
|
|
150
|
+
* @param options - Fetch options including optional cache strategy
|
|
151
|
+
* @returns Promise resolving to the fetched data
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* const data = await weaverse.fetchWithCache<MyData>(
|
|
156
|
+
* 'https://api.example.com/data',
|
|
157
|
+
* { method: 'POST', body: JSON.stringify({ key: 'value' }) }
|
|
158
|
+
* )
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
fetchWithCache: <T = unknown>(url: string, options?: WeaverseFetchWithCacheOptions) => Promise<T>;
|
|
162
|
+
/**
|
|
163
|
+
* Load theme settings from Weaverse API with fallback to schema defaults.
|
|
164
|
+
* Merges remote settings with local theme schema and handles design mode serialization.
|
|
165
|
+
*
|
|
166
|
+
* @param strategy - Optional cache strategy override
|
|
167
|
+
* @returns Promise resolving to theme settings response
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```typescript
|
|
171
|
+
* const settings = await weaverse.loadThemeSettings()
|
|
172
|
+
* const primaryColor = settings.theme.colors?.primary
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
loadThemeSettings: (strategy?: CachingStrategy) => Promise<ThemeSettingsResponse>;
|
|
176
|
+
/**
|
|
177
|
+
* Fetch locale-specific merchant overrides from the translation API.
|
|
178
|
+
* Returns a nested JSON object with translated values.
|
|
179
|
+
* Falls back to empty object on error to avoid blocking theme rendering.
|
|
180
|
+
*/
|
|
181
|
+
private fetchMerchantOverrides;
|
|
182
|
+
/**
|
|
183
|
+
* Generate fallback page with default structure when page data is unavailable.
|
|
184
|
+
* Used internally when API returns no page or when page needs default content.
|
|
185
|
+
*
|
|
186
|
+
* @param message - Custom message to display in the fallback page
|
|
187
|
+
* @returns HydrogenPageData with single main component containing the message
|
|
188
|
+
*/
|
|
189
|
+
generateFallbackPage: (message: string) => HydrogenPageData;
|
|
190
|
+
/**
|
|
191
|
+
* Fetch all published custom pages for sitemap generation.
|
|
192
|
+
* Paginates automatically, never throws, returns accumulated results on partial failure.
|
|
193
|
+
*/
|
|
194
|
+
fetchCustomPages(opts?: FetchCustomPagesOptions): Promise<CustomPageEntry[]>;
|
|
195
|
+
/**
|
|
196
|
+
* Load page data from Weaverse API with optional route-level project override.
|
|
197
|
+
* Fetches page content, executes component loaders, and handles empty items fallback.
|
|
198
|
+
*
|
|
199
|
+
* @param params - Optional page loading parameters
|
|
200
|
+
* @param params.type - Page type (INDEX, PAGE, PRODUCT, COLLECTION, etc.)
|
|
201
|
+
* @param params.handle - Page handle for dynamic routes
|
|
202
|
+
* @param params.locale - Locale override
|
|
203
|
+
* @param params.projectId - Route-level project ID override (for multi-project)
|
|
204
|
+
* @param params.strategy - Custom cache strategy override
|
|
205
|
+
* @returns Promise resolving to page data or null on error
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* // Basic usage
|
|
210
|
+
* const data = await weaverse.loadPage()
|
|
211
|
+
*
|
|
212
|
+
* // With page type
|
|
213
|
+
* const data = await weaverse.loadPage({ type: 'INDEX' })
|
|
214
|
+
*
|
|
215
|
+
* // Route-level project override
|
|
216
|
+
* const data = await weaverse.loadPage({
|
|
217
|
+
* type: 'PAGE',
|
|
218
|
+
* handle: 'about',
|
|
219
|
+
* projectId: 'campaign-project-123'
|
|
220
|
+
* })
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
loadPage: (params?: LoadPageParams) => Promise<WeaverseLoaderData | null>;
|
|
224
|
+
/** Executes the registered loader for one component and attaches its result. */
|
|
225
|
+
execComponentLoader: (item: HydrogenComponentData) => Promise<HydrogenComponentData>;
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=weaverse-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weaverse-client.d.ts","sourceRoot":"","sources":["../../src/weaverse-client.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@weaverse/hydrogen",
|
|
3
3
|
"author": "Weaverse Team",
|
|
4
4
|
"description": "Components, hooks, and utilities for building Shopify Hydrogen websites with Weaverse",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.18.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
|
-
"typings": "dist/index.d.ts",
|
|
8
|
+
"typings": "dist/types/index.d.ts",
|
|
9
9
|
"module": "dist/index.mjs",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public",
|
|
@@ -16,14 +16,15 @@
|
|
|
16
16
|
"directory": "packages/hydrogen"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
-
"dist
|
|
19
|
+
"dist",
|
|
20
|
+
"src"
|
|
20
21
|
],
|
|
21
22
|
"engines": {
|
|
22
23
|
"node": ">=20"
|
|
23
24
|
},
|
|
24
25
|
"scripts": {
|
|
25
26
|
"dev": "tsup --watch",
|
|
26
|
-
"build": "tsup",
|
|
27
|
+
"build": "tsup && node ../../scripts/build-declarations.mjs",
|
|
27
28
|
"clean": "rimraf dist",
|
|
28
29
|
"test": "vp test --run",
|
|
29
30
|
"typecheck": "tsc --noEmit"
|
|
@@ -45,8 +46,8 @@
|
|
|
45
46
|
"dependencies": {
|
|
46
47
|
"@shopify/hydrogen": ">=2025.5",
|
|
47
48
|
"@shopify/remix-oxygen": "3",
|
|
48
|
-
"@weaverse/react": "5.
|
|
49
|
-
"@weaverse/schema": "0.
|
|
49
|
+
"@weaverse/react": "5.18.0",
|
|
50
|
+
"@weaverse/schema": "0.12.0",
|
|
50
51
|
"react": ">=19",
|
|
51
52
|
"react-dom": ">=19",
|
|
52
53
|
"react-error-boundary": "^6",
|