Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PC-33767) build(yarn): bump yarn #7471

Merged
merged 12 commits into from
Jan 6, 2025
Merged
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
4 changes: 3 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ eval "$(devbox generate direnv --print-envrc)"

layout node

source_env ./scripts/install_node_modules_when_not_installed.sh
source ./scripts/load_certificate.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je pense que c'est inutile de le faire une seconde fois, c'est déjà faire ligne 12

export NODE_TLS_REJECT_UNAUTHORIZED=0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'imagine que si on montre ça coté sécu, il y aura un blocage

Copy link
Contributor

@yleclercq-pass yleclercq-pass Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on a une Error warning lorsqu'on lance le web du à cette ligne là
Capture d’écran 2025-01-07 à 10 41 56

source ./scripts/install_node_modules_when_not_installed.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source est une fonction standard de bash

source_env est une fonction standard de direnv utilisant source et permet de relancer le script s'il change


ANDROID_HOME="$HOME/Library/Android/sdk"
if [ -d "$ANDROID_HOME" ]; then
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/dev_on_pull_request_reassure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ jobs:
test-performance:
runs-on: ubuntu-22.04
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: yarn install --force
run: yarn install
- name: Run performance testing script
run: yarn test:perf
- name: Run Danger.js to publish scores in PR
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dev_on_workflow_chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
yarn_test_and_publish_storybook_with_chromatic:
runs-on: ubuntu-22.04
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
with:
# by default, it only retrieves the last commit
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dev_on_workflow_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
name: 'Install yarn dependencies'
runs-on: ubuntu-22.04
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dev_on_workflow_linter_ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
yarn_lint:
runs-on: ubuntu-22.04
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
Expand All @@ -41,6 +43,8 @@ jobs:
yarn_typescript:
runs-on: ubuntu-22.04
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/dev_on_workflow_pr_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
runs-on: ubuntu-22.04
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/[email protected]
with:
ref: ${{ inputs.REF }}
Expand Down Expand Up @@ -67,7 +69,7 @@ jobs:
key: v1-yarn-pro-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
v1-yarn-pro-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --immutable
- run: yarn install
- run: yarn build:${{ inputs.ENV }}
env:
# By default NodeJS processes are limited to 512MB of memory
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/dev_on_workflow_tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
matrix:
shard: [1, 2, 3]
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
- name: 'OpenID Connect Authentication'
uses: 'google-github-actions/auth@v2'
Expand Down Expand Up @@ -62,6 +64,8 @@ jobs:
matrix:
shard: [1, 2, 3, 4, 5, 6, 7]
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
- name: 'OpenID Connect Authentication'
uses: 'google-github-actions/auth@v2'
Expand Down Expand Up @@ -105,6 +109,8 @@ jobs:
runs-on: ubuntu-22.04
needs: yarn_test_native
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
- name: 'OpenID Connect Authentication'
uses: 'google-github-actions/auth@v2'
Expand Down Expand Up @@ -145,6 +151,8 @@ jobs:
yarn_test_proxy:
runs-on: ubuntu-22.04
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
Expand All @@ -165,8 +173,10 @@ jobs:
key: v1-yarn-proxy-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
v1-yarn-proxy-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --immutable --cwd server
- run: yarn --cwd server test:unit:ci
- name: Install packages for proxy
run: cd server && yarn install && cd ..
- name: Run proxy unit tests
run: cd server && yarn test:unit:ci && cd ..
- name: Get secrets for SonarCloud
id: 'sonar_secrets'
uses: 'google-github-actions/get-secretmanager-secrets@v2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
yarn-ts-noUncheckedIndexedAccess:
runs-on: ubuntu-22.04
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dev_on_workflow_ts_prune.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
yarn-ts-prune:
runs-on: ubuntu-22.04
steps:
- name: Enable Corepack
run: corepack enable
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/dev_on_workflow_web_proxy_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ jobs:
key: v1-yarn-proxy-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
v1-yarn-proxy-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- name: Install package for proxy
run: yarn install --immutable --cwd server
- name: Install app dependencies
run: yarn install
- name: Install packages for proxy
run: cd server && yarn install && cd ..
- name: Get Secret
id: 'secrets'
uses: 'google-github-actions/get-secretmanager-secrets@v2'
Expand All @@ -67,7 +68,7 @@ jobs:
workload_identity_provider: ${{ secrets.GCP_PROD_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_PROD_SERVICE_ACCOUNT }}
- name: 'Push proxy for input env'
run: yarn --cwd server deploy:${{ inputs.ENV }}
run: cd server && yarn deploy:${{ inputs.ENV }} && cd ..

