Skip to content

Commit d5b513d

Browse files
author
ws2-release-bot
committed
Merge branch release-2.18.12 into main
1 parent ce03bbc commit d5b513d

106 files changed

Lines changed: 435 additions & 2071 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

INSTALL-INSTRUCTIONS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To avoid dependency clashes, remove the root-level composer.lock file.
2525

2626
## Temporarily remove patches
2727

28-
- The `composer.patches.json` file at the root of your repository needs to be adjusted. Compare it with the version located in `docroot/profiles/contrib/webspark/sample-webspark-dependencies/patches.webspark.json` and remove any of the items that exist in that file from the root `composer.patches.json` file.
28+
- The `composer.patches.json` file at the root of your repository needs to be adjusted. Compare it with the version located in `docroot/profiles/contrib/webspark/webspark-dependencies-source/patches.webspark.json` and remove any of the items that exist in that file from the root `composer.patches.json` file.
2929
- Then, take what is remaining, copy it, and paste it into a temporary text file.
3030
- Your root `composer.patches.json` file should basically be empty now, leaving only the following content:
3131

@@ -45,8 +45,8 @@ ddev composer require asuwebplatforms/webspark:^2.16.4 wikimedia/composer-merge-
4545

4646
## Add custom-dependencies directory (if it doesn't exist)
4747

48-
- If your repository does not already have a `custom-dependencies` directory at the root level, you will need to create it. You can do so by copying the `sample-custom-dependencies` directory from this profile and pasting it into the root of your repository. Then, rename the copied directory from `sample-custom-dependencies` to `custom-dependencies`.
49-
- If you already have a `custom-dependencies` directory, you should ensure that its contents include everything that is in the `sample-custom-dependencies` directory, making adjustments as necessary.
48+
- If your repository does not already have a `custom-dependencies` directory at the root level, you will need to create it. You can do so by copying the `custom-dependencies-source` directory from this profile and pasting it into the root of your repository. Then, rename the copied directory from `custom-dependencies-source` to `custom-dependencies`.
49+
- If you already have a `custom-dependencies` directory, you should ensure that its contents include everything that is in the `custom-dependencies-source` directory, making adjustments as necessary.
5050
- If you have a `scripts` directory in your existing `custom-dependencies` folder, please delete it.
5151
- If you have a `patches` directory in your existing `custom-dependencies` folder, you can keep it, if it has local patch files that you need for your site.
5252

@@ -55,8 +55,8 @@ For more information about the `custom-dependencies` folder and its purpose, ple
5555
## Add webspark-dependencies directory
5656

5757
- If your repository contains an `upstream-configuration` directory at the root level, you will need to delete it. This directory is no longer needed with the newly consolidated webspark profile (as of Webspark 2.16.4).
58-
- Copy the `sample-webspark-dependencies` directory from this profile and paste it into the root of your repository.
59-
- Rename the copied directory from `sample-webspark-dependencies` to `webspark-dependencies`.
58+
- Copy the `webspark-dependencies-source` directory from this profile and paste it into the root of your repository.
59+
- Rename the copied directory from `webspark-dependencies-source` to `webspark-dependencies`.
6060
- Edit the namespace declarations in the two PHP files within the `scripts` directory to be `WebsparkCustomScripts` instead of `SampleWebsparkCustomScripts` and save them.
6161

6262
For more information about the `webspark-dependencies` folder and its purpose, please refer to the README file located within that directory.

README.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,120 @@ webspark distribution.
1919
## Requirements
2020

