Files
webstudio/packages/cli/package.json
T
Oleg Isonen 2ec78c183d feat: Add single-result modes to Assets queries (#6040)
## Summary

- Add `many`, `one`, `first`, and `last` result modes to Assets queries
while keeping `many` as the backward-compatible default.
- Return direct items for single-result modes, validate deterministic
ordering, and report duplicate `one` matches as a structured
`MULTIPLE_RESULTS` error.
- Update Builder controls, preview/published runtime handling, SDK
resource encoding, MCP/CLI guidance, generated contracts, and fixtures.

## Implementation TODOs

- [x] Add result-mode schemas and core execution behavior.
- [x] Select single results before content hydration and preserve
deterministic ID tie-breaking.
- [x] Add structured duplicate-match transport errors.
- [x] Update Builder controls and hide/reset pagination for
single-result modes.
- [x] Keep existing settings first, then Output and Result, without a
duplicate Return label.
- [x] Preserve legacy saved resources with an implicit `many` default.
- [x] Update preview, published runtime, SDK, protocol, MCP, and CLI
behavior.
- [x] Regenerate runtime contracts, server metadata, CLI docs, and
fixtures.
- [x] Review documentation impact and update the authoritative MCP/CLI
guidance.
- [x] Add regression coverage and verify the new tests fail without the
implementation.
- [ ] Run the agent evaluation suite (not run; requires explicit user
approval).

## Compatibility and behavior

- Existing queries without `result` continue to behave as `many` and
retain the ID-keyed collection shape.
- `one` returns an item or `null`, but fails when more than one asset
matches.
- `first` and `last` require explicit sorting; the existing asset-ID
tie-breaker makes equal sort values deterministic.
- Single-result modes ignore and do not persist pagination controls.
Materialized collection queries remain collection-only; single-result
queries execute dynamically.

## Verification

- Content engine typecheck and full test suite (291 tests).
- Query builder, query-builder React, SDK, protocol, asset uploader,
project build, Builder, and CLI targeted typechecks/tests.
- Root lint.
- MCP documentation tests, typecheck, sync check, and generated-doc
checks.
- Generated API contract checks.
- Fixture generation pipeline.
- Final focused content-engine regression run (53 tests).
- Final DRY review: affected typechecks, focused tests, lint, package
boundaries, generated checks, and fixtures.

Closes #6039
2026-08-07 19:13:19 +02:00

123 lines
4.4 KiB
JSON

{
"name": "webstudio",
"version": "0.0.0-webstudio-version",
"description": "Webstudio CLI",
"author": "Webstudio <github@webstudio.is>",
"homepage": "https://webstudio.is",
"type": "module",
"bin": {
"webstudio-cli": "./bin.js",
"webstudio": "./bin.js"
},
"files": [
"lib/*",
"templates/*",
"bin.js",
"!*.{test,stories}.*"
],
"scripts": {
"typecheck": "tsc --noEmit",
"generate-docs": "tsx scripts/generate-docs.ts && oxfmt src/docs.generated.ts",
"build:content-runtime": "esbuild @webstudio-is/content-engine/runtime --bundle --format=esm --platform=browser --target=es2022 --conditions=webstudio --minify --outfile=lib/content-runtime.js",
"fixtures:build": "pnpm build:content-runtime",
"build": "pnpm generate-docs && rm -rf lib && vite build && pnpm build:content-runtime",
"pretest": "mkdir -p lib && pnpm build:content-runtime",
"evaluations": "tsx --import ../../scripts/register-react-global.ts --conditions=webstudio evaluations/high-impact/run-local-agent.ts",
"test": "vitest run",
"test:release-smoke": "pnpm build && tsx --conditions=webstudio scripts/release-smoke.ts",
"test:release-smoke:model": "WEBSTUDIO_RELEASE_SMOKE_MODEL_EVAL_REQUIRED=1 pnpm test:release-smoke",
"test:release-smoke:registry": "tsx --conditions=webstudio scripts/release-smoke.ts"
},
"license": "AGPL-3.0-or-later",
"engines": {
"node": ">=22"
},
"dependencies": {
"@clack/prompts": "^0.10.0",
"@emotion/hash": "^0.9.2",
"@trpc/client": "^10.45.2",
"@webstudio-is/http-client": "workspace:*",
"@webstudio-is/project-migrations": "workspace:*",
"@webstudio-is/protocol": "workspace:*",
"@webstudio-is/sync-client": "workspace:*",
"acorn": "^8.14.1",
"acorn-jsx": "^5.3.2",
"acorn-walk": "^8.3.4",
"change-case": "^5.4.4",
"chrome-launcher": "^1.2.1",
"deepmerge": "^4.3.1",
"decode-named-character-reference": "^1.0.2",
"env-paths": "^3.0.0",
"esbuild": "^0.25.3",
"fast-deep-equal": "^3.1.3",
"immer": "^10.1.1",
"nanoid": "^5.1.5",
"p-limit": "^6.2.0",
"parse5": "7.3.0",
"picocolors": "^1.1.1",
"reserved-identifiers": "^1.0.0",
"tinyexec": "^0.3.2",
"tus-js-client": "^4.3.1",
"warn-once": "^0.1.1",
"yargs": "^17.7.2",
"zod": "^4.4.3"
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.1.0",
"@netlify/vite-plugin-react-router": "^1.0.1",
"@react-router/dev": "^7.5.3",
"@react-router/fs-routes": "^7.5.3",
"@react-router/node": "^7.5.3",
"@react-router/serve": "^7.5.3",
"@remix-run/cloudflare": "^2.16.5",
"@remix-run/cloudflare-pages": "^2.16.5",
"@remix-run/dev": "^2.16.5",
"@remix-run/node": "^2.16.5",
"@remix-run/react": "^2.16.5",
"@remix-run/server-runtime": "^2.16.5",
"@shikijs/langs": "4.4.1",
"@shikijs/themes": "4.4.1",
"@types/mdast": "^4.0.4",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/yargs": "^17.0.33",
"@vercel/react-router": "^1.1.0",
"@vitejs/plugin-react": "^4.4.1",
"@webstudio-is/css-engine": "workspace:*",
"@webstudio-is/content-engine": "workspace:*",
"@webstudio-is/expression": "workspace:*",
"@webstudio-is/fonts": "workspace:*",
"@webstudio-is/image": "workspace:*",
"@webstudio-is/project-build": "workspace:*",
"@webstudio-is/query-builder": "workspace:*",
"@webstudio-is/react-sdk": "workspace:*",
"@webstudio-is/sdk": "workspace:*",
"@webstudio-is/sdk-components-animation": "workspace:*",
"@webstudio-is/sdk-components-react": "workspace:*",
"@webstudio-is/sdk-components-react-radix": "workspace:*",
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"@webstudio-is/sdk-components-react-router": "workspace:*",
"@webstudio-is/sdk-components-registry": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
"@webstudio-is/wsauth": "workspace:*",
"h3": "^1.15.1",
"ipx": "^3.0.3",
"isbot": "^5.1.25",
"mdast-util-directive": "^3.1.0",
"mdast-util-from-markdown": "^2.0.3",
"mdast-util-to-string": "^4.0.0",
"micromark-extension-directive": "^4.0.0",
"oxfmt": "0.58.0",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-router": "^7.5.3",
"shiki": "4.4.1",
"ts-expect": "^1.3.0",
"typescript": "7.0.2",
"vike": "^0.4.229",
"vite": "^6.3.4",
"vitest": "^3.1.2",
"wrangler": "^3.63.2"
}
}