- name: 'Clear unused apps'
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ local.properties
node_modules/
npm-debug.log
yarn-error.log
**/.yarn/install-state.gz

# fastlane
#
Expand Down
Binary file removed .yarn/install-state.gz
Binary file not shown.
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodeLinker: node-modules
checksumBehavior: update
21 changes: 8 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"homepage": ".",
"scripts": {
"preandroid": "./scripts/start_android_emulator_with_certificate.sh",
"android": "react-native run-android",
"android": "yarn preandroid && react-native run-android",
"android:prod": "yarn android --variant=productionDebug --appId=app.passculture.webapp",
"android:staging": "yarn android --variant=stagingDebug --appId=app.passculture.staging",
"android:testing": "yarn android --variant=apptestingDebug --appId=app.passculture.testing",
Expand All @@ -35,12 +35,11 @@
"generate:api:client": "SWAGGER_CODEGEN_CLI_VERSION=3.0.32 ./scripts/generate_api_client.sh",
"generate:api:client:silicon": "SWAGGER_CODEGEN_CLI_VERSION=3.0.32 ./scripts/generate_api_client_silicon.sh",
"preios": "./scripts/check_xcode_version.sh",
"ios": "react-native run-ios",
"ios": "yarn preios && react-native run-ios",
"ios:prod": "yarn ios --scheme PassCulture-Production",
"ios:staging": "yarn ios --scheme PassCulture-Staging",
"ios:testing": "yarn ios --scheme PassCulture-Testing",
"postinstall": "patch-package && jetify",
"prepush": "git pull --rebase origin master",
"start": "react-native start",
"start:web": "vite",
"start:web:development": "yarn start:web --mode=development",
Expand All @@ -50,9 +49,9 @@
"start:web:testing": "yarn start:web --mode=testing",
"storybook": "NODE_OPTIONS='--openssl-legacy-provider' TZ=UTC start-storybook --static-dir ./public -p 6006",
"test": "yarn test:lint && yarn test:types && yarn test:unit && yarn test:unit:web",
"test:deadcode": "yarn --silent ts-prune",
"test:deadcode": "yarn ts-prune",
"test:deadcode:count": "yarn test:deadcode | wc -l",
"test:deadcode:update": "yarn --silent test:deadcode > scripts/dead_code_snapshot.txt",
"test:deadcode:update": "yarn test:deadcode > scripts/dead_code_snapshot.txt",
"test:e2e:android:staging": "./scripts/run_e2e_tests.sh test android staging",
"test:e2e:ios:staging": "./scripts/run_e2e_tests.sh test ios staging",
"test:e2e:web:staging": "./scripts/run_e2e_tests.sh test web staging",
Expand All @@ -69,7 +68,7 @@
"test:storybook:accessibility": "TZ=UTC axe-storybook --storybook-address http://localhost:6006",
"test:types": "tsc",
"test:types:noUncheckedIndexedAccess": "grep --recursive --line-number ./src --regexp '// @ts-expect-error: because of noUncheckedIndexedAccess' | awk -F: '{print $1\":\"$2}' | sort",
"test:types:noUncheckedIndexedAccess:update": "yarn --silent test:types:noUncheckedIndexedAccess > scripts/noUncheckedIndexedAccess_snapshot.txt",
"test:types:noUncheckedIndexedAccess:update": "yarn test:types:noUncheckedIndexedAccess > scripts/noUncheckedIndexedAccess_snapshot.txt",
"test:unit": "TZ=UTC JEST=true node --no-experimental-fetch --no-compilation-cache --expose-gc ./node_modules/.bin/jest --forceExit --logHeapUsage",
"test:unit:ci": "yarn test:unit --maxWorkers=6 --coverage --ci --reporters=default --reporters=jest-junit",
"test:unit:full": "TZ=UTC JEST=true jest --collect-coverage",
Expand All @@ -83,11 +82,6 @@
"trigger:testing:deploy": "./scripts/deploy_new_version.sh testing/v patch",
"update:tools": "nix flake update && direnv exec . devbox update && git commit --only flake.lock devbox.lock --message '(BSR) chore(deps): update tools'"
},
"husky": {
"hooks": {
"pre-push": "yarn prepush"
}
},
Comment on lines -86 to -90
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pour quelles raisons il a été supprimé avec le bump de Yarn ?

