@goliapkg/sentori-expo 0.1.1 → 0.1.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.
- package/lib/index.d.ts +7 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -14
- package/lib/index.js.map +1 -1
- package/lib/release.d.ts +8 -0
- package/lib/release.d.ts.map +1 -0
- package/lib/release.js +19 -0
- package/lib/release.js.map +1 -0
- package/package.json +3 -2
- package/src/__tests__/derive-release.test.ts +1 -1
- package/src/index.ts +8 -15
- package/src/release.ts +20 -0
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InitOptions } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Drop-in init for Expo apps. Reads bundleId / version / build from
|
|
4
4
|
* `expo-application` (which is shipped in every Expo SDK) so the
|
|
@@ -23,13 +23,12 @@ import type { ExpoApplicationLike, InitOptions } from './types.js';
|
|
|
23
23
|
*/
|
|
24
24
|
export declare function initSentoriExpo(options: InitOptions): void;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* init (e.g. as a tag, log prefix, or metric label).
|
|
26
|
+
* Re-export of `deriveRelease` (defined in `./release.ts`) for
|
|
27
|
+
* callers who want to use the same `slug@version+build` string outside
|
|
28
|
+
* of init (e.g. as a tag, log prefix, or metric label). Lives in its
|
|
29
|
+
* own module so it can be unit-tested without the SDK chain pulling
|
|
30
|
+
* in `react-native`'s Flow-typed exports.
|
|
32
31
|
*/
|
|
33
|
-
export
|
|
32
|
+
export { deriveRelease } from './release.js';
|
|
34
33
|
export type { ExpoApplicationLike, InitOptions } from './types.js';
|
|
35
34
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAe1D;AAED;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAW5C,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// The Config Plugin (app.plugin.js) is loaded by Expo at prebuild
|
|
4
4
|
// time; this module is what apps import from JS at runtime.
|
|
5
5
|
import { init as initSentoriRN } from '@goliapkg/sentori-react-native';
|
|
6
|
+
import { deriveRelease } from './release.js';
|
|
6
7
|
/**
|
|
7
8
|
* Drop-in init for Expo apps. Reads bundleId / version / build from
|
|
8
9
|
* `expo-application` (which is shipped in every Expo SDK) so the
|
|
@@ -40,21 +41,13 @@ export function initSentoriExpo(options) {
|
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* init (e.g. as a tag, log prefix, or metric label).
|
|
44
|
+
* Re-export of `deriveRelease` (defined in `./release.ts`) for
|
|
45
|
+
* callers who want to use the same `slug@version+build` string outside
|
|
46
|
+
* of init (e.g. as a tag, log prefix, or metric label). Lives in its
|
|
47
|
+
* own module so it can be unit-tested without the SDK chain pulling
|
|
48
|
+
* in `react-native`'s Flow-typed exports.
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
51
|
-
if (!app)
|
|
52
|
-
return undefined;
|
|
53
|
-
const id = app.applicationId ?? app.nativeApplicationVersion ?? 'app';
|
|
54
|
-
const version = app.nativeApplicationVersion ?? '0.0.0';
|
|
55
|
-
const build = app.nativeBuildVersion ?? '0';
|
|
56
|
-
return `${id}@${version}+${build}`;
|
|
57
|
-
}
|
|
50
|
+
export { deriveRelease } from './release.js';
|
|
58
51
|
function isDev() {
|
|
59
52
|
// RN's __DEV__ is true under Metro dev server; bare false in
|
|
60
53
|
// Hermes release builds. typeof check keeps this safe to import in
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,4DAA4D;AAE5D,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,4DAA4D;AAE5D,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAG5C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,eAAe,CAAC,OAAoB;IAClD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IACrE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,2CAA2C;YACzC,uEAAuE;YACvE,yDAAyD,CAC5D,CAAA;IACH,CAAC;IACD,aAAa,CAAC;QACZ,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9D,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,iCAAiC;QACjE,OAAO;QACP,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,SAAS,KAAK;IACZ,6DAA6D;IAC7D,mEAAmE;IACnE,0CAA0C;IAC1C,OAAO,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAA;AAClD,CAAC"}
|
package/lib/release.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ExpoApplicationLike } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Build a `slug@version+build` release string from expo-application.
|
|
4
|
+
* Returns `undefined` when the module isn't available so the caller
|
|
5
|
+
* can fall back to a manually-supplied release.
|
|
6
|
+
*/
|
|
7
|
+
export declare function deriveRelease(app: ExpoApplicationLike | undefined): string | undefined;
|
|
8
|
+
//# sourceMappingURL=release.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../src/release.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,mBAAmB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAMtF"}
|
package/lib/release.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Phase 21 sub-D — pure release-derivation helper, intentionally
|
|
2
|
+
// isolated from `./index.ts` so unit tests can exercise it without
|
|
3
|
+
// pulling in `@goliapkg/sentori-react-native` (and its transitive
|
|
4
|
+
// static import of `react-native`, which Bun's test runner can't
|
|
5
|
+
// parse — RN ships Flow-typed re-exports). Index.ts re-exports it.
|
|
6
|
+
/**
|
|
7
|
+
* Build a `slug@version+build` release string from expo-application.
|
|
8
|
+
* Returns `undefined` when the module isn't available so the caller
|
|
9
|
+
* can fall back to a manually-supplied release.
|
|
10
|
+
*/
|
|
11
|
+
export function deriveRelease(app) {
|
|
12
|
+
if (!app)
|
|
13
|
+
return undefined;
|
|
14
|
+
const id = app.applicationId ?? app.nativeApplicationVersion ?? 'app';
|
|
15
|
+
const version = app.nativeApplicationVersion ?? '0.0.0';
|
|
16
|
+
const build = app.nativeBuildVersion ?? '0';
|
|
17
|
+
return `${id}@${version}+${build}`;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=release.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.js","sourceRoot":"","sources":["../src/release.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,mEAAmE;AACnE,kEAAkE;AAClE,iEAAiE;AACjE,mEAAmE;AAInE;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,GAAoC;IAChE,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAA;IAC1B,MAAM,EAAE,GAAG,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,wBAAwB,IAAI,KAAK,CAAA;IACrE,MAAM,OAAO,GAAG,GAAG,CAAC,wBAAwB,IAAI,OAAO,CAAA;IACvD,MAAM,KAAK,GAAG,GAAG,CAAC,kBAAkB,IAAI,GAAG,CAAA;IAC3C,OAAO,GAAG,EAAE,IAAI,OAAO,IAAI,KAAK,EAAE,CAAA;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goliapkg/sentori-expo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Expo adapter for Sentori \u2014 Config Plugin marker, expo-application auto-config, EAS post-build helper. Built on @goliapkg/sentori-react-native.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://sentori.golia.jp",
|
|
@@ -58,8 +58,9 @@
|
|
|
58
58
|
"@expo/config-plugins": "^9 || ^10"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
+
"@goliapkg/sentori-react-native": "workspace:*",
|
|
61
62
|
"@types/bun": "latest",
|
|
62
|
-
"typescript": "^
|
|
63
|
+
"typescript": "^6"
|
|
63
64
|
},
|
|
64
65
|
"publishConfig": {
|
|
65
66
|
"access": "public"
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { init as initSentoriRN } from '@goliapkg/sentori-react-native'
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import { deriveRelease } from './release.js'
|
|
9
|
+
import type { InitOptions } from './types.js'
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Drop-in init for Expo apps. Reads bundleId / version / build from
|
|
@@ -47,21 +48,13 @@ export function initSentoriExpo(options: InitOptions): void {
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* init (e.g. as a tag, log prefix, or metric label).
|
|
51
|
+
* Re-export of `deriveRelease` (defined in `./release.ts`) for
|
|
52
|
+
* callers who want to use the same `slug@version+build` string outside
|
|
53
|
+
* of init (e.g. as a tag, log prefix, or metric label). Lives in its
|
|
54
|
+
* own module so it can be unit-tested without the SDK chain pulling
|
|
55
|
+
* in `react-native`'s Flow-typed exports.
|
|
56
56
|
*/
|
|
57
|
-
export
|
|
58
|
-
if (!app) return undefined
|
|
59
|
-
const id =
|
|
60
|
-
app.applicationId ?? app.nativeApplicationVersion ?? 'app'
|
|
61
|
-
const version = app.nativeApplicationVersion ?? '0.0.0'
|
|
62
|
-
const build = app.nativeBuildVersion ?? '0'
|
|
63
|
-
return `${id}@${version}+${build}`
|
|
64
|
-
}
|
|
57
|
+
export { deriveRelease } from './release.js'
|
|
65
58
|
|
|
66
59
|
function isDev(): boolean {
|
|
67
60
|
// RN's __DEV__ is true under Metro dev server; bare false in
|
package/src/release.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Phase 21 sub-D — pure release-derivation helper, intentionally
|
|
2
|
+
// isolated from `./index.ts` so unit tests can exercise it without
|
|
3
|
+
// pulling in `@goliapkg/sentori-react-native` (and its transitive
|
|
4
|
+
// static import of `react-native`, which Bun's test runner can't
|
|
5
|
+
// parse — RN ships Flow-typed re-exports). Index.ts re-exports it.
|
|
6
|
+
|
|
7
|
+
import type { ExpoApplicationLike } from './types.js'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Build a `slug@version+build` release string from expo-application.
|
|
11
|
+
* Returns `undefined` when the module isn't available so the caller
|
|
12
|
+
* can fall back to a manually-supplied release.
|
|
13
|
+
*/
|
|
14
|
+
export function deriveRelease(app: ExpoApplicationLike | undefined): string | undefined {
|
|
15
|
+
if (!app) return undefined
|
|
16
|
+
const id = app.applicationId ?? app.nativeApplicationVersion ?? 'app'
|
|
17
|
+
const version = app.nativeApplicationVersion ?? '0.0.0'
|
|
18
|
+
const build = app.nativeBuildVersion ?? '0'
|
|
19
|
+
return `${id}@${version}+${build}`
|
|
20
|
+
}
|