@digia-engage/core 2.3.0 → 2.3.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.
@@ -8,7 +8,7 @@ Pod::Spec.new do |s|
8
8
  (Jetpack Compose) using the New Architecture (TurboModules / Fabric).
9
9
  DESC
10
10
 
11
- s.license = { :type => 'MIT', :file => '../LICENSE' }
11
+ s.license = { :type => 'BUSL-1.1', :file => 'LICENSE' }
12
12
 
13
13
  s.authors = { 'Digia Technology Private Limited' => 'https://digia.tech' }
14
14
  s.homepage = 'https://github.com/Digia-Technology-Private-Limited/digia_engage'
package/LICENSE ADDED
@@ -0,0 +1,77 @@
1
+ License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
2
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
3
+
4
+ Parameters
5
+
6
+ Licensor: Tinkerbox Technology Private Limited
7
+ Licensed Work: Digia Engage Core SDK (React Native, including its Android
8
+ and iOS bridges) and any associated components and libraries
9
+ (c) 2025 Tinkerbox Technology Private Limited
10
+ Additional Use Grant: You may make personal, commercial, and production use of the
11
+ Licensed Work, provided Your use does not include offering the
12
+ Licensed Work, or any derivative work thereof, as part of a
13
+ competing low-code, no-code, or SDK-based platform or service.
14
+
15
+ For the purposes of this license:
16
+
17
+ A "competing platform" is any service, SDK, or developer tool
18
+ that allows users to visually or programmatically build mobile
19
+ applications or user interfaces and whose primary purpose
20
+ significantly overlaps with Digia's paid platform offerings.
21
+
22
+ A "Product" means any application, service, or tool that embeds,
23
+ integrates, or builds upon the Licensed Work.
24
+
25
+ "Embedded" means including the source code or executable code
26
+ from the Licensed Work in a competing platform or Product, or
27
+ requiring the Licensed Work to function as part of a competitive
28
+ offering.
29
+
30
+ Hosting, using, or embedding the Licensed Work in commercial or
31
+ internal-use software that does not compete with Digia's core
32
+ offerings is permitted.
33
+
34
+ Change Date: August 5, 2029
35
+ Change License: Apache License, Version 2.0
36
+
37
+ For inquiries about commercial licensing or exceptions, contact:
38
+ admin@digia.tech
39
+
40
+ Notice
41
+
42
+ Business Source License 1.1
43
+
44
+ Terms
45
+
46
+ The Licensor hereby grants you the right to copy, modify, create derivative
47
+ works, redistribute, and make personal or commercial use of the Licensed Work,
48
+ including in production, subject to the Additional Use Grant above.
49
+
50
+ Effective on the Change Date stated above, the Licensed Work will automatically
51
+ be released under the Change License. On that date, all rights granted under this
52
+ License terminate, and the Licensed Work becomes governed by the Change License.
53
+
54
+ If your use of the Licensed Work does not comply with the Additional Use Grant,
55
+ you must purchase a commercial license from the Licensor or refrain from using
56
+ the Licensed Work.
57
+
58
+ All copies of the original and modified Licensed Work, and derivative works of
59
+ the Licensed Work, are subject to this License. This License applies separately
60
+ for each version of the Licensed Work, and the Change Date may vary by version.
61
+
62
+ You must conspicuously display this License on each original or modified copy
63
+ of the Licensed Work. If you receive the Licensed Work from a third party,
64
+ this License still applies.
65
+
66
+ Any use of the Licensed Work in violation of this License will automatically
67
+ terminate your rights under this License for the current and all other versions.
68
+
69
+ This License does not grant you any right in any trademark or logo of Tinkerbox
70
+ Technology Private Limited or its affiliates (provided that you may use a
71
+ trademark or logo of the Licensor as expressly required by this License).
72
+
73
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
74
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
75
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
76
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
77
+ TITLE.
package/README.md CHANGED
@@ -266,6 +266,76 @@ react-native/ios/ iOS bridge
266
266
 
267
267
  ---
268
268
 
