Skip to content

Conversation

@nani-samireddy
Copy link
Member

@nani-samireddy nani-samireddy commented Feb 10, 2025

Description

This PR updates npm packages, scripts to use latest versions and wp-scripts for linting and bundling and adds dependent bot configuration.

Technical Details

  • Add dependent_bot.yaml to check for the packages updates monthly once for npm, composer and github-actions.
  • Update all the node packages to their latest and compatible versions.
  • Fix JS linting errors
  • Fix PHPCS error of variable undefined in comments.php
  • Update package.json with keywords, homepage, repository and bugs fields
  • Add npm i as composer post install command
  • Update npm scripts to use wp-scripts to for linting and bundling.
  • Update lint-staged configuration to lint the package.json also
  • Update eslint and stylelint configurations

Following are the list of updated/newly added npm scripts

Command Description
build:dev Sets the environment to development and runs non-dev and non-prod build tasks.
build:prod Sets the environment to production and runs non-dev and non-prod build tasks.
build:js Builds JavaScript using wp-scripts with experimental modules support.
start Starts the development server with wp-scripts and experimental modules.
lint:all Runs all linting tasks in parallel.
lint:css Lints CSS files in ./assets/src directory using wp-scripts.
lint:css:fix Lints and automatically fixes CSS files in ./assets/src directory.
lint:js Lints JavaScript files in ./assets/src directory using wp-scripts.
lint:js:fix Lints and automatically fixes JavaScript files in ./assets/src directory.
lint:js:report Lints JavaScript files and generates a JSON report of linting results.
lint:php Lints PHP files using PHP CodeSniffer (phpcs).
lint:php:fix Automatically fixes PHP files using PHP Code Beautifier (phpcbf).
lint:package-json Lints package.json while ignoring files listed in .gitignore.
lint:staged Runs linting tasks only on staged files using lint-staged.
build:pot Generates .pot files for translation using composer.
wp-env Starts and manages the local WordPress development environment (wp-env).

Steps to Test

  1. Clone the blank-theme repo into the themes folder.
  2. Open the terminal in the blank-theme folder and install the dependencies with composer install
  3. Setup the theme ( optional )
  4. Make any changes and run the above respective commands.

Fixes/Covers issue

@nani-samireddy nani-samireddy self-assigned this Feb 10, 2025
@nani-samireddy nani-samireddy marked this pull request as ready for review February 11, 2025 07:40
Copy link
Contributor

@divyarajmasani divyarajmasani left a comment

Choose a reason for hiding this comment

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

@nani-samireddy

Divid this PR into following separate PRs,

  1. Add dependabot and updates existing npm packages.
  2. Update to use wp/scripts for build and lint, ensure you remove redundant pacakages in that PR.
  3. PR fixing existing lint issues.

@nani-samireddy
Copy link
Member Author

Closing this PR as these changes have been merged into master by the following PRs
#102
#103
#104

@nani-samireddy nani-samireddy mentioned this pull request Feb 12, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants