@youversion/platform-core 0.4.3 → 0.4.4

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@0.4.3 build /home/runner/work/platform-sdk-react/platform-sdk-react/packages/core
2
+ > @youversion/platform-core@0.4.4 build /home/runner/work/platform-sdk-react/platform-sdk-react/packages/core
3
3
  > tsup src/index.ts --format cjs,esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es2022
9
9
  CJS Build start
10
10
  ESM Build start
11
- ESM dist/index.js 37.68 KB
12
- ESM ⚡️ Build success in 37ms
13
- CJS dist/index.cjs 39.67 KB
14
- CJS ⚡️ Build success in 37ms
11
+ CJS dist/index.cjs 39.59 KB
12
+ CJS ⚡️ Build success in 39ms
13
+ ESM dist/index.js 37.59 KB
14
+ ESM ⚡️ Build success in 41ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 2374ms
16
+ DTS ⚡️ Build success in 2375ms
17
17
  DTS dist/index.d.cts 34.08 KB
18
18
  DTS dist/index.d.ts 34.08 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @youversion/platform-core
2
2
 
3
+ ## 0.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 8dee8f6: chore: allow setting apiHost from React code
8
+
3
9
  ## 0.4.3
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -56,11 +56,9 @@ var ApiClient = class {
56
56
  this.config = {
57
57
  ...config
58
58
  };
59
- const apiHost = config.apiHost ?? process.env.YVP_API_HOST ?? "api.youversion.com";
59
+ const apiHost = config.apiHost || "api.youversion.com";
60
60
  if (!apiHost) {
61
- throw new Error(
62
- "ApiClient requires a host name. Provide an apiHost in the config or set the YVP_API_HOST environment variable."
63
- );
61
+ throw new Error("ApiClient requires a host name. Provide an apiHost in the config.");
64
62
  }
65
63
  this.baseURL = "https://" + apiHost;
66
64
  this.timeout = config.timeout || 1e4;
package/dist/index.js CHANGED
@@ -13,11 +13,9 @@ var ApiClient = class {
13
13
  this.config = {
14
14
  ...config
15
15
  };
16
- const apiHost = config.apiHost ?? process.env.YVP_API_HOST ?? "api.youversion.com";
16
+ const apiHost = config.apiHost || "api.youversion.com";
17
17
  if (!apiHost) {
18
- throw new Error(
19
- "ApiClient requires a host name. Provide an apiHost in the config or set the YVP_API_HOST environment variable."
20
- );
18
+ throw new Error("ApiClient requires a host name. Provide an apiHost in the config.");
21
19
  }
22
20
  this.baseURL = "https://" + apiHost;
23
21
  this.timeout = config.timeout || 1e4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youversion/platform-core",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -14,6 +14,7 @@ describe('AuthClient', () => {
14
14
  global.fetch = vi.fn();
15
15
  apiClient = new ApiClient({
16
16
  appKey: 'test-app-key',
17
+ apiHost: process.env.YVP_API_HOST || '',
17
18
  });
18
19
  authClient = new AuthClient(apiClient);
19
20
  });
@@ -16,6 +16,7 @@ describe('BibleClient', () => {
16
16
 
17
17
  beforeEach(() => {
18
18
  apiClient = new ApiClient({
19
+ apiHost: process.env.YVP_API_HOST || '',
19
20
  appKey: process.env.YVP_APP_KEY || '',
20
21
  installationId: 'test-installation',
21
22
  });
@@ -9,6 +9,7 @@ describe('HighlightsClient', () => {
9
9
 
10
10
  beforeEach(() => {
11
11
  apiClient = new ApiClient({
12
+ apiHost: process.env.YVP_API_HOST || '',
12
13
  appKey: 'test-app',
13
14
  installationId: 'test-installation',
14
15
  });
@@ -9,6 +9,7 @@ describe('LanguagesClient', () => {
9
9
 
10
10
  beforeEach(() => {
11
11
  apiClient = new ApiClient({
12
+ apiHost: process.env.YVP_API_HOST || '',
12
13
  appKey: process.env.YVP_APP_KEY || '',
13
14
  installationId: 'test-installation',
14
15
  });
package/src/client.ts CHANGED
@@ -23,11 +23,9 @@ export class ApiClient {
23
23
  this.config = {
24
24
  ...config,
25
25
  };
26
- const apiHost = config.apiHost ?? process.env.YVP_API_HOST ?? 'api.youversion.com';
26
+ const apiHost = config.apiHost || 'api.youversion.com';
27
27
  if (!apiHost) {
28
- throw new Error(
29
- 'ApiClient requires a host name. Provide an apiHost in the config or set the YVP_API_HOST environment variable.',
30
- );
28
+ throw new Error('ApiClient requires a host name. Provide an apiHost in the config.');
31
29
  }
32
30
  this.baseURL = 'https://' + apiHost;
33
31
  this.timeout = config.timeout || 10000;