Skip to content

Commit

Permalink
Rename directories from "full-site-editing*" to "editing-toolkit*" (#…
Browse files Browse the repository at this point in the history
…44501)

1. Rename the full-site-editing calypso app and directories
2. Update everything which was referencing those directories
  • Loading branch information
noahtallen committed Aug 25, 2020
1 parent f221e2a commit 720b5da
Show file tree
Hide file tree
Showing 338 changed files with 89 additions and 84 deletions.
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -77,11 +77,11 @@
/docs/coding-guidelines/typescript* @Automattic/type-review

# FSE (Full Site Editing)
/apps/full-site-editing/full-site-editing-plugin/site-editor @Automattic/cylon
/apps/full-site-editing/full-site-editing-plugin/dotcom-fse @Automattic/cylon
/apps/full-site-editing/full-site-editing-plugin/posts-list-block @Automattic/ajax
/apps/full-site-editing/full-site-editing-plugin/global-styles @Automattic/cylon @nosolosw
/apps/editing-toolkit/editing-toolkit-plugin/site-editor @Automattic/cylon
/apps/editing-toolkit/editing-toolkit-plugin/dotcom-fse @Automattic/cylon
/apps/editing-toolkit/editing-toolkit-plugin/posts-list-block @Automattic/ajax
/apps/editing-toolkit/editing-toolkit-plugin/global-styles @Automattic/cylon @nosolosw

# FSE Workflow Files
/.github/workflows/full-site-editing-plugin.yml @Automattic/cylon
/.github/workflows/editing-toolkit-plugin.yml @Automattic/cylon
/.github/workflows/send-calypso-app-build-trigger.sh @Automattic/cylon
28 changes: 14 additions & 14 deletions .github/workflows/editing-toolkit-plugin.yml
Expand Up @@ -2,7 +2,7 @@ on:
pull_request:
# only trigger this workflow if Editing Toolkit plugin files have been modified, or if packages have been updated.
paths:
- 'apps/full-site-editing/**'
- 'apps/editing-toolkit/**'

name: Editing Toolkit Plugin

Expand Down Expand Up @@ -39,13 +39,13 @@ jobs:

- name: Build JavaScript
run: yarn build
working-directory: apps/full-site-editing
working-directory: apps/editing-toolkit

- name: Upload build artifact
uses: actions/upload-artifact@v1
with:
name: editing-toolkit-build-archive
path: apps/full-site-editing/full-site-editing-plugin
path: apps/editing-toolkit/editing-toolkit-plugin

jest:
name: Run JS tests
Expand Down Expand Up @@ -74,11 +74,11 @@ jobs:
uses: actions/download-artifact@HEAD
with:
name: editing-toolkit-build-archive
path: apps/full-site-editing/full-site-editing-plugin
path: apps/editing-toolkit/editing-toolkit-plugin

- name: Test JavaScript
run: yarn run test:js
working-directory: apps/full-site-editing
working-directory: apps/editing-toolkit

mc_upload:
name: Create wpcom sync diff
Expand All @@ -96,7 +96,7 @@ jobs:
uses: actions/download-artifact@HEAD
with:
name: editing-toolkit-build-archive
path: apps/full-site-editing/full-site-editing-plugin
path: apps/editing-toolkit/editing-toolkit-plugin

- name: Send hook to Mission Control
run: .github/workflows/send-calypso-app-build-trigger.sh
Expand All @@ -114,7 +114,7 @@ jobs:
uses: actions/download-artifact@HEAD
with:
name: editing-toolkit-build-archive
path: apps/full-site-editing/full-site-editing-plugin
path: apps/editing-toolkit/editing-toolkit-plugin

- name: Composer install
uses: nick-zh/composer-php@HEAD
Expand All @@ -137,16 +137,16 @@ jobs:

- name: Setup wp-env dependencies
run: |
echo '{ "plugins": [ "./dev-plugin", "./full-site-editing-plugin", "https://downloads.wordpress.org/plugin/gutenberg.latest-stable.zip" ], "themes": [] }' > .wp-env.override.json
working-directory: apps/full-site-editing
echo '{ "plugins": [ "./dev-plugin", "./editing-toolkit-plugin", "https://downloads.wordpress.org/plugin/gutenberg.latest-stable.zip" ], "themes": [] }' > .wp-env.override.json
working-directory: apps/editing-toolkit

