From c5a420711bb36242ca7565179f63f2a2adf59ca5 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Fri, 15 Dec 2017 09:15:20 +0100
Subject: [PATCH] fix: Revert "feat: support mergeable strings in config for
 npmrc"

This reverts commit 4f65356ba4464d1386d44c7ddc3cfe4c3e5c1072.

I will attempt to merge npmrc configs a different way, as npm itself does not support merging cascaded configs (it finds the most specific one and just uses it).
---
 lib/config/definitions.js                    |  1 -
 lib/config/index.js                          |  2 --
 test/config/__snapshots__/index.spec.js.snap |  7 -------
 test/config/index.spec.js                    | 10 ----------
 4 files changed, 20 deletions(-)

diff --git a/lib/config/definitions.js b/lib/config/definitions.js
index afc38f7069..7c80553971 100644
--- a/lib/config/definitions.js
+++ b/lib/config/definitions.js
@@ -154,7 +154,6 @@ const options = [
     description: 'String copy of npmrc file. Use \\n instead of line breaks',
     stage: 'branch',
     type: 'string',
-    mergeable: 'true',
   },
   {
     name: 'yarnrc',
diff --git a/lib/config/index.js b/lib/config/index.js
index 60ca1a110c..97c850a381 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -126,8 +126,6 @@ function mergeChildConfig(parentConfig, childConfig) {
         config[option.name] = (parentConfig[option.name] || []).concat(
           config[option.name] || []
         );
-      } else if (option.type === 'string') {
-        config[option.name] = parentConfig[option.name] + config[option.name];
       } else {
         config[option.name] = {
           ...parentConfig[option.name],
diff --git a/test/config/__snapshots__/index.spec.js.snap b/test/config/__snapshots__/index.spec.js.snap
index 56c31694d8..73df5d60dc 100644
--- a/test/config/__snapshots__/index.spec.js.snap
+++ b/test/config/__snapshots__/index.spec.js.snap
@@ -1,12 +1,5 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`config/index mergeChildConfig(parentConfig, childConfig) handles mergeable strings 1`] = `
-"_auth=abcd-abcd-abcd-abcd
-always-auth=true
-registry=some-registry
-"
-`;
-
 exports[`config/index mergeChildConfig(parentConfig, childConfig) merges 1`] = `
 Object {
   "branchName": "{{branchPrefix}}lock-file-maintenance",
diff --git a/test/config/index.spec.js b/test/config/index.spec.js
index 87ddd5924f..582a3cddd9 100644
--- a/test/config/index.spec.js
+++ b/test/config/index.spec.js
@@ -235,15 +235,5 @@ describe('config/index', () => {
       const config = configParser.mergeChildConfig(parentConfig, undefined);
       expect(config).toMatchObject(parentConfig);
     });
-    it('handles mergeable strings', () => {
-      const parentConfig = { ...defaultConfig };
-      parentConfig.npmrc = '_auth=abcd-abcd-abcd-abcd\n';
-      const childConfig = {
-        npmrc: 'always-auth=true\nregistry=some-registry\n',
-      };
-      const configParser = require('../../lib/config/index.js');
-      const config = configParser.mergeChildConfig(parentConfig, childConfig);
-      expect(config.npmrc).toMatchSnapshot();
-    });
   });
 });
-- 
GitLab