@volter/twin-googlefonts 1.0.1 → 1.0.2

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 (58) hide show
  1. package/api/spec/sources.json +11 -1
  2. package/api/src/semantics/doors.ts +4 -0
  3. package/css/spec/SOURCE.md +3 -1
  4. package/dist/api/spec/sources.json +11 -1
  5. package/dist/api/src/semantics/doors.js +4 -0
  6. package/dist/css/spec/SOURCE.md +3 -1
  7. package/dist/generated/pack-facts.json +68 -0
  8. package/dist/journeys/customer-life.json +81 -0
  9. package/dist/journeys/decisions.json +13 -3
  10. package/dist/journeys/demand.json +34 -0
  11. package/dist/src/cli.js +11 -10
  12. package/dist/src/manifest.js +4 -2
  13. package/dist/src/semantics/seed.js +40 -0
  14. package/generated/pack-facts.json +5 -2
  15. package/journeys/customer-life.json +81 -0
  16. package/journeys/decisions.json +13 -3
  17. package/journeys/demand.json +34 -0
  18. package/package.json +30 -14
  19. package/src/cli.ts +10 -10
  20. package/src/manifest.ts +4 -2
  21. package/src/semantics/seed.ts +40 -0
  22. package/vendor/SOURCE.md +7 -0
  23. package/vendor/inter-variable.json +52 -0
  24. package/dist/api/src/fetch.ts +0 -16
  25. package/dist/api/src/index.ts +0 -3
  26. package/dist/api/src/manifest.ts +0 -31
  27. package/dist/api/src/semantics/doors.ts +0 -131
  28. package/dist/api/src/semantics/index.ts +0 -8
  29. package/dist/api/src/semantics/shared.ts +0 -1
  30. package/dist/api/src/semantics/states.ts +0 -6
  31. package/dist/api/src/semantics/webfonts.ts +0 -32
  32. package/dist/assets/src/fetch.ts +0 -14
  33. package/dist/assets/src/index.ts +0 -3
  34. package/dist/assets/src/manifest.ts +0 -19
  35. package/dist/assets/src/semantics/index.ts +0 -10
  36. package/dist/assets/src/semantics/l.ts +0 -4
  37. package/dist/assets/src/semantics/s.ts +0 -4
  38. package/dist/assets/src/semantics/shared.ts +0 -13
  39. package/dist/css/src/fetch.ts +0 -14
  40. package/dist/css/src/index.ts +0 -3
  41. package/dist/css/src/manifest.ts +0 -19
  42. package/dist/css/src/semantics/css.ts +0 -19
  43. package/dist/css/src/semantics/css2.ts +0 -20
  44. package/dist/css/src/semantics/index.ts +0 -10
  45. package/dist/css/src/semantics/shared.ts +0 -1
  46. package/dist/journeys/customer-life.outline.md +0 -24
  47. package/dist/journeys/customer-life.outline.verdict.json +0 -82
  48. package/dist/journeys/customer-life.verdict.json +0 -149
  49. package/dist/vendor/Inter-OFL.txt +0 -93
  50. package/dist/vendor/OFL.txt +0 -94
  51. package/dist/vendor/SOURCE.md +0 -33
  52. package/dist/vendor/antic.json +0 -93
  53. package/dist/vendor/inputs.json +0 -460
  54. package/dist/vendor/inter.json +0 -44
  55. package/dist/vendor/noto-sans-sc-text.json +0 -24
  56. package/journeys/customer-life.outline.md +0 -24
  57. package/journeys/customer-life.outline.verdict.json +0 -82
  58. package/journeys/customer-life.verdict.json +0 -149
@@ -19,14 +19,14 @@
19
19
  "operation": "getStylesheet2",
20
20
  "lane": "css",
21
21
  "mechanism": "handler",
22
- "demand": "Dub's Inter weights and Rallly's CJK text subsets, both from a server",
22
+ "demand": "Dub's Inter weights and Rallly's CJK text subsets, both from a server; Rallly's and Cal.diy's next/font/google build of Inter's variable weights, with next/font's browser User-Agent",
23
23
  "why": "Use the exact published CSS per ordered CSS2 query and User-Agent; a non-browser agent without its own representation reads the one published for no agent, as Google answered the same CSS to none, node and undici. Unpublished families, text subsets and browser representations answer a refusal; text= and display= given twice, or another parameter, are a bad request."
24
24
  },
