Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
.DS_Store

# IDE-specific
.phpunit.result.cachecghooks.lock
.phpunit.result.cache
cghooks.lock

# Vendor code
/node_modules/
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ You will mainly need these two commands:
`npm run build` - Transforms your code according to the configuration provided, so it’s ready for production and optimized for the best performance.
`npm run start`- Transforms your code according to the configuration provided, so it’s ready for development. The script will automatically rebuild if you make changes to the code, and you will see the build errors in the console.

### Testing and linting

With `wp-env` running:

`npm run php-install` - Installs the Composer dependencies inside `wp-env`.
`npm run test:php` - Runs the PHPUnit tests inside `wp-env`. Extra PHPUnit arguments can be passed after `--`, e.g. `npm run test:php -- --filter Test_Model_Message`.

`npm run lint:js` and `npm run lint:css` lint the JavaScript/TypeScript and SCSS source files.

## Demo notifications

To install a few demo notifications for testing purposes, you can download and install [this plugin](https://gist.github.com/jonathanbossenger/63828e3bc436021ffedced0c67dc5450).
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,19 @@
"start:storybook": "npm run start --workspace=storybook",
"build": "wp-scripts build",
"build:storybook": "npm run build --workspace=storybook",
"php-install": "wp-env run composer 'composer --ignore-platform-req=php install'",
"php-install": "wp-env run cli --env-cwd=wp-content/plugins/wp-feature-notifications composer install --ignore-platform-req=php",
"packages-update": "wp-scripts packages-update",
"check-engines": "wp-scripts check-engines",
"check-licenses": "wp-scripts check-licenses",
"format": "wp-scripts format",
"lint:css": "wp-scripts lint-style ./src",
"lint:css": "wp-scripts lint-style \"src/**/*.scss\"",
"lint:js": "wp-scripts lint-js ./src",
"lint:md:docs": "wp-scripts lint-md-docs ./src",
"lint:pkg-json": "wp-scripts lint-pkg-json ./src",
"plugin-zip": "wp-scripts plugin-zip",
"test:js": "echo \"🚧 TEST JS: WE'LL THINK ABOUT IT LATER 🚧\" && exit 0",
"test:php": "wp-env run phpunit 'phpunit --configuration=/var/www/html/wp-content/plugins/wp-feature-notifications/phpunit.xml.dist'",
"test:php": "wp-env run tests-cli --env-cwd=wp-content/plugins/wp-feature-notifications vendor/bin/phpunit",
"test": "npm run test:php && npm run test:js",
"docGen": "npx docgen src/scripts/wp-notifications.js",
"prepare": "husky"
},
"repository": {
Expand Down Expand Up @@ -84,7 +83,7 @@
"prettier": "@wordpress/prettier-config",
"stylelint": {
"extends": [
"@wordpress/stylelint-config"
"@wordpress/stylelint-config/scss"
]
}
}
Loading