@ankhorage/expo-runtime 2.2.0 → 2.2.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ankhorage/expo-runtime
2
2
 
3
+ ## 2.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f9a8210: Expose bundled media resolution and registry generation through a lightweight bundled-media subpath.
8
+
3
9
  ## 2.2.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # EXPO-RUNTIME
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v2.1.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v2.2.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters
9
9
 
@@ -0,0 +1,3 @@
1
+ export { type ExpoBundledMediaRegistrySourceEntry, getExpoBundledMediaRegistrySource, } from '../bundledMediaRegistrySource';
2
+ export { createExpoBundledMediaResolver, type ExpoBundledMediaRegistry, type ExpoBundledMediaResolver, type ExpoBundledMediaResolverArgs, type ExpoBundledMediaValue, resolveExpoBundledMediaAsset, } from '../bundledMediaResolver';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundledMedia/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mCAAmC,EACxC,iCAAiC,GAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,8BAA8B,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { getExpoBundledMediaRegistrySource, } from '../bundledMediaRegistrySource';
2
+ export { createExpoBundledMediaResolver, resolveExpoBundledMediaAsset, } from '../bundledMediaResolver';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bundledMedia/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iCAAiC,GAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,8BAA8B,EAK9B,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC","sourcesContent":["export {\n type ExpoBundledMediaRegistrySourceEntry,\n getExpoBundledMediaRegistrySource,\n} from '../bundledMediaRegistrySource';\nexport {\n createExpoBundledMediaResolver,\n type ExpoBundledMediaRegistry,\n type ExpoBundledMediaResolver,\n type ExpoBundledMediaResolverArgs,\n type ExpoBundledMediaValue,\n resolveExpoBundledMediaAsset,\n} from '../bundledMediaResolver';\n"]}
@@ -2,7 +2,7 @@ export function getExpoBundledMediaRegistrySource(entries) {
2
2
  const normalized = normalizeEntries(entries);
3
3
  const rows = normalized.map((entry) => ` ${JSON.stringify(entry.path)}: require(${JSON.stringify(entry.requirePath)}),`);
4
4
  return [
5
- "import type { ExpoBundledMediaRegistry } from '@ankhorage/expo-runtime';",
5
+ "import type { ExpoBundledMediaRegistry } from '@ankhorage/expo-runtime/bundled-media';",
6
6
  '',
7
7
  'declare const require: (path: string) => ExpoBundledMediaRegistry[string];',
8
8
  '',
@@ -1 +1 @@
1
- {"version":3,"file":"bundledMediaRegistrySource.js","sourceRoot":"","sources":["../src/bundledMediaRegistrySource.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,iCAAiC,CAC/C,OAAuD;IAEvD,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CACzB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAC7F,CAAC;IACF,OAAO;QACL,0EAA0E;QAC1E,EAAE;QACF,4EAA4E;QAC5E,EAAE;QACF,iEAAiE;QACjE,GAAG,IAAI;QACP,IAAI;QACJ,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,gBAAgB,CACvB,OAAuD;IAEvD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CAAC,uDAAuD,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACvF,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;SACzB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["export interface ExpoBundledMediaRegistrySourceEntry {\n readonly path: string;\n readonly requirePath: string;\n}\n\nexport function getExpoBundledMediaRegistrySource(\n entries: readonly ExpoBundledMediaRegistrySourceEntry[],\n): string {\n const normalized = normalizeEntries(entries);\n const rows = normalized.map(\n (entry) => ` ${JSON.stringify(entry.path)}: require(${JSON.stringify(entry.requirePath)}),`,\n );\n return [\n \"import type { ExpoBundledMediaRegistry } from '@ankhorage/expo-runtime';\",\n '',\n 'declare const require: (path: string) => ExpoBundledMediaRegistry[string];',\n '',\n 'export const bundledMediaRegistry: ExpoBundledMediaRegistry = {',\n ...rows,\n '};',\n '',\n ].join('\\n');\n}\n\nfunction normalizeEntries(\n entries: readonly ExpoBundledMediaRegistrySourceEntry[],\n): readonly ExpoBundledMediaRegistrySourceEntry[] {\n const byPath = new Map<string, string>();\n for (const entry of entries) {\n const existing = byPath.get(entry.path);\n if (existing !== undefined && existing !== entry.requirePath) {\n throw new Error(`Bundled media path has conflicting require targets: ${entry.path}`);\n }\n byPath.set(entry.path, entry.requirePath);\n }\n return [...byPath.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([path, requirePath]) => ({ path, requirePath }));\n}\n"]}
1
+ {"version":3,"file":"bundledMediaRegistrySource.js","sourceRoot":"","sources":["../src/bundledMediaRegistrySource.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,iCAAiC,CAC/C,OAAuD;IAEvD,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CACzB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAC7F,CAAC;IACF,OAAO;QACL,wFAAwF;QACxF,EAAE;QACF,4EAA4E;QAC5E,EAAE;QACF,iEAAiE;QACjE,GAAG,IAAI;QACP,IAAI;QACJ,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,gBAAgB,CACvB,OAAuD;IAEvD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CAAC,uDAAuD,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACvF,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;SACzB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["export interface ExpoBundledMediaRegistrySourceEntry {\n readonly path: string;\n readonly requirePath: string;\n}\n\nexport function getExpoBundledMediaRegistrySource(\n entries: readonly ExpoBundledMediaRegistrySourceEntry[],\n): string {\n const normalized = normalizeEntries(entries);\n const rows = normalized.map(\n (entry) => ` ${JSON.stringify(entry.path)}: require(${JSON.stringify(entry.requirePath)}),`,\n );\n return [\n \"import type { ExpoBundledMediaRegistry } from '@ankhorage/expo-runtime/bundled-media';\",\n '',\n 'declare const require: (path: string) => ExpoBundledMediaRegistry[string];',\n '',\n 'export const bundledMediaRegistry: ExpoBundledMediaRegistry = {',\n ...rows,\n '};',\n '',\n ].join('\\n');\n}\n\nfunction normalizeEntries(\n entries: readonly ExpoBundledMediaRegistrySourceEntry[],\n): readonly ExpoBundledMediaRegistrySourceEntry[] {\n const byPath = new Map<string, string>();\n for (const entry of entries) {\n const existing = byPath.get(entry.path);\n if (existing !== undefined && existing !== entry.requirePath) {\n throw new Error(`Bundled media path has conflicting require targets: ${entry.path}`);\n }\n byPath.set(entry.path, entry.requirePath);\n }\n return [...byPath.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([path, requirePath]) => ({ path, requirePath }));\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/expo-runtime",
3
3
  "type": "module",
4
- "version": "2.2.0",
4
+ "version": "2.2.1",
5
5
  "description": "Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters",
6
6
  "homepage": "https://github.com/ankhorage/expo-runtime#readme",
7
7
  "bugs": {
@@ -54,6 +54,13 @@
54
54
  "types": "./src/mediaPicker/index.ts",
55
55
  "import": "./dist/mediaPicker/index.js",
56
56
  "default": "./dist/mediaPicker/index.js"
57
+ },
58
+ "./bundled-media": {
59
+ "react-native": "./src/bundledMedia/index.ts",
60
+ "browser": "./src/bundledMedia/index.ts",
61
+ "types": "./src/bundledMedia/index.ts",
62
+ "import": "./dist/bundledMedia/index.js",
63
+ "default": "./dist/bundledMedia/index.js"
57
64
  }
58
65
  },
59
66
  "publishConfig": {
@@ -0,0 +1,24 @@
1
+ import type { MediaAsset } from '@ankhorage/contracts';
2
+ import { describe, expect, test } from 'bun:test';
3
+
4
+ import { createExpoBundledMediaResolver, getExpoBundledMediaRegistrySource } from './index';
5
+
6
+ describe('bundled media subpath surface', () => {
7
+ test('exposes bundled resolution without the root runtime barrel', () => {
8
+ const asset: MediaAsset = {
9
+ id: 'hero',
10
+ name: 'Hero',
11
+ kind: 'image',
12
+ source: { kind: 'bundled', path: 'assets/hero.png' },
13
+ };
14
+ expect(createExpoBundledMediaResolver({ 'assets/hero.png': 42 })({ asset })).toBe(42);
15
+ });
16
+
17
+ test('generates registry modules that import the lightweight subpath', () => {
18
+ const source = getExpoBundledMediaRegistrySource([
19
+ { path: 'assets/hero.png', requirePath: '../../assets/hero.png' },
20
+ ]);
21
+ expect(source).toContain("from '@ankhorage/expo-runtime/bundled-media'");
22
+ expect(source).not.toContain("from '@ankhorage/expo-runtime';");
23
+ });
24
+ });
@@ -0,0 +1,12 @@
1
+ export {
2
+ type ExpoBundledMediaRegistrySourceEntry,
3
+ getExpoBundledMediaRegistrySource,
4
+ } from '../bundledMediaRegistrySource';
5
+ export {
6
+ createExpoBundledMediaResolver,
7
+ type ExpoBundledMediaRegistry,
8
+ type ExpoBundledMediaResolver,
9
+ type ExpoBundledMediaResolverArgs,
10
+ type ExpoBundledMediaValue,
11
+ resolveExpoBundledMediaAsset,
12
+ } from '../bundledMediaResolver';
@@ -11,7 +11,7 @@ export function getExpoBundledMediaRegistrySource(
11
11
  (entry) => ` ${JSON.stringify(entry.path)}: require(${JSON.stringify(entry.requirePath)}),`,
12
12
  );
13
13
  return [
14
- "import type { ExpoBundledMediaRegistry } from '@ankhorage/expo-runtime';",
14
+ "import type { ExpoBundledMediaRegistry } from '@ankhorage/expo-runtime/bundled-media';",
15
15
  '',
16
16
  'declare const require: (path: string) => ExpoBundledMediaRegistry[string];',
17
17
  '',