- name: Start wp-env
run: npx wp-env start || npx wp-env start # Retry if failed.
working-directory: apps/full-site-editing
working-directory: apps/editing-toolkit

- name: Run phpunit command
run: yarn test:php
working-directory: apps/full-site-editing
working-directory: apps/editing-toolkit

phpcs:
name: Run phpcs
Expand Down Expand Up @@ -187,10 +187,10 @@ jobs:
uses: actions/download-artifact@HEAD
with:
name: editing-toolkit-build-archive
path: apps/full-site-editing/full-site-editing-plugin
path: apps/editing-toolkit/editing-toolkit-plugin

- name: Check if newspack-blocks exists
run: test -f ./apps/full-site-editing/full-site-editing-plugin/newspack-blocks/synced-newspack-blocks/class-newspack-blocks.php
run: test -f ./apps/editing-toolkit/editing-toolkit-plugin/newspack-blocks/synced-newspack-blocks/class-newspack-blocks.php

- name: Composer install
uses: nick-zh/composer-php@HEAD
Expand All @@ -199,4 +199,4 @@ jobs:

# This will fail if the textdomain has not been changed to "full-site-editing", which indicates an issue with the sync or build scripts.
- name: Execute phpcs on newspack-blocks PHP files.
run: ./vendor/bin/phpcs --standard=apps/full-site-editing/bin/newspack-block-sync-phpcs.xml
run: ./vendor/bin/phpcs --standard=apps/editing-toolkit/bin/newspack-block-sync-phpcs.xml
2 changes: 1 addition & 1 deletion .github/workflows/send-calypso-app-build-trigger.sh
Expand Up @@ -2,7 +2,7 @@
set -Eeuo pipefail

# cd here so that the parent directories are not included in the zip file.
cd apps/full-site-editing/full-site-editing-plugin
cd apps/editing-toolkit/editing-toolkit-plugin

echo -e "Creating archive file...\n"

