Skip to content

@W-22453800 site library support in libraries config#422

Merged
clavery merged 4 commits into
mainfrom
feat/site-library-config
May 13, 2026
Merged

@W-22453800 site library support in libraries config#422
clavery merged 4 commits into
mainfrom
feat/site-library-config

Conversation

@clavery
Copy link
Copy Markdown
Collaborator

@clavery clavery commented May 12, 2026

Summary

  • The libraries config field (in dw.json, package.json, env) now accepts {id, siteLibrary?} entries in addition to bare strings; mixed shapes allowed in the same array.
  • b2c content list / content export default --site-library from a matching libraries entry. The flag is now allowNo with no default, so --site-library / --no-site-library still wins when passed.
  • VS Code Content Libraries tree seeds every configured entry on activation (instead of only the single contentLibrary), with each entry's siteLibrary flag honored — site-private libraries show the [site] tag automatically.
  • Documents libraries, assetQuery, and realm (already supported in code) in the package.json and dw.json field tables.

Closes #421
GUS: W-22453800

Test plan

  • pnpm run typecheck:agent
  • pnpm run lint:agent
  • pnpm run test:agent
  • New SDK tests: resolveLibraryEntries helper unit tests + PackageJsonSource accepts libraries (string and object forms)
  • New CLI tests: content list defaults --site-library from a matching libraries entry; --no-site-library overrides; falls back to first libraries entry when --library and contentLibrary are unset
  • Manual VS Code: open Content Libraries view with a package.json like { "b2c": { "libraries": ["RefArch", {"id": "homepage", "siteLibrary": true}] } } — both libraries appear, homepage shows [site]

Extends libraries to accept {id, siteLibrary?} entries (mixed with strings).
b2c content list/export default --site-library from a matching entry; the
flag is now allowNo with no default so explicit values still win. The VS
Code Content Libraries tree auto-seeds every entry on activation. Adds
libraries, assetQuery, and realm rows to the documented package.json /
dw.json field tables.
@clavery clavery requested a review from wei-liu-sf as a code owner May 12, 2026 18:23
@clavery clavery changed the title site library support in libraries config @W-22453800 site library support in libraries config May 12, 2026
clavery added 3 commits May 12, 2026 14:30
Add a concrete example of the libraries config (mixed shared + site
entries) under b2c content export, and a corresponding inferred-flag
example under b2c content list, so the new behavior is visible in the
CLI command docs and not just the configuration guide.
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.
When both contentLibrary and libraries are configured, the Content
Libraries tree now seeds the union of both rather than only the
libraries array. Uses a new getExplicitContentLibrary accessor so the
seeder doesn't double-add a library that's already in the libraries
list via the existing libraries[0] fallback in getContentLibrary.
@clavery clavery merged commit e4b8238 into main May 13, 2026
7 checks passed
@clavery clavery deleted the feat/site-library-config branch May 13, 2026 01:21
clavery added a commit that referenced this pull request May 14, 2026
The SDK previously dual-published both ESM and CJS via tsconfig.cjs.json.
With module: Node16, tsc respected the SDK's "type": "module" and emitted
ESM syntax into dist/cjs/, which Node's CJS loader then rejected at
runtime. Production paths (CLI, MCP, VSIX bundle) all consumed the ESM
build, so the broken CJS output went unnoticed until vscode-test loaded
out/test/*.js as CJS and required the SDK transitively (#422 added the
first such SDK import to webdav-mappings.ts).

Drop the CJS build entirely and simplify the SDK exports map to ESM-only.
Convert the VS extension package to "type": "module" so its tsc test
compile emits ESM; rename the esbuild output to dist/extension.cjs (still
CJS-formatted, since VS Code requires a CJS extension entry) and point
main at the new filename. Replace two __dirname usages in tests with
fileURLToPath(import.meta.url). Re-enable the VS extension test step.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to configure package.json to reference a site library

1 participant