@youversion/platform-core 1.21.0 → 1.22.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @youversion/platform-core@1.21.0 build /home/runner/work/platform-sdk-react/platform-sdk-react/packages/core
2
+ > @youversion/platform-core@1.22.0 build /home/runner/work/platform-sdk-react/platform-sdk-react/packages/core
3
3
  > tsup src/index.ts src/browser.ts src/server.ts --format cjs,esm --dts
4
4
 
5
5
  CLI Building entry: src/browser.ts, src/index.ts, src/server.ts
@@ -8,17 +8,17 @@
8
8
  CLI Target: es2022
9
9
  CJS Build start
10
10
  ESM Build start
11
- ESM dist/browser.js 135.00 B
12
- ESM dist/server.js 443.00 B
13
11
  ESM dist/index.js 53.56 KB
14
12
  ESM dist/chunk-2Z2S2WY3.js 7.74 KB
15
- ESM ⚡️ Build success in 65ms
13
+ ESM dist/server.js 443.00 B
14
+ ESM dist/browser.js 135.00 B
15
+ ESM ⚡️ Build success in 58ms
16
16
  CJS dist/browser.cjs 8.75 KB
17
17
  CJS dist/index.cjs 64.03 KB
18
18
  CJS dist/server.cjs 8.76 KB
19
- CJS ⚡️ Build success in 66ms
19
+ CJS ⚡️ Build success in 58ms
20
20
  DTS Build start
21
- DTS ⚡️ Build success in 3000ms
21
+ DTS ⚡️ Build success in 2493ms
22
22
  DTS dist/server.d.cts 863.00 B
23
23
  DTS dist/index.d.cts 33.68 KB
24
24
  DTS dist/browser.d.cts 93.00 B
package/AGENTS.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @youversion/platform-core
2
2
 
3
3
  ## OVERVIEW
4
- Foundation package providing pure TypeScript API clients for YouVersion services with zero React dependencies.
4
+ Foundation package providing pure TypeScript API clients for YouVersion services with zero React dependencies. Also provides framework-agnostic browser CSS (design tokens, preflight reset, Bible reader typography) so any web platform can render Bible content with proper styling.
5
5
 
6
6
  **Related packages:**
7
7
  - For React hooks wrapping these clients → see `packages/hooks/AGENTS.md`
@@ -10,6 +10,11 @@ Foundation package providing pure TypeScript API clients for YouVersion services
10
10
  ## STRUCTURE
11
11
  ```
12
12
  schemas/ # Zod schemas for all data types (schema-first design)
13
+ styles/ # Browser CSS (exported via ./browser/styles/*)
14
+ fonts.css # Google Fonts import (Inter, Source Serif 4)
15
+ theme.css # --yv-* design tokens on :root, dark mode, scoped preflight
16
+ bible-reader.css # USFM/Bible typography for [data-slot='yv-bible-renderer']
17
+ index.css # Barrel: imports fonts + theme + bible-reader
13
18
  client.ts # ApiClient - main HTTP client
14
19
  bible.ts # BibleClient - Bible data operations
15
20
  languages.ts # LanguagesClient - language data
@@ -25,6 +30,8 @@ index.ts # Main entry point (runtime-agnostic)
25
30
  ```
26
31
 
27
32
  ## PUBLIC API
33
+
34
+ ### TypeScript (`@youversion/platform-core`)
28
35
  - `ApiClient`: Main HTTP client with auth handling
29
36
  - `BibleClient`: Fetch Bibles, chapters, verses, versions
30
37
  - `LanguagesClient`: Get available languages
@@ -34,18 +41,20 @@ index.ts # Main entry point (runtime-agnostic)
34
41
  - `transformBibleHtml`: Runtime-agnostic Bible HTML transformer (requires DOM adapters)
35
42
  - `TransformBibleHtmlOptions`: Options for DOM parsing and serialization
36
43
 
44
+ ### Browser CSS (`@youversion/platform-core/browser/styles/*`)
45
+ - `index.css`: All-in-one import (fonts + theme + bible-reader)
46
+ - `theme.css`: `--yv-*` design tokens on `:root` + dark mode (`[data-yv-theme='dark']`) + scoped preflight
47
+ - `bible-reader.css`: USFM typography for `[data-slot='yv-bible-renderer']` or `[data-yv-sdk-bible-reader]`
48
+ - `fonts.css`: Google Fonts import (Inter, Source Serif 4)
49
+
37
50
  ## DOs / DON'Ts
38
51
 
39
- ✅ Do: Keep this package **framework-agnostic** (no React, no environment-specific dependencies in main export)
40
- ✅ Do: Provide pure, runtime-agnostic functions as the main export
41
- ✅ Do: Use environment-specific entry points (`/browser`, `/server`) for convenience wrappers
52
+ ✅ Do: Keep this package **framework-agnostic**, but if you must target server or browser, those files must export from `/server` or `/browser`
42
53
  ✅ Do: Define all input/output types in `schemas/` using Zod; schemas are the single source of truth
43
54
  ✅ Do: Reuse `YouVersionAPI` base client for new service clients
44
55
  ✅ Do: Parse API responses with Zod schemas for validation
45
56
 
46
- ❌ Don't: Import React or React-specific APIs
47
- ❌ Don't: Bundle linkedom in browser builds (use `/server` entry point for server-side code)
48
- ❌ Don't: Include environment-specific code in the default entry point
57
+ ❌ Don't: Import React, `window`, `document`, or browser storage APIs, but if you must target the browser, those files must export from `/browser`
49
58
  ❌ Don't: Bypass Zod validation for API responses
50
59
  ❌ Don't: Implement UI, hooks, or React state here
51
60
 
@@ -112,6 +121,8 @@ This architecture keeps the main export truly runtime-agnostic while providing e
112
121
  - Storage: Abstract via StorageStrategy interface
113
122
  - Auth: PKCE flow with pluggable storage backends
114
123
  - Error handling: Zod validation for all API responses
124
+ - Browser CSS: Plain CSS only (no Tailwind, no preprocessors), served from `src/styles/` without a build step
125
+ - Two export namespaces: `"."` for TS (framework-agnostic), `"./browser"` for browser environments, and `"./server` for server environments
115
126
 
116
127
  ## TESTING
117
128
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @youversion/platform-core
2
2
 
3
+ ## 1.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ff14f28: We've moved our theme, fonts, and Bible CSS from the React package into our core JS package to make it more framework agnostic so that consumers using any web framework can include our CSS without the React peer dependency.
8
+
3
9
  ## 1.21.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youversion/platform-core",
3
- "version": "1.21.0",
3
+ "version": "1.22.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -25,6 +25,7 @@
25
25
  "import": "./dist/browser.js",
26
26
  "require": "./dist/browser.cjs"
27
27
  },
28
+ "./browser/styles/*": "./src/styles/*",
28
29
  "./server": {
29
30
  "types": "./dist/server.d.ts",
30
31
  "import": "./dist/server.js",