@cratis/cast 0.1.0 → 0.2.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 (56) hide show
  1. package/README.md +3 -1
  2. package/badges/RegistryMember.ts +2 -0
  3. package/badges/registry.ts +5 -0
  4. package/cast-json.schema.json +1496 -0
  5. package/config/calendar.ts +34 -0
  6. package/config/castSchema.ts +3 -2
  7. package/github/gitHubSnapshotSchema.ts +58 -0
  8. package/machine/castJson.ts +17 -4
  9. package/machine/castJsonSchema.ts +35 -0
  10. package/machine/index.ts +6 -0
  11. package/machine/profileFromCastJson.ts +214 -0
  12. package/package.json +5 -1
  13. package/routes/404.astro +6 -4
  14. package/routes/cast.json.ts +7 -1
  15. package/routes/cv.astro +3 -365
  16. package/routes/index.astro +3 -55
  17. package/site/components/Activity.astro +8 -6
  18. package/site/components/Agentic.astro +11 -10
  19. package/site/components/CareerReplay.astro +11 -8
  20. package/site/components/CommandPalette.astro +10 -4
  21. package/site/components/Contact.astro +8 -5
  22. package/site/components/Cratis.astro +17 -15
  23. package/site/components/EventModel.astro +8 -5
  24. package/site/components/Footer.astro +9 -4
  25. package/site/components/Hero.astro +13 -10
  26. package/site/components/Inline.astro +45 -0
  27. package/site/components/Monogram.astro +4 -1
  28. package/site/components/Nav.astro +12 -9
  29. package/site/components/Now.astro +13 -10
  30. package/site/components/Projects.astro +11 -14
  31. package/site/components/PullRequestFeed.astro +6 -4
  32. package/site/components/SectionHeader.astro +6 -3
  33. package/site/components/Skills.astro +5 -2
  34. package/site/components/Stats.astro +7 -2
  35. package/site/components/Talks.astro +8 -5
  36. package/site/components/Terminal.astro +7 -2
  37. package/site/components/Writing.astro +9 -7
  38. package/site/data.ts +6 -43
  39. package/site/layouts/Base.astro +31 -19
  40. package/site/lib/blog.ts +42 -16
  41. package/site/lib/github.ts +48 -31
  42. package/site/lib/inline.ts +65 -9
  43. package/site/lib/nav.ts +14 -3
  44. package/site/pages/CvPage.astro +379 -0
  45. package/site/pages/ProfilePage.astro +78 -0
  46. package/site/profile/CastHost.ts +32 -0
  47. package/site/profile/CastView.ts +96 -0
  48. package/site/profile/assertRenderable.ts +151 -0
  49. package/site/profile/clientCast.ts +117 -0
  50. package/site/profile/index.ts +8 -0
  51. package/site/scripts/live.ts +21 -11
  52. package/site/scripts/palette.ts +30 -13
  53. package/site/scripts/replay.ts +2 -1
  54. package/site/scripts/terminal.ts +28 -25
  55. package/writing/fetchWriting.ts +17 -2
  56. package/writing/writingSnapshotSchema.ts +27 -0
package/README.md CHANGED
@@ -10,4 +10,6 @@ import { defineConfig } from 'astro/config';
10
10
  export default defineConfig({ integrations: [cast()] });
11
11
  ```
12
12
 
13
- The quickest start is `npm create @cratis/cast@latest`. Documentation: [getting started](https://github.com/Cratis/Cast/blob/main/Documentation/getting-started.md), [cast.yaml reference](https://github.com/Cratis/Cast/blob/main/Documentation/cast-yaml.md), [badges and the registry](https://github.com/Cratis/Cast/blob/main/Documentation/badges-and-registry.md).
13
+ The quickest start is `npm create @cratis/cast@latest`. Documentation: [getting started](https://github.com/Cratis/Cast/blob/main/Documentation/getting-started.md), [cast.yaml reference](https://github.com/Cratis/Cast/blob/main/Documentation/cast-yaml.md), [cast.json reference](https://github.com/Cratis/Cast/blob/main/Documentation/cast-json.md), [badges and the registry](https://github.com/Cratis/Cast/blob/main/Documentation/badges-and-registry.md).
14
+
15
+ Besides the integration, the package exports what other Astro projects need to render a Cast profile: `@cratis/cast/profile` (`castView`, the hosts, the browser data), `@cratis/cast/machine` (`castJson`, `profileFromCastJson`, the cast.json schema) and the page components `@cratis/cast/site/pages/ProfilePage.astro` and `CvPage.astro`. The JSON Schemas are `@cratis/cast/cast.schema.json` (cast.yaml) and `@cratis/cast/cast-json.schema.json` (cast.json, version 2).
@@ -10,6 +10,8 @@ export type RegistryMember = {
10
10
  since?: string;
11
11
  role?: string;
12
12
  site?: string;
13
+ /** URL of the member's /cast.json, for sites that publish it elsewhere. Defaults to `<site>/cast.json`. */
14
+ profile?: string;
13
15
  company?: string;
14
16
  /** 1-based line in members.yaml where this entry starts, for "verified from" links. */
15
17
  line?: number;
@@ -12,6 +12,7 @@ export const registryMemberSchema = z.object({
12
12
  since: z.string().regex(/^\d{4}-\d{2}$/, 'Use YYYY-MM').optional(),
13
13
  role: z.string().min(1).optional(),
14
14
  site: z.url({ protocol: /^https$/ }).optional(),
15
+ profile: z.url({ protocol: /^https$/ }).optional(),
15
16
  company: z.string().min(1).optional(),
16
17
  }).strict();
17
18
 
@@ -58,6 +59,10 @@ function entryLines(document: ReturnType<typeof parseDocument>, yamlText: string
58
59
  });
59
60
  }
60
61
 
62
+ /** Where the directory reads a member's profile: `profile`, else `<site>/cast.json`, else nowhere. */
63
+ export const profileUrlOf = (member: Pick<RegistryMember, 'site' | 'profile'>): string | undefined =>
64
+ member.profile ?? (member.site ? new URL('/cast.json', member.site).toString() : undefined);
65
+
61
66
  /** Finds a member by GitHub login, case-insensitively. */
62
67
  export const findMember = (members: readonly RegistryMember[], handle: string): RegistryMember | undefined =>
63
68
  members.find(member => member.github.toLowerCase() === handle.toLowerCase());