@youversion/platform-core 1.21.0 → 1.22.1
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/.turbo/turbo-build.log +8 -8
- package/AGENTS.md +18 -7
- package/CHANGELOG.md +13 -0
- package/package.json +4 -1
- package/src/styles/bible-reader.css +1515 -0
- package/src/styles/fonts.css +5 -0
- package/src/styles/index.css +3 -0
- package/src/styles/theme.css +300 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @youversion/platform-core@1.
|
|
2
|
+
> @youversion/platform-core@1.22.1 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
|
[34mCLI[39m Building entry: src/browser.ts, src/index.ts, src/server.ts
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2022
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/browser.js [22m[32m135.00 B[39m
|
|
12
|
-
[32mESM[39m [1mdist/server.js [22m[32m443.00 B[39m
|
|
13
|
-
[32mESM[39m [1mdist/index.js [22m[32m53.56 KB[39m
|
|
14
|
-
[32mESM[39m [1mdist/chunk-2Z2S2WY3.js [22m[32m7.74 KB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in 65ms
|
|
16
11
|
[32mCJS[39m [1mdist/browser.cjs [22m[32m8.75 KB[39m
|
|
17
12
|
[32mCJS[39m [1mdist/index.cjs [22m[32m64.03 KB[39m
|
|
18
13
|
[32mCJS[39m [1mdist/server.cjs [22m[32m8.76 KB[39m
|
|
19
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 45ms
|
|
15
|
+
[32mESM[39m [1mdist/browser.js [22m[32m135.00 B[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.js [22m[32m53.56 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/server.js [22m[32m443.00 B[39m
|
|
18
|
+
[32mESM[39m [1mdist/chunk-2Z2S2WY3.js [22m[32m7.74 KB[39m
|
|
19
|
+
[32mESM[39m ⚡️ Build success in 50ms
|
|
20
20
|
[34mDTS[39m Build start
|
|
21
|
-
[32mDTS[39m ⚡️ Build success in
|
|
21
|
+
[32mDTS[39m ⚡️ Build success in 2590ms
|
|
22
22
|
[32mDTS[39m [1mdist/server.d.cts [22m[32m863.00 B[39m
|
|
23
23
|
[32mDTS[39m [1mdist/index.d.cts [22m[32m33.68 KB[39m
|
|
24
24
|
[32mDTS[39m [1mdist/browser.d.cts [22m[32m93.00 B[39m
|
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
|
|
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
|
|
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,18 @@
|
|
|
1
1
|
# @youversion/platform-core
|
|
2
2
|
|
|
3
|
+
## 1.22.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b8b5cf0: Fixed hooks package bundling to produce proper CJS and ESM outputs, resolving import failures in strict ESM runtimes like Deno.
|
|
8
|
+
- 2a64020: Updated the Bible App logo on the BibleCard and VerseOfTheDay React components to the latest designs.
|
|
9
|
+
|
|
10
|
+
## 1.22.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 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.
|
|
15
|
+
|
|
3
16
|
## 1.21.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youversion/platform-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.1",
|
|
4
|
+
"description": "A type-safe TypeScript SDK for accessing the YouVersion Platform APIs. Get Bible content and build Bible-based applications.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
4
6
|
"type": "module",
|
|
5
7
|
"publishConfig": {
|
|
6
8
|
"access": "public",
|
|
@@ -25,6 +27,7 @@
|
|
|
25
27
|
"import": "./dist/browser.js",
|
|
26
28
|
"require": "./dist/browser.cjs"
|
|
27
29
|
},
|
|
30
|
+
"./browser/styles/*": "./src/styles/*",
|
|
28
31
|
"./server": {
|
|
29
32
|
"types": "./dist/server.d.ts",
|
|
30
33
|
"import": "./dist/server.js",
|