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

new-craft3

v1.0.7

Published

Create a new Craft 3 project and run basic installation cammands.

Downloads

10

Readme

New Craft 3

Build out the skeleton for a Craft 3 website built with Gulp, Webpack, SCSS, Vue, and EJS.

This Node module will do the following:

This generator is my personal starter for Craft 3 projects. It's opinionated and based around my preferred tools and workflow, but it's open for use and for copying/forking. It's based heavily on @nystudio107's Craft 3 scaffolding package. If you'd like to have more options, I'd recommend using nystudio107/craft or the default Craft 3 installer.

Requirements

New Craft 3 is based on a local development workflow.

It's based around using Laravel Valet for local development, so the app is set up to run a site on a Mac, at a .test tld, using a mysql-driven database at 127.0.0.1, user is root, and password is not set (set to an empty string). Technically, another local server tool could be used if it follows along with these default settings.

Here's a list of required tools used to run New Craft 3. Each tool should be updated to it's most recent version, or a relatively new, stable version.

Installation

New Craft 3 is a Node module that should be installed globally and it downloads the rest of its dependencies via npm and composer. This means that Craft 3, WB-Starter, Craft Scripts and other dependencies will be up to date every time New Craft 3 is run.

To set up New Craft 3, run npm install -g new-craft3.

Local Config

If you have some default values that you prefer to use for every website, you may create a local config file that will provide defaults to the questions asked in the beginning.

To create a local config file, copy example.new-craft3.config.json to your home folder and rename it .new-craft3.config.json.

In this file add or edit the following options:

| Option | Default | Description | | --- | --- | --- | | cpTrigger | "admin" | This replaces the path to Craft’s CP. | | dbPrefix | "craft" | Set a database prefix for if a database will include tables outside of the Craft install. | | gitUser | "" | Your GitHub username. | | gitOrg | "" | A GitHub organization name, if you plan to create sites for an organization. |

Remove any options you don’t want to create a preset for. You will still be able to overwrite any of these presets when setting up a new project.

Usage

Follow these steps to generate a new Craft 3 website:

  1. cd into your parked Valet directory
  2. Run new-craft3
  3. Enter in the required information requested by various sets of prompts. Questions are asked by different installation tools—and may change over time, but here are the basics:
  • New Craft 3
    • Asks you to name the project by providing a client code (their initials) and a machine-readable name. This creates the project folder, names the database, and names the GitHub repo. For example, providing "wb" as the client and "test" as the project name, my project folder would be created as wb-test.
    • Allows you to change the CP Trigger in Craft CMS. For example, changing this to "administrator" would mean to get to Craft's Control Panel you would visit http://wb-test.test/administrator
  • Craft 3
    • Craft's command line installer will ask you to set up Craft's database and to run the default Craft 3 setup.
    • The database questions will have answers pulled from .env.php, so most answers can be bypassed by hitting return (the first question about database drivers should be answered with "mysql").
    • You can choose to skip creating a .env file since Craft will use the .env.php file instead. Read more about how to use this in Craft3-Multi-Environment's documentation.
    • Install Craft 3 via command line

By default and when possible, command line output is suppressed, however, you can see all command output and confirmation logs by adding the --verbose option. This could be useful for debugging.

Options

Arguments that are available when running new-craft3:

| Argument | Default | Description | | --- | --- | --- | | --template | _craft3_1 | Select template to use in WB Starter setup. | | --verbose | false | Displays command confirmations and extra command line output. |

Contributing

To test locally, remove any existing versions of new-craft3, clone this repo, and run this command:

npm uninstall -g new-craft3 && npm install -g PATH_TO_LOCAL