Expand Down
Expand Up @@ -16,7 +16,7 @@ module.exports = {
ignorePatterns: [ '**/dist/*' ],
overrides: [
{
files: [ './**/?(*.)spec.[jt]s?(x)', './full-site-editing-plugin/e2e-test-helpers/**' ],
files: [ './**/?(*.)spec.[jt]s?(x)', './editing-toolkit-plugin/e2e-test-helpers/**' ],
globals: {
page: 'readonly',
},
Expand Down
@@ -1,3 +1,5 @@
/full-site-editing-plugin/*/dist/
/full-site-editing-plugin/newspack-blocks/synced-newspack-blocks
/editing-toolkit-plugin/*/dist/
/editing-toolkit-plugin/newspack-blocks/synced-newspack-blocks
/.wp-env.override.json
9 changes: 9 additions & 0 deletions apps/editing-toolkit/.wp-env.json
@@ -0,0 +1,9 @@
{
"plugins": [ "./dev-plugin", "./editing-toolkit-plugin", "../../../gutenberg" ],
"themes": [ "../../../themes/varia", "../../../themes/maywood" ],
"port": 4013,
"testsPort": 4005,
"mappings": {
"wp-content/plugins/editing-toolkit-plugin/vendor": "../../vendor"
}
}
22 changes: 11 additions & 11 deletions apps/full-site-editing/README.md → apps/editing-toolkit/README.md
Expand Up @@ -24,7 +24,7 @@ The following items will likely not change:
- `package.json`: The package file for the editing toolkit monorepo app.
- `.wp-env.json`: Local environment configuration for the editing toolkit plugin.
- `bin/`: Scripts to assis with your local developmenet environment and testing.
- `full-site-editing-plugin/`: The root of the editing toolkit plugin.
- `editing-toolkit-plugin/`: The root of the editing toolkit plugin.
- `full-site-editing-plugin.php`: All initialization code should go here.
- `block-patterns/`: Additional block patterns for Gutenberg.
- `common/`: General functionality which doesn't fit a specific feature and is always executed.
Expand Down Expand Up @@ -56,7 +56,7 @@ import 'a8c-fse-common-data-stores';

## Build System

_Note: `cd` to `apps/full-site-editing` before running these commands_
_Note: `cd` to `apps/editing-toolkit` before running these commands_

- `yarn dev`<br>
Compiles the plugins and watches for changes.
Expand All @@ -68,11 +68,11 @@ Both these scripts will also move all source and PHP files into `/dist` in their

The entry point is:

- **Plugin**: `/full-site-editing-plugin/{{plugin-directory}}/index.js`
- **Plugin**: `/editing-toolkit-plugin/{{plugin-directory}}/index.js`

The output is:

- **Plugin**: `/full-site-editing-plugin/{{plugin-directory}}/dist`
- **Plugin**: `/editing-toolkit-plugin/{{plugin-directory}}/dist`

### Building Individual _Plugins_

Expand All @@ -91,13 +91,13 @@ For a simple Docker experience, use wp-env.

```sh
# From wp-calypso root:
./apps/full-site-editing/bin/setup-env.sh
./apps/editing-toolkit/bin/setup-env.sh
```

That script will set up the correct dependencies and install wp-env. Note that this includes `gutenberg` and `themes` directories installed next to (i.e. outside) the root calypso directory. Once the dependencies are in the correct location, make sure that they are built, and you can use `wp-env` commands to control the environment:

```sh
# All commands should be run from apps/full-site-editing,
# All commands should be run from apps/editing-toolkit,
# which is where the .wp-env.json config file is located.
wp-env start # Starts the environment on localhost:4013
Expand All @@ -114,17 +114,17 @@ Build (or `dev`) and symlink the plugin into a local WordPress install.
E.g.

```sh
cd apps/full-site-editing
cd apps/editing-toolkit
yarn build
ln -s ~/Dev/wp-calypso/apps/full-site-editing/full-site-editing-plugin/ ~/Dev/wordpress/wp-content/plugins/full-site-editing-plugin
ln -s ~/Dev/wp-calypso/apps/editing-toolkit/editing-toolkit-plugin/ ~/Dev/wordpress/wp-content/plugins/editing-toolkit-plugin
```

## Testing

The Plugin contains a suite of unit / integration tests powered by `@wordpress/scripts`.

_Run these commands from the apps/full-site-editing directory_
_Run these commands from the apps/editing-toolkit directory_

```shell
yarn test:js
Expand All @@ -142,8 +142,8 @@ yarn test:js:watch
- Make sure you're using `npx <command>` to favour the local tools over global installs. There's no harm in running `npx some-command-not-in-node_modules/.bin`
- If there's an error connecting to the docker deamon, check that `docker-machine ls` shows a running machine named 'default', and try `docker-machine start`
- If the default machine is already running (or the mysql connection is refused) you may need to re-run `eval $(docker-machine env)`
- If there are missing includes or defines from Gutenberg and/or themes, check that they're installed and up-to-date. By default, `wp-env` expects to find Gutenberg next to (outside) the top level `wp-calypso` directory, as per `./apps/full-site-editing/bin/setup-env.sh`
- You can get a lot more information by calling `wp-env` with the `--debug=true` flag, e.g. `npx wp-env --debug=true run phpunit 'phpunit -c /var/www/html/wp-content/plugins/full-site-editing-plugin/phpunit.xml.dist'`. In particular, this flag will show you where to find the docker-machine configuration file and show you where files from your local environment are being mounted into the container images. It will also show that that first `phpunit` in this example is indicating the command should be run within the `phpunit` service defined in the Docker Compose config.
- If there are missing includes or defines from Gutenberg and/or themes, check that they're installed and up-to-date. By default, `wp-env` expects to find Gutenberg next to (outside) the top level `wp-calypso` directory, as per `./apps/editing-toolkit/bin/setup-env.sh`
- You can get a lot more information by calling `wp-env` with the `--debug=true` flag, e.g. `npx wp-env --debug=true run phpunit 'phpunit -c /var/www/html/wp-content/plugins/editing-toolkit-plugin/phpunit.xml.dist'`. In particular, this flag will show you where to find the docker-machine configuration file and show you where files from your local environment are being mounted into the container images. It will also show that the first `phpunit` in this example is indicating the command should be run within the `phpunit` service defined in the Docker Compose config.

### Updating Snapshots

Expand Down
File renamed without changes.
Expand Up @@ -2,7 +2,7 @@
* Test configuration for the FSE plugin.
*
* Will match files such that:
* 1. Must be in the apps/full-site-editing/ directory
* 1. Must be in the apps/editing-toolkit/ directory
* 2. Must have .test.EXT at the end of the filename
* 3. EXT (above) must be one of js, ts, jsx, or tsx.
*
Expand All @@ -18,8 +18,8 @@
const defaults = require( '@wordpress/scripts/config/jest-unit.config.js' );
const path = require( 'path' );

// Basically, CWD, so 'apps/full-site-editing'.
// Without this, it tries to use 'apps/full-site-editing/bin'
// Basically, CWD, so 'apps/editing-toolkit'.
// Without this, it tries to use 'apps/editing-toolkit/bin'
const pluginRoot = path.resolve( './' );

const config = {
Expand All @@ -29,7 +29,7 @@ const config = {
transform: { '^.+\\.[jt]sx?$': path.join( __dirname, 'babel-transform' ) },
setupFilesAfterEnv: [
...( defaults.setupFilesAfterEnv || [] ), // extend if present
'<rootDir>/apps/full-site-editing/bin/js-unit-setup',
'<rootDir>/apps/editing-toolkit/bin/js-unit-setup',
],
};

Expand Down
File renamed without changes.
Expand Up @@ -10,5 +10,5 @@
</properties>
</rule>

<file>../full-site-editing-plugin/newspack-blocks/synced-newspack-blocks</file>
<file>../editing-toolkit-plugin/newspack-blocks/synced-newspack-blocks</file>
</ruleset>
File renamed without changes.
Expand Up @@ -50,7 +50,7 @@ nvm use
yarn

# Where the wp-env.json file lives:
cd apps/full-site-editing
cd apps/editing-toolkit
yarn build

echo -e "\nWould you like to use the development version of wp-env? You can checkout the correct Gutenberg branch and build it before continuing."
Expand Down
Expand Up @@ -51,8 +51,8 @@ then
exit 1
fi

TARGET=./full-site-editing-plugin/newspack-blocks/synced-newspack-blocks
ENTRY=./full-site-editing-plugin/newspack-blocks/index.php
TARGET=./editing-toolkit-plugin/newspack-blocks/synced-newspack-blocks
ENTRY=./editing-toolkit-plugin/newspack-blocks/index.php

if [[ ( "$MODE" != "path" ) && ( "$MODE" != "npm" ) ]];
then
Expand Down Expand Up @@ -106,7 +106,7 @@ if [ ! -d "$CODE" ] ; then
exit 1
fi

echo Syncing files to FSE…
echo Syncing files to editing toolkit plugin...

# Remove the target dir so that we start on a clean slate.
rm -rf "$TARGET"
Expand Down
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

LOCAL_PATH="./full-site-editing-plugin/"
LOCAL_PATH="./editing-toolkit-plugin/"
REMOTE_PATH="/home/wpcom/public_html/wp-content/plugins/full-site-editing-plugin/dev"
REMOTE_SSH="wpcom-sandbox"
COMMAND="rsync -ahz $LOCAL_PATH $REMOTE_SSH:$REMOTE_PATH"
Expand Down
File renamed without changes.
Expand Up @@ -23,7 +23,7 @@ function enqueue_script( $filename, $in_footer = false ) {
if ( ! file_exists( $asset_path ) ) {
throw new RuntimeException(
'Asset file not found: ' . $asset_path . '. ' .
'Please see https://github.com/Automattic/wp-calypso/blob/HEAD/apps/full-site-editing/README.md#build-system ' .
'Please see https://github.com/Automattic/wp-calypso/blob/HEAD/apps/editing-toolkit/README.md#build-system ' .
'for more information about the Full Site Editing build system.'
);
}
Expand Down
Expand Up @@ -181,7 +181,7 @@ function enqueue_coblocks_gallery_scripts() {
// This happens in the Customizer because we try very hard not to load things and we get a fatal
// https://github.com/Automattic/wp-calypso/issues/36680.
if ( ! class_exists( '\A8C\FSE\WP_Template' ) ) {
require_once __DIR__ . '/full-site-editing/templates/class-wp-template.php';
require_once __DIR__ . '/dotcom-fse/templates/class-wp-template.php';
}
$template = new WP_Template();
$header = $template->get_template_content( 'header' );
Expand Down
Expand Up @@ -4,22 +4,22 @@ This plugin creates a new sidebar for the block editor through which the users c

- [How to develop and build the plugin](#how-to-develop-and-build-the-plugin)
- [How it works and how themes can use it](#how-it-works-and-how-themes-can-use-it)
- [Fallbacks for browsers without support for CSS custom properties](#fallbacks-for-browsers-without-support-for-css-custom-properties)
- [How to add a "Theme Default" option to the font list](#how-to-add-a-theme-default-option-to-the-font-list)
- [How to use a fallback stylesheet (experimental)](#how-to-use-a-fallback-stylesheet-experimental)
* [Fallbacks for browsers without support for CSS custom properties](#fallbacks-for-browsers-without-support-for-css-custom-properties)
* [How to add a "Theme Default" option to the font list](#how-to-add-a-theme-default-option-to-the-font-list)
* [How to use a fallback stylesheet (experimental)](#how-to-use-a-fallback-stylesheet-experimental)
- [Existing hooks](#existing-hooks)
- [jetpack_global_styles_data_set_get_data filter](#jetpack_global_styles_data_set_get_data-filter)
- [jetpack_global_styles_data_set_save_data filter](#jetpack_global_styles_data_set_save_data-filter)
- [jetpack_global_styles_permission_check_additional filter](#jetpack_global_styles_permission_check_additional-filter)
- [jetpack_global_styles_settings](#jetpack_global_styles_settings)
* [jetpack_global_styles_data_set_get_data filter](#jetpack_global_styles_data_set_get_data-filter)
* [jetpack_global_styles_data_set_save_data filter](#jetpack_global_styles_data_set_save_data-filter)
* [jetpack_global_styles_permission_check_additional filter](#jetpack_global_styles_permission_check_additional-filter)
* [jetpack_global_styles_settings](#jetpack_global_styles_settings)
- [FAQ](#faq)
- [Which fonts are available?](#which-fonts-are-available)
- [What will happen when the user changes to another theme that supports GlobalStyles?](#what-will-happen-when-the-user-changes-to-another-theme-that-supports-globalstyles)
- [What will happen when the user changes to a theme that doesn't support Global Styles or the plugin is deactivated?](#what-will-happen-when-the-user-changes-to-a-theme-that-doesnt-support-global-styles-or-the-plugin-is-deactivated)
* [Which fonts are available?](#which-fonts-are-available)
* [What will happen when the user changes to another theme that supports GlobalStyles?](#what-will-happen-when-the-user-changes-to-another-theme-that-supports-globalstyles)
* [What will happen when the user changes to a theme that doesn't support Global Styles or the plugin is deactivated?](#what-will-happen-when-the-user-changes-to-a-theme-that-doesnt-support-global-styles-or-the-plugin-is-deactivated)

## How to develop and build the plugin

Refer to instructions in the top-level [Full Site Editing](https://github.com/automattic/wp-calypso/tree/HEAD/apps/full-site-editing) directory.
Refer to instructions in the top-level [Editing Toolkit](https://github.com/automattic/wp-calypso/tree/HEAD/apps/editing-toolkit) directory.

## How it works and how themes can use it

Expand Down Expand Up @@ -88,7 +88,10 @@ body {

h1 {
font-family: sans-serif; // Fallback for browsers without support.
font-family: var( --font-headings, sans-serif ); // Variable and fallback for browsers with support.
font-family: var(
--font-headings,
sans-serif
); // Variable and fallback for browsers with support.
}
```

Expand Down
Expand Up @@ -33,7 +33,7 @@ You can see that `synced-newspack-blocks` is being synced with the Newspack Bloc

Once your changes land on the Newspack side, coordinate with the team (over issues/PRs) to [make a new release](https://github.com/Automattic/newspack-blocks/releases) and once you have the release ID, you can pull the code into here.

While being in `apps/full-site-editing/` directory, you can run:
While being in `apps/editing-toolkit/` directory, you can run:

```
yarn run sync:newspack-blocks --release=1.0.0-alpha.17
Expand Down
Expand Up @@ -10,7 +10,7 @@
define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', 'dist/' );
define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );

// Autogenerated by apps/full-site-editing/bin/sync-newspack-blocks.sh.
// Autogenerated by apps/editing-toolkit/bin/sync-newspack-blocks.sh.
define( 'NEWSPACK_BLOCKS__VERSION', 'v1.7.0' );
// End autogenerated area.

Expand Down
Expand Up @@ -26,7 +26,7 @@ function _manually_load_plugin() {
update_option(
'active_plugins',
array(
'full-site-editing-plugin/full-site-editing-plugin.php',
'editing-toolkit-plugin/full-site-editing-plugin.php',
)
);
}
Expand Down

0 comments on commit 720b5da

Please sign in to comment.