-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #594 from alleyinteractive/feature/issue-582/fast-…
…refresh-for-package-plugin-dev Issue-582: Provide fast refresh when developing for scripts in package plugin
- Loading branch information
Showing
4 changed files
with
36 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"alley-scripts-demo-plugin": patch | ||
--- | ||
|
||
Add support and documentation for fast refresh in demo plugin" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,23 @@ | ||
# Alley Scripts Demo Plugin | ||
|
||
This is a demo plugin for Alley Scripts. It is a simple plugin that adds the | ||
components included in the Monorepo to a Gutenberg sidebar. It is not meant to | ||
This is a demo plugin for Alley Scripts. It is meant to be used in development and to | ||
demo the functionality of the packages in alley-scripts. | ||
|
||
The plugin adds components included in the Monorepo to a Gutenberg sidebar. It is not meant to | ||
be used in production. | ||
|
||
## Installation | ||
|
||
1. Clone the `alley-scripts` repository to your `plugins` directory in your local WordPress installation. | ||
2. Run `npm install` in the `alley-scripts` directory. Then run `npm run build` to build the plugin. | ||
3. Activate the plugin in your WordPress installation to see the components in the Gutenberg sidebar. | ||
|
||
## Development for block editor tools with fast refresh. | ||
To develop the plugin and see changes in real-time: | ||
1. Install the [Gutenberg plugin](https://wordpress.org/plugins/gutenberg/) in your WordPress installation. | ||
2. Ensure that `define( 'SCRIPT_DEBUG', true );` is defined in your `wp-config.php` file. | ||
1. Run `npm run start:hot` in the `alley-scripts/plugin` directory. This will start a development server and watch for changes in the block-editor-tools package files. | ||
|
||
### Testing new features in the alley scripts plugin | ||
If you want to test any new components or hooks in a block in the plugin you can scaffold a new block, entry, or slotfill in the `alley-scripts/plugin` directory. | ||
To test the new feature with fast refresh, be sure to import the scripts using a _relative path_ so that the development server can watch for changes. You may need to disable the [ESLint no relative packages rule (`import/no-relative-packages`)](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md) to allow linting to pass. Follow the instructions above to see the changes apply in real time in the editor. |
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