@chipmobilesdk/rn-core 0.1.0 → 0.2.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.
- package/CHANGELOG.md +64 -0
- package/lib/commonjs/diagnostics/index.js +81 -0
- package/lib/commonjs/diagnostics/index.js.map +1 -0
- package/lib/commonjs/errors/index.js +86 -0
- package/lib/commonjs/errors/index.js.map +1 -0
- package/lib/commonjs/index.js +305 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/intl/index.js +98 -0
- package/lib/commonjs/intl/index.js.map +1 -0
- package/lib/commonjs/kv/index.js +83 -0
- package/lib/commonjs/kv/index.js.map +1 -0
- package/lib/commonjs/lazy/index.js +63 -0
- package/lib/commonjs/lazy/index.js.map +1 -0
- package/lib/commonjs/listeners/index.js +110 -0
- package/lib/commonjs/listeners/index.js.map +1 -0
- package/lib/commonjs/messages/index.js +53 -0
- package/lib/commonjs/messages/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/react/index.js +93 -0
- package/lib/commonjs/react/index.js.map +1 -0
- package/lib/commonjs/redact/index.js +128 -0
- package/lib/commonjs/redact/index.js.map +1 -0
- package/lib/commonjs/runtime/index.js +77 -0
- package/lib/commonjs/runtime/index.js.map +1 -0
- package/lib/commonjs/runtime/lifecycle.js +105 -0
- package/lib/commonjs/runtime/lifecycle.js.map +1 -0
- package/lib/commonjs/scheduler/index.js +216 -0
- package/lib/commonjs/scheduler/index.js.map +1 -0
- package/lib/commonjs/store/index.js +39 -0
- package/lib/commonjs/store/index.js.map +1 -0
- package/lib/commonjs/testing/conformance.js +79 -0
- package/lib/commonjs/testing/conformance.js.map +1 -0
- package/lib/commonjs/testing/index.js +58 -0
- package/lib/commonjs/testing/index.js.map +1 -0
- package/lib/commonjs/testing/lifecycle.js +37 -0
- package/lib/commonjs/testing/lifecycle.js.map +1 -0
- package/lib/commonjs/testing/redaction.js +118 -0
- package/lib/commonjs/testing/redaction.js.map +1 -0
- package/lib/commonjs/testing/scheduler.js +51 -0
- package/lib/commonjs/testing/scheduler.js.map +1 -0
- package/lib/module/diagnostics/index.js +75 -0
- package/lib/module/diagnostics/index.js.map +1 -0
- package/lib/module/errors/index.js +78 -0
- package/lib/module/errors/index.js.map +1 -0
- package/lib/module/index.js +24 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/intl/index.js +91 -0
- package/lib/module/intl/index.js.map +1 -0
- package/lib/module/kv/index.js +76 -0
- package/lib/module/kv/index.js.map +1 -0
- package/lib/module/lazy/index.js +59 -0
- package/lib/module/lazy/index.js.map +1 -0
- package/lib/module/listeners/index.js +104 -0
- package/lib/module/listeners/index.js.map +1 -0
- package/lib/module/messages/index.js +48 -0
- package/lib/module/messages/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/react/index.js +86 -0
- package/lib/module/react/index.js.map +1 -0
- package/lib/module/redact/index.js +118 -0
- package/lib/module/redact/index.js.map +1 -0
- package/lib/module/runtime/index.js +52 -0
- package/lib/module/runtime/index.js.map +1 -0
- package/lib/module/runtime/lifecycle.js +99 -0
- package/lib/module/runtime/lifecycle.js.map +1 -0
- package/lib/module/scheduler/index.js +203 -0
- package/lib/module/scheduler/index.js.map +1 -0
- package/lib/module/store/index.js +33 -0
- package/lib/module/store/index.js.map +1 -0
- package/lib/module/testing/conformance.js +72 -0
- package/lib/module/testing/conformance.js.map +1 -0
- package/lib/module/testing/index.js +12 -0
- package/lib/module/testing/index.js.map +1 -0
- package/lib/module/testing/lifecycle.js +32 -0
- package/lib/module/testing/lifecycle.js.map +1 -0
- package/lib/module/testing/redaction.js +113 -0
- package/lib/module/testing/redaction.js.map +1 -0
- package/lib/module/testing/scheduler.js +47 -0
- package/lib/module/testing/scheduler.js.map +1 -0
- package/lib/typescript/commonjs/diagnostics/index.d.ts +49 -0
- package/lib/typescript/commonjs/diagnostics/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/errors/index.d.ts +59 -0
- package/lib/typescript/commonjs/errors/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +22 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/intl/index.d.ts +25 -0
- package/lib/typescript/commonjs/intl/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/kv/index.d.ts +38 -0
- package/lib/typescript/commonjs/kv/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/lazy/index.d.ts +36 -0
- package/lib/typescript/commonjs/lazy/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/listeners/index.d.ts +61 -0
- package/lib/typescript/commonjs/listeners/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/messages/index.d.ts +39 -0
- package/lib/typescript/commonjs/messages/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/react/index.d.ts +38 -0
- package/lib/typescript/commonjs/react/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/redact/index.d.ts +47 -0
- package/lib/typescript/commonjs/redact/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/runtime/index.d.ts +21 -0
- package/lib/typescript/commonjs/runtime/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/runtime/lifecycle.d.ts +34 -0
- package/lib/typescript/commonjs/runtime/lifecycle.d.ts.map +1 -0
- package/lib/typescript/commonjs/scheduler/index.d.ts +108 -0
- package/lib/typescript/commonjs/scheduler/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/store/index.d.ts +18 -0
- package/lib/typescript/commonjs/store/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance.d.ts +35 -0
- package/lib/typescript/commonjs/testing/conformance.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/index.d.ts +10 -0
- package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/lifecycle.d.ts +15 -0
- package/lib/typescript/commonjs/testing/lifecycle.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/redaction.d.ts +35 -0
- package/lib/typescript/commonjs/testing/redaction.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/scheduler.d.ts +15 -0
- package/lib/typescript/commonjs/testing/scheduler.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/index.d.ts +49 -0
- package/lib/typescript/module/diagnostics/index.d.ts.map +1 -0
- package/lib/typescript/module/errors/index.d.ts +59 -0
- package/lib/typescript/module/errors/index.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +22 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/intl/index.d.ts +25 -0
- package/lib/typescript/module/intl/index.d.ts.map +1 -0
- package/lib/typescript/module/kv/index.d.ts +38 -0
- package/lib/typescript/module/kv/index.d.ts.map +1 -0
- package/lib/typescript/module/lazy/index.d.ts +36 -0
- package/lib/typescript/module/lazy/index.d.ts.map +1 -0
- package/lib/typescript/module/listeners/index.d.ts +61 -0
- package/lib/typescript/module/listeners/index.d.ts.map +1 -0
- package/lib/typescript/module/messages/index.d.ts +39 -0
- package/lib/typescript/module/messages/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/react/index.d.ts +38 -0
- package/lib/typescript/module/react/index.d.ts.map +1 -0
- package/lib/typescript/module/redact/index.d.ts +47 -0
- package/lib/typescript/module/redact/index.d.ts.map +1 -0
- package/lib/typescript/module/runtime/index.d.ts +21 -0
- package/lib/typescript/module/runtime/index.d.ts.map +1 -0
- package/lib/typescript/module/runtime/lifecycle.d.ts +34 -0
- package/lib/typescript/module/runtime/lifecycle.d.ts.map +1 -0
- package/lib/typescript/module/scheduler/index.d.ts +108 -0
- package/lib/typescript/module/scheduler/index.d.ts.map +1 -0
- package/lib/typescript/module/store/index.d.ts +18 -0
- package/lib/typescript/module/store/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance.d.ts +35 -0
- package/lib/typescript/module/testing/conformance.d.ts.map +1 -0
- package/lib/typescript/module/testing/index.d.ts +10 -0
- package/lib/typescript/module/testing/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/lifecycle.d.ts +15 -0
- package/lib/typescript/module/testing/lifecycle.d.ts.map +1 -0
- package/lib/typescript/module/testing/redaction.d.ts +35 -0
- package/lib/typescript/module/testing/redaction.d.ts.map +1 -0
- package/lib/typescript/module/testing/scheduler.d.ts +15 -0
- package/lib/typescript/module/testing/scheduler.d.ts.map +1 -0
- package/package.json +154 -46
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type RuntimePlatform = 'android' | 'ios' | 'unsupported';
|
|
2
|
+
/** What a build is for. A package may refuse production configuration elsewhere. */
|
|
3
|
+
export type BuildEnvironment = 'development' | 'test' | 'production';
|
|
4
|
+
/** The OS the app runs on, or `unsupported` (web, Node, a platform with no adapter). */
|
|
5
|
+
export declare function currentPlatform(): RuntimePlatform;
|
|
6
|
+
/** Test seam: pins `currentPlatform()`; `undefined` goes back to the real one. */
|
|
7
|
+
export declare function setPlatformOverride(platform: RuntimePlatform | undefined): void;
|
|
8
|
+
/** Picks a value for the current platform, falling back to `default`. */
|
|
9
|
+
export declare function byPlatform<T>(values: {
|
|
10
|
+
readonly android?: T;
|
|
11
|
+
readonly ios?: T;
|
|
12
|
+
readonly default: T;
|
|
13
|
+
}): T;
|
|
14
|
+
/**
|
|
15
|
+
* Whether this is a development build: React Native's `__DEV__`, or, where that
|
|
16
|
+
* global does not exist (plain Node, some test runners), `NODE_ENV` not being
|
|
17
|
+
* `production`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isDevBuild(): boolean;
|
|
20
|
+
export { appLifecycle, createAppLifecycle, onForeground, type AppLifecyclePort, type AppLifecycleState, type AppStateSource, } from './lifecycle.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/index.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,KAAK,GAAG,aAAa,CAAC;AAEhE,oFAAoF;AACpF,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,CAAC;AAarE,wFAAwF;AACxF,wBAAgB,eAAe,IAAI,eAAe,CAKjD;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI,CAE/E;AAED,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACpB,GAAG,CAAC,CAKJ;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAIpC;AAED,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACnB,MAAM,gBAAa,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Unsubscribe } from '../listeners/index.js';
|
|
2
|
+
export type AppLifecycleState = 'active' | 'inactive' | 'background';
|
|
3
|
+
export interface AppLifecyclePort {
|
|
4
|
+
/** The state now. */
|
|
5
|
+
current(): AppLifecycleState;
|
|
6
|
+
/**
|
|
7
|
+
* Called on every change of state, with the state before it. Repeated reports
|
|
8
|
+
* of the same state are not changes. The returned function removes the
|
|
9
|
+
* listener, once.
|
|
10
|
+
*/
|
|
11
|
+
subscribe(listener: (state: AppLifecycleState, previous: AppLifecycleState) => void): Unsubscribe;
|
|
12
|
+
/** How many listeners are attached; the native subscription lives while this is above zero. */
|
|
13
|
+
readonly listenerCount: number;
|
|
14
|
+
}
|
|
15
|
+
/** The slice of React Native's `AppState` the port reads. */
|
|
16
|
+
export interface AppStateSource {
|
|
17
|
+
readonly currentState?: string | null;
|
|
18
|
+
addEventListener(type: 'change', listener: (state: string) => void): {
|
|
19
|
+
remove(): void;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A lifecycle port over `source`, React Native's `AppState` by default. Packages use
|
|
24
|
+
* the shared `appLifecycle()`; this is for tests and for an app with its own source.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createAppLifecycle(source?: () => AppStateSource | undefined): AppLifecyclePort;
|
|
27
|
+
/** The app's lifecycle, shared by every package so there is one native subscription. */
|
|
28
|
+
export declare function appLifecycle(): AppLifecyclePort;
|
|
29
|
+
/**
|
|
30
|
+
* Calls `listener` each time the app comes back from the background. A trip through
|
|
31
|
+
* `inactive` alone (iOS Control Center, an incoming-call banner) is not a return.
|
|
32
|
+
*/
|
|
33
|
+
export declare function onForeground(listener: () => void, port?: AppLifecyclePort): Unsubscribe;
|
|
34
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/runtime/lifecycle.ts"],"names":[],"mappings":"AAaA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,uBAAc,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAC;AAErE,MAAM,WAAW,gBAAgB;IAChC,qBAAqB;IACrB,OAAO,IAAI,iBAAiB,CAAC;IAC7B;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,KAAK,IAAI,GAAG,WAAW,CAAC;IAClG,+FAA+F;IAC/F,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAC/B;AAED,6DAA6D;AAC7D,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG;QAAE,MAAM,IAAI,IAAI,CAAA;KAAE,CAAC;CACxF;AAwBD;;;GAGG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,GAAE,MAAM,cAAc,GAAG,SAAyB,GACtD,gBAAgB,CAyClB;AAID,wFAAwF;AACxF,wBAAgB,YAAY,IAAI,gBAAgB,CAG/C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC3B,QAAQ,EAAE,MAAM,IAAI,EACpB,IAAI,GAAE,gBAAiC,GACrC,WAAW,CAUb"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time, retries, concurrency and bounds, shared by every package (CORE-04,
|
|
3
|
+
* CORE-05).
|
|
4
|
+
*
|
|
5
|
+
* rn-ads and rn-payment each had their own copy of these, and the copies had
|
|
6
|
+
* drifted: one validated a backoff and the other did not, one reported a retry
|
|
7
|
+
* policy out of bounds under a timeout's error code. Packages keep their domain
|
|
8
|
+
* defaults and bounds; the mechanism lives here, and bounds checks take a `fail`
|
|
9
|
+
* callback so each package raises its own error with its own code.
|
|
10
|
+
*/
|
|
11
|
+
import { type Unsubscribe } from '../listeners/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* How timers are scheduled. Injectable so a test drives backoff and expiry by
|
|
14
|
+
* moving a clock instead of waiting.
|
|
15
|
+
*/
|
|
16
|
+
export interface Scheduler {
|
|
17
|
+
setTimeout(callback: () => void, ms: number): unknown;
|
|
18
|
+
clearTimeout(handle: unknown): void;
|
|
19
|
+
}
|
|
20
|
+
export declare const realScheduler: Scheduler;
|
|
21
|
+
/**
|
|
22
|
+
* Every timer an owner started, so disposing it can prove nothing is left: a
|
|
23
|
+
* leaked timer is otherwise invisible until it fires into a disposed consumer.
|
|
24
|
+
*/
|
|
25
|
+
export interface TimerSet {
|
|
26
|
+
after(ms: number, callback: () => void): Unsubscribe;
|
|
27
|
+
clearAll(): void;
|
|
28
|
+
size(): number;
|
|
29
|
+
}
|
|
30
|
+
export declare function createTimerSet(scheduler?: Scheduler): TimerSet;
|
|
31
|
+
export interface BackoffSpec {
|
|
32
|
+
readonly initialDelayMs: number;
|
|
33
|
+
readonly maxDelayMs: number;
|
|
34
|
+
/** Growth per attempt. Defaults to 2. */
|
|
35
|
+
readonly factor?: number | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* `none` keeps a schedule exact (one device retrying its own request has no
|
|
38
|
+
* herd to avoid); `full` spreads it over [0, delay] so a fleet that failed at
|
|
39
|
+
* once does not retry in lockstep. Defaults to `none`.
|
|
40
|
+
*/
|
|
41
|
+
readonly jitter?: 'none' | 'full' | undefined;
|
|
42
|
+
}
|
|
43
|
+
/** Delay before `attempt`, 1-based: initial × factor^(attempt−1), capped, maybe jittered. */
|
|
44
|
+
export declare function computeBackoff(attempt: number, spec: BackoffSpec, random?: () => number): number;
|
|
45
|
+
export interface RetryHandle {
|
|
46
|
+
/** Cancels any pending attempt. Idempotent. */
|
|
47
|
+
cancel(): void;
|
|
48
|
+
/** Attempts made so far. */
|
|
49
|
+
attempts(): number;
|
|
50
|
+
/** True once `maxAttempts` were made without success. */
|
|
51
|
+
exhausted(): boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface RetryOptions {
|
|
54
|
+
readonly spec: BackoffSpec & {
|
|
55
|
+
readonly maxAttempts: number;
|
|
56
|
+
};
|
|
57
|
+
/** Resolves true when the attempt succeeded. A throw counts as a failed attempt. */
|
|
58
|
+
readonly attempt: (attemptNumber: number) => Promise<boolean>;
|
|
59
|
+
/** Called once every attempt failed. Exhaustion is reported, never thrown. */
|
|
60
|
+
readonly onExhausted?: ((attempts: number) => void) | undefined;
|
|
61
|
+
readonly scheduler?: Scheduler | undefined;
|
|
62
|
+
readonly random?: (() => number) | undefined;
|
|
63
|
+
}
|
|
64
|
+
/** Runs `attempt` now, then on the backoff schedule until it succeeds, is cancelled or runs out. */
|
|
65
|
+
export declare function runWithRetry(options: RetryOptions): RetryHandle;
|
|
66
|
+
/**
|
|
67
|
+
* Joins concurrent callers onto one in-flight operation. Once it settles the
|
|
68
|
+
* slot clears, so a later call starts fresh: de-duplication, not caching.
|
|
69
|
+
*/
|
|
70
|
+
export declare function createSingleFlight<T>(): {
|
|
71
|
+
run(operation: () => Promise<T>): Promise<T>;
|
|
72
|
+
inFlight(): boolean;
|
|
73
|
+
};
|
|
74
|
+
/** Distinguishes "refused because busy" from any other failure, without throwing. */
|
|
75
|
+
export type ExclusiveOutcome<T> = {
|
|
76
|
+
acquired: true;
|
|
77
|
+
value: T;
|
|
78
|
+
} | {
|
|
79
|
+
acquired: false;
|
|
80
|
+
};
|
|
81
|
+
/** Admits one operation at a time and refuses the rest, rather than queueing them. */
|
|
82
|
+
export declare function createExclusive(): {
|
|
83
|
+
run<T>(operation: () => Promise<T>): Promise<ExclusiveOutcome<T>>;
|
|
84
|
+
busy(): boolean;
|
|
85
|
+
};
|
|
86
|
+
/** Admits at most one call per `minIntervalMs`; a refused call is dropped, not deferred. */
|
|
87
|
+
export declare function createRateLimiter(minIntervalMs: number, now?: () => number): {
|
|
88
|
+
tryAcquire(): boolean;
|
|
89
|
+
reset(): void;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Rejects with `onTimeout()` after `ms`. Always clears its timer, including when
|
|
93
|
+
* the promise wins, so no operation leaks one.
|
|
94
|
+
*/
|
|
95
|
+
export declare function withTimeout<T>(promise: Promise<T>, ms: number, onTimeout: () => Error, scheduler?: Scheduler): Promise<T>;
|
|
96
|
+
export interface Range {
|
|
97
|
+
readonly min: number;
|
|
98
|
+
readonly max: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* `value` when it is a finite number inside `range`; otherwise throws what `fail`
|
|
102
|
+
* builds. Out-of-range values are rejected, never clamped: clamping tells an app
|
|
103
|
+
* it configured something it did not.
|
|
104
|
+
*/
|
|
105
|
+
export declare function checkRange(label: string, value: number, range: Range, fail: (message: string) => Error, unit?: string): number;
|
|
106
|
+
/** As `checkRange`, and a whole number. */
|
|
107
|
+
export declare function checkInteger(label: string, value: number, range: Range, fail: (message: string) => Error): number;
|
|
108
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scheduler/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A store whose snapshot keeps its identity until the state actually changes,
|
|
3
|
+
* which is what `useSyncExternalStore` needs (CORE-07). No React here: a package's
|
|
4
|
+
* pure core can hold its state in one, and its hooks read it through
|
|
5
|
+
* `@chipmobilesdk/rn-core/react`.
|
|
6
|
+
*/
|
|
7
|
+
import { type Unsubscribe } from '../listeners/index.js';
|
|
8
|
+
export interface Store<T> {
|
|
9
|
+
/** The current snapshot: the same object until the state actually changes. */
|
|
10
|
+
getSnapshot(): T;
|
|
11
|
+
/** Replaces the state; listeners hear about it only when `isEqual` says it changed. */
|
|
12
|
+
setState(next: T | ((previous: T) => T)): void;
|
|
13
|
+
subscribe(listener: () => void): Unsubscribe;
|
|
14
|
+
}
|
|
15
|
+
export declare function createStore<T>(initial: T, isEqual?: (a: T, b: T) => boolean): Store<T>;
|
|
16
|
+
/** Same keys, and each value `Object.is` the other's. */
|
|
17
|
+
export declare function shallowEqual<T>(a: T, b: T): boolean;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/store/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,uBAAc,CAAC;AAEnE,MAAM,WAAW,KAAK,CAAC,CAAC;IACvB,8EAA8E;IAC9E,WAAW,IAAI,CAAC,CAAC;IACjB,uFAAuF;IACvF,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/C,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC;CAC7C;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAmB,GAAG,KAAK,CAAC,CAAC,CAAC,CAajG;AAED,yDAAyD;AACzD,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CAUnD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A conformance harness that runs in Jest and on a device alike (CORE-13, IOS-12).
|
|
3
|
+
*
|
|
4
|
+
* A package describes what any implementation of one of its ports must do as a
|
|
5
|
+
* list of checks. The same list runs against the fake its tests use and against
|
|
6
|
+
* the real adapter (with the native module mocked in Jest, or for real in a demo
|
|
7
|
+
* screen), so the fake cannot drift from the adapter it stands in for. A report
|
|
8
|
+
* is plain data; `expectConformance` turns a failing one into a Jest failure.
|
|
9
|
+
*/
|
|
10
|
+
import type { ConformanceReport } from './redaction.js';
|
|
11
|
+
export interface Check<Subject> {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
run(subject: Subject): void | Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
/** Runs every check against a fresh subject, so no check depends on another's leftovers. */
|
|
16
|
+
export declare function runChecks<Subject>(makeSubject: () => Subject | Promise<Subject>, checks: readonly Check<Subject>[]): Promise<ConformanceReport>;
|
|
17
|
+
/** Throws one error listing every failed check, for a test runner to report. */
|
|
18
|
+
export declare function expectConformance(report: ConformanceReport, subject?: string): void;
|
|
19
|
+
/** A failed expectation inside a check. */
|
|
20
|
+
export declare function ensure(condition: unknown, message: string): asserts condition;
|
|
21
|
+
export interface FaultRegistry<Point extends string> {
|
|
22
|
+
/** The next `times` calls at `point` throw what `fault` builds. */
|
|
23
|
+
arm(point: Point, fault: () => Error, times?: number): void;
|
|
24
|
+
disarm(point?: Point): void;
|
|
25
|
+
/** Throws if `point` is armed; called by the code under test at that point. */
|
|
26
|
+
throwIfFaulted(point: Point): void;
|
|
27
|
+
/** Points that have fired at least once, so a test can prove its fault was reached. */
|
|
28
|
+
fired(): readonly Point[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Deterministic fault injection: a fake or an adapter calls `throwIfFaulted` at its
|
|
32
|
+
* named points, and a test arms the ones it wants to fail (CORE-13, NOT-22).
|
|
33
|
+
*/
|
|
34
|
+
export declare function createFaultRegistry<Point extends string>(): FaultRegistry<Point>;
|
|
35
|
+
//# sourceMappingURL=conformance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../../../../src/testing/conformance.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,gBAAa,CAAC;AAEzE,MAAM,WAAW,KAAK,CAAC,OAAO;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,4FAA4F;AAC5F,wBAAsB,SAAS,CAAC,OAAO,EACtC,WAAW,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAC7C,MAAM,EAAE,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAa5B;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,SAAmB,GAAG,IAAI,CAM7F;AAED,2CAA2C;AAC3C,wBAAgB,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAE7E;AAED,MAAM,WAAW,aAAa,CAAC,KAAK,SAAS,MAAM;IAClD,mEAAmE;IACnE,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5D,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,+EAA+E;IAC/E,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACnC,uFAAuF;IACvF,KAAK,IAAI,SAAS,KAAK,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,MAAM,KAAK,aAAa,CAAC,KAAK,CAAC,CAqBhF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test helpers shared by every package: conformance suites that return plain
|
|
3
|
+
* reports, so they run in Jest and on a device alike. Production code never
|
|
4
|
+
* imports this entrypoint.
|
|
5
|
+
*/
|
|
6
|
+
export { REDACTION_PROBES, redactionConformance, type ConformanceFailure, type ConformanceReport, type RedactionProbe, } from './redaction.js';
|
|
7
|
+
export { createManualScheduler, type ManualScheduler } from './scheduler.js';
|
|
8
|
+
export { createFaultRegistry, ensure, expectConformance, runChecks, type Check, type FaultRegistry, } from './conformance.js';
|
|
9
|
+
export { createManualLifecycle, type ManualLifecycle } from './lifecycle.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACN,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACnB,MAAM,gBAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAa,CAAC;AAC1E,OAAO,EACN,mBAAmB,EACnB,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,KAAK,KAAK,EACV,KAAK,aAAa,GAClB,MAAM,kBAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAa,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A lifecycle a test moves by hand (CORE-14). It runs the real port over a scripted
|
|
3
|
+
* `AppState`, so transitions, de-duplication and reference counting behave exactly
|
|
4
|
+
* as they do on a device.
|
|
5
|
+
*/
|
|
6
|
+
import { type AppLifecyclePort, type AppLifecycleState } from '../runtime/lifecycle.js';
|
|
7
|
+
export interface ManualLifecycle {
|
|
8
|
+
readonly port: AppLifecyclePort;
|
|
9
|
+
/** Moves the app to `state`, as the OS would. Reporting the current state again is a no-op. */
|
|
10
|
+
set(state: AppLifecycleState): void;
|
|
11
|
+
/** Whether the port holds its (scripted) native subscription. */
|
|
12
|
+
isSubscribed(): boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function createManualLifecycle(initial?: AppLifecycleState): ManualLifecycle;
|
|
15
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/testing/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAEN,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEtB,MAAM,yBAAsB,CAAC;AAE9B,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,+FAA+F;IAC/F,GAAG,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,iEAAiE;IACjE,YAAY,IAAI,OAAO,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,iBAA4B,GAAG,eAAe,CAoB5F"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One set of secrets every package's redaction must remove (CORE-02).
|
|
3
|
+
*
|
|
4
|
+
* Packages redact with different policies (identifier-only, pattern-based,
|
|
5
|
+
* key-based), but none of them may let one of these through. Each package runs
|
|
6
|
+
* this against every redaction entrypoint it has; the report is plain data, so it
|
|
7
|
+
* runs in Jest and on a device alike.
|
|
8
|
+
*/
|
|
9
|
+
export interface RedactionProbe {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
/** What is handed to the redactor. */
|
|
12
|
+
readonly input: unknown;
|
|
13
|
+
/** The part that must not appear anywhere in the output. */
|
|
14
|
+
readonly secret: string;
|
|
15
|
+
/** Probes that need key-aware redaction; a string-only redactor skips them. */
|
|
16
|
+
readonly structured?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const REDACTION_PROBES: readonly RedactionProbe[];
|
|
19
|
+
export interface ConformanceFailure {
|
|
20
|
+
readonly check: string;
|
|
21
|
+
readonly detail: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ConformanceReport {
|
|
24
|
+
readonly passed: boolean;
|
|
25
|
+
readonly checks: number;
|
|
26
|
+
readonly failures: readonly ConformanceFailure[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Runs every probe through `redact` and reports each secret that survived.
|
|
30
|
+
* `stringsOnly` is for a redactor that only accepts text (rn-auth's `redact`).
|
|
31
|
+
*/
|
|
32
|
+
export declare function redactionConformance(redact: (value: unknown) => unknown, options?: {
|
|
33
|
+
readonly stringsOnly?: boolean;
|
|
34
|
+
}): ConformanceReport;
|
|
35
|
+
//# sourceMappingURL=redaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redaction.d.ts","sourceRoot":"","sources":["../../../../src/testing/redaction.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC9B;AASD,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EA2BpD,CAAC;AAEH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACjD;AAsBD;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,EACnC,OAAO,GAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9C,iBAAiB,CAmBnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A scheduler a test drives by hand: nothing fires until `advance` moves the
|
|
3
|
+
* clock past it, so timing assertions are exact and instant.
|
|
4
|
+
*/
|
|
5
|
+
import type { Scheduler } from '../scheduler/index.js';
|
|
6
|
+
export interface ManualScheduler extends Scheduler {
|
|
7
|
+
/** The scheduler's clock, in milliseconds since it was created at `startMs`. */
|
|
8
|
+
now(): number;
|
|
9
|
+
/** Moves the clock forward, firing every timer that falls due, in order. */
|
|
10
|
+
advance(ms: number): void;
|
|
11
|
+
/** Timers scheduled and not yet fired or cleared. */
|
|
12
|
+
pending(): number;
|
|
13
|
+
}
|
|
14
|
+
export declare function createManualScheduler(startMs?: number): ManualScheduler;
|
|
15
|
+
//# sourceMappingURL=scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../../src/testing/scheduler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAc,CAAC;AAE9C,MAAM,WAAW,eAAgB,SAAQ,SAAS;IACjD,gFAAgF;IAChF,GAAG,IAAI,MAAM,CAAC;IACd,4EAA4E;IAC5E,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qDAAqD;IACrD,OAAO,IAAI,MAAM,CAAC;CAClB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,SAAI,GAAG,eAAe,CAoClE"}
|
package/package.json
CHANGED
|
@@ -1,93 +1,180 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipmobilesdk/rn-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
|
-
"main": "
|
|
7
|
-
"types": "
|
|
6
|
+
"main": "./lib/commonjs/index.js",
|
|
7
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
10
|
+
"chipmobilesdk-source": "./src/index.ts",
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./lib/typescript/module/index.d.ts",
|
|
13
|
+
"default": "./lib/module/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
17
|
+
"default": "./lib/commonjs/index.js"
|
|
18
|
+
}
|
|
13
19
|
},
|
|
14
20
|
"./errors": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
21
|
+
"chipmobilesdk-source": "./src/errors/index.ts",
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./lib/typescript/module/errors/index.d.ts",
|
|
24
|
+
"default": "./lib/module/errors/index.js"
|
|
25
|
+
},
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./lib/typescript/commonjs/errors/index.d.ts",
|
|
28
|
+
"default": "./lib/commonjs/errors/index.js"
|
|
29
|
+
}
|
|
18
30
|
},
|
|
19
31
|
"./redact": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
32
|
+
"chipmobilesdk-source": "./src/redact/index.ts",
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./lib/typescript/module/redact/index.d.ts",
|
|
35
|
+
"default": "./lib/module/redact/index.js"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./lib/typescript/commonjs/redact/index.d.ts",
|
|
39
|
+
"default": "./lib/commonjs/redact/index.js"
|
|
40
|
+
}
|
|
23
41
|
},
|
|
24
42
|
"./listeners": {
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
43
|
+
"chipmobilesdk-source": "./src/listeners/index.ts",
|
|
44
|
+
"import": {
|
|
45
|
+
"types": "./lib/typescript/module/listeners/index.d.ts",
|
|
46
|
+
"default": "./lib/module/listeners/index.js"
|
|
47
|
+
},
|
|
48
|
+
"require": {
|
|
49
|
+
"types": "./lib/typescript/commonjs/listeners/index.d.ts",
|
|
50
|
+
"default": "./lib/commonjs/listeners/index.js"
|
|
51
|
+
}
|
|
28
52
|
},
|
|
29
53
|
"./diagnostics": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
54
|
+
"chipmobilesdk-source": "./src/diagnostics/index.ts",
|
|
55
|
+
"import": {
|
|
56
|
+
"types": "./lib/typescript/module/diagnostics/index.d.ts",
|
|
57
|
+
"default": "./lib/module/diagnostics/index.js"
|
|
58
|
+
},
|
|
59
|
+
"require": {
|
|
60
|
+
"types": "./lib/typescript/commonjs/diagnostics/index.d.ts",
|
|
61
|
+
"default": "./lib/commonjs/diagnostics/index.js"
|
|
62
|
+
}
|
|
33
63
|
},
|
|
34
64
|
"./scheduler": {
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
65
|
+
"chipmobilesdk-source": "./src/scheduler/index.ts",
|
|
66
|
+
"import": {
|
|
67
|
+
"types": "./lib/typescript/module/scheduler/index.d.ts",
|
|
68
|
+
"default": "./lib/module/scheduler/index.js"
|
|
69
|
+
},
|
|
70
|
+
"require": {
|
|
71
|
+
"types": "./lib/typescript/commonjs/scheduler/index.d.ts",
|
|
72
|
+
"default": "./lib/commonjs/scheduler/index.js"
|
|
73
|
+
}
|
|
38
74
|
},
|
|
39
75
|
"./lazy": {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
76
|
+
"chipmobilesdk-source": "./src/lazy/index.ts",
|
|
77
|
+
"import": {
|
|
78
|
+
"types": "./lib/typescript/module/lazy/index.d.ts",
|
|
79
|
+
"default": "./lib/module/lazy/index.js"
|
|
80
|
+
},
|
|
81
|
+
"require": {
|
|
82
|
+
"types": "./lib/typescript/commonjs/lazy/index.d.ts",
|
|
83
|
+
"default": "./lib/commonjs/lazy/index.js"
|
|
84
|
+
}
|
|
43
85
|
},
|
|
44
86
|
"./kv": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
87
|
+
"chipmobilesdk-source": "./src/kv/index.ts",
|
|
88
|
+
"import": {
|
|
89
|
+
"types": "./lib/typescript/module/kv/index.d.ts",
|
|
90
|
+
"default": "./lib/module/kv/index.js"
|
|
91
|
+
},
|
|
92
|
+
"require": {
|
|
93
|
+
"types": "./lib/typescript/commonjs/kv/index.d.ts",
|
|
94
|
+
"default": "./lib/commonjs/kv/index.js"
|
|
95
|
+
}
|
|
48
96
|
},
|
|
49
97
|
"./runtime": {
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
98
|
+
"chipmobilesdk-source": "./src/runtime/index.ts",
|
|
99
|
+
"import": {
|
|
100
|
+
"types": "./lib/typescript/module/runtime/index.d.ts",
|
|
101
|
+
"default": "./lib/module/runtime/index.js"
|
|
102
|
+
},
|
|
103
|
+
"require": {
|
|
104
|
+
"types": "./lib/typescript/commonjs/runtime/index.d.ts",
|
|
105
|
+
"default": "./lib/commonjs/runtime/index.js"
|
|
106
|
+
}
|
|
53
107
|
},
|
|
54
108
|
"./intl": {
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
109
|
+
"chipmobilesdk-source": "./src/intl/index.ts",
|
|
110
|
+
"import": {
|
|
111
|
+
"types": "./lib/typescript/module/intl/index.d.ts",
|
|
112
|
+
"default": "./lib/module/intl/index.js"
|
|
113
|
+
},
|
|
114
|
+
"require": {
|
|
115
|
+
"types": "./lib/typescript/commonjs/intl/index.d.ts",
|
|
116
|
+
"default": "./lib/commonjs/intl/index.js"
|
|
117
|
+
}
|
|
58
118
|
},
|
|
59
119
|
"./messages": {
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
120
|
+
"chipmobilesdk-source": "./src/messages/index.ts",
|
|
121
|
+
"import": {
|
|
122
|
+
"types": "./lib/typescript/module/messages/index.d.ts",
|
|
123
|
+
"default": "./lib/module/messages/index.js"
|
|
124
|
+
},
|
|
125
|
+
"require": {
|
|
126
|
+
"types": "./lib/typescript/commonjs/messages/index.d.ts",
|
|
127
|
+
"default": "./lib/commonjs/messages/index.js"
|
|
128
|
+
}
|
|
63
129
|
},
|
|
64
130
|
"./store": {
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
131
|
+
"chipmobilesdk-source": "./src/store/index.ts",
|
|
132
|
+
"import": {
|
|
133
|
+
"types": "./lib/typescript/module/store/index.d.ts",
|
|
134
|
+
"default": "./lib/module/store/index.js"
|
|
135
|
+
},
|
|
136
|
+
"require": {
|
|
137
|
+
"types": "./lib/typescript/commonjs/store/index.d.ts",
|
|
138
|
+
"default": "./lib/commonjs/store/index.js"
|
|
139
|
+
}
|
|
68
140
|
},
|
|
69
141
|
"./react": {
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
142
|
+
"chipmobilesdk-source": "./src/react/index.ts",
|
|
143
|
+
"import": {
|
|
144
|
+
"types": "./lib/typescript/module/react/index.d.ts",
|
|
145
|
+
"default": "./lib/module/react/index.js"
|
|
146
|
+
},
|
|
147
|
+
"require": {
|
|
148
|
+
"types": "./lib/typescript/commonjs/react/index.d.ts",
|
|
149
|
+
"default": "./lib/commonjs/react/index.js"
|
|
150
|
+
}
|
|
73
151
|
},
|
|
74
152
|
"./testing": {
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
|
|
153
|
+
"chipmobilesdk-source": "./src/testing/index.ts",
|
|
154
|
+
"import": {
|
|
155
|
+
"types": "./lib/typescript/module/testing/index.d.ts",
|
|
156
|
+
"default": "./lib/module/testing/index.js"
|
|
157
|
+
},
|
|
158
|
+
"require": {
|
|
159
|
+
"types": "./lib/typescript/commonjs/testing/index.d.ts",
|
|
160
|
+
"default": "./lib/commonjs/testing/index.js"
|
|
161
|
+
}
|
|
78
162
|
}
|
|
79
163
|
},
|
|
80
164
|
"files": [
|
|
81
165
|
"src",
|
|
82
166
|
"!src/**/__tests__",
|
|
167
|
+
"lib",
|
|
83
168
|
"skills",
|
|
84
169
|
"README.md",
|
|
85
170
|
"CHANGELOG.md"
|
|
86
171
|
],
|
|
87
172
|
"sideEffects": false,
|
|
88
173
|
"scripts": {
|
|
174
|
+
"build": "bob build",
|
|
89
175
|
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json",
|
|
90
|
-
"pack:check": "npm pack --dry-run"
|
|
176
|
+
"pack:check": "npm pack --dry-run",
|
|
177
|
+
"prepack": "npm run build"
|
|
91
178
|
},
|
|
92
179
|
"peerDependencies": {
|
|
93
180
|
"react": ">=19",
|
|
@@ -104,5 +191,26 @@
|
|
|
104
191
|
"publishConfig": {
|
|
105
192
|
"access": "public",
|
|
106
193
|
"registry": "https://registry.npmjs.org/"
|
|
194
|
+
},
|
|
195
|
+
"source": "./src/index.ts",
|
|
196
|
+
"module": "./lib/module/index.js",
|
|
197
|
+
"react-native-builder-bob": {
|
|
198
|
+
"source": "src",
|
|
199
|
+
"output": "lib",
|
|
200
|
+
"targets": [
|
|
201
|
+
[
|
|
202
|
+
"commonjs",
|
|
203
|
+
{
|
|
204
|
+
"esm": true
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
[
|
|
208
|
+
"module",
|
|
209
|
+
{
|
|
210
|
+
"esm": true
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"typescript"
|
|
214
|
+
]
|
|
107
215
|
}
|
|
108
216
|
}
|