Skip to content

Commit

Permalink
Update dependencies to build on Node 20 (WordPress#2391)
Browse files Browse the repository at this point in the history
* Update dependencies to build on Node 20

* Remove duplicate wp-scripts dependency

* Fix lint errors

* Fix stylelint errors

* Try using v4 github actions
  • Loading branch information
adamwoodnz authored Apr 23, 2024
1 parent aae40cf commit 3849564
Show file tree
Hide file tree
Showing 12 changed files with 6,570 additions and 5,695 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Fetch wporg parent theme css
run: |
mkdir wp-content/themes/pub/wporg
svn export https://meta.svn.wordpress.org/sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg/css wp-content/themes/pub/wporg/css
- name: Install NodeJS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
20
3 changes: 2 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"rule-empty-line-before" : [ "always-multi-line", {
"except" : [ "first-nested", "after-single-line-comment" ]
} ],
"selector-class-pattern": null
"selector-class-pattern": null,
"value-keyword-case": [ "lower", { "camelCaseSvgKeywords": true } ]
}
}
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"license": "GPL-2.0-or-later",
"private": true,
"dependencies": {
"@wordpress/env": "4.1.3"
"@wordpress/env": "9.3.0",
"@wordpress/scripts": "27.2.0",
"@wordpress/stylelint-config": "21.34.0"
},
"workspaces": {
"packages": [
Expand All @@ -31,8 +33,5 @@
"watch:plugin": "yarn workspace wporg-learn-plugin start",
"setup:tools": "exit 0"
},
"main": "index.js",
"devDependencies": {
"@wordpress/scripts": "^19.2.2"
}
"main": "index.js"
}
2 changes: 1 addition & 1 deletion wp-content/mu-plugins/pub/locale-switcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"@wordpress/url": "^3.21.0"
},
"devDependencies": {
"@wordpress/scripts": "^19.2.2"
"@wordpress/scripts": "27.2.0"
}
}
5 changes: 2 additions & 3 deletions wp-content/plugins/wporg-learn/js/expiration-date/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ const ExpirationDate = () => {
},
} );

const {
ownerDocument,
} = pickerRef.current;
const { ownerDocument } =
pickerRef.current;
ownerDocument.activeElement.blur();
} }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { useSelect } from '@wordpress/data';

export const useIsBlockInSidebar = ( clientId, sidebarName ) => {
return useSelect( ( select ) => {
const { getBlockAttributes, getBlockName, getBlockParents } = select(
'core/block-editor'
);
const { getBlockAttributes, getBlockName, getBlockParents } =
select( 'core/block-editor' );
const parents = getBlockParents( clientId );
return parents.some( ( parent ) => {
if ( 'core/widget-area' !== getBlockName( parent ) ) {
Expand Down
2 changes: 1 addition & 1 deletion wp-content/plugins/wporg-learn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@wordpress/url": "3.19.0"
},
"devDependencies": {
"@wordpress/scripts": "^19.2.2"
"@wordpress/scripts": "27.2.0"
},
"stylelint": {
"extends": "../../../.stylelintrc"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* stylelint-disable scss/no-global-function-names */

// Base colors.
$color__wp-blue: #0073aa;
$color__green: #c7e8ca;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@import "settings/structure";
@import "settings/typography";
@import "../../pub/wporg/css/tools/breakpoint";
@import "../../pub/wporg/css/settings/_modular-scale.scss";
@import "../../pub/wporg/css/settings/modular-scale";
@import "../../pub/wporg/css/objects/buttons";
@import "objects/buttons";
@import "objects/hero";
Expand Down
4 changes: 2 additions & 2 deletions wp-content/themes/pub/wporg-learn-2020/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"devDependencies": {
"@wordpress/browserslist-config": "2.6.0",
"@wordpress/scripts": "^19.2.2",
"@wordpress/scripts": "27.2.0",
"autoprefixer": "9.6.1",
"cssnano": "4.1.10",
"grunt": "1.0.4",
Expand All @@ -36,6 +36,6 @@
},
"stylelint": {
"extends": "../../../../.stylelintrc",
"ignoreFiles": ["*/vendor/*", "**/*.css", "**/*.css.map"]
"ignoreFiles": ["*/vendor/*", "**/*.css", "**/*.css.map", "**/*.md"]
}
}
Loading

0 comments on commit 3849564

Please sign in to comment.