Skip to content

Commit d64dfa1

Browse files
authored
chore(#47): Convert to using Drupal Canvas git repo after the rename
Convert to using Drupal Canvas git repo after the rename By: cosmicdreams By: vishalkhode1 By: penyaskito
2 parents 9747bf8 + 87d749d commit d64dfa1

File tree

12 files changed

+48
-76
lines changed

12 files changed

+48
-76
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# DDEV Drupal Experience Builder Development Environment
1+
# DDEV Drupal Canvas Development Environment
22

3-
This creates and configures a DDEV project for local Drupal [Experience Builder](https://www.drupal.org/project/experience_builder) (XB) module development. Specifically, it creates a Drupal site, clones and installs the module, sets up the front-end dependencies, and provides specialized development and testing tools.
3+
This creates and configures a DDEV project for local [Drupal Canvas](https://www.drupal.org/project/canvas) module development. Specifically, it creates a Drupal site, clones and installs the module, sets up the front-end dependencies, and provides specialized development and testing tools.
44

55
> **Notice:** This add-on is experimental. See [Support & community](#support--community) below.
66
@@ -54,9 +54,9 @@ ddev xb-workspaces-dev
5454

5555
The resulting DDEV project is just like any other one. Interact with it using the [the built-in commands](https://ddev.readthedocs.io/en/stable/users/usage/commands/), e.g., `ddev launch` to browse the site.
5656

57-
The installation process clones [the Experience Builder module](https://www.drupal.org/project/experience_builder) into `web/modules/contrib/experience_builder`. Develop and contribute from either location like you would any other Git repo for a normal Drupal project.
57+
The installation process clones [the Drupal Canvas module](https://www.drupal.org/project/canvas) into `web/modules/contrib/canvas`. Develop and contribute from either location like you would any other Git repo for a normal Drupal project.
5858

59-
Any time you update the Experience Builder module or modify its front-end code, be sure to rebuild the UI app assets:
59+
Any time you update the Drupal Canvas module or modify its front-end code, be sure to rebuild the UI app assets:
6060

6161
```shell
6262
ddev xb-ui-build
@@ -68,25 +68,25 @@ When developing the React app, make sure to use the HTTPS URL of your DDEV proje
6868
ddev xb-ui-dev
6969
```
7070

71-
To completely reinstall Drupal and the Experience Builder module, run:
71+
To completely reinstall Drupal and the Drupal Canvas module, run:
7272

7373
```shell
7474
ddev xb-site-install
7575
```
7676

77-
For the full list of available Experience Builder commands, run this:
77+
For the full list of available Drupal Canvas commands, run this:
7878

7979
```shell
8080
ddev | grep xb-
8181
```
8282

8383
## Updating
8484

85-
Update the Experience Builder module clone just like you would any other Git repo. No tools are currently provided for updating Core.
85+
Update the Drupal Canvas module clone just like you would any other Git repo. No tools are currently provided for updating Core.
8686

8787
## Cypress
8888

89-
Experience Builder uses [Cypress](https://www.cypress.io/) for front-end testing. It is currently only supported on macOS.
89+
Drupal Canvas uses [Cypress](https://www.cypress.io/) for front-end testing. It is currently only supported on macOS.
9090

9191
### Setup
9292

@@ -130,9 +130,9 @@ ddev cypress component
130130

131131
## Support & community
132132

133-
- [Experience Builder](https://www.drupal.org/project/experience_builder) module
133+
- [Drupal Canvas](https://www.drupal.org/project/canvas) module
134134
- [#experience-builder](https://drupal.slack.com/archives/C072JMEPUS1) Drupal Slack channel
135-
- Background on this add-on: [DDEV support for Cypress tests [#3458369] | Drupal.org](https://www.drupal.org/project/experience_builder/issues/3458369)
135+
- Background on this add-on: [DDEV support for Cypress tests [#3458369] | Drupal.org](https://www.drupal.org/project/canvas/issues/3458369)
136136

137137
## FAQ & known issues
138138

commands/host/xb-cypress

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
cd "$(dirname "$0")" || exit 1
1414

15-
CYPRESS_BIN="$(dirname "$0")/../../../web/modules/contrib/experience_builder/ui/node_modules/.bin/cypress"
15+
CYPRESS_BIN="$(dirname "$0")/../../../web/modules/contrib/canvas/ui/node_modules/.bin/cypress"
1616

1717
# Check for the presence of Cypress.
1818
if ! command -v "$CYPRESS_BIN" &>/dev/null; then
@@ -40,7 +40,7 @@ xhost +
4040
# Runs a given Cypress command, e.g., `xb_cypress run --e2e`.
4141
function xb_cypress {
4242
ddev exec \
43-
--dir /var/www/html/web/modules/contrib/experience_builder/ui \
43+
--dir /var/www/html/web/modules/contrib/canvas/ui \
4444
"$CYPRESS_BIN $1"
4545
}
4646

commands/host/xb-setup

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
## #ddev-generated
4-
## Description: Set up the Experience Builder development environment.
4+
## Description: Set up the Canvas development environment.
55
## Usage: xb-setup
66
## Example: ddev xb-setup\nddev xb-setup --force
77
## Flags: [{"Name":"force","Shorthand":"f","Usage":"Completely reset an existing environment if present and start over"}]
@@ -28,26 +28,26 @@ while :; do
2828
done
2929

3030
# Exit early if the environment is already set up.
31-
if [ -d web/modules/contrib/experience_builder/.git ] && [ ! "$FORCE" ]; then
31+
if [ -d web/modules/contrib/canvas/.git ] && [ ! "$FORCE" ]; then
3232
GREEN="\033[0;32m"
3333
NO_COLOR="\033[0m"
34-
printf "%bThe Experience Builder development environment is already set up.%b\n" "$GREEN" "$NO_COLOR"
34+
printf "%bThe Drupal Canvas development environment is already set up.%b\n" "$GREEN" "$NO_COLOR"
3535
# shellcheck disable=SC2016
3636
echo 'Note: If the environment is broken, run `ddev xb-setup --force` to completely reset it and start over.'
37-
echo 'Warning: If you do this, you will lose any changes you have made to the Experience Builder module or your Drupal site. Back up anything you want to save.'
37+
echo 'Warning: If you do this, you will lose any changes you have made to the Drupal Canvas module or your Drupal site. Back up anything you want to save.'
3838
echo Hint: ddev xb-setup --force
3939
exit
4040
fi
4141

42-
# Remove the Experience Builder module if it's there.
43-
rm -rf web/modules/contrib/experience_builder
42+
# Remove the Drupal Canvas module if it's there.
43+
rm -rf web/modules/contrib/canvas
4444
mkdir -p web/modules/contrib
4545

46-
# Place the Experience Builder module via Git for development. Require
46+
# Place the Drupal Canvas module via Git for development. Require
4747
# it with Composer to test its composer.json and place dependencies.
4848
git clone \
49-
git@git.drupal.org:project/experience_builder.git \
50-
web/modules/contrib/experience_builder
49+
git@git.drupal.org:project/canvas.git \
50+
web/modules/contrib/canvas
5151

5252
# Allow all Composer plugins.
5353
ddev composer config \
@@ -62,16 +62,16 @@ ddev composer require \
6262
--no-interaction \
6363
drush/drush
6464

65-
# Require the Experience Builder module. Still don't install.
65+
# Require the Drupal Canvas module. Still don't install.
6666
ddev composer config \
6767
repositories.xb \
6868
path \
69-
web/modules/contrib/experience_builder
69+
web/modules/contrib/canvas
7070
ddev composer require \
7171
--no-install \
7272
--update-with-all-dependencies \
7373
--no-interaction \
74-
drupal/experience_builder
74+
drupal/canvas
7575

7676
# Require dev dependencies. NOW install.
7777
ddev composer require \
@@ -89,7 +89,7 @@ ddev composer require \
8989
printf '\n# Allow test modules and themes to be installed.\n$settings["extension_discovery_scan_tests"] = TRUE;' \
9090
>> web/sites/default/settings.ddev.php
9191

92-
# Install Drupal and enable the Experience Builder module.
92+
# Install Drupal and enable the Drupal Canvas module.
9393
ddev xb-site-install
9494

9595
# Install Drupal core NPM packages.

commands/web/xb-autosave

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
## AutocompleteTerms: ["on","off","enable","disable","toggle","status","clear"]
1111

1212
enable_autosave() {
13-
drush state:delete experience_builder.disable_auto-save
13+
drush state:delete canvas.disable_auto-save
1414
}
1515

1616
disable_autosave() {
17-
drush state:set experience_builder.disable_auto-save 1
17+
drush state:set canvas.disable_auto-save 1
1818
}
1919

2020
get_autosave_status() {
21-
[[ "$(drush state:get experience_builder.disable_auto-save)" == "1" ]] && echo "0" || echo "1"
21+
[[ "$(drush state:get canvas.disable_auto-save)" == "1" ]] && echo "0" || echo "1"
2222
}
2323

2424
clear_autosave() {
25-
drush sql:query "delete from key_value_expire where collection='tempstore.shared.experience_builder.auto_save'" > /dev/null
25+
drush sql:query "delete from key_value_expire where collection='tempstore.shared.canvas.auto_save'" > /dev/null
2626
}
2727

2828
# The default action is to enable auto-save.

commands/web/xb-eslint

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
## Flags: []
1010
## AutocompleteTerms: ["fix"]
1111

12-
cd "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/modules/contrib/experience_builder/ui" || exit 1
12+
cd "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/modules/contrib/canvas/ui" || exit 1
1313

1414
# @todo: Suppress "WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree."
15-
# @see https://www.drupal.org/project/experience_builder/issues/3485146
15+
# @see https://www.drupal.org/project/canvas/issues/3485146
1616

1717
case "$1" in
1818
"fix") npm run lint:fix ;;

commands/web/xb-phpcs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ fi
2121

2222
"../vendor/bin/$COMMAND" \
2323
-s \
24-
--standard=modules/contrib/experience_builder/phpcs.xml \
25-
--basepath=modules/contrib/experience_builder \
26-
modules/contrib/experience_builder
24+
--standard=modules/contrib/canvas/phpcs.xml \
25+
--basepath=modules/contrib/canvas \
26+
modules/contrib/canvas

commands/web/xb-phpstan

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ cd "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT" || exit 1
99

1010
../vendor/bin/phpstan \
1111
analyze \
12-
--configuration=modules/contrib/experience_builder/phpstan.neon \
12+
--configuration=modules/contrib/canvas/phpstan.neon \
1313
--memory-limit=256M \
14-
modules/contrib/experience_builder
14+
modules/contrib/canvas

commands/web/xb-phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ cd "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT" || exit 1
99

1010
../vendor/bin/phpunit \
1111
-c core/phpunit.xml.dist \
12-
modules/contrib/experience_builder/"$*"
12+
modules/contrib/canvas/"$*"

commands/web/xb-site-install

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,24 @@
11
#!/bin/bash
22

33
## #ddev-generated
4-
## Description: (Re)install Drupal and the Experience Builder module.
4+
## Description: (Re)install Drupal and the Drupal Canvas module.
55
## Example: ddev xb-site-install
66
## Aliases: site-install,si
77

88
# Install Drupal.
99
drush site:install -y \
1010
--account-name=admin \
1111
--account-pass=admin \
12-
--site-name="XB Local Dev"
12+
--site-name="Drupal Canvas Local Dev"
1313

14-
# Enable the Experience Builder module.
14+
# Enable the Canvas module.
1515
drush pm:install -y \
16-
experience_builder \
17-
xb_dev_standard \
16+
canvas \
17+
canvas_dev_mode \
1818
sdc_test_all_props
1919

2020
# Without a cache rebuild, Drupal can't find test modules, leading to a WSOD.
2121
drush cache:rebuild
2222

23-
# Create a default article.
24-
drush php:eval "(\Drupal\node\Entity\Node::create(['type' => 'article', 'title' => 'Test', 'uid' => 1]))->save();"
25-
26-
# Create a test page. Note: If any more PHP code is added here, it should be
27-
# extracted to its own file. Writing it this way is clumsy, to say the least.
28-
drush php:eval "
29-
\$alias = '/test';
30-
\$path_alias_repository = \Drupal::service('path_alias.repository');
31-
32-
// See if the test page already exists and exit if so. (Just checking for
33-
// the path alias is naive, but it will suffice for our purposes.
34-
if (\$path_alias_repository->lookupByAlias(\$alias, 'en')) {
35-
echo 'The test page already exists.' . PHP_EOL;
36-
return;
37-
}
38-
39-
// Create the xb_page entity.
40-
\Drupal::service('entity_type.manager')
41-
->getStorage('xb_page')
42-
->create([
43-
'title' => 'XB 💫',
44-
'description' => 'This is an XB page.',
45-
'path' => ['alias' => \$alias],
46-
])->save();
47-
48-
echo 'The test page has been created.' . PHP_EOL;
49-
"
50-
5123
# Display a one time login link for user ID 1.
5224
drush uli

commands/web/xb-stylelint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Flags: []
1010
## AutocompleteTerms: ["fix"]
1111

12-
UI_DIR="$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/modules/contrib/experience_builder/ui"
12+
UI_DIR="$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/modules/contrib/canvas/ui"
1313
cd "$UI_DIR" || exit 1
1414

1515
FIX_OPTION=""

0 commit comments

Comments
 (0)