payload-live-preview 2.0.0-beta.0 → 2.0.0

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.
Files changed (109) hide show
  1. package/README.md +60 -775
  2. package/dist/adapters/astro/PreviewBoundary.astro +2 -2
  3. package/dist/adapters/astro/index.d.ts +28 -154
  4. package/dist/adapters/astro/index.js +1 -1
  5. package/dist/adapters/astro/index.js.map +1 -1
  6. package/dist/adapters/astro/middleware-entry.d.ts +3 -2
  7. package/dist/adapters/astro/middleware-entry.js +1 -1
  8. package/dist/adapters/astro/middleware-entry.js.map +1 -1
  9. package/dist/adapters/nextjs/index.d.ts +247 -6
  10. package/dist/adapters/nextjs/index.js +1 -1
  11. package/dist/adapters/nextjs/index.js.map +1 -1
  12. package/dist/adapters/nuxt/index.d.ts +58 -3
  13. package/dist/adapters/nuxt/index.js +1 -1
  14. package/dist/adapters/nuxt/index.js.map +1 -1
  15. package/dist/adapters/nuxt/module.d.ts +82 -0
  16. package/dist/adapters/nuxt/module.js +2 -0
  17. package/dist/adapters/nuxt/module.js.map +1 -0
  18. package/dist/adapters/react/index.d.ts +110 -0
  19. package/dist/adapters/react/index.js +3 -0
  20. package/dist/adapters/react/index.js.map +1 -0
  21. package/dist/adapters/sveltekit/index.d.ts +65 -7
  22. package/dist/adapters/sveltekit/index.js +1 -1
  23. package/dist/adapters/sveltekit/index.js.map +1 -1
  24. package/dist/adapters/vue/index.d.ts +56 -0
  25. package/dist/adapters/vue/index.js +2 -0
  26. package/dist/adapters/vue/index.js.map +1 -0
  27. package/dist/annotate.d.ts +161 -0
  28. package/dist/annotate.js +2 -0
  29. package/dist/annotate.js.map +1 -0
  30. package/dist/client.cjs +1 -1
  31. package/dist/client.cjs.map +1 -1
  32. package/dist/client.d.cts +182 -9
  33. package/dist/client.d.ts +182 -9
  34. package/dist/client.js +1 -1
  35. package/dist/client.js.map +1 -1
  36. package/dist/codegen-astro.js +1 -1
  37. package/dist/codegen-astro.js.map +1 -1
  38. package/dist/codegen-cli.js +1 -1
  39. package/dist/codegen-cli.js.map +1 -1
  40. package/dist/codegen.cjs +1 -1
  41. package/dist/codegen.cjs.map +1 -1
  42. package/dist/codegen.d.cts +129 -4
  43. package/dist/codegen.d.ts +129 -4
  44. package/dist/codegen.js +1 -1
  45. package/dist/codegen.js.map +1 -1
  46. package/dist/core.cjs +1 -1
  47. package/dist/core.cjs.map +1 -1
  48. package/dist/core.d.cts +264 -73
  49. package/dist/core.d.ts +264 -73
  50. package/dist/core.js +1 -1
  51. package/dist/core.js.map +1 -1
  52. package/dist/doctor-cli.d.ts +1 -1
  53. package/dist/doctor-cli.js +1 -1
  54. package/dist/doctor-cli.js.map +1 -1
  55. package/dist/doctor.d.ts +7 -6
  56. package/dist/doctor.js +1 -1
  57. package/dist/doctor.js.map +1 -1
  58. package/dist/document-session-BfBfLVpg.d.ts +53 -0
  59. package/dist/fragment-endpoint-3Mlz7GDz.d.ts +189 -0
  60. package/dist/fragment.cjs +1 -1
  61. package/dist/fragment.cjs.map +1 -1
  62. package/dist/fragment.d.cts +64 -18
  63. package/dist/fragment.d.ts +64 -18
  64. package/dist/fragment.js +1 -1
  65. package/dist/fragment.js.map +1 -1
  66. package/dist/index.cjs +1 -1
  67. package/dist/index.cjs.map +1 -1
  68. package/dist/index.d.cts +422 -83
  69. package/dist/index.d.ts +422 -83
  70. package/dist/index.js +1 -1
  71. package/dist/index.js.map +1 -1
  72. package/dist/lean.cjs +2 -0
  73. package/dist/lean.cjs.map +1 -0
  74. package/dist/lean.d.cts +44 -0
  75. package/dist/lean.d.ts +44 -0
  76. package/dist/lean.js +2 -0
  77. package/dist/lean.js.map +1 -0
  78. package/dist/lexical.cjs +1 -1
  79. package/dist/lexical.cjs.map +1 -1
  80. package/dist/lexical.d.cts +19 -1
  81. package/dist/lexical.d.ts +19 -1
  82. package/dist/lexical.js +1 -1
  83. package/dist/lexical.js.map +1 -1
  84. package/dist/locals-DBXDMxOA.d.ts +45 -0
  85. package/dist/{middleware-CEPsY1P7.d.ts → middleware-Bx9I7PXW.d.ts} +14 -14
  86. package/dist/migrate.d.ts +4 -3
  87. package/dist/migrate.js +1 -1
  88. package/dist/migrate.js.map +1 -1
  89. package/dist/{options-CEzzfHJu.d.ts → options-BW1eqXvc.d.ts} +90 -2
  90. package/dist/plugins.cjs +1 -1
  91. package/dist/plugins.cjs.map +1 -1
  92. package/dist/plugins.d.cts +111 -6
  93. package/dist/plugins.d.ts +111 -6
  94. package/dist/plugins.js +1 -1
  95. package/dist/plugins.js.map +1 -1
  96. package/dist/{probe-CYtvj_Lm.d.ts → probe-CELeUciC.d.ts} +26 -4
  97. package/dist/server.cjs +1 -1
  98. package/dist/server.cjs.map +1 -1
  99. package/dist/server.d.cts +67 -13
  100. package/dist/server.d.ts +67 -13
  101. package/dist/server.js +1 -1
  102. package/dist/server.js.map +1 -1
  103. package/dist/structural.cjs +2 -2
  104. package/dist/structural.cjs.map +1 -1
  105. package/dist/structural.d.cts +47 -4
  106. package/dist/structural.d.ts +47 -4
  107. package/dist/structural.js +2 -2
  108. package/dist/structural.js.map +1 -1
  109. package/package.json +77 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload-live-preview",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0",
