1.0.12 • Published 2 years ago

merge-template v1.0.12

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
2 years ago

merge-template

Merge your project with predefined templates or customs, install dependencies and apply some codemods.

Installation

npm install merge-template -g

Usage

To use default default template and files run in your project root:

merge-template

With default template

It will:

You can skip this step with option --no-install:

merge-template --no-install

NOTE: files and directories from the template directory will override existing files.

You can skip this step with the option --no-copy-files or use your own template (see section Customization).

merge-template --no-copy-files
  • modify package.json in your project by rules specified in package-json-overrides.json.

Customization

Command line options

--template                    use template directory with package-json-overrides.json (required) and files to copy
--no-install                  skip installation step
--no-copy-files               don't copy files from template directory
--no-delete                   don't delete dependencies listed in "deleteDependencies" in package-json-overrides.json
--no-post-tasks               don't execute post tasks (section "postTasks" in package-json-overrides.json)
--ignore-files                files in template directory that should't be copied into project. Default: 'node_modules' 'build' 'dist' '.git' 'package-json-overrides.json'

You can specify your own template directory with option --template. It must include a file package-json-overrides.json.

merge-template --template /home/user/my-custom-template-directory/

Any other directories and files in this directory will be copied into your project root, overriding existing ones.

package-json-overrides.json

This file should be JSON and can contain the following sections:

  1. dependencies

    The format is the as in package.json dependencies, it will be installed or updated to specified version.

  2. devDependencies

    The format is the as in package.json devDependencies, it will be installed or updated to specified version.

  3. deleteDependencies

    Dependencies to remove. The format is the as in package.json dependencies, but versions will be ignored.

  4. mergeSections

    The value of this section will be merged into existing package.json.

  5. addSections

    The value will be added to the existing package.json, overriding existing sections.

  6. postTasks

    Shell commands to execute after other steps. Nested lists where each element is an array of form command, …args, e.g.:

"postTasks": [["npx", "@mui/codemod", "v5.0.0/preset-safe", "src"]]
1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago