Skip to content

Commit

Permalink
Merge branch 'main' into @tjzel/plugin/worklet-referencing
Browse files Browse the repository at this point in the history
  • Loading branch information
tjzel committed Jun 10, 2024
2 parents 96ae340 + 5cb258d commit 80655aa
Show file tree
Hide file tree
Showing 1,734 changed files with 317,102 additions and 77,568 deletions.
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

81 changes: 49 additions & 32 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,52 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
extends: ['plugin:@typescript-eslint/recommended-type-checked'],
rules: {
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-ignore': 'allow-with-description',
'ts-expect-error': 'allow-with-description',
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' },
],
'@typescript-eslint/consistent-type-exports': [
'error',
{ fixMixedExportsWithInlineTypeSpecifier: false },
],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-duplicate-type-constituents': 'error',
'@typescript-eslint/no-shadow': 'error',
},
},
],
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
requireConfigFile: false,
},
extends: [
'standard',
'plugin:@typescript-eslint/recommended-type-checked',
'prettier',
'plugin:import/typescript',
'plugin:react-hooks/recommended',
Expand All @@ -32,43 +71,21 @@ module.exports = {
},
},
rules: {
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'object-shorthand': 'error',
curly: 'error',
curly: ['error', 'all'],
'no-case-declarations': 'error',
'@typescript-eslint/no-shadow': 'error',
'import/no-unresolved': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'react/jsx-uses-vars': 'error',
'react/jsx-uses-react': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-ignore': 'allow-with-description',
'ts-expect-error': 'allow-with-description',
},
],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-var-requires': 'warn',
// '@typescript-eslint/no-duplicate-type-constituents': 'error', // TODO this currently breaks ESLint for VSCode in plugin
eqeqeq: 'error',
'no-unreachable': 'error',
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' },
],
'@typescript-eslint/consistent-type-exports': [
'error',
{ fixMixedExportsWithInlineTypeSpecifier: false },
],
'tsdoc/syntax': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
};
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
plugin/build/* linguist-generated=true

.yarn/releases/** binary
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
36 changes: 20 additions & 16 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
pull_request:
paths:
- .github/workflows/android-build.yml
- android/**
- Common/**
- Example/package.json
- Example/android/**
- FabricExample/package.json
- FabricExample/android/**
- packages/react-native-reanimated/android/**
- packages/react-native-reanimated/Common/**
- apps/paper-example/package.json
- apps/paper-example/android/**
- apps/fabric-example/package.json
- apps/fabric-example/android/**
merge_group:
branches:
- main
Expand All @@ -19,20 +19,20 @@ on:
- main
paths:
- .github/workflows/android-build.yml
- android/**
- Common/**
- Example/package.json
- Example/android/**
- FabricExample/package.json
- FabricExample/android/**
- packages/react-native-reanimated/android/**
- packages/react-native-reanimated/Common/**
- apps/paper-example/package.json
- apps/paper-example/android/**
- apps/fabric-example/package.json
- apps/fabric-example/android/**

jobs:
build:
if: github.repository == 'software-mansion/react-native-reanimated'
runs-on: ubuntu-latest
strategy:
matrix:
working-directory: [Example, FabricExample]
working-directory: [apps/paper-example, apps/fabric-example]
fail-fast: false
concurrency:
group: android-${{ matrix.working-directory }}-${{ github.ref }}
Expand All @@ -41,6 +41,9 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install dependencies in root
run: yarn install --immutable

- name: Setup Java 17
uses: actions/setup-java@v3
with:
Expand All @@ -50,11 +53,12 @@ jobs:
- name: Restore Reanimated node_modules from cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-android-node-modules-reanimated-${{ hashFiles('yarn.lock') }}
path: packages/react-native-reanimated/node_modules
key: ${{ runner.os }}-android-node-modules-reanimated-${{ hashFiles('packages/react-native-reanimated/yarn.lock') }}
restore-keys: ${{ runner.os }}-android-node-modules-reanimated-

- name: Install Reanimated node_modules
working-directory: packages/react-native-reanimated
run: yarn install --immutable

- name: Restore app node_modules from cache
Expand All @@ -66,7 +70,7 @@ jobs:

- name: Install app node_modules
working-directory: ${{ matrix.working-directory }}
run: yarn install --immutable
run: yarn install

- name: Build app
working-directory: ${{ matrix.working-directory }}/android
Expand Down
23 changes: 9 additions & 14 deletions .github/workflows/build-monorepo-action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Test build in monorepo
env:
YARN_ENABLE_HARDENED_MODE: 0
REACT_NATIVE_TEMPLATE: ${{ inputs.react_native_version && '--version' || '' }} ${{ inputs.react_native_version }}
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
on:
workflow_call:
inputs:
Expand All @@ -14,9 +13,6 @@ on:
is_hoisted:
required: true
type: boolean
react_native_version:
required: false
type: string

jobs:
build:
Expand All @@ -33,17 +29,18 @@ jobs:
java-version: '17'
- name: Create directories
run: mkdir -p monorepo/packages

- name: Setup monorepo
working-directory: monorepo
run: echo '{"name":"rnos-monorepo-tester","version":"1.0.0","license":"MIT","private":true,"workspaces":{"packages":["RootApp","packages/PackageApp", "AppA", "AppB"],"nohoist":["**/react","**/react-dom","**/react-native","**/react-native/**","**/react-native-codegen","**/react-native-dev-menu"]}}' > package.json
- name: Install dependencies
run: yarn install
- name: Create RootApp
working-directory: monorepo
run: npx react-native init RootApp --skip-install ${{ env.REACT_NATIVE_TEMPLATE }}
run: npx react-native@0.73 init RootApp --skip-install --version 0.73
- name: Create PackageApp
working-directory: monorepo/packages
run: npx react-native init PackageApp --skip-install ${{ env.REACT_NATIVE_TEMPLATE }}
- name: Setup monorepo
working-directory: monorepo
run: |
echo '{"name":"rnos-monorepo-tester","version":"1.0.0","license":"MIT","private":true,"workspaces":{"packages":["RootApp","packages/PackageApp", "AppA", "AppB"],"nohoist":["**/react","**/react-dom","**/react-native","**/react-native/**","**/react-native-codegen","**/react-native-dev-menu"]}}' > package.json
yarn
run: npx react-native@0.73 init PackageApp --skip-install --version 0.73