269
+ ## Build & publishing (hybrid model)
270
+
271
+ This package is published using the **hybrid** React Native library layout (the
272
+ [`react-native-builder-bob`](https://github.com/callstack/react-native-builder-bob)
273
+ convention): the npm tarball ships **both** the compiled output (`lib/`) **and**
274
+ the original TypeScript source (`src/`).
275
+
276
+ ### What the entry fields mean
277
+
278
+ | `package.json` field | Points to | Used by |
279
+ |---|---|---|
280
+ | `main` | `lib/commonjs/index` | Node / CommonJS consumers, Jest |
281
+ | `module` | `lib/module/index` | Bundlers that understand ESM |
282
+ | `types` | `lib/typescript/index.d.ts` | TypeScript |
283
+ | `react-native` / `source` | `src/index` | **Metro** — RN apps bundle straight from source |
284
+
285
+ Because Metro resolves the `react-native`/`source` field, a React Native app that
286
+ consumes this package bundles the **actual `.ts` source**. That gives our users
287
+ the best developer experience:
288
+
289
+ - **Stack traces** point at real `src/*.ts` lines, not transpiled output.
290
+ - **Step-debugging** walks through the real source.
291
+ - **Go-to-definition** lands on the real source — we ship `.d.ts` **and**
292
+ `.d.ts.map` (declaration maps) alongside `src/`, so an IDE jumps from the type
293
+ definition through to the `.ts` it came from.
294
+
295
+ The compiled `lib/` is a robust fallback for any tool that does *not* honour the
296
+ `react-native` field (Node, Jest, web bundlers, type resolvers), so the package
297
+ never breaks outside Metro.
298
+
299
+ ### Why not ship raw `src/` only?
300
+
301
+ Shipping only `src/*.ts` works in RN (Metro strips the types) but breaks
302
+ everywhere else — bundlers skip `node_modules` transpilation by default, and a
303
+ consumer's stricter `tsconfig` would re-type-check our source and surface errors
304
+ they can't fix. The hybrid layout keeps the great RN DX *and* stays safe for
305
+ every other consumer.
306
+
307
+ ### Build config that makes this work
308
+
309
+ `tsconfig.build.json` (used only to generate type definitions):
310
+
311
+ - `declaration: true` — emit `.d.ts`
312
+ - `declarationMap: true` — emit `.d.ts.map` so go-to-definition reaches `src/`
313
+ - `sourceMap: true` + `inlineSources: true` — map compiled JS back to source
314
+ - `rootDir: "src"` — keeps `index.d.ts` at the top of `lib/typescript/`
315
+ - **No** `declarationDir` / `noEmit` here — `bob` sets those via the CLI; leaving
316
+ them in the config produces conflict warnings
317
+
318
+ `files` includes both `src` and `lib` so the maps resolve on the consumer's disk.
319
+
320
+ ### Publishing
321
+
322
+ The `prepare` script runs `bob build` automatically on install and publish, so
323
+ the build toolchain (`typescript`, `react-native-builder-bob`) must be installed
324
+ first:
325
+
326
+ ```bash
327
+ npm install # installs devDeps AND runs prepare → bob build
328
+ npm pack --dry-run # verify lib/ + src/ + maps are in the tarball
329
+ npm publish
330
+ ```
331
+
332
+ > **Heads-up:** `package-lock.json` is **gitignored** for this library (a lib's
333
+ > lockfile is ignored by consumers and only hides dependency-range drift). On a
334
+ > fresh CI clone there is no lockfile, so use `npm install` — **not** `npm ci`,
335
+ > which requires one.
336
+
337
+ **Never hand-edit `lib/`** — it is generated. Edit `src/` and rebuild.
338
+
269
339
  ## License
270
340
 
271
- MIT © Digia Technology Private Limited
341
+ Business Source License 1.1 (BUSL-1.1) © Digia Technology Private Limited — see [LICENSE](LICENSE)
@@ -74,7 +74,7 @@ class DigiaClass {
74
74
  try {
75
75
  await _NativeDigiaEngage.nativeDigiaModule.initialize(config.projectId, environment, logLevel, config.baseUrl, config.fontFamily);
76
76
  } catch (e) {
77
- // TODO: TO BE PICKED LATER @aditya-digia — health event reporting being removed
77
+ // Health-event reporting is currently disabled.
78
78
  // digiaHealthReporter.report(HealthEventType.fetch_failed, { error_code: 0, platform: 'react_native' });
79
79
  throw e;
80
80
  }
@@ -28,7 +28,7 @@ class DigiaHealthReporter {
28
28
  }
29
29
  report(eventType, detail) {
30
30
  if (!this._projectId) return;
31
- // TODO: TO BE PICKED LATER @aditya-digia — health event backend endpoint being removed
31
+ // Health-event reporting is currently disabled.
32
32
  // fetch(`${this._baseUrl}/engage/sdk/recordHealthEvent`, {
33
33
  // method: 'POST',
34
34
  // headers: {
@@ -67,7 +67,7 @@ class DigiaClass {
67
67
  try {
68
68
  await nativeDigiaModule.initialize(config.projectId, environment, logLevel, config.baseUrl, config.fontFamily);
69
69
  } catch (e) {
70
- // TODO: TO BE PICKED LATER @aditya-digia — health event reporting being removed
70
+ // Health-event reporting is currently disabled.
71
71
  // digiaHealthReporter.report(HealthEventType.fetch_failed, { error_code: 0, platform: 'react_native' });
72
72
  throw e;
73
73
  }
@@ -22,7 +22,7 @@ export class DigiaHealthReporter {
22
22
  }
23
23
  report(eventType, detail) {
24
24
  if (!this._projectId) return;
25
- // TODO: TO BE PICKED LATER @aditya-digia — health event backend endpoint being removed
25
+ // Health-event reporting is currently disabled.
26
26
  // fetch(`${this._baseUrl}/engage/sdk/recordHealthEvent`, {
27
27
  // method: 'POST',
28
28
  // headers: {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@digia-engage/core",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "React Native bridge for Digia Engage – renders native Android Compose UI inside React Native apps",
5
- "main": "src/index.ts",
6
- "module": "src/index.ts",
7
- "types": "src/index.ts",
8
- "react-native": "src/index.ts",
9
- "source": "src/index.ts",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
10
  "files": [
11
11
  "src",
12
12
  "lib",
@@ -43,17 +43,13 @@
43
43
  "directory": "react-native"
44
44
  },
45
45
  "author": "Digia Technology Private Limited",
46
- "license": "MIT",
46
+ "license": "BUSL-1.1",
47
47
  "dependencies": {
48
48
  "@react-native-async-storage/async-storage": "^2.1.2",
49
49
  "react-native-uuid": "^2.0.3",
50
50
  "@edwardloopez/react-native-coachmark": "^0.5.3",
51
51
  "@floating-ui/core": "^1.0.0"
52
52
  },
53
- "peerDependencies": {
54
- "react-native-reanimated": ">=3.0.0",
55
- "react-native-svg": ">=13.0.0"
56
- },
57
53
  "devDependencies": {
58
54
  "@react-native/eslint-config": "^0.73.0",
59
55
  "@types/react": "^18.2.0",
@@ -62,8 +58,6 @@
62
58
  "react": "18.2.0",
63
59
  "react-native": "0.73.0",
64
60
  "react-native-builder-bob": "^0.23.0",
65
- "react-native-reanimated": "^3.19.3",
66
- "react-native-svg": "^15.15.1",
67
61
  "typescript": "^5.2.0"
68
62
  },
69
63
  "react-native-builder-bob": {
package/src/Digia.ts CHANGED
@@ -95,7 +95,7 @@ class DigiaClass implements DigiaDelegate {
95
95
  try {
96
96
  await nativeDigiaModule.initialize(config.projectId, environment, logLevel, config.baseUrl, config.fontFamily);
97
97
  } catch (e) {
98
- // TODO: TO BE PICKED LATER @aditya-digia — health event reporting being removed
98
+ // Health-event reporting is currently disabled.
99
99
  // digiaHealthReporter.report(HealthEventType.fetch_failed, { error_code: 0, platform: 'react_native' });
100
100
  throw e;
101
101
  }
@@ -27,7 +27,7 @@ export class DigiaHealthReporter {
27
27
 
28
28
  report(eventType: HealthEventType, detail: Record<string, unknown>): void {
29
29
  if (!this._projectId) return;
30
- // TODO: TO BE PICKED LATER @aditya-digia — health event backend endpoint being removed
30
+ // Health-event reporting is currently disabled.
31
31
  // fetch(`${this._baseUrl}/engage/sdk/recordHealthEvent`, {
32
32
  // method: 'POST',
33
33
  // headers: {