25
25
  {
26
26
  "operation": "getFontFile",
27
27
  "lane": "assets",
28
28
  "mechanism": "handler",
29
- "demand": "Archive stream for returned /s URL",
29
+ "demand": "Archive stream for returned /s URL; the woff2 faces next/font/google self-hosts at build",
30
30
  "why": "Resolve the actual vendor URL to its resource blob and preserve Content-Type/bytes; no conversion or placeholder font."
31
31
  },
32
32
  {
@@ -41,7 +41,17 @@
41
41
  "lane": "api",
42
42
  "mechanism": "door",
43
43
  "demand": "World boot credential fill",
44
- "why": "Google key issuance is outside the Fonts read-only API. ctx.secret supplies the opaque per-World key; only its hash is recorded. Repeated boot retains that key."
44
+ "why": "Google issues the key outside the Fonts read-only API: a standard API key belongs to a Google Cloud project, made on that project's Credentials page, and associates each request with the project for billing and quota; the Developer API takes it as key= and nothing else. The door keeps a project per World organization (ctx.tenant) and one key per deployment under it (ctx.accountKey), drawn from the World's seed so a World returned to its seed issues the same key; only its hash is recorded.",
45
+ "sourceRules": [
46
+ {
47
+ "source": "https://developers.google.com/fonts/docs/developer_api",
48
+ "means": "the Developer API identifies the application by an API key, key= on every request, made on the Cloud console's Credentials page"
49
+ },
50
+ {
51
+ "source": "https://docs.cloud.google.com/docs/authentication/api-keys",
52
+ "means": "a standard API key associates a request with a project for billing and quota; keys are listed and created per project (console, gcloud services api-keys, keys.create)"
53
+ }
54
+ ]
45
55
  },
46
56
  {
47
57
  "operation": "door:publishCatalog",
@@ -61,6 +61,40 @@
61
61
  "evidence": "apps/landing/src/app/[locale]/opengraph-image.tsx:38"
62
62
  }
63
63
  ]