2121
Drupal 10 or higher
22+
23+
## Dependency sync process
24+
25+
The Webspark profile is installed into many downstream repositories via Composer.
26+
A handful of files that Webspark relies on cannot live inside the profile itself —
27+
they have to exist at the **root** of the consuming repository. To deliver these files without causing merge conflicts on
28+
every upstream update, the profile ships them inside two source folders and
29+
syncs/distributes them out to the repository root automatically when you run
30+
`composer install` or `composer update`.
31+
32+
This section documents that process so developers understand what happens, why, and
33+
which files they should and should not edit.
34+
35+
### The two source folders
36+
37+
Both folders live inside the profile and are the **source of truth**. They are
38+
copied out to the repository root, where they are renamed (the `-source` suffix is
39+
dropped):
40+
41+
| Profile source folder | Root destination | How it gets there |
42+
|---------------------------------| ------------------------- | ------------------------------------------------------------ |
43+
| `webspark-dependencies-source/` | `webspark-dependencies/` | Automatically rsynced on every `composer install`/`update`. |
44+
| `custom-dependencies-source/` | `custom-dependencies/` | Copied **once** by hand during install, then owned by the site. |
45+
46+
- `webspark-dependencies/` is **upstream-owned**. It is overwritten on every Composer
47+
run, so do **not** edit anything in it at the individual site level — your changes will be lost. Upstream changes belong in
48+
`webspark-dependencies-source/`.
49+
- `custom-dependencies/` is **site-owned**. It holds your site-specific
50+
`composer.json` and `patches.custom.json` files, and is registered as a
51+
Composer `path` repository (`asu/custom-dependencies`). Manage it with
52+
`composer custom-require` / `composer custom-remove` (see
53+
`custom-dependencies/README.md`).
54+
55+
### Composer hook wiring
56+
57+
The root `composer.json` `scripts` section wires the process into Composer's
58+
lifecycle:
59+
60+
- `WebsparkCustomScripts\ComposerScripts::writeComposerPatchFile` — merges
61+
`webspark-dependencies/patches.webspark.json` (upstream) and
62+
`custom-dependencies/patches.custom.json` (site) into the root
63+
`composer.patches.json`. That root file is generated; edit the source patch
64+
files instead.
65+
- **`post-update-cmd`** runs after `composer update` and **`post-install-cmd`** runs
66+
after `composer install`. Both start by running the
67+
`docroot/profiles/contrib/webspark/sync-dependencies` script (the actual file sync,
68+
described below), then perform a couple of follow-up steps:
69+
- After an update, `ComposerScripts::postUpdate` merges the ASUAwesome and Font
70+
Awesome icon lists for the renovation theme. After an install,
71+
`ComposerScripts::buildFrontend` compiles the renovation theme's frontend assets
72+
(only in the `asufactory1` CI pipeline).
73+
- Both then recreate the SimpleSAMLphp symlinks so the library can locate its
74+
public files and configuration.
75+
76+
The two Composer script classes are autoloaded from
77+
`webspark-dependencies/scripts/ComposerScripts.php` and
78+
`CustomComposerScripts.php` via the root `composer.json` `autoload.classmap`.
79+
80+
### What `sync-dependencies` does
81+
82+
`docroot/profiles/contrib/webspark/sync-dependencies` runs on every
83+
`composer install` / `composer update`. It is **local-only**: it is skipped when
84+
`AH_SITE_ENVIRONMENT` (Acquia Cloud) or `CI` is set, because those environments
85+
already have the synced files committed to the repository.
86+
87+
When it runs locally it performs the following steps:
88+
89+
1. **Rsync the source folder.** `rsync -avq --delete` copies
90+
`webspark-dependencies-source/` to the root-level `webspark-dependencies/` directory. The `--delete` flag
91+
means `webspark-dependencies/` is a faithful mirror of the source — anything not
92+
in the source is removed.
93+
2. **Rewrite PHP namespaces.** In every synced `*.php` file the namespace
94+
`SampleWebsparkCustomScripts` is rewritten to `WebsparkCustomScripts` (the
95+
namespace the root `composer.json` autoloader expects).
96+
3. **Distribute the synced files to their final homes.** Files that were rsynced
97+
into `webspark-dependencies/scripts/` are moved to where they actually need to
98+
live for the repository to work, and the source copy under
99+
`webspark-dependencies/scripts/` is deleted after each move:
100+
101+
| Synced source file | Final destination | Behavior |
102+
| ------------------------------------------ | ------------------------------------------ | ---------------------------------------------------------------------------------------------- |
103+
| `scripts/pre-commit` | `.git/hooks/pre-commit` | Installs the hook, or merges the `asu_commit_check` function into an existing hook. |
104+
| `scripts/post-commit` | `.git/hooks/post-commit` | Installs the hook, or merges the `asu_post_commit_actions` function into an existing hook. |
105+
| `scripts/.prettierignore` | root `.prettierignore` | Copied to the repository root. |
106+
| `scripts/prettierrc.js` | root `.prettierrc.js` | Copied to the repository root. |
107+
| `scripts/.root-gitignore` | root `.gitignore` | Ensures the `/node_modules` and `!/package.json` rules exist (appends them if missing). |
108+
| `scripts/package.json` | root `package.json` | Creates the root `package.json`, or merges the `prettier` devDependency into an existing one. |
109+
110+
4. **Align `drupal/core-dev`.** `sync_core_dev` reads the installed
111+
`drupal/core-recommended` version from `composer.lock` and adds/updates a matching
112+
`drupal/core-dev` entry in the root `composer.json` `require-dev`.
113+
114+
The files that remain in `webspark-dependencies/` after distribution are the ones
115+
that are referenced in place: the Composer scripts (`scripts/ComposerScripts.php`,
116+
`scripts/CustomComposerScripts.php`, `scripts/pre-autoload-check`) and
117+
`patches.webspark.json`.
118+
119+
### What developers should / should not edit
120+
121+
- **Upstream maintainers:** make changes in `webspark-dependencies-source/`
122+
(and `custom-dependencies-source/`). These are the sources of truth that ship with
123+
the profile.
124+
- **Site developers:**
125+
- **Do not** edit `webspark-dependencies/` — it is regenerated on every Composer
126+
run.
127+
- **Do not** hand-edit the root `composer.patches.json` — it is generated by
128+
merging the two patch source files.
129+
- **Do** put site-specific dependencies and patches in `custom-dependencies/` using
130+
`composer custom-require` / `composer custom-remove`.
131+
132+
### Related documentation
133+
134+
- `INSTALL-INSTRUCTIONS.md` — For first-time setup, including the one-time copy of
135+
`custom-dependencies-source/` to root-level `custom-dependencies/` and the required root
136+
`composer.json` configuration.
137+
- `UPDATE-INSTRUCTIONS.md` — How to update an existing Webspark site.
138+
- `custom-dependencies/README.md` — For managing site-specific dependencies and patches.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"drupal/layout_builder_restrictions": "2.19.0",
4040
"drupal/layout_builder_usage_reports": "1.0.2",
4141
"drupal/layout_section_classes": "1.5.0",
42-
"drupal/linkit": "7.0.13",
42+
"drupal/linkit": "7.0.15",
4343
"drupal/maxlength": "2.1.2",
4444
"drupal/media_library_form_element": "2.1.0",
4545
"drupal/metatag": "2.2.0",
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Managing Custom Dependencies and Patches
22