"dependencies": {
"@algolia/client-search": "^4.24.0",
"@amplitude/analytics-react-native": "^1.0.1",
Expand Down Expand Up @@ -320,7 +314,7 @@
"react-native-web-linear-gradient": "^1.1.2",
"react-query-native-devtools": "^3.0.1",
"react-test-renderer": "18.2.0",
"reassure": "^0.7.2",
"reassure": "1.1.0",
"resolve": "^1.20.0",
"resolve-url-loader": "^3.1.2",
"sass-loader": "^11.0.1",
Expand Down Expand Up @@ -364,5 +358,6 @@
"./jsx-dev-runtime": "./jsx-dev-runtime.js",
"./jsx-runtime": "./jsx-runtime.js",
"./": "./"
}
},
"packageManager": "[email protected]"
}
2 changes: 1 addition & 1 deletion scripts/check_dead_code_introduced.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -o errexit
set -o nounset
set -o pipefail

yarn --silent test:deadcode >scripts/dead_code_current.txt
yarn test:deadcode >scripts/dead_code_current.txt

current_dead_code_count=$(wc -l <scripts/dead_code_current.txt)
snapshot_dead_code_count=$(wc -l <scripts/dead_code_snapshot.txt)
Expand Down
2 changes: 1 addition & 1 deletion scripts/check_noUncheckedIndexedAccess_error_introduced.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -o errexit
set -o nounset
set -o pipefail

yarn --silent test:types:noUncheckedIndexedAccess >scripts/noUncheckedIndexedAccess_current.txt
yarn test:types:noUncheckedIndexedAccess >scripts/noUncheckedIndexedAccess_current.txt

current_count=$(wc -l <scripts/noUncheckedIndexedAccess_current.txt)
snapshot_count=$(wc -l <scripts/noUncheckedIndexedAccess_snapshot.txt)
Expand Down
2 changes: 1 addition & 1 deletion scripts/get_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -o errexit
set -o nounset
set -o pipefail

VERSION=$(yarn --silent json -f package.json version)
VERSION=$(node -p "require('./package.json').version")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pour etre plus explicit et lisible, je recommande toujours les options en versions longues dans le code versionné

Suggested change
VERSION=$(node -p "require('./package.json').version")
VERSION=$(node --print "require('./package.json').version")

2 changes: 0 additions & 2 deletions scripts/noUncheckedIndexedAccess_snapshot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@
./src/libs/hooks/useTimer.native.test.ts:34
./src/libs/hooks/useTimer.native.test.ts:53
./src/libs/itinerary/useItinerary.native.test.ts:61
./src/libs/itinerary/useItinerary.ts:101
./src/libs/itinerary/useItinerary.ts:77
./src/libs/location/geolocation/requestGeolocPermission/requestGeolocPermission.android.ts:11
./src/libs/location/geolocation/requestGeolocPermission/requestGeolocPermission.android.ts:15
./src/libs/location/geolocation/requestGeolocPermission/requestGeolocPermission.android.ts:17
Expand Down
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@
},
"resolutions": {
"semver": "^7.5.2"
}
},
"packageManager": "[email protected]"
}
Loading
Loading