Commit 78d243e
committed
minor symfony#2349 [DX] Some improvements for dependencies management when testing (Kocal)
This PR was merged into the 2.x branch.
Discussion
----------
[DX] Some improvements for dependencies management when testing
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- For new features, provide some code snippets to help understand usage.
- Features and deprecations must be submitted against branch main.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
- Never break backward compatibility (see https://symfony.com/bc).
-->
Added two new internal features to the test process:
1. We now check for `peerDependencies.*` and `symfony.importmap.*` homogeneity, that was pretty useful before, when versions were altered without being restored when running `yarn test`. It's in fact less necessary due to the 2nd feature:
```
➜ assets git:(test-improvments-versions) ✗ yarn test
Processing workspace `@symfony`/ux-chartjs at location /Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets...
Checking '/Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets/package.json' for peerDependencies and importmap dependencies to have the same version
-> Version mismatch for chart.js: ^4.0 (peerDependencies) vs ^3.4.1 || ^4.0 (importmap)
-> You need to match the version of the "peerDependency" with the version in the "importmap"
```
2. We now cleanup changes when a peerDependency changed because it has multiple versions, this allows us to keep a clean `package.json` and `yarn.lock`, and so a clean project state:
```
➜ assets git:(test-improvments-versions) yarn test
Processing workspace `@symfony`/ux-chartjs at location /Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets...
Checking '/Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets/package.json' for peerDependencies and importmap dependencies to have the same version
Checking '/Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets/package.json' for peerDependencies with multiple versions defined
-> Multiple versions found for peerDependencies: chart.js
- Install chart.js@^3.4.1 for `@symfony`/ux-chartjs
➤ YN0000: · Yarn 4.5.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ rollup is listed by your project with version 4.22.5 (pf8256), which doesn't satisfy what `@rollup`/pluginutils (via `@rollup`/plugin-commonjs) and other dependencies request (^2.78.0 || ^3.0.0).
➤ YN0002: │ `@symfony`/ux-autocomplete@workspace:src/Autocomplete/assets doesn't provide vitest (pc8205), requested by vitest-fetch-mock.
➤ YN0002: │ `@symfony`/ux-chartjs@workspace:src/Chartjs/assets doesn't provide vitest (pccf90), requested by vitest-canvas-mock.
➤ YN0002: │ `@symfony`/ux-react@workspace:src/React/assets doesn't provide vite (pbe8ce), requested by `@vitejs`/plugin-react.
➤ YN0002: │ `@symfony`/ux-svelte@workspace:src/Svelte/assets doesn't provide vite (pf0478), requested by `@sveltejs`/vite-plugin-svelte.
➤ YN0002: │ `@symfony`/ux-vue@workspace:src/Vue/assets doesn't provide vite (p99573), requested by `@vitejs`/plugin-vue.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 268ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 666ms
Running tests for `@symfony`/ux-chartjs...
RUN v2.1.1 /Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets
✓ test/controller.test.ts (5)
✓ ChartjsController (5)
✓ connect without options
✓ connect with options
✓ will update when the view data changes
✓ will update when the view data changes without options
✓ dispatches the events correctly
Test Files 1 passed (1)
Tests 5 passed (5)
Start at 10:21:45
Duration 1.13s (transform 51ms, setup 93ms, collect 205ms, tests 114ms, environment 480ms, prepare 63ms)
- Install chart.js@^4.0 for `@symfony`/ux-chartjs
➤ YN0000: · Yarn 4.5.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ rollup is listed by your project with version 4.22.5 (pf8256), which doesn't satisfy what `@rollup`/pluginutils (via `@rollup`/plugin-commonjs) and other dependencies request (^2.78.0 || ^3.0.0).
➤ YN0002: │ `@symfony`/ux-autocomplete@workspace:src/Autocomplete/assets doesn't provide vitest (pc8205), requested by vitest-fetch-mock.
➤ YN0002: │ `@symfony`/ux-chartjs@workspace:src/Chartjs/assets doesn't provide vitest (pccf90), requested by vitest-canvas-mock.
➤ YN0002: │ `@symfony`/ux-react@workspace:src/React/assets doesn't provide vite (pbe8ce), requested by `@vitejs`/plugin-react.
➤ YN0002: │ `@symfony`/ux-svelte@workspace:src/Svelte/assets doesn't provide vite (pf0478), requested by `@sveltejs`/vite-plugin-svelte.
➤ YN0002: │ `@symfony`/ux-vue@workspace:src/Vue/assets doesn't provide vite (p99573), requested by `@vitejs`/plugin-vue.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 259ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 664ms
Running tests for `@symfony`/ux-chartjs...
RUN v2.1.1 /Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets
✓ test/controller.test.ts (5)
✓ ChartjsController (5)
✓ connect without options
✓ connect with options
✓ will update when the view data changes
✓ will update when the view data changes without options
✓ dispatches the events correctly
Test Files 1 passed (1)
Tests 5 passed (5)
Start at 10:21:48
Duration 757ms (transform 49ms, setup 69ms, collect 149ms, tests 114ms, environment 221ms, prepare 62ms)
-> Reverting version changes for chart.js
➤ YN0000: · Yarn 4.5.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ rollup is listed by your project with version 4.22.5 (pf8256), which doesn't satisfy what `@rollup`/pluginutils (via `@rollup`/plugin-commonjs) and other dependencies request (^2.78.0 || ^3.0.0).
➤ YN0002: │ `@symfony`/ux-autocomplete@workspace:src/Autocomplete/assets doesn't provide vitest (pc8205), requested by vitest-fetch-mock.
➤ YN0002: │ `@symfony`/ux-chartjs@workspace:src/Chartjs/assets doesn't provide vitest (pccf90), requested by vitest-canvas-mock.
➤ YN0002: │ `@symfony`/ux-react@workspace:src/React/assets doesn't provide vite (pbe8ce), requested by `@vitejs`/plugin-react.
➤ YN0002: │ `@symfony`/ux-svelte@workspace:src/Svelte/assets doesn't provide vite (pf0478), requested by `@sveltejs`/vite-plugin-svelte.
➤ YN0002: │ `@symfony`/ux-vue@workspace:src/Vue/assets doesn't provide vite (p99573), requested by `@vitejs`/plugin-vue.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 259ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 665ms
All tests passed!
```
Commits
-------
11342b4 [Test] Check for peerDependencies/symfony.importmap homogeneity, cleanup changes when a peerDependency changed because multiple versions1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
| |||
68 | 81 | | |
69 | 82 | | |
70 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
71 | 87 | | |
72 | 88 | | |
73 | 89 | | |
| |||
0 commit comments