Skip to content

Commit

Permalink
setup yarn berry
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-chaix-didomi committed Aug 2, 2024
1 parent 374e032 commit c0b69bb
Show file tree
Hide file tree
Showing 16 changed files with 11,464 additions and 61 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ jobs:
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: yarn install
- run: corepack enable
- run: corepack prepare yarn@stable --activate
- run: yarn set version stable
- run: yarn install --frozen-lockfile
- run: yarn prepare
- run: npm publish --access public
env:
Expand Down
33 changes: 30 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,17 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Enable Corepack
run: corepack enable

- name: Set up Yarn
run: |
corepack prepare yarn@stable --activate
yarn set version stable
- name: Install dependencies
run: yarn install
run: |
yarn install --frozen-lockfile
- name: Run JS tests
run: yarn test
Expand Down Expand Up @@ -61,9 +70,18 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Enable Corepack
run: corepack enable

- name: Set up Yarn
run: |
corepack prepare yarn@stable --activate
yarn set version stable
- name: Install dependencies
run: yarn install
run: |
yarn install --frozen-lockfile
- name: Cache Gradle Wrapper
uses: actions/cache@v4
Expand Down Expand Up @@ -147,9 +165,18 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Enable Corepack
run: corepack enable

- name: Set up Yarn
run: |
corepack prepare yarn@stable --activate
yarn set version stable
- name: Install dependencies
run: yarn install
run: |
yarn install --frozen-lockfile
- name: Install pods
run: cd ios && pod install
Expand Down
33 changes: 30 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,18 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Enable Corepack
run: corepack enable

- name: Set up Yarn
run: |
corepack prepare yarn@stable --activate
yarn set version stable
- name: Install dependencies
run: yarn install
run: |
yarn install --frozen-lockfile
- name: Run JS tests
run: yarn test
Expand Down Expand Up @@ -61,9 +70,18 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Enable Corepack
run: corepack enable

- name: Set up Yarn
run: |
corepack prepare yarn@stable --activate
yarn set version stable
- name: Install dependencies
run: yarn install
run: |
yarn install --frozen-lockfile
- name: Cache Gradle Wrapper
uses: actions/cache@v4
Expand Down Expand Up @@ -147,9 +165,18 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Enable Corepack
run: corepack enable

- name: Set up Yarn
run: |
corepack prepare yarn@stable --activate
yarn set version stable
- name: Install dependencies
run: yarn install
run: |
yarn install --frozen-lockfile
- name: Install pods
run: cd ios && pod install
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,17 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Enable Corepack
run: corepack enable

- name: Set up Yarn
run: |
corepack prepare yarn@stable --activate
yarn set version stable
- name: Install dependencies
run: yarn install
run: |
yarn install --frozen-lockfile
- name: Update React Native SDK
run: |
Expand Down
69 changes: 39 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
Expand All @@ -27,46 +20,62 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Xcode / tests
#
testApp/ios/main.jsbundle
**/.xcode.env.local

# Android/IJ
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof

# Ruby / CocoaPods
#
testApp/ios/Pods
testApp/vendor/bundle/
sampleApp/ios/Pods
sampleApp/vendor/bundle/
.cxx/
*.keystore
!debug.keystore

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
**/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# testing
/coverage

# Expo
.expo/*
# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# generated by bob
# generated by sample / test
lib/
package-lock.json
Podfile.lock
yarn.lock
/yarn.lock
index.android.bundle
894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.3.1.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.3.1.cjs

enableGlobalCache: true

logFilters:
- code: YN0013
level: discard
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-prettier": "^3.1.3",
"husky": "^4.2.5",
"jest": "^26.6.3",
"jest": "^29.7.0",
"metro-config": "^0.80.9",
"metro-react-native-babel-preset": "^0.77.0",
"pod-install": "^0.1.0",
"prettier": "^2.0.5",
"react": "17.0.2",
Expand Down Expand Up @@ -159,5 +160,6 @@
}
]
]
}
},
"packageManager": "[email protected]"
}
9 changes: 9 additions & 0 deletions sample/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nodeLinker: node-modules

yarnPath: ../.yarn/releases/yarn-4.3.1.cjs

enableGlobalCache: true

logFilters:
- code: YN0013
level: discard
17 changes: 0 additions & 17 deletions sample/__tests__/App.test.tsx

This file was deleted.

9 changes: 9 additions & 0 deletions testApp/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nodeLinker: node-modules

yarnPath: ../.yarn/releases/yarn-4.3.1.cjs

enableGlobalCache: true

logFilters:
- code: YN0013
level: discard
2 changes: 1 addition & 1 deletion testApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"babel-plugin-module-resolver": "^4.0.0",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"babel-plugin-module-resolver": "^4.0.0",
"metro-react-native-babel-preset": "^0.67.0",
"react-test-renderer": "17.0.2"
},
Expand Down
6 changes: 5 additions & 1 deletion testApp/scripts/android/prepare-ui-tests-locally-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
[ -f yarn.lock ] && rm yarn.lock && echo "yarn.lock deleted"
)

yarn install
# Setup Yarn Berry
corepack enable
corepack prepare yarn@stable --activate
yarn set version stable
yarn install --frozen-lockfile

# Makes gradlew executable
chmod +x ./android/gradlew
Expand Down
6 changes: 5 additions & 1 deletion testApp/scripts/ios/prepare-ui-tests-locally-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
# [ -f yarn.lock ] && rm yarn.lock && echo "yarn.lock deleted"
)

yarn install
# Setup Yarn Berry
corepack enable
corepack prepare yarn@stable --activate
yarn set version stable
yarn install --frozen-lockfile

# Update pods
pod update --project-directory=./ios && pod install --project-directory=./ios
Expand Down
Loading

0 comments on commit c0b69bb

Please sign in to comment.