Repository: symfony/ux
Pull request #2245 (2024-10-06 07:35:37)

[Site] Skip yarn & npm install during deploy
> To disable the JavaScript dependencies and asset building, set NO_NPM or NO_YARN to 1 depending on your package manager.

cf https://docs.platform.sh/guides/symfony/integration.html#symfony-build




Patch:
diff --git a/.gitignore b/.gitignore
index 509b663c..328530a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,7 +12,5 @@ yarn-error.log
 
 .doctor-rst.cache
 .php-cs-fixer.cache
-.phpunit.result.cache
-
 /composer.lock
 /vendor
diff --git a/src/Autocomplete/.gitattributes b/src/Autocomplete/.gitattributes
index 61e8a87a..2b1d42ea 100644
--- a/src/Autocomplete/.gitattributes
+++ b/src/Autocomplete/.gitattributes
@@ -3,6 +3,5 @@
 /.symfony.bundle.yaml export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/Autocomplete/.gitignore b/src/Autocomplete/.gitignore
index 1784dd65..85421784 100644
--- a/src/Autocomplete/.gitignore
+++ b/src/Autocomplete/.gitignore
@@ -1,7 +1,5 @@
-/assets/node_modules/
-/vendor/
 /composer.lock
 /phpunit.xml
+/vendor/
+/var/
 /.phpunit.result.cache
-
-/var
diff --git a/src/Chartjs/.gitattributes b/src/Chartjs/.gitattributes
index d49b3ecd..1ba1a889 100644
--- a/src/Chartjs/.gitattributes
+++ b/src/Chartjs/.gitattributes
@@ -4,6 +4,5 @@
 /assets/src export-ignore
 /assets/test export-ignore
 /assets/vitest.config.js export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/Chartjs/.gitignore b/src/Chartjs/.gitignore
index 2cc9f023..bb17c3e1 100644
--- a/src/Chartjs/.gitignore
+++ b/src/Chartjs/.gitignore
@@ -1,5 +1,4 @@
-/assets/node_modules/
 /vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
+.phpunit.result.cache
+.php_cs.cache
+composer.lock
diff --git a/src/Cropperjs/.gitattributes b/src/Cropperjs/.gitattributes
index 61e8a87a..2b1d42ea 100644
--- a/src/Cropperjs/.gitattributes
+++ b/src/Cropperjs/.gitattributes
@@ -3,6 +3,5 @@
 /.symfony.bundle.yaml export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/Cropperjs/.gitignore b/src/Cropperjs/.gitignore
index 2cc9f023..30282084 100644
--- a/src/Cropperjs/.gitignore
+++ b/src/Cropperjs/.gitignore
@@ -1,5 +1,4 @@
-/assets/node_modules/
-/vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
+vendor
+composer.lock
+.php_cs.cache
+.phpunit.result.cache
diff --git a/src/Dropzone/.gitattributes b/src/Dropzone/.gitattributes
index 61e8a87a..2b1d42ea 100644
--- a/src/Dropzone/.gitattributes
+++ b/src/Dropzone/.gitattributes
@@ -3,6 +3,5 @@
 /.symfony.bundle.yaml export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/Dropzone/.gitignore b/src/Dropzone/.gitignore
index 2cc9f023..3ffdd8ae 100644
--- a/src/Dropzone/.gitignore
+++ b/src/Dropzone/.gitignore
@@ -1,5 +1,3 @@
-/assets/node_modules/
 /vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
+.phpunit.result.cache
+composer.lock
diff --git a/src/Icons/.gitattributes b/src/Icons/.gitattributes
index 0d2dd572..596519e1 100644
--- a/src/Icons/.gitattributes
+++ b/src/Icons/.gitattributes
@@ -1,6 +1,5 @@
 /.gitattributes export-ignore
 /.gitignore export-ignore
 /.symfony.bundle.yaml export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/Icons/.gitignore b/src/Icons/.gitignore
index 1784dd65..6b466948 100644
--- a/src/Icons/.gitignore
+++ b/src/Icons/.gitignore
@@ -1,7 +1,4 @@
-/assets/node_modules/
-/vendor/
+/vendor
 /composer.lock
-/phpunit.xml
-/.phpunit.result.cache
-
 /var
+/.phpunit.result.cache
diff --git a/src/LazyImage/.gitattributes b/src/LazyImage/.gitattributes
index 61e8a87a..2b1d42ea 100644
--- a/src/LazyImage/.gitattributes
+++ b/src/LazyImage/.gitattributes
@@ -3,6 +3,5 @@
 /.symfony.bundle.yaml export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/LazyImage/.gitignore b/src/LazyImage/.gitignore
index 2cc9f023..30282084 100644
--- a/src/LazyImage/.gitignore
+++ b/src/LazyImage/.gitignore
@@ -1,5 +1,4 @@
-/assets/node_modules/
-/vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
+vendor
+composer.lock
+.php_cs.cache
+.phpunit.result.cache
diff --git a/src/LiveComponent/.gitattributes b/src/LiveComponent/.gitattributes
index 61e8a87a..2b1d42ea 100644
--- a/src/LiveComponent/.gitattributes
+++ b/src/LiveComponent/.gitattributes
@@ -3,6 +3,5 @@
 /.symfony.bundle.yaml export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/LiveComponent/.gitignore b/src/LiveComponent/.gitignore
index 1784dd65..85421784 100644
--- a/src/LiveComponent/.gitignore
+++ b/src/LiveComponent/.gitignore
@@ -1,7 +1,5 @@
-/assets/node_modules/
-/vendor/
 /composer.lock
 /phpunit.xml
+/vendor/
+/var/
 /.phpunit.result.cache
-
-/var
diff --git a/src/Map/.gitattributes b/src/Map/.gitattributes
index a2d6db26..35c1f46a 100644
--- a/src/Map/.gitattributes
+++ b/src/Map/.gitattributes
@@ -5,5 +5,4 @@
 /assets/src export-ignore
 /assets/test export-ignore
 /assets/vitest.config.js export-ignore
-/doc export-ignore
 /tests export-ignore
diff --git a/src/Notify/.gitattributes b/src/Notify/.gitattributes
index 61e8a87a..2b1d42ea 100644
--- a/src/Notify/.gitattributes
+++ b/src/Notify/.gitattributes
@@ -3,6 +3,5 @@
 /.symfony.bundle.yaml export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/Notify/.gitignore b/src/Notify/.gitignore
index 2cc9f023..bb17c3e1 100644
--- a/src/Notify/.gitignore
+++ b/src/Notify/.gitignore
@@ -1,5 +1,4 @@
-/assets/node_modules/
 /vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
+.phpunit.result.cache
+.php_cs.cache
+composer.lock
diff --git a/src/React/.gitattributes b/src/React/.gitattributes
index d49b3ecd..1ba1a889 100644
--- a/src/React/.gitattributes
+++ b/src/React/.gitattributes
@@ -4,6 +4,5 @@
 /assets/src export-ignore
 /assets/test export-ignore
 /assets/vitest.config.js export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/React/.gitignore b/src/React/.gitignore
index 2cc9f023..30282084 100644
--- a/src/React/.gitignore
+++ b/src/React/.gitignore
@@ -1,5 +1,4 @@
-/assets/node_modules/
-/vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
+vendor
+composer.lock
+.php_cs.cache
+.phpunit.result.cache
diff --git a/src/StimulusBundle/.gitattributes b/src/StimulusBundle/.gitattributes
index 61e8a87a..2b1d42ea 100644
--- a/src/StimulusBundle/.gitattributes
+++ b/src/StimulusBundle/.gitattributes
@@ -3,6 +3,5 @@
 /.symfony.bundle.yaml export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/StimulusBundle/.gitignore b/src/StimulusBundle/.gitignore
index 6e705b91..d776edf2 100644
--- a/src/StimulusBundle/.gitignore
+++ b/src/StimulusBundle/.gitignore
@@ -1,7 +1,5 @@
-/assets/node_modules/
-/vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
-
-/tests/fixtures/var
+.php-cs-fixer.cache
+.phpunit.result.cache
+composer.lock
+vendor/
+tests/fixtures/var
diff --git a/src/Svelte/.gitattributes b/src/Svelte/.gitattributes
index d49b3ecd..1ba1a889 100644
--- a/src/Svelte/.gitattributes
+++ b/src/Svelte/.gitattributes
@@ -4,6 +4,5 @@
 /assets/src export-ignore
 /assets/test export-ignore
 /assets/vitest.config.js export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/Svelte/.gitignore b/src/Svelte/.gitignore
index 2cc9f023..bf4b985d 100644
--- a/src/Svelte/.gitignore
+++ b/src/Svelte/.gitignore
@@ -1,5 +1,5 @@
-/assets/node_modules/
-/vendor/
+/assets/node_modules
 /composer.lock
 /phpunit.xml
+/vendor/
 /.phpunit.result.cache
diff --git a/src/Swup/.gitattributes b/src/Swup/.gitattributes
index 254b1adb..fe55079a 100644
--- a/src/Swup/.gitattributes
+++ b/src/Swup/.gitattributes
@@ -3,4 +3,3 @@
 /.symfony.bundle.yaml export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
diff --git a/src/Swup/.gitignore b/src/Swup/.gitignore
index 2cc9f023..4a45ef5f 100644
--- a/src/Swup/.gitignore
+++ b/src/Swup/.gitignore
@@ -1,5 +1,3 @@
-/assets/node_modules/
-/vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
+vendor
+composer.lock
+.php_cs.cache
diff --git a/src/TogglePassword/.gitattributes b/src/TogglePassword/.gitattributes
index 73107b13..97734d35 100644
--- a/src/TogglePassword/.gitattributes
+++ b/src/TogglePassword/.gitattributes
@@ -4,5 +4,4 @@
 /phpunit.xml.dist export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
 /tests export-ignore
diff --git a/src/TogglePassword/.gitignore b/src/TogglePassword/.gitignore
index 2cc9f023..3d7e132f 100644
--- a/src/TogglePassword/.gitignore
+++ b/src/TogglePassword/.gitignore
@@ -1,5 +1,3 @@
-/assets/node_modules/
-/vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
+vendor/
+composer.lock
+.phpunit.result.cache
diff --git a/src/Translator/.gitattributes b/src/Translator/.gitattributes
index 73107b13..97734d35 100644
--- a/src/Translator/.gitattributes
+++ b/src/Translator/.gitattributes
@@ -4,5 +4,4 @@
 /phpunit.xml.dist export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
 /tests export-ignore
diff --git a/src/Translator/.gitignore b/src/Translator/.gitignore
index 2cc9f023..30282084 100644
--- a/src/Translator/.gitignore
+++ b/src/Translator/.gitignore
@@ -1,5 +1,4 @@
-/assets/node_modules/
-/vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
+vendor
+composer.lock
+.php_cs.cache
+.phpunit.result.cache
diff --git a/src/Turbo/.gitattributes b/src/Turbo/.gitattributes
index 91c1f350..b6c0beab 100644
--- a/src/Turbo/.gitattributes
+++ b/src/Turbo/.gitattributes
@@ -6,7 +6,4 @@
 /assets/src export-ignore
 /assets/test export-ignore
 /assets/vitest.config.js export-ignore
-/CONTRIBUTING.md export-ignore
-/docker-compose.yml
-/doc export-ignore
 /tests export-ignore
diff --git a/src/Turbo/.gitignore b/src/Turbo/.gitignore
index d365c4b9..9bd0c178 100644
--- a/src/Turbo/.gitignore
+++ b/src/Turbo/.gitignore
@@ -1,9 +1,10 @@
-/assets/node_modules/
-/vendor/
+/.php_cs.cache
+/.php_cs
+/.phpunit.result.cache
+/composer.phar
 /composer.lock
 /drivers/
 /phpunit.xml
