From 2025033aa2e450095e8dab31965a14be2ece7feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20L=C3=B3pez?= Date: Mon, 27 Apr 2026 11:53:35 +0200 Subject: [PATCH 1/2] feat: enhance rollup configuration and add web-specific entry point - Updated rollup configuration to support separate builds for web and common JS formats. - Added new entry point for web-specific functionality in src/index.web.ts. - Updated package.json exports to include web module paths. --- packages/react-native-tvos/package.json | 2 ++ packages/react-native-tvos/rollup.config.mjs | 28 +++++++++++++++----- packages/react-native-tvos/src/index.web.ts | 2 ++ 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 packages/react-native-tvos/src/index.web.ts diff --git a/packages/react-native-tvos/package.json b/packages/react-native-tvos/package.json index bcc900e..5ab2bcf 100644 --- a/packages/react-native-tvos/package.json +++ b/packages/react-native-tvos/package.json @@ -7,6 +7,8 @@ "types": "dist/index.d.ts", "exports": { ".": { + "react-native": "./dist/index.mjs", + "browser": "./dist/index.web.mjs", "import": "./dist/index.mjs", "require": "./dist/index.cjs", "types": "./dist/index.d.ts" diff --git a/packages/react-native-tvos/rollup.config.mjs b/packages/react-native-tvos/rollup.config.mjs index 1d9ca3f..57faaf3 100644 --- a/packages/react-native-tvos/rollup.config.mjs +++ b/packages/react-native-tvos/rollup.config.mjs @@ -4,12 +4,7 @@ import commonjs from '@rollup/plugin-commonjs'; import typescript from '@rollup/plugin-typescript'; import { defineConfig } from 'rollup'; -export default defineConfig({ - input: 'src/index.ts', - output: [ - { file: 'dist/index.mjs', format: 'es' }, - { file: 'dist/index.cjs', format: 'cjs' } - ], +const baseConfig = { external: [ '@noriginmedia/norigin-spatial-navigation-core', '@noriginmedia/norigin-spatial-navigation-react', @@ -18,4 +13,23 @@ export default defineConfig({ 'react-native' ], plugins: [resolve(), commonjs(), typescript({ tsconfig: './tsconfig.json' })] -}); +}; + +export default defineConfig([ + { + input: 'src/index.ts', + output: [ + { file: 'dist/index.mjs', format: 'es' }, + { file: 'dist/index.cjs', format: 'cjs' } + ], + ...baseConfig + }, + { + input: 'src/index.web.ts', + output: [ + { file: 'dist/index.web.mjs', format: 'es' }, + { file: 'dist/index.web.cjs', format: 'cjs' } + ], + ...baseConfig + } +]); diff --git a/packages/react-native-tvos/src/index.web.ts b/packages/react-native-tvos/src/index.web.ts new file mode 100644 index 0000000..8f44801 --- /dev/null +++ b/packages/react-native-tvos/src/index.web.ts @@ -0,0 +1,2 @@ +export { BaseWebAdapter as ReactNativeLayoutAdapter } from '@noriginmedia/norigin-spatial-navigation-core'; +export * from '@noriginmedia/norigin-spatial-navigation-react'; From ccfb18897b0286603a758a3ccb789b31b37be878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20L=C3=B3pez?= Date: Mon, 27 Apr 2026 12:18:16 +0200 Subject: [PATCH 2/2] Create hungry-donuts-wave.md --- .changeset/hungry-donuts-wave.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/hungry-donuts-wave.md diff --git a/.changeset/hungry-donuts-wave.md b/.changeset/hungry-donuts-wave.md new file mode 100644 index 0000000..2d0031c --- /dev/null +++ b/.changeset/hungry-donuts-wave.md @@ -0,0 +1,5 @@ +--- +"@noriginmedia/norigin-spatial-navigation-react-native-tvos": patch +--- + +- Add extra compatibility for web bundlers like Vite or Webpack when using with React Native Web