Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ android/keystores/debug.keystore
# This Project
coverage
lib

# Claude
.claude
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
bracketSpacing: true,
jsxBracketSameLine: true,
bracketSameLine: true,
singleQuote: true,
trailingComma: 'none',
};
38 changes: 0 additions & 38 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

55 changes: 0 additions & 55 deletions .yarn/releases/yarn-2.3.2.cjs

This file was deleted.

942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.12.0.cjs

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
compressionLevel: mixed

enableGlobalCache: true

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-2.3.2.cjs
yarnPath: .yarn/releases/yarn-4.12.0.cjs
2 changes: 1 addition & 1 deletion acceptance/ersatz-testing/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
presets: [
'module:metro-react-native-babel-preset',
'module:@react-native/babel-preset',
'@babel/preset-typescript'
],
plugins: ['@babel/plugin-transform-react-jsx'],
Expand Down
5 changes: 4 additions & 1 deletion acceptance/ersatz-testing/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
preset: 'react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'node'],
testRegex: 'src/.*\\.test\\.tsx?$'
testRegex: 'src/.*\\.test\\.tsx?$',
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native|@react-native(-community)?|node-fetch|fetch-blob|data-uri-to-buffer|formdata-polyfill)/)'
]
};
38 changes: 19 additions & 19 deletions acceptance/ersatz-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
"dependencies": {
"@formidable-webview/ersatz": "workspace:*",
"@formidable-webview/ersatz-testing": "workspace:*",
"@testing-library/react-native": "^7.0.2",
"jest": "^26.5.2",
"react": "16.13.1",
"react-native": "^0.63.3",
"react-native-webview": "^10.9.2",
"react-test-renderer": "16.13.1"
"@testing-library/react-native": "^13.3.3",
"jest": "^30.3.0",
"react": "19.2.0",
"react-native": "0.83.2",
"react-native-webview": "13.16.0",
"react-test-renderer": "19.2.0"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/core": "^7.11.6",
"@babel/plugin-transform-react-jsx": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"@babel/runtime": "^7.11.2",
"@react-native-community/bob": "^0.16.2",
"@types/jest": "^26.0.14",
"@types/react": "^16.9.51",
"@types/react-native": "^0.63.25",
"@types/react-test-renderer": "^16.9.3",
"babel-jest": "^26.5.2",
"metro-react-native-babel-preset": "^0.63.0",
"typescript": "~3.9.7"
"@babel/cli": "^7.28.6",
"@babel/core": "^7.29.0",
"@babel/plugin-transform-react-jsx": "^7.28.6",
"@babel/preset-typescript": "^7.28.5",
"@babel/runtime": "^7.29.2",
"@react-native/babel-preset": "^0.84.1",
"@types/jest": "^30.0.0",
"@types/react": "^19.2.14",
"@types/react-native": "^0.73.0",
"@types/react-test-renderer": "^19.1.0",
"babel-jest": "^30.3.0",
"react-native-builder-bob": "^0.40.18",
"typescript": "~5.9.2"
}
}
15 changes: 7 additions & 8 deletions acceptance/web-app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/* eslint-disable react-native/no-inline-styles */
import 'react-native-gesture-handler';
import Constants from 'expo-constants';
import React from 'react';
import { Button, Dimensions, StyleSheet, Text, View } from 'react-native';
import { VisualTest, VisualTestProps } from './src/VisualTest';
import { NavigationContainer, useNavigation } from '@react-navigation/native';
import {
NavigationContainer,
NavigationProp,
useNavigation
} from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { FlatList } from 'react-native-gesture-handler';

Expand Down Expand Up @@ -66,11 +69,7 @@ const examples: VisualTestProps[] = [
height: 320,
width: 320
},
scrollView: true,
extraProps: {
// sandbox: "allow-same-origin",
seamlessEnabled: true
}
scrollView: true
},
{
title: 'HTML in View',
Expand Down Expand Up @@ -146,7 +145,7 @@ const examples: VisualTestProps[] = [
];

function HomeScreen() {
const navigation = useNavigation();
const navigation = useNavigation<NavigationProp<Record<string, undefined>>>();
return (
<FlatList
data={examples}
Expand Down
4 changes: 1 addition & 3 deletions acceptance/web-app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
},
Expand Down
39 changes: 18 additions & 21 deletions acceptance/web-app/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { getDefaultConfig } = require('expo/metro-config');
// eslint-disable-next-line @typescript-eslint/no-require-imports
const path = require('path');

const workspacePackagesPath = path.resolve(__dirname, '../../packages');
const projectRoot = __dirname;
const monorepoRoot = path.resolve(projectRoot, '../..');

module.exports = {
projectRoot: __dirname,
watchFolders: [workspacePackagesPath],
resolver: {
extraNodeModules: new Proxy(
{},
{
get: (target, name) => path.join(__dirname, `node_modules/${name}`)
}
)
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true
}
})
}
};
const config = getDefaultConfig(projectRoot);

// Watch the monorepo root so Metro picks up workspace package changes
config.watchFolders = [...(config.watchFolders ?? []), monorepoRoot];

