@ankhorage/expo-runtime 7.0.1 → 7.0.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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/bundledMediaRegistrySource.d.ts.map +1 -1
- package/dist/bundledMediaRegistrySource.js +10 -4
- package/dist/bundledMediaRegistrySource.js.map +1 -1
- package/dist/platform.js +3 -3
- package/dist/platform.js.map +1 -1
- package/package.json +4 -4
- package/src/bundledMediaRegistrySource.test.ts +58 -2
- package/src/bundledMediaRegistrySource.ts +12 -4
- package/src/platform.test.ts +3 -3
- package/src/platform.ts +3 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# EXPO-RUNTIME
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters
|
|
9
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundledMediaRegistrySource.d.ts","sourceRoot":"","sources":["../src/bundledMediaRegistrySource.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,SAAS,mCAAmC,EAAE,GACtD,MAAM,
|
|
1
|
+
{"version":3,"file":"bundledMediaRegistrySource.d.ts","sourceRoot":"","sources":["../src/bundledMediaRegistrySource.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,SAAS,mCAAmC,EAAE,GACtD,MAAM,CAkBR"}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
export function getExpoBundledMediaRegistrySource(entries) {
|
|
2
2
|
const normalized = normalizeEntries(entries);
|
|
3
|
-
const rows = normalized.map((entry) => ` ${
|
|
3
|
+
const rows = normalized.map((entry) => ` ${toExpoBundledMediaRegistrySourceLiteral(entry.path)}: require(${toExpoBundledMediaRegistrySourceLiteral(entry.requirePath)}),`);
|
|
4
|
+
const registry = normalized.length === 0
|
|
5
|
+
? ['export const bundledMediaRegistry: ExpoBundledMediaRegistry = {};']
|
|
6
|
+
: ['export const bundledMediaRegistry: ExpoBundledMediaRegistry = {', ...rows, '};'];
|
|
4
7
|
return [
|
|
5
8
|
"import type { ExpoBundledMediaRegistry } from '@ankhorage/expo-runtime/bundled-media';",
|
|
6
9
|
'',
|
|
7
10
|
'declare const require: (path: string) => ExpoBundledMediaRegistry[string];',
|
|
8
11
|
'',
|
|
9
|
-
|
|
10
|
-
...rows,
|
|
11
|
-
'};',
|
|
12
|
+
...registry,
|
|
12
13
|
'',
|
|
13
14
|
].join('\n');
|
|
14
15
|
}
|
|
16
|
+
function toExpoBundledMediaRegistrySourceLiteral(value) {
|
|
17
|
+
if (/[\\'\n\r\t\b\f]/u.test(value))
|
|
18
|
+
return JSON.stringify(value);
|
|
19
|
+
return `'${value}'`;
|
|
20
|
+
}
|
|
15
21
|
function normalizeEntries(entries) {
|
|
16
22
|
const byPath = new Map();
|
|
17
23
|
for (const entry of entries) {
|
|
@@ -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,
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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) =>\n ` ${toExpoBundledMediaRegistrySourceLiteral(entry.path)}: require(${toExpoBundledMediaRegistrySourceLiteral(entry.requirePath)}),`,\n );\n const registry =\n normalized.length === 0\n ? ['export const bundledMediaRegistry: ExpoBundledMediaRegistry = {};']\n : ['export const bundledMediaRegistry: ExpoBundledMediaRegistry = {', ...rows, '};'];\n return [\n \"import type { ExpoBundledMediaRegistry } from '@ankhorage/expo-runtime/bundled-media';\",\n '',\n 'declare const require: (path: string) => ExpoBundledMediaRegistry[string];',\n '',\n ...registry,\n '',\n ].join('\\n');\n}\n\nfunction toExpoBundledMediaRegistrySourceLiteral(value: string): string {\n if (/[\\\\'\\n\\r\\t\\b\\f]/u.test(value)) return JSON.stringify(value);\n return `'${value}'`;\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/dist/platform.js
CHANGED
|
@@ -12,7 +12,7 @@ export const EXPO_PLATFORM = {
|
|
|
12
12
|
sdk: 57,
|
|
13
13
|
architecture: 'new-architecture-only',
|
|
14
14
|
runtime: {
|
|
15
|
-
expo: definePackage('expo', '57.0.
|
|
15
|
+
expo: definePackage('expo', '57.0.31'),
|
|
16
16
|
react: definePackage('react', '19.2.3'),
|
|
17
17
|
reactDom: definePackage('react-dom', '19.2.3'),
|
|
18
18
|
reactNative: definePackage('react-native', '0.86.3'),
|
|
@@ -29,7 +29,7 @@ export const EXPO_PLATFORM = {
|
|
|
29
29
|
expoDoctor: definePackage('expo-doctor', '1.20.4'),
|
|
30
30
|
},
|
|
31
31
|
navigation: {
|
|
32
|
-
expoRouter: definePackage('expo-router', '~57.0.
|
|
32
|
+
expoRouter: definePackage('expo-router', '~57.0.29'),
|
|
33
33
|
screens: definePackage('react-native-screens', '~4.26.0'),
|
|
34
34
|
safeArea: definePackage('react-native-safe-area-context', '~5.7.0'),
|
|
35
35
|
},
|
|
@@ -64,7 +64,7 @@ export const EXPO_PLATFORM = {
|
|
|
64
64
|
linearGradient: definePackage('expo-linear-gradient', '~57.0.2'),
|
|
65
65
|
linking: definePackage('expo-linking', '~57.0.13'),
|
|
66
66
|
localization: definePackage('expo-localization', '~57.0.2'),
|
|
67
|
-
location: definePackage('expo-location', '~57.0.
|
|
67
|
+
location: definePackage('expo-location', '~57.0.22'),
|
|
68
68
|
mediaLibrary: definePackage('expo-media-library', '~57.0.5'),
|
|
69
69
|
notifications: definePackage('expo-notifications', '~57.0.23'),
|
|
70
70
|
secureStore: definePackage('expo-secure-store', '~57.0.4'),
|
package/dist/platform.js.map
CHANGED
|
@@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AAE,UAAU,CAAC;QAClD,YAAY,EAAE,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC;QAC3D,QAAQ,EAAE,aAAa,CAAC,eAAe,EAAE,UAAU,CAAC;QACpD,YAAY,EAAE,aAAa,CAAC,oBAAoB,EAAE,SAAS,CAAC;QAC5D,aAAa,EAAE,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC;QAC9D,WAAW,EAAE,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC;QAC1D,YAAY,EAAE,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC;QAC7D,SAAS,EAAE,aAAa,CAAC,iBAAiB,EAAE,SAAS,CAAC;QACtD,OAAO,EAAE,aAAa,CAAC,cAAc,EAAE,UAAU,CAAC;QAClD,UAAU,EAAE,aAAa,CAAC,kBAAkB,EAAE,SAAS,CAAC;KACzD;IACD,SAAS,EAAE;QACT,OAAO,EAAE;YACP,cAAc,EAAE,CAAC;YACjB,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,IAAI;SACjB;QACD,GAAG,EAAE;YACH,cAAc,EAAE,MAAM;YACtB,mBAAmB,EAAE,MAAM;SAC5B;KACF;CACO,CAAC","sourcesContent":["export interface ExpoPlatformPackage {\n readonly name: string;\n readonly version: string;\n}\n\nfunction definePackage(name: string, version: string): ExpoPlatformPackage {\n return { name, version };\n}\n\n/**\n * The canonical Ankhorage projection of the supported Expo platform.\n *\n * Package versions come from Expo SDK 57's bundled native module map. Keep this\n * structure as the only hand-maintained Expo compatibility authority in this\n * repository; generated manifests and runtime planning derive from it.\n */\nexport const EXPO_PLATFORM = {\n sdk: 57,\n architecture: 'new-architecture-only',\n runtime: {\n expo: definePackage('expo', '57.0.
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAKA,SAAS,aAAa,CAAC,IAAY,EAAE,OAAe;IAClD,OAAO,EAA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AAE,aAAa,CAAC,oBAAoB,EAAE,SAAS,CAAC;QAC5D,aAAa,EAAE,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC;QAC9D,WAAW,EAAE,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC;QAC1D,YAAY,EAAE,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC;QAC7D,SAAS,EAAE,aAAa,CAAC,iBAAiB,EAAE,SAAS,CAAC;QACtD,OAAO,EAAE,aAAa,CAAC,cAAc,EAAE,UAAU,CAAC;QAClD,UAAU,EAAE,aAAa,CAAC,kBAAkB,EAAE,SAAS,CAAC;KACzD;IACD,SAAS,EAAE;QACT,OAAO,EAAE;YACP,cAAc,EAAE,CAAC;YACjB,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,IAAI;SACjB;QACD,GAAG,EAAE;YACH,cAAc,EAAE,MAAM;YACtB,mBAAmB,EAAE,MAAM;SAC5B;KACF;CACO,CAAC","sourcesContent":["export interface ExpoPlatformPackage {\n readonly name: string;\n readonly version: string;\n}\n\nfunction definePackage(name: string, version: string): ExpoPlatformPackage {\n return { name, version };\n}\n\n/**\n * The canonical Ankhorage projection of the supported Expo platform.\n *\n * Package versions come from Expo SDK 57's bundled native module map. Keep this\n * structure as the only hand-maintained Expo compatibility authority in this\n * repository; generated manifests and runtime planning derive from it.\n */\nexport const EXPO_PLATFORM = {\n sdk: 57,\n architecture: 'new-architecture-only',\n runtime: {\n expo: definePackage('expo', '57.0.31'),\n react: definePackage('react', '19.2.3'),\n reactDom: definePackage('react-dom', '19.2.3'),\n reactNative: definePackage('react-native', '0.86.3'),\n reactNativeWeb: definePackage('react-native-web', '~0.21.3'),\n },\n tooling: {\n node: {\n lts: 24,\n version: '24.x',\n },\n nodeTypes: definePackage('@types/node', '^24.13.3'),\n reactTypes: definePackage('@types/react', '~19.2.4'),\n typescript: definePackage('typescript', '~6.0.3'),\n expoDoctor: definePackage('expo-doctor', '1.20.4'),\n },\n navigation: {\n expoRouter: definePackage('expo-router', '~57.0.29'),\n screens: definePackage('react-native-screens', '~4.26.0'),\n safeArea: definePackage('react-native-safe-area-context', '~5.7.0'),\n },\n animation: {\n reanimated: definePackage('react-native-reanimated', '4.5.1'),\n worklets: definePackage('react-native-worklets', '0.10.1'),\n gestureHandler: definePackage('react-native-gesture-handler', '~2.32.0'),\n },\n ui: {\n svg: definePackage('react-native-svg', '15.15.4'),\n iconProviders: {\n Ionicons: definePackage('@react-native-vector-icons/ionicons', '^13.1.4'),\n FontAwesome: definePackage('@react-native-vector-icons/fontawesome', '^13.1.4'),\n FontAwesome5: definePackage('@react-native-vector-icons/fontawesome5', '^13.1.4'),\n FontAwesome6: definePackage('@react-native-vector-icons/fontawesome6', '^13.1.4'),\n MaterialDesignIcons: definePackage(\n '@react-native-vector-icons/material-design-icons',\n '^13.1.4',\n ),\n },\n },\n packages: {\n metroRuntime: definePackage('@expo/metro-runtime', '~57.0.17'),\n asset: definePackage('expo-asset', '~57.0.20'),\n audio: definePackage('expo-audio', '~57.0.5'),\n authSession: definePackage('expo-auth-session', '~57.0.16'),\n camera: definePackage('expo-camera', '~57.0.6'),\n constants: definePackage('expo-constants', '~57.0.22'),\n crypto: definePackage('expo-crypto', '~57.0.4'),\n devClient: definePackage('expo-dev-client', '~57.0.20'),\n documentPicker: definePackage('expo-document-picker', '~57.0.3'),\n fileSystem: definePackage('expo-file-system', '~57.0.7'),\n font: definePackage('expo-font', '~57.0.4'),\n imagePicker: definePackage('expo-image-picker', '~57.0.20'),\n linearGradient: definePackage('expo-linear-gradient', '~57.0.2'),\n linking: definePackage('expo-linking', '~57.0.13'),\n localization: definePackage('expo-localization', '~57.0.2'),\n location: definePackage('expo-location', '~57.0.22'),\n mediaLibrary: definePackage('expo-media-library', '~57.0.5'),\n notifications: definePackage('expo-notifications', '~57.0.23'),\n secureStore: definePackage('expo-secure-store', '~57.0.4'),\n splashScreen: definePackage('expo-splash-screen', '~57.0.10'),\n statusBar: definePackage('expo-status-bar', '~57.0.1'),\n updates: definePackage('expo-updates', '~57.0.26'),\n webBrowser: definePackage('expo-web-browser', '~57.0.3'),\n },\n platforms: {\n android: {\n minimumVersion: 7,\n minimumApiLevel: 24,\n compileSdk: 36,\n targetSdk: 36,\n edgeToEdge: true,\n },\n ios: {\n minimumVersion: '16.4',\n minimumXcodeVersion: '26.4',\n },\n },\n} as const;\n\nexport type ExpoPlatform = typeof EXPO_PLATFORM;\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/expo-runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.2",
|
|
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": {
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
"@react-native-vector-icons/fontawesome6": "^13.1.4",
|
|
191
191
|
"@react-native-vector-icons/ionicons": "^13.1.4",
|
|
192
192
|
"@react-native-vector-icons/material-design-icons": "^13.1.4",
|
|
193
|
-
"expo": "57.0.
|
|
193
|
+
"expo": "57.0.31",
|
|
194
194
|
"expo-camera": "~57.0.6",
|
|
195
195
|
"expo-constants": "~57.0.22",
|
|
196
196
|
"expo-document-picker": "~57.0.3",
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
}
|
|
252
252
|
},
|
|
253
253
|
"devDependencies": {
|
|
254
|
-
"@ankhorage/devtools": "^2.3.
|
|
254
|
+
"@ankhorage/devtools": "^2.3.21",
|
|
255
255
|
"@ankhorage/paradox": "^0.2.27",
|
|
256
256
|
"@ankhorage/permissions": "^0.2.63",
|
|
257
257
|
"@ankhorage/zora": "^25.8.3",
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
"@types/pngjs": "^6.0.5",
|
|
266
266
|
"@types/react": "~19.2.18",
|
|
267
267
|
"bwip-js": "^4.11.4",
|
|
268
|
-
"expo": "57.0.
|
|
268
|
+
"expo": "57.0.31",
|
|
269
269
|
"expo-camera": "~57.0.6",
|
|
270
270
|
"expo-constants": "~57.0.22",
|
|
271
271
|
"expo-document-picker": "~57.0.3",
|
|
@@ -1,8 +1,60 @@
|
|
|
1
|
+
import { mkdtemp, rm } from 'node:fs/promises';
|
|
2
|
+
import { tmpdir } from 'node:os';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
1
6
|
import { describe, expect, test } from 'bun:test';
|
|
2
7
|
|
|
3
8
|
import { getExpoBundledMediaRegistrySource } from './bundledMediaRegistrySource';
|
|
4
9
|
|
|
10
|
+
const repositoryRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
11
|
+
|
|
12
|
+
async function expectGeneratedRegistryPassesFormatter(): Promise<void> {
|
|
13
|
+
const fixtureDirectory = await mkdtemp(join(tmpdir(), 'expo-bundled-media-registry-'));
|
|
14
|
+
const registryPath = join(fixtureDirectory, 'bundledMediaRegistry.ts');
|
|
15
|
+
await Bun.write(
|
|
16
|
+
registryPath,
|
|
17
|
+
getExpoBundledMediaRegistrySource([
|
|
18
|
+
{ path: 'assets/zebra.png', requirePath: '../../assets/zebra.png' },
|
|
19
|
+
{ path: 'assets/ant.png', requirePath: '../../assets/ant.png' },
|
|
20
|
+
{ path: 'assets/bear.png', requirePath: '../../assets/bear.png' },
|
|
21
|
+
]),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const formatter = Bun.spawn(
|
|
26
|
+
[
|
|
27
|
+
'./node_modules/.bin/ankhorage-prettier',
|
|
28
|
+
'--check',
|
|
29
|
+
'--config',
|
|
30
|
+
'.prettierrc.js',
|
|
31
|
+
registryPath,
|
|
32
|
+
],
|
|
33
|
+
{ cwd: repositoryRoot, stderr: 'pipe', stdout: 'pipe' },
|
|
34
|
+
);
|
|
35
|
+
expect(await formatter.exited).toBe(0);
|
|
36
|
+
} finally {
|
|
37
|
+
await rm(fixtureDirectory, { recursive: true, force: true });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
5
41
|
describe('Expo bundled media registry source', () => {
|
|
42
|
+
test('renders an empty registry', () => {
|
|
43
|
+
expect(getExpoBundledMediaRegistrySource([])).toBe(
|
|
44
|
+
"import type { ExpoBundledMediaRegistry } from '@ankhorage/expo-runtime/bundled-media';\n\n" +
|
|
45
|
+
'declare const require: (path: string) => ExpoBundledMediaRegistry[string];\n\n' +
|
|
46
|
+
'export const bundledMediaRegistry: ExpoBundledMediaRegistry = {};\n',
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('renders a single static require literal', () => {
|
|
51
|
+
expect(
|
|
52
|
+
getExpoBundledMediaRegistrySource([
|
|
53
|
+
{ path: 'assets/ant.png', requirePath: '../../assets/ant.png' },
|
|
54
|
+
]),
|
|
55
|
+
).toContain("'assets/ant.png': require('../../assets/ant.png')");
|
|
56
|
+
});
|
|
57
|
+
|
|
6
58
|
test('renders sorted static require literals and deduplicates identical entries', () => {
|
|
7
59
|
const source = getExpoBundledMediaRegistrySource([
|
|
8
60
|
{ path: 'assets/z.png', requirePath: '../../assets/z.png' },
|
|
@@ -10,8 +62,8 @@ describe('Expo bundled media registry source', () => {
|
|
|
10
62
|
{ path: 'assets/a.png', requirePath: '../../assets/a.png' },
|
|
11
63
|
]);
|
|
12
64
|
expect(source.indexOf('assets/a.png')).toBeLessThan(source.indexOf('assets/z.png'));
|
|
13
|
-
expect(source.match(/require\(
|
|
14
|
-
expect(source).toContain(
|
|
65
|
+
expect(source.match(/require\('\.\.\/\.\.\/assets\/a\.png'\)/g)?.length).toBe(1);
|
|
66
|
+
expect(source).toContain("require('../../assets/z.png')");
|
|
15
67
|
});
|
|
16
68
|
|
|
17
69
|
test('rejects one canonical path mapped to different files', () => {
|
|
@@ -22,4 +74,8 @@ describe('Expo bundled media registry source', () => {
|
|
|
22
74
|
]),
|
|
23
75
|
).toThrow('conflicting require targets');
|
|
24
76
|
});
|
|
77
|
+
|
|
78
|
+
test('writes a multi-entry registry that passes the repository formatter without modification', async () => {
|
|
79
|
+
await expectGeneratedRegistryPassesFormatter();
|
|
80
|
+
});
|
|
25
81
|
});
|
|
@@ -8,20 +8,28 @@ export function getExpoBundledMediaRegistrySource(
|
|
|
8
8
|
): string {
|
|
9
9
|
const normalized = normalizeEntries(entries);
|
|
10
10
|
const rows = normalized.map(
|
|
11
|
-
(entry) =>
|
|
11
|
+
(entry) =>
|
|
12
|
+
` ${toExpoBundledMediaRegistrySourceLiteral(entry.path)}: require(${toExpoBundledMediaRegistrySourceLiteral(entry.requirePath)}),`,
|
|
12
13
|
);
|
|
14
|
+
const registry =
|
|
15
|
+
normalized.length === 0
|
|
16
|
+
? ['export const bundledMediaRegistry: ExpoBundledMediaRegistry = {};']
|
|
17
|
+
: ['export const bundledMediaRegistry: ExpoBundledMediaRegistry = {', ...rows, '};'];
|
|
13
18
|
return [
|
|
14
19
|
"import type { ExpoBundledMediaRegistry } from '@ankhorage/expo-runtime/bundled-media';",
|
|
15
20
|
'',
|
|
16
21
|
'declare const require: (path: string) => ExpoBundledMediaRegistry[string];',
|
|
17
22
|
'',
|
|
18
|
-
|
|
19
|
-
...rows,
|
|
20
|
-
'};',
|
|
23
|
+
...registry,
|
|
21
24
|
'',
|
|
22
25
|
].join('\n');
|
|
23
26
|
}
|
|
24
27
|
|
|
28
|
+
function toExpoBundledMediaRegistrySourceLiteral(value: string): string {
|
|
29
|
+
if (/[\\'\n\r\t\b\f]/u.test(value)) return JSON.stringify(value);
|
|
30
|
+
return `'${value}'`;
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
function normalizeEntries(
|
|
26
34
|
entries: readonly ExpoBundledMediaRegistrySourceEntry[],
|
|
27
35
|
): readonly ExpoBundledMediaRegistrySourceEntry[] {
|
package/src/platform.test.ts
CHANGED
|
@@ -32,15 +32,15 @@ describe('EXPO_PLATFORM', () => {
|
|
|
32
32
|
expect(EXPO_PLATFORM.tooling.expoDoctor.name).toBe('expo-doctor');
|
|
33
33
|
expect(EXPO_PLATFORM.tooling.reactTypes.name).toBe('@types/react');
|
|
34
34
|
expect(EXPO_PLATFORM.animation.worklets.name).toBe('react-native-worklets');
|
|
35
|
-
expect(EXPO_PLATFORM.runtime.expo.version).toBe('57.0.
|
|
36
|
-
expect(EXPO_PLATFORM.navigation.expoRouter.version).toBe('~57.0.
|
|
35
|
+
expect(EXPO_PLATFORM.runtime.expo.version).toBe('57.0.31');
|
|
36
|
+
expect(EXPO_PLATFORM.navigation.expoRouter.version).toBe('~57.0.29');
|
|
37
37
|
expect(EXPO_PLATFORM.packages.linking.version).toBe('~57.0.13');
|
|
38
38
|
expect(EXPO_PLATFORM.packages.metroRuntime.version).toBe('~57.0.17');
|
|
39
39
|
expect(EXPO_PLATFORM.packages.constants.version).toBe('~57.0.22');
|
|
40
40
|
expect(EXPO_PLATFORM.packages.asset.version).toBe('~57.0.20');
|
|
41
41
|
expect(EXPO_PLATFORM.packages.authSession.version).toBe('~57.0.16');
|
|
42
42
|
expect(EXPO_PLATFORM.packages.imagePicker.version).toBe('~57.0.20');
|
|
43
|
-
expect(EXPO_PLATFORM.packages.location.version).toBe('~57.0.
|
|
43
|
+
expect(EXPO_PLATFORM.packages.location.version).toBe('~57.0.22');
|
|
44
44
|
expect(EXPO_PLATFORM.packages.notifications.version).toBe('~57.0.23');
|
|
45
45
|
expect(EXPO_PLATFORM.packages.updates.version).toBe('~57.0.26');
|
|
46
46
|
});
|
package/src/platform.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const EXPO_PLATFORM = {
|
|
|
18
18
|
sdk: 57,
|
|
19
19
|
architecture: 'new-architecture-only',
|
|
20
20
|
runtime: {
|
|
21
|
-
expo: definePackage('expo', '57.0.
|
|
21
|
+
expo: definePackage('expo', '57.0.31'),
|
|
22
22
|
react: definePackage('react', '19.2.3'),
|
|
23
23
|
reactDom: definePackage('react-dom', '19.2.3'),
|
|
24
24
|
reactNative: definePackage('react-native', '0.86.3'),
|
|
@@ -35,7 +35,7 @@ export const EXPO_PLATFORM = {
|
|
|
35
35
|
expoDoctor: definePackage('expo-doctor', '1.20.4'),
|
|
36
36
|
},
|
|
37
37
|
navigation: {
|
|
38
|
-
expoRouter: definePackage('expo-router', '~57.0.
|
|
38
|
+
expoRouter: definePackage('expo-router', '~57.0.29'),
|
|
39
39
|
screens: definePackage('react-native-screens', '~4.26.0'),
|
|
40
40
|
safeArea: definePackage('react-native-safe-area-context', '~5.7.0'),
|
|
41
41
|
},
|
|
@@ -73,7 +73,7 @@ export const EXPO_PLATFORM = {
|
|
|
73
73
|
linearGradient: definePackage('expo-linear-gradient', '~57.0.2'),
|
|
74
74
|
linking: definePackage('expo-linking', '~57.0.13'),
|
|
75
75
|
localization: definePackage('expo-localization', '~57.0.2'),
|
|
76
|
-
location: definePackage('expo-location', '~57.0.
|
|
76
|
+
location: definePackage('expo-location', '~57.0.22'),
|
|
77
77
|
mediaLibrary: definePackage('expo-media-library', '~57.0.5'),
|
|
78
78
|
notifications: definePackage('expo-notifications', '~57.0.23'),
|
|
79
79
|
secureStore: definePackage('expo-secure-store', '~57.0.4'),
|