Skip to content

Commit

Permalink
Add support for NPM 8, 9, 10 and PNPM 8, remove support for NPM 6 (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Mar 15, 2024
1 parent af49b57 commit 7cd92e2
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 49 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ jobs:
fail-fast: false
matrix:
include:
- php-version: '8.1'
node-version: '14'
- php-version: '8.2'
node-version: '16'
npm-version: '8'
mysql-version: '5.7'
create-project: false
create-database: false
Expand All @@ -37,9 +38,9 @@ jobs:
SULU_ADMIN_EMAIL:
DATABASE_URL: "mysql://root:@127.0.0.1:3306/sulu_test?serverVersion=5.7"

- php-version: '8.2'
node-version: '16'
npm-version: '6'
- php-version: '8.3'
node-version: '18'
npm-version: '9'
mysql-version: '8.0'
create-project: true
create-database: true
Expand All @@ -55,8 +56,8 @@ jobs:
DATABASE_URL: "mysql://root:@127.0.0.1:3306/sulu_test?serverVersion=8.0"

- php-version: '8.3'
node-version: '16'
npm-version: '6'
node-version: '20'
npm-version: '10'
mysql-version: '8.0'
create-project: true
create-database: true
Expand Down Expand Up @@ -188,11 +189,11 @@ jobs:
fail-fast: false
matrix:
include:
- php-version: '8.1'
node-version: '16'
npm-version: '6'
- php-version: '8.3'
node-version: '20'
npm-version: '10'
mysql-version: '8.0'
php-extensions: 'ctype, iconv, intl, mysql, pdo_mysql, php_fileinfo, imagick'
php-extensions: 'ctype, iconv, intl, mysql, pdo_mysql, php_fileinfo, gd, sodium'
tools: 'composer:v2'

steps:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ symfony.lock

# npm
package-lock.json
pnpm-lock.yaml
bun.lockb
yarn.lock
node_modules
.yarn

# phpcs
.php_cs.cache
Expand Down
9 changes: 9 additions & 0 deletions assets/admin/.npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ engine-strict=true
# package.json. to display a helpful message instead of a confusing dependency tree error when using npm 7, we enable
# the "legacy-peer-deps" setting: https://github.com/sulu/skeleton/issues/133#issuecomment-907271497
legacy-peer-deps=true

# unfortunataly, npm >= 7 ignores dependencies of local dependencies to handle them the same way as normal
# dependencies we require to use install-links which will create a tar ball for all packages and install
# it like a normal dependency with its dependencies
install-links=true

# pnpm does not install dependencies of local dependencies correctly by default but if use the shamefully-hoist
# configuration it also installs them correctly and can so be correctly build via pnpm
shamefully-hoist=true
36 changes: 19 additions & 17 deletions assets/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
"mobx-react": "^5.0.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"sulu-admin-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/AdminBundle/Resources/js",
"sulu-audience-targeting-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/AudienceTargetingBundle/Resources/js",
"sulu-category-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/CategoryBundle/Resources/js",
"sulu-contact-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/ContactBundle/Resources/js",
"sulu-custom-url-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/CustomUrlBundle/Resources/js",
"sulu-location-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/LocationBundle/Resources/js",
"sulu-media-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/MediaBundle/Resources/js",
"sulu-page-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/PageBundle/Resources/js",
"sulu-preview-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/PreviewBundle/Resources/js",
"sulu-route-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/RouteBundle/Resources/js",
"sulu-search-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/SearchBundle/Resources/js",
"sulu-security-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/SecurityBundle/Resources/js",
"sulu-snippet-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/SnippetBundle/Resources/js",
"sulu-trash-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/TrashBundle/Resources/js",
"sulu-website-bundle": "file:node_modules/@sulu/vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/Resources/js"
"sulu-admin-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/AdminBundle/Resources/js",
"sulu-audience-targeting-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/AudienceTargetingBundle/Resources/js",
"sulu-category-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/CategoryBundle/Resources/js",
"sulu-contact-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/ContactBundle/Resources/js",
"sulu-custom-url-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/CustomUrlBundle/Resources/js",
"sulu-location-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/LocationBundle/Resources/js",
"sulu-media-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/MediaBundle/Resources/js",
"sulu-page-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/PageBundle/Resources/js",
"sulu-preview-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/PreviewBundle/Resources/js",
"sulu-route-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/RouteBundle/Resources/js",
"sulu-search-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/SearchBundle/Resources/js",
"sulu-security-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/SecurityBundle/Resources/js",
"sulu-snippet-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/SnippetBundle/Resources/js",
"sulu-trash-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/TrashBundle/Resources/js",
"sulu-website-bundle": "file:../../vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/Resources/js"
},
"devDependencies": {
"@babel/core": "^7.5.5",
Expand Down Expand Up @@ -61,7 +61,9 @@
},
"engines": {
"node": ">=14",
"npm": ">=6 <7",
"bun": "^1.0"
"yarn": "use 'npm install' instead",
"bun": "^1.0",
"pnpm": "^8.0",
"npm": "8.* || 9.* || 10.*"
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"@php -r \"file_put_contents('.env', str_replace('APP_SECRET=\\'s\\$cretf0rt3st\\'', 'APP_SECRET=' . bin2hex(random_bytes(16)), file_get_contents('.env')));\""
],
"post-create-project-cmd": [
"@php -r \"file_put_contents('.gitignore', str_replace(['composer.lock' . PHP_EOL, 'symfony.lock' . PHP_EOL, 'package-lock.json' . PHP_EOL], ['', '', ''], file_get_contents('.gitignore')));\"",
"@php -r \"file_put_contents('.gitignore', str_replace(['composer.lock' . PHP_EOL, 'symfony.lock' . PHP_EOL, 'package-lock.json' . PHP_EOL, 'yarn.lock' . PHP_EOL, 'bun.lockb' . PHP_EOL, 'pnpm-lock.yaml' . PHP_EOL], '', file_get_contents('.gitignore')));\"",
"@php bin/adminconsole sulu:admin:info --ansi"
],
"serve": [
Expand Down
9 changes: 0 additions & 9 deletions public/build/admin/main.3dc4707015aa34bdfdaf.js

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions public/build/admin/main.742901d354ad10dd2f3b.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions public/build/admin/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"main.css": "/build/admin/main.3dc4707015aa34bdfdaf.css",
"main.js": "/build/admin/main.3dc4707015aa34bdfdaf.js",
"main.css": "/build/admin/main.742901d354ad10dd2f3b.css",
"main.js": "/build/admin/main.742901d354ad10dd2f3b.js",
"fonts/fa-solid-900.svg": "/build/admin/fonts/fa-solid-900.7a8b4f130182d19a2d7c67d80c090397.svg",
"fonts/fa-brands-400.svg": "/build/admin/fonts/fa-brands-400.2f517e09eb2ca6650ff5bec5a95157ab.svg",
"fonts/fa-solid-900.eot": "/build/admin/fonts/fa-solid-900.9bbb245e67a133f6e486d8d2545e14a5.eot",
Expand Down Expand Up @@ -77,6 +77,6 @@
"images/layers.png": "/build/admin/images/layers.416d91365b44e4b4f4777663e6f009f3.png",
"images/marker-shadow.png": "/build/admin/images/marker-shadow.a0c6cc1401c107b501efee6477816891.png",
"images/checkerBackground.gif": "/build/admin/images/checkerBackground.9883f9a87851b3f982e6e6ac284c2f4e.gif",
"main.css.map": "/build/admin/main.3dc4707015aa34bdfdaf.css.map",
"main.js.map": "/build/admin/main.3dc4707015aa34bdfdaf.js.map"
"main.css.map": "/build/admin/main.742901d354ad10dd2f3b.css.map",
"main.js.map": "/build/admin/main.742901d354ad10dd2f3b.js.map"
}

0 comments on commit 7cd92e2

Please sign in to comment.