Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #2326 [DX] Add per-package Yarn scripts (build, watch, test, li…
…nt, ...) (Kocal) This PR was squashed before being merged into the 2.x branch. Discussion ---------- [DX] Add per-package Yarn scripts (build, watch, test, lint, ...) | 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). --> When working in UX Map, it was very painful to build or watch modifications on `.ts` files, I had investigate how the building process worked, and had to run Rollup like this, which is far from ideal (not documented and not obvious): ``` ./node_modules/.bin/rollup -c --environment INPUT_FILE:src/Map/assets/src/abstract_map_controller.ts -w ./node_modules/.bin/rollup -c --environment INPUT_FILE:src/Map/src/Bridge/Google/assets/src/map_controller.ts -w ./node_modules/.bin/rollup -c --environment INPUT_FILE:src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts -w ``` And I also felt sorry for `@rrr63` when he worked on adding Polygons on Map (#2162)... This PR improves the way developers will work on UX, and makes their lives easier. **Before**: - `yarn build` compiled the assets from ALL packages, it was not possible to build packages from only one package (which is useful if you work on a single package) - no `yarn watch` - `yarn test` runned tests from ALL packages, like `yarn build`, it was not possible to run tests for only one package **Now:** - at the project root, `build`/`test`/`lint`/`format`/`check-lint`/`check-format` scripts will run on all assets **from all packages**. And it will be faster than before, when processing was sequential, but now it's parallelized. - at a package root (ex: `src/Map/assets`), `build`/`test`/`lint`/`format`/`check-lint`/`check-format` scripts will run on all assets **from this package only** - `build` and `watch` scripts handles both TypeScript and CSS files in a single command This is a first step to what we spoke about with `@smnandre` to write a contribution guide. It is now much more easier and friendlier to tell a developer to run `yarn watch` inside a package root, instead of telling it to run `./node_modules/.bin/rollup -c --environment INPUT_FILE:src/Map/src/Bridge/Google/assets/src/map_controller.ts -w` (and more, if you have multiple files). <img width="1210" alt="image" src="https://github.com/user-attachments/assets/f40d4efc-439d-4f83-a0f8-611b1a64b334"> Commits ------- b8dc5fd Ignore `var` folder in Biome.js 8397b52 [DX] Rework testing process, add `test` script to packages package.json bc1d63c [DX] Reconfigure lint/format tasks to not run the command for each workspace, since Biome is super fast (also include bin and test JS files) 1873b3e [DX] Rework building process, and add build/watch scripts to packages package.json 5517388 [DX] Add lint/format/check-lint/check-format scripts to packages package.json
- Loading branch information