@plitzi/sdk-server 0.38.2 → 0.38.4

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 (54) hide show
  1. package/CHANGELOG.md +325 -0
  2. package/README.md +17 -7
  3. package/dist/core/createServer.devReload.test.d.ts +1 -0
  4. package/dist/core/http/stages/devReload.d.ts +18 -0
  5. package/dist/core/http/stages/devReload.js +40 -0
  6. package/dist/core/http/stages/images.js +1 -1
  7. package/dist/core/server/baseServer.d.ts +2 -0
  8. package/dist/core/server/baseServer.js +1 -0
  9. package/dist/core/server/drain.d.ts +2 -2
  10. package/dist/core/server/drain.js +17 -2
  11. package/dist/core/server/pageServer.js +8 -2
  12. package/dist/modules/images/imageProxy.js +19 -1
  13. package/dist/modules/rsc/connectorRscData.js +1 -1
  14. package/dist/modules/rsc/publicFileResolver.d.ts +3 -0
  15. package/dist/modules/rsc/publicFileResolver.js +10 -4
  16. package/dist/modules/ssr/prepareRender.js +1 -0
  17. package/dist/modules/ssr/views/template.ejs +6 -0
  18. package/dist/plugins/manager.js +1 -1
  19. package/package.json +3 -3
  20. package/skills/plitzi-authoring/CHEATSHEET.md +9 -5
  21. package/skills/plitzi-authoring/SKILL.md +6 -2
  22. package/skills/plitzi-authoring/recipes/accordion.ts +58 -0
  23. package/skills/plitzi-authoring/recipes/carousel.ts +14 -9
  24. package/skills/plitzi-authoring/recipes/detail-page.ts +10 -6
  25. package/skills/plitzi-authoring/recipes/every-few-seconds.ts +13 -8
  26. package/skills/plitzi-authoring/recipes/filter-a-list.ts +2 -2
  27. package/skills/plitzi-authoring/recipes/forms-and-modals.ts +1 -2
  28. package/skills/plitzi-authoring/recipes/from-tailwind.ts +1 -1
  29. package/skills/plitzi-authoring/recipes/link-to-a-section.ts +3 -3
  30. package/skills/plitzi-authoring/recipes/link-with-data.ts +12 -7
  31. package/skills/plitzi-authoring/recipes/marquee.ts +2 -2
  32. package/skills/plitzi-authoring/recipes/scroll-a-row.ts +5 -6
  33. package/skills/plitzi-authoring/recipes/server-data.ts +65 -0
  34. package/skills/plitzi-authoring/recipes/show-data.ts +12 -7
  35. package/skills/plitzi-authoring/recipes/style-a-page.ts +1 -1
  36. package/skills/plitzi-authoring/recipes/typed-data.ts +9 -6
  37. package/skills/plitzi-authoring/recipes/usable-without-sight.ts +2 -2
  38. package/skills/plitzi-authoring/reference/accessibility.md +8 -4
  39. package/skills/plitzi-authoring/reference/authoring-errors.md +13 -3
  40. package/skills/plitzi-authoring/reference/colours-and-motion.md +7 -0
  41. package/skills/plitzi-authoring/reference/components.md +2 -1
  42. package/skills/plitzi-authoring/reference/data-and-visibility.md +26 -16
  43. package/skills/plitzi-authoring/reference/drawing.md +22 -0
  44. package/skills/plitzi-authoring/reference/efficiency.md +10 -1
  45. package/skills/plitzi-authoring/reference/elements-and-styles.md +7 -11
  46. package/skills/plitzi-authoring/reference/lists.md +12 -7
  47. package/skills/plitzi-authoring/reference/plugins.md +5 -0
  48. package/skills/plitzi-authoring/reference/review-checklist.md +14 -2
  49. package/skills/plitzi-authoring/reference/snippets-and-export.md +2 -2
  50. package/skills/plitzi-authoring/reference/structure.md +1 -1
  51. package/skills/plitzi-authoring/reference/templates.md +1 -1
  52. package/skills/plitzi-authoring/reference/testing.md +10 -5
  53. package/skills/plitzi-authoring/reference/typed-sources.md +1 -1
  54. package/skills/plitzi-authoring/reference/validation.md +3 -2
