Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style Engine: add first draft of contributing doc #45930

Merged
merged 4 commits into from
Nov 21, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Formattings
ramonjd committed Nov 21, 2022
commit 851c4dc0900af4e5dd2cd22ce173bd3f612534ab
6 changes: 4 additions & 2 deletions packages/style-engine/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ This document contains information you might need to know when extending or debu

The Style Engine PHP and Javascript (JS) files exist inside the `style-engine` package.

In order to use the Style Engine in the Block Editor, these files must be compiled (in the case of JS) and copied to the build folder.
In order to use the Style Engine in the Block Editor, these files must be compiled (in the case of JS) and copied to the build folder.

When running the `npm run dev` script for example, webpack watches out for changes and will recompile/copy files as necessary if any changes are detected according to the rules in [packages webpack config](https://github.com/WordPress/gutenberg/tree/HEAD/tools/webpack/packages.js).
ramonjd marked this conversation as resolved.
Show resolved Hide resolved

@@ -31,7 +31,9 @@ To start the JS unit tests, run:

[PHP unit tests](https://github.com/WordPress/gutenberg/tree/HEAD/phpunit/style-engine) on the other hand are located in the `phpunit` directory.
ramonjd marked this conversation as resolved.
Show resolved Hide resolved

In order to test the latest version of the Style Engine and avoid conflicts with existing Core equivalents, all PHP unit tests call the `gutenberg_` functions and `_Gutenberg` classes. Therefore, the PHP files should be parsed and copied to the build folder before running tests. During development, this will happen as part of the `npm run dev` script. You can also trigger a build by executing `npm run build`.
In order to test the latest version of the Style Engine and avoid conflicts with existing Core equivalents, all PHP unit tests call the `gutenberg_` functions and `_Gutenberg` classes.

Therefore, Style Engine PHP source files should be parsed and copied to the build folder before running tests. During development, this will happen as part of the `npm run dev` script. You can also trigger a build by executing `npm run build`.

To start the PHP unit tests, run: