Skip to content

Commit

Permalink
Merge branch 'main' into @tomekzaw/remove-reainitializer
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekzaw committed May 10, 2024
2 parents 3996b8b + 325bd18 commit a74e6b4
Show file tree
Hide file tree
Showing 288 changed files with 244,773 additions and 64,707 deletions.
5 changes: 0 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.eslintrc.js
scripts/*.js
docs/*
plugin/*
eslintrc.js
jest.config.js
eslintPlugin/*
mock.js
77 changes: 43 additions & 34 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,49 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
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',
},
},
],
extends: [
'standard',
'plugin:@typescript-eslint/recommended-type-checked',
'prettier',
'plugin:import/typescript',
'plugin:react-hooks/recommended',
Expand All @@ -32,43 +68,16 @@ 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',
},
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
plugin/build/* linguist-generated=true

.yarn/releases/** binary
2 changes: 2 additions & 0 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Test Android build
env:
YARN_ENABLE_HARDENED_MODE: 0
on:
pull_request:
paths:
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/build-monorepo-action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Test build in monorepo
env:
YARN_ENABLE_HARDENED_MODE: 0
REACT_NATIVE_TEMPLATE: ${{ inputs.react_native_version && '--version' || '' }} ${{ inputs.react_native_version }}
on:
workflow_call:
inputs:
Expand All @@ -15,13 +18,10 @@ on:
required: false
type: string

env:
REACT_NATIVE_TEMPLATE: ${{ inputs.react_native_version && '--version' || '' }} ${{ inputs.react_native_version }}

jobs:
build:
if: github.repository == 'software-mansion/react-native-reanimated'
runs-on: ${{ inputs.platform == 'iOS' && 'macos-13' || 'ubuntu-latest' }}
runs-on: ${{ inputs.platform == 'iOS' && 'macos-14' || 'ubuntu-latest' }}
concurrency:
group: ${{ inputs.concurrency_group }}
cancel-in-progress: true
Expand All @@ -44,10 +44,18 @@ jobs:
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
- name: Install dependencies for RootApp
working-directory: monorepo/RootApp
run: yarn install
- name: Install Reanimated for RootApp
working-directory: monorepo/RootApp
run: yarn add github:software-mansion/react-native-reanimated#${{ github.ref }}

- name: Install dependencies for PackageApp
working-directory: monorepo/packages/PackageApp
run: yarn install
- name: Install Reanimated for PackageApp
working-directory: monorepo/packages/PackageApp
run: yarn add github:software-mansion/react-native-reanimated#${{ github.ref }}

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-monorepo.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Test monorepo build
env:
YARN_ENABLE_HARDENED_MODE: 0
on:
pull_request:
paths:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-next-example.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Build/test NextExample
env:
YARN_ENABLE_HARDENED_MODE: 0
on:
pull_request:
paths:
Expand All @@ -22,6 +24,9 @@ jobs:
- name: Install Reanimated node_modules
run: yarn install --immutable

- name: Build package
run: yarn build

- name: Install NextExample node_modules
working-directory: NextExample
run: yarn install --immutable
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-nightly-npm-package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build nightly npm package

env:
YARN_ENABLE_HARDENED_MODE: 0
on:
schedule:
- cron: '27 23 * * *' # at 23:27 every day
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-npm-package-action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build npm package

env:
YARN_ENABLE_HARDENED_MODE: 0
on:
workflow_call:
inputs:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-on-windows-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Test build on Windows nightly
env:
YARN_ENABLE_HARDENED_MODE: 0
on:
pull_request:
paths:
Expand All @@ -22,6 +24,9 @@ jobs:
java-version: '17'
- name: Create React Native App
run: npx react-native init App
- name: Install dependencies
working-directory: App
run: yarn
- name: Install Reanimated
working-directory: App
run: yarn add github:software-mansion/react-native-reanimated#${{ github.ref }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-release-npm-package-rea2.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build release npm package, Reanimated 2

env:
YARN_ENABLE_HARDENED_MODE: 0
on:
workflow_dispatch:

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-release-npm-package-rea3.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build release npm package, Reanimated 3

env:
YARN_ENABLE_HARDENED_MODE: 0
on:
workflow_dispatch:

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/build-v8-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Test V8 on Android nightly
env:
YARN_ENABLE_HARDENED_MODE: 0
on:
pull_request:
paths:
- .github/workflows/build-v8-nightly.yml
- .github/workflows/helper/configureV8.js
schedule:
- cron: '37 19 * * *'
workflow_dispatch:
Expand All @@ -19,9 +22,17 @@ jobs:
uses: actions/checkout@v4
with:
path: 'reanimated_repo'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Create React Native app
run: npx react-native init app
- name: Install dependencies
working-directory: app
run: yarn install
- name: Install test dependencies
working-directory: app
run: yarn add github:software-mansion/react-native-reanimated#${{ github.ref }} react-native-v8 v8-android-jit
- name: Configure V8
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/check-TS-react-native.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Check TypeScript with different React Native versions
env:
YARN_ENABLE_HARDENED_MODE: 0
on:
pull_request:
paths:
Expand All @@ -13,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
react-native-version: ['0.71', '0.72', nightly]
react-native-version: ['0.71', '0.72', '0.73', '0.74.0-rc.6', nightly]
fail-fast: false
concurrency:
group: TS-react-native-nightly-${{ matrix.react-native-version }}-${{ github.ref }}
Expand All @@ -27,8 +29,12 @@ jobs:
cache: 'yarn'
- name: Clear annotations
run: scripts/clear-annotations.sh
- name: Install dependencies
run: yarn install
- name: Build repo
run: yarn build
- name: Install react-native ${{ matrix.react-native-version }}
run: yarn add react-native@${{ matrix.react-native-version }}
run: yarn add --dev react-native@${{ matrix.react-native-version }}
- name: Check source types
run: yarn type:check:src
- name: Check plugin types
Expand Down
Loading

0 comments on commit a74e6b4

Please sign in to comment.