@@ -13,8 +13,11 @@ expect((await inspectPage(page, handles)).problems).toEqual([]);
13
13
  It checks the open page and returns EVERY problem at once, one sentence each, naming the element and the reason:
14
14
 
15
15
  - every element the page owes is present and visible — its own and those of the layouts around it
16
- (`heading "hero-title" is on the page but not visible: display:none on "hero"`);
17
- - every image arrived — an image element that failed says so (`data-plitzi-failed`), though its fallback loads;
16
+ (`heading "hero-title" is on the page but not visible: display:none on "hero"`). One a breakpoint hides at this
17
+ width (`mobile: { display: 'none' }`, or shown only at another width) is laid out by width, not missing: listed in
18
+ `hiddenAtWidth`, and checked at the width it shows at — run the check at each width you author for;
19
+ - every image arrived — an image element that failed says so (`data-plitzi-failed`), though its fallback loads. A lazy
20
+ image out of sight (below the fold, or beside the screen in a carousel's track) has not been asked for yet, and waits;
18
21
  - nothing scrolls sideways (`the page scrolls sideways by 37px — widest: "cards"`);
19
22
  - no text is drawn in the colour painted behind it.
20
23
 
@@ -33,10 +36,12 @@ the list `inspectPage` holds a page to.
33
36
 
34
37
  Three flags say what a bare visit cannot promise, and `onScreen` leaves out:
35
38
 
36
- - `conditional` — on screen only under a condition of its own or of an ancestor;
39
+ - `conditional` — on screen only under a condition of its own or of an ancestor, or with every child conditional (a
40
+ list of flyouts at rest);
37
41
  - `repeated` — inside a list row, so rendered once per row: several copies, or none while the list is empty. Address
38
42
  one with `.first()` / `.nth(i)`, in a test that knows the data;
39
- - `boxless` — a provider with no tag, which renders its children and no element of its own.
43
+ - `boxless` — a provider with no tag, which renders its children and no element of its own; or a plugin whose
44
+ declaration says `drawsNothing: true` — behaviour rather than content, a clock that fires a flow.
40
45
 
41
46
  A `formControl`'s id names its wrapper: type into `locate('email').locator('input')`.
42
47
 
@@ -82,7 +87,7 @@ One code on one element; it comes back in `warnings` with the reason, and an ent
82
87
 
83
88
  ## What to check
84
89
 
85
- - **Every viewport and both themes.** Desktop, tablet (48–64rem) and mobile (below 48rem); `colorScheme: 'dark'` as well
90
+ - **Every viewport and both themes.** Desktop, tablet (48–64rem) and mobile (up to 48rem); `colorScheme: 'dark'` as well
86
91
  as light.
87
92
  - **No horizontal scroll on a phone.** A column child grows to its content unless its parent stretches it; a code
88
93
  block or a wide table is what finds out.
@@ -9,7 +9,7 @@ const site = source('site', home);
9
9
  apiContainer({ id: site.id, query: '/data/home.json', children: [
10
10
  heading({ from: site.data.hero.title }),
11
11
  text({ content: twig`{{ ${site.data.products}|length }} products` }),
12
- list({ id: 'products', items: site.data.products, row: p => text({ from: p.item.title }) })
12
+ list({ id: 'products', items: site.data.products, row: p => listItem({ children: [text({ from: p.item.title })] }) })
13
13
  ] })
14
14
  ```
15
15
 
@@ -47,8 +47,9 @@ bar.
47
47
 
48
48
  2. **Fix, re-run, until it prints zero warnings.** What has one fix (`author` says how many) is written for you: `npx
49
49
  plitzi fix` shows it as a diff of your source, `--write` writes it and keeps it only if the space authors with each
50
- fix gone and nothing new — a fix it cannot place, or that would add a problem, is said with the reason. Then
51
- typecheck the project.
50
+ fix gone and nothing new — a fix it cannot place, or that would add a problem, is said with the reason. A
51
+ suggestion with one reading is written the same way (`content-attribute`: words and an icon held as children become
52
+ the button's or link's own `content` and `icon`). Then typecheck the project.
52
53
  3. **Look at it** — in a browser, at desktop and phone width, in both themes (see [testing](testing.md)). Stage 3 is
53
54
  thorough about MEANING and blind to what follows.
54
55