Skip to content

Commit 24e86ed

Browse files
committed
docs: use idiomatic library/site IDs in libraries examples
The site library example now uses SiteGenesis (a real site ID) and the shared library is RefArchSharedLibrary so the difference between a site-private and shared library is obvious from the IDs alone.
1 parent f800185 commit 24e86ed

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

.changeset/site-library-config-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
'b2c-vs-extension': minor
55
---
66

7-
The `libraries` config field now accepts `{id, siteLibrary?}` objects in addition to bare strings (mixed forms allowed in the same array). This lets you mark site-private libraries in `dw.json` or `package.json` so `b2c content list` / `content export` can default `--site-library` based on which library you target, and the VS Code Content Libraries tree auto-loads every configured library on activation. To upgrade, optionally replace `"libraries": ["RefArch"]` with `"libraries": ["RefArch", {"id": "homepage", "siteLibrary": true}]`. The existing string-only form continues to work unchanged. Also adds `libraries`, `assetQuery`, and `realm` to the documented `package.json` allowed fields list (already supported in code).
7+
The `libraries` config field now accepts `{id, siteLibrary?}` objects in addition to bare strings (mixed forms allowed in the same array). This lets you mark site-private libraries in `dw.json` or `package.json` so `b2c content list` / `content export` can default `--site-library` based on which library you target, and the VS Code Content Libraries tree auto-loads every configured library on activation. To upgrade, optionally replace `"libraries": ["RefArchSharedLibrary"]` with `"libraries": ["RefArchSharedLibrary", {"id": "SiteGenesis", "siteLibrary": true}]`. The existing string-only form continues to work unchanged. Also adds `libraries`, `assetQuery`, and `realm` to the documented `package.json` allowed fields list (already supported in code).

docs/cli/content.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ export SFCC_CLIENT_ID=your-client-id
103103
export SFCC_CLIENT_SECRET=your-client-secret
104104
b2c content export homepage
105105

106-
# With a libraries config entry (see below) marking "homepage" as site-private,
107-
# --site-library is inferred automatically:
108-
b2c content export homepage --library homepage
106+
# With a libraries config entry (see below) marking the site library as
107+
# site-private, --site-library is inferred automatically:
108+
b2c content export homepage --library SiteGenesis
109109
```
110110

111111
### Configuring multiple libraries
@@ -116,8 +116,8 @@ Listing libraries under `b2c.libraries` in `package.json` (or `libraries` in `dw
116116
{
117117
"b2c": {
118118
"libraries": [
119-
"RefArch",
120-
{ "id": "homepage", "siteLibrary": true }
119+
"RefArchSharedLibrary",
120+
{ "id": "SiteGenesis", "siteLibrary": true }
121121
]
122122
}
123123
}
@@ -126,14 +126,14 @@ Listing libraries under `b2c.libraries` in `package.json` (or `libraries` in `dw
126126
With this config:
127127

128128
```bash
129-
# Uses RefArch (first entry) as the default library
129+
# Uses RefArchSharedLibrary (first entry) as the default library
130130
b2c content export hero-banner
131131

132132
# --site-library is inferred from the matching entry
133-
b2c content export homepage --library homepage
133+
b2c content export homepage --library SiteGenesis
134134

135135
# Explicit flag still overrides the config
136-
b2c content export homepage --library homepage --no-site-library
136+
b2c content export homepage --library SiteGenesis --no-site-library
137137
```
138138

139139
### Output
@@ -198,10 +198,10 @@ b2c content list --library SharedLibrary --tree
198198
# List from a site-private library
199199
b2c content list --library RefArch --site-library
200200

201-
# With a libraries config entry marking "homepage" as site-private,
201+
# With a libraries config entry marking the site library as site-private,
202202
# --site-library is inferred automatically (see "b2c content export"
203203
# above for an example b2c.libraries config):
204-
b2c content list --library homepage
204+
b2c content list --library SiteGenesis
205205

206206
# List from a local XML file
207207
b2c content list --library SharedLibrary --library-file ./library.xml

docs/guide/configuration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,19 +353,19 @@ A bare string is treated as a shared library; an object can mark a library as si
353353
{
354354
"b2c": {
355355
"libraries": [
356-
"RefArch",
357-
{ "id": "homepage", "siteLibrary": true }
356+
"RefArchSharedLibrary",
357+
{ "id": "SiteGenesis", "siteLibrary": true }
358358
]
359359
}
360360
}
361361
```
362362

363363
With this config:
364364

365-
- `b2c content list --library homepage` calls the site-library API automatically (no need to pass `--site-library`).
366-
- `b2c content list --library RefArch` treats `RefArch` as a shared library.
365+
- `b2c content list --library SiteGenesis` calls the site-library API automatically (no need to pass `--site-library`); the library ID is the site ID.
366+
- `b2c content list --library RefArchSharedLibrary` treats `RefArchSharedLibrary` as a shared library.
367367
- `--site-library` / `--no-site-library` on the command line still wins over the config default.
368-
- The VS Code Content Libraries tree shows both entries on activation, with `homepage` marked `[site]`.
368+
- The VS Code Content Libraries tree shows both entries on activation, with `SiteGenesis` marked `[site]`.
369369

370370
### Resolution Priority
371371

0 commit comments

Comments
 (0)