build: switch to yarn v2+ (monicahq/chandler#467)

This commit is contained in:
Alexis Saettler
2023-04-09 18:29:54 +00:00
committed by GitHub
parent 010506c5a2
commit 03b148c6a9
11 changed files with 5126 additions and 2433 deletions
+4
View File
@@ -3,3 +3,7 @@
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
+4 -7
View File
@@ -36,17 +36,14 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Get yarn cache directory path
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn files
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-
${{ runner.os }}-yarn-v2-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-v2-
- name: Install yarn dependencies
run: yarn install --frozen-lockfile
+7 -7
View File
@@ -4,6 +4,9 @@ on:
pull_request:
types: [opened, synchronize, reopened]
env:
node-version: 18
concurrency:
group: Lint js ${{ github.ref }}
cancel-in-progress: true
@@ -26,17 +29,14 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Get yarn cache directory path
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn files
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: .yarn/cache
key: ${{ runner.os }}-yarn-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-
${{ runner.os }}-yarn-v2-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-v2-
- name: Install yarn dependencies
run: yarn install --frozen-lockfile
+1 -2
View File
@@ -165,8 +165,7 @@ jobs:
- name: Merge junit files
run: |
yarn global add junit-merge
$(yarn global bin)/junit-merge --recursive --dir results/${{ env.coverage-with }}/junit --out results/results.xml
yarn dlx junit-merge --recursive --dir results/${{ env.coverage-with }}/junit --out results/results.xml
- name: Set version parameter
id: version
+8 -1
View File
@@ -14,6 +14,13 @@
/.scribe
/tests/Features/screenshots/
/tests/Features/videos/
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
_ide_helper.php
_ide_helper_models.php
.env
@@ -26,4 +33,4 @@ npm-debug.log
.phpstorm.meta.php
.phpunit.result.cache
yarn-error.log
monica.db
monica.db
Regular → Executable
View File
+873
View File
File diff suppressed because one or more lines are too long
+3
View File
@@ -0,0 +1,3 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.5.0.cjs
+5 -6
View File
@@ -5,9 +5,9 @@
"build": "vite build",
"lint": "eslint --ext .js,.vue *.js resources",
"format": "prettier --write '**/*.{js,vue,css,scss}'",
"prepare": "husky install",
"pretest": "DB_CONNECTION=testing php artisan migrate:fresh && DB_CONNECTION=testing php artisan db:seed",
"pretest": "php artisan migrate:fresh --database=testing && php artisan db:seed --database=testing",
"posttest": "vendor/bin/phpstan analyse && vendor/bin/psalm",
"postinstall": "husky install",
"test": "vendor/bin/phpunit",
"docker:build": "docker build --cache-from monica-next -t monica-next -f scripts/docker/Dockerfile . && docker image prune -f",
"docker:run": "docker run --name monica -p 8080:80 monica-next"
@@ -16,9 +16,11 @@
"@inertiajs/inertia": "^0.11.0",
"@inertiajs/inertia-vue3": "^0.6.0",
"@inertiajs/progress": "^0.2.6",
"@popperjs/core": "^2.11.7",
"@sentry/tracing": "^7.11.1",
"@sentry/vue": "^7.11.1",
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/typography": "^0.5.7",
"@vitejs/plugin-basic-ssl": "^1.0.1",
"@vitejs/plugin-vue": "^4.0.0",
"ant-design-vue": "^3.2.5",
@@ -57,11 +59,8 @@
"prettier --write --ignore-unknown"
],
"**/*.php": [
"php artisan ide-helper:models --nowrite",
"vendor/bin/pint"
]
},
"dependencies": {
"@tailwindcss/typography": "^0.5.7"
}
"packageManager": "yarn@3.5.0"
}
+4 -4
View File
@@ -12,17 +12,17 @@ class ZiggyVersionCheckTest extends TestCase
*/
public function it_ckecks_ziggy_version_are_same()
{
//# Get composer ziggy version
// Get composer ziggy version
exec('composer show tightenco/ziggy --format=json', $composer);
$composerJson = json_decode(implode('', $composer));
$composerVersion = Str::of($composerJson->versions[0])->trim('v');
//# Get yarn ziggy version
exec('yarn list --pattern ziggy-js --depth=0 --json --non-interactive --no-progress', $yarn);
// Get yarn ziggy version
exec('yarn info ziggy-js --json', $yarn);
$yarnJson = json_decode(implode('', $yarn));
$yarnVersion = Str::of($yarnJson->data->trees[0]->name)->replace('ziggy-js@', '');
$yarnVersion = Str::of($yarnJson->value)->replace('ziggy-js@npm:', '');
$this->assertEquals($composerVersion, $yarnVersion, 'Ziggy version for composer and yarn are not the same');
}
+4217 -2406
View File
File diff suppressed because it is too large Load Diff