Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for NPM 8, 9, 10 and PNPM 8, remove support for NPM 6 #235

Merged
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'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bildschirmfoto 2024-03-15 um 10 31 41

Looks like Imagick on PHP 8.3 is not yet supported for windows.

The sodium PHP Extension seems not longer be part of setup-php of winodws. So we need to enable it.

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
Comment on lines +17 to +24
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This are the main changes required for newer NPM version and for using PNPM

88 changes: 45 additions & 43 deletions assets/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,61 @@
"watch": "webpack --mode development --watch"
},
"dependencies": {
"mobx": "^4.0.0",
"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"
"mobx": "^4.15.7",
"mobx-react": "^5.4.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"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",
"@babel/plugin-proposal-class-properties": "^7.16.5",
"@babel/plugin-proposal-decorators": "^7.4.4",
"@babel/plugin-transform-flow-strip-types": "^7.4.4",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"@ckeditor/ckeditor5-dev-utils": "^30.3.2",
"@babel/core": "^7.23.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.23.9",
"@babel/plugin-transform-flow-strip-types": "^7.23.3",
"@babel/preset-env": "^7.23.9",
"@babel/preset-react": "^7.23.3",
"@ckeditor/ckeditor5-dev-utils": "^30.5.0",
"@ckeditor/ckeditor5-theme-lark": "^34.2.0",
"autoprefixer": "^10.4.7",
"babel-loader": "^9.1.0",
"core-js": "^3.18.0",
"css-loader": "^5.2.4",
"autoprefixer": "^10.4.17",
"babel-loader": "^9.1.3",
"core-js": "^3.36.0",
"css-loader": "^5.2.7",
"css-minimizer-webpack-plugin": "^4.2.2",
"file-loader": "^6.0.0",
"glob": "^7.1.2",
"mini-css-extract-plugin": "^2.7.1",
"postcss": "^8.4.14",
"file-loader": "^6.2.0",
"glob": "^7.2.3",
"mini-css-extract-plugin": "^2.8.0",
"postcss": "^8.4.35",
"postcss-calc": "^8.2.4",
"postcss-hexrgba": "^2.1.0",
"postcss-import": "^15.0.1",
"postcss-loader": "^7.0.2",
"postcss-nested": "^6.0.0",
"postcss-import": "^15.1.0",
"postcss-loader": "^7.3.4",
"postcss-nested": "^6.0.1",
"postcss-simple-vars": "^7.0.1",
"raw-loader": "^4.0.0",
"regenerator-runtime": "^0.13.3",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.0",
"raw-loader": "^4.0.2",
"regenerator-runtime": "^0.13.11",
"webpack": "^5.90.2",
"webpack-cli": "^5.1.4",
"webpack-manifest-plugin": "^5.0.0"
},
"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
Loading