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

wp-local-build-script

v1.4.1

Published

Gulp build script used for local Wordpress environment setup.

Downloads

8

Readme

40digits Local Wordpress Setup

A build script that sets up your local dev environment faster than you can $ say -v g "Restart apache".

Things it does:

  1. Renames the theme folder to whatever the site name is, which is typically the repo slug and/or base directory name
  2. Creates a vhost file
  3. Writes an entry in your hosts file
  4. Creates a database
  5. Creates wp-config.php
  6. Restarts apache
  7. Opens url in browser (optional)

Options

Since everyone is a snowflake, here are available options for configuration and their defaults.

  • siteName: path.basename(path.join(__dirname.toString(), '..', '..')): The name of the site/repo. Defaults to the project directory name, which is normalized based on being at repo-name/node_modules/wp-local-build-script/. Adjust as needed. No spaces, please.

  • localUrl: 'l.<%= siteName %>': The url you want. This is rendered with ejs based on siteName.

  • vhostsDir: '/etc/apache2/extra/vhosts/': The directory in which to keep your vhost .conf files.

  • hostsFile: '/etc/hosts': The location of your hosts file.

  • httpPort: '80': The port number you use in your vhosts.

  • customLog: '/http-logs/<%= siteName %>.log': Log path. This is for the vhost configuration. Rendered with ejs using siteName.

  • errorLog: '/http-logs/<%= siteName %>.error.log': The path for the apache error logs. Also rendered with ejs using the siteName.

  • mysqlUser: 'root': Your MySQL username.

  • mysqlPw: '': Your MySQL password.

  • open: false: Open the newly created url in your default browser.

  • apache24: true: When using apache 2.4, you may experience a 403 when visiting the newly created url. This adds a directive to the vhosts that fixes the issue.

Instructions :rooster::dash:

  1. Create gulpfile.js in the project root
var gulp = require('gulp'),
    build = require('wp-local-build-script');

gulp.task('build', build);

Or using custom configuration. See above for a complete list of available options.

var gulp = require('gulp'),
    build = require('wp-local-build-script');

gulp.task('build', build({
  localUrl: '<%= siteName %>.dev',
  mysqlUser: 'admin',
  mysqlPw: '1234'
}));
  1. $ sudo gulp build
  2. $ say -v "Pipe Organ" "CAN YOU DIG IT?"
  3. :feelsgood:

Considerations

I've noticed that if the apache log paths don't exist, you'll get weird behavior. So make sure those are valid paths.