chore: upgrade to Yarn 3 (#429)
This commit is contained in:
Родитель
d1ea8f7463
Коммит
ab53e0e903
|
@ -1,2 +1,3 @@
|
|||
* text=auto
|
||||
*.pbxproj -text
|
||||
* text=auto
|
||||
*.pbxproj -text
|
||||
/.yarn/releases/* binary
|
||||
|
|
|
@ -18,8 +18,3 @@ updates:
|
|||
schedule:
|
||||
interval: "weekly"
|
||||
versioning-strategy: "lockfile-only"
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/example"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
versioning-strategy: "lockfile-only"
|
||||
|
|
|
@ -21,14 +21,14 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Cache /.yarn-offline-mirror
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .yarn-offline-mirror
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: Install
|
||||
run: |
|
||||
yarn ci
|
||||
yarn
|
||||
- name: Lint commit message
|
||||
run: |
|
||||
yarn lint:commit
|
||||
|
@ -45,21 +45,17 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 64
|
||||
- name: Deduplicate packages /
|
||||
- name: Deduplicate packages
|
||||
run: |
|
||||
npx yarn-deduplicate --list --fail
|
||||
- name: Deduplicate packages /example
|
||||
run: |
|
||||
npx yarn-deduplicate --list --fail
|
||||
working-directory: example
|
||||
- name: Cache /.yarn-offline-mirror
|
||||
yarn dedupe --check
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .yarn-offline-mirror
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: Install
|
||||
run: |
|
||||
yarn ci
|
||||
yarn
|
||||
- name: ClangFormat
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
env:
|
||||
|
@ -120,11 +116,11 @@ jobs:
|
|||
node-version: 14
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache /example/.yarn-offline-mirror
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: example/.yarn-offline-mirror
|
||||
key: ${{ hashFiles('example/yarn.lock') }}
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: Set up react-native@nightly
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
run: |
|
||||
|
@ -133,11 +129,10 @@ jobs:
|
|||
# https://github.com/facebook/react-native/issues/30036 and
|
||||
# https://github.com/microsoft/react-native-macos/issues/620 for more
|
||||
# details.
|
||||
yarn set-react-version main
|
||||
npm run set-react-version main
|
||||
- name: Install
|
||||
run: |
|
||||
yarn ci
|
||||
working-directory: example
|
||||
yarn
|
||||
- name: Build
|
||||
run: |
|
||||
set -eo pipefail
|
||||
|
@ -167,22 +162,11 @@ jobs:
|
|||
node-version: 14
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache /.yarn-offline-mirror
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .yarn-offline-mirror
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: npm pack
|
||||
run: |
|
||||
npm pack
|
||||
shell: bash
|
||||
- name: Cache /template-example/.yarn-offline-mirror
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
template-example/.yarn-offline-mirror
|
||||
template-example/yarn.lock
|
||||
key: ${{ matrix.template }}-${{ hashFiles('react-native-test-app-0.0.1-dev.tgz') }}
|
||||
- name: Install
|
||||
run: |
|
||||
scripts/install-test-template.sh ${{ matrix.template }}
|
||||
|
@ -227,20 +211,19 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
- name: Cache /example/.yarn-offline-mirror
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: example/.yarn-offline-mirror
|
||||
key: ${{ hashFiles('example/yarn.lock') }}
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: Set up react-native@nightly
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
run: |
|
||||
yarn set-react-version nightly
|
||||
npm run set-react-version nightly
|
||||
shell: bash
|
||||
- name: Install /example
|
||||
- name: Install
|
||||
run: |
|
||||
yarn ci
|
||||
working-directory: example
|
||||
yarn
|
||||
- name: Test `react-native config`
|
||||
run: |
|
||||
yarn jest
|
||||
|
@ -253,16 +236,6 @@ jobs:
|
|||
./gradlew clean build check test
|
||||
shell: bash
|
||||
working-directory: example
|
||||
- name: Cache /.yarn-offline-mirror
|
||||
if: ${{ matrix.os == 'macos-11' }}
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .yarn-offline-mirror
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: Install /
|
||||
if: ${{ matrix.os == 'macos-11' }}
|
||||
run: |
|
||||
yarn ci
|
||||
- name: Run instrumented tests
|
||||
if: ${{ matrix.os == 'macos-11' }}
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
|
@ -292,22 +265,11 @@ jobs:
|
|||
node-version: 14
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache /.yarn-offline-mirror
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .yarn-offline-mirror
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: npm pack
|
||||
run: |
|
||||
npm pack
|
||||
shell: bash
|
||||
- name: Cache /template-example/.yarn-offline-mirror
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
template-example/.yarn-offline-mirror
|
||||
template-example/yarn.lock
|
||||
key: ${{ matrix.template }}-${{ hashFiles('react-native-test-app-0.0.1-dev.tgz') }}
|
||||
- name: Install
|
||||
run: |
|
||||
scripts/install-test-template.sh ${{ matrix.template }}
|
||||
|
@ -340,20 +302,19 @@ jobs:
|
|||
node-version: 14
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache /example/.yarn-offline-mirror
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: example/.yarn-offline-mirror
|
||||
key: ${{ hashFiles('example/yarn.lock') }}
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: Set up react-native@canary
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
run: |
|
||||
yarn set-react-version canary-macos
|
||||
npm run set-react-version canary-macos
|
||||
shell: bash
|
||||
- name: Install
|
||||
run: |
|
||||
yarn ci
|
||||
working-directory: example
|
||||
yarn
|
||||
- name: Build
|
||||
run: |
|
||||
set -eo pipefail
|
||||
|
@ -389,22 +350,11 @@ jobs:
|
|||
node-version: 14
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache /.yarn-offline-mirror
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .yarn-offline-mirror
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: npm pack
|
||||
run: |
|
||||
npm pack
|
||||
shell: bash
|
||||
- name: Cache /template-example/.yarn-offline-mirror
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
template-example/.yarn-offline-mirror
|
||||
template-example/yarn.lock
|
||||
key: ${{ matrix.template }}-${{ hashFiles('react-native-test-app-0.0.1-dev.tgz') }}
|
||||
- name: Install
|
||||
run: |
|
||||
scripts/install-test-template.sh ${{ matrix.template }}
|
||||
|
@ -443,20 +393,19 @@ jobs:
|
|||
node-version: 14
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache /example/.yarn-offline-mirror
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: example/.yarn-offline-mirror
|
||||
key: ${{ hashFiles('example/yarn.lock') }}
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: Set up react-native@canary
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
run: |
|
||||
yarn set-react-version canary-windows
|
||||
npm run set-react-version canary-windows
|
||||
shell: bash
|
||||
- name: Install
|
||||
run: |
|
||||
yarn ci
|
||||
working-directory: example
|
||||
yarn
|
||||
- name: Build bundle and create solution
|
||||
run: |
|
||||
yarn build:windows
|
||||
|
@ -496,22 +445,11 @@ jobs:
|
|||
node-version: 14
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache /.yarn-offline-mirror
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .yarn-offline-mirror
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: npm pack
|
||||
run: |
|
||||
npm pack
|
||||
shell: bash
|
||||
- name: Cache /template-example/.yarn-offline-mirror
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
template-example/.yarn-offline-mirror
|
||||
template-example/yarn.lock
|
||||
key: ${{ matrix.template }}-${{ hashFiles('react-native-test-app-0.0.1-dev.tgz') }}
|
||||
- name: Install
|
||||
run: |
|
||||
scripts/install-test-template.sh ${{ matrix.template }}
|
||||
|
@ -559,14 +497,14 @@ jobs:
|
|||
node-version: 14
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Cache /.yarn-offline-mirror
|
||||
- name: Cache /.yarn/cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .yarn-offline-mirror
|
||||
path: .yarn/cache
|
||||
key: ${{ hashFiles('yarn.lock') }}
|
||||
- name: Install
|
||||
run: |
|
||||
yarn ci
|
||||
yarn
|
||||
- name: Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
@ -595,9 +533,3 @@ jobs:
|
|||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
continue-on-error: true
|
||||
- name: /example/yarn.lock changes
|
||||
uses: Simek/yarn-lock-changes@main
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
path: example/yarn.lock
|
||||
continue-on-error: true
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
.idea/
|
||||
.vs/
|
||||
.watchman-*
|
||||
.yarn-offline-mirror/
|
||||
.yarn/*
|
||||
!.yarn/releases/
|
||||
Pods/
|
||||
android/**/build/
|
||||
clang-format-diff.py
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
1
.yarnrc
1
.yarnrc
|
@ -1 +0,0 @@
|
|||
registry "https://registry.npmjs.org"
|
|
@ -1,2 +0,0 @@
|
|||
registry "https://registry.npmjs.org"
|
||||
yarn-offline-mirror ".yarn-offline-mirror"
|
|
@ -0,0 +1,12 @@
|
|||
enableTelemetry: false
|
||||
logFilters:
|
||||
- code: YN0007 # X must be built because it never has been before or the last one failed
|
||||
level: discard
|
||||
- code: YN0008 # X must be rebuilt because its dependency tree changed
|
||||
level: discard
|
||||
- code: YN0013 # X can't be found in the cache and will be fetched from the remote registry
|
||||
level: discard
|
||||
nmHoistingLimits: workspaces
|
||||
nodeLinker: node-modules
|
||||
npmRegistryServer: "https://registry.npmjs.org"
|
||||
yarnPath: .yarn/releases/yarn-3.0.2.cjs
|
|
@ -37,32 +37,19 @@ Open a terminal and navigate to your clone of this repository:
|
|||
cd react-native-test-app
|
||||
```
|
||||
|
||||
The first thing we have to do is to tell Yarn that we'd like to link this
|
||||
package in another project. This only needs to be done once.
|
||||
The first thing we have to do is to install the npm dependencies:
|
||||
|
||||
```sh
|
||||
yarn link
|
||||
```
|
||||
|
||||
You can read more about the command in Yarn's
|
||||
[documentation](https://classic.yarnpkg.com/en/docs/cli/link/). Once the link is
|
||||
set up, we can go into the Example app folder and install npm dependencies:
|
||||
|
||||
```sh
|
||||
cd example
|
||||
yarn
|
||||
```
|
||||
|
||||
Once Yarn is done installing dependencies, we need to tell Yarn to link in
|
||||
`react-native-test-app`:
|
||||
Once Yarn is done installing dependencies, we need to navigate to the `example`
|
||||
folder:
|
||||
|
||||
```sh
|
||||
yarn link "react-native-test-app"
|
||||
cd example
|
||||
```
|
||||
|
||||
Note that this step must be run _after_ having run `yarn`, otherwise it will be
|
||||
overwritten.
|
||||
|
||||
Now we should be ready to start the app. Jump to the appropriate section below
|
||||
for further instructions.
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
registry "https://registry.npmjs.org"
|
|
@ -1,2 +0,0 @@
|
|||
registry "https://registry.npmjs.org"
|
||||
yarn-offline-mirror ".yarn-offline-mirror"
|
|
@ -483,4 +483,4 @@ SPEC CHECKSUMS:
|
|||
|
||||
PODFILE CHECKSUM: 192c89b7b9691a138c7ae651924b80cf83bccf1e
|
||||
|
||||
COCOAPODS: 1.10.2
|
||||
COCOAPODS: 1.11.2
|
||||
|
|
|
@ -389,4 +389,4 @@ SPEC CHECKSUMS:
|
|||
|
||||
PODFILE CHECKSUM: 3c90d49455189425443ac97fd0ecb40d4f3b6b78
|
||||
|
||||
COCOAPODS: 1.10.2
|
||||
COCOAPODS: 1.11.2
|
||||
|
|
|
@ -8,11 +8,10 @@
|
|||
"build:ios": "mkdirp dist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist",
|
||||
"build:macos": "mkdirp dist && react-native bundle --entry-file index.js --platform macos --dev true --bundle-output dist/main.macos.jsbundle --assets-dest dist",
|
||||
"build:windows": "mkdirp dist && react-native bundle --entry-file index.js --platform windows --dev true --bundle-output dist/main.windows.bundle --assets-dest dist",
|
||||
"ci": "yarn --use-yarnrc .yarnrc-offline --prefer-offline",
|
||||
"clean": "yarn --cwd .. clean",
|
||||
"clean": "yarn workspace react-native-test-app clean",
|
||||
"ios": "react-native run-ios",
|
||||
"macos": "react-native run-macos --scheme Example",
|
||||
"set-react-version": "yarn --cwd .. set-react-version",
|
||||
"set-react-version": "yarn workspace react-native-test-app set-react-version",
|
||||
"start": "react-native start",
|
||||
"windows": "react-native run-windows --sln windows/Example.sln"
|
||||
},
|
||||
|
@ -30,7 +29,7 @@
|
|||
"react": "16.13.1",
|
||||
"react-native": "^0.63.4",
|
||||
"react-native-macos": "^0.63.33",
|
||||
"react-native-test-app": "../",
|
||||
"react-native-test-app": "workspace:.",
|
||||
"react-native-windows": "^0.63.32"
|
||||
},
|
||||
"jest": {
|
||||
|
|
6341
example/yarn.lock
6341
example/yarn.lock
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
10
package.json
10
package.json
|
@ -45,9 +45,7 @@
|
|||
"url": "https://github.com/microsoft/react-native-test-app.git"
|
||||
},
|
||||
"scripts": {
|
||||
"ci": "yarn --use-yarnrc .yarnrc-offline --prefer-offline --frozen-lockfile --non-interactive",
|
||||
"clean": "npx --quiet rimraf example/node_modules/react-native-test-app && git clean -dfqx",
|
||||
"deduplicate": "npx yarn-deduplicate --strategy fewer",
|
||||
"clean": "git clean -dfqx --exclude=.yarn/cache",
|
||||
"format:c": "clang-format -i $(git ls-files '*.cpp' '*.h' '*.m' '*.mm')",
|
||||
"format:js": "prettier --write $(git ls-files '*.js' '*.yml' 'test/**/*.json')",
|
||||
"format:swift": "swiftformat --swiftversion 5.3 ios macos",
|
||||
|
@ -98,7 +96,7 @@
|
|||
"@types/jest": "^26.0.0",
|
||||
"@types/mustache": "^4.0.0",
|
||||
"@types/node": "^12.0.0",
|
||||
"@types/prompts": "^2.0.0",
|
||||
"@types/prompts": "~2.0.0",
|
||||
"@types/rimraf": "^3.0.0",
|
||||
"@types/semver": "^7.3.6",
|
||||
"eslint": "^7.10.0",
|
||||
|
@ -115,6 +113,10 @@
|
|||
"suggestion-bot": "^1.0.0",
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"packageManager": "yarn@3.0.2",
|
||||
"workspaces": [
|
||||
"example"
|
||||
],
|
||||
"commitlint": {
|
||||
"extends": [
|
||||
"@commitlint/config-conventional"
|
||||
|
|
|
@ -34,12 +34,16 @@ done
|
|||
# Use tarballs to ensure that published packages are consumable
|
||||
npm pack
|
||||
|
||||
yarn ci
|
||||
yarn
|
||||
yarn react-native init-test-app --destination template-example --name TemplateExample --platform $platform
|
||||
cp .yarnrc-offline template-example/.yarnrc
|
||||
|
||||
pushd template-example 1> /dev/null
|
||||
|
||||
echo 'enableTelemetry: false' >> .yarnrc.yml
|
||||
echo 'nodeLinker: node-modules' >> .yarnrc.yml
|
||||
echo 'npmRegistryServer: "https://registry.npmjs.org"' >> .yarnrc.yml
|
||||
echo 'yarnPath: ../.yarn/releases/yarn-3.0.2.cjs' >> .yarnrc.yml
|
||||
|
||||
script="s/\"react-native-test-app\": \".*\"/\"react-native-test-app\": \"..\/react-native-test-app-$version.tgz\"/"
|
||||
if sed --version &> /dev/null; then
|
||||
sed -i'' "$script" package.json
|
||||
|
@ -47,6 +51,7 @@ else
|
|||
sed -i '' "$script" package.json
|
||||
fi
|
||||
|
||||
touch yarn.lock
|
||||
if $install; then
|
||||
yarn --prefer-offline
|
||||
yarn --no-immutable
|
||||
fi
|
||||
|
|
22942
yarn.lock
22942
yarn.lock
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче