Mrm Core Versions Save

Utilities to make tasks for Mrm

v2.3.0

6 years ago

New features

Add set() method to lines API:

const { lines } = require('mrm-core')
const file = lines('file name', ['default', 'values'])
file.set(['line 1', 'line 2', 'line 3'])  // Set file lines, overwrite existing
file.save()  // Save file

(#7 by @aleung)

v2.2.2

6 years ago
  • Fixed: lines add/remove TypeScript typings

v2.2.1

6 years ago
  • Fixed: Use fs-extra everywhere

v2.2.0

6 years ago
  • New API method:

    const { deleteFiles } = require('mrm-core')
    deleteFiles('file name 1') // Delete file or folder
    deleteFiles(['file name 1', 'folder name 1']) // Delete files or folders
    
  • Minor bug fixes and UI improvements.

  • Fix TypeScript typings.

v2.1.3

6 years ago
  • Fixed: Ability to pass extra data with MrmError

v2.1.2

6 years ago

v2.1.1

6 years ago
  • Fixed: Add TypeScript definitions
  • Fixed: Throw when saving template without applying

v2.1.0

6 years ago

New features

  • packageJson().removeScript() method to remove scripts from package.json:

    const { packageJson } = require('mrm-core')
    const file = packageJson({ default: 'values' })
    file.removeScript('test')  // Remove script
    file.removeScript(/^mocha|ava$/)  // Remove all scripts that match a regexp
    file.removeScript('test', /b/)  // Remove subcommands from a script: a && b -> a
    
  • uninstall() method to remove npm packages

    const { uninstall } = require('mrm-core')
    uninstall('eslint') // Uninstall from devDependencies
    uninstall(['tamia', 'lodash'], { dev: false }) // Uninstall from dependencies
    

Bug fixes

  • Fix chaining of methods in packageJson().
  • Remove empty lines when saving lines().

v2.0.0

6 years ago

Breaking change

Always use npm to install packages: do not try to use Yarn.

New feature

New API to work with package.json:

const { packageJson } = require('mrm-core')
const file = packageJson({ default: 'values' })
file.exists()  // File exists?
file.get()  // Return everything
file.getScript('test')  // Return script
file.setScript('test', 'jest')  // Replace a script with a command: a -> b
file.appendScript('test', 'jest')  // Append command to a script: a -> a && b
file.prependScript('test', 'jest')  // Prepend a script with a command: a -> b && a
file.save()  // Save file
// All methods of json() work too

Example:

packageJson()
  .appendScript('lint', 'eslint . --ext .js --fix')
  .save();

v1.1.0

7 years ago

New feature

json.set() and yaml.set() methods to overwrite the whole object instead of merging.