4
4
  "description": "Live preview for Payload CMS in Astro and any SSR/static frontend (SvelteKit, Nuxt, Next.js, plain HTML). Patches the DOM live, no rebuild.",
5
5
  "author": "relative23",
6
6
  "license": "MIT",
@@ -54,6 +54,24 @@
54
54
  "default": "./dist/adapters/nuxt/index.js"
55
55
  }
56
56
  },
57
+ "./nuxt-module": {
58
+ "import": {
59
+ "types": "./dist/adapters/nuxt/module.d.ts",
60
+ "default": "./dist/adapters/nuxt/module.js"
61
+ }
62
+ },
63
+ "./react": {
64
+ "import": {
65
+ "types": "./dist/adapters/react/index.d.ts",
66
+ "default": "./dist/adapters/react/index.js"
67
+ }
68
+ },
69
+ "./vue": {
70
+ "import": {
71
+ "types": "./dist/adapters/vue/index.d.ts",
72
+ "default": "./dist/adapters/vue/index.js"
73
+ }
74
+ },
57
75
  "./codegen": {
58
76
  "import": {
59
77
  "types": "./dist/codegen.d.ts",
@@ -70,6 +88,12 @@
70
88
  "default": "./dist/codegen-astro.js"
71
89
  }
72
90
  },
91
+ "./annotate": {
92
+ "import": {
93
+ "types": "./dist/annotate.d.ts",
94
+ "default": "./dist/annotate.js"
95
+ }
96
+ },
73
97
  "./doctor": {
74
98
  "import": {
75
99
  "types": "./dist/doctor.d.ts",
@@ -142,6 +166,16 @@
142
166
  "default": "./dist/plugins.cjs"
143
167
  }
144
168
  },
169
+ "./lean": {
170
+ "import": {
171
+ "types": "./dist/lean.d.ts",
172
+ "default": "./dist/lean.js"
173
+ },
174
+ "require": {
175
+ "types": "./dist/lean.d.cts",
176
+ "default": "./dist/lean.cjs"
177
+ }
178
+ },
145
179
  "./fragment": {
146
180
  "import": {
147
181
  "types": "./dist/fragment.d.ts",
@@ -159,7 +193,8 @@
159
193
  "types": "./dist/adapters/astro/middleware-entry.d.ts",
160
194
  "default": "./dist/adapters/astro/middleware-entry.js"
161
195
  }
162
- }
196
+ },
197
+ "./package.json": "./package.json"
163
198
  },
