Skip to content

Commit

Permalink
chore(example): fix ugly import that was preventing easy copy-pasting
Browse files Browse the repository at this point in the history
  • Loading branch information
pierpo committed Nov 1, 2023
1 parent 4618249 commit 4e77dc8
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 12 deletions.
8 changes: 7 additions & 1 deletion packages/example/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['transform-class-properties'],
plugins: [
[
'babel-plugin-module-resolver',
{ alias: { 'react-tv-space-navigation': '../lib/src/index' } },
],
'transform-class-properties',
],
};
1 change: 1 addition & 0 deletions packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@types/react": "^18.0.24",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"babel-plugin-module-resolver": "^5.0.0",
"babel-plugin-react-native-web": "^0.19.6",
"file-loader": "^6.2.0",
"jest": "^29.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/components/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useIsFocused } from '@react-navigation/native';
import { ReactNode } from 'react';
import { SpatialNavigationRoot } from 'react-tv-space-navigation/src';
import { SpatialNavigationRoot } from 'react-tv-space-navigation';

type Props = { children: ReactNode };

Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/components/VirtualizedSpatialGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useTheme } from '@emotion/react';
import { useCallback } from 'react';
import { StyleSheet, View } from 'react-native';
import { SpatialNavigationVirtualizedGrid } from 'react-tv-space-navigation/src';
import { SpatialNavigationVirtualizedGrid } from 'react-tv-space-navigation';
import { programInfos } from '../modules/program/infra/programInfos';
import { ProgramNode } from '../modules/program/view/ProgramNode';
import { scaledPixels } from '../design-system/helpers/scaledPixels';
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/components/configureRemoteControl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Directions, SpatialNavigation } from 'react-tv-space-navigation/src';
import { Directions, SpatialNavigation } from 'react-tv-space-navigation';
import { SupportedKeys } from './remote-control/SupportedKeys';
import RemoteControlManager from './remote-control/RemoteControlManager';

Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/design-system/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { forwardRef } from 'react';
import { Animated, View } from 'react-native';
import { SpatialNavigationNode } from 'react-tv-space-navigation/src';
import { SpatialNavigationNode } from 'react-tv-space-navigation';
import { Typography } from './Typography';
import styled from '@emotion/native';
import { useFocusAnimation } from '../helpers/useFocusAnimation';
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/modules/program/view/ProgramList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from '@emotion/react';
import { useNavigation } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { useCallback, useMemo } from 'react';
import { SpatialNavigationVirtualizedList } from 'react-tv-space-navigation/src';
import { SpatialNavigationVirtualizedList } from 'react-tv-space-navigation';
import { RootStackParamList } from '../../../../App';
import { ProgramInfo } from '../domain/programInfo';
import { getPrograms } from '../infra/programInfos';
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/modules/program/view/ProgramNode.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SpatialNavigationNode } from 'react-tv-space-navigation/src';
import { SpatialNavigationNode } from 'react-tv-space-navigation';

import { ProgramInfo } from '../domain/programInfo';
import { Program } from './Program';
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/native';
import { DefaultFocus, SpatialNavigationScrollView } from 'react-tv-space-navigation/src';
import { DefaultFocus, SpatialNavigationScrollView } from 'react-tv-space-navigation';
import { Page } from '../components/Page';
import '../components/configureRemoteControl';
import { Box } from '../design-system/components/Box';
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/pages/ProgramDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from '@emotion/native';
import { RouteProp } from '@react-navigation/native';
import { DefaultFocus } from 'react-tv-space-navigation/src';
import { DefaultFocus } from 'react-tv-space-navigation';
import { RootStackParamList } from '../../App';
import { Page } from '../components/Page';
import { Box } from '../design-system/components/Box';
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/pages/ProgramGridPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { StyleSheet, View } from 'react-native';
import { DefaultFocus, SpatialNavigationScrollView } from 'react-tv-space-navigation/src';
import { DefaultFocus, SpatialNavigationScrollView } from 'react-tv-space-navigation';
import { Page } from '../components/Page';
import { VirtualizedSpatialGrid } from '../components/VirtualizedSpatialGrid';
import '../components/configureRemoteControl';
Expand Down
2 changes: 1 addition & 1 deletion packages/example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"paths": {
"react-tv-space-navigation": ["../core/src/*"]
"react-tv-space-navigation": ["../lib/src/index"]
}
},
"include": [
Expand Down
115 changes: 114 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4717,6 +4717,19 @@ __metadata:
languageName: node
linkType: hard

"babel-plugin-module-resolver@npm:^5.0.0":
version: 5.0.0
resolution: "babel-plugin-module-resolver@npm:5.0.0"
dependencies:
find-babel-config: ^2.0.0
glob: ^8.0.3
pkg-up: ^3.1.0
reselect: ^4.1.7
resolve: ^1.22.1
checksum: d6880e49fc8e7bac509a2c183b4303ee054a47a80032a59a6f7844bb468ebe5e333b5dc5378443afdab5839e2da2b31a6c8d9a985a0047cd076b82bb9161cc78
languageName: node
linkType: hard

"babel-plugin-polyfill-corejs2@npm:^0.4.3":
version: 0.4.3
resolution: "babel-plugin-polyfill-corejs2@npm:0.4.3"
Expand Down Expand Up @@ -7165,6 +7178,16 @@ __metadata:
languageName: node
linkType: hard

"find-babel-config@npm:^2.0.0":
version: 2.0.0
resolution: "find-babel-config@npm:2.0.0"
dependencies:
json5: ^2.1.1
path-exists: ^4.0.0
checksum: d110308b02fe6a6411a0cfb7fd50af6740fbf5093eada3d6ddacf99b07fc8eea4aa3475356484710a0032433029a21ce733bb3ef88fda1d6e35c29a3e4983014
languageName: node
linkType: hard

"find-cache-dir@npm:^2.0.0":
version: 2.1.0
resolution: "find-cache-dir@npm:2.1.0"
Expand Down Expand Up @@ -7393,6 +7416,13 @@ __metadata:
languageName: node
linkType: hard

"function-bind@npm:^1.1.2":
version: 1.1.2
resolution: "function-bind@npm:1.1.2"
checksum: 2b0ff4ce708d99715ad14a6d1f894e2a83242e4a52ccfcefaee5e40050562e5f6dafc1adbb4ce2d4ab47279a45dc736ab91ea5042d843c3c092820dfe032efb1
languageName: node
linkType: hard

"function.prototype.name@npm:^1.1.5":
version: 1.1.5
resolution: "function.prototype.name@npm:1.1.5"
Expand Down Expand Up @@ -7548,6 +7578,19 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:^8.0.3":
version: 8.1.0
resolution: "glob@npm:8.1.0"
dependencies:
fs.realpath: ^1.0.0
inflight: ^1.0.4
inherits: 2
minimatch: ^5.0.1
once: ^1.3.0
checksum: 92fbea3221a7d12075f26f0227abac435de868dd0736a17170663783296d0dd8d3d532a5672b4488a439bf5d7fb85cdd07c11185d6cd39184f0385cbdfb86a47
languageName: node
linkType: hard

"globals@npm:^11.1.0":
version: 11.12.0
resolution: "globals@npm:11.12.0"
Expand Down Expand Up @@ -7748,6 +7791,15 @@ __metadata:
languageName: node
linkType: hard

"hasown@npm:^2.0.0":
version: 2.0.0
resolution: "hasown@npm:2.0.0"
dependencies:
function-bind: ^1.1.2
checksum: 6151c75ca12554565098641c98a40f4cc86b85b0fd5b6fe92360967e4605a4f9610f7757260b4e8098dd1c2ce7f4b095f2006fe72a570e3b6d2d28de0298c176
languageName: node
linkType: hard

"he@npm:^1.2.0":
version: 1.2.0
resolution: "he@npm:1.2.0"
Expand Down Expand Up @@ -7806,6 +7858,7 @@ __metadata:
"@types/react": ^18.0.24
"@types/react-test-renderer": ^18.0.0
babel-jest: ^29.2.1
babel-plugin-module-resolver: ^5.0.0
babel-plugin-react-native-web: ^0.19.6
file-loader: ^6.2.0
jest: ^29.2.1
Expand Down Expand Up @@ -8295,6 +8348,15 @@ __metadata:
languageName: node
linkType: hard

"is-core-module@npm:^2.13.0":
version: 2.13.1
resolution: "is-core-module@npm:2.13.1"
dependencies:
hasown: ^2.0.0
checksum: 256559ee8a9488af90e4bad16f5583c6d59e92f0742e9e8bb4331e758521ee86b810b93bae44f390766ffbc518a0488b18d9dab7da9a5ff997d499efc9403f7c
languageName: node
linkType: hard

"is-data-descriptor@npm:^0.1.4":
version: 0.1.4
resolution: "is-data-descriptor@npm:0.1.4"
Expand Down Expand Up @@ -9896,7 +9958,7 @@ __metadata:
languageName: node
linkType: hard

"json5@npm:^2.1.2, json5@npm:^2.2.2":
"json5@npm:^2.1.1, json5@npm:^2.1.2, json5@npm:^2.2.2":
version: 2.2.3
resolution: "json5@npm:2.2.3"
bin:
Expand Down Expand Up @@ -10755,6 +10817,15 @@ __metadata:
languageName: node
linkType: hard

"minimatch@npm:^5.0.1":
version: 5.1.6
resolution: "minimatch@npm:5.1.6"
dependencies:
brace-expansion: ^2.0.1
checksum: 7564208ef81d7065a370f788d337cd80a689e981042cb9a1d0e6580b6c6a8c9279eba80010516e258835a988363f99f54a6f711a315089b8b42694f5da9d0d77
languageName: node
linkType: hard

"minimatch@npm:^9.0.1":
version: 9.0.2
resolution: "minimatch@npm:9.0.2"
Expand Down Expand Up @@ -11632,6 +11703,15 @@ __metadata:
languageName: node
linkType: hard

"pkg-up@npm:^3.1.0":
version: 3.1.0
resolution: "pkg-up@npm:3.1.0"
dependencies:
find-up: ^3.0.0
checksum: 5bac346b7c7c903613c057ae3ab722f320716199d753f4a7d053d38f2b5955460f3e6ab73b4762c62fd3e947f58e04f1343e92089e7bb6091c90877406fcd8c8
languageName: node
linkType: hard

"posix-character-classes@npm:^0.1.0":
version: 0.1.1
resolution: "posix-character-classes@npm:0.1.1"
Expand Down Expand Up @@ -12464,6 +12544,13 @@ __metadata:
languageName: node
linkType: hard

"reselect@npm:^4.1.7":
version: 4.1.8
resolution: "reselect@npm:4.1.8"
checksum: a4ac87cedab198769a29be92bc221c32da76cfdad6911eda67b4d3e7136dca86208c3b210e31632eae31ebd2cded18596f0dd230d3ccc9e978df22f233b5583e
languageName: node
linkType: hard

"resolve-cwd@npm:^3.0.0":
version: 3.0.0
resolution: "resolve-cwd@npm:3.0.0"
Expand Down Expand Up @@ -12521,6 +12608,19 @@ __metadata:
languageName: node
linkType: hard

"resolve@npm:^1.22.1":
version: 1.22.8
resolution: "resolve@npm:1.22.8"
dependencies:
is-core-module: ^2.13.0
path-parse: ^1.0.7
supports-preserve-symlinks-flag: ^1.0.0
bin:
resolve: bin/resolve
checksum: f8a26958aa572c9b064562750b52131a37c29d072478ea32e129063e2da7f83e31f7f11e7087a18225a8561cfe8d2f0df9dbea7c9d331a897571c0a2527dbb4c
languageName: node
linkType: hard

"resolve@npm:^2.0.0-next.4":
version: 2.0.0-next.4
resolution: "resolve@npm:2.0.0-next.4"
Expand All @@ -12547,6 +12647,19 @@ __metadata:
languageName: node
linkType: hard

"resolve@patch:resolve@^1.22.1#~builtin<compat/resolve>":
version: 1.22.8
resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin<compat/resolve>::version=1.22.8&hash=c3c19d"
dependencies:
is-core-module: ^2.13.0
path-parse: ^1.0.7
supports-preserve-symlinks-flag: ^1.0.0
bin:
resolve: bin/resolve
checksum: 5479b7d431cacd5185f8db64bfcb7286ae5e31eb299f4c4f404ad8aa6098b77599563ac4257cb2c37a42f59dfc06a1bec2bcf283bb448f319e37f0feb9a09847
languageName: node
linkType: hard

"resolve@patch:resolve@^2.0.0-next.4#~builtin<compat/resolve>":
version: 2.0.0-next.4
resolution: "resolve@patch:resolve@npm%3A2.0.0-next.4#~builtin<compat/resolve>::version=2.0.0-next.4&hash=c3c19d"
Expand Down

0 comments on commit 4e77dc8

Please sign in to comment.