2.0.4 • Published 2 years ago

@triviumsoftware/pack-it v2.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Chemist

Chemist is a packager that bundles source code within a standard Node.js project into a compressed file.

Build Status GitHub version NPM version License code style: prettier

Prerequisites

Ensure the following requirements are met prior to usage:

  • Node.js 14 or higher
  • Git installed

Installation

Via NPM:

npm install --save-dev @triviumsoftware/pack-it

Usage

Configuration File

Chemist looks for a config file named chemist.config.cjs in the project's root directory. The following is an example with all of the configurable settings:

module.exports = {
  name: 'chemist',
  git: {
    url: 'git@github.com:tgillus/chemist.git',
  },
  compression: {
    destination: 'dist',
    include: ['lib/**/*', 'node_modules/**/*', 'package.json'],
  },
};

Configuration Settings

SettingDescription
nameName of the project. Used in the compressed file name
git.urlRepo whose source code is cloned and compressed
compression.destinationDirectory where the compressed file is saved
compression.includeDirectories/files included in the compressed file (NOTE: valid glob patterns required)

Commands

CommandDescription
chemistBundle the project as a compressed file
chemist synthBundle the project as a compressed file
chemist downloadClone project from Git (Does not create compressed file.)
chemist disposeDelete .chemist and compression.destination directories

Synthesis

Chemist expects an NPM script named build to be defined in package.json. In other words, Chemist executes the following command to build the project:

npm run build

Chemist installs an executable named chemist. Run the following in the root of the project to bundle it as a compressed file:

npx chemist

or

npx chemist synth

NOTE: Chemist clones a fresh copy of the project's repository prior to building and bundling the project. It installs all of the project's dependencies after it's cloned in order to build the project. However, only production dependencies remain after the synth command completes.

Download

Run the following in the root of the project to download the project from git.url.

npx chemist download --branch main

The --branch flag (aliased as -b) indicates the branch to checkout once the clone from Git is complete. If the branch argument is omitted Chemist defaults to the main branch.

Disposal

Run the following in the root of the project to remove the .chemist and compression.destination directories:

npx chemist dispose

Author

Tramaine Gillus

License

Chemist is distributed under the MIT License. See the LICENSE file for more information.

2.0.3

2 years ago

2.0.2

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.6.0

2 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago