@se-studio/skills 1.1.1 → 1.1.3
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,29 @@
|
|
|
1
1
|
# @se-studio/skills
|
|
2
2
|
|
|
3
|
+
## 1.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Bulk version bump: patch for all packages
|
|
8
|
+
|
|
9
|
+
## 1.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Exclude redirect sources from sitemaps + robust protection against self and circular redirects.
|
|
14
|
+
|
|
15
|
+
- `buildRedirectMap` now normalizes internal paths (leading + trailing `/` to match urlCalculators + sitemap conventions) and reliably drops self-redirects (A → A). It also detects longer redirect cycles (A → B → A, etc.), drops the participating `from` rules from the baked map, and emits a `console.warn` during construction (visible in build/generate scripts).
|
|
16
|
+
- New exported utility: `filterSitemapEntriesExcludingRedirects(entries, redirectMap)`. Works on any `{ url: string }[]` (SitemapEntry, ISitemapEntry, etc.).
|
|
17
|
+
- The standard marketing site sitemap helper now accepts an optional `redirectMap` in `getSitemapEntries({ includeUnindexed, redirectMap })`. When provided, any URL that is the source of an active redirect is excluded from the generated sitemap entries. This is the recommended way to keep sitemaps clean when using editor-managed redirects.
|
|
18
|
+
- Widened the public `getSitemapEntries` option type in app helpers (additive; existing callers unaffected).
|
|
19
|
+
- Updated example app sitemaps (main + unindexed) to demonstrate fetching the map and passing it.
|
|
20
|
+
- Skill docs (`se-marketing-sites-redirects`) now include a "Redirects and sitemaps" section with usage patterns + notes on the improved cycle/self protection. Also updated routing docs.
|
|
21
|
+
- `buildRedirectMap` / `RedirectMap` / `getRedirectMap` behaviour for the middleware baked map is now safer (no self-loops or cycles will be baked).
|
|
22
|
+
|
|
23
|
+
Consumers using the `marketingSiteSitemap` helper + `getRedirectMap` at build time can now easily exclude redirect sources from both their static redirect map (for middleware) and their sitemaps in one consistent way.
|
|
24
|
+
|
|
25
|
+
See the redirect skill for the full recommended build-time pattern and the new filter helper.
|
|
26
|
+
|
|
3
27
|
## 1.1.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -60,7 +60,7 @@ The following are already in the packages:
|
|
|
60
60
|
|
|
61
61
|
- `IRedirect` + `isRedirect` in `@se-studio/core-data-types` (now uses `fromInternal` / `toInternal`)
|
|
62
62
|
- `baseRedirectConverter` + `BaseRedirectSkeleton`
|
|
63
|
-
- `contentfulRedirectsRest` + `buildRedirectMap` + `getRedirectsWithErrors` / `getRedirectMap` (via `createAppHelpers`)
|
|
63
|
+
- `contentfulRedirectsRest` + `buildRedirectMap` (now with robust self/cycle guards + normalization) + `getRedirectsWithErrors` / `getRedirectMap` (via `createAppHelpers`)
|
|
64
64
|
- Revalidation tag `redirect` (so the existing webhook machinery knows about the new type)
|
|
65
65
|
|
|
66
66
|
You only need to wire the **rebuild** side in your app.
|
|
@@ -174,6 +174,30 @@ export const config = {
|
|
|
174
174
|
|
|
175
175
|
If you already have a `middleware.ts` for A/B or other things, just add the redirect check at the very top (before any other logic).
|
|
176
176
|
|
|
177
|
+
### 4.2.1 Redirects and sitemaps
|
|
178
|
+
|
|
179
|
+
When you create a redirect whose `from` (raw or resolved via internal picker) matches a URL that would otherwise be listed in your sitemap, that URL should generally be omitted from the sitemap (search engines should not be told to crawl a source that 301s away).
|
|
180
|
+
|
|
181
|
+
The shared libraries now support this easily:
|
|
182
|
+
|
|
183
|
+
- The `getSitemapEntries(...)` function returned by the marketing sitemap helper (when you configure `marketingSiteSitemap` in `createAppHelpers`) accepts an optional `redirectMap` in its options. When supplied, any entry whose URL is a redirect source is filtered out before the entries are returned to `buildSitemap`.
|
|
184
|
+
- Standalone: `filterSitemapEntriesExcludingRedirects(entries, redirectMap)` (exported from `@se-studio/contentful-rest-api`) works on any `{ url: string }[]` list for custom flows.
|
|
185
|
+
|
|
186
|
+
Recommended pattern (in `app/sitemap.ts` and the unindexed route):
|
|
187
|
+
|
|
188
|
+
```ts
|
|
189
|
+
import { getRedirectMap, getSitemapEntries } from '@/lib/cms-server';
|
|
190
|
+
import { buildSitemap } from '@se-studio/core-ui';
|
|
191
|
+
|
|
192
|
+
export default async function sitemap() {
|
|
193
|
+
const redirectMap = await getRedirectMap({});
|
|
194
|
+
const entries = await getSitemapEntries({ includeUnindexed: false, redirectMap });
|
|
195
|
+
return buildSitemap([() => Promise.resolve(entries)], { baseUrl, ... });
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Pure `fromPath` vanity redirects were already absent from sitemaps (no backing content entry). This mainly helps when you redirect *away from* live CMS pages/articles.
|
|
200
|
+
|
|
177
201
|
### 4.3 Webhook = Deploy Hook (the trigger)
|
|
178
202
|
|
|
179
203
|
In Contentful → Settings → Webhooks, create (or reuse) a webhook that fires on:
|
|
@@ -226,6 +250,8 @@ Then commit the updated `.agents/skills/...` (the monorepo keeps them in sync wi
|
|
|
226
250
|
|
|
227
251
|
The `redirect` content type and the `buildRedirectMap` / `getRedirectMap` helpers are intentionally stable so a future faster path can consume the same data.
|
|
228
252
|
|
|
253
|
+
`buildRedirectMap` automatically drops self-redirects (A → A after normalization) and any rules that participate in longer cycles, emitting a console warning for cycles during build/generate. Internal paths are normalized with a trailing `/` to match your urlCalculators and sitemap hrefs.
|
|
254
|
+
|
|
229
255
|
---
|
|
230
256
|
|
|
231
257
|
**You now have editor-managed redirects that are as robust and low-surprise as your A/B tests, using only patterns that already exist in the codebase.**
|