0.0.6 • Published 1 year ago

moyare v0.0.6

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Moyare

Monorepo YAML replacer.

Installation

npm install -g moyare

Usage

moyare

Configuration

For each project in your monorepo, a configuration file can be used. The configuration file can take multiple forms:

  • a moyare property in package.json
  • a .moyarerc file in JSON or YAML format
  • a .moyarerc.json, .moyarerc.yaml, .moyarerc.yml, .moyarerc.js, .moyarerc.ts, .moyarerc.mjs, or .moyarerc.cjs file
  • a moyarerc, moyarerc.json, moyarerc.yaml, moyarerc.yml, moyarerc.js, moyarerc.ts, moyarerc.mjs, or moyarerc.cjs file inside a .config subdirectory
  • a moyare.config.js, moyare.config.ts, moyare.config.mjs, or moyare.config.cjs file

Replacements

[
  {
    "file": "path/to/file",
    "replacements": [
      {
        "selector": "my.selector",
        "value": "${packageJson.version}"
      }
    ]
  }
]

Replacement Functions

functions are only supported in JS files.

export default [
  {
    file: "path/to/file",
    replacementFunctions: [
      ({ packageJson, json }) => {
        json.my.selector = packageJson.version;
        return json;
      },
    ],
  },
];