npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

drupal-dev-mode

v1.0.5

Published

Adds a CLI script to toggle Drupal 8's 'dev mode' on/off

Downloads

11

Readme

drupal-dev-mode package

This is an attempt to be able to quickly toggle on/off Drupal 8's 'dev mode', with one command.

The command/scripts here were written to run in the context of a Drupal site running in a local Lando/Docker setup (see "Prerequisites" section below).

'dev mode' consists of:

  • enabling inclusion of a settings.local.php file into the (default) Drupal site's settings.php file (again, see "Prerequisites" below)
  • enabling Twig debugging in development.services.yml (which is enabled by inclusion of settings.local.php in settings.php)
  • enabling inclusion of Drupal cache related settings (render, page and dynamic_page_cache) to nullify caches in settings.local.php

This package provides a CLI command, toggle-dev-mode that achieves the points listed above. Running the command once will toggle 'dev mode' on. Running it a second time will toggle 'dev mode' off again.

Prerequisites

  • You will have a Drupal 8 site running locally via Lando. The Drupal install dir will be docroot, web or drupal.

  • You will need to have already created settings.local.php (from the out of the box example) and moved to the default site directory. This package does not (yet) attempt to create that file, only modify it.

  • This package should be installed in a node_modules folder that is a sibling of the Drupal install (Eg. a sibling of docroot, web or drupal).

    This should just be npm install drupal-dev-mode.

    The package assumes this location when trying to find the various files to modify when running toggle-dev-mode.

Running the toggle-dev-mode command/script

This should just be as simple as:

npx toggle-dev-mode

You can also run the script directly with:

node node_modules/drupal-dev-mode/cli.js

Output from running the command should be similar to:

~/W/xxx> npx toggle-dev-mode
Uncommenting $settings['cache']['bins']['render']
Uncommenting $settings['cache']['bins']['page']
Uncommenting $settings['cache']['bins']['dynamic_page_cache']
Updated /Users/alex/Work/xxx/docroot/sites/development.services.yml!
Updated /Users/alex/Work/xxx/docroot/sites/default/settings.local.php!
Updated /Users/alex/Work/xxx/docroot/sites/default/settings.php! (Enable settings.local.php inclusion)

You will still want to run a drush cache:rebuild (or drush cr) after running, to ensure changes take effect.