astroidjs 0.18.0 → 0.20.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 (44) hide show
  1. package/README.md +6 -7
  2. package/bin/astroid.mjs +51 -11
  3. package/dist/commerce/adapters.js +3 -3
  4. package/dist/commerce/checkout.js +1 -1
  5. package/dist/commerce/mirror.js +5 -4
  6. package/dist/commerce/roles.js +3 -3
  7. package/dist/commerce/secrets.d.ts +7 -0
  8. package/dist/commerce/secrets.js +12 -3
  9. package/dist/config.d.ts +85 -16
  10. package/dist/config.js +111 -8
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +1 -0
  13. package/dist/portal/guard.js +1 -1
  14. package/dist/project/generate.js +96 -52
  15. package/dist/project/index.d.ts +1 -0
  16. package/dist/project/index.js +1 -0
  17. package/dist/project/migrations.d.ts +26 -0
  18. package/dist/project/migrations.js +78 -0
  19. package/dist/project/scaffold.d.ts +6 -0
  20. package/dist/project/scaffold.js +33 -11
  21. package/dist/queues/index.d.ts +1 -1
  22. package/dist/queues/index.js +1 -1
  23. package/dist/queues/messages.d.ts +6 -0
  24. package/dist/queues/messages.js +17 -2
  25. package/dist/queues/scaffold.js +5 -1
  26. package/dist/schema/collections.d.ts +6 -0
  27. package/dist/schema/collections.js +14 -2
  28. package/dist/schema/framework.js +1 -1
  29. package/dist/schema/generate.js +48 -4
  30. package/dist/security/index.d.ts +1 -1
  31. package/dist/security/index.js +1 -1
  32. package/dist/security/rate-rules.d.ts +9 -2
  33. package/dist/security/rate-rules.js +46 -22
  34. package/dist/seo/routes.js +3 -2
  35. package/dist/shape.d.ts +6 -0
  36. package/dist/shape.js +14 -0
  37. package/dist/status.js +22 -10
  38. package/dist/worker/generate.js +142 -10
  39. package/dist/workflow/advance.js +1 -1
  40. package/dist/workflow/config.js +1 -1
  41. package/package.json +3 -3
  42. package/src/components/Credit.astro +70 -0
  43. package/src/components/StageBar.astro +1 -1
  44. package/src/components/media-meta.ts +1 -1
@@ -0,0 +1,70 @@
1
+ ---
2
+ // `<Credit>`—the agency credit from `config.credit`, for the site's footer.
3
+ // Renders nothing when the config has no `credit`, so it's safe to leave in a
4
+ // footer permanently.
5
+ //
6
+ // The mark is a CSS mask filled with `currentColor`, not an `<img>`. An SVG
7
+ // loaded through `<img>` renders in its own document and can't see the page's
8
+ // text color, so it would stay whatever color it was drawn in on every theme.
9
+ // As a mask, only its shape counts and the fill follows the theme. It's
10
+ // `aria-hidden` because the name beside it already says who it is, so a screen
11
+ // reader reads the name once.
12
+ //
13
+ // The styles are scoped here rather than written as Tailwind utilities: a site
14
+ // may not scan node_modules, and the credit has to look the same either way.
15
+ import type { AstroidConfig } from "astroidjs";
16
+
17
+ interface Props {
18
+ config: AstroidConfig;
19
+ class?: string;
20
+ }
21
+
22
+ const { config, class: className } = Astro.props;
23
+ const credit = config.credit;
24
+ // `defineAstroid` limits `logo` to a root-relative path or an https URL, and
25
+ // JSON quoting keeps a space or parenthesis in the path from ending the `url()`.
26
+ const markStyle = credit?.logo ? `--astroid-credit-mark:url(${JSON.stringify(credit.logo)})` : "";
27
+ ---
28
+
29
+ {
30
+ credit && (
31
+ <p class:list={["astroid-credit", className]}>
32
+ <a href={credit.href} rel={credit.rel}>
33
+ {credit.logo && <span class="astroid-credit__mark" aria-hidden="true" style={markStyle} />}
34
+ <span>
35
+ {credit.label ?? "Site by"} {credit.name}
36
+ </span>
37
+ </a>
38
+ </p>
39
+ )
40
+ }
41
+
42
+ <style>
43
+ .astroid-credit {
44
+ margin: 0;
45
+ font-size: 0.75rem;
46
+ line-height: 1.5;
47
+ }
48
+ /* Low contrast, not illegible: 70% of the theme's text color stays above
49
+ WCAG AA on daisyUI's light and dark base colors. */
50
+ .astroid-credit a {
51
+ display: inline-flex;
52
+ align-items: center;
53
+ gap: 0.4em;
54
+ color: inherit;
55
+ opacity: 0.7;
56
+ text-decoration: none;
57
+ }
58
+ .astroid-credit a:hover,
59
+ .astroid-credit a:focus-visible {
60
+ opacity: 1;
61
+ text-decoration: underline;
62
+ }
63
+ .astroid-credit__mark {
64
+ flex: none;
65
+ width: 1.25em;
66
+ height: 1.25em;
67
+ background-color: currentColor;
68
+ mask: var(--astroid-credit-mark) center / contain no-repeat;
69
+ }
70
+ </style>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  // `<StageBar>`—a pipeline's progress as a segmented bar.
3
3
  //
4
- // Generalized from ghostfire's six-stage floor tracker, which hard-coded the
4
+ // Generalized from a client site's six-stage floor tracker, which hard-coded the
5
5
  // segment count, the corner radii, the brand hex codes, and a mascot image.
6
6
  // Here the stage list drives everything and the colours are theme tokens, so a
7
7
  // four-stage onboarding flow and an eight-stage production line both work and
@@ -9,7 +9,7 @@
9
9
  //
10
10
  // So the whole page is resolved in ONE bounded `IN (...)` lookup before anything
11
11
  // renders, and the result is threaded down as `mediaMeta`. This is the pattern
12
- // ghostfire's `Sections.astro` arrived at independently, generalized.
12
+ // a client site's `Sections.astro` arrived at independently, generalized.
13
13
  //
14
14
  // The collection step is SCHEMA-DRIVEN: it walks the catalog looking for fields
15
15
  // of `type: "image"` rather than hardcoding field names. That's what keeps it