-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move test scenario for creating block to shell script
- Loading branch information
Showing
3 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# This script validates whether `npm init @wordpress/block` works properly | ||
# with the latest changes applied to the `master` branch. It purpousfuly | ||
# avoids installing `@wordpress/scripts` package from npm when scaffolding | ||
# a test block and uses the local package by executing everything from the | ||
# root of the project. | ||
|
||
# Exit if any command fails. | ||
set -e | ||
|
||
status () { | ||
echo -e "\n\033[1;34m$1\033[0m\n" | ||
} | ||
|
||
status "Scaffolding block..." | ||
rm -rf esnext-test | ||
npx wp-create-block esnext-test --no-wp-scripts | ||
cd esnext-test | ||
|
||
status "Formatting JavaScript files..." | ||
../node_modules/.bin/wp-scripts format-js | ||
|
||
status "Building block..." | ||
../node_modules/.bin/wp-scripts build | ||
|
||
status "Lintig CSS files..." | ||
../node_modules/.bin/wp-scripts lint-style | ||
|
||
status "Linting JavaScript files..." | ||
../node_modules/.bin/wp-scripts lint-js |
This file contains 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