164
199
  "bin": {
165
200
  "pll-codegen": "./dist/codegen-cli.js",
@@ -172,8 +207,8 @@
172
207
  ],
173
208
  "sideEffects": false,
174
209
  "scripts": {
175
- "build:runtime": "tsx scripts/build-runtime.ts",
176
- "build": "npm run build:runtime && tsx scripts/build-dist.ts && npm run build:assets && npm run test:bundle && npm run test:treeshake && npm run test:edge",
210
+ "build:runtime": "node -e \"const c=require('node:child_process'),e={...process.env};if(!e.SOURCE_DATE_EPOCH){const g=c.spawnSync('git',['show','-s','--format=%ct','HEAD'],{encoding:'utf8'});if(g.status===0)e.SOURCE_DATE_EPOCH=g.stdout.trim()}process.exit(c.spawnSync(process.execPath,['--import','tsx',process.argv[1]],{stdio:'inherit',env:e}).status??1)\" scripts/build-runtime.ts",
211
+ "build": "npm run build:runtime && tsx scripts/build-dist.ts && npm run build:assets && npm run test:bundle && npm run test:treeshake && npm run test:edge && npm run test:interaction && npm run test:protocol-semantics",
177
212
  "build:assets": "node -e \"const fs=require('node:fs');for(const f of ['RichText','PreviewBoundary'])fs.copyFileSync('src/adapters/astro/'+f+'.astro','dist/adapters/astro/'+f+'.astro')\"",
178
213
  "dev": "tsup --watch",
179
214
  "pretest": "npm run build:runtime",
@@ -190,20 +225,26 @@
190
225
  "test:bench": "vitest bench tests/benchmarks",
191
226
  "test:bench:codspeed": "vitest bench --run --config vitest.bench.config.ts",
192
227
  "test:bundle": "tsx scripts/check-bundle-size.ts",
228
+ "test:interaction": "tsx scripts/check-interaction-budgets.ts",
229
+ "test:protocol-semantics": "tsx scripts/check-protocol-semantics.ts",
230
+ "test:upstream-findings": "tsx scripts/check-upstream-findings.ts",
193
231
  "test:treeshake": "tsx scripts/check-tree-shaking.ts",
194
232
  "test:edge": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' tsx scripts/check-edge-runtime.ts",
195
233
  "compat:check": "tsx scripts/compat-table.ts --check",
196
234
  "compat:write": "tsx scripts/compat-table.ts --write",
235
+ "compat:refresh": "tsx scripts/compat-table.ts --refresh",
236
+ "diagnostics:check": "tsx scripts/diagnostic-table.ts --check",
197
237
  "test:package": "tsx scripts/check-package.ts",
198
238
  "audit:gate": "tsx scripts/audit-gate.ts",
199
239
  "test:smoke": "tsx scripts/post-publish-smoke.ts",
200
240
  "test:coverage": "vitest run --coverage",
201
241
  "test:coverage:diff": "tsx scripts/coverage-policy.ts",
202
242
  "test:policy": "tsx scripts/test-policy.ts",
203
- "test:architecture": "tsx scripts/architecture-policy.ts && tsx scripts/workflow-contracts.ts && tsx scripts/docs-contracts.ts && knip --no-progress --treat-config-hints-as-errors",
243
+ "test:architecture": "tsx scripts/architecture-policy.ts && tsx scripts/check-complexity.ts && tsx scripts/check-trusted-core.ts && tsx scripts/compare-scope.ts --check && tsx scripts/workflow-contracts.ts && tsx scripts/docs-contracts.ts && knip --no-progress --treat-config-hints-as-errors",
204
244
  "test:property": "vitest run tests/unit/property",
205
245
  "test:mutation": "stryker run stryker.config.js",
206
246
  "test:mutation:policy:pr": "tsx scripts/mutation-policy.ts --policy quality/mutation-policy-pr.json --report test-results/stryker-pr.json",
247
+ "test:mutation:policy:core": "tsx scripts/mutation-policy.ts --policy quality/mutation-policy-core.json --report test-results/stryker-core.json",
207
248
  "test:mutation:policy": "tsx scripts/mutation-policy.ts",
208
249
  "test:leak": "node --expose-gc --import tsx scripts/leak-soak.ts",
209
250
  "test:leak:quick": "node --expose-gc --import tsx scripts/leak-soak.ts --quick",
@@ -213,7 +254,7 @@
213
254
  "lint:fix": "eslint . --fix",
214
255
  "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\" \"*.{js,cjs,mjs,ts,json,jsonc,yml,yaml,md}\" \"quality/**/*.json\" \"docs/**/*.md\" \"type-tests/**/*.md\" \".prettierrc.json\" \".changeset/*.{json,md}\" \".github/**/*.{yml,yaml,json}\" \"examples/**/*.{ts,tsx,js,cjs,mjs,json}\" && prettier --write \"type-tests/packed/*.fixture\" --parser typescript",
215
256
  "format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\" \"*.{js,cjs,mjs,ts,json,jsonc,yml,yaml,md}\" \"quality/**/*.json\" \"docs/**/*.md\" \"type-tests/**/*.md\" \".prettierrc.json\" \".changeset/*.{json,md}\" \".github/**/*.{yml,yaml,json}\" \"examples/**/*.{ts,tsx,js,cjs,mjs,json}\" && prettier --check \"type-tests/packed/*.fixture\" --parser typescript",
216
- "check": "npm run typecheck && npm run lint && npm run test:policy && npm run test:architecture && npm run test",
257
+ "check": "npm run typecheck && npm run lint && npm run format:check && npm run test:policy && npm run test:architecture && npm run compat:check && npm run diagnostics:check && npm run test",
217
258
  "prepublishOnly": "npm run build && npm run check && npm run format:check && npm run test:package",
218
259
  "changeset": "changeset",
219
260
  "version": "changeset version && tsx scripts/sync-lockfile-metadata.ts",
@@ -228,12 +269,16 @@
228
269
  "@eslint/js": "^10.0.1",
229
270
  "@fast-check/vitest": "^0.4.1",
230
271
  "@microsoft/api-extractor": "^7.58.12",
272
+ "@payloadcms/live-preview": "^3.88.0",
231
273
  "@playwright/test": "^1.62.1",
232
274
  "@stryker-mutator/core": "^9.6.1",
233
275
  "@stryker-mutator/vitest-runner": "^9.6.1",
276
+ "@testing-library/react": "^16.3.3",
234
277
  "@types/jsdom": "^30.0.0",
235
278
  "@types/node": "^22.20.1",
236
- "@vitest/coverage-v8": "^4.1.10",
279
+ "@types/react": "^19.2.18",
280
+ "@types/react-dom": "^19.2.7",
281
+ "@vitest/coverage-v8": "^4.1.11",
237
282
  "esbuild": "^0.28.2",
238
283
  "eslint": "^10.8.1",
239
284
  "fast-check": "^4.9.0",
@@ -242,6 +287,8 @@
242
287
  "knip": "^6.32.2",
243
288
  "prettier": "^3.9.6",
244
289
  "publint": "^0.3.23",
290
+ "react": "^19.2.8",
291
+ "react-dom": "^19.2.8",
245
292
  "terser": "^5.46.1",
246
293
  "ts-morph": "^28.0.0",
247
294
  "tsup": "^8.5.1",
@@ -249,7 +296,8 @@
249
296
  "typescript": "^5.9.3",
250
297
  "typescript-eslint": "^8.67.0",
251
298
  "vite": "^7.3.6",
252
- "vitest": "^4.1.10",
299
+ "vitest": "^4.1.11",
300
+ "vue": "^3.5.42",
253
301
  "yaml": "^2.9.0"
254
302
  },
255
303
  "overrides": {
@@ -287,14 +335,34 @@
287
335
  ],
288
336
  "peerDependencies": {
289
337
  "astro": ">=4.0.0 <8.0.0",
290
- "ts-morph": "^28.0.0"
338
+ "react": ">=18",
339
+ "react-dom": ">=18",
340
+ "svelte": ">=5",
341
+ "ts-morph": "^28.0.0",
342
+ "vite": ">=5.4.0 <9.0.0",
343
+ "vue": ">=3.3"
291
344
  },
292
345
  "peerDependenciesMeta": {
293
346
  "astro": {
294
347
  "optional": true
295
348
  },
349
+ "react": {
350
+ "optional": true
351
+ },
352
+ "react-dom": {
353
+ "optional": true
354
+ },
355
+ "svelte": {
356
+ "optional": true
357
+ },
296
358
  "ts-morph": {
297
359
  "optional": true
360
+ },
361
+ "vue": {
362
+ "optional": true
363
+ },
364
+ "vite": {
365
+ "optional": true
298
366
  }
299
367
  },
300
368
  "engines": {