// Resolve modules from the app's node_modules first, then the monorepo root.
// This ensures react-native@0.79.3 (web-app) is used instead of @0.84.1 (root).
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(monorepoRoot, 'node_modules')
];

module.exports = config;
38 changes: 18 additions & 20 deletions acceptance/web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,27 @@
},
"dependencies": {
"@formidable-webview/web": "workspace:*",
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/native": "^5.7.6",
"@react-navigation/stack": "^5.9.3",
"expo": "~39.0.2",
"expo-status-bar": "~1.0.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz",
"react-native-gesture-handler": "~1.7.0",
"react-native-reanimated": "~1.13.0",
"react-native-safe-area-context": "3.1.4",
"react-native-screens": "~2.10.1",
"react-native-web": "~0.13.12",
"@react-native-masked-view/masked-view": "^0.3.2",
"@react-navigation/native": "^7.2.0",
"@react-navigation/stack": "^7.8.7",
"expo": "~55.0.8",
"expo-status-bar": "~55.0.4",
"react": "19.2.0",
"react-dom": "19.2.0",
"react-native": "0.83.2",
"react-native-gesture-handler": "^2.30.0",
"react-native-reanimated": "4.2.1",
"react-native-safe-area-context": "~5.6.2",
"react-native-screens": "~4.23.0",
"react-native-web": "^0.21.2",
"react-native-web-webview": "^1.0.2",
"react-native-webview": "10.7.0"
"react-native-webview": "13.16.0",
"react-native-worklets": "0.7.2"
},
"devDependencies": {
"@expo/webpack-config": "^0.12.38",
"@types/react": "~16.9.35",
"@types/react-dom": "~16.9.8",
"@types/react-native": "~0.63.2",
"react-native-web": "~0.13.7",
"typescript": "~3.9.5"
"@types/react": "^19.2.14",
"@types/react-dom": "~19.1.7",
"typescript": "~5.9.2"
},
"private": true,
"installConfig": {
Expand Down
20 changes: 9 additions & 11 deletions acceptance/web-app/src/VisualTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { useMemo } from 'react';
import {
StyleProp,
ViewStyle,
SafeAreaView,
ScrollView,
StyleSheet,
Text,
View
} from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import WebView, { WebViewProps } from 'react-native-webview';
// import WebView from 'react-native-web-webview';
import { WebViewSource } from 'react-native-webview/lib/WebViewTypes';
Expand Down Expand Up @@ -78,23 +78,22 @@ export const VisualTest = ({
const Wrapper = useMemo(
() =>
scrollView
? ({ children }: PropsWithChildren<{}>) => (
? ({ children }: PropsWithChildren<unknown>) => (
<ScrollView
style={styles.container}
contentContainerStyle={[styles.content]}
children={children}
/>
contentContainerStyle={[styles.content]}>
{children}
</ScrollView>
)
: ({ children }: PropsWithChildren<{}>) => (
<View
style={[styles.container, styles.content]}
children={children}
/>
: ({ children }: PropsWithChildren<unknown>) => (
<View style={[styles.container, styles.content]}>{children}</View>
),
[scrollView]
);

return (
<SafeAreaView style={{ flex: 1, backgroundColor: '#9c9c9c' }}>
{/* eslint-disable-next-line react-hooks/static-components */}
<Wrapper>
<View
style={[
Expand All @@ -116,7 +115,6 @@ export const VisualTest = ({
style={webViewStyle}
containerStyle={containerStyle}
source={source}
originWhitelist={[]}
onNavigationStateChange={(state) =>
console.info('Navigation State Change', state)
}
Expand Down
16 changes: 0 additions & 16 deletions acceptance/web-app/webpack.config.js

This file was deleted.

50 changes: 50 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* eslint-disable @typescript-eslint/no-require-imports */
const tseslint = require('typescript-eslint');
const reactPlugin = require('eslint-plugin-react');
const reactHooksPlugin = require('eslint-plugin-react-hooks');
const prettierConfig = require('eslint-config-prettier');
const prettierPlugin = require('eslint-plugin-prettier');

module.exports = [
{
ignores: ['**/lib/**', '**/types/**', '**/node_modules/**', '**/*.d.ts']
},
...tseslint.configs.recommended,
{
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
prettier: prettierPlugin
},
settings: {
react: {
version: '19.2.0'
}
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
...prettierConfig.rules,
'prettier/prettier': 'error',
'comma-dangle': ['error', 'never'],
'no-eval': 'off',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true }
],
// These react rules use context APIs removed in ESLint 10
'react/jsx-no-undef': 'off',
'react/no-unescaped-entities': 'off',
// Relax rules that were not enforced by @react-native-community/eslint-config
'@typescript-eslint/no-explicit-any': 'off',
'react/display-name': 'off',
// New in react-hooks@7, not previously enforced
'react-hooks/set-state-in-effect': 'off',
'@typescript-eslint/no-unused-expressions': [
'error',
{ allowShortCircuit: true, allowTernary: true }
]
}
}
];
Loading
Loading