- name: Install dependencies for RootApp
working-directory: monorepo/RootApp
Expand Down Expand Up @@ -72,7 +69,6 @@ jobs:
if: ${{ inputs.platform == 'iOS' }}
working-directory: monorepo/packages/PackageApp/ios
run: pod install

- name: Build iOS app RootApp
if: ${{ inputs.platform == 'iOS' }}
working-directory: monorepo/RootApp
Expand All @@ -81,7 +77,6 @@ jobs:
if: ${{ inputs.platform == 'iOS' }}
working-directory: monorepo/packages/PackageApp
run: yarn react-native run-ios --simulator='iPhone 14' --no-packager

- name: Build Android RootApp
if: ${{ inputs.platform == 'Android' }}
working-directory: monorepo/RootApp/android
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/build-monorepo.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: Test monorepo build
env:
YARN_ENABLE_HARDENED_MODE: 0
on:
pull_request:
paths:
- .github/workflows/build-monorepo.yml
- .github/workflows/build-monorepo-action.yml
- RNReanimated.podspec
- scripts/reanimated_utils.rb
- android/build.gradle
- packages/react-native-reanimated/scripts/reanimated_utils.rb
- packages/react-native-reanimated/android/build.gradle
merge_group:
branches:
- main
Expand All @@ -18,9 +16,9 @@ on:
paths:
- .github/workflows/build-monorepo.yml
- .github/workflows/build-monorepo-action.yml
- RNReanimated.podspec
- scripts/reanimated_utils.rb
- android/build.gradle
- packages/react-native-reanimated/RNReanimated.podspec
- packages/react-native-reanimated/scripts/reanimated_utils.rb
- packages/react-native-reanimated/android/build.gradle
workflow_call:

jobs:
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/build-next-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
pull_request:
paths:
- .github/workflows/build-next-example.yml
- 'src/**'
- 'NextExample/**'
- 'packages/react-native-reanimated/src/**'
- 'packages/react-native-reanimated/NextExample/**'
push:
branches:
- master
- main

jobs:
check:
Expand All @@ -20,21 +20,23 @@ jobs:
steps:
- name: Checkout Git repository
uses: actions/checkout@v4

- name: Install Reanimated node_modules
- name: Install monorepo node dependencies
run: yarn install --immutable

- name: Build package
- name: Install Reanimated node dependencies
working-directory: packages/react-native-reanimated
run: yarn install --immutable
- name: Build Reanimated package
working-directory: packages/react-native-reanimated
run: yarn build

- name: Install NextExample node_modules
working-directory: NextExample
working-directory: apps/next-example
run: yarn install --immutable

- name: Compile production build
working-directory: NextExample
run: yarn build
working-directory: apps/next-example
run: yarn build:next

- name: Run e2e tests
working-directory: NextExample
working-directory: apps/next-example
run: yarn e2e:headless
Loading

0 comments on commit 80655aa

Please sign in to comment.