3+
> 📖 This document covers managing site-specific dependencies and patches. For the
4+
> full end-to-end documentation of how Webspark syncs its root-level dependency files
5+
> (including how `custom-dependencies-source/` becomes `custom-dependencies/`), see the
6+
> "Add custom-dependencies directory (if it doesn't exist)" section of the
7+
> [`INSTALL-INSTRUCTIONS.md`](../INSTALL-INSTRUCTIONS.md) file.
8+
39
In order to provide better separation and management of custom dependencies and patches, we've introduced two new files:
410

511
- `custom-dependencies/composer.json`: For managing custom dependencies
@@ -86,4 +92,4 @@ composer update
8692

8793
### What if I don't want to use the `custom-require` or `custom-remove` commands?
8894

89-
The standard `composer require` and `composer remove` commands will still work, however we HIGHLY recommend that you try not to use them. In a future update, we may need to edit the root `composer.json` file, which puts you in danger of a nasty merge conflict.
95+
The standard `composer require` and `composer remove` commands will still work, however we HIGHLY recommend that you try not to use them. In a future update, we may need to edit the root `composer.json` file, which puts you in danger of a nasty merge conflict.
File renamed without changes.

modules/asu_brand/asu_brand.libraries.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
components-library:
2-
version: 2.18.11
2+
version: 2.18.12
33
dependencies:
44
- core/drupal
55
- core/drupalSettings
@@ -11,7 +11,7 @@ components-library:
1111
component:
1212
css/asu_brand.header.css: {}
1313
block__system_main_block:
14-
version: 2.18.11
14+
version: 2.18.12
1515
css:
1616
theme:
1717
css/asu-brand-edit-form.css: {}

modules/asu_degree_rfi/asu_degree_rfi.libraries.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
asu-degree-rfi-core:
2-
version: 2.18.11
2+
version: 2.18.12
33
dependencies:
44
- asu_react_integration/reactjs
55
- core/jquery
66
- core/drupal
77
- core/drupalSettings
88
app-rfi:
9-
version: 2.18.11
9+
version: 2.18.12
1010
dependencies:
1111
- asu_degree_rfi/asu-degree-rfi-core
1212
js:
1313
node_modules/@asu/app-rfi/dist/appRfi.umd.js: {}
1414
js/asu_degree_rfi.rfi.js: {}
1515
degree-page-core:
16-
version: 2.18.11
16+
version: 2.18.12
1717
dependencies:
1818
- asu_degree_rfi/asu-degree-rfi-core
1919
js:
2020
node_modules/@asu/app-degree-pages/dist/degreePages.umd.js: { }
2121
degree-listing-page:
22-
version: 2.18.11
22+
version: 2.18.12
2323
dependencies:
2424
- asu_degree_rfi/degree-page-core
2525
js:
2626
js/asu_degree_listing_page.js: {}
2727
program-detail-page:
28-
version: 2.18.11
28+
version: 2.18.12
2929
dependencies:
3030
- asu_degree_rfi/degree-page-core
3131
js:

modules/asu_events/asu_events.libraries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
events-component:
2-
version: 2.18.11
2+
version: 2.18.12
33
dependencies:
44
- asu_react_integration/reactjs
55
- core/jquery

modules/asu_footer/asu_footer.libraries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
footer-block:
2-
version: 2.18.11
2+
version: 2.18.12
33
dependencies:
44
- core/jquery
55
- core/drupal

0 commit comments

Comments
 (0)