Repository navigation
Tooling: Fix the test:php, php-install, lint:css and docGen npm scripts - #632
Open
huzaifaalmesbah wants to merge 2 commits into
Open
huzaifaalmesbah wants to merge 2 commits into
huzaifaalmesbah wants to merge 2 commits into
Conversation
- test:php and php-install used the phpunit and composer containers, which current versions of @wordpress/env no longer provide. Run them in tests-cli and cli instead. - lint:css linted the .ts/.tsx files in src as CSS. Lint only the .scss files, using the SCSS variant of the WordPress stylelint config. - Remove docGen, which pointed at a file that does not exist. - Split two .gitignore entries that had been merged onto one line. - Document the test and lint scripts in the README. Fixes WordPress#629.
# Conflicts: # README.md
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes the
test:php,php-install,lint:cssanddocGennpm scripts, which fail ondevelop.Why?
Fixes #629.
test:phpandphp-installuse thephpunitandcomposercontainers, which current versions of@wordpress/envno longer provide.lint:csslints the.ts/.tsxfiles in./srcas CSS and reports 38CssSyntaxErrorerrors.docGenpoints tosrc/scripts/wp-notifications.js, which doesn't exist.How?
test:php→wp-env run tests-cli --env-cwd=wp-content/plugins/wp-feature-notifications vendor/bin/phpunit. Extra PHPUnit arguments can be passed after--.php-install→wp-env run cli --env-cwd=wp-content/plugins/wp-feature-notifications composer install --ignore-platform-req=php.lint:css→wp-scripts lint-style \"src/**/*.scss\"(escaped quotes so the glob works on Windows), and the stylelint config now extends@wordpress/stylelint-config/scss.docGen..gitignore: split.phpunit.result.cacheandcghooks.lock, which had been merged onto one line, so neither was ignored.README.md: added a short "Testing and linting" section.lint:pkg-jsonandlint:md:docsare fixed separately in #631. Both PRs edit thescriptsblock inpackage.json, so whichever merges second will need a small rebase.Testing Instructions
npm installandnpx wp-env start.npm run php-install. Composer installs the dependencies in theclicontainer.npm run test:php. PHPUnit runs intests-cli(currently 62 tests, 24 skipped, no failures).npm run test:php -- --filter Test_Model_Messageto check that extra arguments are passed through.npm run lint:css. It lints only the.scssfiles and exits 0.npm run docGen. npm reports that the script is missing.Screenshots or screencast
N/A
Use of AI Tools
@wordpress/envcontainers and the SCSS stylelint config, and running each script to confirm the fix. I reviewed and tested all changes.