-
Notifications
You must be signed in to change notification settings - Fork 1
thunder/thunder.github.io
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
Repository files navigation
<!doctype html> <html lang="en-US"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1" /> <meta name="generator" content="VuePress 2.0.0-rc.24" /> <style> :root { --vp-c-bg: #fff; } [data-theme='dark'] { --vp-c-bg: #1b1b1f; } html, body { background-color: var(--vp-c-bg); } </style> <script> const useChoice = localStorage.getItem('vuepress-color-scheme') const systemStatus = 'matchMedia' in window ? window.matchMedia('(prefers-color-scheme: dark)').matches : false if (useChoice === 'light') { document.documentElement.dataset.theme = 'light' } else if (useChoice === 'dark' || systemStatus) { document.documentElement.dataset.theme = 'dark' } </script> <link rel="icon" href="/thunder.svg"><title>Contribute to Thunder | Thunder</title><meta name="description" content="Thunder is a Drupal distribution for professional publishers."> <link rel="preload" href="/assets/style-73OrOom8.css" as="style"><link rel="stylesheet" href="/assets/style-73OrOom8.css"> <link rel="modulepreload" href="/assets/app-BKU_geH9.js"><link rel="modulepreload" href="/assets/contributing.html-BKXWuBO9.js"> <link rel="prefetch" href="/assets/index.html-OY0_MlDm.js" as="script"><link rel="prefetch" href="/assets/feature-overview.html-CznKXiN6.js" as="script"><link rel="prefetch" href="/assets/headless.html-CfcR5Ta_.js" as="script"><link rel="prefetch" href="/assets/setup.html-C9q4GPcR.js" as="script"><link rel="prefetch" href="/assets/testing.html-dmTF0DnK.js" as="script"><link rel="prefetch" href="/assets/varnish.html-aNSN1HVv.js" as="script"><link rel="prefetch" href="/assets/migrate-2-3.html-DgLZWvn2.js" as="script"><link rel="prefetch" href="/assets/migrate-3-6.html-D-iQIxVa.js" as="script"><link rel="prefetch" href="/assets/migrate-6-7.html-D2yzXdYy.js" as="script"><link rel="prefetch" href="/assets/migrate-7-8.html-BvqLKJZ-.js" as="script"><link rel="prefetch" href="/assets/404.html-BoqwNORI.js" as="script"> </head> <body> <div id="app"><!--[--><div class="vp-theme-container no-sidebar external-link-icon" vp-container><!--[--><header class="vp-navbar" vp-navbar><div class="vp-toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a class="route-link" href="/"><img class="vp-site-logo" src="/thunder.svg" alt="Thunder"><span class="vp-site-name vp-hide-mobile" aria-hidden="true">Thunder</span></a></span><div class="vp-navbar-items-wrapper" style=""><!--[--><!--]--><nav class="vp-navbar-items vp-hide-mobile" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/user-guide/feature-overview.html" aria-label="User Guide"><!--[--><!--[--><!--]--><!--]-->User Guide<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/developer-guide/setup.html" aria-label="Developer Guide"><!--[--><!--[--><!--]--><!--]-->Developer Guide<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/../../contributing.html" aria-label="Contribute"><!--[--><!--[--><!--]--><!--]-->Contribute<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="auto-link external-link" href="https://thunder.org" aria-label="Thunder.org" rel="noopener noreferrer" target="_blank"><!--[--><!--[--><!--]--><!--]-->Thunder.org<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="auto-link external-link" href="https://github.com/thunder/thunder-distribution" aria-label="GitHub" rel="noopener noreferrer" target="_blank"><!--[--><!--[--><!--]--><!--]-->GitHub<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button type="button" class="vp-toggle-color-mode-button" title="toggle color mode"><svg class="light-icon" viewbox="0 0 32 32" style=""><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg class="dark-icon" viewbox="0 0 32 32" style="display:none;"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><form class="search-box" role="search"><input type="search" placeholder="Search" autocomplete="off" spellcheck="false" value><!----></form></div></header><!--]--><div class="vp-sidebar-mask"></div><!--[--><aside class="vp-sidebar" vp-sidebar><nav class="vp-navbar-items" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/user-guide/feature-overview.html" aria-label="User Guide"><!--[--><!--[--><!--]--><!--]-->User Guide<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/developer-guide/setup.html" aria-label="Developer Guide"><!--[--><!--[--><!--]--><!--]-->Developer Guide<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/../../contributing.html" aria-label="Contribute"><!--[--><!--[--><!--]--><!--]-->Contribute<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="auto-link external-link" href="https://thunder.org" aria-label="Thunder.org" rel="noopener noreferrer" target="_blank"><!--[--><!--[--><!--]--><!--]-->Thunder.org<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="auto-link external-link" href="https://github.com/thunder/thunder-distribution" aria-label="GitHub" rel="noopener noreferrer" target="_blank"><!--[--><!--[--><!--]--><!--]-->GitHub<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><!----><!--[--><!--]--></aside><!--]--><!--[--><main class="vp-page"><!--[--><!--]--><div vp-content><!--[--><!--]--><div id="content"><h1 id="contribute-to-thunder" tabindex="-1"><a class="header-anchor" href="#contribute-to-thunder"><span>Contribute to Thunder</span></a></h1><p>Thunder is a "Drupal" based distribution.</p><p>We are working on GitHub and drupal.org. Issues are managed on drupal.org. That gives us the possibility to better interact with related issues. Code improvements will be managed over GitHub's PR system.</p><p>If you found an issue with Thunder, please open a <a href="https://www.drupal.org/project/issues/thunder?categories=All" target="_blank" rel="noopener noreferrer">ticket</a> on drupal.org. Please have in mind that Thunder is a collection of Drupal modules, a set of configurations, and very little custom code.</p><p>So, if you can track down an issue to a specific module, please open the ticket in the corresponding issue queue on drupal.org.</p><p>If you want to open a PR for the Thunder distribution, please make sure you created a corresponding issue on d.o. before. All created pull requests should contain a d.o. issue number in its title.</p><p>Please also note the pull request template to create better quality pull requests.</p><h2 id="setup-thunder-for-development" tabindex="-1"><a class="header-anchor" href="#setup-thunder-for-development"><span>Setup Thunder for development</span></a></h2><p>To install the Thunder Distribution for development take a look at the <a href="https://github.com/thunder/thunder-develop" target="_blank" rel="noopener noreferrer">Thunder Develop Project</a>.</p><h2 id="automated-code-checks" tabindex="-1"><a class="header-anchor" href="#automated-code-checks"><span>Automated code checks</span></a></h2><p>All Thunder pull requests are executed on <a href="https://github.com/thunder/thunder-distribution/actions" target="_blank" rel="noopener noreferrer">GitHub actions</a>. On every pull request tests will be executed (or when new commits are pushed into the pull request branch). All code will be checked against coding style.</p><p>We support some test execution options. They can be provided by pull request labels. Here is a list of supported labels:</p><ul><li><em>test-upgrade</em> - this option will execute a custom test path, where an update (including the execution of update hooks) from Thunder 2 will be tested. This option should be used in case of a pull request with update hooks or module updates.</li><li><em>test-min</em> - this option installs the pull request version of Thunder with the oldest possible dependencies and executes the test suite.</li><li><em>test-performance</em> - this option pushed the codebase to our performance testing infrastructure. A successful test-max build is required for this.</li></ul><h2 id="how-to-s" tabindex="-1"><a class="header-anchor" href="#how-to-s"><span>How-To's</span></a></h2><h3 id="update-profile-configuration" tabindex="-1"><a class="header-anchor" href="#update-profile-configuration"><span>Update profile configuration</span></a></h3><p>The Thunder distribution ships the config_profile module as a dev dependency for easier config updates. The workflow for updating config files that are shipped in the distribution should be:</p><ul><li><p>Install the latest dev version of Thunder</p></li><li><p>Enable the Config Profile module</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line">drush en config_profile</span> <span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div></li><li><p>Apply all your changes in the UI</p></li><li><p>Export your configuration</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line">drush cex</span> <span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p>The configuration is exported to the chosen config_directory and simultaneously to your profile folder.</p></li><li><p>config_profile has now copied all the config changes to the profile folder</p></li><li><p>Put all new config files to the desired folder and add track it in git</p></li><li><p>Remove all untracked files</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line"><span class="token function">git</span> clean <span class="token parameter variable">-fd</span></span> <span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div></li></ul><h3 id="writing-update-hooks" tabindex="-1"><a class="header-anchor" href="#writing-update-hooks"><span>Writing update hooks</span></a></h3><p>To support the creation of update hooks, Thunder integrated the <code>update_helper</code> module. That contains several methods to e.g. update the existing configuration or enabling modules.</p><p>Outputting results of update hook is highly recommended for that we have provided UpdateLogger, it handles the output of result properly for <code>drush</code> or UI (<code>update.php</code>) update workflow. That's why every update hook that changes something should log what is changed and was it successful or it has failed. And the last line in the update hook should be returning of UpdateLogger output. UpdateLogger service is also used by Thunder Updater and it can be retrieved from it. Here are two examples of how to get and use UpdateLogger. All text logged as INFO, will be outputted as success in <code>drush</code> output.</p><div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php"><pre><code class="language-php"><span class="line"> <span class="token comment">// Get service directly.</span></span> <span class="line"> <span class="token doc-comment comment">/** <span class="token keyword">@var</span> <span class="token class-name"><span class="token punctuation">\</span>Drupal<span class="token punctuation">\</span>update_helper<span class="token punctuation">\</span>UpdateLogger</span> <span class="token parameter">$updateLogger</span> */</span></span> <span class="line"> <span class="token variable">$updateLogger</span> <span class="token operator">=</span> <span class="token class-name class-name-fully-qualified static-context"><span class="token punctuation">\</span>Drupal</span><span class="token operator">::</span><span class="token function">service</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'update_helper.logger'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"></span> <span class="line"> <span class="token comment">// Log change success or failures.</span></span> <span class="line"> <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">...</span><span class="token punctuation">)</span> <span class="token punctuation">{</span></span> <span class="line"> <span class="token variable">$updateLogger</span><span class="token operator">-></span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'Change is successful.'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"> <span class="token punctuation">}</span></span> <span class="line"> <span class="token keyword">else</span> <span class="token punctuation">{</span></span> <span class="line"> <span class="token variable">$updateLogger</span><span class="token operator">-></span><span class="token function">warning</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'Change has failed.'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"> <span class="token punctuation">}</span></span> <span class="line"></span> <span class="line"> <span class="token comment">// At end of update hook return result of UpdateLogger::output().</span></span> <span class="line"> <span class="token keyword">return</span> <span class="token variable">$updateLogger</span><span class="token operator">-></span><span class="token function">output</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Other way to get UpdateLogger is from Update Helper Updater service.</p><div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php"><pre><code class="language-php"><span class="line"> <span class="token comment">// Get service from Thunder Updater service.</span></span> <span class="line"> <span class="token doc-comment comment">/** <span class="token keyword">@var</span> <span class="token class-name"><span class="token punctuation">\</span>Drupal<span class="token punctuation">\</span>update_helper<span class="token punctuation">\</span>Updater</span> <span class="token parameter">$updater</span> */</span></span> <span class="line"> <span class="token variable">$updater</span> <span class="token operator">=</span> <span class="token class-name class-name-fully-qualified static-context"><span class="token punctuation">\</span>Drupal</span><span class="token operator">::</span><span class="token function">service</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'update_helper.updater'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"> <span class="token variable">$updateLogger</span> <span class="token operator">=</span> <span class="token variable">$updater</span><span class="token operator">-></span><span class="token function">logger</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"></span> <span class="line"> <span class="token operator">...</span></span> <span class="line"></span> <span class="line"> <span class="token comment">// At end of update hook return result of UpdateLogger::output().</span></span> <span class="line"> <span class="token keyword">return</span> <span class="token variable">$updateLogger</span><span class="token operator">-></span><span class="token function">output</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="importing-new-configurations" tabindex="-1"><a class="header-anchor" href="#importing-new-configurations"><span>Importing new configurations</span></a></h4><p>You have to create configuration update definition file with global <code>import_configs</code> action. For example:</p><div class="language-yaml line-numbers-mode" data-highlighter="prismjs" data-ext="yml"><pre><code class="language-yaml"><span class="line"><span class="token key atrule">__global</span><span class="token punctuation">:</span></span> <span class="line"> <span class="token key atrule">import_configs</span><span class="token punctuation">:</span></span> <span class="line"> <span class="token punctuation">-</span> config.to.import</span> <span class="line"> <span class="token punctuation">-</span> config.to.import<span class="token punctuation">-</span>no2</span> <span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>After that you just have to execute configuration update. For example:</p><div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php"><pre><code class="language-php"><span class="line"> <span class="token doc-comment comment">/** <span class="token keyword">@var</span> <span class="token class-name"><span class="token punctuation">\</span>Drupal<span class="token punctuation">\</span>update_helper<span class="token punctuation">\</span>Updater</span> <span class="token parameter">$updater</span> */</span></span> <span class="line"> <span class="token variable">$updater</span> <span class="token operator">=</span> <span class="token class-name class-name-fully-qualified static-context"><span class="token punctuation">\</span>Drupal</span><span class="token operator">::</span><span class="token function">service</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'update_helper.updater'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"> <span class="token variable">$updater</span><span class="token operator">-></span><span class="token function">executeUpdate</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'thunder_article'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'thunder_update_8101'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"></span> <span class="line"> <span class="token keyword">return</span> <span class="token variable">$updater</span><span class="token operator">-></span><span class="token function">logger</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">-></span><span class="token function">output</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>This update hook will import configurations, that are in a module or profile config directory.</p><h4 id="updating-existing-configuration-with-manually-defined-configuration-changes" tabindex="-1"><a class="header-anchor" href="#updating-existing-configuration-with-manually-defined-configuration-changes"><span>Updating existing configuration (with manually defined configuration changes)</span></a></h4><p>Before Drupal\update_helper\Updater::updateConfig() updates existing configuration, it could check the current values of that config. That helps to leave the modified, existing configuration in a valid state.</p><div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php"><pre><code class="language-php"><span class="line"> <span class="token comment">// List of configurations that should be checked for existence.</span></span> <span class="line"> <span class="token variable">$expectedConfig</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'content'</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'field_url'</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span></span> <span class="line"> <span class="token string single-quoted-string">'type'</span> <span class="token operator">=></span> <span class="token string single-quoted-string">'instagram_embed'</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'weight'</span> <span class="token operator">=></span> <span class="token number">0</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'label'</span> <span class="token operator">=></span> <span class="token string single-quoted-string">'hidden'</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'settings'</span> <span class="token operator">=></span> <span class="token punctuation">[</span></span> <span class="line"> <span class="token string single-quoted-string">'width'</span> <span class="token operator">=></span> <span class="token number">241</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'height'</span> <span class="token operator">=></span> <span class="token number">313</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token punctuation">]</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'third_party_settings'</span> <span class="token operator">=></span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token punctuation">]</span><span class="token punctuation">;</span></span> <span class="line"></span> <span class="line"> <span class="token comment">// New configuration that should be applied.</span></span> <span class="line"> <span class="token variable">$newConfig</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'content'</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'thumbnail'</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span></span> <span class="line"> <span class="token string single-quoted-string">'type'</span> <span class="token operator">=></span> <span class="token string single-quoted-string">'image'</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'weight'</span> <span class="token operator">=></span> <span class="token number">0</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'region'</span> <span class="token operator">=></span> <span class="token string single-quoted-string">'content'</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'label'</span> <span class="token operator">=></span> <span class="token string single-quoted-string">'hidden'</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'settings'</span> <span class="token operator">=></span> <span class="token punctuation">[</span></span> <span class="line"> <span class="token string single-quoted-string">'image_style'</span> <span class="token operator">=></span> <span class="token string single-quoted-string">'media_thumbnail'</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'image_link'</span> <span class="token operator">=></span> <span class="token string single-quoted-string">''</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token punctuation">]</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token string single-quoted-string">'third_party_settings'</span> <span class="token operator">=></span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span></span> <span class="line"> <span class="token punctuation">]</span><span class="token punctuation">;</span></span> <span class="line"></span> <span class="line"> <span class="token doc-comment comment">/** <span class="token keyword">@var</span> <span class="token class-name"><span class="token punctuation">\</span>Drupal<span class="token punctuation">\</span>update_helper<span class="token punctuation">\</span>Updater</span> <span class="token parameter">$updater</span> */</span></span> <span class="line"> <span class="token variable">$updater</span> <span class="token operator">=</span> <span class="token class-name class-name-fully-qualified static-context"><span class="token punctuation">\</span>Drupal</span><span class="token operator">::</span><span class="token function">service</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'update_helper.updater'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"> <span class="token variable">$updater</span><span class="token operator">-></span><span class="token function">updateConfig</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'core.entity_view_display.media.instagram.thumbnail'</span><span class="token punctuation">,</span> <span class="token variable">$newConfig</span><span class="token punctuation">,</span> <span class="token variable">$expectedConfig</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span> <span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="updating-existing-configuration-with-using-of-generated-configuration-changes" tabindex="-1"><a class="header-anchor" href="#updating-existing-configuration-with-using-of-generated-configuration-changes"><span>Updating existing configuration (with using of generated configuration changes)</span></a></h4><p>With the Thunder Updater module, we have provided Drupal Console command that will generate update configuration changes (it's called configuration update definition or CUD). Configuration update definition (CUD) will be stored in <code>config/update</code> directory of the module and it can be easily executed with Thunder Updater.</p><p>Workflow to generate Thunder configuration update is following:</p><ol><li>Make a clean install of the previous version of Thunder (version for which one you want to create configuration update). For example, if you are merging changes to <code>develop</code> branch, then you should install Thunder for that branch</li><li>When Thunder is installed, make code update (with code update also configuration files will be updated, but not active configuration in the database)</li><li>Execute update hooks if it's necessary (e.g. in a case when you have a module and/or core updates in your branch)</li><li>Now is a moment to generate Thunder configuration update code. For that, we have provided the following drush command: <code>drush generate configuration-update</code>. That command should be executed and there is some information that has to be filled, like module name where all generated data will be saved (CUD file, checklist <code>update.yml</code> and update hook function). Then also information for checklist entry, like title, success message, and failure message. Command will generate CUD file and save it in <code>config/update</code> folder of the module, it will add an entry in <code>update.yml</code> file for the checklist and it will create an update hook function in <code><module_name>.install</code> file.</li><li>After the command has finished it will display what files are modified and generated. It's always good to make an additional check of generated code.</li></ol><h3 id="write-automated-tests" tabindex="-1"><a class="header-anchor" href="#write-automated-tests"><span>Write automated tests</span></a></h3><p>Thunder distribution comes with a set of Drupal tests. They can be used to validate Thunder installation or to use provided traits for your own project Drupal tests.</p><h3 id="how-to-run-the-tests" tabindex="-1"><a class="header-anchor" href="#how-to-run-the-tests"><span>How to run the tests</span></a></h3><p>Please see the official <a href="https://www.drupal.org/docs/automated-testing/phpunit-in-drupal" target="_blank" rel="noopener noreferrer">Drupal documentation</a></p><p>To speed up the test execution time, you can provide a database dump to Thunder tests:</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line"><span class="token builtin class-name">cd</span> docroot</span> <span class="line">php ./core/scripts/db-tools.php dump-database-d8-mysql <span class="token operator">|</span> <span class="token function">gzip</span> <span class="token operator">></span> thunder.sql.gz</span> <span class="line"><span class="token builtin class-name">export</span> <span class="token assign-left variable">thunderDumpFile</span><span class="token operator">=</span>/path/to/thunder.sql.gz</span> <span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="documentation" tabindex="-1"><a class="header-anchor" href="#documentation"><span>Documentation</span></a></h2><p>To help with the documentation, please run:</p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code class="language-bash"><span class="line"><span class="token function">git</span> clone [email protected]:thunder/thunder-distribution.git</span> <span class="line"><span class="token builtin class-name">cd</span> thunder-distribution</span> <span class="line">nvm use</span> <span class="line"><span class="token function">npm</span> <span class="token function">install</span></span> <span class="line"><span class="token function">npm</span> run docs:dev</span> <span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>This will serve the docs server at <a href="http://localhost:8080" target="_blank" rel="noopener noreferrer">http://localhost:8080</a>.</p></div><!--[--><!--]--></div><footer class="vp-page-meta"><div class="vp-meta-item edit-link"><a class="auto-link external-link label" href="https://github.com/thunder/thunder-distribution/edit/6.3.x/docs/contributing.md" aria-label="Edit this page" rel="noopener noreferrer" target="_blank"><!--[--><!--[--><svg class="edit-icon" viewbox="0 0 1024 1024"><g fill="currentColor"><path d="M430.818 653.65a60.46 60.46 0 0 1-50.96-93.281l71.69-114.012 7.773-10.365L816.038 80.138A60.46 60.46 0 0 1 859.225 62a60.46 60.46 0 0 1 43.186 18.138l43.186 43.186a60.46 60.46 0 0 1 0 86.373L588.879 565.55l-8.637 8.637-117.466 68.234a60.46 60.46 0 0 1-31.958 11.229z"></path><path d="M728.802 962H252.891A190.883 190.883 0 0 1 62.008 771.98V296.934a190.883 190.883 0 0 1 190.883-192.61h267.754a60.46 60.46 0 0 1 0 120.92H252.891a69.962 69.962 0 0 0-69.098 69.099V771.98a69.962 69.962 0 0 0 69.098 69.098h475.911A69.962 69.962 0 0 0 797.9 771.98V503.363a60.46 60.46 0 1 1 120.922 0V771.98A190.883 190.883 0 0 1 728.802 962z"></path></g></svg><!--]--><!--]-->Edit this page<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">Last Updated: </span><time class="meta-item-info" datetime="2025-08-28T10:13:30.000Z" data-allow-mismatch>8/28/25, 10:13 AM</time></div><!----></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div> <script type="module" src="/assets/app-BKU_geH9.js" defer></script> </body> </html>
About
No description, website, or topics provided.
Contributing
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published