-/.phpunit.result.cache
 /tests/app/assets/vendor/
 /tests/app/public/assets/
 /tests/app/public/build/
diff --git a/src/TwigComponent/.gitattributes b/src/TwigComponent/.gitattributes
index 80dad561..596519e1 100644
--- a/src/TwigComponent/.gitattributes
+++ b/src/TwigComponent/.gitattributes
@@ -1,7 +1,5 @@
 /.gitattributes export-ignore
 /.gitignore export-ignore
 /.symfony.bundle.yaml export-ignore
-/alert-example.png export-ignore
 /phpunit.xml.dist export-ignore
-/doc export-ignore
 /tests export-ignore
diff --git a/src/TwigComponent/.gitignore b/src/TwigComponent/.gitignore
index 1784dd65..85421784 100644
--- a/src/TwigComponent/.gitignore
+++ b/src/TwigComponent/.gitignore
@@ -1,7 +1,5 @@
-/assets/node_modules/
-/vendor/
 /composer.lock
 /phpunit.xml
+/vendor/
+/var/
 /.phpunit.result.cache
-
-/var
diff --git a/src/Typed/.gitattributes b/src/Typed/.gitattributes
index 254b1adb..fe55079a 100644
--- a/src/Typed/.gitattributes
+++ b/src/Typed/.gitattributes
@@ -3,4 +3,3 @@
 /.symfony.bundle.yaml export-ignore
 /assets/src export-ignore
 /assets/test export-ignore
-/doc export-ignore
diff --git a/src/Typed/.gitignore b/src/Typed/.gitignore
index 2cc9f023..de4a392c 100644
--- a/src/Typed/.gitignore
+++ b/src/Typed/.gitignore
@@ -1,5 +1,2 @@
-/assets/node_modules/
-/vendor/
+/vendor
 /composer.lock
-/phpunit.xml
-/.phpunit.result.cache
diff --git a/src/Vue/.gitattributes b/src/Vue/.gitattributes
index d49b3ecd..1ba1a889 100644
--- a/src/Vue/.gitattributes
+++ b/src/Vue/.gitattributes
@@ -4,6 +4,5 @@
 /assets/src export-ignore
 /assets/test export-ignore
 /assets/vitest.config.js export-ignore
-/doc export-ignore
 /phpunit.xml.dist export-ignore
 /tests export-ignore
diff --git a/src/Vue/.gitignore b/src/Vue/.gitignore
index 2cc9f023..30282084 100644
--- a/src/Vue/.gitignore
+++ b/src/Vue/.gitignore
@@ -1,5 +1,4 @@
-/assets/node_modules/
-/vendor/
-/composer.lock
-/phpunit.xml
-/.phpunit.result.cache
+vendor
+composer.lock
+.php_cs.cache
+.phpunit.result.cache
diff --git a/ux.symfony.com/.platform.app.yaml b/ux.symfony.com/.platform.app.yaml
index c14dba22..dd83e74d 100644
--- a/ux.symfony.com/.platform.app.yaml
+++ b/ux.symfony.com/.platform.app.yaml
@@ -47,6 +47,11 @@ hooks:
 
         curl -s https://get.symfony.com/cloud/configurator | (>&2 bash)
 
+        # We don't need to run yarn or npm... 
+        # ...let's skip both build steps  
+        NO_YARN=1
+        NO_NPM=1
+
         (>&2 symfony-build)
 
     deploy: |
@@ -55,6 +60,7 @@ hooks:
         (>&2 symfony-deploy)
 
         php bin/console app:load-data
+        
         # needed because StimulusBundle / asset mapper will currently
         # expect this asset mapper directory to exist at runtime
         mkdir -p var/translations


Test patch:
diff --git a/src/Turbo/tests/app/.gitignore b/src/Turbo/tests/app/.gitignore
deleted file mode 100644
index 86806e8a..00000000
--- a/src/Turbo/tests/app/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/var/
-/public/build/