@se-studio/project-build 1.3.3 → 1.3.4
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 +6 -0
- package/dist/marketing-routes.mjs +24 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @se-studio/project-build
|
|
2
2
|
|
|
3
|
+
## 1.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5a3f66f: Reject impossible CMS slugs (`%`, `:`, `,`, `.`, `f_auto`, `wp-`) with `notFound` before any Contentful fetch in the shared page and article handlers. Generated page and article routes call the same guard. The site proxy template returns a CDN-cacheable 404 for those paths, including encoded asset URLs that end in a static extension. Ordinary images still skip the proxy.
|
|
8
|
+
|
|
3
9
|
## 1.3.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1299,7 +1299,8 @@ function concreteArticlePage(rest, typeSlug) {
|
|
|
1299
1299
|
'parent: ResolvingMetadata',
|
|
1300
1300
|
]);
|
|
1301
1301
|
const page = openFn('export default async function ', [`props: ${props}`]);
|
|
1302
|
-
return `${header()}import
|
|
1302
|
+
return `${header()}import { notFoundIfImpossibleCmsSlug } from '@se-studio/core-ui/server';
|
|
1303
|
+
import type { ResolvingMetadata } from 'next';
|
|
1303
1304
|
import { generateArticleMetadata, generateArticlePage } from '@/lib/route-handlers';
|
|
1304
1305
|
import { ARTICLE_DETAIL_ROUTE_CONFIG } from '@/lib/routeConfig';
|
|
1305
1306
|
|
|
@@ -1312,6 +1313,7 @@ export function generateStaticParams() {
|
|
|
1312
1313
|
${extract}
|
|
1313
1314
|
const params = await props.params;
|
|
1314
1315
|
const { article } = params;
|
|
1316
|
+
notFoundIfImpossibleCmsSlug(article);
|
|
1315
1317
|
return { articleSlug: article, path: \`/${rest}/\${article}/\` };
|
|
1316
1318
|
}
|
|
1317
1319
|
|
|
@@ -1721,6 +1723,7 @@ function levelPage() {
|
|
|
1721
1723
|
]);
|
|
1722
1724
|
const page = openFn('export default async function ', [`props: ${props}`]);
|
|
1723
1725
|
return `${header()}import { joinCmsPathSegments } from '@se-studio/core-ui';
|
|
1726
|
+
import { notFoundIfImpossibleCmsSlug } from '@se-studio/core-ui/server';
|
|
1724
1727
|
import type { ResolvingMetadata } from 'next';
|
|
1725
1728
|
import { notFound } from 'next/navigation';
|
|
1726
1729
|
import { generatePage, generatePageMetadata } from '@/lib/route-handlers';
|
|
@@ -1736,6 +1739,7 @@ ${extract}
|
|
|
1736
1739
|
if (!slug) {
|
|
1737
1740
|
notFound();
|
|
1738
1741
|
}
|
|
1742
|
+
notFoundIfImpossibleCmsSlug(slug);
|
|
1739
1743
|
return { slug, path: \`/\${slug}/\` };
|
|
1740
1744
|
}
|
|
1741
1745
|
|
|
@@ -1760,6 +1764,7 @@ function levelSlugsPage() {
|
|
|
1760
1764
|
]);
|
|
1761
1765
|
const page = openFn('export default async function ', [`props: ${props}`]);
|
|
1762
1766
|
return `${header()}import { joinCmsPathSegments } from '@se-studio/core-ui';
|
|
1767
|
+
import { notFoundIfImpossibleCmsSlug } from '@se-studio/core-ui/server';
|
|
1763
1768
|
import type { ResolvingMetadata } from 'next';
|
|
1764
1769
|
import { notFound } from 'next/navigation';
|
|
1765
1770
|
import { generatePage, generatePageMetadata } from '@/lib/route-handlers';
|
|
@@ -1775,6 +1780,7 @@ ${extract}
|
|
|
1775
1780
|
if (!slug) {
|
|
1776
1781
|
notFound();
|
|
1777
1782
|
}
|
|
1783
|
+
notFoundIfImpossibleCmsSlug(slug);
|
|
1778
1784
|
return { slug, path: \`/\${slug}/\` };
|
|
1779
1785
|
}
|
|
1780
1786
|
|
|
@@ -2156,6 +2162,7 @@ function fixedArticleDetail(segment) {
|
|
|
2156
2162
|
]);
|
|
2157
2163
|
const page = openFn('export default async function ', [`props: ${props}`]);
|
|
2158
2164
|
return `${header()}import { joinCmsPathSegments } from '@se-studio/core-ui';
|
|
2165
|
+
import { notFoundIfImpossibleCmsSlug } from '@se-studio/core-ui/server';
|
|
2159
2166
|
import type { ResolvingMetadata } from 'next';
|
|
2160
2167
|
import { notFound } from 'next/navigation';
|
|
2161
2168
|
import { generateArticleMetadata, generateArticlePage } from '@/lib/route-handlers';
|
|
@@ -2173,6 +2180,7 @@ ${extract}
|
|
|
2173
2180
|
if (!articleSlug) {
|
|
2174
2181
|
notFound();
|
|
2175
2182
|
}
|
|
2183
|
+
notFoundIfImpossibleCmsSlug(articleSlug);
|
|
2176
2184
|
return {
|
|
2177
2185
|
articleSlug,
|
|
2178
2186
|
path: \`/${segment}/\${articleSlug}/\`,
|
|
@@ -2261,7 +2269,8 @@ function dynamicArticleType(segment) {
|
|
|
2261
2269
|
'parent: ResolvingMetadata',
|
|
2262
2270
|
]);
|
|
2263
2271
|
const page = openFn('export default async function ', [`props: ${props}`]);
|
|
2264
|
-
return `${header()}import
|
|
2272
|
+
return `${header()}import { notFoundIfImpossibleCmsSlug } from '@se-studio/core-ui/server';
|
|
2273
|
+
import type { ResolvingMetadata } from 'next';
|
|
2265
2274
|
${converterImport}import { generateArticleTypeMetadata, generateArticleTypePage } from '@/lib/route-handlers';
|
|
2266
2275
|
import { DEFAULT_ROUTE_CONFIG } from '@/lib/routeConfig';
|
|
2267
2276
|
|
|
@@ -2272,6 +2281,7 @@ export function generateStaticParams() {
|
|
|
2272
2281
|
${extract}
|
|
2273
2282
|
const params = await props.params;
|
|
2274
2283
|
const { articleType } = params;
|
|
2284
|
+
notFoundIfImpossibleCmsSlug(articleType);
|
|
2275
2285
|
return { slug: articleType, path: ${pathExpr} };
|
|
2276
2286
|
}
|
|
2277
2287
|
|
|
@@ -2306,6 +2316,7 @@ function dynamicArticleDetail(segment) {
|
|
|
2306
2316
|
]);
|
|
2307
2317
|
const page = openFn('export default async function ', [`props: ${props}`]);
|
|
2308
2318
|
return `${header()}import { joinCmsPathSegments } from '@se-studio/core-ui';
|
|
2319
|
+
import { notFoundIfImpossibleCmsSlug } from '@se-studio/core-ui/server';
|
|
2309
2320
|
import type { ResolvingMetadata } from 'next';
|
|
2310
2321
|
import { notFound } from 'next/navigation';
|
|
2311
2322
|
${converterImport}import { generateArticleMetadata, generateArticlePage } from '@/lib/route-handlers';
|
|
@@ -2322,6 +2333,7 @@ ${extract}
|
|
|
2322
2333
|
if (!(articleType && articleSlug)) {
|
|
2323
2334
|
notFound();
|
|
2324
2335
|
}
|
|
2336
|
+
notFoundIfImpossibleCmsSlug(articleType, articleSlug);
|
|
2325
2337
|
return {
|
|
2326
2338
|
articleType,
|
|
2327
2339
|
articleSlug,
|
|
@@ -2358,7 +2370,8 @@ function fixedArticleTag(segment) {
|
|
|
2358
2370
|
'parent: ResolvingMetadata',
|
|
2359
2371
|
]);
|
|
2360
2372
|
const page = openFn('export default async function ', [`props: ${props}`]);
|
|
2361
|
-
return `${header()}import
|
|
2373
|
+
return `${header()}import { notFoundIfImpossibleCmsSlug } from '@se-studio/core-ui/server';
|
|
2374
|
+
import type { ResolvingMetadata } from 'next';
|
|
2362
2375
|
import {
|
|
2363
2376
|
generateArticleTypeTagMetadata,
|
|
2364
2377
|
generateArticleTypeTagPage,
|
|
@@ -2374,6 +2387,7 @@ export function generateStaticParams() {
|
|
|
2374
2387
|
${extract}
|
|
2375
2388
|
const params = await props.params;
|
|
2376
2389
|
const { tag } = params;
|
|
2390
|
+
notFoundIfImpossibleCmsSlug(tag);
|
|
2377
2391
|
return { tag, path: \`/${segment}/\${tag}/\` };
|
|
2378
2392
|
}
|
|
2379
2393
|
|
|
@@ -2401,6 +2415,7 @@ function fixedArticleTagDetail(segment) {
|
|
|
2401
2415
|
]);
|
|
2402
2416
|
const page = openFn('export default async function ', [`props: ${props}`]);
|
|
2403
2417
|
return `${header()}import { joinCmsPathSegments } from '@se-studio/core-ui';
|
|
2418
|
+
import { notFoundIfImpossibleCmsSlug } from '@se-studio/core-ui/server';
|
|
2404
2419
|
import type { ResolvingMetadata } from 'next';
|
|
2405
2420
|
import { notFound } from 'next/navigation';
|
|
2406
2421
|
import { generateArticleMetadata, generateArticlePage } from '@/lib/route-handlers';
|
|
@@ -2419,6 +2434,7 @@ ${extract}
|
|
|
2419
2434
|
if (!(tag && articleSlug)) {
|
|
2420
2435
|
notFound();
|
|
2421
2436
|
}
|
|
2437
|
+
notFoundIfImpossibleCmsSlug(tag, articleSlug);
|
|
2422
2438
|
return {
|
|
2423
2439
|
tag,
|
|
2424
2440
|
articleSlug,
|
|
@@ -2462,7 +2478,8 @@ function dynamicArticleTag(segment) {
|
|
|
2462
2478
|
'parent: ResolvingMetadata',
|
|
2463
2479
|
]);
|
|
2464
2480
|
const page = openFn('export default async function ', [`props: ${props}`]);
|
|
2465
|
-
return `${header()}import
|
|
2481
|
+
return `${header()}import { notFoundIfImpossibleCmsSlug } from '@se-studio/core-ui/server';
|
|
2482
|
+
import type { ResolvingMetadata } from 'next';
|
|
2466
2483
|
${converterImport}import {
|
|
2467
2484
|
generateArticleTypeTagMetadata,
|
|
2468
2485
|
generateArticleTypeTagPage,
|
|
@@ -2476,6 +2493,7 @@ export function generateStaticParams() {
|
|
|
2476
2493
|
${extract}
|
|
2477
2494
|
const params = await props.params;
|
|
2478
2495
|
const { articleType, tag } = params;
|
|
2496
|
+
notFoundIfImpossibleCmsSlug(articleType, tag);
|
|
2479
2497
|
return { articleType, tag, path: ${pathExpr} };
|
|
2480
2498
|
}
|
|
2481
2499
|
|
|
@@ -2516,6 +2534,7 @@ function dynamicArticleTagDetail(segment) {
|
|
|
2516
2534
|
]);
|
|
2517
2535
|
const page = openFn('export default async function ', [`props: ${props}`]);
|
|
2518
2536
|
return `${header()}import { joinCmsPathSegments } from '@se-studio/core-ui';
|
|
2537
|
+
import { notFoundIfImpossibleCmsSlug } from '@se-studio/core-ui/server';
|
|
2519
2538
|
import type { ResolvingMetadata } from 'next';
|
|
2520
2539
|
import { notFound } from 'next/navigation';
|
|
2521
2540
|
${converterImport}import { generateArticleMetadata, generateArticlePage } from '@/lib/route-handlers';
|
|
@@ -2533,6 +2552,7 @@ ${extract}
|
|
|
2533
2552
|
if (!(articleType && tag && articleSlug)) {
|
|
2534
2553
|
notFound();
|
|
2535
2554
|
}
|
|
2555
|
+
notFoundIfImpossibleCmsSlug(articleType, tag, articleSlug);
|
|
2536
2556
|
return {
|
|
2537
2557
|
articleType,
|
|
2538
2558
|
tag,
|