1.30.2 • Published 13 days ago

art-build-configurator v1.30.2

Weekly downloads
1,492
License
ISC
Repository
github
Last release
13 days ago

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

1.30.2

13 days ago

1.30.1

3 years ago

1.30.0

3 years ago

1.29.5

3 years ago

1.29.4

3 years ago

1.29.3

3 years ago

1.29.2

3 years ago

1.29.1

3 years ago

1.29.0

3 years ago

1.28.1

3 years ago

1.28.2

3 years ago

1.28.3

3 years ago

1.28.0

4 years ago

1.26.17

4 years ago

1.26.16

4 years ago

1.26.14

4 years ago

1.26.13

4 years ago

1.26.12

4 years ago

1.26.11

4 years ago

1.26.10

4 years ago

1.26.9

4 years ago

1.26.8

5 years ago

1.26.7

5 years ago

1.26.6

5 years ago

1.26.5

5 years ago

1.26.4

5 years ago

1.26.3

5 years ago

1.26.2

5 years ago

1.26.1

5 years ago

1.25.3

5 years ago

1.25.2

5 years ago

1.25.1

5 years ago

1.25.0

5 years ago

1.24.0

5 years ago

1.23.1

5 years ago

1.23.0

5 years ago

1.21.1

5 years ago

1.19.15

5 years ago

1.19.14

5 years ago

1.19.4

5 years ago

1.19.3

5 years ago

1.18.6

6 years ago

1.18.1

6 years ago

1.18.0

6 years ago

1.16.2

6 years ago

1.17.0

6 years ago

1.16.1

6 years ago

1.16.0

6 years ago

1.15.4

6 years ago

1.15.2

6 years ago

1.15.1

7 years ago

1.15.0

7 years ago

1.14.6

7 years ago

1.14.3

7 years ago

1.14.1

7 years ago

1.14.0

7 years ago

1.13.4

7 years ago

1.11.6

7 years ago

1.11.5

7 years ago

1.11.0

7 years ago

1.10.0

7 years ago

1.9.1

7 years ago

1.9.0

7 years ago

1.8.1

7 years ago

1.8.0

7 years ago

1.7.1

7 years ago

1.6.0

7 years ago

1.3.0

7 years ago

1.1.0

7 years ago