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

@10up/scripts

v1.3.4

Published

Collection of reusable scripts for 10up development.

Downloads

147

Readme

10up Scripts

A collection of bundled scripts for 10up development.

Install

npm install --save-dev @10up/scripts

Scripts

10up-scripts build

Builds CSS and JavaScript files. This uses the 10up configuration for Webpack. Check out the entry points below to see what is built.

10up-scripts start

Builds CSS and JavaScript and watches files for changes.

10up-scripts format-js

Fixes JavaScript formatting issues via ESLint with 10up configuration.

10up-scripts lint-js

Runs ESLint with 10up configuration

10up-scripts lint-style

Runs Stylelint with 10up configuration.

10up-scripts test-unit-jest

Runs Jest on current project.

10up-scripts check-engines

Verify the Node and npm satisfy minimum package.json versions.

Project is a fork of wp-scripts

Configuration and Extension

Under the hood 10up-scripts uses Webpack, Postcss, Stylelint, Jest, Babel, and Eslint. By default the package uses 10up standard configurations for all of these tools. However, configuration can be overrided or extended for each tool.

Entry points

This package uses Webpack under the hood and uses the following entry points:

{
    admin: './assets/js/admin/admin.js',
    blocks: './includes/blocks/blocks.js',
    frontend: './assets/js/frontend/frontend.js',
    shared: './assets/js/shared/shared.js',
    styleguide: './assets/js/styleguide/styleguide.js',

    'admin-style': './assets/css/admin/admin-style.css',
    'editor-style': './assets/css/frontend/editor-style.css',
    'shared-style': './assets/css/shared/shared-style.css',
    style: './assets/css/frontend/style.css',
    'styleguide-style': './assets/css/styleguide/styleguide.css'
}

To override you will need to define @10up/scripts.entry in your package.json file. For example:

{
    "@10up/scripts": {
        "entry": {
            "myEntry: ...
        }
	...
    }
}

WordPress Dependecy Extraction

10up scripts will automatically run the dependecy extraction plugin. If you don't want to run the dependecy extraction plugin you can disable it by setting a ENV var TENUP_NO_EXTERNAL or by setting the wpDependencyExternals setting to false in package.json.

{
    "@10up/scripts": {
        "entry": {
            "myEntry: ...
        },
        "wpDependencyExternals": false
	...
    }
}

Browsersync

10up Scripts starts Browsersync automatically. All you need to do is change @10up/scripts.devURL in your package.json to point to your local development URL:

{
    "@10up/scripts": {
        "devURL": "https://project.test",
	...
    }
}

Webpack

10up-scripts will use 10up standard Webpack configuration located in /config/webpack.config.js UNLESS you define a Webpack config file in your project e.g. you have a webpack.config.js in your project root. If you just need to change entry points, see the Entry Points section below.

Here's an example webpack.config.js you could add to the root of your project to extend 10up/scripts Webpack.

const defaultConfig = require('@10up/scripts/config/webpack.config');
module.exports = {
	...defaultConfig,
	myObject: {
        stuffHere: true
    }
};

ESLint

10up-scripts will use 10up standard ESLint configuration located in /config/.eslintrc.js which extends @10up/eslint-config UNLESS you define a ESLint config file in your project e.g. you have a .eslintrc.js in your project root.

Stylelint

10up-scripts will use 10up standard Stylelint configuration located in /config/stylelint.config.js which extends @10up/stylelint-config UNLESS you define a Stylelint config file in your project e.g. you have a stylelint.config.js in your project root.

PostCSS

10up-scripts will use 10up standard PostCSS configuration located in /config/postcss.config.js UNLESS you define a PostCSS config file in your project e.g. you have a postcss.config.js in your project root.

Babel

10up-scripts will use 10up standard Babel configuration of @10up/babel-preset-default UNLESS you define a Babel config file in your project e.g. you have a .babelrc in your project root.

Support Level

Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.

Like what you see?