@volter/twin-googlefonts 1.0.1 → 1.0.3
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.
- package/api/spec/sources.json +11 -1
- package/api/src/semantics/doors.ts +10 -5
- package/api/src/semantics/index.ts +1 -1
- package/assets/src/semantics/index.ts +1 -1
- package/css/spec/SOURCE.md +10 -2
- package/css/src/semantics/css.ts +5 -3
- package/css/src/semantics/css2.ts +9 -8
- package/css/src/semantics/index.ts +1 -1
- package/dist/api/spec/sources.json +11 -1
- package/dist/api/src/semantics/doors.js +10 -5
- package/dist/css/spec/SOURCE.md +10 -2
- package/dist/css/src/semantics/css.js +5 -3
- package/dist/css/src/semantics/css2.js +9 -8
- package/dist/generated/pack-facts.json +68 -0
- package/dist/journeys/customer-life.json +81 -0
- package/dist/journeys/decisions.json +15 -5
- package/dist/journeys/demand.json +56 -0
- package/dist/src/cli.js +11 -10
- package/dist/src/manifest.js +5 -3
- package/dist/src/semantics/seed.js +135 -0
- package/dist/src/semantics/shared.d.ts +1 -0
- package/dist/src/semantics/shared.js +50 -2
- package/generated/pack-facts.json +5 -2
- package/journeys/customer-life.json +81 -0
- package/journeys/decisions.json +15 -5
- package/journeys/demand.json +56 -0
- package/package.json +30 -14
- package/src/cli.ts +10 -10
- package/src/manifest.ts +5 -3
- package/src/semantics/seed.ts +135 -0
- package/src/semantics/shared.ts +55 -2
- package/{dist/vendor/OFL.txt → vendor/DMMono-OFL.txt} +93 -94
- package/vendor/SOURCE.md +28 -0
- package/vendor/browser-classes.json +529 -0
- package/vendor/inter-dm-mono-chromium.json +108 -0
- package/vendor/inter-variable.json +52 -0
- package/dist/api/src/fetch.ts +0 -16
- package/dist/api/src/index.ts +0 -3
- package/dist/api/src/manifest.ts +0 -31
- package/dist/api/src/semantics/doors.ts +0 -131
- package/dist/api/src/semantics/index.ts +0 -8
- package/dist/api/src/semantics/shared.ts +0 -1
- package/dist/api/src/semantics/states.ts +0 -6
- package/dist/api/src/semantics/webfonts.ts +0 -32
- package/dist/assets/src/fetch.ts +0 -14
- package/dist/assets/src/index.ts +0 -3
- package/dist/assets/src/manifest.ts +0 -19
- package/dist/assets/src/semantics/index.ts +0 -10
- package/dist/assets/src/semantics/l.ts +0 -4
- package/dist/assets/src/semantics/s.ts +0 -4
- package/dist/assets/src/semantics/shared.ts +0 -13
- package/dist/css/src/fetch.ts +0 -14
- package/dist/css/src/index.ts +0 -3
- package/dist/css/src/manifest.ts +0 -19
- package/dist/css/src/semantics/css.ts +0 -19
- package/dist/css/src/semantics/css2.ts +0 -20
- package/dist/css/src/semantics/index.ts +0 -10
- package/dist/css/src/semantics/shared.ts +0 -1
- package/dist/journeys/customer-life.outline.md +0 -24
- package/dist/journeys/customer-life.outline.verdict.json +0 -82
- package/dist/journeys/customer-life.verdict.json +0 -149
- package/dist/vendor/Inter-OFL.txt +0 -93
- package/dist/vendor/SOURCE.md +0 -33
- package/dist/vendor/antic.json +0 -93
- package/dist/vendor/inputs.json +0 -460
- package/dist/vendor/inter.json +0 -44
- package/dist/vendor/noto-sans-sc-text.json +0 -24
- package/journeys/customer-life.outline.md +0 -24
- package/journeys/customer-life.outline.verdict.json +0 -82
- package/journeys/customer-life.verdict.json +0 -149
|
@@ -13,20 +13,20 @@
|
|
|
13
13
|
"lane": "css",
|
|
14
14
|
"mechanism": "handler",
|
|
15
15
|
"demand": "All five pinned config.ts UAs",
|
|
16
|
-
"why": "Use exact published CSS per request/
|
|
16
|
+
"why": "Use the exact published CSS per request and browser class (src/semantics/shared.ts browserClass; each of the five pinned config.ts UAs is one class's sample), with the real font-family/style/weight/src consumed by fetchCSS; first-use downloads every returned src. A class with no published representation answers a refusal."
|
|
17
17
|
},
|
|
18
18
|
{
|
|
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",
|
|
23
|
-
"why": "Use the exact published CSS per ordered CSS2 query and
|
|
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; Twenty's front end's Inter and DM Mono stylesheets, from a Chromium browser",
|
|
23
|
+
"why": "Use the exact published CSS per ordered CSS2 query and browser class (src/semantics/shared.ts browserClass, the classes of Google's answers in vendor/browser-classes.json): Google serves any browser, choosing WOFF 2.0 and unicode-range by the browser, and a non-browser agent is the truetype class, as Google answered the same CSS to none, node and undici. A class without a published representation, and unpublished families and text subsets, 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
|
|
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,62 @@
|
|
|
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
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"name": "twentyhq/twenty",
|
|
101
|
+
"commit": "323e66433ee5b0878f43bc6c54abe4b1ac9be64b",
|
|
102
|
+
"client": "the front end in a browser (Playwright 1.63's Chromium 153 headless shell in the bench task twenty-20877), its own User-Agent",
|
|
103
|
+
"backend": [
|
|
104
|
+
{
|
|
105
|
+
"call": "GET fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap",
|
|
106
|
+
"operation": "getStylesheet2",
|
|
107
|
+
"evidence": "packages/twenty-front/index.html:33 (a stylesheet link, until 3aeb2b0d self-hosts the fonts)"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"call": "GET fonts.googleapis.com/css2?family=DM+Mono:wght@400;500;600&display=swap",
|
|
111
|
+
"operation": "getStylesheet2",
|
|
112
|
+
"evidence": "packages/twenty-front/index.html:37"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"call": "GET fonts.gstatic.com/s/{inter,dmmono}/... woff2, the faces the page's text needs",
|
|
116
|
+
"operation": "getFontFile",
|
|
117
|
+
"evidence": "the browser loads each unicode-range face its text uses"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
64
120
|
}
|
|
65
121
|
],
|
|
66
122
|
"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 {
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
4
4
|
import { keepProcessAlive } from '@volter/world-core/lifecycle';
|
|
5
5
|
import { createGooglefontsTwinServer } from "./server.js";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
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 =
|
|
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 } : {})
|
|
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]
|
|
21
|
+
process.stdout.write('Usage: world-googlefonts serve [--port N] [--root DIR] [--read-only] [--database URL]\n');
|
|
21
22
|
}
|
package/dist/src/manifest.js
CHANGED
|
@@ -11,15 +11,17 @@ export const manifest = {
|
|
|
11
11
|
protocol: '3', transport: 'rest', archetype: 'crud', bin: 'world-googlefonts',
|
|
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
|
-
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
|
|
15
|
-
|
|
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, the CSS2 weights 500-700 of Inter, the variable weights of Inter and the Inter and DM Mono stylesheets Twenty links, not the complete live Google catalog.',
|
|
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
|
};
|