Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@koober/mrm-preset

Package Overview
Dependencies
Maintainers
5
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koober/mrm-preset - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

43

bootstrap/index.js
/* eslint-disable sort-keys-fix/sort-keys-fix */
const { packageJson } = require('mrm-core');
const { packageJson, file } = require('mrm-core');
const { install } = require('../pm');

@@ -30,2 +30,3 @@ const path = require('path');

const scripts = createNPMScript();
const packageFile = packageJson({

@@ -38,16 +39,36 @@ name: path.basename(process.cwd()),

});
/**
* @param {string} configName
* @param {() => any} getDefault
*/
const setConfigDefault = (configName, getDefault) => {
const path = 'config.' + configName;
const value = packageFile.get(path);
if (value == null) {
packageFile.set(path, getDefault());
}
};
packageFile.merge({
scripts: scripts,
config: Object.assign(
{
packageManager: packageManager,
packageArchetype: packageArchetype,
mrmPreset: mrmPreset,
mrmTask: mrmTask,
},
packageFile.get('config', {})
),
scripts,
});
setConfigDefault('packageManager', () => {
if (file('yarn.lock').exists()) {
return 'yarn';
}
if (file('package-lock.json').exists()) {
return 'npm';
}
return packageManager;
});
setConfigDefault('packageArchetype', () => {
if (file('lerna.json').exists() || Boolean(packageFile.get('workspaces'))) {
return 'workspace';
}
return packageArchetype;
});
setConfigDefault('mrmPreset', () => mrmPreset);
setConfigDefault('mrmTask', () => mrmTask);
packageFile.save();

@@ -54,0 +75,0 @@ install(['mrm', mrmPreset], { dev: true, yarn: packageManager === 'yarn' });

{
"name": "@koober/mrm-preset",
"version": "1.3.1",
"version": "1.3.2",
"description": "Mrm configuration presets",

@@ -48,3 +48,3 @@ "keywords": [

},
"gitHead": "e8a700e1fb5a3f901d8add39c63394b1b79dbe28"
"gitHead": "b0cf51f18d0761e43267e654592ba178e2aaecb4"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc