@ankhorage/expo-runtime 3.2.3 → 3.2.4

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
+ ## 3.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 281a3fa: Generate Expo layout provider imports through the focused `@ankhorage/expo-runtime/providers` subpath so unrelated capability peers do not leak into generated applications.
8
+
3
9
  ## 3.2.3
4
10
 
5
11
  ### Patch 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: v3.2.1](././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: v3.2.2](././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
 
@@ -10,7 +10,7 @@ export function resolveExpoRuntimeLayoutIntegration(runtimePlan) {
10
10
  providerEnd.push('</ExpoRuntimeProviders>');
11
11
  }
12
12
  if (expoRuntimeImports.length > 0) {
13
- imports.push(`import { ${Array.from(new Set(expoRuntimeImports)).join(', ')} } from '@ankhorage/expo-runtime';`);
13
+ imports.push(`import { ${Array.from(new Set(expoRuntimeImports)).join(', ')} } from '@ankhorage/expo-runtime/providers';`);
14
14
  }
15
15
  return {
16
16
  imports,
@@ -1 +1 @@
1
- {"version":3,"file":"layoutIntegrationPlanning.js","sourceRoot":"","sources":["../src/layoutIntegrationPlanning.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,mCAAmC,CACjD,WAAwC;IAExC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,kBAAkB,GAAa,EAAE,CAAC;IACxC,MAAM,kBAAkB,GAAa,EAAE,CAAC;IACxC,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,kBAAkB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAChD,aAAa,CAAC,IAAI,CAChB,sCAAsC,CAAC,WAAW,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CACxF,CAAC;QACF,WAAW,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CACV,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,oCAAoC,CACnG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO;QACP,kBAAkB;QAClB,aAAa;QACb,WAAW;KACZ,CAAC;AACJ,CAAC","sourcesContent":["import type { ExpoRuntimePlan } from './resolveExpoRuntimePlan';\n\nexport interface ExpoRuntimeLayoutIntegrationPlan {\n readonly imports: readonly string[];\n readonly moduleDeclarations: readonly string[];\n readonly providerStart: readonly string[];\n readonly providerEnd: readonly string[];\n}\n\nexport function resolveExpoRuntimeLayoutIntegration(\n runtimePlan: ExpoRuntimePlan | undefined,\n): ExpoRuntimeLayoutIntegrationPlan {\n const imports: string[] = [];\n const expoRuntimeImports: string[] = [];\n const moduleDeclarations: string[] = [];\n const providerStart: string[] = [];\n const providerEnd: string[] = [];\n\n if ((runtimePlan?.providers.length ?? 0) > 0) {\n expoRuntimeImports.push('ExpoRuntimeProviders');\n providerStart.push(\n `<ExpoRuntimeProviders providers={['${(runtimePlan?.providers ?? []).join(\"', '\")}']}>`,\n );\n providerEnd.push('</ExpoRuntimeProviders>');\n }\n\n if (expoRuntimeImports.length > 0) {\n imports.push(\n `import { ${Array.from(new Set(expoRuntimeImports)).join(', ')} } from '@ankhorage/expo-runtime';`,\n );\n }\n\n return {\n imports,\n moduleDeclarations,\n providerStart,\n providerEnd,\n };\n}\n"]}
1
+ {"version":3,"file":"layoutIntegrationPlanning.js","sourceRoot":"","sources":["../src/layoutIntegrationPlanning.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,mCAAmC,CACjD,WAAwC;IAExC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,kBAAkB,GAAa,EAAE,CAAC;IACxC,MAAM,kBAAkB,GAAa,EAAE,CAAC;IACxC,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,kBAAkB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAChD,aAAa,CAAC,IAAI,CAChB,sCAAsC,CAAC,WAAW,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CACxF,CAAC;QACF,WAAW,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CACV,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,8CAA8C,CAC7G,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO;QACP,kBAAkB;QAClB,aAAa;QACb,WAAW;KACZ,CAAC;AACJ,CAAC","sourcesContent":["import type { ExpoRuntimePlan } from './resolveExpoRuntimePlan';\n\nexport interface ExpoRuntimeLayoutIntegrationPlan {\n readonly imports: readonly string[];\n readonly moduleDeclarations: readonly string[];\n readonly providerStart: readonly string[];\n readonly providerEnd: readonly string[];\n}\n\nexport function resolveExpoRuntimeLayoutIntegration(\n runtimePlan: ExpoRuntimePlan | undefined,\n): ExpoRuntimeLayoutIntegrationPlan {\n const imports: string[] = [];\n const expoRuntimeImports: string[] = [];\n const moduleDeclarations: string[] = [];\n const providerStart: string[] = [];\n const providerEnd: string[] = [];\n\n if ((runtimePlan?.providers.length ?? 0) > 0) {\n expoRuntimeImports.push('ExpoRuntimeProviders');\n providerStart.push(\n `<ExpoRuntimeProviders providers={['${(runtimePlan?.providers ?? []).join(\"', '\")}']}>`,\n );\n providerEnd.push('</ExpoRuntimeProviders>');\n }\n\n if (expoRuntimeImports.length > 0) {\n imports.push(\n `import { ${Array.from(new Set(expoRuntimeImports)).join(', ')} } from '@ankhorage/expo-runtime/providers';`,\n );\n }\n\n return {\n imports,\n moduleDeclarations,\n providerStart,\n providerEnd,\n };\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/expo-runtime",
3
3
  "type": "module",
4
- "version": "3.2.3",
4
+ "version": "3.2.4",
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": {
@@ -100,6 +100,13 @@
100
100
  "import": "./dist/bundledMedia/index.js",
101
101
  "default": "./dist/bundledMedia/index.js"
102
102
  },
103
+ "./providers": {
104
+ "react-native": "./src/ExpoRuntimeProviders.tsx",
105
+ "browser": "./src/ExpoRuntimeProviders.tsx",
106
+ "types": "./src/ExpoRuntimeProviders.tsx",
107
+ "import": "./dist/ExpoRuntimeProviders.js",
108
+ "default": "./dist/ExpoRuntimeProviders.js"
109
+ },
103
110
  "./barcode-scanner": {
104
111
  "react-native": "./src/barcodeScanner.ts",
105
112
  "browser": "./src/barcodeScanner.ts",
@@ -5,11 +5,16 @@ interface PackageJson {
5
5
  }
6
6
 
7
7
  describe('capability-scoped adapter entrypoints', () => {
8
- it('publishes focused barcode scanner and reader exports', async () => {
8
+ it('publishes focused provider, barcode scanner, and reader exports', async () => {
9
9
  const packageJson = (await Bun.file(
10
10
  new URL('../package.json', import.meta.url),
11
11
  ).json()) as PackageJson;
12
12
 
13
+ expect(packageJson.exports['./providers']).toMatchObject({
14
+ import: './dist/ExpoRuntimeProviders.js',
15
+ 'react-native': './src/ExpoRuntimeProviders.tsx',
16
+ types: './src/ExpoRuntimeProviders.tsx',
17
+ });
13
18
  expect(packageJson.exports['./barcode-scanner']).toMatchObject({
14
19
  import: './dist/barcodeScanner.js',
15
20
  'react-native': './src/barcodeScanner.ts',
@@ -22,6 +27,16 @@ describe('capability-scoped adapter entrypoints', () => {
22
27
  });
23
28
  });
24
29
 
30
+ it('keeps document renderer ownership out of the providers entrypoint', async () => {
31
+ const entrypoint = await Bun.file(
32
+ new URL('./ExpoRuntimeProviders.tsx', import.meta.url),
33
+ ).text();
34
+
35
+ expect(entrypoint).not.toContain('@readium/');
36
+ expect(entrypoint).not.toContain('@zip.js/zip.js');
37
+ expect(entrypoint).not.toContain('pdfjs-dist');
38
+ });
39
+
25
40
  it('keeps camera ownership out of the reader entrypoint', async () => {
26
41
  const entrypoint = await Bun.file(new URL('./reader/index.ts', import.meta.url)).text();
27
42
  const adapter = await Bun.file(
@@ -124,7 +124,7 @@ describe('combined generated App output', () => {
124
124
  'expo-camera': EXPO_PLATFORM.packages.camera.version,
125
125
  },
126
126
  layoutIntegration: {
127
- imports: ["import { ExpoRuntimeProviders } from '@ankhorage/expo-runtime';"],
127
+ imports: ["import { ExpoRuntimeProviders } from '@ankhorage/expo-runtime/providers';"],
128
128
  moduleDeclarations: [],
129
129
  providerStart: [PROVIDER_START],
130
130
  providerEnd: ['</ExpoRuntimeProviders>'],
@@ -46,7 +46,7 @@ describe('layoutIntegrationPlanning', () => {
46
46
  needsPermissionsProvider: true,
47
47
  }),
48
48
  ).toEqual({
49
- imports: ["import { ExpoRuntimeProviders } from '@ankhorage/expo-runtime';"],
49
+ imports: ["import { ExpoRuntimeProviders } from '@ankhorage/expo-runtime/providers';"],
50
50
  moduleDeclarations: [],
51
51
  providerStart: [PERMISSIONS_PROVIDER_START],
52
52
  providerEnd: ['</ExpoRuntimeProviders>'],
@@ -26,7 +26,7 @@ export function resolveExpoRuntimeLayoutIntegration(
26
26
 
27
27
  if (expoRuntimeImports.length > 0) {
28
28
  imports.push(
29
- `import { ${Array.from(new Set(expoRuntimeImports)).join(', ')} } from '@ankhorage/expo-runtime';`,
29
+ `import { ${Array.from(new Set(expoRuntimeImports)).join(', ')} } from '@ankhorage/expo-runtime/providers';`,
30
30
  );
31
31
  }
32
32