64
+ },
65
+ {
66
+ "name": "lukevella/rallly",
67
+ "commit": "195877a38de4fb96bce921011668871da1121174",
68
+ "client": "next build (Next.js 16.1.6, Turbopack's next/font: crates/next-core/src/next_font/google, User-Agent USER_AGENT_FOR_GOOGLE_FONTS)",
69
+ "backend": [
70
+ {
71
+ "call": "GET fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap",
72
+ "operation": "getStylesheet2",
73
+ "evidence": "apps/web/src/app/[locale]/layout.tsx:8,31-34 (Inter, subsets latin, display swap); also at 65fb551012078fc3058d8a23b3fa4be1846fd056 (layout.tsx:8,28-31)"
74
+ },
75
+ {
76
+ "call": "GET fonts.gstatic.com/s/inter/v20/... woff2, each URL returned in the CSS",
77
+ "operation": "getFontFile",
78
+ "evidence": "the same build"
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ "name": "calcom/cal.diy",
84
+ "commit": "5918e66cc56b3a36c1e7205c7fc00eaad50dece8",
85
+ "client": "next build (Next.js 15.5.8, next/font's packages/font/src/google/fetch-resource.ts, the same User-Agent)",
86
+ "backend": [
87
+ {
88
+ "call": "GET fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap",
89
+ "operation": "getStylesheet2",
90
+ "evidence": "apps/web/app/layout.tsx:2,18; apps/web/components/PageWrapper.tsx:13,36"
91
+ },
92
+ {
93
+ "call": "GET fonts.gstatic.com/s/inter/v20/... woff2, each URL returned in the CSS",
94
+ "operation": "getFontFile",
95
+ "evidence": "the same build"
96
+ }
97
+ ]
64
98
  }
65
99
  ],
66
100
  "notDemanded": "OAuth, font submission/publishing UI, effects and advanced catalog capabilities are outside these client paths."
package/dist/src/cli.js CHANGED
@@ -1,21 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  // world-googlefonts: serve the googlefonts twin.
3
- import { hasFlag, optionValue } from '@volter/world-core/args';
3
+ import { parseArgs } from 'node:util';
4
4
  import { keepProcessAlive } from '@volter/world-core/lifecycle';
5
5
  import { createGooglefontsTwinServer } from "./server.js";
6
- const [cmd, ...rest] = process.argv.slice(2);
7
- const port = Number(optionValue(rest, '--port', '0')) || undefined;
8
- const root = optionValue(rest, '--root') || undefined;
9
- const readOnly = hasFlag(rest, '--read-only');
6
+ const { values, positionals } = parseArgs({ options: { port: { type: 'string' }, root: { type: 'string' }, 'read-only': { type: 'boolean' }, database: { type: 'string' } }, allowPositionals: true, strict: true });
7
+ if (positionals.length > 1)
8
+ throw new Error('Expected one command');
9
+ const [cmd] = positionals;
10
+ const port = Number(values.port ?? '0') || undefined;
11
+ const root = values.root;
12
+ const readOnly = Boolean(values['read-only']);
10
13
  // the selected twin's private Postgres, which the runtime binds a pack declaring managedDatabase to
11
- const database = optionValue(rest, '--database') || undefined;
12
- // the World's scenario file, for a model vendor's turns
13
- const scenarioPath = optionValue(rest, '--scenario') || undefined;
14
+ const database = values.database;
14
15
  if (cmd === 'serve' || cmd === undefined) {
15
- const s = await createGooglefontsTwinServer({ readOnly, ...(root ? { root } : {}), ...(port ? { port } : {}), ...(database ? { database } : {}), ...(scenarioPath ? { scenarioPath } : {}) });
16
+ const s = await createGooglefontsTwinServer({ readOnly, ...(root ? { root } : {}), ...(port ? { port } : {}), ...(database ? { database } : {}) });
16
17
  process.stdout.write(`googlefonts twin${readOnly ? ' [read-only]' : ''} at http://127.0.0.1:${s.port}\n`);
17
18
  await keepProcessAlive();
18
19
  }
19
20
  else {
20
- process.stdout.write('Usage: world-googlefonts serve [--port N] [--root DIR] [--read-only] [--database URL] [--scenario FILE]\n');
21
+ process.stdout.write('Usage: world-googlefonts serve [--port N] [--root DIR] [--read-only] [--database URL]\n');
21
22
  }
@@ -12,14 +12,16 @@ export const manifest = {
12
12
  resources: ['webfont', '_api_key', '_font_catalog', '_stylesheet', '_font_file'],
13
13
  specSource: 'api/spec/SOURCE.md: unchanged Google Discovery; css/spec/SOURCE.md and assets/spec/SOURCE.md: Google documentation and retained font responses',
14
14
  description: 'Google Fonts catalog, exact published CSS representations and genuine font bytes; a World-issued query API key. Seed data is the attributed Antic reference catalog and the CSS2 weights 500-700 of Inter, not the complete live Google catalog.',
15
- adoption: { sdks: [], envStems: ['GOOGLE_FONTS'] },
15
+ // next/font/google fetches the font's stylesheet and files from Google at an app's build (twin-world architecture,
16
+ // Selection: a module that reaches the vendor by itself is evidence, as an SDK is)
17
+ adoption: { sdks: [], envStems: ['GOOGLE_FONTS'], modules: ['next/font/google'] },
16
18
  hosts: [
17
19
  { host: 'www.googleapis.com', pathPattern: '^/webfonts/v1/webfonts$' },
18
20
  { host: 'webfonts.googleapis.com', pathPattern: '^/v1/webfonts$' },
19
21
  { host: 'fonts.googleapis.com', pathPattern: '^/css2?$' },
20
22
  { host: 'fonts.gstatic.com', pathPattern: '^/(s/|l/font$)' },
21
23
  ],
22
- credentialDoor: { path: '/_twin/app-credentials', body: {}, account: { field: 'account', tenancy: 'Google Cloud project', source: 'https://developers.google.com/fonts/docs/developer_api' }, deployment: { field: 'deployment', object: 'Project API key', source: 'https://cloud.google.com/docs/authentication/api-keys' }, fill: { GOOGLE_FONTS_API_KEY: 'api_key' } },
24
+ credentialDoor: { path: '/_twin/app-credentials', body: {}, account: { field: 'account', tenancy: 'Google Cloud project', source: 'https://developers.google.com/fonts/docs/developer_api' }, deployment: { field: 'deployment', object: 'Project API key', source: 'https://docs.cloud.google.com/docs/authentication/api-keys' }, fill: { GOOGLE_FONTS_API_KEY: 'api_key' } },
23
25
  endpointEnvNone: 'Pinned helper hardcodes the vendor API and CSS hosts, then downloads their returned gstatic URLs. Scoped host routing preserves these URLs.',
24
26
  },
25
27
  };