@sigx/lynx-permissions 0.1.2 → 0.4.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Android-only infrastructure module.** Provides the shared `PermissionHelper` + `MediaCapture` classes that `@sigx/lynx-camera`, `@sigx/lynx-image-picker`, `@sigx/lynx-location`, and `@sigx/lynx-notifications` all dispatch through to show OS permission dialogs and receive Activity Result callbacks. iOS doesn't need this — `UIImagePickerController`/`CLLocationManager`/etc. handle their own prompts.
4
4
 
5
- You typically don't import this package directly — pull it in transitively by listing it after the modules that need it. Most apps that use Camera/ImagePicker/Location/Notifications will end up declaring it explicitly because the autolinker doesn't currently dedup peer requirements.
5
+ You typically don't import this package directly — install it alongside any of Camera/ImagePicker/Location/Notifications and the auto-linker wires it in.
6
6
 
7
7
  ## Install
8
8
 
@@ -10,19 +10,7 @@ You typically don't import this package directly — pull it in transitively by
10
10
  pnpm add @sigx/lynx-permissions
11
11
  ```
12
12
 
13
- ```ts
14
- // sigx.lynx.config.ts
15
- export default defineLynxConfig({
16
- modules: [
17
- '@sigx/lynx-permissions',
18
- '@sigx/lynx-camera',
19
- '@sigx/lynx-image-picker',
20
- // ...
21
- ],
22
- });
23
- ```
24
-
25
- `sigx prebuild` copies the Kotlin sources (`PermissionHelper.kt` + `MediaCapture.kt`) into your Android source tree.
13
+ `sigx prebuild` auto-discovers the package and copies the Kotlin sources (`PermissionHelper.kt` + `MediaCapture.kt`) into your Android source tree.
26
14
 
27
15
  ## How it works
28
16
 
@@ -33,7 +21,7 @@ The app template's `MainActivity.kt` reflectively wires this module on lifecycle
33
21
  - `onCreate` → `MediaCapture.register(this)` (Activity Result API launchers — must be wired before `STARTED` state)
34
22
  - `onRequestPermissionsResult` → `PermissionHelper.onRequestPermissionsResult(...)`
35
23
 
36
- The `try { Class.forName(...).getDeclaredField("INSTANCE").get(null) } catch { /* not present */ }` pattern means the wiring silently no-ops in apps that don't have this module on the classpath — so adding/removing it is a one-line change in `sigx.lynx.config.ts`.
24
+ The `try { Class.forName(...).getDeclaredField("INSTANCE").get(null) } catch { /* not present */ }` pattern means the wiring silently no-ops in apps that don't have this module on the classpath — so adding/removing it is a one-line `pnpm add`/`pnpm remove` away.
37
25
 
38
26
  ## Public API
39
27
 
@@ -7,7 +7,7 @@ import androidx.activity.ComponentActivity
7
7
  /**
8
8
  * Activity-lifecycle hook for `@sigx/lynx-permissions`.
9
9
  *
10
- * Discovered by the auto-linker via `sigx-module.json`'s
10
+ * Discovered by the auto-linker via `signalx-module.json`'s
11
11
  * `android.activityHook`. Wires the host Activity into [PermissionHelper]
12
12
  * (so runtime permission prompts can show their OS dialog) and registers
13
13
  * Activity-result launchers used by Camera + ImagePicker.
@@ -16,3 +16,4 @@
16
16
  * goes here.
17
17
  */
18
18
  export {};
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,CAAC"}
package/dist/index.js ADDED
File without changes
package/package.json CHANGED
@@ -1,19 +1,29 @@
1
1
  {
2
2
  "name": "@sigx/lynx-permissions",
3
- "version": "0.1.2",
3
+ "version": "0.4.0",
4
4
  "description": "Shared Android permission helper for sigx-lynx native modules",
5
5
  "type": "module",
6
- "main": "./src/index.ts",
7
- "types": "./src/index.ts",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
8
  "exports": {
9
- ".": "./src/index.ts",
10
- "./sigx-module.json": "./sigx-module.json"
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./signalx-module.json": "./signalx-module.json"
11
15
  },
12
16
  "files": [
13
- "src",
17
+ "dist",
14
18
  "android",
15
- "sigx-module.json"
19
+ "signalx-module.json"
16
20
  ],
21
+ "devDependencies": {
22
+ "@sigx/vite": "^0.4.3",
23
+ "@typescript/native-preview": "7.0.0-dev.20260511.1",
24
+ "typescript": "^6.0.3",
25
+ "vite": "^8.0.12"
26
+ },
17
27
  "author": "Andreas Ekdahl",
18
28
  "license": "MIT",
19
29
  "repository": {
@@ -36,5 +46,10 @@
36
46
  "ios",
37
47
  "android",
38
48
  "permissions"
39
- ]
49
+ ],
50
+ "scripts": {
51
+ "build": "vite build && tsgo --emitDeclarationOnly",
52
+ "dev": "vite build --watch",
53
+ "clean": "rm -rf dist .turbo *.tsbuildinfo"
54
+ }
40
55
  }
File without changes