@se-studio/core-ui 1.27.0 → 1.27.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @se-studio/core-ui
2
2
 
3
+ ## 1.27.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Stop importing contentful-rest-api from handleCmsError so the main barrel stays client-safe under Next 16.3.3 Turbopack.
8
+
9
+ ## 1.27.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Share Contentful CDA rate-limit pauses across Next SSG workers (file-backed limiter) and rethrow 429/5xx from handleCmsError instead of baking static 404s.
14
+ - Updated dependencies
15
+ - @se-studio/contentful-rest-api@1.26.1
16
+
3
17
  ## 1.27.0
4
18
 
5
19
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../../src/utils/errorHandling.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,YAAY,EACrB,gBAAgB,EAAE,iBAAiB,+BA4BpC"}
1
+ {"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../../src/utils/errorHandling.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,YAAY,EACrB,gBAAgB,EAAE,iBAAiB,+BAgCpC"}
@@ -1,12 +1,23 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { notFound } from 'next/navigation';
3
3
  import { CmsDataError } from '../components/CmsDataError';
4
- // Helper function to detect Next.js notFound errors
5
4
  function isNotFoundError(error) {
6
5
  return (error instanceof Error &&
7
6
  (error.message === 'NEXT_HTTP_ERROR_FALLBACK;404' ||
8
7
  error.digest === 'NEXT_HTTP_ERROR_FALLBACK;404'));
9
8
  }
9
+ /** Duck-type CDA 429/5xx without importing contentful-rest-api (keeps the main barrel client-safe). */
10
+ function isRetryableCmsError(error) {
11
+ if (!error || typeof error !== 'object') {
12
+ return false;
13
+ }
14
+ const candidate = error;
15
+ if (candidate.name === 'RateLimitError') {
16
+ return true;
17
+ }
18
+ const status = candidate.statusCode;
19
+ return typeof status === 'number' && (status >= 500 || status === 429);
20
+ }
10
21
  /**
11
22
  * Handles CMS-related errors with appropriate error display or Next.js notFound.
12
23
  *
@@ -35,10 +46,13 @@ function isNotFoundError(error) {
35
46
  * ```
36
47
  */
37
48
  export function handleCmsError(error, context, buildInformation) {
38
- // Re-throw notFound errors so Next.js can handle them properly
39
49
  if (isNotFoundError(error)) {
40
50
  throw error;
41
51
  }
52
+ // Rate limits / 5xx must not become static 404s during SSG.
53
+ if (isRetryableCmsError(error)) {
54
+ throw error;
55
+ }
42
56
  // Add timestamp and default preview from buildInformation
43
57
  const enhancedContext = {
44
58
  ...context,
@@ -1 +1 @@
1
- {"version":3,"file":"errorHandling.js","sourceRoot":"","sources":["../../src/utils/errorHandling.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAU1D,oDAAoD;AACpD,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,CACL,KAAK,YAAY,KAAK;QACtB,CAAC,KAAK,CAAC,OAAO,KAAK,8BAA8B;YAC9C,KAA6B,CAAC,MAAM,KAAK,8BAA8B,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAc,EACd,OAAqB,EACrB,gBAAmC;IAEnC,+DAA+D;IAC/D,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,KAAK,CAAC;IACd,CAAC;IAED,0DAA0D;IAC1D,MAAM,eAAe,GAAG;QACtB,GAAG,OAAO;QACV,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,gBAAgB,CAAC,OAAO,IAAI,KAAK;QAC7D,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;IAEF,oBAAoB;IACpB,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE;QAC/B,KAAK;QACL,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;KACxD,CAAC,CAAC;IAEH,IAAI,gBAAgB,CAAC,YAAY,EAAE,CAAC;QAClC,mCAAmC;QACnC,OAAO,QAAQ,EAAE,CAAC;IACpB,CAAC;IAED,yDAAyD;IACzD,OAAO,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,GAAI,CAAC;AAClE,CAAC"}
1
+ {"version":3,"file":"errorHandling.js","sourceRoot":"","s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,EAAE;KACpC,CAAC;IAEF,oBAAoB;IACpB,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE;QAC/B,KAAK;QACL,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;KACxD,CAAC,CAAC;IAEH,IAAI,gBAAgB,CAAC,YAAY,EAAE,CAAC;QAClC,mCAAmC;QACnC,OAAO,QAAQ,EAAE,CAAC;IACpB,CAAC;IAED,yDAAyD;IACzD,OAAO,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,GAAI,CAAC;AAClE,CAAC"}
@@ -95,4 +95,5 @@ Prefer fixing and publishing core-ui. If blocked on an older version:
95
95
  ## Related incidents
96
96
 
97
97
  - **filterRelatedArticles** removed from main barrel (core-ui ~1.11) — same class of bug.
98
- - **listingStructuredData** moved to `/server` (core-ui 1.13.1) — `buildListingItems` / `buildListingStructuredDataContext` had runtime `contentful-rest-api` import on main entry.
98
+ - **listingStructuredData** moved to `/server` (core-ui 1.13.1) — `buildListingItems` / `buildListingStructuredDataContext` had runtime `contentful-rest-api` import on main entry.
99
+ - **handleCmsError** (core-ui 1.27.2) — inlined retryable-error checks so `errorHandling` no longer imports `contentful-rest-api`. Next 16.3.3 Turbopack production builds failed when `'use client'` files imported the main barrel (`ViewTransitionTrackedLink` on se-website-2026).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/core-ui",
3
- "version": "1.27.0",
3
+ "version": "1.27.2",
4
4
  "description": "Shared React UI component library with Tailwind CSS v4 for SE Studio applications",
5
5
  "repository": {
6
6
  "type": "git",
@@ -76,15 +76,15 @@
76
76
  "@contentful/rich-text-react-renderer": "^16.2.2",
77
77
  "@contentful/rich-text-types": "^17.2.7",
78
78
  "@radix-ui/react-slot": "1.3.3",
79
+ "@se-studio/contentful-rest-api": "1.26.1",
80
+ "@se-studio/core-data-types": "1.13.0",
79
81
  "@types/mustache": "4.2.6",
80
82
  "@vimeo/player": "^2.30.4",
81
83
  "clsx": "^2.1.1",
82
84
  "html-entities": "^2.6.0",
83
85
  "mustache": "4.2.0",
84
86
  "server-only": "0.0.1",
85
- "tailwind-merge": "^3.6.0",
86
- "@se-studio/contentful-rest-api": "1.26.0",
87
- "@se-studio/core-data-types": "1.13.0"
87
+ "tailwind-merge": "^3.6.0"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@biomejs/biome": "^2.5.10",
@@ -92,7 +92,7 @@
92
92
  "@types/react": "^19.2.18",
93
93
  "@types/react-dom": "^19.2.5",
94
94
  "jsdom": "^30.0.1",
95
- "next": "^16.3.2",
95
+ "next": "^16.3.3",
96
96
  "typescript": "^7.0.2",
97
97
  "vitest": "^4.1.11"
98
98
  },