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

art-build-configurator

v1.30.4

Published

Tools for configuring npm (package.json) and webpack (webpack.config.js)

Downloads

457

Readme

art-build-configurator (abc) Build Status

Tools for configuring npm (package.json) and webpack (webpack.config.js)

Initializing a new Art Suite App

NOTE: Your directory-name is used to initialize various files including package.json, so pick a good name.

# replace "my-app-name" with your appo's name
mkdir my-app-name
cd my-app-name

# create package.json forces npm to install in your directory
echo "{}" > package.json

# install & configure abc
npm install art-build-configurator
npx art-build-configurator --init app --git

# install newly configured dependencies
npm install

# start your app
npm start

Then go to: http://localhost:8080/webpack-dev-server/

Create Git Repository (highly recommended):

After you have your app initialized, create a git repository so you have a working state to roll back to as you work:

git init
git add * ".[a-zA-Z]*"
git commit -a -m 'initial checkin'

Configuring package.json

The original motivation for ABC is the problem that package.json is not code. There is no way to dynamically configure it with plain npm + node. ABC solves that. ABC's config file art.build.config.{caf/coffee/js} is evaluated before it is applied. You can execute arbitrary code to generate and return the config object.

The output package.json file is generated as follows:

  1. Extract the current version from the current package.json. This is the only thing that is persisted. Everything else is replaced.
  2. defaultPackage = ABC's default package.json
  3. One of two things can happen depending upon the type of package = ArtBuildConfig.npm || ArtBuildConfig.package (two aliases):
    • package is an object: merged it: deepMerge defaultPackage, package
    • package is a function: invoke it: package(defaultPackage)
  4. Set version to the version read in step 1
  5. Write the resulting package.json

WIP: ABC v2 >> AGC?

  • A.C.G.: @art-suite/config-generator
  • configurator: CONFIGURation generATOR

Config:

import &ArtStandardLib

loaders:
  json: (rawJsonString, generator) ->
    consistentJsonStringify deepMerge current, generator current = JSON.parse rawJsonString

# Gets applied when you run the "abc --configure" command

generators:
  ###
    An array or object
    <array>
      Elements are functions or objects
      <Functions> are invoked and passed the selected folder, fully qualified.

    <objects>
      each value, key in object
        switch value
        when value is String
          key is the filename
          value is the contents to write

        when value is Function
          key is the filename
          function is invoked and passed in the current contents of the file, if any. The return value is written fo the file.
          If there is a matching loader for the filename's extension, It is used.

        when value is Array
          key is a folder
          create the folder if it doesn't exist
          recurse with the root algorythm in this sub-folder

  ###
  package.json: ->
    description: "The best package ever!"

&ArtBuildConfigurator.loaders.json &ArtBuildConfigurator.Builder.webpack